summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-24 20:38:39 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-24 20:38:39 -0500
commit051bf1c9dbb5733242c7657d6d507389206b33ee (patch)
tree9f1a61fa8558dd572b7c577f51599586e3c48a7e /app/Template
parent60f3d7f83d23014f9cfb7d8494d6cebd2f8b24a3 (diff)
Add configurable task priority
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/board/task_footer.php2
-rw-r--r--app/Template/board/task_private.php1
-rw-r--r--app/Template/board/task_public.php1
-rw-r--r--app/Template/project_edit/dates.php1
-rw-r--r--app/Template/project_edit/description.php1
-rw-r--r--app/Template/project_edit/general.php1
-rw-r--r--app/Template/project_edit/task_priority.php29
-rw-r--r--app/Template/task/details.php3
-rw-r--r--app/Template/task_creation/form.php20
-rw-r--r--app/Template/task_modification/edit_task.php12
10 files changed, 57 insertions, 14 deletions
diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php
index 4a16364c..26f3b1d4 100644
--- a/app/Template/board/task_footer.php
+++ b/app/Template/board/task_footer.php
@@ -69,4 +69,6 @@
<i class="fa fa-flag flag-milestone"></i>
</span>
<?php endif ?>
+
+ <?= $this->task->formatPriority($project, $task) ?>
</div>
diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php
index 8d76453c..4880af00 100644
--- a/app/Template/board/task_private.php
+++ b/app/Template/board/task_private.php
@@ -78,6 +78,7 @@
<?= $this->render('board/task_footer', array(
'task' => $task,
'not_editable' => $not_editable,
+ 'project' => $project,
)) ?>
</div>
<?php endif ?>
diff --git a/app/Template/board/task_public.php b/app/Template/board/task_public.php
index bacdcef4..d02722bb 100644
--- a/app/Template/board/task_public.php
+++ b/app/Template/board/task_public.php
@@ -25,5 +25,6 @@
<?= $this->render('board/task_footer', array(
'task' => $task,
'not_editable' => $not_editable,
+ 'project' => $project,
)) ?>
</div> \ No newline at end of file
diff --git a/app/Template/project_edit/dates.php b/app/Template/project_edit/dates.php
index d3f4bad8..cb585c6a 100644
--- a/app/Template/project_edit/dates.php
+++ b/app/Template/project_edit/dates.php
@@ -4,6 +4,7 @@
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
<li class="active"><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
+ <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
</ul>
</div>
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off">
diff --git a/app/Template/project_edit/description.php b/app/Template/project_edit/description.php
index 3af484d5..dce8ab10 100644
--- a/app/Template/project_edit/description.php
+++ b/app/Template/project_edit/description.php
@@ -4,6 +4,7 @@
<li><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
<li class="active"><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
+ <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
</ul>
</div>
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off">
diff --git a/app/Template/project_edit/general.php b/app/Template/project_edit/general.php
index 1da913da..5caefa2d 100644
--- a/app/Template/project_edit/general.php
+++ b/app/Template/project_edit/general.php
@@ -4,6 +4,7 @@
<li class="active"><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
+ <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
</ul>
</div>
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off">
diff --git a/app/Template/project_edit/task_priority.php b/app/Template/project_edit/task_priority.php
new file mode 100644
index 00000000..e54215b2
--- /dev/null
+++ b/app/Template/project_edit/task_priority.php
@@ -0,0 +1,29 @@
+<div class="page-header">
+ <h2><?= t('Edit project') ?></h2>
+ <ul>
+ <li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
+ <li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
+ <li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
+ <li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
+ </ul>
+</div>
+<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off">
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('id', $values) ?>
+ <?= $this->form->hidden('name', $values) ?>
+
+ <?= $this->form->label(t('Default priority'), 'priority_default') ?>
+ <?= $this->form->number('priority_default', $values, $errors) ?>
+
+ <?= $this->form->label(t('Lowest priority'), 'priority_start') ?>
+ <?= $this->form->number('priority_start', $values, $errors) ?>
+
+ <?= $this->form->label(t('Highest priority'), 'priority_end') ?>
+ <?= $this->form->number('priority_end', $values, $errors) ?>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form>
+
+<p class="alert alert-info"><?= t('If you put zero to the low and high priority, this feature will be disabled.') ?></p>
diff --git a/app/Template/task/details.php b/app/Template/task/details.php
index 74799b15..d885ca9c 100644
--- a/app/Template/task/details.php
+++ b/app/Template/task/details.php
@@ -4,6 +4,9 @@
<span class="task-score"><?= $this->e($task['score']) ?></span>
<?php endif ?>
<ul>
+ <li>
+ <strong><?= t('Priority: %d', $task['priority']) ?></strong>
+ </li>
<?php if ($task['reference']): ?>
<li>
<strong><?= t('Reference: %s', $task['reference']) ?></strong>
diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php
index c9f367a0..eaf9024d 100644
--- a/app/Template/task_creation/form.php
+++ b/app/Template/task_creation/form.php
@@ -16,7 +16,7 @@
<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->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?>
<?= $this->form->label(t('Description'), 'description') ?>
@@ -57,32 +57,34 @@
<?= $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->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?>
<?= $this->form->label(t('Category'), 'category_id') ?>
- <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/>
+ <?= $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"')) ?><br/>
+ <?= $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"')) ?><br/>
+ <?= $this->form->select('column_id', $columns_list, $values, $errors, array('tabindex="6"')) ?>
+
+ <?= $this->task->selectPriority($project, $values) ?>
<?= $this->form->label(t('Complexity'), 'score') ?>
- <?= $this->form->number('score', $values, $errors, array('tabindex="8"')) ?><br/>
+ <?= $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="9"')) ?> <?= t('hours') ?><br/>
+ <?= $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="10"'), 'form-date') ?><br/>
+ <?= $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>
</div>
<div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="11"/>
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="12"/>
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
</div>
</form> \ No newline at end of file
diff --git a/app/Template/task_modification/edit_task.php b/app/Template/task_modification/edit_task.php
index 6fdb77b5..2701dd8f 100644
--- a/app/Template/task_modification/edit_task.php
+++ b/app/Template/task_modification/edit_task.php
@@ -8,7 +8,7 @@
<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->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"')) ?>
<?= $this->form->label(t('Description'), 'description') ?>
<div class="form-tabs">
@@ -45,16 +45,18 @@
<?= $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->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?>
<?= $this->form->label(t('Category'), 'category_id') ?>
- <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/>
+ <?= $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"')) ?><br/>
+ <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?>
+
+ <?= $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="7"'), 'form-date') ?><br/>
+ <?= $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>
</div>