* [ticket#1788,done,0.5h] add edit action for effort.

This commit is contained in:
tianshujie
2025-02-17 10:29:46 +08:00
committed by 刘梦艺
parent 2c77fa9a4f
commit 87752cef41
+8
View File
@@ -527,6 +527,7 @@ class task extends control
$effort = $this->task->getEffortByID($effortID);
if(!empty($_POST))
{
if($this->config->edition != 'open') $oldEffort = $this->loadModel('effort')->fetchByID($effortID);
$formData = form::data($this->config->task->form->editEffort)->add('id', $effortID)->get();
$changes = $this->task->updateEffort($formData);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
@@ -534,6 +535,13 @@ class task extends control
$actionID = $this->loadModel('action')->create('task', $effort->objectID, 'EditEffort', $this->post->work);
$this->action->logHistory($actionID, $changes);
if($this->config->edition != 'open')
{
$effort = $this->effort->fetchByID($effortID);
$actionID = $this->action->create('effort', $effortID, 'edited');
$this->action->logHistory($actionID, common::createChanges($oldEffort, $effort));
}
$url = $this->createLink($this->app->rawModule, 'recordWorkhour', "taskID={$effort->objectID}");
return $this->send(array(
'result' => 'success',