diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-19 18:14:20 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-19 18:14:20 -0400 |
commit | 401b0bdfb10ebfe75c9a392de52d37cc3c22c062 (patch) | |
tree | 841bf69b8d404a29ab92692a9ebfb8d5a7e500e1 /app/Template/task | |
parent | fcdd71af2cabdd1252172ac83a24be8672ca34cc (diff) |
Split task controller into smaller classes
Diffstat (limited to 'app/Template/task')
-rw-r--r-- | app/Template/task/close.php | 15 | ||||
-rw-r--r-- | app/Template/task/description.php (renamed from app/Template/task/show_description.php) | 0 | ||||
-rw-r--r-- | app/Template/task/edit.php | 68 | ||||
-rw-r--r-- | app/Template/task/edit_description.php | 38 | ||||
-rw-r--r-- | app/Template/task/edit_recurrence.php | 47 | ||||
-rw-r--r-- | app/Template/task/new.php | 84 | ||||
-rw-r--r-- | app/Template/task/open.php | 15 | ||||
-rw-r--r-- | app/Template/task/public.php | 2 | ||||
-rw-r--r-- | app/Template/task/show.php | 6 | ||||
-rw-r--r-- | app/Template/task/sidebar.php | 12 | ||||
-rw-r--r-- | app/Template/task/time.php | 20 | ||||
-rw-r--r-- | app/Template/task/time_tracking_details.php (renamed from app/Template/task/time_tracking.php) | 2 | ||||
-rw-r--r-- | app/Template/task/time_tracking_summary.php (renamed from app/Template/task/timesheet.php) | 0 |
13 files changed, 11 insertions, 298 deletions
diff --git a/app/Template/task/close.php b/app/Template/task/close.php deleted file mode 100644 index 160d5400..00000000 --- a/app/Template/task/close.php +++ /dev/null @@ -1,15 +0,0 @@ -<div class="page-header"> - <h2><?= t('Close a task') ?></h2> -</div> - -<div class="confirm"> - <p class="alert alert-info"> - <?= t('Do you really want to close the task "%s" as well as all subtasks?', $this->e($task['title'])) ?> - </p> - - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> - </div> -</div>
\ No newline at end of file diff --git a/app/Template/task/show_description.php b/app/Template/task/description.php index f823e7d6..f823e7d6 100644 --- a/app/Template/task/show_description.php +++ b/app/Template/task/description.php diff --git a/app/Template/task/edit.php b/app/Template/task/edit.php deleted file mode 100644 index 359df779..00000000 --- a/app/Template/task/edit.php +++ /dev/null @@ -1,68 +0,0 @@ -<div class="page-header"> - <h2><?= t('Edit a task') ?></h2> -</div> -<section id="task-section"> -<form method="post" action="<?= $this->url->href('task', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - - <div class="form-column"> - - <?= $this->form->label(t('Title'), 'title') ?> - <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"')) ?><br/> - - <?= $this->form->label(t('Description'), 'description') ?> - - <div class="form-tabs"> - <div class="write-area"> - <?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?> - </div> - <div class="preview-area"> - <div class="markdown"></div> - </div> - <ul class="form-tabs-nav"> - <li class="form-tab form-tab-selected"> - <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a> - </li> - <li class="form-tab"> - <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a> - </li> - </ul> - </div> - - <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div> - - </div> - - <div class="form-column"> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> - - <?= $this->form->label(t('Assignee'), 'owner_id') ?> - <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/> - - <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/> - - <?= $this->form->label(t('Color'), 'color_id') ?> - <?= $this->form->select('color_id', $colors_list, $values, $errors, array('tabindex="5"')) ?><br/> - - <?= $this->form->label(t('Complexity'), 'score') ?> - <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?><br/> - - <?= $this->form->label(t('Due Date'), 'date_due') ?> - <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="7"'), '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" tabindex="10"> - <?= t('or') ?> - <?php if ($ajax): ?> - <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?> - <?php else: ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - <?php endif ?> - </div> -</form> -</section> diff --git a/app/Template/task/edit_description.php b/app/Template/task/edit_description.php deleted file mode 100644 index 99a547e1..00000000 --- a/app/Template/task/edit_description.php +++ /dev/null @@ -1,38 +0,0 @@ -<div class="page-header"> - <h2><?= t('Edit the description') ?></h2> -</div> - -<form method="post" action="<?= $this->url->href('task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - - <div class="form-tabs"> - <ul class="form-tabs-nav"> - <li class="form-tab form-tab-selected"> - <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a> - </li> - <li class="form-tab"> - <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a> - </li> - </ul> - <div class="write-area"> - <?= $this->form->textarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'task-show-description-textarea') ?> - </div> - <div class="preview-area"> - <div class="markdown"></div> - </div> - </div> - - <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> - <?php if ($ajax): ?> - <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> - <?php else: ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - <?php endif ?> - </div> -</form> diff --git a/app/Template/task/edit_recurrence.php b/app/Template/task/edit_recurrence.php deleted file mode 100644 index e7c4c8f8..00000000 --- a/app/Template/task/edit_recurrence.php +++ /dev/null @@ -1,47 +0,0 @@ -<div class="page-header"> - <h2><?= t('Edit recurrence') ?></h2> -</div> - -<?php if ($task['recurrence_status'] != \Model\Task::RECURRING_STATUS_NONE): ?> -<div class="listing"> - <?= $this->render('task/recurring_info', array( - 'task' => $task, - 'recurrence_trigger_list' => $recurrence_trigger_list, - 'recurrence_timeframe_list' => $recurrence_timeframe_list, - 'recurrence_basedate_list' => $recurrence_basedate_list, - )) ?> -</div> -<?php endif ?> - -<?php if ($task['recurrence_status'] != \Model\Task::RECURRING_STATUS_PROCESSED): ?> - - <form method="post" action="<?= $this->url->href('task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> - - <?= $this->form->label(t('Generate recurrent task'), 'recurrence_status') ?> - <?= $this->form->select('recurrence_status', $recurrence_status_list, $values, $errors) ?> - - <?= $this->form->label(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?> - <?= $this->form->select('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?> - - <?= $this->form->label(t('Factor to calculate new due date'), 'recurrence_factor') ?> - <?= $this->form->number('recurrence_factor', $values, $errors) ?> - - <?= $this->form->label(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?> - <?= $this->form->select('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?> - - <?= $this->form->label(t('Base date to calculate new due date'), 'recurrence_basedate') ?> - <?= $this->form->select('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </div> - </form> - -<?php endif ?>
\ No newline at end of file diff --git a/app/Template/task/new.php b/app/Template/task/new.php deleted file mode 100644 index 8fcdacdf..00000000 --- a/app/Template/task/new.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php if (! $ajax): ?> -<div class="page-header"> - <ul> - <li><i class="fa fa-th fa-fw"></i><?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li> - </ul> -</div> -<?php else: ?> -<div class="page-header"> - <h2><?= t('New task') ?></h2> -</div> -<?php endif ?> - -<section id="task-section"> -<form method="post" action="<?= $this->url->href('task', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - - <div class="form-column"> - <?= $this->form->label(t('Title'), 'title') ?> - <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?><br/> - - <?= $this->form->label(t('Description'), 'description') ?> - - <div class="form-tabs"> - <div class="write-area"> - <?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?> - </div> - <div class="preview-area"> - <div class="markdown"></div> - </div> - <ul class="form-tabs-nav"> - <li class="form-tab form-tab-selected"> - <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a> - </li> - <li class="form-tab"> - <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a> - </li> - </ul> - </div> - - <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)): ?> - <?= $this->form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> - <?php endif ?> - </div> - - <div class="form-column"> - <?= $this->form->hidden('project_id', $values) ?> - - <?= $this->form->label(t('Assignee'), 'owner_id') ?> - <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/> - - <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/> - - <?php if (! (count($swimlanes_list) === 1 && key($swimlanes_list) === 0)): ?> - <?= $this->form->label(t('Swimlane'), 'swimlane_id') ?> - <?= $this->form->select('swimlane_id', $swimlanes_list, $values, $errors, array('tabindex="5"')) ?><br/> - <?php endif ?> - - <?= $this->form->label(t('Column'), 'column_id') ?> - <?= $this->form->select('column_id', $columns_list, $values, $errors, array('tabindex="6"')) ?><br/> - - <?= $this->form->label(t('Color'), 'color_id') ?> - <?= $this->form->select('color_id', $colors_list, $values, $errors, array('tabindex="7"')) ?><br/> - - <?= $this->form->label(t('Complexity'), 'score') ?> - <?= $this->form->number('score', $values, $errors, array('tabindex="8"')) ?><br/> - - <?= $this->form->label(t('Original estimate'), 'time_estimated') ?> - <?= $this->form->numeric('time_estimated', $values, $errors, array('tabindex="9"')) ?> <?= t('hours') ?><br/> - - <?= $this->form->label(t('Due Date'), 'date_due') ?> - <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="10"'), '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" tabindex="11"/> - <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?> - </div> -</form> -</section> diff --git a/app/Template/task/open.php b/app/Template/task/open.php deleted file mode 100644 index fbcc1111..00000000 --- a/app/Template/task/open.php +++ /dev/null @@ -1,15 +0,0 @@ -<div class="page-header"> - <h2><?= t('Open a task') ?></h2> -</div> - -<div class="confirm"> - <p class="alert alert-info"> - <?= t('Do you really want to open this task: "%s"?', $this->e($task['title'])) ?> - </p> - - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </div> -</div>
\ No newline at end of file diff --git a/app/Template/task/public.php b/app/Template/task/public.php index 73116de9..e3105488 100644 --- a/app/Template/task/public.php +++ b/app/Template/task/public.php @@ -4,7 +4,7 @@ <p class="pull-right"><?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p> - <?= $this->render('task/show_description', array( + <?= $this->render('task/description', array( 'task' => $task, 'project' => $project, 'is_public' => true diff --git a/app/Template/task/show.php b/app/Template/task/show.php index a594d906..68d63c58 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -6,10 +6,10 @@ 'recurrence_basedate_list' => $this->task->recurrenceBasedates(), )) ?> -<?= $this->render('task/time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> -<?= $this->render('task/show_description', array('task' => $task)) ?> +<?= $this->render('task_modification/edit_time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> +<?= $this->render('task/description', array('task' => $task)) ?> <?= $this->render('tasklink/show', array('task' => $task, 'links' => $links, 'link_label_list' => $link_label_list)) ?> <?= $this->render('subtask/show', array('task' => $task, 'subtasks' => $subtasks, 'project' => $project, 'users_list' => isset($users_list) ? $users_list : array())) ?> -<?= $this->render('task/timesheet', array('task' => $task)) ?> +<?= $this->render('task/time_tracking_summary', array('task' => $task)) ?> <?= $this->render('file/show', array('task' => $task, 'files' => $files, 'images' => $images)) ?> <?= $this->render('task/comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?> diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index 942e7d01..1116040a 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -15,20 +15,20 @@ </li> <?php if ($task['time_estimated'] > 0 || $task['time_spent'] > 0): ?> <li> - <?= $this->url->link(t('Time tracking'), 'task', 'timesheet', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <?php endif ?> </ul> <h2><?= t('Actions') ?></h2> <ul> <li> - <?= $this->url->link(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= $this->url->link(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> - <?= $this->url->link(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('Edit recurrence'), 'taskmodification', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> <?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> @@ -56,9 +56,9 @@ </li> <li> <?php if ($task['is_active'] == 1): ?> - <?= $this->url->link(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php else: ?> - <?= $this->url->link(t('Open this task'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php endif ?> </li> <?php if ($this->task->canRemove($task)): ?> diff --git a/app/Template/task/time.php b/app/Template/task/time.php deleted file mode 100644 index 90407d7a..00000000 --- a/app/Template/task/time.php +++ /dev/null @@ -1,20 +0,0 @@ -<form method="post" action="<?= $this->url->href('task', 'time', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" class="form-inline task-time-form" autocomplete="off"> - - <?php if (empty($values['date_started'])): ?> - <?= $this->url->link('<i class="fa fa-play"></i>', 'task', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-show-start-link', t('Set automatically the start date')) ?> - <?php endif ?> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - - <?= $this->form->label(t('Start date'), 'date_started') ?> - <?= $this->form->text('date_started', $values, array(), array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-datetime') ?> - - <?= $this->form->label(t('Time estimated'), 'time_estimated') ?> - <?= $this->form->numeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?> - - <?= $this->form->label(t('Time spent'), 'time_spent') ?> - <?= $this->form->numeric('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/time_tracking.php b/app/Template/task/time_tracking_details.php index 441cb585..faa07cb8 100644 --- a/app/Template/task/time_tracking.php +++ b/app/Template/task/time_tracking_details.php @@ -1,4 +1,4 @@ -<?= $this->render('task/timesheet', array('task' => $task)) ?> +<?= $this->render('task/time_tracking_summary', array('task' => $task)) ?> <h3><?= t('Subtask timesheet') ?></h3> <?php if ($subtask_paginator->isEmpty()): ?> diff --git a/app/Template/task/timesheet.php b/app/Template/task/time_tracking_summary.php index 0210be7e..0210be7e 100644 --- a/app/Template/task/timesheet.php +++ b/app/Template/task/time_tracking_summary.php |