* Code for task #85045.
This commit is contained in:
@@ -80,7 +80,7 @@ class executionsEntry extends entry
|
||||
*/
|
||||
public function post($projectID = 0)
|
||||
{
|
||||
$fields = 'project,code,name,begin,end,lifetime,desc,days';
|
||||
$fields = 'project,code,name,begin,end,lifetime,desc,days,percent,parent';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$projectID = $this->param('project', $projectID);
|
||||
|
||||
@@ -387,6 +387,7 @@ class executionModel extends model
|
||||
->setDefault('lastEditedDate', helper::now())
|
||||
->setDefault('team', $this->post->name)
|
||||
->setDefault('parent', $this->post->project)
|
||||
->setIF($this->post->parent, 'parent', $this->post->parent)
|
||||
->setIF($this->post->heightType == 'auto', 'displayCards', 0)
|
||||
->setIF(!isset($_POST['whitelist']), 'whitelist', '')
|
||||
->setIF($this->post->acl == 'open', 'whitelist', '')
|
||||
@@ -396,7 +397,7 @@ class executionModel extends model
|
||||
->remove('products, workDays, delta, branch, uid, plans, teams, teamMembers, contactListMenu, heightType')
|
||||
->get();
|
||||
|
||||
if(!empty($sprint->parent))
|
||||
if(!empty($sprint->parent) and ($sprint->project == $sprint->parent))
|
||||
{
|
||||
$project = $this->loadModel('project')->getByID($sprint->parent);
|
||||
$sprint->hasProduct = $project->hasProduct;
|
||||
@@ -459,6 +460,15 @@ class executionModel extends model
|
||||
|
||||
if((isset($project) and $project->model != 'kanban') or empty($project)) $this->loadModel('kanban')->createExecutionLane($executionID);
|
||||
|
||||
/* Api create infinitus stages. */
|
||||
if(isset($sprint->parent) and ($sprint->parent != $sprint->project) and $sprint->type == 'stage')
|
||||
{
|
||||
$parent = $this->getByID($sprint->parent);
|
||||
$grade = $parent->grade + 1;
|
||||
$path = rtrim($parent->path, ',') . ",{$executionID}";
|
||||
$this->dao->update(TABLE_EXECUTION)->set('path')->eq($path)->set('grade')->eq($grade)->where('id')->eq($executionID)->exec();
|
||||
}
|
||||
|
||||
/* Save order. */
|
||||
$this->dao->update(TABLE_EXECUTION)->set('`order`')->eq($executionID * 5)->where('id')->eq($executionID)->exec();
|
||||
$this->file->updateObjectID($this->post->uid, $executionID, 'execution');
|
||||
|
||||
Reference in New Issue
Block a user