Merge branch 'sprint/165_zenggang' into 'sprint/165'
Sprint/165 zenggang See merge request easycorp/zentaopms!40
This commit is contained in:
@@ -46,7 +46,7 @@ class build extends control
|
||||
if($this->app->tab == 'project')
|
||||
{
|
||||
$this->loadModel('project')->setMenu($projectID);
|
||||
$executions = $this->execution->getPairs($projectID);
|
||||
$executions = $this->execution->getPairs($projectID, 'all', 'stagefilter');
|
||||
$executionID = empty($executionID) ? key($executions) : $executionID;
|
||||
$this->session->set('project', $projectID);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class build extends control
|
||||
$execution->name = '';
|
||||
}
|
||||
|
||||
$executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project);
|
||||
$executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project, 'stagefilter');
|
||||
if(!isset($executions[$build->execution])) $executions[$build->execution] = $execution->name;
|
||||
|
||||
$productGroups = $this->execution->getProducts($build->execution);
|
||||
|
||||
@@ -674,6 +674,23 @@ class commonModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/* Check whether other methods under the module have permissions. If yes, point to other methods. */
|
||||
if($display == false and isset($lang->$currentModule->menu))
|
||||
{
|
||||
foreach($lang->$currentModule->menu as $menu)
|
||||
{
|
||||
$linkPart = explode('|', $menu['link']);
|
||||
if(!isset($linkPart[2])) continue;
|
||||
$method = $linkPart[2];
|
||||
if(common::hasPriv($currentModule, $method))
|
||||
{
|
||||
$display = true;
|
||||
$currentMethod = $method;
|
||||
if(!isset($menu['target'])) break; // Try to jump to the method without opening a new window.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$display) continue;
|
||||
|
||||
/* Assign vars. */
|
||||
|
||||
@@ -986,7 +986,7 @@ class executionModel extends model
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param string $type all|sprint|stage|kanban
|
||||
* @param string $mode all|noclosed or empty
|
||||
* @param string $mode all|noclosed|stagefilter or empty
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -1024,6 +1024,7 @@ class executionModel extends model
|
||||
foreach($executions as $execution)
|
||||
{
|
||||
if(strpos($mode, 'noclosed') !== false and ($execution->status == 'done' or $execution->status == 'closed')) continue;
|
||||
if(strpos($mode, 'stagefilter') !== false and isset($executionModel) and $executionModel == 'waterfall' and in_array($execution->attribute, array('request', 'design', 'review'))) continue; // Some stages of waterfall not need.
|
||||
$pairs[$execution->id] = $execution->name;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,13 +149,13 @@ body {margin-bottom: 25px;}
|
||||
<?php if($canBeChanged and (common::hasPriv('task', 'batchCreate', $checkObject) or common::hasPriv('task', 'create', $checkObject))):?>
|
||||
<div class='btn-group dropdown'>
|
||||
<?php
|
||||
$actionLink = $this->createLink('task', 'create', "executionID=$executionID");
|
||||
$actionLink = $this->createLink('task', 'create', "executionID=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ""));
|
||||
echo html::a($actionLink, "<i class='icon icon-plus'></i> {$lang->task->create}", '', "class='btn btn-primary'");
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<li><?php echo html::a($actionLink, $lang->task->create);?></li>
|
||||
<li><?php echo html::a($this->createLink('task', 'batchCreate', "executionID=$executionID"), $lang->task->batchCreate);?></li>
|
||||
<li><?php echo html::a($this->createLink('task', 'batchCreate', "executionID=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")), $lang->task->batchCreate);?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -1026,10 +1026,11 @@ class productModel extends model
|
||||
* @param int $branch
|
||||
* @param string $orderBy
|
||||
* @param int $projectID
|
||||
* @param string $mode stagefilter or empty
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExecutionPairsByProduct($productID, $branch = 0, $orderBy = 'id_asc', $projectID = 0)
|
||||
public function getExecutionPairsByProduct($productID, $branch = 0, $orderBy = 'id_asc', $projectID = 0, $mode = '')
|
||||
{
|
||||
if(empty($productID)) return array();
|
||||
if(empty($projectID) or $this->config->systemMode == 'classic') return $this->getAllExecutionPairsByProduct($productID, $branch);
|
||||
@@ -1037,7 +1038,7 @@ class productModel extends model
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
$orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc';
|
||||
|
||||
$executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
$executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent,t2.attribute')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->where('t1.product')->eq($productID)
|
||||
->andWhere('t2.project')->eq($projectID)
|
||||
@@ -1068,6 +1069,7 @@ class productModel extends model
|
||||
$executionList = $executionList + $execution->children;
|
||||
continue;
|
||||
}
|
||||
if(strpos($mode, 'stagefilter') !== false and in_array($execution->attribute, array('request', 'design', 'review'))) continue; // Some stages of waterfall not need.
|
||||
$executionList[$execution->id] = $execution->name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,9 +81,9 @@ $lang->project->bycard = 'Card';
|
||||
$lang->project->mine = 'My';
|
||||
$lang->project->myProject = 'Meine Zuständigkeit';
|
||||
$lang->project->other = 'Andere';
|
||||
$lang->project->acl = 'Access control';
|
||||
$lang->project->acl = 'ACL';
|
||||
$lang->project->setPlanduration = 'Set Duration';
|
||||
$lang->project->auth = 'Access Control';
|
||||
$lang->project->auth = 'Privileges';
|
||||
$lang->project->durationEstimation = 'Estimated Workload';
|
||||
$lang->project->teamCount = 'Man';
|
||||
$lang->project->teamSumCount = '%s people in total';
|
||||
|
||||
@@ -117,9 +117,9 @@ $lang->project->bycard = 'Card';
|
||||
$lang->project->mine = 'My';
|
||||
$lang->project->myProject = 'Mine';
|
||||
$lang->project->other = 'Others';
|
||||
$lang->project->acl = 'Access control';
|
||||
$lang->project->acl = 'ACL';
|
||||
$lang->project->setPlanduration = 'Set Duration';
|
||||
$lang->project->auth = 'Access Control';
|
||||
$lang->project->auth = 'Privileges';
|
||||
$lang->project->durationEstimation = 'Estimated Workload';
|
||||
$lang->project->leftStories = 'Left Stories';
|
||||
$lang->project->leftTasks = 'Left Tasks';
|
||||
|
||||
@@ -81,9 +81,9 @@ $lang->project->bycard = 'Card';
|
||||
$lang->project->mine = 'My';
|
||||
$lang->project->myProject = 'Mine';
|
||||
$lang->project->other = 'Others';
|
||||
$lang->project->acl = 'Access control';
|
||||
$lang->project->acl = 'ACL';
|
||||
$lang->project->setPlanduration = 'Set Duration';
|
||||
$lang->project->auth = 'Access Control';
|
||||
$lang->project->auth = 'Privileges';
|
||||
$lang->project->durationEstimation = 'Estimated Workload';
|
||||
$lang->project->teamCount = 'Man';
|
||||
$lang->project->teamSumCount = '%s people in total';
|
||||
|
||||
@@ -81,9 +81,9 @@ $lang->project->bycard = 'Card';
|
||||
$lang->project->mine = 'My';
|
||||
$lang->project->myProject = 'Mine';
|
||||
$lang->project->other = 'Others';
|
||||
$lang->project->acl = 'Access control';
|
||||
$lang->project->acl = 'ACL';
|
||||
$lang->project->setPlanduration = 'Set Duration';
|
||||
$lang->project->auth = 'Access Control';
|
||||
$lang->project->auth = 'Privileges';
|
||||
$lang->project->durationEstimation = 'Estimated Workload';
|
||||
$lang->project->teamCount = 'Man';
|
||||
$lang->project->teamSumCount = '%s people in total';
|
||||
|
||||
@@ -3866,7 +3866,7 @@ class storyModel extends model
|
||||
{
|
||||
$requirements = $this->dao->select('t3.*')->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
->leftJoin(TABLE_RELATION)->alias('t2')->on("t1.story=t2.AID && t2.AType='story'")
|
||||
->leftJoin(TABLE_STORY)->alias('t3')->on("t2.BID=t3.id && t2.BType='requirement'")
|
||||
->leftJoin(TABLE_STORY)->alias('t3')->on("t2.BID=t3.id && t2.BType='requirement' && t3.deleted='0'")
|
||||
->where('t1.project')->eq($projectID)
|
||||
->andWhere('t1.product')->eq($productID)
|
||||
->andWhere('t3.id')->ne('')
|
||||
@@ -3919,11 +3919,13 @@ class storyModel extends model
|
||||
$tracks = $requirements;
|
||||
|
||||
/* Get no requirements story. */
|
||||
$excludeStories = $this->dao->select('BID')->from(TABLE_RELATION)
|
||||
->where('AType')->eq('requirement')
|
||||
->andWhere('BType')->eq('story')
|
||||
->andWhere('relation')->eq('subdivideinto')
|
||||
->andWhere('product')->eq($productID)
|
||||
$excludeStories = $this->dao->select('t1.BID')->from(TABLE_RELATION)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on("t1.AID=t2.id")
|
||||
->where('t2.deleted')->eq('0')
|
||||
->andWhere('t1.AType')->eq('requirement')
|
||||
->andWhere('t1.BType')->eq('story')
|
||||
->andWhere('t1.relation')->eq('subdivideinto')
|
||||
->andWhere('t1.product')->eq($productID)
|
||||
->fetchPairs('BID', 'BID');
|
||||
if($projectID)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user