Merge branch 'sprint/zentaopms256_lanzongjun' into 'zentaopms_256'

* Finish Task #77798#77796

See merge request easycorp/zentaopms!6403
This commit is contained in:
孙广明
2022-11-30 01:20:50 +00:00
9 changed files with 77 additions and 24 deletions
+4 -1
View File
@@ -4121,9 +4121,12 @@ class execution extends control
$count = 0;
if(!empty($planStory))
{
$projectProducts = $this->loadModel('project')->getBranchesByProject($executionID);
$projectProducts = zget($projectProducts, $productID, array());
foreach($planStory as $id => $story)
{
if($story->status == 'draft' or $story->status == 'reviewing')
if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectProducts) and !isset($projectProducts[$story->branch])))
{
$count++;
unset($planStory[$id]);
+1 -1
View File
@@ -349,7 +349,7 @@ $lang->execution->howToUpdateBurn = "<a href='http://api.zentao.net/goto.ph
$lang->execution->whyNoStories = "Keine Story kann verknüpft werden. Bitte prüfen Sie ob ein Story mit {$lang->executionCommon} verknüpft ist {$lang->productCommon} und stellen Sie sicher das diese geprüft ist.";
$lang->execution->projectNoStories = "No story can be linked. Please check whether there is any story in project and make sure it has been reviewed.";
$lang->execution->productStories = "{$lang->executionCommon} verknüpfte Story ist ein Subset von {$lang->productCommon}, welche nur nach überprüfung verknüpft werden kann. Bitte <a href='%s'> Story verknüpfen</a>。";
$lang->execution->haveDraft = "There are %s draft stories can't be linked.";
$lang->execution->haveDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked.";
$lang->execution->doneExecutions = 'Erledigt';
$lang->execution->selectDept = 'Abteilung wählen';
$lang->execution->selectDeptTitle = 'Abteilung wählen';
+1 -1
View File
@@ -349,7 +349,7 @@ $lang->execution->howToUpdateBurn = "<a href='https://api.zentao.pm/goto.ph
$lang->execution->whyNoStories = "No story can be linked. Please check whether there is any story in {$lang->executionCommon} which is linked to {$lang->productCommon} and make sure it has been reviewed.";
$lang->execution->projectNoStories = "No story can be linked. Please check whether there is any story in project and make sure it has been reviewed.";
$lang->execution->productStories = "Stories linked to {$lang->executionCommon} are the subeset of stories linked to {$lang->productCommon}. Stories can only be linked after they pass the review. <a href='%s'> Link Stories</a> now.";
$lang->execution->haveDraft = "%s stories in draft, so they can't be linked.";
$lang->execution->haveDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked.";
$lang->execution->doneExecutions = 'Finished';
$lang->execution->selectDept = 'Select Department';
$lang->execution->selectDeptTitle = 'Select User';
+1 -1
View File
@@ -349,7 +349,7 @@ $lang->execution->howToUpdateBurn = "<a href='https://api.zentao.pm/goto.ph
$lang->execution->whyNoStories = "Aucune story ne peut être associée. Vérifiez s'il existe des stories dans {$lang->executionCommon} qui sont associées à {$lang->productCommon} et vérifiez qu'elles ont bien été validées.";
$lang->execution->projectNoStories = "No story can be linked. Please check whether there is any story in project and make sure it has been reviewed.";
$lang->execution->productStories = "Les stories associées au {$lang->executionCommon} sont une portion des stories associées au {$lang->productCommon}. Les stories ne peuvent être associées à un {$lang->executionCommon} qu'après avoir été validées. <a href='%s'> Associer Stories</a> maintenant.";
$lang->execution->haveDraft = "%s stories sont encore en conception, elles ne peuvent pas être associées au {$lang->executionCommon} actuellement.";
$lang->execution->haveDraft = "There are %s draft stories or not associated with this {$lang->executionCommon} can't be linked.";
$lang->execution->doneExecutions = 'Terminé';
$lang->execution->selectDept = 'Sélection Compartiment';
$lang->execution->selectDeptTitle = 'Sélection Utilisateur';
+1 -1
View File
@@ -349,7 +349,7 @@ $lang->execution->howToUpdateBurn = "<a href='https://api.zentao.net/goto.p
$lang->execution->whyNoStories = "看起来没有{$lang->SRCommon}可以关联。请检查下{$lang->executionCommon}关联的{$lang->productCommon}中有没有{$lang->SRCommon},而且要确保它们已经审核通过。";
$lang->execution->projectNoStories = "看起来没有{$lang->SRCommon}可以关联。请检查下项目中有没有{$lang->SRCommon},而且要确保它们已经审核通过。";
$lang->execution->productStories = "{$lang->executionCommon}关联的{$lang->SRCommon}是{$lang->productCommon}{$lang->SRCommon}的子集,并且只有评审通过的{$lang->SRCommon}才能关联。请<a href='%s'>关联{$lang->SRCommon}</a>。";
$lang->execution->haveDraft = "有%s条草稿状态的{$lang->SRCommon}无法关联到该{$lang->executionCommon}";
$lang->execution->haveDraft = "有%s条草稿状态或非本{$lang->executionCommon}关联分支的{$lang->SRCommon}无法关联到该{$lang->executionCommon}";
$lang->execution->doneExecutions = '已结束';
$lang->execution->selectDept = '选择部门';
$lang->execution->selectDeptTitle = '选择一个部门的成员';
+19 -1
View File
@@ -4626,10 +4626,28 @@ class executionModel extends model
foreach($branches as $branchID => $branchName) $branchIdList[$branchID] = $branchID;
}
$branchQuery = '';
if(!empty($branchIdList))
{
$branchQuery .= '(';
$branchCount = count($branchIdList);
foreach($branchIdList as $index => $branchID)
{
$branchQuery .= "FIND_IN_SET('$branchID', branch)";
if($index < $branchCount - 1) $branchQuery .= ' OR ';
}
}
else
{
$branchQuery .= "FIND_IN_SET('', branch)";
}
$branchQuery .= ')';
$plans = $this->dao->select('id,title,product,parent,begin,end')->from(TABLE_PRODUCTPLAN)
->where('product')->in(array_keys($products))
->andWhere('deleted')->eq(0)
->andWhere('branch')->in($branchIdList)->fi()
->andWhere($branchQuery)
->orderBy('begin desc')
->fetchAll('id');
+2 -2
View File
@@ -257,7 +257,7 @@ class product extends control
$this->products = $this->product->getProducts($projectID, 'all', '', false);
$projectProducts = $this->product->getProducts($projectID);
$productPlans = $this->execution->getPlans($projectProducts, 'skipParent');
$productPlans = $this->execution->getPlans($projectProducts, 'skipParent', $projectID);
if($browseType == 'bybranch') $param = $branchID;
$stories = $this->story->getExecutionStories($projectID, $productID, $branchID, $sort, $browseType, $param, $storyType, '', $pager);
@@ -1042,7 +1042,7 @@ class product extends control
}
else
{
$plans = $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? 'all' : $branch, $param);
$plans = $this->loadModel('productplan')->getPairsForStory($productID, $branch == '0' ? 'all' : $branch, $param);
}
$field = $fieldID !== '' ? "plans[$fieldID]" : 'plan';
$multiple = strpos($param, 'multiple') === false ? '' : 'multiple';
+46 -15
View File
@@ -240,13 +240,27 @@ class productplanModel extends model
*/
public function getPairs($product = 0, $branch = '', $param = '', $skipParent = false)
{
$date = date('Y-m-d');
$date = date('Y-m-d');
$branchQuery = '';
if($branch !== '' and $branch != 'all')
{
$branchQuery .= '(';
$branchCount = count(explode(',', $branch));
foreach(explode(',', $branch) as $index => $branchID)
{
$branchQuery .= "FIND_IN_SET('$branchID', t1.branch)";
if($index < $branchCount - 1) $branchQuery .= ' OR ';
}
$branchQuery .= ')';
}
$plans = $this->dao->select('t1.id,t1.title,t1.parent,t1.begin,t1.end,t2.name as branchName,t3.type as productType')->from(TABLE_PRODUCTPLAN)->alias('t1')
->leftJoin(TABLE_BRANCH)->alias('t2')->on('t2.id=t1.branch')
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t3.id=t1.product')
->where('t1.product')->in($product)
->andWhere('t1.deleted')->eq(0)
->beginIF($branch !== '' and $branch != 'all')->andWhere('t1.branch')->in("0,$branch")->fi()
->beginIF(!empty($branchQuery))->andWhere($branchQuery)->fi()
->beginIF(strpos($param, 'unexpired') !== false)->andWhere('t1.end')->ge($date)->fi()
->beginIF(strpos($param, 'noclosed') !== false)->andWhere('t1.status')->ne('closed')->fi()
->orderBy('t1.begin desc')
@@ -280,12 +294,26 @@ class productplanModel extends model
$date = date('Y-m-d');
$param = strtolower($param);
$branch = strpos($param, 'withmainplan') !== false ? "0,$branch" : $branch;
$branchQuery = '';
if($branch !== '' and $branch != 'all')
{
$branchQuery .= '(';
$branchCount = count(explode(',', $branch));
foreach(explode(',', $branch) as $index => $branchID)
{
$branchQuery .= "FIND_IN_SET('$branchID', branch)";
if($index < $branchCount - 1) $branchQuery .= ' OR ';
}
$branchQuery .= ')';
}
$plans = $this->dao->select('id,title,parent,begin,end')->from(TABLE_PRODUCTPLAN)
->where('product')->in($product)
->andWhere('deleted')->eq(0)
->beginIF(strpos($param, 'unexpired') !== false)->andWhere('end')->ge($date)->fi()
->beginIF(strpos($param, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->beginIF($branch !== 'all' and $branch !== '')->andWhere("branch")->in($branch)->fi()
->beginIF($branch !== 'all' and $branch !== '')->andWhere($branchQuery)->fi()
->orderBy('begin desc')
->fetchAll('id');
@@ -361,19 +389,22 @@ class productplanModel extends model
$planGroup = array();
foreach($plans as $plan)
{
if(!isset($planGroup[$plan->product][$plan->branch])) $planGroup[$plan->product][$plan->branch] = array('' => '');
if($plan->parent == '-1' and strpos($param, 'skipparent') !== false) continue;
if($field == 'name')
foreach(explode(',', $plan->branch) as $branch)
{
if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title;
$planGroup[$plan->product][$plan->branch][$plan->id] = $plan->title . " [{$plan->begin} ~ {$plan->end}]";
if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planGroup[$plan->product][$plan->branch][$plan->id] = $plan->title . ' ' . $this->lang->productplan->future;
}
else
{
$planGroup[$plan->product][$plan->branch][$plan->id] = $plan;
if(!isset($planGroup[$plan->product][$branch])) $planGroup[$plan->product][$branch] = array('' => '');
if($plan->parent == '-1' and strpos($param, 'skipparent') !== false) continue 2;
if($field == 'name')
{
if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title;
$planGroup[$plan->product][$branch][$plan->id] = $plan->title . " [{$plan->begin} ~ {$plan->end}]";
if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planGroup[$plan->product][$branch][$plan->id] = $plan->title . ' ' . $this->lang->productplan->future;
}
else
{
$planGroup[$plan->product][$branch][$plan->id] = $plan;
}
}
}
return $planGroup;
+2 -1
View File
@@ -1485,6 +1485,7 @@ class projectModel extends model
->setDefault('team', $this->post->name)
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', helper::now())
->setDefault('parent', 0)
->setIF($this->post->delta == 999, 'end', LONG_TIME)
->setIF($this->post->delta == 999, 'days', 0)
->setIF($this->post->begin == '0000-00-00', 'begin', '')
@@ -2339,7 +2340,7 @@ class projectModel extends model
$members = array_keys($this->getTeamMembers($projectID));
/* Link products of other programs. */
if($_POST['otherProducts'])
if(!empty($_POST['otherProducts']))
{
$products = array();
$otherProducts = $_POST['otherProducts'];