From 5c92f467867b43034b9e66b46b3b465ba9db655c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 30 Jan 2016 20:38:20 -0500 Subject: Add external links for tasks with plugin api --- app/Template/board/task_footer.php | 6 +++- app/Template/board/task_menu.php | 1 + app/Template/board/tooltip_external_links.php | 20 +++++++++++ app/Template/comment/create.php | 4 +-- app/Template/task/comments.php | 3 +- app/Template/task/show.php | 17 ++++----- app/Template/task/sidebar.php | 22 ++++++++++-- app/Template/task_creation/form.php | 2 +- app/Template/task_external_link/create.php | 13 +++++++ app/Template/task_external_link/edit.php | 13 +++++++ app/Template/task_external_link/find.php | 32 +++++++++++++++++ app/Template/task_external_link/form.php | 13 +++++++ app/Template/task_external_link/remove.php | 15 ++++++++ app/Template/task_external_link/show.php | 50 +++++++++++++++++++++++++++ app/Template/tasklink/create.php | 4 +-- app/Template/tasklink/show.php | 12 ++++--- 16 files changed, 204 insertions(+), 23 deletions(-) create mode 100644 app/Template/board/tooltip_external_links.php create mode 100644 app/Template/task_external_link/create.php create mode 100644 app/Template/task_external_link/edit.php create mode 100644 app/Template/task_external_link/find.php create mode 100644 app/Template/task_external_link/form.php create mode 100644 app/Template/task_external_link/remove.php create mode 100644 app/Template/task_external_link/show.php (limited to 'app/Template') diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index 26f3b1d4..1912dd83 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -35,7 +35,11 @@ -   + + + + + diff --git a/app/Template/board/task_menu.php b/app/Template/board/task_menu.php index b5ed125d..9e26e15b 100644 --- a/app/Template/board/task_menu.php +++ b/app/Template/board/task_menu.php @@ -7,6 +7,7 @@
  •  url->link(t('Edit this task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
  •  url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
  •  url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
  • +
  •  url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
  •  url->link(t('Add a screenshot'), 'BoardPopover', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
  •  url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'popover') ?>
  • diff --git a/app/Template/board/tooltip_external_links.php b/app/Template/board/tooltip_external_links.php new file mode 100644 index 00000000..7681c06c --- /dev/null +++ b/app/Template/board/tooltip_external_links.php @@ -0,0 +1,20 @@ + + + + + + + + + + + + + +
    + + + e($link['title']) ?> + + e($link['dependency_label']) ?> +
    \ No newline at end of file diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index e9a6404d..8ce9aac3 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -2,7 +2,7 @@

    -
    + form->csrf() ?> form->hidden('task_id', $values) ?> form->hidden('user_id', $values) ?> @@ -41,7 +41,7 @@ - + url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> diff --git a/app/Template/task/comments.php b/app/Template/task/comments.php index 57fb305f..ef85287b 100644 --- a/app/Template/task/comments.php +++ b/app/Template/task/comments.php @@ -28,7 +28,8 @@ 'task_id' => $task['id'], ), 'errors' => array(), - 'task' => $task + 'task' => $task, + 'ajax' => $ajax, )) ?> diff --git a/app/Template/task/show.php b/app/Template/task/show.php index f6d47e53..b848d49e 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -13,14 +13,6 @@ render('task/description', array('task' => $task)) ?> -render('tasklink/show', array( - 'task' => $task, - 'links' => $links, - 'link_label_list' => $link_label_list, - 'editable' => $this->user->hasProjectAccess('tasklink', 'edit', $project['id']), - 'is_public' => false, -)) ?> - render('subtask/show', array( 'task' => $task, 'subtasks' => $subtasks, @@ -29,6 +21,14 @@ 'editable' => $this->user->hasProjectAccess('subtask', 'edit', $project['id']), )) ?> +render('tasklink/show', array( + 'task' => $task, + 'links' => $links, + 'link_label_list' => $link_label_list, + 'editable' => $this->user->hasProjectAccess('tasklink', 'edit', $project['id']), + 'is_public' => false, +)) ?> + render('task/time_tracking_summary', array('task' => $task)) ?> render('file/show', array( @@ -42,4 +42,5 @@ 'comments' => $comments, 'project' => $project, 'editable' => $this->user->hasProjectAccess('comment', 'edit', $project['id']), + 'ajax' => $ajax, )) ?> diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index f522c1c4..b5a2c4b4 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -21,6 +21,25 @@ hook->render('template:task:sidebar:information') ?> + +

    + + user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>