From ffa87d39584542e97cab98533524daa15ae012b8 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 10 Apr 2024 15:53:13 +0800 Subject: [PATCH] * Fix bug #47706. --- module/task/zen.php | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/module/task/zen.php b/module/task/zen.php index b94c1d8bbf..32a8e2ea5e 100644 --- a/module/task/zen.php +++ b/module/task/zen.php @@ -1585,8 +1585,13 @@ class taskZen extends task $response['message'] = $this->lang->saveSuccess; $response['closeModal'] = $this->app->rawMethod != 'recordworkhour' || $from == 'edittask'; - $execution = $this->loadModel('execution')->getByID((int)$task->execution); + if($this->app->rawMethod == 'recordworkhour') + { + $response['callback'] = $from == 'edittask' ? "refreshConsumed('{$task->consumed}');" : "loadModal('" . inLink('recordworkhour', "taskID={$task->id}") . "', '#modal-record-hours-task-{$task->id}')"; + return $response; + } + $execution = $this->loadModel('execution')->getByID((int)$task->execution); $inLiteKanban = $this->config->vision == 'lite' && $this->app->tab == 'project' && $this->session->kanbanview == 'kanban'; if((($this->app->tab == 'execution' || $inLiteKanban) && $execution->type == 'kanban') || $from == 'taskkanban') { @@ -1594,21 +1599,7 @@ class taskZen extends task return $response; } - if($this->app->rawMethod == 'recordworkhour') - { - if($from == 'edittask') - { - $response['callback'] = "refreshConsumed('{$task->consumed}');"; - } - else - { - $response['callback'] = "loadModal('" . inLink('recordworkhour', "taskID={$task->id}") . "', '#modal-record-hours-task-{$task->id}')"; - } - } - else - { - $response['load'] = $from != 'edittask'; - } + $response['load'] = $from != 'edittask'; return $response; }