summaryrefslogtreecommitdiff
path: root/app/Template/task_modification
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-30 22:25:16 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-30 22:25:16 -0500
commitbb040cfb78d53696edd63bf256d0fd8ba3ccdbfa (patch)
tree811d150fddd6220faabb3c1ea1743ffd7f781e45 /app/Template/task_modification
parent4a52d327f7e555c336a428c457cf40c3d97bfab3 (diff)
Simplify code to handle ajax popover and redirects
Diffstat (limited to 'app/Template/task_modification')
-rw-r--r--app/Template/task_modification/edit_description.php8
-rw-r--r--app/Template/task_modification/edit_task.php8
2 files changed, 4 insertions, 12 deletions
diff --git a/app/Template/task_modification/edit_description.php b/app/Template/task_modification/edit_description.php
index c38e885d..f5a9b0e1 100644
--- a/app/Template/task_modification/edit_description.php
+++ b/app/Template/task_modification/edit_description.php
@@ -2,7 +2,7 @@
<h2><?= t('Edit the description') ?></h2>
</div>
-<form method="post" action="<?= $this->url->href('taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
+<form class="popover-form" method="post" action="<?= $this->url->href('taskmodification', 'updateDescription', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('id', $values) ?>
@@ -39,10 +39,6 @@
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
- <?php if ($ajax): ?>
- <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
- <?php else: ?>
- <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- <?php endif ?>
+ <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
</div>
</form>
diff --git a/app/Template/task_modification/edit_task.php b/app/Template/task_modification/edit_task.php
index 2701dd8f..f825f4a4 100644
--- a/app/Template/task_modification/edit_task.php
+++ b/app/Template/task_modification/edit_task.php
@@ -1,7 +1,7 @@
<div class="page-header">
<h2><?= t('Edit a task') ?></h2>
</div>
-<form id="task-form" method="post" action="<?= $this->url->href('taskmodification', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
+<form class="popover-form" method="post" action="<?= $this->url->href('taskmodification', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
@@ -63,10 +63,6 @@
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="10">
<?= t('or') ?>
- <?php if ($ajax): ?>
- <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?>
- <?php else: ?>
- <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- <?php endif ?>
+ <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
</div>
</form> \ No newline at end of file