* [ticket#1788,done,0.5h] add edit action for effort.
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user