diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-12-28 11:28:50 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-12-28 11:28:50 -0500 |
commit | 34d7450d3c13342715e90ec21bceaa13e1baa876 (patch) | |
tree | a2d8f2f22ad3fe9b56f01fe2db0357f9b963e660 /app/Template/task | |
parent | 88d84073aecbe8bdc5f10825b6d7ca6b81c5f7b1 (diff) |
Template helpers refactoring
Diffstat (limited to 'app/Template/task')
-rw-r--r-- | app/Template/task/close.php | 6 | ||||
-rw-r--r-- | app/Template/task/comments.php | 6 | ||||
-rw-r--r-- | app/Template/task/details.php | 14 | ||||
-rw-r--r-- | app/Template/task/duplicate.php | 4 | ||||
-rw-r--r-- | app/Template/task/duplicate_project.php | 12 | ||||
-rw-r--r-- | app/Template/task/edit.php | 40 | ||||
-rw-r--r-- | app/Template/task/edit_description.php | 12 | ||||
-rw-r--r-- | app/Template/task/layout.php | 4 | ||||
-rw-r--r-- | app/Template/task/move_project.php | 12 | ||||
-rw-r--r-- | app/Template/task/new.php | 50 | ||||
-rw-r--r-- | app/Template/task/open.php | 6 | ||||
-rw-r--r-- | app/Template/task/public.php | 10 | ||||
-rw-r--r-- | app/Template/task/remove.php | 6 | ||||
-rw-r--r-- | app/Template/task/show.php | 14 | ||||
-rw-r--r-- | app/Template/task/show_description.php | 4 | ||||
-rw-r--r-- | app/Template/task/sidebar.php | 24 | ||||
-rw-r--r-- | app/Template/task/table.php | 30 | ||||
-rw-r--r-- | app/Template/task/time.php | 18 | ||||
-rw-r--r-- | app/Template/task/timesheet.php | 6 |
19 files changed, 139 insertions, 139 deletions
diff --git a/app/Template/task/close.php b/app/Template/task/close.php index 062d0a88..76852862 100644 --- a/app/Template/task/close.php +++ b/app/Template/task/close.php @@ -4,12 +4,12 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to close this task: "%s"?', Helper\escape($task['title'])) ?> + <?= t('Do you really want to close this task: "%s"?', $this->e($task['title'])) ?> </p> <div class="form-actions"> - <?= Helper\a(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/comments.php b/app/Template/task/comments.php index 343e66c5..6f380567 100644 --- a/app/Template/task/comments.php +++ b/app/Template/task/comments.php @@ -5,7 +5,7 @@ </div> <?php foreach ($comments as $comment): ?> - <?= Helper\template('comment/show', array( + <?= $this->render('comment/show', array( 'comment' => $comment, 'task' => $task, 'project' => $project, @@ -15,10 +15,10 @@ <?php endforeach ?> <?php if (! isset($not_editable)): ?> - <?= Helper\template('comment/create', array( + <?= $this->render('comment/create', array( 'skip_cancel' => true, 'values' => array( - 'user_id' => Helper\get_user_id(), + 'user_id' => $this->acl->getUserId(), 'task_id' => $task['id'], ), 'errors' => array(), diff --git a/app/Template/task/details.php b/app/Template/task/details.php index b5111f78..50145da4 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -1,7 +1,7 @@ <div class="task-<?= $task['color_id'] ?> task-show-details"> - <h2><?= Helper\escape('#'.$task['id'].' '.$task['title']) ?></h2> + <h2><?= $this->e('#'.$task['id'].' '.$task['title']) ?></h2> <?php if ($task['score']): ?> - <span class="task-score"><?= Helper\escape($task['score']) ?></span> + <span class="task-score"><?= $this->e($task['score']) ?></span> <?php endif ?> <ul> <?php if ($task['reference']): ?> @@ -58,13 +58,13 @@ </li> <li> <?= t('Column on the board:') ?> - <strong><?= Helper\escape($task['column_title']) ?></strong> - (<?= Helper\escape($task['project_name']) ?>) + <strong><?= $this->e($task['column_title']) ?></strong> + (<?= $this->e($task['project_name']) ?>) </li> - <li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> <?php if ($task['category_name']): ?> <li> - <?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong> + <?= t('Category:') ?> <strong><?= $this->e($task['category_name']) ?></strong> </li> <?php endif ?> <li> @@ -76,7 +76,7 @@ </li> <?php if ($project['is_public']): ?> <li> - <?= Helper\a(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?> + <?= $this->a(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?> </li> <?php endif ?> </ul> diff --git a/app/Template/task/duplicate.php b/app/Template/task/duplicate.php index 3d1829ed..c1aed6be 100644 --- a/app/Template/task/duplicate.php +++ b/app/Template/task/duplicate.php @@ -8,8 +8,8 @@ </p> <div class="form-actions"> - <?= Helper\a(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/duplicate_project.php b/app/Template/task/duplicate_project.php index 45081842..d69da9d5 100644 --- a/app/Template/task/duplicate_project.php +++ b/app/Template/task/duplicate_project.php @@ -6,18 +6,18 @@ <p class="alert"><?= t('No project') ?></p> <?php else: ?> - <form method="post" action="<?= Helper\u('task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> + <form method="post" action="<?= $this->u('task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> - <?= Helper\form_csrf() ?> + <?= $this->formCsrf() ?> - <?= Helper\form_hidden('id', $values) ?> - <?= Helper\form_label(t('Project'), 'project_id') ?> - <?= Helper\form_select('project_id', $projects_list, $values, $errors) ?><br/> + <?= $this->formHidden('id', $values) ?> + <?= $this->formLabel(t('Project'), 'project_id') ?> + <?= $this->formSelect('project_id', $projects_list, $values, $errors) ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> </div> </form> diff --git a/app/Template/task/edit.php b/app/Template/task/edit.php index 6f136cb9..ef1a9dfa 100644 --- a/app/Template/task/edit.php +++ b/app/Template/task/edit.php @@ -2,16 +2,16 @@ <h2><?= t('Edit a task') ?></h2> </div> <section id="task-section"> -<form method="post" action="<?= Helper\u('task', 'update', array('task_id' => $task['id'], 'ajax' => $ajax)) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('task', 'update', array('task_id' => $task['id'], 'ajax' => $ajax)) ?>" autocomplete="off"> - <?= Helper\form_csrf() ?> + <?= $this->formCsrf() ?> <div class="form-column"> - <?= Helper\form_label(t('Title'), 'title') ?> - <?= Helper\form_text('title', $values, $errors, array('required')) ?><br/> + <?= $this->formLabel(t('Title'), 'title') ?> + <?= $this->formText('title', $values, $errors, array('required')) ?><br/> - <?= Helper\form_label(t('Description'), 'description') ?> + <?= $this->formLabel(t('Description'), 'description') ?> <div class="form-tabs"> <ul class="form-tabs-nav"> @@ -23,7 +23,7 @@ </li> </ul> <div class="write-area"> - <?= Helper\form_textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?> + <?= $this->formTextarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?> </div> <div class="preview-area"> <div class="markdown"></div> @@ -35,23 +35,23 @@ </div> <div class="form-column"> - <?= Helper\form_hidden('id', $values) ?> - <?= Helper\form_hidden('project_id', $values) ?> + <?= $this->formHidden('id', $values) ?> + <?= $this->formHidden('project_id', $values) ?> - <?= Helper\form_label(t('Assignee'), 'owner_id') ?> - <?= Helper\form_select('owner_id', $users_list, $values, $errors) ?><br/> + <?= $this->formLabel(t('Assignee'), 'owner_id') ?> + <?= $this->formSelect('owner_id', $users_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Category'), 'category_id') ?> - <?= Helper\form_select('category_id', $categories_list, $values, $errors) ?><br/> + <?= $this->formLabel(t('Category'), 'category_id') ?> + <?= $this->formSelect('category_id', $categories_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Color'), 'color_id') ?> - <?= Helper\form_select('color_id', $colors_list, $values, $errors) ?><br/> + <?= $this->formLabel(t('Color'), 'color_id') ?> + <?= $this->formSelect('color_id', $colors_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Complexity'), 'score') ?> - <?= Helper\form_number('score', $values, $errors) ?><br/> + <?= $this->formLabel(t('Complexity'), 'score') ?> + <?= $this->formNumber('score', $values, $errors) ?><br/> - <?= Helper\form_label(t('Due Date'), 'date_due') ?> - <?= Helper\form_text('date_due', $values, $errors, array('placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?><br/> + <?= $this->formLabel(t('Due Date'), 'date_due') ?> + <?= $this->formText('date_due', $values, $errors, array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?><br/> <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> </div> @@ -59,9 +59,9 @@ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <?php if ($ajax): ?> - <?= Helper\a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> + <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> <?php else: ?> - <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> <?php endif ?> </div> </form> diff --git a/app/Template/task/edit_description.php b/app/Template/task/edit_description.php index 9ec94d69..d53aff93 100644 --- a/app/Template/task/edit_description.php +++ b/app/Template/task/edit_description.php @@ -2,10 +2,10 @@ <h2><?= t('Edit the description') ?></h2> </div> -<form method="post" action="<?= Helper\u('task', 'description', array('task_id' => $task['id'], 'ajax' => $ajax)) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('task', 'description', array('task_id' => $task['id'], 'ajax' => $ajax)) ?>" autocomplete="off"> - <?= Helper\form_csrf() ?> - <?= Helper\form_hidden('id', $values) ?> + <?= $this->formCsrf() ?> + <?= $this->formHidden('id', $values) ?> <div class="form-tabs"> <ul class="form-tabs-nav"> @@ -17,7 +17,7 @@ </li> </ul> <div class="write-area"> - <?= Helper\form_textarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'description-textarea') ?> + <?= $this->formTextarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'description-textarea') ?> </div> <div class="preview-area"> <div class="markdown"></div> @@ -30,9 +30,9 @@ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <?php if ($ajax): ?> - <?= Helper\a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> + <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> <?php else: ?> - <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> <?php endif ?> </div> </form> diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php index a73ce28f..776fdc78 100644 --- a/app/Template/task/layout.php +++ b/app/Template/task/layout.php @@ -1,12 +1,12 @@ <section id="main"> <div class="page-header"> <ul> - <li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id'])) ?></li> + <li><i class="fa fa-table fa-fw"></i><?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id'])) ?></li> </ul> </div> <section class="sidebar-container" id="task-section"> - <?= Helper\template('task/sidebar', array('task' => $task, 'hide_remove_menu' => isset($hide_remove_menu))) ?> + <?= $this->render('task/sidebar', array('task' => $task, 'hide_remove_menu' => isset($hide_remove_menu))) ?> <div class="sidebar-content"> <?= $task_content_for_layout ?> diff --git a/app/Template/task/move_project.php b/app/Template/task/move_project.php index 1a355b02..15b295d7 100644 --- a/app/Template/task/move_project.php +++ b/app/Template/task/move_project.php @@ -6,18 +6,18 @@ <p class="alert"><?= t('No project') ?></p> <?php else: ?> - <form method="post" action="<?= Helper\u('task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> + <form method="post" action="<?= $this->u('task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> - <?= Helper\form_csrf() ?> + <?= $this->formCsrf() ?> - <?= Helper\form_hidden('id', $values) ?> - <?= Helper\form_label(t('Project'), 'project_id') ?> - <?= Helper\form_select('project_id', $projects_list, $values, $errors) ?><br/> + <?= $this->formHidden('id', $values) ?> + <?= $this->formLabel(t('Project'), 'project_id') ?> + <?= $this->formSelect('project_id', $projects_list, $values, $errors) ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> </div> </form> diff --git a/app/Template/task/new.php b/app/Template/task/new.php index 3e2576c5..6294968a 100644 --- a/app/Template/task/new.php +++ b/app/Template/task/new.php @@ -1,7 +1,7 @@ <?php if (! $ajax): ?> <div class="page-header"> <ul> - <li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li> + <li><i class="fa fa-table fa-fw"></i><?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li> </ul> </div> <?php else: ?> @@ -11,15 +11,15 @@ <?php endif ?> <section id="task-section"> -<form method="post" action="<?= Helper\u('task', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('task', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off"> - <?= Helper\form_csrf() ?> + <?= $this->formCsrf() ?> <div class="form-column"> - <?= Helper\form_label(t('Title'), 'title') ?> - <?= Helper\form_text('title', $values, $errors, array('autofocus', 'required'), 'form-input-large') ?><br/> + <?= $this->formLabel(t('Title'), 'title') ?> + <?= $this->formText('title', $values, $errors, array('autofocus', 'required'), 'form-input-large') ?><br/> - <?= Helper\form_label(t('Description'), 'description') ?> + <?= $this->formLabel(t('Description'), 'description') ?> <div class="form-tabs"> <ul class="form-tabs-nav"> @@ -31,7 +31,7 @@ </li> </ul> <div class="write-area"> - <?= Helper\form_textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?> + <?= $this->formTextarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?> </div> <div class="preview-area"> <div class="markdown"></div> @@ -41,40 +41,40 @@ <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div> <?php if (! isset($duplicate)): ?> - <?= Helper\form_checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> + <?= $this->formCheckbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> <?php endif ?> </div> <div class="form-column"> - <?= Helper\form_hidden('project_id', $values) ?> - <?= Helper\form_hidden('swimlane_id', $values) ?> + <?= $this->formHidden('project_id', $values) ?> + <?= $this->formHidden('swimlane_id', $values) ?> - <?= Helper\form_label(t('Assignee'), 'owner_id') ?> - <?= Helper\form_select('owner_id', $users_list, $values, $errors) ?><br/> + <?= $this->formLabel(t('Assignee'), 'owner_id') ?> + <?= $this->formSelect('owner_id', $users_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Category'), 'category_id') ?> - <?= Helper\form_select('category_id', $categories_list, $values, $errors) ?><br/> + <?= $this->formLabel(t('Category'), 'category_id') ?> + <?= $this->formSelect('category_id', $categories_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Column'), 'column_id') ?> - <?= Helper\form_select('column_id', $columns_list, $values, $errors) ?><br/> + <?= $this->formLabel(t('Column'), 'column_id') ?> + <?= $this->formSelect('column_id', $columns_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Color'), 'color_id') ?> - <?= Helper\form_select('color_id', $colors_list, $values, $errors) ?><br/> + <?= $this->formLabel(t('Color'), 'color_id') ?> + <?= $this->formSelect('color_id', $colors_list, $values, $errors) ?><br/> - <?= Helper\form_label(t('Complexity'), 'score') ?> - <?= Helper\form_number('score', $values, $errors) ?><br/> + <?= $this->formLabel(t('Complexity'), 'score') ?> + <?= $this->formNumber('score', $values, $errors) ?><br/> - <?= Helper\form_label(t('Original estimate'), 'time_estimated') ?> - <?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> + <?= $this->formLabel(t('Original estimate'), 'time_estimated') ?> + <?= $this->formNumeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> - <?= Helper\form_label(t('Due Date'), 'date_due') ?> - <?= Helper\form_text('date_due', $values, $errors, array('placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?><br/> + <?= $this->formLabel(t('Due Date'), 'date_due') ?> + <?= $this->formText('date_due', $values, $errors, array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?><br/> <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> </div> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> <?= Helper\a(t('cancel'), 'board', 'show', array('project_id' => $values['project_id'])) ?> + <?= t('or') ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $values['project_id'])) ?> </div> </form> </section> diff --git a/app/Template/task/open.php b/app/Template/task/open.php index 5dec3b0e..438acb34 100644 --- a/app/Template/task/open.php +++ b/app/Template/task/open.php @@ -4,12 +4,12 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to open this task: "%s"?', Helper\escape($task['title'])) ?> + <?= t('Do you really want to open this task: "%s"?', $this->e($task['title'])) ?> </p> <div class="form-actions"> - <?= Helper\a(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/public.php b/app/Template/task/public.php index 371c063a..2d95e6db 100644 --- a/app/Template/task/public.php +++ b/app/Template/task/public.php @@ -1,22 +1,22 @@ <section id="main" class="public-task"> - <?= Helper\template('task/details', array('task' => $task, 'project' => $project)) ?> + <?= $this->render('task/details', array('task' => $task, 'project' => $project)) ?> - <p class="pull-right"><?= Helper\a(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p> + <p class="pull-right"><?= $this->a(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p> - <?= Helper\template('task/show_description', array( + <?= $this->render('task/show_description', array( 'task' => $task, 'project' => $project, 'is_public' => true )) ?> - <?= Helper\template('subtask/show', array( + <?= $this->render('subtask/show', array( 'task' => $task, 'subtasks' => $subtasks, 'not_editable' => true )) ?> - <?= Helper\template('task/comments', array( + <?= $this->render('task/comments', array( 'task' => $task, 'comments' => $comments, 'project' => $project, diff --git a/app/Template/task/remove.php b/app/Template/task/remove.php index 5d6095bc..59845c6a 100644 --- a/app/Template/task/remove.php +++ b/app/Template/task/remove.php @@ -4,12 +4,12 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to remove this task: "%s"?', Helper\escape($task['title'])) ?> + <?= t('Do you really want to remove this task: "%s"?', $this->e($task['title'])) ?> </p> <div class="form-actions"> - <?= Helper\a(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->a(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/show.php b/app/Template/task/show.php index 2652291a..b98af52d 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -1,7 +1,7 @@ -<?= Helper\template('task/details', array('task' => $task, 'project' => $project)) ?> -<?= Helper\template('task/time', array('values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> -<?= Helper\template('task/show_description', array('task' => $task)) ?> -<?= Helper\template('subtask/show', array('task' => $task, 'subtasks' => $subtasks)) ?> -<?= Helper\template('task/timesheet', array('timesheet' => $timesheet)) ?> -<?= Helper\template('file/show', array('task' => $task, 'files' => $files)) ?> -<?= Helper\template('task/comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?>
\ No newline at end of file +<?= $this->render('task/details', array('task' => $task, 'project' => $project)) ?> +<?= $this->render('task/time', array('values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> +<?= $this->render('task/show_description', array('task' => $task)) ?> +<?= $this->render('subtask/show', array('task' => $task, 'subtasks' => $subtasks)) ?> +<?= $this->render('task/timesheet', array('timesheet' => $timesheet)) ?> +<?= $this->render('file/show', array('task' => $task, 'files' => $files)) ?> +<?= $this->render('task/comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?>
\ No newline at end of file diff --git a/app/Template/task/show_description.php b/app/Template/task/show_description.php index 25312149..9cd278e3 100644 --- a/app/Template/task/show_description.php +++ b/app/Template/task/show_description.php @@ -6,9 +6,9 @@ <article class="markdown task-show-description"> <?php if (! isset($is_public)): ?> - <?= Helper\markdown($task['description']) ?> + <?= $this->markdown($task['description']) ?> <?php else: ?> - <?= Helper\markdown( + <?= $this->markdown( $task['description'], array( 'controller' => 'task', diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index 25bddeab..1779255a 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -2,42 +2,42 @@ <h2><?= t('Actions') ?></h2> <ul> <li> - <?= Helper\a(t('Summary'), 'task', 'show', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Summary'), 'task', 'show', array('task_id' => $task['id'])) ?> </li> <li> - <?= Helper\a(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'])) ?> </li> <li> - <?= Helper\a(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'])) ?> </li> <li> - <?= Helper\a(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'])) ?> </li> <li> - <?= Helper\a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'])) ?> </li> <li> - <?= Helper\a(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'])) ?> </li> <li> - <?= Helper\a(t('Duplicate'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->a(t('Duplicate'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= Helper\a(t('Duplicate to another project'), 'task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->a(t('Duplicate to another project'), 'task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= Helper\a(t('Move to another project'), 'task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->a(t('Move to another project'), 'task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> <?php if ($task['is_active'] == 1): ?> - <?= Helper\a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'])) ?> <?php else: ?> - <?= Helper\a(t('Open this task'), 'task', 'open', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Open this task'), 'task', 'open', array('task_id' => $task['id'])) ?> <?php endif ?> </li> <?php if (! $hide_remove_menu): ?> <li> - <?= Helper\a(t('Remove'), 'task', 'remove', array('task_id' => $task['id'])) ?> + <?= $this->a(t('Remove'), 'task', 'remove', array('task_id' => $task['id'])) ?> </li> <?php endif ?> </ul> diff --git a/app/Template/task/table.php b/app/Template/task/table.php index 9f11ea85..dfde4561 100644 --- a/app/Template/task/table.php +++ b/app/Template/task/table.php @@ -1,32 +1,32 @@ <table class="table-fixed table-small"> <tr> - <th class="column-8"><?= Helper\order(t('Id'), 'tasks.id', $pagination) ?></th> - <th class="column-8"><?= Helper\order(t('Column'), 'tasks.column_id', $pagination) ?></th> - <th class="column-8"><?= Helper\order(t('Category'), 'tasks.category_id', $pagination) ?></th> - <th><?= Helper\order(t('Title'), 'tasks.title', $pagination) ?></th> - <th class="column-10"><?= Helper\order(t('Assignee'), 'users.username', $pagination) ?></th> - <th class="column-10"><?= Helper\order(t('Due date'), 'tasks.date_due', $pagination) ?></th> - <th class="column-10"><?= Helper\order(t('Date created'), 'tasks.date_creation', $pagination) ?></th> - <th class="column-10"><?= Helper\order(t('Date completed'), 'tasks.date_completed', $pagination) ?></th> - <th class="column-5"><?= Helper\order(t('Status'), 'tasks.is_active', $pagination) ?></th> + <th class="column-8"><?= $this->order(t('Id'), 'tasks.id', $pagination) ?></th> + <th class="column-8"><?= $this->order(t('Column'), 'tasks.column_id', $pagination) ?></th> + <th class="column-8"><?= $this->order(t('Category'), 'tasks.category_id', $pagination) ?></th> + <th><?= $this->order(t('Title'), 'tasks.title', $pagination) ?></th> + <th class="column-10"><?= $this->order(t('Assignee'), 'users.username', $pagination) ?></th> + <th class="column-10"><?= $this->order(t('Due date'), 'tasks.date_due', $pagination) ?></th> + <th class="column-10"><?= $this->order(t('Date created'), 'tasks.date_creation', $pagination) ?></th> + <th class="column-10"><?= $this->order(t('Date completed'), 'tasks.date_completed', $pagination) ?></th> + <th class="column-5"><?= $this->order(t('Status'), 'tasks.is_active', $pagination) ?></th> </tr> <?php foreach ($tasks as $task): ?> <tr> <td class="task-table task-<?= $task['color_id'] ?>"> - <?= Helper\a('#'.Helper\escape($task['id']), 'task', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> + <?= $this->a('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> </td> <td> - <?= Helper\in_list($task['column_id'], $columns) ?> + <?= $this->inList($task['column_id'], $columns) ?> </td> <td> - <?= Helper\in_list($task['category_id'], $categories, '') ?> + <?= $this->inList($task['category_id'], $categories, '') ?> </td> <td> - <?= Helper\a(Helper\escape($task['title']), 'task', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> + <?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> </td> <td> <?php if ($task['assignee_username']): ?> - <?= Helper\escape($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php else: ?> <?= t('Unassigned') ?> <?php endif ?> @@ -53,4 +53,4 @@ <?php endforeach ?> </table> -<?= Helper\paginate($pagination) ?> +<?= $this->paginate($pagination) ?> diff --git a/app/Template/task/time.php b/app/Template/task/time.php index 11a76303..b00cbc14 100644 --- a/app/Template/task/time.php +++ b/app/Template/task/time.php @@ -1,15 +1,15 @@ -<form method="post" action="<?= Helper\u('task', 'time', array('task_id' => $values['id'])) ?>" class="form-inline task-time-form" autocomplete="off"> - <?= Helper\form_csrf() ?> - <?= Helper\form_hidden('id', $values) ?> +<form method="post" action="<?= $this->u('task', 'time', array('task_id' => $values['id'])) ?>" class="form-inline task-time-form" autocomplete="off"> + <?= $this->formCsrf() ?> + <?= $this->formHidden('id', $values) ?> - <?= Helper\form_label(t('Start date'), 'date_started') ?> - <?= Helper\form_text('date_started', $values, array(), array('placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?> + <?= $this->formLabel(t('Start date'), 'date_started') ?> + <?= $this->formText('date_started', $values, array(), array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> - <?= Helper\form_label(t('Time estimated'), 'time_estimated') ?> - <?= Helper\form_numeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?> + <?= $this->formLabel(t('Time estimated'), 'time_estimated') ?> + <?= $this->formNumeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?> - <?= Helper\form_label(t('Time spent'), 'time_spent') ?> - <?= Helper\form_numeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?> + <?= $this->formLabel(t('Time spent'), 'time_spent') ?> + <?= $this->formNumeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> </form>
\ No newline at end of file diff --git a/app/Template/task/timesheet.php b/app/Template/task/timesheet.php index cd093657..fa76b84d 100644 --- a/app/Template/task/timesheet.php +++ b/app/Template/task/timesheet.php @@ -5,9 +5,9 @@ </div> <ul class="listing"> - <li><?= t('Estimate:') ?> <strong><?= Helper\escape($timesheet['time_estimated']) ?></strong> <?= t('hours') ?></li> - <li><?= t('Spent:') ?> <strong><?= Helper\escape($timesheet['time_spent']) ?></strong> <?= t('hours') ?></li> - <li><?= t('Remaining:') ?> <strong><?= Helper\escape($timesheet['time_remaining']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Estimate:') ?> <strong><?= $this->e($timesheet['time_estimated']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Spent:') ?> <strong><?= $this->e($timesheet['time_spent']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Remaining:') ?> <strong><?= $this->e($timesheet['time_remaining']) ?></strong> <?= t('hours') ?></li> </ul> <?php endif ?>
\ No newline at end of file |