summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
Diffstat (limited to 'app/Helper')
-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())