* finish task #1393.

This commit is contained in:
wangyidong
2014-07-25 05:53:25 +00:00
parent e6797bddde
commit c49bc171fc
7 changed files with 31 additions and 29 deletions

View File

@@ -548,6 +548,8 @@ class bug extends control
foreach($allChanges as $bugID => $changes)
{
if(empty($changes)) continue;
$actionID = $this->action->create('bug', $bugID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($bugID, $actionID);

View File

@@ -244,11 +244,10 @@ class product extends control
{
foreach($allChanges as $productID => $changes)
{
if(!empty($changes))
{
$actionID = $this->loadModel('action')->create('product', $productID, 'Edited');
$this->action->logHistory($actionID, $changes);
}
if(empty($changes)) continue;
$actionID = $this->loadModel('action')->create('product', $productID, 'Edited');
$this->action->logHistory($actionID, $changes);
}
}
die(js::locate($this->session->productList, 'parent'));

View File

@@ -931,11 +931,10 @@ class project extends control
{
foreach($allChanges as $projectID => $changes)
{
if(!empty($changes))
{
$actionID = $this->loadModel('action')->create('project', $projectID, 'Edited');
$this->action->logHistory($actionID, $changes);
}
if(empty($changes)) continue;
$actionID = $this->loadModel('action')->create('project', $projectID, 'Edited');
$this->action->logHistory($actionID, $changes);
}
}
die(js::locate($this->session->projectList, 'parent'));

View File

@@ -308,6 +308,8 @@ class story extends control
{
foreach($allChanges as $storyID => $changes)
{
if(empty($changes)) continue;
$actionID = $this->action->create('story', $storyID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);

View File

@@ -276,23 +276,22 @@ class task extends control
{
foreach($allChanges as $taskID => $changes)
{
if(!empty($changes))
{
$actionID = $this->loadModel('action')->create('task', $taskID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
if(empty($changes)) continue;
$task = $this->task->getById($taskID);
if($task->fromBug != 0)
$actionID = $this->loadModel('action')->create('task', $taskID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$task = $this->task->getById($taskID);
if($task->fromBug != 0)
{
foreach($changes as $change)
{
foreach($changes as $change)
if($change['field'] == 'status')
{
if($change['field'] == 'status')
{
$confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug");
$cancelURL = $this->server->HTTP_REFERER;
die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent'));
}
$confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug");
$cancelURL = $this->server->HTTP_REFERER;
die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent'));
}
}
}

View File

@@ -484,6 +484,8 @@ class testcase extends control
{
foreach($allChanges as $caseID => $changes )
{
if(empty($changes)) continue;
$actionID = $this->loadModel('action')->create('case', $caseID, 'Edited');
$this->action->logHistory($actionID, $changes);
}

View File

@@ -210,11 +210,10 @@ class todo extends control
$allChanges = $this->todo->batchUpdate();
foreach($allChanges as $todoID => $changes)
{
if(!empty($changes))
{
$actionID = $this->loadModel('action')->create('todo', $todoID, 'edited');
$this->action->logHistory($actionID, $changes);
}
if(empty($changes)) continue;
$actionID = $this->loadModel('action')->create('todo', $todoID, 'edited');
$this->action->logHistory($actionID, $changes);
}
die(js::locate($this->session->todoList, 'parent'));