summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-31 11:50:28 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-31 11:50:28 -0500
commitd8e452d375493a70186866b876c0617bb3269e5f (patch)
treebee3adfefbc89dc0b085e897ef4c492182de61a5 /app/Template
parent9570793f68d44179f9b7e0b264e5fbe0ca839c51 (diff)
Move task form elements to Task helper
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/board/popover_category.php3
-rw-r--r--app/Template/gantt/task_creation.php27
-rw-r--r--app/Template/task_creation/form.php29
-rw-r--r--app/Template/task_modification/edit_task.php15
4 files changed, 17 insertions, 57 deletions
diff --git a/app/Template/board/popover_category.php b/app/Template/board/popover_category.php
index 224ce8d1..e65593cd 100644
--- a/app/Template/board/popover_category.php
+++ b/app/Template/board/popover_category.php
@@ -9,8 +9,7 @@
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
- <?= $this->form->label(t('Category'), 'category_id') ?>
- <?= $this->form->select('category_id', $categories_list, $values, array(), array('autofocus')) ?><br/>
+ <?= $this->task->selectCategory($categories_list, $values, array(), array('autofocus'), true) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
diff --git a/app/Template/gantt/task_creation.php b/app/Template/gantt/task_creation.php
index 7997e231..a08f41b4 100644
--- a/app/Template/gantt/task_creation.php
+++ b/app/Template/gantt/task_creation.php
@@ -33,26 +33,13 @@
</div>
<div class="form-column">
- <?= $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('Complexity'), 'score') ?>
- <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?><br/>
-
- <?= $this->form->label(t('Start Date'), 'date_started') ?>
- <?= $this->form->text('date_started', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="7"'), 'form-date') ?>
-
- <?= $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="8"'), 'form-date') ?><br/>
- <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
+ <?= $this->task->selectAssignee($users_list, $values, $errors) ?>
+ <?= $this->task->selectCategory($categories_list, $values, $errors) ?>
+ <?= $this->task->selectSwimlane($swimlanes_list, $values, $errors) ?>
+ <?= $this->task->selectPriority($project, $values) ?>
+ <?= $this->task->selectScore($values, $errors) ?>
+ <?= $this->task->selectStartDate($values, $errors) ?>
+ <?= $this->task->selectDueDate($values, $errors) ?>
</div>
<div class="form-actions">
diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php
index a814219b..b222f00f 100644
--- a/app/Template/task_creation/form.php
+++ b/app/Template/task_creation/form.php
@@ -47,31 +47,14 @@
<div class="form-column">
<?= $this->form->hidden('project_id', $values) ?>
-
<?= $this->task->selectAssignee($users_list, $values, $errors) ?>
-
- <?= $this->form->label(t('Category'), 'category_id') ?>
- <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?>
-
- <?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"')) ?>
- <?php endif ?>
-
- <?= $this->form->label(t('Column'), 'column_id') ?>
- <?= $this->form->select('column_id', $columns_list, $values, $errors, array('tabindex="6"')) ?>
-
+ <?= $this->task->selectCategory($categories_list, $values, $errors) ?>
+ <?= $this->task->selectSwimlane($swimlanes_list, $values, $errors) ?>
+ <?= $this->task->selectColumn($columns_list, $values, $errors) ?>
<?= $this->task->selectPriority($project, $values) ?>
-
- <?= $this->form->label(t('Complexity'), 'score') ?>
- <?= $this->form->number('score', $values, $errors, array('tabindex="9"')) ?>
-
- <?= $this->form->label(t('Original estimate'), 'time_estimated') ?>
- <?= $this->form->numeric('time_estimated', $values, $errors, array('tabindex="10"')) ?> <?= t('hours') ?>
-
- <?= $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="11"'), 'form-date') ?>
- <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
+ <?= $this->task->selectScore($values, $errors) ?>
+ <?= $this->task->selectTimeEstimate($values, $errors) ?>
+ <?= $this->task->selectDueDate($values, $errors) ?>
</div>
<div class="form-actions">
diff --git a/app/Template/task_modification/edit_task.php b/app/Template/task_modification/edit_task.php
index 1daa318c..fe7fb009 100644
--- a/app/Template/task_modification/edit_task.php
+++ b/app/Template/task_modification/edit_task.php
@@ -43,20 +43,11 @@
<div class="form-column">
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
-
<?= $this->task->selectAssignee($users_list, $values, $errors) ?>
-
- <?= $this->form->label(t('Category'), 'category_id') ?>
- <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?>
-
- <?= $this->form->label(t('Complexity'), 'score') ?>
- <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?>
-
+ <?= $this->task->selectCategory($categories_list, $values, $errors) ?>
<?= $this->task->selectPriority($project, $values) ?>
-
- <?= $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="8"'), 'form-date') ?>
- <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
+ <?= $this->task->selectScore($values, $errors) ?>
+ <?= $this->task->selectDueDate($values, $errors) ?>
</div>
<div class="form-actions">