From 3eec6b72e64cc920e11b0efade6ea74ed30eb0ab Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 31 Jan 2016 12:02:55 -0500 Subject: Move subtask form elements to subtask helper --- app/Helper/Subtask.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'app/Helper/Subtask.php') diff --git a/app/Helper/Subtask.php b/app/Helper/Subtask.php index 90bd733e..5b8d7d90 100644 --- a/app/Helper/Subtask.php +++ b/app/Helper/Subtask.php @@ -43,4 +43,47 @@ class Subtask extends \Kanboard\Core\Base array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'redirect' => $redirect) ); } + + public function selectTitle(array $values, array $errors = array(), array $attributes = array()) + { + $attributes = array_merge(array('tabindex="1"', 'required', 'maxlength="255"'), $attributes); + + $html = $this->helper->form->label(t('Title'), 'title'); + $html .= $this->helper->form->text('title', $values, $errors, $attributes); + + return $html; + } + + public function selectAssignee(array $users, array $values, array $errors = array(), array $attributes = array()) + { + $attributes = array_merge(array('tabindex="2"'), $attributes); + + $html = $this->helper->form->label(t('Assignee'), 'user_id'); + $html .= $this->helper->form->select('user_id', $users, $values, $errors, $attributes); + $html .= ' '.t('Me').''; + + return $html; + } + + public function selectTimeEstimated(array $values, array $errors = array(), array $attributes = array()) + { + $attributes = array_merge(array('tabindex="3"'), $attributes); + + $html = $this->helper->form->label(t('Original estimate'), 'time_estimated'); + $html .= $this->helper->form->numeric('time_estimated', $values, $errors, $attributes); + $html .= ' '.t('hours'); + + return $html; + } + + public function selectTimeSpent(array $values, array $errors = array(), array $attributes = array()) + { + $attributes = array_merge(array('tabindex="4"'), $attributes); + + $html = $this->helper->form->label(t('Time spent'), 'time_spent'); + $html .= $this->helper->form->numeric('time_spent', $values, $errors, $attributes); + $html .= ' '.t('hours'); + + return $html; + } } -- cgit v1.2.3