* finish the task #643.

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-12-20 05:50:07 +00:00
parent 658f80ca0b
commit 842c41442d
2 changed files with 24 additions and 3 deletions
+6 -1
View File
@@ -29,6 +29,7 @@ class actionModel extends model
*/
public function create($objectType, $objectID, $actionType, $comment = '', $extra = '')
{
$objectType = str_replace('`', '', $objectType);
$action->objectType = strtolower($objectType);
$action->objectID = $objectID;
$action->actor = $this->app->user->account;
@@ -139,7 +140,11 @@ class actionModel extends model
if(!$trashes) return array();
/* Group trashes by objectType, and get there name field. */
foreach($trashes as $object) $typeTrashes[$object->objectType][] = $object->objectID;
foreach($trashes as $object)
{
$object->objectType = str_replace('`', '', $object->objectType);
$typeTrashes[$object->objectType][] = $object->objectID;
}
foreach($typeTrashes as $objectType => $objectIds)
{
$objectIds = array_unique($objectIds);
+18 -2
View File
@@ -304,7 +304,6 @@ class storyModel extends model
->setIF($this->post->closedReason != false and $oldStory->closedDate == '', 'closedDate', $now)
->setIF($this->post->closedBy != false or $this->post->closedReason != false, 'status', 'closed')
->setIF($this->post->closedReason != false and $this->post->closedBy == false, 'closedBy', $this->app->user->account)
->setIF($oldStory->status == 'draft', 'stage', '')
->remove('files,labels,comment')
->get();
@@ -317,6 +316,8 @@ class storyModel extends model
->checkIF(isset($story->closedReason) and $story->closedReason == 'duplicate', 'duplicateStory', 'notempty')
->checkIF(isset($story->closedReason) and $story->closedReason == 'subdivided', 'childStories', 'notempty')
->where('id')->eq((int)$storyID)->exec();
$this->setStage($storyID);
if(!dao::isError()) return common::createChanges($oldStory, $story);
}
@@ -481,7 +482,7 @@ class storyModel extends model
return true;
}
/* If have test task, the stage is tested or testing. */
/* If have test task, the stage is tested, testing or developing. */
if(isset($tasks['test']))
{
$stage = 'tested';
@@ -493,6 +494,21 @@ class storyModel extends model
break;
}
}
if($stage != 'testing')
{
unset($tasks['test']);
foreach($tasks as $type => $typeTasks)
{
foreach($typeTasks as $task)
{
if($task->status != 'done')
{
$stage = 'developing';
break;
}
}
}
}
}
/* No test taske, stage is done or developing. */
else