summaryrefslogtreecommitdiff
path: root/app/Helper/Subtask.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-05 18:30:16 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-05 18:30:16 -0500
commit4e07ad6555bee33c6e48992f8f8e56706aff7c58 (patch)
tree1921c1c080133a6c9bd67119b282d3dbd313e4b2 /app/Helper/Subtask.php
parent9c15658089ec5bd3914b91c7a59fdb522e837b70 (diff)
Improve subtask toggle status and timer
Diffstat (limited to 'app/Helper/Subtask.php')
-rw-r--r--app/Helper/Subtask.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/Helper/Subtask.php b/app/Helper/Subtask.php
index 38074b78..1784a2bf 100644
--- a/app/Helper/Subtask.php
+++ b/app/Helper/Subtask.php
@@ -29,21 +29,23 @@ class Subtask extends \Kanboard\Core\Base
* @access public
* @param array $subtask
* @param integer $project_id
+ * @param boolean $refresh_table
* @return string
*/
- public function toggleStatus(array $subtask, $project_id)
+ public function toggleStatus(array $subtask, $project_id, $refresh_table = false)
{
if (! $this->helper->user->hasProjectAccess('subtask', 'edit', $project_id)) {
return $this->getTitle($subtask);
}
- $params = array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']);
+ $params = array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'refresh-table' => (int) $refresh_table);
if ($subtask['status'] == 0 && isset($this->sessionStorage->hasSubtaskInProgress) && $this->sessionStorage->hasSubtaskInProgress) {
return $this->helper->url->link($this->getTitle($subtask), 'SubtaskRestriction', 'popover', $params, false, 'popover');
}
- return $this->helper->url->link($this->getTitle($subtask), 'SubtaskStatus', 'change', $params, false, 'ajax-replace');
+ $class = 'subtask-toggle-status '.($refresh_table ? 'subtask-refresh-table' : '');
+ return $this->helper->url->link($this->getTitle($subtask), 'SubtaskStatus', 'change', $params, false, $class);
}
public function selectTitle(array $values, array $errors = array(), array $attributes = array())