* when assignTo action, log the diff.
This commit is contained in:
@@ -226,8 +226,10 @@ class task extends control
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$actionID = $this->task->assign($taskID);
|
||||
$changes = $this->task->assign($taskID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
|
||||
+5
-11
@@ -216,25 +216,19 @@ class taskModel extends model
|
||||
$now = helper::now();
|
||||
$oldTask = $this->getById($taskID);
|
||||
$task = fixer::input('post')
|
||||
->cleanFloat('left')
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->setDefault('lastEditedDate', $now)
|
||||
->remove('comment')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)
|
||||
$this->dao->update(TABLE_TASK)
|
||||
->data($task)
|
||||
->autoCheck()
|
||||
->check('`left`', 'float')
|
||||
->check('left', 'float')
|
||||
->where('id')->eq($taskID)->exec();
|
||||
|
||||
$actionID = $this->loadModel('action')->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo);
|
||||
$this->dao->insert(TABLE_HISTORY)
|
||||
->set('company')->eq(1)
|
||||
->set('action')->eq($actionID)
|
||||
->set('field')->eq('assignedTo')
|
||||
->set('old')->eq($oldTask->assignedTo)
|
||||
->set('new')->eq($this->post->assignedTo)
|
||||
->exec();
|
||||
return $actionID;
|
||||
if(!dao::isError()) return common::createChanges($oldTask, $task);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $task->name;?></caption>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user