summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-19 17:03:06 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-19 17:03:06 -0400
commitfcdd71af2cabdd1252172ac83a24be8672ca34cc (patch)
tree7c449d1c30bfa78e33499995ef73df8fdd424df8 /app/Template
parent0dd17c6137b41ace3ce9ae58736326d1a7724c78 (diff)
Prompt user when moving or duplicate a task to another project
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/task/duplicate_project.php24
-rw-r--r--app/Template/task/move_project.php24
-rw-r--r--app/Template/task/sidebar.php6
-rw-r--r--app/Template/task_duplication/copy.php43
-rw-r--r--app/Template/task_duplication/duplicate.php (renamed from app/Template/task/duplicate.php)2
-rw-r--r--app/Template/task_duplication/move.php43
6 files changed, 90 insertions, 52 deletions
diff --git a/app/Template/task/duplicate_project.php b/app/Template/task/duplicate_project.php
deleted file mode 100644
index 9a8e3c4a..00000000
--- a/app/Template/task/duplicate_project.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="page-header">
- <h2><?= t('Duplicate the task to another project') ?></h2>
-</div>
-
-<?php if (empty($projects_list)): ?>
- <p class="alert"><?= t('No project') ?></p>
-<?php else: ?>
-
- <form method="post" action="<?= $this->url->href('task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
-
- <?= $this->form->csrf() ?>
-
- <?= $this->form->hidden('id', $values) ?>
- <?= $this->form->label(t('Project'), 'project_id') ?>
- <?= $this->form->select('project_id', $projects_list, $values, $errors) ?><br/>
-
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- </div>
- </form>
-
-<?php endif ?> \ No newline at end of file
diff --git a/app/Template/task/move_project.php b/app/Template/task/move_project.php
deleted file mode 100644
index b0b33f81..00000000
--- a/app/Template/task/move_project.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="page-header">
- <h2><?= t('Move the task to another project') ?></h2>
-</div>
-
-<?php if (empty($projects_list)): ?>
- <p class="alert"><?= t('No project') ?></p>
-<?php else: ?>
-
- <form method="post" action="<?= $this->url->href('task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
-
- <?= $this->form->csrf() ?>
-
- <?= $this->form->hidden('id', $values) ?>
- <?= $this->form->label(t('Project'), 'project_id') ?>
- <?= $this->form->select('project_id', $projects_list, $values, $errors) ?><br/>
-
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- </div>
- </form>
-
-<?php endif ?> \ No newline at end of file
diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php
index e6a5517a..942e7d01 100644
--- a/app/Template/task/sidebar.php
+++ b/app/Template/task/sidebar.php
@@ -46,13 +46,13 @@
<?= $this->url->link(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
- <?= $this->url->link(t('Duplicate'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
- <?= $this->url->link(t('Duplicate to another project'), 'task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
- <?= $this->url->link(t('Move to another project'), 'task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?php if ($task['is_active'] == 1): ?>
diff --git a/app/Template/task_duplication/copy.php b/app/Template/task_duplication/copy.php
new file mode 100644
index 00000000..f9106c1d
--- /dev/null
+++ b/app/Template/task_duplication/copy.php
@@ -0,0 +1,43 @@
+<div class="page-header">
+ <h2><?= t('Duplicate the task to another project') ?></h2>
+</div>
+
+<?php if (empty($projects_list)): ?>
+ <p class="alert"><?= t('There is no destination project available.') ?></p>
+<?php else: ?>
+
+ <form method="post" action="<?= $this->url->href('taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
+
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('id', $values) ?>
+
+ <?= $this->form->label(t('Project'), 'project_id') ?>
+ <?= $this->form->select(
+ 'project_id',
+ $projects_list,
+ $values,
+ array(),
+ array('data-redirect="'.$this->url->href('taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'dst_project_id' => 'PROJECT_ID')).'"'),
+ 'task-reload-project-destination'
+ ) ?>
+
+ <?= $this->form->label(t('Swimlane'), 'swimlane_id') ?>
+ <?= $this->form->select('swimlane_id', $swimlanes_list, $values) ?>
+
+ <?= $this->form->label(t('Column'), 'column_id') ?>
+ <?= $this->form->select('column_id', $columns_list, $values) ?>
+
+ <?= $this->form->label(t('Category'), 'category_id') ?>
+ <?= $this->form->select('category_id', $categories_list, $values) ?>
+
+ <?= $this->form->label(t('Assignee'), 'owner_id') ?>
+ <?= $this->form->select('owner_id', $users_list, $values) ?>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ </div>
+ </form>
+
+<?php endif ?> \ No newline at end of file
diff --git a/app/Template/task/duplicate.php b/app/Template/task_duplication/duplicate.php
index e74d2906..4b50d9ca 100644
--- a/app/Template/task/duplicate.php
+++ b/app/Template/task_duplication/duplicate.php
@@ -8,7 +8,7 @@
</p>
<div class="form-actions">
- <?= $this->url->link(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
+ <?= $this->url->link(t('Yes'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</div>
diff --git a/app/Template/task_duplication/move.php b/app/Template/task_duplication/move.php
new file mode 100644
index 00000000..e90424a2
--- /dev/null
+++ b/app/Template/task_duplication/move.php
@@ -0,0 +1,43 @@
+<div class="page-header">
+ <h2><?= t('Move the task to another project') ?></h2>
+</div>
+
+<?php if (empty($projects_list)): ?>
+ <p class="alert"><?= t('There is no destination project available.') ?></p>
+<?php else: ?>
+
+ <form method="post" action="<?= $this->url->href('taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
+
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('id', $values) ?>
+
+ <?= $this->form->label(t('Project'), 'project_id') ?>
+ <?= $this->form->select(
+ 'project_id',
+ $projects_list,
+ $values,
+ array(),
+ array('data-redirect="'.$this->url->href('taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'dst_project_id' => 'PROJECT_ID')).'"'),
+ 'task-reload-project-destination'
+ ) ?>
+
+ <?= $this->form->label(t('Swimlane'), 'swimlane_id') ?>
+ <?= $this->form->select('swimlane_id', $swimlanes_list, $values) ?>
+
+ <?= $this->form->label(t('Column'), 'column_id') ?>
+ <?= $this->form->select('column_id', $columns_list, $values) ?>
+
+ <?= $this->form->label(t('Category'), 'category_id') ?>
+ <?= $this->form->select('category_id', $categories_list, $values) ?>
+
+ <?= $this->form->label(t('Assignee'), 'owner_id') ?>
+ <?= $this->form->select('owner_id', $users_list, $values) ?>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ </div>
+ </form>
+
+<?php endif ?> \ No newline at end of file