* finish the task #643.
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user