Merge branch 'master' into 'master_xieqiyu_78690'
# Conflicts: # module/productplan/model.php
This commit is contained in:
@@ -1855,7 +1855,7 @@ class bugModel extends model
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF($excludeBugs)->andWhere('id')->notIN($excludeBugs)->fi()
|
||||
->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false)->andWhere('product')->eq($productID)->fi()
|
||||
->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false)->andWhere('branch')->eq($branchID)->fi()
|
||||
->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false and $branchID != 'all')->andWhere('branch')->eq($branchID)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
@@ -2319,7 +2319,7 @@ class bugModel extends model
|
||||
$products = $this->session->product;
|
||||
preg_match('/`product` IN \((?P<productIdList>.+)\)/', $this->reportCondition(), $matchs);
|
||||
if(!empty($matchs) and isset($matchs['productIdList'])) $products = str_replace('\'', '', $matchs['productIdList']);
|
||||
$builds = $this->loadModel('build')->getBuildPairs($products, $branch = 0, $params = 'hasDeleted');
|
||||
$builds = $this->loadModel('build')->getBuildPairs($products, $branch = 0, $params = 'hasdeleted');
|
||||
|
||||
/* Deal with the situation that a bug maybe associate more than one openedBuild. */
|
||||
foreach($datas as $buildIDList => $data)
|
||||
|
||||
@@ -283,6 +283,8 @@ class build extends control
|
||||
foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage;
|
||||
|
||||
/* Set menu. */
|
||||
$objectType = 'execution';
|
||||
$objectID = $build->execution;
|
||||
if($this->app->tab == 'project')
|
||||
{
|
||||
$this->loadModel('project')->setMenu($build->project);
|
||||
@@ -643,7 +645,10 @@ class build extends control
|
||||
|
||||
if($build->branch)
|
||||
{
|
||||
foreach(explode(',', $build->branch) as $branchID) $branches += array($branchID => $branchPairs[$branchID]);
|
||||
foreach(explode(',', $build->branch) as $branchID)
|
||||
{
|
||||
if(isset($branchPairs[$branchID])) $branches += array($branchID => $branchPairs[$branchID]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
|
||||
|
||||
@@ -25,6 +25,7 @@ $().ready(function()
|
||||
{
|
||||
var projectID = $('#project').val();
|
||||
var executionID = $('#execution').val();
|
||||
|
||||
if($(this).val() == 'no')
|
||||
{
|
||||
$('#execution').closest('tr').show();
|
||||
@@ -35,7 +36,16 @@ $().ready(function()
|
||||
{
|
||||
$('#execution').closest('tr').hide();
|
||||
$('#buildBox').closest('tr').show();
|
||||
|
||||
$.ajaxSettings.async = false;
|
||||
loadProducts(projectID);
|
||||
var productID = $('#product').val();
|
||||
$.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=all&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data)
|
||||
{
|
||||
if(data) $('#buildBox').html(data);
|
||||
$('#builds').attr('data-placeholder', multipleSelect).chosen();
|
||||
});
|
||||
$.ajaxSettings.async = true;
|
||||
}
|
||||
});
|
||||
$('#product').change();
|
||||
|
||||
@@ -63,7 +63,7 @@ class buildModel extends model
|
||||
*/
|
||||
public function getProjectBuilds($projectID = 0, $type = 'all', $param = 0, $orderBy = 't1.date_desc,t1.id_desc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t3.name as productName')
|
||||
return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t2.deleted as executionDeleted, t3.name as productName')
|
||||
->from(TABLE_BUILD)->alias('t1')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id')
|
||||
@@ -253,7 +253,7 @@ class buildModel extends model
|
||||
->beginIF($products)->andWhere('product')->in($products)->fi()
|
||||
->beginIF($objectType === 'execution' and $objectID)->andWhere('execution')->eq($objectID)->fi()
|
||||
->beginIF($objectType === 'project' and $objectID)->andWhere('project')->eq($objectID)->fi()
|
||||
->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('deleted')->eq(0)->fi()
|
||||
->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('deleted')->eq(0)->fi()
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ class buildModel extends model
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t5')->on('t1.product = t5.id')
|
||||
->where('1=1')
|
||||
->andWhere('t1.id')->notIN($shadows)
|
||||
->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('t1.deleted')->eq(0)->fi()
|
||||
->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('t1.deleted')->eq(0)->fi()
|
||||
->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi()
|
||||
->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi()
|
||||
->beginIF($products)->andWhere('t1.product')->in($products)->fi()
|
||||
@@ -457,7 +457,7 @@ class buildModel extends model
|
||||
->get();
|
||||
|
||||
$product = $this->loadModel('product')->getByID($build->product);
|
||||
if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch']))
|
||||
if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch']) and isset($_POST['product']))
|
||||
{
|
||||
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
|
||||
dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<td><?php if($disabled) echo $lang->build->notice->changeProduct;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class='<?php if((!empty($product) and $product->type == 'normal') or empty($product)) echo 'hidden'?>'>
|
||||
<tr class='<?php if((!empty($product) and $product->type == 'normal') or empty($product) or empty($build->execution)) echo 'hidden'?>'>
|
||||
<?php
|
||||
if(empty($product)) $product = new stdclass();
|
||||
$productType = zget($product, 'type', 'normal');
|
||||
|
||||
@@ -898,7 +898,7 @@ class execution extends control
|
||||
$storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList, $executionID);
|
||||
$storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList);
|
||||
|
||||
$plans = $this->execution->getPlans($products, 'skipParent|withMainPlan', $executionID);
|
||||
$plans = $this->execution->getPlans($products, 'skipParent|withMainPlan|unexpired|noclosed', $executionID);
|
||||
$allPlans = array('' => '');
|
||||
if(!empty($plans))
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#endLabel {white-space: nowrap;}
|
||||
#copyProjectModal .projectSelect {display: inline-block; margin-left: 10px; width: 20%;}
|
||||
#copyProjectModal .titleBox{position: relative; bottom: 3px; display: inline-block;}
|
||||
a.chosen-single > div > b {top: -4px !important;}
|
||||
#copyProjectModal .projectSelect a.chosen-single > div > b {top: -4px !important;}
|
||||
|
||||
.productsBox a {border-radius: 2px !important;}
|
||||
.productsBox .required:after {right: -9.5px !important;}
|
||||
|
||||
@@ -1582,17 +1582,14 @@ class executionModel extends model
|
||||
->andWhere('type')->eq('execution')
|
||||
->fetchPairs();
|
||||
}
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
|
||||
$executions = $this->dao->select('t1.*,t2.name projectName, t2.model as projectModel')->from(TABLE_EXECUTION)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project')
|
||||
->beginIF(!empty($project->division))->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t4.id=t3.product')->fi()
|
||||
->beginIF($productID)->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project')->fi()
|
||||
->where('t1.type')->in('sprint,stage,kanban')
|
||||
->andWhere('t1.deleted')->eq('0')
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('t1.multiple')->eq('1')
|
||||
->beginIF(!empty($project->division))->andWhere('t4.deleted')->eq('0')->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi()
|
||||
->beginIF(!empty($executionQuery))->andWhere($executionQuery)->fi()
|
||||
->beginIF($productID)->andWhere('t3.product')->eq($productID)->fi()
|
||||
@@ -2319,7 +2316,7 @@ class executionModel extends model
|
||||
$planPairs = array('' => '');
|
||||
foreach($products as $productID => $product)
|
||||
{
|
||||
$plans = $this->productplan->getBranchPlanPairs($productID, array(BRANCH_MAIN) + $product->branches, true);
|
||||
$plans = $this->productplan->getBranchPlanPairs($productID, array(BRANCH_MAIN) + $product->branches, 'unexpired', true);
|
||||
foreach($plans as $plan) $planPairs += $plan;
|
||||
}
|
||||
$this->config->product->search['params']['plan']['values'] = $planPairs;
|
||||
@@ -4656,6 +4653,8 @@ class executionModel extends model
|
||||
{
|
||||
$this->loadModel('productplan');
|
||||
|
||||
$date = date('Y-m-d');
|
||||
|
||||
$param = strtolower($param);
|
||||
$branchIdList = strpos($param, 'withmainplan') !== false ? array(BRANCH_MAIN => BRANCH_MAIN) : array();
|
||||
$branchGroups = $this->getBranchByProduct(array_keys($products), $executionID, 'noclosed');
|
||||
@@ -4686,6 +4685,8 @@ class executionModel extends model
|
||||
->where('t1.product')->in(array_keys($products))
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->andWhere($branchQuery)
|
||||
->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')
|
||||
->fetchAll('id');
|
||||
|
||||
|
||||
@@ -408,7 +408,8 @@
|
||||
<div class="modal-body">
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('plan', $allPlans, '', "class='form-control chosen' id='plan'");?>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->execution->linkStory, "id='toTaskButton'", 'btn btn-primary');?></span>
|
||||
<?php $disabled = empty(array_filter($allPlans)) ? 'disabled' : ''?>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->execution->linkStory, "id='toTaskButton'", 'btn btn-primary ' . $disabled);?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@ class file extends control
|
||||
{
|
||||
echo(js::alert($this->lang->file->accessDenied));
|
||||
if(isonlybody()) return print(js::reload('parent.parent'));
|
||||
return print(js::locate(helper::createLink('my', 'index')));
|
||||
return print(js::locate(helper::createLink('my', 'index'), 'parent.parent'));
|
||||
}
|
||||
|
||||
/* Judge the mode, down or open. */
|
||||
|
||||
@@ -962,7 +962,10 @@ EOF;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lang->my->auditMenu->audit = $this->my->getReviewingTypeList();
|
||||
$typeList = $this->my->getReviewingTypeList();
|
||||
if(!isset($typeList->$browseType)) $browseType = 'all';
|
||||
|
||||
$this->lang->my->auditMenu->audit = $typeList;
|
||||
$reviewList = $this->my->getReviewingList($browseType, $orderBy, $pager);
|
||||
}
|
||||
|
||||
|
||||
@@ -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', $projectID);
|
||||
$productPlans = $this->execution->getPlans($projectProducts, 'skipParent,unexpired,noclosed', $projectID);
|
||||
|
||||
if($browseType == 'bybranch') $param = $branchID;
|
||||
$stories = $this->story->getExecutionStories($projectID, $productID, $branchID, $sort, $browseType, $param, $storyType, '', $pager);
|
||||
|
||||
@@ -1030,6 +1030,7 @@ class productplan extends control
|
||||
$parentPlan = $this->productplan->getByID($parentID);
|
||||
foreach(explode(',', $parentPlan->branch) as $parentBranchID)
|
||||
{
|
||||
if(!isset($branchPairs[$parentBranchID])) continue;
|
||||
$parentBranches[$parentBranchID] = $branchPairs[$parentBranchID];
|
||||
if(!empty($currentBranches) and strpos(",$currentBranches,", ",$parentBranchID,") === false) $currentBranches = str_replace(",$parentBranchID,", ',', $currentBranches);
|
||||
}
|
||||
|
||||
@@ -460,11 +460,12 @@ class productplanModel extends model
|
||||
*
|
||||
* @param int $productID
|
||||
* @param array $branches
|
||||
* @param string $param
|
||||
* @param bool $skipParent
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBranchPlanPairs($productID, $branches = '', $skipParent = false)
|
||||
public function getBranchPlanPairs($productID, $branches = '', $param = '', $skipParent = false)
|
||||
{
|
||||
$branchQuery = '';
|
||||
if($branches !== '' and $branches !== 'all')
|
||||
@@ -479,10 +480,14 @@ class productplanModel extends model
|
||||
$branchQuery .= ')';
|
||||
}
|
||||
|
||||
$date = date('Y-m-d');
|
||||
$param = strtolower($param);
|
||||
$plans = $this->dao->select('parent,branch,id,title,begin,end')->from(TABLE_PRODUCTPLAN)
|
||||
->where('product')->eq($productID)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF(!empty($branchQuery))->andWhere($branchQuery)->fi()
|
||||
->beginIF($branches != '')->andWhere('branch')->in($branches)->fi()
|
||||
->beginIF(strpos($param, 'unexpired') !== false)->andWhere('end')->ge($date)->fi()
|
||||
->orderBy('begin desc')
|
||||
->fetchAll('id');
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<?php if($project->hasProduct):?>
|
||||
<th class="c-name w-150px text-left"><?php echo $lang->build->product;?></th>
|
||||
<?php if($showBranch):?>
|
||||
<th class="c-name w-150px text-left"><?php echo $lang->build->branch;?></th>
|
||||
<th class="c-name w-200px text-left"><?php echo $lang->build->branch;?></th>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php if($project->multiple):?>
|
||||
@@ -84,7 +84,12 @@
|
||||
<?php endif;?>
|
||||
<?php if($project->multiple):?>
|
||||
<?php if($build->execution):?>
|
||||
<td class="c-name text-left" title='<?php echo $build->executionName;?>'><?php echo $build->executionName;?></td>
|
||||
<td class="c-name text-left" title='<?php echo $build->executionName;?>'>
|
||||
<?php echo $build->executionName;?>
|
||||
<?php if($build->executionDeleted):?>
|
||||
<span class='label label-danger'><?php echo $lang->build->deleted;?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php else:?>
|
||||
<td class="c-name text-left">
|
||||
<?php $childExecutions = array();?>
|
||||
|
||||
@@ -87,6 +87,16 @@ class projectrelease extends control
|
||||
|
||||
$releases = $this->projectrelease->getList($projectID, $type, $orderBy, $pager);
|
||||
|
||||
$showBranch = false;
|
||||
foreach($releases as $release)
|
||||
{
|
||||
if($release->productType != 'normal')
|
||||
{
|
||||
$showBranch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->title = $objectName . $this->lang->colon . $this->lang->release->browse;
|
||||
$this->view->execution = $execution;
|
||||
$this->view->project = $project;
|
||||
@@ -97,6 +107,7 @@ class projectrelease extends control
|
||||
$this->view->type = $type;
|
||||
$this->view->from = $this->app->tab;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->showBranch = $showBranch;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -136,7 +147,7 @@ class projectrelease extends control
|
||||
$builds = $this->build->getBuildPairs($this->view->product->id, 'all', 'notrunk|withbranch|hasproject', $projectID, 'project', '', false);
|
||||
$releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID);
|
||||
foreach($releasedBuilds as $build) unset($builds[$build]);
|
||||
|
||||
|
||||
$this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->builds = $builds;
|
||||
|
||||
@@ -59,7 +59,7 @@ class projectreleaseModel extends model
|
||||
*/
|
||||
public function getList($projectID, $type = 'all', $orderBy = 't1.date_desc', $pager = null)
|
||||
{
|
||||
$releases = $this->dao->select('t1.*, t2.name as productName')->from(TABLE_RELEASE)->alias('t1')
|
||||
$releases = $this->dao->select('t1.*, t2.name as productName, t2.type as productType')->from(TABLE_RELEASE)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere("FIND_IN_SET($projectID, t1.project)")
|
||||
|
||||
@@ -53,7 +53,9 @@
|
||||
<th class='c-product'><?php echo $lang->projectrelease->product;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-build'><?php echo $lang->release->includedBuild;?></th>
|
||||
<?php if($showBranch):?>
|
||||
<th class='c-branch text-center'><?php echo $lang->release->branch;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-status text-center'><?php echo $lang->release->status;?></th>
|
||||
<th class='c-date text-center'><?php echo $lang->release->date;?></th>
|
||||
<?php
|
||||
@@ -88,7 +90,9 @@
|
||||
<td class='c-build'><?php if($buildCount) echo html::a($this->createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$buildID"), $build->name, '', "data-app='project' title='{$build->name}'");?></td>
|
||||
<?php if($i == 0):?>
|
||||
<?php $status = $this->processStatus('release', $release);?>
|
||||
<?php if($showBranch):?>
|
||||
<td <?php echo $rowspan?> class='c-branch text-center'><?php echo $release->branchName; ?></td>
|
||||
<?php endif;?>
|
||||
<td <?php echo $rowspan?> class='c-status text-center' title='<?php echo $status;?>'>
|
||||
<span class="status-release status-<?php echo $release->status?>"><?php echo $status;?></span>
|
||||
</td>
|
||||
|
||||
@@ -50,12 +50,23 @@ class release extends control
|
||||
$uri = $this->app->getURI(true);
|
||||
$this->session->set('releaseList', $uri, 'product');
|
||||
$this->session->set('buildList', $uri);
|
||||
$releases = $this->release->getList($productID, $branch, $type, $orderBy, $pager);
|
||||
$showBranch = false;
|
||||
foreach($releases as $release)
|
||||
{
|
||||
if($release->productType != 'normal')
|
||||
{
|
||||
$showBranch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->browse;
|
||||
$this->view->position[] = $this->lang->release->browse;
|
||||
$this->view->releases = $this->release->getList($productID, $branch, $type, $orderBy, $pager);
|
||||
$this->view->releases = $releases;
|
||||
$this->view->type = $type;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->showBranch = $showBranch;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class releaseModel extends model
|
||||
*/
|
||||
public function getList($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc', $pager = null)
|
||||
{
|
||||
$releases = $this->dao->select('t1.*, t2.name as productName')->from(TABLE_RELEASE)->alias('t1')
|
||||
$releases = $this->dao->select('t1.*, t2.name as productName, t2.type as productType')->from(TABLE_RELEASE)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi()
|
||||
@@ -84,8 +84,19 @@ class releaseModel extends model
|
||||
|
||||
$releaseBuilds[] = $builds[$buildID];
|
||||
}
|
||||
|
||||
$release->builds = $releaseBuilds;
|
||||
|
||||
$branchName = '';
|
||||
if($release->branch != 'normal')
|
||||
{
|
||||
foreach(explode(',', $release->branch) as $releaseBranch)
|
||||
{
|
||||
$branchName .= $this->loadModel('branch')->getById($releaseBranch);
|
||||
$branchName .= ',';
|
||||
}
|
||||
$branchName = trim($branchName, ',');
|
||||
}
|
||||
$release->branchName = empty($branchName) ? $this->lang->branch->main : $branchName;
|
||||
}
|
||||
|
||||
return $releases;
|
||||
@@ -224,6 +235,7 @@ class releaseModel extends model
|
||||
$linkedBuilds = array_merge($linkedBuilds, explode(',', $build->builds));
|
||||
}
|
||||
if($linkedBuilds) $builds += $this->dao->select('id,project,branch,builds,stories,bugs')->from(TABLE_BUILD)->where('id')->in($linkedBuilds)->fetchAll('id');
|
||||
$branches = array();
|
||||
foreach($builds as $build)
|
||||
{
|
||||
foreach(explode(',', $build->branch) as $buildBranch)
|
||||
@@ -328,10 +340,14 @@ class releaseModel extends model
|
||||
/* update release project and branch */
|
||||
if($release->build)
|
||||
{
|
||||
$builds = $this->dao->select('project, branch')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll();
|
||||
$builds = $this->dao->select('project, branch')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll();
|
||||
$branches = array();
|
||||
foreach($builds as $build)
|
||||
{
|
||||
$branches[$build->branch] = $build->branch;
|
||||
foreach(explode(',', $build->branch) as $buildBranch)
|
||||
{
|
||||
if(!isset($branches[$buildBranch])) $branches[$buildBranch] = $buildBranch;
|
||||
}
|
||||
$projects[$build->project] = $build->project;
|
||||
}
|
||||
$release->build = ',' . trim($release->build, ',') . ',';
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
<th class='c-id'><?php echo $lang->release->id;?></th>
|
||||
<th class="c-name"><?php echo $lang->release->name;?></th>
|
||||
<th class='c-build'><?php echo $lang->release->includedBuild;?></th>
|
||||
<?php if($showBranch):?>
|
||||
<th class="c-name w-200px"><?php echo $lang->release->branch;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-project'><?php echo $lang->release->relatedProject;?></th>
|
||||
<th class='text-center c-status'><?php echo $lang->release->status;?></th>
|
||||
<th class='c-date text-center'><?php echo $lang->release->date;?></th>
|
||||
@@ -98,6 +101,11 @@
|
||||
?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<?php if($i == 1):?>
|
||||
<?php if($showBranch):?>
|
||||
<td <?php echo $rowspan?> class='c-branch text-center'><?php echo $release->branchName; ?></td>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<td><?php if($buildCount) echo $build->projectName;?></td>
|
||||
<?php if($i == 1):?>
|
||||
<?php $status = $this->processStatus('release', $release);?>
|
||||
|
||||
@@ -263,7 +263,9 @@ class story extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$response['locate'] = $this->session->storyList;
|
||||
$sessionStoryList = $this->session->storyList;
|
||||
if(count($_POST['branches']) > 1) $sessionStoryList = preg_replace('/branch=(\d+|[A-Za-z]+)/', 'branch=all', $this->session->storyList);
|
||||
$response['locate'] = $sessionStoryList;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1064,7 +1066,7 @@ class story extends control
|
||||
$moduleList = $branchProduct ? $modulePairs : array(0 => $modulePairs);
|
||||
|
||||
$modules = array($productID => $moduleList);
|
||||
$plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', true));
|
||||
$plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', 'unexpired', true));
|
||||
$products = array($productID => $product);
|
||||
$branchTagOption = array($productID => $branchTagOption);
|
||||
}
|
||||
@@ -1096,7 +1098,7 @@ class story extends control
|
||||
$modulePairs = $this->tree->getOptionMenu($storyProduct->id, 'story', 0, $branches);
|
||||
$modules[$storyProduct->id] = $storyProduct->type != 'normal' ? $modulePairs : array(0 => $modulePairs);
|
||||
|
||||
$plans[$storyProduct->id] = $this->productplan->getBranchPlanPairs($storyProduct->id, $branches, true);
|
||||
$plans[$storyProduct->id] = $this->productplan->getBranchPlanPairs($storyProduct->id, $branches, 'unexpired', true);
|
||||
if(empty($plans[$storyProduct->id])) $plans[$storyProduct->id][0] = $plans[$storyProduct->id];
|
||||
|
||||
if($storyProduct->type != 'normal') $branchProduct = true;
|
||||
|
||||
@@ -521,4 +521,4 @@ $lang->requirement->linkStory = 'Link Story';
|
||||
|
||||
$lang->story->addBranch = 'Add %s';
|
||||
$lang->story->deleteBranch = 'Delete %s';
|
||||
$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later';
|
||||
$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later';
|
||||
|
||||
@@ -521,4 +521,4 @@ $lang->requirement->linkStory = 'Link Story';
|
||||
|
||||
$lang->story->addBranch = 'Add %s';
|
||||
$lang->story->deleteBranch = 'Delete %s';
|
||||
$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later';
|
||||
$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later';
|
||||
|
||||
@@ -521,4 +521,4 @@ $lang->requirement->linkStory = 'Lier Story';
|
||||
|
||||
$lang->story->addBranch = 'Add %s';
|
||||
$lang->story->deleteBranch = 'Delete %s';
|
||||
$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later';
|
||||
$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later';
|
||||
|
||||
@@ -521,4 +521,4 @@ $lang->requirement->linkStory = "关联{$lang->SRCommon}";
|
||||
|
||||
$lang->story->addBranch = '添加%s';
|
||||
$lang->story->deleteBranch = '删除%s';
|
||||
$lang->story->notice->branch = '每个分支会建立一个需求,需求间互为孪生关系,孪生需求间除产品、分支、模块、计划、阶段字段外均同步,后期您可以手动解除孪生关系';
|
||||
$lang->story->notice->branch = '每个分支会建立一个需求,需求间互为孪生关系。孪生需求间除产品、分支、模块、计划、阶段字段外均保持同步,后期您可以手动解除孪生关系。';
|
||||
|
||||
@@ -1256,7 +1256,7 @@ class storyModel extends model
|
||||
if(empty($childrenStatus)) return $this->dao->update(TABLE_STORY)->set('parent')->eq('0')->where('id')->eq($parentID)->exec();
|
||||
|
||||
$status = $oldParentStory->status;
|
||||
if(count($childrenStatus) == 1 and $oldParentStory->status != 'changing')
|
||||
if(count($childrenStatus) == 1 and $oldParentStory->status != 'changing' and $oldParentStory->status != 'reviewing')
|
||||
{
|
||||
$status = current($childrenStatus);
|
||||
if($status == 'draft' or $status == 'changing') $status = 'active';
|
||||
|
||||
@@ -91,7 +91,7 @@ class testtaskModel extends model
|
||||
->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in($products)->fi()
|
||||
->beginIF(strtolower($scopeAndStatus[1]) == 'totalstatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi()
|
||||
->beginIF(!in_array(strtolower($scopeAndStatus[1]), array('totalstatus', 'review'), true))->andWhere('t1.status')->eq($scopeAndStatus[1])->fi()
|
||||
->beginIF($branch !== 'all')->andWhere('t4.branch')->eq($branch)->fi()
|
||||
->beginIF($branch !== 'all')->andWhere("CONCAT(',', t4.branch, ',')")->like("%,$branch,%")->fi()
|
||||
->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi()
|
||||
->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi()
|
||||
->beginIF($branch == BRANCH_MAIN)
|
||||
|
||||
@@ -852,7 +852,7 @@ class transferModel extends model
|
||||
$storyDatas = end($stories);
|
||||
$lastBranch = $storyDatas->branch;
|
||||
$lastType = $storyDatas->type;
|
||||
$stories = $this->story->mergePlanTitle($productID , $stories, $lastBranch, $lastType);
|
||||
$stories = $this->loadModel('story')->mergePlanTitle($productID , $stories, $lastBranch, $lastType);
|
||||
|
||||
return $stories;
|
||||
}
|
||||
|
||||
@@ -422,6 +422,7 @@ class webhookModel extends model
|
||||
$viewLink = $this->getViewLink($objectType == 'kanbancard' ? 'kanban' : $objectType, $objectType == 'kanbancard' ? $object->kanban : $objectID);
|
||||
$objectTypeName = ($objectType == 'story' and $object->type == 'requirement') ? $this->lang->action->objectTypes['requirement'] : $this->lang->action->objectTypes[$objectType];
|
||||
$title = $this->app->user->realname . $this->lang->action->label->$actionType . $objectTypeName;
|
||||
$host = (defined('RUN_MODE') and RUN_MODE == 'api') ? '' : $host;
|
||||
$text = $title . ' ' . "[#{$objectID}::{$object->$field}](" . $host . $viewLink . ")";
|
||||
|
||||
$mobile = '';
|
||||
|
||||
Reference in New Issue
Block a user