* change checkrepeat to removeDuplicate.

This commit is contained in:
wangyidong
2014-08-25 03:08:21 +00:00
parent 565fb4c5ef
commit 8c50180759
17 changed files with 169 additions and 91 deletions
+14 -2
View File
@@ -76,12 +76,24 @@ class task extends control
$this->send($response);
}
/* if the count of tasksID is 1 then check exists. */
if(count($tasksID) == 1)
{
$taskID = current($tasksID);
if($taskID['status'] == 'exists')
{
$response['locate'] = $this->createLink('task', 'view', "taskID={$taskID['id']}");
$response['message'] = sprintf($this->lang->duplicate, $this->lang->task->common);
$this->send($response);
}
}
/* Create actions. */
$this->loadModel('action');
foreach($tasksID as $taskID)
{
/* if status is existed then this task has existed not new create. */
if($taskID['status'] == 'existed') continue;
/* if status is exists then this task has exists not new create. */
if($taskID['status'] == 'exists') continue;
$taskID = $taskID['id'];
$actionID = $this->action->create('task', $taskID, 'Opened', '');