* code for task #73476,73475,73474,73473.
This commit is contained in:
@@ -743,7 +743,7 @@ class execution extends control
|
||||
|
||||
/* Change for requirement story title. */
|
||||
if($storyType == 'requirement')
|
||||
{
|
||||
{
|
||||
$this->lang->story->title = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->title);
|
||||
$this->lang->story->noStory = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->noStory);
|
||||
$this->lang->execution->createStory = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->execution->createStory);
|
||||
|
||||
@@ -5035,7 +5035,6 @@ class executionModel extends model
|
||||
$_POST['end'] = $project->end;
|
||||
$_POST['status'] = 'wait';
|
||||
$_POST['days'] = $project->days;
|
||||
$_POST['products'] = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchPairs();
|
||||
$_POST['team'] = $project->team;
|
||||
$_POST['teamMembers'] = array($this->app->user->account);
|
||||
$_POST['acl'] = 'open';
|
||||
@@ -5046,6 +5045,14 @@ class executionModel extends model
|
||||
$_POST['multiple'] = '0';
|
||||
$_POST['hasProduct'] = $project->hasProduct;
|
||||
|
||||
$projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchAll();
|
||||
foreach($projectProducts as $projectProduct)
|
||||
{
|
||||
$_POST['products'][] = $projectProduct->product;
|
||||
$_POST['branch'][] = $projectProduct->branch;
|
||||
if($projectProduct->plan) $_POST['plans'][$projectProduct->product][$projectProduct->branch] = explode(',', trim($projectProduct->plan, ','));
|
||||
}
|
||||
|
||||
$executionID = $this->create();
|
||||
if($project->model == 'kanban')
|
||||
{
|
||||
@@ -5057,4 +5064,54 @@ class executionModel extends model
|
||||
|
||||
return $executionID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync no multiple project to sprint.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function syncNoMultipleSprint($projectID)
|
||||
{
|
||||
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
|
||||
$post = $_POST;
|
||||
|
||||
$_POST = array();
|
||||
$_POST['project'] = $projectID;
|
||||
$_POST['name'] = $project->name;
|
||||
$_POST['code'] = $project->code;
|
||||
$_POST['begin'] = $project->begin;
|
||||
$_POST['end'] = $project->end;
|
||||
$_POST['days'] = $project->days;
|
||||
$_POST['team'] = $project->team;
|
||||
$_POST['PO'] = $project->PO;
|
||||
$_POST['QD'] = $project->QD;
|
||||
$_POST['PM'] = $project->PM;
|
||||
$_POST['RD'] = $project->RD;
|
||||
$_POST['status'] = $project->status;
|
||||
$_POST['acl'] = 'open';
|
||||
|
||||
$projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchAll();
|
||||
foreach($projectProducts as $projectProduct)
|
||||
{
|
||||
$_POST['products'][] = $projectProduct->product;
|
||||
$_POST['branch'][] = $projectProduct->branch;
|
||||
if($projectProduct->plan) $_POST['plans'][$projectProduct->product][$projectProduct->branch] = explode(',', trim($projectProduct->plan, ','));
|
||||
}
|
||||
|
||||
$teamMembers = $this->dao->select('*')->from(TABLE_TEAM)->where('type')->eq('project')->andWhere('root')->eq($projectID)->fetchPairs('account', 'account');
|
||||
$_POST['teamMembers'] = array_values($teamMembers);
|
||||
|
||||
$executionID = $this->dao->select('*')->from(TABLE_EXECUTION)->where('project')->eq($projectID)->andWhere('type')->in('sprint,kanban')->andWhere('multiple')->eq(0)->fetch('id');
|
||||
if($executionID)
|
||||
{
|
||||
$this->update($executionID);
|
||||
$this->updateProducts($executionID);
|
||||
}
|
||||
|
||||
$_POST = $post;
|
||||
|
||||
return $executionID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1441,7 +1441,7 @@ class projectModel extends model
|
||||
|
||||
if($project->acl != 'open') $this->loadModel('user')->updateUserView($projectID, 'project');
|
||||
|
||||
if(!$project->multiple and $project->model != 'waterfall') $this->loadModel('execution')->createDefaultSprint($projectID);
|
||||
if(empty($project->multiple) and $project->model != 'waterfall') $this->loadModel('execution')->createDefaultSprint($projectID);
|
||||
|
||||
return $projectID;
|
||||
}
|
||||
@@ -1617,6 +1617,8 @@ class projectModel extends model
|
||||
if($project->status == 'closed') $this->product->close($productID);
|
||||
}
|
||||
|
||||
if(empty($oldProject->multiple) and $oldProject->model != 'waterfall') $this->loadModel('execution')->syncNoMultipleSprint($projectID);
|
||||
|
||||
return common::createChanges($oldProject, $project);
|
||||
}
|
||||
}
|
||||
@@ -1667,6 +1669,7 @@ class projectModel extends model
|
||||
}
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$this->loadModel('execution');
|
||||
$this->lang->error->unique = $this->lang->error->repeat;
|
||||
foreach($projects as $projectID => $project)
|
||||
{
|
||||
@@ -1688,10 +1691,7 @@ class projectModel extends model
|
||||
if(dao::isError())
|
||||
{
|
||||
$errors = dao::getError();
|
||||
foreach($errors as $key => $error)
|
||||
{
|
||||
dao::$errors[$key][0] = 'ID' . $projectID . $error[0];
|
||||
}
|
||||
foreach($errors as $key => $error) dao::$errors[$key][0] = 'ID' . $projectID . $error[0];
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1708,6 +1708,8 @@ class projectModel extends model
|
||||
if($project->acl == 'open') $this->loadModel('personnel')->updateWhitelist(array(), 'project', $projectID);
|
||||
if($project->acl != 'open') $this->loadModel('user')->updateUserView($projectID, 'project');
|
||||
$this->executeHooks($projectID);
|
||||
|
||||
if(empty($oldProject->multiple) and $oldProject->model != 'waterfall') $this->execution->syncNoMultipleSprint($projectID);
|
||||
}
|
||||
$allChanges[$projectID] = common::createChanges($oldProject, $project);
|
||||
}
|
||||
@@ -2135,6 +2137,8 @@ class projectModel extends model
|
||||
->andWhere('account')->in($removedAccounts)
|
||||
->exec();
|
||||
}
|
||||
|
||||
if(empty($project->multiple) and $project->model != 'waterfall') $this->loadModel('execution')->syncNoMultipleSprint($projectID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user