From 5c936a53153cfb50ba17ac31b5bcd2c047dc4d67 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Mon, 5 Jun 2023 09:36:39 +0800 Subject: [PATCH] * Refactor edit effort method. --- module/task/control.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index def9330e05..7749196643 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -489,21 +489,21 @@ class task extends control */ public function editEffort(int $effortID) { - $workhour = $this->task->getEffortByID($workhourID); + $effort = $this->task->getEffortByID($effortID); if(!empty($_POST)) { - $changes = $this->task->updateWorkhour($estimateID); + $changes = $this->task->updateEffort($effortID); if(dao::isError()) return print(js::error(dao::getError())); - $actionID = $this->loadModel('action')->create('task', $estimate->task, 'EditWorkhour', $this->post->work); + $actionID = $this->loadModel('action')->create('task', $effort->task, 'EditEffort', $this->post->work); $this->action->logHistory($actionID, $changes); - return print(js::locate(inlink('recordWorkhour', "taskID={$workhour->task}"), 'parent')); + return print(js::locate(inlink('recordWorkhour', "taskID={$effort->task}"), 'parent')); } - $this->view->title = $this->lang->task->editEffort; - $this->view->workhour = $workhour; - $this->view->task = $this->task->getById($workhour->objectID); + $this->view->title = $this->lang->task->editEffort; + $this->view->effort = $effort; + $this->view->task = $this->task->getById($effort->objectID); $this->display(); }