summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-26 14:34:03 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-26 14:34:03 -0500
commit9bcf97a6c9110afd62b542b92d07d27f945eda96 (patch)
tree6a31787c7be18204b60968cf18d1649afb759335 /app/Helper
parent27328255cd727f188e735c2202d0ee95db265677 (diff)
Project priority is always rendered now
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/TaskHelper.php26
1 files changed, 9 insertions, 17 deletions
diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php
index 9484a479..69520c03 100644
--- a/app/Helper/TaskHelper.php
+++ b/app/Helper/TaskHelper.php
@@ -143,16 +143,12 @@ class TaskHelper extends Base
public function renderPriorityField(array $project, array $values)
{
- $html = '';
-
- if ($project['priority_end'] != $project['priority_start']) {
- $range = range($project['priority_start'], $project['priority_end']);
- $options = array_combine($range, $range);
- $values += array('priority' => $project['priority_default']);
+ $range = range($project['priority_start'], $project['priority_end']);
+ $options = array_combine($range, $range);
+ $values += array('priority' => $project['priority_default']);
- $html .= $this->helper->form->label(t('Priority'), 'priority');
- $html .= $this->helper->form->select('priority', $options, $values, array(), array('tabindex="7"'));
- }
+ $html = $this->helper->form->label(t('Priority'), 'priority');
+ $html .= $this->helper->form->select('priority', $options, $values, array(), array('tabindex="7"'));
return $html;
}
@@ -211,15 +207,11 @@ class TaskHelper extends Base
return $this->helper->form->date(t('Due Date'), 'date_due', $values, $errors, $attributes);
}
- public function formatPriority(array $project, array $task)
+ public function renderPriority($priority)
{
- $html = '';
-
- if ($project['priority_end'] != $project['priority_start']) {
- $html .= '<span class="task-board-priority" title="'.t('Task priority').'">';
- $html .= $task['priority'] >= 0 ? 'P'.$task['priority'] : '-P'.abs($task['priority']);
- $html .= '</span>';
- }
+ $html = '<span class="task-priority" title="'.t('Task priority').'">';
+ $html .= $this->helper->text->e($priority >= 0 ? 'P'.$priority : '-P'.abs($priority));
+ $html .= '</span>';
return $html;
}