diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
commit | eeac2329baab1fdae7cbf6c707ed2ffd8beb4c1b (patch) | |
tree | 511c2fe47f8fbb1ea90e59e7a7a7f5e3530aa9ed /app/Template/project | |
parent | 65e9e5d1bed9f88ecfd43eb2c1e780a7c22c151f (diff) |
Helpers refactoring
Diffstat (limited to 'app/Template/project')
-rw-r--r-- | app/Template/project/activity.php | 10 | ||||
-rw-r--r-- | app/Template/project/disable.php | 4 | ||||
-rw-r--r-- | app/Template/project/duplicate.php | 14 | ||||
-rw-r--r-- | app/Template/project/edit.php | 22 | ||||
-rw-r--r-- | app/Template/project/enable.php | 4 | ||||
-rw-r--r-- | app/Template/project/feed.php | 10 | ||||
-rw-r--r-- | app/Template/project/index.php | 14 | ||||
-rw-r--r-- | app/Template/project/integrations.php | 56 | ||||
-rw-r--r-- | app/Template/project/layout.php | 4 | ||||
-rw-r--r-- | app/Template/project/new.php | 14 | ||||
-rw-r--r-- | app/Template/project/remove.php | 4 | ||||
-rw-r--r-- | app/Template/project/search.php | 16 | ||||
-rw-r--r-- | app/Template/project/share.php | 10 | ||||
-rw-r--r-- | app/Template/project/show.php | 12 | ||||
-rw-r--r-- | app/Template/project/sidebar.php | 44 | ||||
-rw-r--r-- | app/Template/project/tasks.php | 8 | ||||
-rw-r--r-- | app/Template/project/users.php | 24 |
17 files changed, 135 insertions, 135 deletions
diff --git a/app/Template/project/activity.php b/app/Template/project/activity.php index 7da6be5c..1c5dcb75 100644 --- a/app/Template/project/activity.php +++ b/app/Template/project/activity.php @@ -3,22 +3,22 @@ <ul> <li> <i class="fa fa-table fa-fw"></i> - <?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-calendar fa-fw"></i> - <?= $this->a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-search fa-fw"></i> - <?= $this->a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-check-square-o fa-fw"></i> - <?= $this->a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?> </li> <?php if ($project['is_public']): ?> - <li><i class="fa fa-rss-square fa-fw"></i><?= $this->a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></li> + <li><i class="fa fa-rss-square fa-fw"></i><?= $this->url->link(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></li> <?php endif ?> </ul> </div> diff --git a/app/Template/project/disable.php b/app/Template/project/disable.php index 48a09a97..ddfcdca2 100644 --- a/app/Template/project/disable.php +++ b/app/Template/project/disable.php @@ -8,7 +8,7 @@ </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?> - <?= t('or') ?> <?= $this->a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/project/duplicate.php b/app/Template/project/duplicate.php index 7e7fd85e..8967c306 100644 --- a/app/Template/project/duplicate.php +++ b/app/Template/project/duplicate.php @@ -6,18 +6,18 @@ <p class="alert alert-info"> <?= t('Which parts of the project do you want to duplicate?') ?> </p> - <form method="post" action="<?= $this->u('project', 'duplicate', array('project_id' => $project['id'], 'duplicate' => 'yes')) ?>" autocomplete="off"> + <form method="post" action="<?= $this->url->href('project', 'duplicate', array('project_id' => $project['id'], 'duplicate' => 'yes')) ?>" autocomplete="off"> - <?= $this->formCsrf() ?> + <?= $this->form->csrf() ?> - <?= $this->formCheckbox('category', t('Categories'), 1, true) ?> - <?= $this->formCheckbox('action', t('Actions'), 1, true) ?> - <?= $this->formCheckbox('swimlane', t('Swimlanes'), 1, false) ?> - <?= $this->formCheckbox('task', t('Tasks'), 1, false) ?> + <?= $this->form->checkbox('category', t('Categories'), 1, true) ?> + <?= $this->form->checkbox('action', t('Actions'), 1, true) ?> + <?= $this->form->checkbox('swimlane', t('Swimlanes'), 1, false) ?> + <?= $this->form->checkbox('task', t('Tasks'), 1, false) ?> <div class="form-actions"> <input type="submit" value="<?= t('Duplicate') ?>" class="btn btn-red"/> - <?= t('or') ?> <?= $this->a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> </form> </div>
\ No newline at end of file diff --git a/app/Template/project/edit.php b/app/Template/project/edit.php index 8b94e378..794267f4 100644 --- a/app/Template/project/edit.php +++ b/app/Template/project/edit.php @@ -1,28 +1,28 @@ <div class="page-header"> <h2><?= t('Edit project') ?></h2> </div> -<form method="post" action="<?= $this->u('project', 'update', array('project_id' => $project['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('project', 'update', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->formCsrf() ?> - <?= $this->formHidden('id', $values) ?> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('id', $values) ?> - <?= $this->formLabel(t('Name'), 'name') ?> - <?= $this->formText('name', $values, $errors, array('required', 'maxlength="50"')) ?> + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('required', 'maxlength="50"')) ?> - <?= $this->formLabel(t('Identifier'), 'identifier') ?> - <?= $this->formText('identifier', $values, $errors, array('maxlength="50"')) ?> + <?= $this->form->label(t('Identifier'), 'identifier') ?> + <?= $this->form->text('identifier', $values, $errors, array('maxlength="50"')) ?> <p class="form-help"><?= t('The project identifier is an optional alphanumeric code used to identify your project.') ?></p> - <?php if ($this->userSession->isAdmin()): ?> - <?= $this->formCheckbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> + <?php if ($this->user->isAdmin()): ?> + <?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> <?php endif ?> - <?= $this->formLabel(t('Description'), 'description') ?> + <?= $this->form->label(t('Description'), 'description') ?> <div class="form-tabs"> <div class="write-area"> - <?= $this->formTextarea('description', $values, $errors) ?> + <?= $this->form->textarea('description', $values, $errors) ?> </div> <div class="preview-area"> <div class="markdown"></div> diff --git a/app/Template/project/enable.php b/app/Template/project/enable.php index b683ea7c..c10d2f12 100644 --- a/app/Template/project/enable.php +++ b/app/Template/project/enable.php @@ -8,7 +8,7 @@ </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?> - <?= t('or') ?> <?= $this->a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/project/feed.php b/app/Template/project/feed.php index 14427af9..2062e801 100644 --- a/app/Template/project/feed.php +++ b/app/Template/project/feed.php @@ -1,16 +1,16 @@ <?= '<?xml version="1.0" encoding="utf-8"?>' ?> <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom"> <title><?= t('%s\'s activity', $project['name']) ?></title> - <link rel="alternate" type="text/html" href="<?= $this->getCurrentBaseUrl() ?>"/> - <link rel="self" type="application/atom+xml" href="<?= $this->getCurrentBaseUrl().$this->u('project', 'feed', array('token' => $project['token'])) ?>"/> + <link rel="alternate" type="text/html" href="<?= $this->url->base() ?>"/> + <link rel="self" type="application/atom+xml" href="<?= $this->url->base().$this->url->href('project', 'feed', array('token' => $project['token'])) ?>"/> <updated><?= date(DATE_ATOM) ?></updated> - <id><?= $this->getCurrentBaseUrl() ?></id> - <icon><?= $this->getCurrentBaseUrl() ?>assets/img/favicon.png</icon> + <id><?= $this->url->base() ?></id> + <icon><?= $this->url->base() ?>assets/img/favicon.png</icon> <?php foreach ($events as $e): ?> <entry> <title type="text"><?= $e['event_title'] ?></title> - <link rel="alternate" href="<?= $this->getCurrentBaseUrl().$this->u('task', 'show', array('task_id' => $e['task_id'])) ?>"/> + <link rel="alternate" href="<?= $this->url->base().$this->url->href('task', 'show', array('task_id' => $e['task_id'])) ?>"/> <id><?= $e['id'].'-'.$e['event_name'].'-'.$e['task_id'].'-'.$e['date_creation'] ?></id> <published><?= date(DATE_ATOM, $e['date_creation']) ?></published> <updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated> diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 8d2bc30b..1080968e 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -1,10 +1,10 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->userSession->isAdmin()): ?> - <li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New project'), 'project', 'create') ?></li> + <?php if ($this->user->isAdmin()): ?> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> <?php endif ?> - <li><i class="fa fa-lock fa-fw"></i><?= $this->a(t('New private project'), 'project', 'create', array('private' => 1)) ?></li> + <li><i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?></li> </ul> </div> <section> @@ -22,7 +22,7 @@ <?php foreach ($paginator->getCollection() as $project): ?> <tr> <td> - <?= $this->a('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?> + <?= $this->url->link('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?> </td> <td> <?php if ($project['is_active']): ?> @@ -35,7 +35,7 @@ <?= $this->e($project['identifier']) ?> </td> <td> - <?= $this->a('<i class="fa fa-table"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?> + <?= $this->url->link('<i class="fa fa-table"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?> <?php if ($project['is_public']): ?> <i class="fa fa-share-alt fa-fw"></i> @@ -44,9 +44,9 @@ <i class="fa fa-lock fa-fw"></i> <?php endif ?> - <?= $this->a($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> <?php if (! empty($project['description'])): ?> - <span class="column-tooltip" title='<?= $this->e($this->markdown($project['description'])) ?>'> + <span class="column-tooltip" title='<?= $this->e($this->text->markdown($project['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> diff --git a/app/Template/project/integrations.php b/app/Template/project/integrations.php index d4fab23b..698e438c 100644 --- a/app/Template/project/integrations.php +++ b/app/Template/project/integrations.php @@ -2,53 +2,53 @@ <h2><?= t('Integration with third-party services') ?></h2> </div> -<form method="post" action="<?= $this->u('project', 'integration', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->formCsrf() ?> +<form method="post" action="<?= $this->url->href('project', 'integration', array('project_id' => $project['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> <h3><i class="fa fa-github fa-fw"></i> <?= t('Github webhooks') ?></h3> <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'github', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/> + <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().$this->url->href('webhook', 'github', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/> <p class="form-help"><a href="http://kanboard.net/documentation/github-webhooks" target="_blank"><?= t('Help on Github webhooks') ?></a></p> </div> <h3><img src="assets/img/gitlab-icon.png"/> <?= t('Gitlab webhooks') ?></h3> <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'gitlab', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/> + <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().$this->url->href('webhook', 'gitlab', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/> <p class="form-help"><a href="http://kanboard.net/documentation/gitlab-webhooks" target="_blank"><?= t('Help on Gitlab webhooks') ?></a></p> </div> <h3><i class="fa fa-bitbucket fa-fw"></i> <?= t('Bitbucket webhooks') ?></h3> <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'bitbucket', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/> + <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().$this->url->href('webhook', 'bitbucket', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/> <p class="form-help"><a href="http://kanboard.net/documentation/bitbucket-webhooks" target="_blank"><?= t('Help on Bitbucket webhooks') ?></a></p> </div> <h3><img src="assets/img/jabber-icon.png"/> <?= t('Jabber (XMPP)') ?></h3> <div class="listing"> - <?= $this->formCheckbox('jabber', t('Send notifications to Jabber'), 1, isset($values['jabber']) && $values['jabber'] == 1) ?> + <?= $this->form->checkbox('jabber', t('Send notifications to Jabber'), 1, isset($values['jabber']) && $values['jabber'] == 1) ?> - <?= $this->formLabel(t('XMPP server address'), 'jabber_server') ?> - <?= $this->formText('jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?> + <?= $this->form->label(t('XMPP server address'), 'jabber_server') ?> + <?= $this->form->text('jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?> <p class="form-help"><?= t('The server address must use this format: "tcp://hostname:5222"') ?></p> - <?= $this->formLabel(t('Jabber domain'), 'jabber_domain') ?> - <?= $this->formText('jabber_domain', $values, $errors, array('placeholder="example.com"')) ?> + <?= $this->form->label(t('Jabber domain'), 'jabber_domain') ?> + <?= $this->form->text('jabber_domain', $values, $errors, array('placeholder="example.com"')) ?> - <?= $this->formLabel(t('Username'), 'jabber_username') ?> - <?= $this->formText('jabber_username', $values, $errors) ?> + <?= $this->form->label(t('Username'), 'jabber_username') ?> + <?= $this->form->text('jabber_username', $values, $errors) ?> - <?= $this->formLabel(t('Password'), 'jabber_password') ?> - <?= $this->formPassword('jabber_password', $values, $errors) ?> + <?= $this->form->label(t('Password'), 'jabber_password') ?> + <?= $this->form->password('jabber_password', $values, $errors) ?> - <?= $this->formLabel(t('Jabber nickname'), 'jabber_nickname') ?> - <?= $this->formText('jabber_nickname', $values, $errors) ?> + <?= $this->form->label(t('Jabber nickname'), 'jabber_nickname') ?> + <?= $this->form->text('jabber_nickname', $values, $errors) ?> - <?= $this->formLabel(t('Multi-user chat room'), 'jabber_room') ?> - <?= $this->formText('jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?> + <?= $this->form->label(t('Multi-user chat room'), 'jabber_room') ?> + <?= $this->form->text('jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?> <p class="form-help"><a href="http://kanboard.net/documentation/jabber" target="_blank"><?= t('Help on Jabber integration') ?></a></p> @@ -60,16 +60,16 @@ <h3><img src="assets/img/hipchat-icon.png"/> <?= t('Hipchat') ?></h3> <div class="listing"> - <?= $this->formCheckbox('hipchat', t('Send notifications to Hipchat'), 1, isset($values['hipchat']) && $values['hipchat'] == 1) ?> + <?= $this->form->checkbox('hipchat', t('Send notifications to Hipchat'), 1, isset($values['hipchat']) && $values['hipchat'] == 1) ?> - <?= $this->formLabel(t('API URL'), 'hipchat_api_url') ?> - <?= $this->formText('hipchat_api_url', $values, $errors) ?> + <?= $this->form->label(t('API URL'), 'hipchat_api_url') ?> + <?= $this->form->text('hipchat_api_url', $values, $errors) ?> - <?= $this->formLabel(t('Room API ID or name'), 'hipchat_room_id') ?> - <?= $this->formText('hipchat_room_id', $values, $errors) ?> + <?= $this->form->label(t('Room API ID or name'), 'hipchat_room_id') ?> + <?= $this->form->text('hipchat_room_id', $values, $errors) ?> - <?= $this->formLabel(t('Room notification token'), 'hipchat_room_token') ?> - <?= $this->formText('hipchat_room_token', $values, $errors) ?> + <?= $this->form->label(t('Room notification token'), 'hipchat_room_token') ?> + <?= $this->form->text('hipchat_room_token', $values, $errors) ?> <p class="form-help"><a href="http://kanboard.net/documentation/hipchat" target="_blank"><?= t('Help on Hipchat integration') ?></a></p> @@ -81,10 +81,10 @@ <h3><i class="fa fa-slack fa-fw"></i> <?= t('Slack') ?></h3> <div class="listing"> - <?= $this->formCheckbox('slack', t('Send notifications to a Slack channel'), 1, isset($values['slack']) && $values['slack'] == 1) ?> + <?= $this->form->checkbox('slack', t('Send notifications to a Slack channel'), 1, isset($values['slack']) && $values['slack'] == 1) ?> - <?= $this->formLabel(t('Webhook URL'), 'slack_webhook_url') ?> - <?= $this->formText('slack_webhook_url', $values, $errors) ?> + <?= $this->form->label(t('Webhook URL'), 'slack_webhook_url') ?> + <?= $this->form->text('slack_webhook_url', $values, $errors) ?> <p class="form-help"><a href="http://kanboard.net/documentation/slack" target="_blank"><?= t('Help on Slack integration') ?></a></p> diff --git a/app/Template/project/layout.php b/app/Template/project/layout.php index 8cd1fd3c..f5409500 100644 --- a/app/Template/project/layout.php +++ b/app/Template/project/layout.php @@ -3,11 +3,11 @@ <ul> <li> <i class="fa fa-table fa-fw"></i> - <?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-folder fa-fw"></i> - <?= $this->a(t('All projects'), 'project', 'index') ?> + <?= $this->url->link(t('All projects'), 'project', 'index') ?> </li> </ul> </div> diff --git a/app/Template/project/new.php b/app/Template/project/new.php index b68258b4..25b70ac2 100644 --- a/app/Template/project/new.php +++ b/app/Template/project/new.php @@ -1,20 +1,20 @@ <section id="main"> <div class="page-header"> <ul> - <li><i class="fa fa-folder fa-fw"></i><?= $this->a(t('All projects'), 'project', 'index') ?></li> + <li><i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('All projects'), 'project', 'index') ?></li> </ul> </div> <section> - <form method="post" action="<?= $this->u('project', 'save') ?>" autocomplete="off"> + <form method="post" action="<?= $this->url->href('project', 'save') ?>" autocomplete="off"> - <?= $this->formCsrf() ?> - <?= $this->formHidden('is_private', $values) ?> - <?= $this->formLabel(t('Name'), 'name') ?> - <?= $this->formText('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('is_private', $values) ?> + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> <?= $this->a(t('cancel'), 'project', 'index') ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'index') ?> </div> </form> </section> diff --git a/app/Template/project/remove.php b/app/Template/project/remove.php index 0f6fec78..fa43fc78 100644 --- a/app/Template/project/remove.php +++ b/app/Template/project/remove.php @@ -8,7 +8,7 @@ </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'project', 'remove', array('project_id' => $project['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> - <?= t('or') ?> <?= $this->a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Yes'), 'project', 'remove', array('project_id' => $project['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/project/search.php b/app/Template/project/search.php index 47ba0f77..a8e387c6 100644 --- a/app/Template/project/search.php +++ b/app/Template/project/search.php @@ -3,28 +3,28 @@ <ul> <li> <i class="fa fa-table fa-fw"></i> - <?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-calendar fa-fw"></i> - <?= $this->a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-check-square-o fa-fw"></i> - <?= $this->a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-dashboard fa-fw"></i> - <?= $this->a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?> </li> </ul> </div> <section> <form method="get" action="?" autocomplete="off"> - <?= $this->formHidden('controller', $values) ?> - <?= $this->formHidden('action', $values) ?> - <?= $this->formHidden('project_id', $values) ?> - <?= $this->formText('search', $values, array(), array('autofocus', 'required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?> + <?= $this->form->hidden('controller', $values) ?> + <?= $this->form->hidden('action', $values) ?> + <?= $this->form->hidden('project_id', $values) ?> + <?= $this->form->text('search', $values, array(), array('autofocus', 'required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?> <input type="submit" value="<?= t('Search') ?>" class="btn btn-blue"/> </form> diff --git a/app/Template/project/share.php b/app/Template/project/share.php index 07f29fdc..a9146599 100644 --- a/app/Template/project/share.php +++ b/app/Template/project/share.php @@ -6,14 +6,14 @@ <div class="listing"> <ul class="no-bullet"> - <li><strong><i class="fa fa-share-alt"></i> <?= $this->a(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></strong></li> - <li><strong><i class="fa fa-rss-square"></i> <?= $this->a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></strong></li> - <li><strong><i class="fa fa-calendar"></i> <?= $this->a(t('iCal feed'), 'ical', 'project', array('token' => $project['token']), false, '', '', true) ?></strong></li> + <li><strong><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></strong></li> + <li><strong><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></strong></li> + <li><strong><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token']), false, '', '', true) ?></strong></li> </ul> </div> - <?= $this->a(t('Disable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> + <?= $this->url->link(t('Disable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> <?php else: ?> - <?= $this->a(t('Enable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?> + <?= $this->url->link(t('Enable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?> <?php endif ?> diff --git a/app/Template/project/show.php b/app/Template/project/show.php index 9c6cd1a8..9ffbd5bc 100644 --- a/app/Template/project/show.php +++ b/app/Template/project/show.php @@ -9,8 +9,8 @@ <?php endif ?> <?php if ($project['is_public']): ?> - <li><i class="fa fa-share-alt"></i> <?= $this->a(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li> - <li><i class="fa fa-rss-square"></i> <?= $this->a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></li> + <li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li> + <li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></li> <?php else: ?> <li><?= t('Public access disabled') ?></li> <?php endif ?> @@ -22,11 +22,11 @@ <?php if ($stats['nb_tasks'] > 0): ?> <?php if ($stats['nb_active_tasks'] > 0): ?> - <li><?= $this->a(t('%d tasks on the board', $stats['nb_active_tasks']), 'board', 'show', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('%d tasks on the board', $stats['nb_active_tasks']), 'board', 'show', array('project_id' => $project['id'])) ?></li> <?php endif ?> <?php if ($stats['nb_inactive_tasks'] > 0): ?> - <li><?= $this->a(t('%d closed tasks', $stats['nb_inactive_tasks']), 'project', 'tasks', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('%d closed tasks', $stats['nb_inactive_tasks']), 'project', 'tasks', array('project_id' => $project['id'])) ?></li> <?php endif ?> <li><?= t('%d tasks in total', $stats['nb_tasks']) ?></li> @@ -50,7 +50,7 @@ <td> <?= $this->e($column['title']) ?> <?php if (! empty($column['description'])): ?> - <span class="column-tooltip" title='<?= $this->e($this->markdown($column['description'])) ?>'> + <span class="column-tooltip" title='<?= $this->e($this->text->markdown($column['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> @@ -67,6 +67,6 @@ </div> <article class="markdown"> - <?= $this->markdown($project['description']) ?> + <?= $this->text->markdown($project['description']) ?> </article> <?php endif ?> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index 31e3ff04..5c7ea715 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -2,71 +2,71 @@ <h2><?= t('Actions') ?></h2> <ul> <li> - <?= $this->a(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->isManager($project['id'])): ?> + <?php if ($this->user->isManager($project['id'])): ?> <li> - <?= $this->a(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Integrations'), 'project', 'integration', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Integrations'), 'project', 'integration', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Edit board'), 'column', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Edit board'), 'column', 'index', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->userSession->isAdmin() || $project['is_private'] == 0): ?> + <?php if ($this->user->isAdmin() || $project['is_private'] == 0): ?> <li> - <?= $this->a(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?> </li> <?php endif ?> <li> - <?= $this->a(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Budget'), 'budget', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Budget'), 'budget', 'index', array('project_id' => $project['id'])) ?> </li> <li> <?php if ($project['is_active']): ?> - <?= $this->a(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?> + <?= $this->url->link(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?> <?php else: ?> - <?= $this->a(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?> + <?= $this->url->link(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?> <?php endif ?> </li> - <?php if ($this->userSession->isAdmin()): ?> + <?php if ($this->user->isAdmin()): ?> <li> - <?= $this->a(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> </li> <?php endif ?> <?php endif ?> </ul> - <?php if ($this->acl->isManagerActionAllowed($project['id'])): ?> + <?php if ($this->user->isManager($project['id'])): ?> <h2><?= t('Exports') ?></h2> <ul> <li> - <?= $this->a(t('Tasks'), 'export', 'tasks', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Tasks'), 'export', 'tasks', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Subtasks'), 'export', 'subtasks', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Subtasks'), 'export', 'subtasks', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Task transitions'), 'export', 'transitions', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Task transitions'), 'export', 'transitions', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->a(t('Daily project summary'), 'export', 'summary', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Daily project summary'), 'export', 'summary', array('project_id' => $project['id'])) ?> </li> </ul> <?php endif ?> diff --git a/app/Template/project/tasks.php b/app/Template/project/tasks.php index b22746f9..06f28061 100644 --- a/app/Template/project/tasks.php +++ b/app/Template/project/tasks.php @@ -3,19 +3,19 @@ <ul> <li> <i class="fa fa-table fa-fw"></i> - <?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-calendar fa-fw"></i> - <?= $this->a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-search fa-fw"></i> - <?= $this->a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> </li> <li> <i class="fa fa-dashboard fa-fw"></i> - <?= $this->a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?> </li> </ul> </div> diff --git a/app/Template/project/users.php b/app/Template/project/users.php index 18147340..d725a9e8 100644 --- a/app/Template/project/users.php +++ b/app/Template/project/users.php @@ -24,12 +24,12 @@ <?php if ($project['is_private'] == 0): ?> <td> <ul> - <li><?= $this->a(t('Revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?></li> + <li><?= $this->url->link(t('Revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?></li> <li> <?php if (isset($users['managers'][$user_id])): ?> - <?= $this->a(t('Set project member'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> + <?= $this->url->link(t('Set project member'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> <?php else: ?> - <?= $this->a(t('Set project manager'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> + <?= $this->url->link(t('Set project manager'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> <?php endif ?> </li> </ul> @@ -42,14 +42,14 @@ <?php if ($project['is_private'] == 0 && ! empty($users['not_allowed'])): ?> <hr/> - <form method="post" action="<?= $this->u('project', 'allow', array('project_id' => $project['id'])) ?>" autocomplete="off"> + <form method="post" action="<?= $this->url->href('project', 'allow', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->formCsrf() ?> + <?= $this->form->csrf() ?> - <?= $this->formHidden('project_id', array('project_id' => $project['id'])) ?> + <?= $this->form->hidden('project_id', array('project_id' => $project['id'])) ?> - <?= $this->formLabel(t('User'), 'user_id') ?> - <?= $this->formSelect('user_id', $users['not_allowed'], array(), array(), array('data-notfound="'.t('No results match:').'"'), 'chosen-select') ?><br/> + <?= $this->form->label(t('User'), 'user_id') ?> + <?= $this->form->select('user_id', $users['not_allowed'], array(), array(), array('data-notfound="'.t('No results match:').'"'), 'chosen-select') ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/> @@ -61,11 +61,11 @@ <?php if ($project['is_private'] == 0): ?> <hr/> -<form method="post" action="<?= $this->u('project', 'allowEverybody', array('project_id' => $project['id'])) ?>"> - <?= $this->formCsrf() ?> +<form method="post" action="<?= $this->url->href('project', 'allowEverybody', array('project_id' => $project['id'])) ?>"> + <?= $this->form->csrf() ?> - <?= $this->formHidden('id', array('id' => $project['id'])) ?> - <?= $this->formCheckbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?> + <?= $this->form->hidden('id', array('id' => $project['id'])) ?> + <?= $this->form->checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> |