diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-06-24 15:43:34 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-06-24 15:43:34 -0400 |
commit | 18cb7ad0a4a96be63030f5207b74a195c8b6cd6c (patch) | |
tree | 719898528a9df56f6d8ea4abaee54b9542e3d434 /app/Helper | |
parent | b2e92480c29acb15586bc8ea305c8416927a667c (diff) |
Expose tags to the user interface (first prototype)
Diffstat (limited to 'app/Helper')
-rw-r--r-- | app/Helper/TaskHelper.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index e33438d6..f272059d 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -40,6 +40,34 @@ class TaskHelper extends Base return $this->taskModel->getRecurrenceBasedateList(); } + public function selectTitle(array $values, array $errors) + { + $html = $this->helper->form->label(t('Title'), 'title'); + $html .= $this->helper->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large'); + return $html; + } + + public function selectTags(array $project, array $tags = array()) + { + $options = $this->tagModel->getAssignableList($project['id']); + + $html = $this->helper->form->label(t('Tags'), 'tags[]'); + $html .= '<select name="tags[]" id="form-tags" class="tag-autocomplete" multiple>'; + + foreach ($options as $tag) { + $html .= sprintf( + '<option value="%s" %s>%s</option>', + $this->helper->text->e($tag), + in_array($tag, $tags) ? 'selected="selected"' : '', + $this->helper->text->e($tag) + ); + } + + $html .= '</select>'; + + return $html; + } + public function selectAssignee(array $users, array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="3"'), $attributes); |