From 6d388ec48d04481883aeb08b3aa4cbb9063ce3a4 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 3 Feb 2016 18:43:31 -0500 Subject: Remove description textarea from task edit form --- app/Helper/Task.php | 15 +++++++-- app/Template/task_modification/edit_task.php | 46 +++++++--------------------- 2 files changed, 24 insertions(+), 37 deletions(-) (limited to 'app') diff --git a/app/Helper/Task.php b/app/Helper/Task.php index 192cce49..1cb36b86 100644 --- a/app/Helper/Task.php +++ b/app/Helper/Task.php @@ -129,10 +129,21 @@ class Task extends Base return $html; } + public function selectTimeSpent(array $values, array $errors = array(), array $attributes = array()) + { + $attributes = array_merge(array('tabindex="10"'), $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; + } + public function selectStartDate(array $values, array $errors = array(), array $attributes = array()) { $placeholder = $this->helper->text->in($this->config->get('application_date_format'), $this->dateParser->getAvailableFormats()); - $attributes = array_merge(array('tabindex="10"', 'placeholder="'.$placeholder.'"'), $attributes); + $attributes = array_merge(array('tabindex="11"', 'placeholder="'.$placeholder.'"'), $attributes); $html = $this->helper->form->label(t('Start Date'), 'date_started'); $html .= $this->helper->form->text('date_started', $values, $errors, $attributes, 'form-date'); @@ -143,7 +154,7 @@ class Task extends Base public function selectDueDate(array $values, array $errors = array(), array $attributes = array()) { $placeholder = $this->helper->text->in($this->config->get('application_date_format'), $this->dateParser->getAvailableFormats()); - $attributes = array_merge(array('tabindex="11"', 'placeholder="'.$placeholder.'"'), $attributes); + $attributes = array_merge(array('tabindex="12"', 'placeholder="'.$placeholder.'"'), $attributes); $html = $this->helper->form->label(t('Due Date'), 'date_due'); $html .= $this->helper->form->text('date_due', $values, $errors, $attributes, 'form-date'); diff --git a/app/Template/task_modification/edit_task.php b/app/Template/task_modification/edit_task.php index fe7fb009..7365648b 100644 --- a/app/Template/task_modification/edit_task.php +++ b/app/Template/task_modification/edit_task.php @@ -4,52 +4,28 @@
form->csrf() ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?>
- form->label(t('Title'), 'title') ?> form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"')) ?> - - form->label(t('Description'), 'description') ?> -
-
- form->textarea( - 'description', - $values, - $errors, - array( - 'placeholder="'.t('Leave a description').'"', - 'tabindex="2"', - 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"' - ) - ) ?> -
-
-
-
-
    -
  • - -
  • -
  • - -
  • -
-
- - render('task/color_picker', array('colors_list' => $colors_list, 'values' => $values)) ?> -
- -
- form->hidden('id', $values) ?> - form->hidden('project_id', $values) ?> task->selectAssignee($users_list, $values, $errors) ?> task->selectCategory($categories_list, $values, $errors) ?> task->selectPriority($project, $values) ?> task->selectScore($values, $errors) ?> +
+ +
+ task->selectTimeEstimated($values, $errors) ?> + task->selectTimeSpent($values, $errors) ?> task->selectDueDate($values, $errors) ?>
+
+ render('task/color_picker', array('colors_list' => $colors_list, 'values' => $values)) ?> +
+
-- cgit v1.2.3