From 5ce0ebdd26c051049955ad4f1cc3b2659c083e9a Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 8 Jan 2017 18:07:38 -0500 Subject: Rename methods to render fields in TaskHelper and SubtaskHelper --- app/Helper/SubtaskHelper.php | 8 +++---- app/Helper/TaskHelper.php | 32 +++++++++++++-------------- app/Template/external_task_creation/step1.php | 2 +- app/Template/subtask/create.php | 7 +++--- app/Template/subtask/edit.php | 10 +++++---- app/Template/task_bulk/show.php | 6 ++--- app/Template/task_creation/show.php | 30 ++++++++++++------------- app/Template/task_modification/show.php | 26 +++++++++++----------- 8 files changed, 62 insertions(+), 59 deletions(-) (limited to 'app') diff --git a/app/Helper/SubtaskHelper.php b/app/Helper/SubtaskHelper.php index 833544a7..8e090f17 100644 --- a/app/Helper/SubtaskHelper.php +++ b/app/Helper/SubtaskHelper.php @@ -50,7 +50,7 @@ class SubtaskHelper extends Base return $this->helper->url->link($this->getTitle($subtask), 'SubtaskStatusController', 'change', $params, false, $class); } - public function selectTitle(array $values, array $errors = array(), array $attributes = array()) + public function renderTitleField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="1"', 'required', 'maxlength="255"'), $attributes); @@ -60,7 +60,7 @@ class SubtaskHelper extends Base return $html; } - public function selectAssignee(array $users, array $values, array $errors = array(), array $attributes = array()) + public function renderAssigneeField(array $users, array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="2"'), $attributes); @@ -74,7 +74,7 @@ class SubtaskHelper extends Base return $html; } - public function selectTimeEstimated(array $values, array $errors = array(), array $attributes = array()) + public function renderTimeEstimatedField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="3"'), $attributes); @@ -85,7 +85,7 @@ class SubtaskHelper extends Base return $html; } - public function selectTimeSpent(array $values, array $errors = array(), array $attributes = array()) + public function renderTimeSpentField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="4"'), $attributes); diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index a13ad18b..71596b60 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -40,7 +40,7 @@ class TaskHelper extends Base return $this->taskRecurrenceModel->getRecurrenceBasedateList(); } - public function selectTitle(array $values, array $errors) + public function renderTitleField(array $values, array $errors) { return $this->helper->form->text( 'title', @@ -56,12 +56,12 @@ class TaskHelper extends Base ); } - public function selectDescription(array $values, array $errors) + public function renderDescriptionField(array $values, array $errors) { return $this->helper->form->textEditor('description', $values, $errors, array('tabindex' => 2)); } - public function selectTags(array $project, array $tags = array()) + public function renderTagField(array $project, array $tags = array()) { $options = $this->tagModel->getAssignableList($project['id']); @@ -83,7 +83,7 @@ class TaskHelper extends Base return $html; } - public function selectColor(array $values) + public function renderColorField(array $values) { $colors = $this->colorModel->getList(); $html = $this->helper->form->label(t('Color'), 'color_id'); @@ -91,7 +91,7 @@ class TaskHelper extends Base return $html; } - public function selectAssignee(array $users, array $values, array $errors = array(), array $attributes = array()) + public function renderAssigneeField(array $users, array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="3"'), $attributes); @@ -105,7 +105,7 @@ class TaskHelper extends Base return $html; } - public function selectCategory(array $categories, array $values, array $errors = array(), array $attributes = array(), $allow_one_item = false) + public function renderCategoryField(array $categories, array $values, array $errors = array(), array $attributes = array(), $allow_one_item = false) { $attributes = array_merge(array('tabindex="4"'), $attributes); $html = ''; @@ -118,7 +118,7 @@ class TaskHelper extends Base return $html; } - public function selectSwimlane(array $swimlanes, array $values, array $errors = array(), array $attributes = array()) + public function renderSwimlaneField(array $swimlanes, array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="5"'), $attributes); $html = ''; @@ -131,7 +131,7 @@ class TaskHelper extends Base return $html; } - public function selectColumn(array $columns, array $values, array $errors = array(), array $attributes = array()) + public function renderColumnField(array $columns, array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="6"'), $attributes); @@ -141,7 +141,7 @@ class TaskHelper extends Base return $html; } - public function selectPriority(array $project, array $values) + public function renderPriorityField(array $project, array $values) { $html = ''; @@ -157,7 +157,7 @@ class TaskHelper extends Base return $html; } - public function selectScore(array $values, array $errors = array(), array $attributes = array()) + public function renderScoreField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="13"'), $attributes); @@ -167,7 +167,7 @@ class TaskHelper extends Base return $html; } - public function selectReference(array $values, array $errors = array(), array $attributes = array()) + public function renderReferenceField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="14"'), $attributes); @@ -177,7 +177,7 @@ class TaskHelper extends Base return $html; } - public function selectTimeEstimated(array $values, array $errors = array(), array $attributes = array()) + public function renderTimeEstimatedField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="11"'), $attributes); @@ -188,7 +188,7 @@ class TaskHelper extends Base return $html; } - public function selectTimeSpent(array $values, array $errors = array(), array $attributes = array()) + public function renderTimeSpentField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="12"'), $attributes); @@ -199,13 +199,13 @@ class TaskHelper extends Base return $html; } - public function selectStartDate(array $values, array $errors = array(), array $attributes = array()) + public function renderStartDateField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="10"'), $attributes); return $this->helper->form->datetime(t('Start Date'), 'date_started', $values, $errors, $attributes); } - public function selectDueDate(array $values, array $errors = array(), array $attributes = array()) + public function renderDueDateField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="9"'), $attributes); return $this->helper->form->date(t('Due Date'), 'date_due', $values, $errors, $attributes); @@ -251,7 +251,7 @@ class TaskHelper extends Base 'step1', array('project_id' => $projectId, 'swimlane_id' => $swimlaneId, 'column_id' => $columnId, 'provider_name' => $providerName), false, - 'popover-link' + 'js-modal-replace' ); $html .= '
  • '.$link.'
  • '; diff --git a/app/Template/external_task_creation/step1.php b/app/Template/external_task_creation/step1.php index 415b02ef..2a3b0144 100644 --- a/app/Template/external_task_creation/step1.php +++ b/app/Template/external_task_creation/step1.php @@ -12,5 +12,5 @@
    text->e($error_message) ?>
    - modal->submitButtons(t('Next')) ?> + modal->submitButtons(array('submitLabel' => t('Next'))) ?> diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php index ade9686e..96ad7a46 100644 --- a/app/Template/subtask/create.php +++ b/app/Template/subtask/create.php @@ -6,9 +6,10 @@ form->csrf() ?> form->hidden('task_id', $values) ?> - subtask->selectTitle($values, $errors, array('autofocus')) ?> - subtask->selectAssignee($users_list, $values, $errors) ?> - subtask->selectTimeEstimated($values, $errors) ?> + subtask->renderTitleField($values, $errors, array('autofocus')) ?> + subtask->renderAssigneeField($users_list, $values, $errors) ?> + subtask->renderTimeEstimatedField($values, $errors) ?> + hook->render('template:subtask:form:create', array('values' => $values, 'errors' => $errors)) ?> form->checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?> diff --git a/app/Template/subtask/edit.php b/app/Template/subtask/edit.php index b34b93a8..7c0266a8 100644 --- a/app/Template/subtask/edit.php +++ b/app/Template/subtask/edit.php @@ -6,10 +6,12 @@ form->csrf() ?> form->hidden('id', $values) ?> form->hidden('task_id', $values) ?> - subtask->selectTitle($values, $errors, array('autofocus')) ?> - subtask->selectAssignee($users_list, $values, $errors) ?> - subtask->selectTimeEstimated($values, $errors) ?> - subtask->selectTimeSpent($values, $errors) ?> + + subtask->renderTitleField($values, $errors, array('autofocus')) ?> + subtask->renderAssigneeField($users_list, $values, $errors) ?> + subtask->renderTimeEstimatedField($values, $errors) ?> + subtask->renderTimeSpentField($values, $errors) ?> + hook->render('template:subtask:form:edit', array('values' => $values, 'errors' => $errors)) ?> modal->submitButtons() ?> diff --git a/app/Template/task_bulk/show.php b/app/Template/task_bulk/show.php index 2442779d..acf80d8c 100644 --- a/app/Template/task_bulk/show.php +++ b/app/Template/task_bulk/show.php @@ -8,9 +8,9 @@ form->hidden('swimlane_id', $values) ?> form->hidden('project_id', $values) ?> - task->selectColor($values) ?> - task->selectAssignee($users_list, $values, $errors) ?> - task->selectCategory($categories_list, $values, $errors) ?> + task->renderColorField($values) ?> + task->renderAssigneeField($users_list, $values, $errors) ?> + task->renderCategoryField($categories_list, $values, $errors) ?> form->label(t('Tasks'), 'tasks') ?> form->textarea('tasks', $values, $errors, array('placeholder="'.t('My task title').'"')) ?> diff --git a/app/Template/task_creation/show.php b/app/Template/task_creation/show.php index 56e4b398..e957087f 100644 --- a/app/Template/task_creation/show.php +++ b/app/Template/task_creation/show.php @@ -7,31 +7,31 @@
    - task->selectTitle($values, $errors) ?> - task->selectDescription($values, $errors) ?> - task->selectTags($project) ?> + task->renderTitleField($values, $errors) ?> + task->renderDescriptionField($values, $errors) ?> + task->renderTagField($project) ?> hook->render('template:task:form:first-column', array('values' => $values, 'errors' => $errors)) ?>
    - task->selectColor($values) ?> - task->selectAssignee($users_list, $values, $errors) ?> - task->selectCategory($categories_list, $values, $errors) ?> - task->selectSwimlane($swimlanes_list, $values, $errors) ?> - task->selectColumn($columns_list, $values, $errors) ?> - task->selectPriority($project, $values) ?> + task->renderColorField($values) ?> + task->renderAssigneeField($users_list, $values, $errors) ?> + task->renderCategoryField($categories_list, $values, $errors) ?> + task->renderSwimlaneField($swimlanes_list, $values, $errors) ?> + task->renderColumnField($columns_list, $values, $errors) ?> + task->renderPriorityField($project, $values) ?> hook->render('template:task:form:second-column', array('values' => $values, 'errors' => $errors)) ?>
    - task->selectDueDate($values, $errors) ?> - task->selectStartDate($values, $errors) ?> - task->selectTimeEstimated($values, $errors) ?> - task->selectTimeSpent($values, $errors) ?> - task->selectScore($values, $errors) ?> - task->selectReference($values, $errors) ?> + task->renderDueDateField($values, $errors) ?> + task->renderStartDateField($values, $errors) ?> + task->renderTimeEstimatedField($values, $errors) ?> + task->renderTimeSpentField($values, $errors) ?> + task->renderScoreField($values, $errors) ?> + task->renderReferenceField($values, $errors) ?> hook->render('template:task:form:third-column', array('values' => $values, 'errors' => $errors)) ?>
    diff --git a/app/Template/task_modification/show.php b/app/Template/task_modification/show.php index 23a0a43b..710abedf 100644 --- a/app/Template/task_modification/show.php +++ b/app/Template/task_modification/show.php @@ -8,29 +8,29 @@
    - task->selectTitle($values, $errors) ?> - task->selectDescription($values, $errors) ?> - task->selectTags($project, $tags) ?> + task->renderTitleField($values, $errors) ?> + task->renderDescriptionField($values, $errors) ?> + task->renderTagField($project, $tags) ?> hook->render('template:task:form:first-column', array('values' => $values, 'errors' => $errors)) ?>
    - task->selectColor($values) ?> - task->selectAssignee($users_list, $values, $errors) ?> - task->selectCategory($categories_list, $values, $errors) ?> - task->selectPriority($project, $values) ?> + task->renderColorField($values) ?> + task->renderAssigneeField($users_list, $values, $errors) ?> + task->renderCategoryField($categories_list, $values, $errors) ?> + task->renderPriorityField($project, $values) ?> hook->render('template:task:form:second-column', array('values' => $values, 'errors' => $errors)) ?>
    - task->selectDueDate($values, $errors) ?> - task->selectStartDate($values, $errors) ?> - task->selectTimeEstimated($values, $errors) ?> - task->selectTimeSpent($values, $errors) ?> - task->selectScore($values, $errors) ?> - task->selectReference($values, $errors) ?> + task->renderDueDateField($values, $errors) ?> + task->renderStartDateField($values, $errors) ?> + task->renderTimeEstimatedField($values, $errors) ?> + task->renderTimeSpentField($values, $errors) ?> + task->renderScoreField($values, $errors) ?> + task->renderReferenceField($values, $errors) ?> hook->render('template:task:form:third-column', array('values' => $values, 'errors' => $errors)) ?>
    -- cgit v1.2.3