From 8a6f02735b628033a3284d06a9f633bd260e19ef Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 15 May 2016 20:09:43 -0400 Subject: Added task creation menu for all projects views --- app/Template/board/table_column.php | 8 ++--- app/Template/board/table_container.php | 4 +-- app/Template/listing/show.php | 2 +- app/Template/project_header/dropdown.php | 20 ++++++++---- app/Template/task_bulk/show.php | 2 +- app/Template/task_creation/form.php | 53 -------------------------------- app/Template/task_creation/show.php | 53 ++++++++++++++++++++++++++++++++ 7 files changed, 75 insertions(+), 67 deletions(-) delete mode 100644 app/Template/task_creation/form.php create mode 100644 app/Template/task_creation/show.php (limited to 'app/Template') diff --git a/app/Template/board/table_column.php b/app/Template/board/table_column.php index e2f69036..a356849c 100644 --- a/app/Template/board/table_column.php +++ b/app/Template/board/table_column.php @@ -12,9 +12,9 @@
- user->hasProjectAccess('taskcreation', 'create', $column['project_id'])): ?> + user->hasProjectAccess('TaskCreationController', 'show', $column['project_id'])): ?>
- url->link('+', 'taskcreation', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover', t('Add a new task')) ?> + url->link('+', 'TaskCreationController', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover', t('Add a new task')) ?>
@@ -35,10 +35,10 @@ - user->hasProjectAccess('Taskcreation', 'create', $column['project_id'])): ?> + user->hasProjectAccess('TaskCreationController', 'show', $column['project_id'])): ?>
  • - url->link(t('Create tasks in bulk'), 'TaskBulk', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?> + url->link(t('Create tasks in bulk'), 'TaskBulkController', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?>
  • 0): ?>
  • diff --git a/app/Template/board/table_container.php b/app/Template/board/table_container.php index e30f9ce8..82bbec93 100644 --- a/app/Template/board/table_container.php +++ b/app/Template/board/table_container.php @@ -13,7 +13,7 @@ data-save-url="url->href('board', 'save', array('project_id' => $project['id'])) ?>" data-reload-url="url->href('board', 'reload', array('project_id' => $project['id'])) ?>" data-check-url="url->href('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" - data-task-creation-url="url->href('taskcreation', 'create', array('project_id' => $project['id'])) ?>" + data-task-creation-url="url->href('TaskCreationController', 'show', array('project_id' => $project['id'])) ?>" > @@ -55,4 +55,4 @@ -
  • \ No newline at end of file + diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php index 98b9528a..a5cba1c4 100644 --- a/app/Template/listing/show.php +++ b/app/Template/listing/show.php @@ -59,4 +59,4 @@ - \ No newline at end of file + diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php index fdfcaf26..1aa59a8d 100644 --- a/app/Template/project_header/dropdown.php +++ b/app/Template/project_header/dropdown.php @@ -30,21 +30,29 @@ + user->hasProjectAccess('TaskCreationController', 'show', $project['id'])): ?> +
  • + + url->link(t('Add a new task'), 'TaskCreationController', 'show', array('project_id' => $project['id']), false, 'popover') ?> +
  • + +
  • -   + url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
  • user->hasProjectAccess('customfilter', 'index', $project['id'])): ?>
  • -   + url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
  • -  url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?> + + url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
  • @@ -52,21 +60,21 @@ user->hasProjectAccess('analytic', 'tasks', $project['id'])): ?>
  • -   + url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
  • user->hasProjectAccess('export', 'tasks', $project['id'])): ?>
  • -   + url->link(t('Exports'), 'export', 'tasks', array('project_id' => $project['id'])) ?>
  • user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
  • -   + url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
  • diff --git a/app/Template/task_bulk/show.php b/app/Template/task_bulk/show.php index 628b2c27..5f76f808 100644 --- a/app/Template/task_bulk/show.php +++ b/app/Template/task_bulk/show.php @@ -2,7 +2,7 @@

    -
    + form->csrf() ?> form->hidden('column_id', $values) ?> form->hidden('swimlane_id', $values) ?> diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php deleted file mode 100644 index c963bdcf..00000000 --- a/app/Template/task_creation/form.php +++ /dev/null @@ -1,53 +0,0 @@ - - - - - form->csrf() ?> - -
    - form->label(t('Title'), 'title') ?> - form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?> - - 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' => $values['project_id'])).'"' - ), - 'markdown-editor' - ) ?> - - render('task/color_picker', array('colors_list' => $colors_list, 'values' => $values)) ?> - - - form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> - - - hook->render('template:task:form:left-column', array('values' => $values, 'errors' => $errors)) ?> -
    - -
    - form->hidden('project_id', $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->selectScore($values, $errors) ?> - task->selectTimeEstimated($values, $errors) ?> - task->selectDueDate($values, $errors) ?> - - hook->render('template:task:form:right-column', array('values' => $values, 'errors' => $errors)) ?> -
    - -
    - - url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?> -
    -
    diff --git a/app/Template/task_creation/show.php b/app/Template/task_creation/show.php new file mode 100644 index 00000000..d3991177 --- /dev/null +++ b/app/Template/task_creation/show.php @@ -0,0 +1,53 @@ + + +
    + + form->csrf() ?> + +
    + form->label(t('Title'), 'title') ?> + form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?> + + 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' => $values['project_id'])).'"' + ), + 'markdown-editor' + ) ?> + + render('task/color_picker', array('colors_list' => $colors_list, 'values' => $values)) ?> + + + form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> + + + hook->render('template:task:form:left-column', array('values' => $values, 'errors' => $errors)) ?> +
    + +
    + form->hidden('project_id', $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->selectScore($values, $errors) ?> + task->selectTimeEstimated($values, $errors) ?> + task->selectDueDate($values, $errors) ?> + + hook->render('template:task:form:right-column', array('values' => $values, 'errors' => $errors)) ?> +
    + +
    + + url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?> +
    +
    -- cgit v1.2.3