Merge branch 'master' into 'sgm_fixbug'
# Conflicts: # module/kanban/model.php # module/kanban/view/view.html.php
This commit is contained in:
@@ -258,22 +258,19 @@ class branch extends control
|
||||
*/
|
||||
public function ajaxGetBranches($productID, $oldBranch = 0, $param = '', $projectID = 0)
|
||||
{
|
||||
$param = $param ? $param : 'all';
|
||||
$product = $this->loadModel('product')->getById($productID);
|
||||
if(empty($product) or $product->type == 'normal') die();
|
||||
|
||||
$branches = $this->branch->getPairs($productID, $param);
|
||||
|
||||
/* Remove unlinked branches of the project. */
|
||||
if($projectID)
|
||||
$branches = $this->loadModel('branch')->getList($productID, $projectID, $param);
|
||||
$branchOption = array();
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$projectProducts = $this->loadModel('project')->getBranchesByProject($projectID);
|
||||
foreach($branches as $branchID => $branchName)
|
||||
{
|
||||
if(!isset($projectProducts[$productID][$branchID])) unset($branches[$branchID]);
|
||||
}
|
||||
$branchOption[$branchInfo->id] = $branchInfo->name;
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
|
||||
die(html::select('branch', $branches, $oldBranch, "class='form-control' onchange='loadBranch(this)'"));
|
||||
die(html::select('branch', strpos($param, 'active') !== false ? $branchOption : $branchTagOption, $oldBranch, "class='form-control' onchange='loadBranch(this)'"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -85,6 +85,8 @@ class branchModel extends model
|
||||
$mainBranch->desc = sprintf($this->lang->branch->mainBranch, $this->lang->product->branchName[$product->type]);
|
||||
$mainBranch->order = 0;
|
||||
|
||||
if($productID) $product = $this->loadModel('product')->getById($productID);
|
||||
if(isset($product) and $product->type == 'normal') return $branchList;
|
||||
return array($mainBranch) + $branchList;
|
||||
}
|
||||
|
||||
|
||||
+36
-15
@@ -207,6 +207,16 @@ class bug extends control
|
||||
/* Display of branch label. */
|
||||
$showBranch = $this->loadModel('branch')->showBranch($productID);
|
||||
|
||||
/* Display status of branch. */
|
||||
$branches = $this->loadModel('branch')->getList($productID, 0, 'all');
|
||||
$branchOption = array();
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchOption[$branchInfo->id] = $branchInfo->name;
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
|
||||
/* Set view. */
|
||||
$this->view->title = $productName . $this->lang->colon . $this->lang->bug->common;
|
||||
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName,'','title=' . $productName);
|
||||
@@ -229,7 +239,8 @@ class bug extends control
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->memberPairs = $this->user->getPairs('noletter|nodeleted');
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
|
||||
$this->view->branchOption = $branchOption;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->executions = $executions;
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairs($productID);
|
||||
$this->view->stories = $storyList;
|
||||
@@ -965,13 +976,17 @@ class bug extends control
|
||||
|
||||
if($this->app->tab == 'execution' or $this->app->tab == 'project')
|
||||
{
|
||||
$objectID = $this->app->tab == 'project' ? $bug->project : $bug->execution;
|
||||
$productBranches = (isset($product->type) and $product->type != 'normal') ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID, 'all') : array();
|
||||
$branches = isset($productBranches[$productID]) ? array(BRANCH_MAIN => $this->lang->branch->main) + $productBranches[$productID] : array();
|
||||
$objectID = $this->app->tab == 'project' ? $bug->project : $bug->execution;
|
||||
}
|
||||
else
|
||||
|
||||
/* Display status of branch. */
|
||||
$branches = $this->loadModel('branch')->getList($productID, isset($objectID) ? $objectID : 0, 'all');
|
||||
$branchOption = array();
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branches = (isset($product->type) and $product->type != 'normal') ? $this->loadModel('branch')->getPairs($productID) : array();
|
||||
$branchOption[$branchInfo->id] = $branchInfo->name;
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
|
||||
$this->view->bug = $bug;
|
||||
@@ -984,7 +999,8 @@ class bug extends control
|
||||
$this->view->currentModuleID = $currentModuleID;
|
||||
$this->view->executions = array(0 => '') + $this->product->getExecutionPairsByProduct($bug->product, $bug->branch, 'id_desc', $bug->project);
|
||||
$this->view->stories = $bug->execution ? $this->story->getExecutionStoryPairs($bug->execution) : $this->story->getProductStoryPairs($bug->product, $bug->branch);
|
||||
$this->view->branches = $branches;
|
||||
$this->view->branchOption = $branchOption;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->tasks = $this->task->getExecutionTaskPairs($bug->execution);
|
||||
$this->view->testtasks = $this->loadModel('testtask')->getPairs($bug->product, $bug->execution, $bug->testtask);
|
||||
$this->view->users = $this->user->getPairs('nodeleted', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy");
|
||||
@@ -1053,12 +1069,17 @@ class bug extends control
|
||||
$plans = array('' => '', 'ditto' => $this->lang->bug->ditto) + $plans;
|
||||
|
||||
/* Set branches and modules. */
|
||||
$branches = array();
|
||||
$branches = array();
|
||||
$branchTagOption = array();
|
||||
$modules = array();
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
$branches = $this->loadModel('branch')->getPairs($productID);
|
||||
foreach($branches as $branchID => $branchName)
|
||||
$branches = $this->loadModel('branch')->getList($productID, 0 ,'all');
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
foreach($branchTagOption as $branchID => $branchName)
|
||||
{
|
||||
$modules[$productID][$branchID] = $this->tree->getOptionMenu($productID, 'bug', 0, $branchID);
|
||||
}
|
||||
@@ -1071,11 +1092,11 @@ class bug extends control
|
||||
/* Set product menu. */
|
||||
$this->qa->setMenu($this->products, $productID, $branch);
|
||||
|
||||
$this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit;
|
||||
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->plans = $plans;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit;
|
||||
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->plans = $plans;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->modules = $modules;
|
||||
}
|
||||
/* The bugs of my. */
|
||||
else
|
||||
|
||||
@@ -76,14 +76,19 @@
|
||||
if(!empty($this->config->user->moreLink)) $this->config->moreLinks["assignedTos[$bugID]"] = $this->config->user->moreLink;
|
||||
if(!$productID)
|
||||
{
|
||||
$product = $this->product->getByID($bug->product);
|
||||
$plans = $this->loadModel('productplan')->getPairs($bug->product, $branch);
|
||||
$branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getPairs($product->id);
|
||||
$branchTagOption = array();
|
||||
$product = $this->product->getByID($bug->product);
|
||||
$plans = $this->loadModel('productplan')->getPairs($bug->product, $branch);
|
||||
$branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getList($product->id, 0 ,'all');;
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
|
||||
$modules[$bug->product][0] = $this->tree->getOptionMenu($bug->product, 'bug');
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
|
||||
foreach($branchTagOption as $branchID => $branchName) $branchTagOption[$branchID] = '/' . $product->name . '/' . $branchName;
|
||||
$modules[$bug->product][$bug->branch] = $this->tree->getOptionMenu($bug->product, 'bug', 0, $bug->branch);
|
||||
}
|
||||
}
|
||||
@@ -111,7 +116,7 @@
|
||||
<td style='overflow:visible'>
|
||||
<?php $branchProductID = $productID ? $productID : $product->id;?>
|
||||
<?php $disabled = (isset($product) and $product->type == 'normal') ? "disabled='disabled'" : '';?>
|
||||
<?php echo html::select("branches[$bugID]", $branches, $bug->branch, "class='form-control chosen' $disabled onchange='setBranchRelated(this.value, $bug->product, $bug->id)'");?>
|
||||
<?php echo html::select("branches[$bugID]", $branchTagOption, $bug->branch, "class='form-control chosen' $disabled onchange='setBranchRelated(this.value, $bug->product, $bug->id)'");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td><?php echo html::select("modules[$bugID]", $modules[$bug->product][$bug->branch], $bug->module, "class='form-control chosen'");?></td>
|
||||
|
||||
@@ -302,11 +302,11 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
|
||||
{
|
||||
if($value->id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status')
|
||||
{
|
||||
$this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table');
|
||||
$this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table');
|
||||
}
|
||||
}?>
|
||||
<?php else:?>
|
||||
<?php foreach($setting as $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table');?>
|
||||
<?php foreach($setting as $value) $this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table');?>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
@@ -385,7 +385,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
|
||||
<?php if($canBatchChangeBranch and $this->session->currentProductType != 'normal'):?>
|
||||
<div class="btn-group dropup">
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->product->branchName[$this->session->currentProductType];?> <span class="caret"></span></button>
|
||||
<?php $withSearch = count($branches) > 6;?>
|
||||
<?php $withSearch = count($branchTagOption) > 6;?>
|
||||
<?php if($withSearch):?>
|
||||
<div class="dropdown-menu search-list search-box-sink" data-ride="searchList">
|
||||
<div class="input-control search-box has-icon-left has-icon-right search-example">
|
||||
@@ -393,13 +393,13 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
|
||||
<label for="userSearchBox" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
|
||||
<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>
|
||||
</div>
|
||||
<?php $branchsPinYin = common::convert2Pinyin($branches);?>
|
||||
<?php $branchsPinYin = common::convert2Pinyin($branchTagOption);?>
|
||||
<?php else:?>
|
||||
<div class="dropdown-menu search-list">
|
||||
<?php endif;?>
|
||||
<div class="list-group">
|
||||
<?php
|
||||
foreach($branches as $branchID => $branchName)
|
||||
foreach($branchTagOption as $branchID => $branchName)
|
||||
{
|
||||
$searchKey = $withSearch ? ('data-key="' . zget($branchsPinYin, $branchName, '') . '"') : '';
|
||||
$actionLink = $this->createLink('bug', 'batchChangeBranch', "branchID=$branchID");
|
||||
|
||||
@@ -95,7 +95,7 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project);
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value)' class='form-control chosen'");?>
|
||||
<?php if($product->type != 'normal') echo html::select('branch', $branches, $bug->branch, "onchange='loadBranch();' class='form-control'");?>
|
||||
<?php if($product->type != 'normal') echo html::select('branch', $branchTagOption, $bug->branch, "onchange='loadBranch();' class='form-control'");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+12
-18
@@ -169,29 +169,23 @@ class build extends control
|
||||
$productGroups[$build->product] = $product;
|
||||
}
|
||||
|
||||
$branchGroups = $this->loadModel('project')->getBranchesByProject($build->execution);
|
||||
$branchPairs = $this->loadModel('branch')->getPairs($build->product);
|
||||
$products = array();
|
||||
$branches = array();
|
||||
|
||||
/* Set branches and products. */
|
||||
if($productGroups[$build->product]->type != 'normal' and isset($branchGroups[$build->product]))
|
||||
/* Display status of branch. */
|
||||
$branches = $this->loadModel('branch')->getList($build->product, $build->execution, 'all');
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
foreach($branchGroups[$build->product] as $branchID => $branch)
|
||||
{
|
||||
$branches[$branchID] = $branchPairs[$branchID];
|
||||
}
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
|
||||
foreach($productGroups as $product) $products[$product->id] = $product->name;
|
||||
|
||||
$this->view->title = $execution->name . $this->lang->colon . $this->lang->build->edit;
|
||||
$this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$build->execution"), $execution->name);
|
||||
$this->view->position[] = $this->lang->build->edit;
|
||||
$this->view->product = isset($productGroups[$build->product]) ? $productGroups[$build->product] : '';
|
||||
$this->view->branches = $branches;
|
||||
$this->view->executions = $executions;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->title = $execution->name . $this->lang->colon . $this->lang->build->edit;
|
||||
$this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$build->execution"), $execution->name);
|
||||
$this->view->position[] = $this->lang->build->edit;
|
||||
$this->view->product = isset($productGroups[$build->product]) ? $productGroups[$build->product] : '';
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->executions = $executions;
|
||||
$this->view->orderBy = $orderBy;
|
||||
|
||||
$this->view->productGroups = $productGroups;
|
||||
$this->view->products = $products;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<?php
|
||||
if($build->productType != 'normal')
|
||||
{
|
||||
echo "<span class='input-group-addon fix-padding fix-border'></span>" . html::select('branch', $branches, $build->branch, "class='form-control chosen' $disabled");
|
||||
echo "<span class='input-group-addon fix-padding fix-border'></span>" . html::select('branch', $branchTagOption, $build->branch, "class='form-control chosen' $disabled");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -621,45 +621,48 @@ $lang->release->methodOrder[75] = 'notify';
|
||||
|
||||
/* Kanban */
|
||||
$lang->resource->kanban = new stdclass();
|
||||
$lang->resource->kanban->space = 'spaceCommon';
|
||||
$lang->resource->kanban->createSpace = 'createSpace';
|
||||
$lang->resource->kanban->editSpace = 'editSpace';
|
||||
$lang->resource->kanban->closeSpace = 'closeSpace';
|
||||
$lang->resource->kanban->deleteSpace = 'deleteSpace';
|
||||
$lang->resource->kanban->sortSpace = 'sortSpace';
|
||||
$lang->resource->kanban->create = 'create';
|
||||
$lang->resource->kanban->edit = 'edit';
|
||||
$lang->resource->kanban->view = 'view';
|
||||
$lang->resource->kanban->close = 'close';
|
||||
$lang->resource->kanban->delete = 'delete';
|
||||
$lang->resource->kanban->createRegion = 'createRegion';
|
||||
$lang->resource->kanban->editRegion = 'editRegion';
|
||||
$lang->resource->kanban->sortRegion = 'sortRegion';
|
||||
$lang->resource->kanban->sortGroup = 'sortGroup';
|
||||
$lang->resource->kanban->deleteRegion = 'deleteRegion';
|
||||
$lang->resource->kanban->createLane = 'createLane';
|
||||
$lang->resource->kanban->setLane = 'setLane';
|
||||
$lang->resource->kanban->sortLane = 'sortLane';
|
||||
$lang->resource->kanban->deleteLane = 'deleteLane';
|
||||
$lang->resource->kanban->createColumn = 'createColumn';
|
||||
$lang->resource->kanban->splitColumn = 'splitColumn';
|
||||
$lang->resource->kanban->restoreColumn = 'restoreColumn';
|
||||
$lang->resource->kanban->setColumn = 'setColumn';
|
||||
$lang->resource->kanban->setWIP = 'setWIP';
|
||||
$lang->resource->kanban->sortColumn = 'sortColumn';
|
||||
$lang->resource->kanban->deleteColumn = 'deleteColumn';
|
||||
$lang->resource->kanban->createCard = 'createCard';
|
||||
$lang->resource->kanban->editCard = 'editCard';
|
||||
$lang->resource->kanban->viewCard = 'viewCard';
|
||||
$lang->resource->kanban->sortCard = 'sortCard';
|
||||
$lang->resource->kanban->archiveCard = 'archiveCard';
|
||||
$lang->resource->kanban->assigntoCard = 'assigntoCard';
|
||||
$lang->resource->kanban->copyCard = 'copyCard';
|
||||
$lang->resource->kanban->deleteCard = 'deleteCard';
|
||||
$lang->resource->kanban->moveCard = 'moveCard';
|
||||
$lang->resource->kanban->setCardColor = 'setCardColor';
|
||||
$lang->resource->kanban->laneMove = 'laneMove';
|
||||
$lang->resource->kanban->cardsSort = 'cardsSort';
|
||||
$lang->resource->kanban->space = 'spaceCommon';
|
||||
$lang->resource->kanban->createSpace = 'createSpace';
|
||||
$lang->resource->kanban->editSpace = 'editSpace';
|
||||
$lang->resource->kanban->closeSpace = 'closeSpace';
|
||||
$lang->resource->kanban->deleteSpace = 'deleteSpace';
|
||||
$lang->resource->kanban->sortSpace = 'sortSpace';
|
||||
$lang->resource->kanban->create = 'create';
|
||||
$lang->resource->kanban->edit = 'edit';
|
||||
$lang->resource->kanban->view = 'view';
|
||||
$lang->resource->kanban->close = 'close';
|
||||
$lang->resource->kanban->delete = 'delete';
|
||||
$lang->resource->kanban->createRegion = 'createRegion';
|
||||
$lang->resource->kanban->editRegion = 'editRegion';
|
||||
$lang->resource->kanban->sortRegion = 'sortRegion';
|
||||
$lang->resource->kanban->sortGroup = 'sortGroup';
|
||||
$lang->resource->kanban->deleteRegion = 'deleteRegion';
|
||||
$lang->resource->kanban->createLane = 'createLane';
|
||||
$lang->resource->kanban->setLane = 'setLane';
|
||||
$lang->resource->kanban->sortLane = 'sortLane';
|
||||
$lang->resource->kanban->deleteLane = 'deleteLane';
|
||||
$lang->resource->kanban->createColumn = 'createColumn';
|
||||
$lang->resource->kanban->splitColumn = 'splitColumn';
|
||||
$lang->resource->kanban->archiveColumn = 'archiveColumn';
|
||||
$lang->resource->kanban->restoreColumn = 'restoreColumn';
|
||||
$lang->resource->kanban->setColumn = 'setColumn';
|
||||
$lang->resource->kanban->setWIP = 'setWIP';
|
||||
$lang->resource->kanban->sortColumn = 'sortColumn';
|
||||
$lang->resource->kanban->deleteColumn = 'deleteColumn';
|
||||
$lang->resource->kanban->createCard = 'createCard';
|
||||
$lang->resource->kanban->editCard = 'editCard';
|
||||
$lang->resource->kanban->viewCard = 'viewCard';
|
||||
$lang->resource->kanban->sortCard = 'sortCard';
|
||||
$lang->resource->kanban->archiveCard = 'archiveCard';
|
||||
$lang->resource->kanban->assigntoCard = 'assigntoCard';
|
||||
//$lang->resource->kanban->copyCard = 'copyCard';
|
||||
$lang->resource->kanban->deleteCard = 'deleteCard';
|
||||
$lang->resource->kanban->moveCard = 'moveCard';
|
||||
$lang->resource->kanban->setCardColor = 'setCardColor';
|
||||
$lang->resource->kanban->laneMove = 'laneMove';
|
||||
$lang->resource->kanban->cardsSort = 'cardsSort';
|
||||
$lang->resource->kanban->viewArchivedColumn = 'viewArchivedColumn';
|
||||
$lang->resource->kanban->viewArchivedCard = 'viewArchivedCard';
|
||||
|
||||
$lang->kanban->methodOrder[5] = 'space';
|
||||
$lang->kanban->methodOrder[10] = 'createSpace';
|
||||
@@ -693,13 +696,16 @@ $lang->kanban->methodOrder[140] = 'editCard';
|
||||
$lang->kanban->methodOrder[145] = 'viewCard';
|
||||
$lang->kanban->methodOrder[150] = 'sortCard';
|
||||
$lang->kanban->methodOrder[155] = 'archivedCard';
|
||||
$lang->kanban->methodOrder[160] = 'copyCard';
|
||||
//$lang->kanban->methodOrder[160] = 'copyCard';
|
||||
$lang->kanban->methodOrder[165] = 'deleteCard';
|
||||
$lang->kanban->methodOrder[170] = 'assigntoCard';
|
||||
$lang->kanban->methodOrder[175] = 'moveCard';
|
||||
$lang->kanban->methodOrder[180] = 'setCardColor';
|
||||
$lang->kanban->methodOrder[185] = 'laneMove';
|
||||
$lang->kanban->methodorder[190] = 'cardsSort';
|
||||
$lang->kanban->methodOrder[195] = 'viewArchivedColumn';
|
||||
$lang->kanban->methodorder[200] = 'viewArchivedCard';
|
||||
$lang->kanban->methodorder[205] = 'archiveColumn';
|
||||
|
||||
/* Execution. */
|
||||
$lang->resource->execution = new stdclass();
|
||||
|
||||
@@ -583,7 +583,7 @@ class kanban extends control
|
||||
*/
|
||||
public function viewArchivedColumn($regionID)
|
||||
{
|
||||
$columns = $this->kanban->getColumnsByRegion($regionID);
|
||||
$columns = $this->kanban->getColumnsByObject('region', $regionID, '', '');
|
||||
$columnsData = array();
|
||||
foreach($columns as $column)
|
||||
{
|
||||
@@ -767,6 +767,54 @@ class kanban extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* View archived cards.
|
||||
*
|
||||
* @param int $regionID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function viewArchivedCard($regionID)
|
||||
{
|
||||
$this->view->cards = $this->kanban->getCardsByObject('region', $regionID, 1);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
|
||||
$this->view->usersAvatar = $this->user->getAvatarPairs();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore a card.
|
||||
*
|
||||
* @param int $cardID
|
||||
* @param string $confirm no|yes
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function restoreCard($cardID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
$card = $this->kanban->getCardByID($cardID);
|
||||
$column = $this->dao->select('*')->from(TABLE_KANBANCOLUMN)->where('id')->eq($card->column)->fetch();
|
||||
if($column->archived) die(js::alert(sprintf($this->lang->kanbancard->confirmRestoreTip, $column->name)));
|
||||
|
||||
die(js::confirm(sprintf($this->lang->kanbancard->confirmRestore, $column->name), $this->createLink('kanban', 'restoreCard', "cardID=$cardID&confirm=yes"), ''));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->kanban->restoreCard($cardID);
|
||||
|
||||
$changes = $this->kanban->restoreCard($cardID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('kanbancard', $cardID, 'restore');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a card.
|
||||
*
|
||||
|
||||
@@ -324,6 +324,7 @@ function renderKanbanItem(item, $item)
|
||||
|
||||
if(!$item.hasClass('has-color') && needRemind) $time.css('background-color', 'rgba(210, 50, 61, 0.3)');
|
||||
if($item.hasClass('has-color') && needRemind) $time.css('background-color', 'rgba(255, 255, 255, 0.3)');
|
||||
if(!needRemind) $time.css('background-color', 'rgba(0, 0, 0, 0.15)');
|
||||
}
|
||||
|
||||
/* Display avatars of assignedTo. */
|
||||
|
||||
@@ -287,8 +287,10 @@ $lang->kanbancard->deadlineAB = 'DL';
|
||||
$lang->kanbancard->beginAB = 'Begin';
|
||||
$lang->kanbancard->to = 'to';
|
||||
|
||||
$lang->kanbancard->confirmArchive = 'Are you sure to archive this card? After archiving the card, it will be hidden from the column and you can view it in the Region - Archived.';
|
||||
$lang->kanbancard->confirmDelete = 'Are you sure to delete this card? After deleting the card, it will be deleted from the Kanban. You can only view it in the system recycle bin.';
|
||||
$lang->kanbancard->confirmArchive = 'Are you sure to archive this card? After archiving the card, it will be hidden from the column and you can view it in the Region - Archived.';
|
||||
$lang->kanbancard->confirmDelete = 'Are you sure to delete this card? After deleting the card, it will be deleted from the Kanban. You can only view it in the system recycle bin.';
|
||||
$lang->kanbancard->confirmRestore = 'Are you sure you want to restore this card? After the card is restored, the card will be restored to the "%s" Kanban column.';
|
||||
$lang->kanbancard->confirmRestoreTip = "The card's column has been archived, please restore '%s' column first.";
|
||||
|
||||
$lang->kanbancard->priList[1] = 1;
|
||||
$lang->kanbancard->priList[2] = 2;
|
||||
|
||||
@@ -79,12 +79,12 @@ $lang->kanban->createColumnOnRight = '在右侧添加看板列';
|
||||
$lang->kanban->accessDenied = '您无权访问该看板';
|
||||
$lang->kanban->confirmDelete = '您确认删除吗?';
|
||||
|
||||
$lang->kanban->aclList['extend'] = '继承空间访问权限(能访问当前空间,即可访问)';
|
||||
$lang->kanban->aclList['private'] = '私有(看板团队成员、白名单、空间负责人可访问)';
|
||||
|
||||
$lang->kanban->aclGroup['open'] = '公开';
|
||||
$lang->kanban->aclGroup['private'] = '私有';
|
||||
|
||||
$lang->kanban->aclList['extend'] = '继承空间访问权限(能访问当前空间,即可访问)';
|
||||
$lang->kanban->aclList['private'] = '私有(看板团队成员、白名单、空间负责人可访问)';
|
||||
|
||||
$lang->kanban->enableArchived['0'] = '不启用';
|
||||
$lang->kanban->enableArchived['1'] = '启用';
|
||||
|
||||
@@ -287,8 +287,10 @@ $lang->kanbancard->deadlineAB = '截止';
|
||||
$lang->kanbancard->beginAB = '开始';
|
||||
$lang->kanbancard->to = '至';
|
||||
|
||||
$lang->kanbancard->confirmArchive = '您确认归档该卡片吗?归档卡片后,该卡片将从列中隐藏,您可以在区域-已归档中查看。';
|
||||
$lang->kanbancard->confirmDelete = '您确认删除该卡片吗?删除卡片后,该卡片将从看板中删除,您只能通过系统回收站查看。';
|
||||
$lang->kanbancard->confirmArchive = '您确认归档该卡片吗?归档卡片后,该卡片将从列中隐藏,您可以在区域-已归档中查看。';
|
||||
$lang->kanbancard->confirmDelete = '您确认删除该卡片吗?删除卡片后,该卡片将从看板中删除,您只能通过系统回收站查看。';
|
||||
$lang->kanbancard->confirmRestore = '您确定要还原该卡片吗?还原卡片后,该卡片将还原到“%s”看板列中。';
|
||||
$lang->kanbancard->confirmRestoreTip = '该卡片所属的看板列已被归档,请先还原“%s”看板列。';
|
||||
|
||||
$lang->kanbancard->priList[1] = 1;
|
||||
$lang->kanbancard->priList[2] = 2;
|
||||
|
||||
+53
-22
@@ -266,7 +266,7 @@ class kanbanModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
$childColumns = $this->getColumnsByParent($column->parent);
|
||||
$childColumns = $this->getColumnsByObject('parent', $column->parent);
|
||||
foreach($childColumns as $childColumn)
|
||||
{
|
||||
$limit += (int)$childColumn->limit;
|
||||
@@ -2055,6 +2055,29 @@ class kanbanModel extends model
|
||||
if(!dao::isError()) return common::createChanges($oldCard, $card);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore a card.
|
||||
*
|
||||
* @param int $cardID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function restoreCard($cardID)
|
||||
{
|
||||
$oldCard = $this->getCardByID($cardID);
|
||||
|
||||
$this->dao->update(TABLE_KANBANCARD)
|
||||
->set('archived')->eq(0)
|
||||
->set('archivedBy')->eq('')
|
||||
->set('archivedDate')->eq('')
|
||||
->where('id')->eq($cardID)
|
||||
->exec();
|
||||
|
||||
$card = $this->getCardByID($cardID);
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldCard, $card);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get space by id.
|
||||
*
|
||||
@@ -2139,35 +2162,22 @@ class kanbanModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get child columns by parent id.
|
||||
* Get columns by object id.
|
||||
*
|
||||
* @param int $parentID
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @param string $archived
|
||||
* @param string $deleted
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getColumnsByParent($parentID, $archived = '0', $deleted = '0')
|
||||
public function getColumnsByObject($objectType = '', $objectID = 0, $archived = 0, $deleted = 0)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_KANBANCOLUMN)
|
||||
->where('parent')->eq($parentID)
|
||||
->andWhere('archived')->eq($archived)
|
||||
->andWhere('deleted')->eq($deleted)
|
||||
->orderBy('order')
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns by region id.
|
||||
*
|
||||
* @param int $regionID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getColumnsByRegion($regionID)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_KANBANCOLUMN)
|
||||
->where('region')->eq($regionID)
|
||||
->where(true)
|
||||
->beginIF($objectType)->andWhere($objectType)->eq($objectID)->fi()
|
||||
->beginIF($archived != '')->andWhere('archived')->eq($archived)->fi()
|
||||
->beginIF($deleted != '')->andWhere('deleted')->eq($deleted)->fi()
|
||||
->orderBy('order')
|
||||
->fetchAll('id');
|
||||
}
|
||||
@@ -2246,6 +2256,27 @@ class kanbanModel extends model
|
||||
return $card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cards by object id.
|
||||
*
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @param string $archived
|
||||
* @param string $deleted
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getCardsByObject($objectType = '', $objectID = 0, $archived = 0, $deleted = 0)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_KANBANCARD)
|
||||
->where(true)
|
||||
->beginIF($objectType)->andWhere($objectType)->eq($objectID)->fi()
|
||||
->beginIF($archived != '')->andWhere('archived')->eq($archived)->fi()
|
||||
->beginIF($deleted != '')->andWhere('deleted')->eq($deleted)->fi()
|
||||
->orderBy('order')
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Kanban cards menus by execution id.
|
||||
*
|
||||
|
||||
@@ -62,10 +62,20 @@ $canCreateLane = commonModel::hasPriv('kanban', 'createLane');
|
||||
<?php endif;?>
|
||||
</span>
|
||||
<span class='regionActions'>
|
||||
<button data-toggle="dropdown" class="btn btn-link action" type="button" title=<?php echo $this->lang->kanban->archived;?>>
|
||||
<span><?php echo $this->lang->kanban->archived;?></span>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<?php $canViewArchivedCard = commonModel::hasPriv('kanban', 'viewArchivedCard');?>
|
||||
<?php $canViewArchivedColumn = commonModel::hasPriv('kanban', 'viewArchivedColumn');?>
|
||||
<?php if(($canViewArchivedCard or $canViewArchivedColumn) and $kanban->archived):?>
|
||||
<span>
|
||||
<button data-toggle="dropdown" class="btn btn-link action" type="button" title=<?php echo $this->lang->kanban->archived;?>>
|
||||
<span><?php echo $this->lang->kanban->archived;?></span>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<?php if($canViewArchivedCard) echo '<li>' . html::a("javascript:loadMore(\"Card\", $region->id)", '<i class="icon icon-card-archive"></i>' . $this->lang->kanban->viewArchivedCard) . '</li>';?>
|
||||
<?php if($canViewArchivedColumn) echo '<li>' . html::a("javascript:loadMore(\"Column\", $region->id)", '<i class="icon icon-col-archive"></i>' . $this->lang->kanban->viewArchivedColumn) . '</li>';?>
|
||||
</ul>
|
||||
</span>
|
||||
<?php endif;?>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<?php echo '<li>' . html::a(inlink('viewArchivedCard', "", '', 1), '<i class="icon icon-card-archive"></i>' . $this->lang->kanban->viewArchivedCard, '', 'class="iframe" data-toggle="modal" data-width="600px"') . '</li>';?>
|
||||
<?php echo '<li>' . html::a(inlink('viewArchivedColumn', "", '', 1), '<i class="icon icon-col-archive"></i>' . $this->lang->kanban->viewArchivedColumn, '', 'class="iframe" data-toggle="modal" data-width="600px"') . '</li>';?>
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* The viewarchivedcard file of kanban module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Shujie Tian <tianshujie@easycorp.ltd>
|
||||
* @package kanban
|
||||
* @version $Id: viewarchivedcard.html.php 935 2021-12-22 15:44:24Z $
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<style>
|
||||
#archivedCards {top: 48px; right: -400px; width: 400px; position: fixed; z-index: 1050; background-color: rgb(255,255,255);}
|
||||
#archivedCards .panel .panel-body {overflow: auto; padding: 10px;}
|
||||
#archivedCards .kanban-item {border: 1px solid #ddd; border-radius: 4px; padding: 5px;}
|
||||
#archivedCards .kanban-item > .title {display: block; max-height: 38px; overflow: hidden; color: inherit; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;}
|
||||
#archivedCards .kanban-item > .title:hover {color: #2272eb}
|
||||
#archivedCards .kanban-item > .info {margin-top: 5px; position: relative;}
|
||||
#archivedCards .kanban-item > .info > .pri {height: 14px; border-width: 1px; font-size: 12px; line-height: 12px; min-width: 14px; padding: 0 1px;}
|
||||
#archivedCards .kanban-item > .info > .time {margin-left: 10px; font-size: 12px}
|
||||
#archivedCards .kanban-item > .info > .user {position: absolute; right: 0; top: 0}
|
||||
#archivedCards .card-actions {position: relative; padding: 15px 10px; padding-top: 0px;}
|
||||
#archivedCards .card-actions > .btn {display: block;}
|
||||
#archivedCards .card-actions > .btn + .btn {margin-top: 10px;}
|
||||
#archivedCards .info > .users > span:before {left: -4px;}
|
||||
#archivedCards .info > .users > span:after {right: -4px;}
|
||||
#archivedCards .info > .users .avatar {display: inline-block; position: relative; border-radius: 50%; top: -5px; margin: 5px; right: -7px; margin-left: -4px;}
|
||||
#archivedCards .cardName {word-wrap: break-word;}
|
||||
</style>
|
||||
<div class='panel'>
|
||||
<div class='panel-heading text-center'>
|
||||
<strong><?php echo $lang->kanban->archivedCard;?></strong>
|
||||
<button type="button" class="close" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<?php foreach($cards as $card):?>
|
||||
<div class='card-item' data-card='<?php echo $card->id;?>'>
|
||||
<div class='col-xs-10'>
|
||||
<div class="kanban-item" data-id="<?php echo $card->id;?>">
|
||||
<?php echo html::a($this->createLink('kanban', 'viewCard', "cardID=$card->id", '', true), $card->name, '', "class='cardName iframe' data-toggle='modal' data-width='80%' title='$card->name'");?>
|
||||
<div class="info">
|
||||
<span class="pri label-pri label-pri-<?php echo $card->pri;?>"><?php echo $card->pri;?></span>
|
||||
<?php if($card->estimate and $card->estimate != 0) echo "<span class='text-gray'>{$card->estimate}h</span>";?>
|
||||
<?php if(helper::isZeroDate($card->end) and !helper::isZeroDate($card->begin)):?>
|
||||
<span class="time label label-light"><?php echo date("m/d", strtotime($card->begin)) . $lang->kanbancard->beginAB;?></span>
|
||||
<?php endif;?>
|
||||
<?php if(helper::isZeroDate($card->begin) and !helper::isZeroDate($card->end)):?>
|
||||
<span class="time label label-light"><?php echo date("m/d", strtotime($card->end)) . $lang->kanbancard->deadlineAB;?></span>
|
||||
<?php endif;?>
|
||||
<?php if(!helper::isZeroDate($card->begin) and !helper::isZeroDate($card->end)):?>
|
||||
<span class="time label label-light"><?php echo date("m/d", strtotime($card->begin)) . ' ~ ' . date("m/d", strtotime($card->end));?></span>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
$assignedToList = explode(',', $card->assignedTo);
|
||||
$count = 0;
|
||||
$members = '';
|
||||
?>
|
||||
<?php
|
||||
foreach($assignedToList as $index => $account)
|
||||
{
|
||||
if(!isset($users[$account]))
|
||||
{
|
||||
unset($assignedToList[$index]);
|
||||
continue;
|
||||
}
|
||||
$members .= $users[$account] . ',';
|
||||
}
|
||||
$userCount = count($assignedToList);
|
||||
?>
|
||||
<?php if($userCount > 0):?>
|
||||
<div class='users pull-right' title="<?php echo $members;?>">
|
||||
<?php
|
||||
foreach($assignedToList as $account)
|
||||
{
|
||||
if($count > 4) continue;
|
||||
echo html::smallAvatar(array('avatar' => $usersAvatar[$account], 'account' => $account));
|
||||
$count ++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-xs-2 card-actions'>
|
||||
<?php
|
||||
$canRestore = commonModel::hasPriv('kanban', 'restoreCard');
|
||||
$canDelete = commonModel::hasPriv('kanban', 'deleteCard');
|
||||
|
||||
if($canRestore) echo html::a(inlink('restoreCard', "cardID={$card->id}", '',true), $lang->kanban->restore, '', "class='btn btn-xs btn-primary' target='hiddenwin'");
|
||||
|
||||
if($canDelete) echo html::a($this->createLink('kanban', 'deleteCard', "cardID=$card->id", '', true), $lang->delete, '', "class='btn btn-xs delete-card' target='hiddenwin'");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#archivedCards .panel .close').click(function()
|
||||
{
|
||||
$('#archivedCards').animate({right: -400}, 500);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@@ -13,7 +13,9 @@
|
||||
<style>
|
||||
#archivedColumns {top: 50px; right: -400px; width: 400px; position: fixed; z-index: 1050; background-color: rgb(255,255,255);}
|
||||
#archivedColumns .panel .panel-body {overflow: auto; padding: 0px 20px;}
|
||||
#archivedColumns .parent-item,#archivedColumns .child-item {padding: 20px 0px; border-bottom: 1px solid #ddd; line-height: 26px; overflow: hidden;}
|
||||
.hr {border-bottom: 1px solid #ddd;}
|
||||
#archivedColumns .parent-item,#archivedColumns .child-item {padding: 20px 0px; line-height: 26px; overflow: hidden;}
|
||||
#archivedColumns .child-item {padding: 5px 0px;}
|
||||
#archivedColumns .title {width: 250px; float: left;}
|
||||
#archivedColumns .label-child {border-radius: 12px; background-color: #DDDDDD; color: #333; margin-right: 10px;}
|
||||
#archivedColumns .btn {float: right; line-height: 26px; height: 26px; padding: 0 20px;}
|
||||
@@ -31,15 +33,19 @@
|
||||
<?php else:?>
|
||||
<?php foreach($columns as $column):?>
|
||||
<div class="item-body">
|
||||
<div class="item parent-item" data-archived='<?php echo $column->archived;?>' data-id="<?php echo $column->id;?>">
|
||||
<div class="item parent-item hr" data-archived='<?php echo $column->archived;?>' data-id="<?php echo $column->id;?>">
|
||||
<div class="title text-ellipsis"><?php echo $column->name;?></div>
|
||||
<?php if(commonModel::hasPriv('kanban', 'restoreColumn') && $column->archived == '1') echo html::a(inlink('restoreColumn', "columnID={$column->id}", '',true), $lang->kanban->restore, '', "class='btn btn-primary' target='hiddenwin'");?>
|
||||
</div>
|
||||
<?php if(!empty($column->child) && $column->archived == '0'):?>
|
||||
<?php $count = 1;?>
|
||||
<?php foreach($column->child as $childColumn):?>
|
||||
<div class="item child-item" data-id="<?php echo $childColumn->id;?>" data-archived='<?php echo $childColumn->archived;?>'>
|
||||
<?php $class = $count == count($column->child) ? 'hr' : '';?>
|
||||
<div class="item child-item <?php echo $class;?>" data-id="<?php echo $childColumn->id;?>" data-archived='<?php echo $childColumn->archived;?>'>
|
||||
<div class="title text-ellipsis"><label class="label label-child"><?php echo $lang->kanban->child;?></label><?php echo $childColumn->name;?></div>
|
||||
<?php if(commonModel::hasPriv('kanban', 'restoreColumn') && $childColumn->archived == '1') echo html::a(inlink('restoreColumn', "columnID={$childColumn->id}", '',true), $lang->kanban->restore, 'hiddenwin', "class='btn btn-primary");?>
|
||||
</div>
|
||||
<?php $count ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -31,10 +31,20 @@ class productplan extends control
|
||||
$this->product->setMenu($productID, $branch);
|
||||
$this->session->set('currentProductType', $product->type);
|
||||
|
||||
$this->view->product = $product;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID);
|
||||
$this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$productID}&branch=$branch"), $product->name);
|
||||
$branches = $this->loadModel('branch')->getList($productID, 0, 'all');
|
||||
$branchOption = array();
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchOption[$branchInfo->id] = $branchInfo->name;
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
|
||||
$this->view->product = $product;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branchOption = $branchOption;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$productID}&branch=$branch"), $product->name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<?php if($branchProduct):?>
|
||||
<td class='text-left'>
|
||||
<?php $disabled = $plan->parent == '-1' ? "disabled='disabled'" : '';?>
|
||||
<?php echo html::select("branch[$plan->id]", $plan->parent == '-1' ? '' : $branches, $plan->branch, "onchange='getConflictStories($plan->id, this.value); 'class='form-control chosen' $disabled");?>
|
||||
<?php echo html::select("branch[$plan->id]", $plan->parent == '-1' ? '' : $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id, this.value); 'class='form-control chosen' $disabled");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td title='<?php echo $plan->title?>'><?php echo html::input("title[$plan->id]", $plan->title, "class='form-control'")?></td>
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
?>
|
||||
</td>
|
||||
<?php if($this->session->currentProductType != 'normal'):?>
|
||||
<td class='c-branch' title='<?php echo $branches[$plan->branch];?>'><?php if($plan->parent != '-1') echo $branches[$plan->branch];?></td>
|
||||
<td class='c-branch' title='<?php echo $branches[$plan->branch];?>'><?php if($plan->parent != '-1') echo $branchOption[$plan->branch];?></td>
|
||||
<?php endif;?>
|
||||
<td><?php echo $plan->begin == '2030-01-01' ? $lang->productplan->future : $plan->begin;?></td>
|
||||
<td><?php echo $plan->end == '2030-01-01' ? $lang->productplan->future : $plan->end;?></td>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<?php if($product->type != 'normal' and $plan->parent != '-1'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->branch;?></th>
|
||||
<td><?php echo html::select('branch', $branches, $plan->branch, "onchange='getConflictStories($plan->id, this.value); 'class='form-control'");?></td><td></td><td></td>
|
||||
<td><?php echo html::select('branch', $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id, this.value); 'class='form-control'");?></td><td></td><td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class='page-title'>
|
||||
<span class='label label-id'><?php echo $plan->id;?></span>
|
||||
<span title='<?php echo $plan->title;?>' class='text'><?php echo $plan->title;?></span>
|
||||
<?php if($product->type !== 'normal') echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>" . $branches[$branch] . '</span>';?>
|
||||
<?php if($product->type !== 'normal') echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>" . $branchOption[$branch] . '</span>';?>
|
||||
<span class='label label-info label-badge'>
|
||||
<?php echo ($plan->begin == '2030-01-01' || $plan->end == '2030-01-01') ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?>
|
||||
</span>
|
||||
@@ -291,12 +291,12 @@
|
||||
|
||||
if($canBatchChangeBranch and $this->session->currentProductType != 'normal')
|
||||
{
|
||||
$withSearch = count($branches) > 8;
|
||||
$withSearch = count($branchTagOption) > 8;
|
||||
echo "<li class='dropdown-submenu'>";
|
||||
echo html::a('javascript:;', $lang->product->branchName[$this->session->currentProductType], '', "id='branchItem'");
|
||||
echo "<div class='dropdown-menu" . ($withSearch ? ' with-search':'') . "'>";
|
||||
echo '<ul class="dropdown-list">';
|
||||
foreach($branches as $branchID => $branchName)
|
||||
foreach($branchTagOption as $branchID => $branchName)
|
||||
{
|
||||
$actionLink = $this->createLink('story', 'batchChangeBranch', "branchID=$branchID");
|
||||
echo "<li class='option' data-key='$branchID'>" . html::a('#', $branchName, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin', this)\"") . "</li>";
|
||||
@@ -569,7 +569,7 @@
|
||||
<?php if($product->type != 'normal'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->branch;?></th>
|
||||
<td><?php echo $branches[$plan->branch];?></td>
|
||||
<td><?php echo $branchOption[$plan->branch];?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
|
||||
+46
-35
@@ -668,16 +668,19 @@ class story extends control
|
||||
|
||||
if($this->app->tab == 'project' or $this->app->tab == 'execution')
|
||||
{
|
||||
$objectID = $this->app->tab == 'project' ? $this->session->project : $this->session->execution;
|
||||
$productBranches = $product->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($story->product, $objectID, 'all') : array();
|
||||
$branches = isset($productBranches[$story->product]) ? array(BRANCH_MAIN => $this->lang->branch->main) + $productBranches[$story->product] : array();
|
||||
$products = $this->product->getProductPairsByProject($objectID);
|
||||
|
||||
$objectID = $this->app->tab == 'project' ? $this->session->project : $this->session->execution;
|
||||
$products = $this->product->getProductPairsByProject($objectID);
|
||||
$this->view->objectID = $objectID;
|
||||
}
|
||||
else
|
||||
|
||||
/* Display status of branch. */
|
||||
$branches = $this->loadModel('branch')->getList($product->id, isset($objectID) ? $objectID : 0, 'all');
|
||||
$branchOption = array();
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($product->id) : array();
|
||||
$branchOption[$branchInfo->id] = $branchInfo->name;
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
|
||||
/* Get product reviewers. */
|
||||
@@ -694,7 +697,8 @@ class story extends control
|
||||
$this->view->product = $product;
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairsForStory($story->product, $story->branch, 'skipParent');
|
||||
$this->view->products = $products;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->branchOption = $branchOption;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->reviewers = implode(',', $reviewerList);
|
||||
$this->view->reviewedReviewer = $reviewedReviewer;
|
||||
$this->view->productReviewers = $this->user->getPairs('noclosed|nodeleted', $reviewerList, 0, $productReviewers);
|
||||
@@ -772,39 +776,44 @@ class story extends control
|
||||
{
|
||||
if(!$executionID)
|
||||
{
|
||||
$branches = $this->branch->getPairs($productID);
|
||||
$product = $this->product->getByID($productID);
|
||||
$branchProduct = $product->type == 'normal' ? false : true;
|
||||
$modules = array($productID => $this->tree->getOptionMenu($productID, 'story', 0, array_keys($branches)));
|
||||
$plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', true));
|
||||
$products = array($productID => $product);
|
||||
$branches = array($productID => $branches);
|
||||
$branches = $this->branch->getList($productID, $executionID, 'all');
|
||||
$branchOption = array();
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo) $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
|
||||
$product = $this->product->getByID($productID);
|
||||
$branchProduct = $product->type == 'normal' ? false : true;
|
||||
$modules = array($productID => $this->tree->getOptionMenu($productID, 'story', 0, array_keys($branches)));
|
||||
$plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', true));
|
||||
$products = array($productID => $product);
|
||||
$branchTagOption = array($productID => $branchTagOption);
|
||||
}
|
||||
else
|
||||
{
|
||||
$modules = array();
|
||||
$branches = array();
|
||||
$execution = $this->execution->getByID($executionID);
|
||||
$branchProduct = false;
|
||||
$linkedProducts = $this->loadModel('product')->getProducts($executionID);
|
||||
$modules = array();
|
||||
$branches = array();
|
||||
$branchTagOption = array();
|
||||
$execution = $this->execution->getByID($executionID);
|
||||
$branchProduct = false;
|
||||
$linkedProducts = $this->loadModel('product')->getProducts($executionID);
|
||||
foreach($linkedProducts as $linkedProduct)
|
||||
{
|
||||
$branchList = $this->branch->getPairs($linkedProduct->id, '', $executionID);
|
||||
$branches[$linkedProduct->id] = array(BRANCH_MAIN => $this->lang->branch->main) + $branchList;
|
||||
$modules[$linkedProduct->id] = $this->tree->getOptionMenu($linkedProduct->id, 'story', 0, array_keys($branchList));
|
||||
$plans[$linkedProduct->id] = $this->productplan->getBranchPlanPairs($linkedProduct->id, array_keys($branchList), true);
|
||||
$branchList = $this->branch->getList($linkedProduct->id, $executionID, 'all');
|
||||
foreach($branchList as $branchInfo) $branches[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
|
||||
$branchTagOption[$linkedProduct->id] = array(BRANCH_MAIN => $this->lang->branch->main) + $branches;
|
||||
$modules[$linkedProduct->id] = $this->tree->getOptionMenu($linkedProduct->id, 'story', 0, array_keys($branchList));
|
||||
$plans[$linkedProduct->id] = $this->productplan->getBranchPlanPairs($linkedProduct->id, array_keys($branchList), true);
|
||||
if(empty($plans[$linkedProduct->id])) $plans[$linkedProduct->id][0] = $plans[$linkedProduct->id];
|
||||
|
||||
if($linkedProduct->type != 'normal') $branchProduct = true;
|
||||
}
|
||||
|
||||
$products = $linkedProducts;
|
||||
}
|
||||
|
||||
$this->view->title = (isset($product) ? $product->name : $execution->name) . $this->lang->colon . $this->lang->story->batchEdit;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->productName = isset($product) ? $product->name : '';
|
||||
$this->view->title = (isset($product) ? $product->name : $execution->name) . $this->lang->colon . $this->lang->story->batchEdit;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->productName = isset($product) ? $product->name : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -815,9 +824,11 @@ class story extends control
|
||||
$products = $this->product->getByIdList($productIdList);
|
||||
foreach($products as $storyProduct)
|
||||
{
|
||||
$branchList = $this->branch->getPairs($storyProduct->id);
|
||||
$branchList = array();
|
||||
$branches = $this->branch->getList($storyProduct->id, 0, 'all');
|
||||
foreach($branches as $branchInfo) $branchList[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
$branchIdList = array_keys($branchList) ? array_keys($branchList) : 0;
|
||||
$branches[$storyProduct->id] = $branchList;
|
||||
$branchTagOption[$storyProduct->id] = $branchList;
|
||||
|
||||
$modules[$storyProduct->id] = $this->tree->getOptionMenu($storyProduct->id, 'story', 0, $branchIdList);
|
||||
if($storyProduct->type == 'normal') $modules[$storyProduct->id][0] = $modules[$storyProduct->id];
|
||||
@@ -828,9 +839,9 @@ class story extends control
|
||||
if($storyProduct->type != 'normal') $branchProduct = true;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->story->batchEdit;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->title = $this->lang->story->batchEdit;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->modules = $modules;
|
||||
}
|
||||
|
||||
/* Set ditto option for users. */
|
||||
|
||||
@@ -72,8 +72,8 @@ foreach(explode(',', $showFields) as $field)
|
||||
<?php if($branchProduct):?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'branch', ' hidden')?>'>
|
||||
<?php $disabled = $products[$story->product]->type == 'normal' ? "disabled='disabled'" : '';?>
|
||||
<?php if($products[$story->product]->type == 'normal') $branches[$story->product] = array();?>
|
||||
<?php echo html::select("branches[$storyID]", $branches[$story->product], $story->branch, "class='form-control chosen' onchange='loadBranches($story->product, this.value, $storyID);' $disabled");?>
|
||||
<?php if($products[$story->product]->type == 'normal') $branchTagOption[$story->product] = array();?>
|
||||
<?php echo html::select("branches[$storyID]", $branchTagOption[$story->product], $story->branch, "class='form-control chosen' onchange='loadBranches($story->product, this.value, $storyID);' $disabled");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module')?>'>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('product', $products, $story->product, "onchange='loadProduct(this.value);' class='form-control chosen control-product'");?>
|
||||
<span class='input-group-addon fix-border fix-padding'></span>
|
||||
<?php if($product->type != 'normal') echo html::select('branch', $branches, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?>
|
||||
<?php if($product->type != 'normal') echo html::select('branch', $branchTagOption, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -91,7 +91,7 @@
|
||||
<tr>
|
||||
<th class='thWidth'><?php echo $lang->product->branch = sprintf($lang->product->branch, $lang->product->branchName['branch']);?></th>
|
||||
<td>
|
||||
<div class='input-group'><?php if($product->type != 'normal') echo html::select('branch', $branches, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?></div>
|
||||
<div class='input-group'><?php if($product->type != 'normal') echo html::select('branch', $branchTagOption, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?></div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
@@ -157,11 +157,11 @@
|
||||
<th><?php echo $lang->story->stage;?></th>
|
||||
<td>
|
||||
<?php
|
||||
if($story->stages and $branches)
|
||||
if($story->stages and $branchTagOption)
|
||||
{
|
||||
foreach($story->stages as $branch => $stage)
|
||||
{
|
||||
if(isset($branches[$branch])) echo '<p>' . $branches[$branch] . html::select("stages[$branch]", $lang->story->stageList, $stage, "class='form-control chosen'") . '</p>';
|
||||
if(isset($branchTagOption[$branch])) echo '<p>' . $branchTagOption[$branch] . html::select("stages[$branch]", $lang->story->stageList, $stage, "class='form-control chosen'") . '</p>';
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
+60
-44
@@ -189,36 +189,47 @@ class testcase extends control
|
||||
/* Display of branch label. */
|
||||
$showBranch = $this->loadModel('branch')->showBranch($productID);
|
||||
|
||||
/* Display status of branch. */
|
||||
$branches = $this->loadModel('branch')->getList($productID, $projectID, 'all');
|
||||
$branchOption = array();
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchOption[$branchInfo->id] = $branchInfo->name;
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
|
||||
$product = $this->product->getById($productID);
|
||||
|
||||
/* Assign. */
|
||||
$tree = $moduleID ? $this->tree->getByID($moduleID) : '';
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $product;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
|
||||
$this->view->moduleTree = $moduleTree;
|
||||
$this->view->moduleName = $moduleID ? $tree->name : $this->lang->tree->all;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->projectType = !empty($projectID) ? $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('model') : '';
|
||||
$this->view->summary = $this->testcase->summary($cases);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->cases = $cases;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
|
||||
$this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID);
|
||||
$this->view->suiteID = $suiteID;
|
||||
$this->view->setModule = true;
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array();
|
||||
$this->view->showBranch = $showBranch;
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $product;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
|
||||
$this->view->moduleTree = $moduleTree;
|
||||
$this->view->moduleName = $moduleID ? $tree->name : $this->lang->tree->all;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->projectType = !empty($projectID) ? $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('model') : '';
|
||||
$this->view->summary = $this->testcase->summary($cases);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->cases = $cases;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branchOption = $branchOption;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID);
|
||||
$this->view->suiteID = $suiteID;
|
||||
$this->view->setModule = true;
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array();
|
||||
$this->view->showBranch = $showBranch;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -864,18 +875,19 @@ class testcase extends control
|
||||
$product = $this->product->getById($productID);
|
||||
if($this->app->tab == 'execution' or $this->app->tab == 'project')
|
||||
{
|
||||
$objectID = $this->app->tab == 'project' ? $case->project : $executionID;
|
||||
$productBranches = (isset($product->type) and $product->type != 'normal') ? $this->execution->getBranchByProduct($productID, $objectID, 'all') : array();
|
||||
$branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$branches = (isset($product->type) and $product->type != 'normal') ? $this->loadModel('branch')->getPairs($productID) : array();
|
||||
$objectID = $this->app->tab == 'project' ? $case->project : $executionID;
|
||||
}
|
||||
|
||||
/* Display status of branch. */
|
||||
$branches = $this->loadModel('branch')->getList($productID, isset($objectID) ? $objectID : 0, 'all');
|
||||
$branchTagOption = array();
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $product;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch);
|
||||
@@ -959,28 +971,32 @@ class testcase extends control
|
||||
if($product->type != 'normal') $branchProduct = true;
|
||||
|
||||
/* Set branches and modules. */
|
||||
$branches = array();
|
||||
$branches = array();
|
||||
$branchTagOption = array();
|
||||
$modules = array();
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
$branches = $this->loadModel('branch')->getPairs($productID);
|
||||
|
||||
$branches = $this->loadModel('branch')->getList($productID, 0, 'all');
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
if($this->app->tab == 'project')
|
||||
{
|
||||
$branches = $this->loadModel('branch')->getPairsByProjectProduct($this->session->project, $productID);
|
||||
$branchTagOption = $this->loadModel('branch')->getPairsByProjectProduct($this->session->project, $productID);
|
||||
}
|
||||
foreach($branches as $branchID => $branchName) $modules[$productID][$branchID] = $this->tree->getOptionMenu($productID, 'case', 0, $branchID);
|
||||
foreach($branchTagOption as $branchID => $branchName) $modules[$productID][$branchID] = $this->tree->getOptionMenu($productID, 'case', 0, $branchID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$modules[$productID][BRANCH_MAIN] = $this->tree->getOptionMenu($productID, 'case');
|
||||
}
|
||||
|
||||
$this->view->branches = $branches;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
|
||||
$this->view->product = $product;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
|
||||
$this->view->product = $product;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -71,13 +71,17 @@
|
||||
$caseBranch = isset($cases[$caseID]->branch) ? $cases[$caseID]->branch : 0;
|
||||
if(!$productID and !$cases[$caseID]->lib)
|
||||
{
|
||||
$caseProductID = $cases[$caseID]->product;
|
||||
$product = $products[$caseProductID];
|
||||
$branches = isset($branches) ? $branches : array('' => '');
|
||||
$caseProductID = $cases[$caseID]->product;
|
||||
$product = $products[$caseProductID];
|
||||
$branchTagOption = array();
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
$branches = isset($productBranches[$product->id]) ? $productBranches[$product->id] : $branches;
|
||||
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
|
||||
$branches = $this->loadModel('branch')->getList($product->id, 0, 'all');
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
foreach($branchTagOption as $branchID => $branchName) $branchTagOption[$branchID] = '/' . $product->name . '/' . $branchName;
|
||||
}
|
||||
|
||||
$modules[$caseProductID][$caseBranch] = $this->tree->getOptionMenu($cases[$caseID]->product, 'case', 0, $caseBranch);
|
||||
@@ -103,7 +107,7 @@
|
||||
<td class='text-left' style='overflow:visible'>
|
||||
<?php $branchProductID = $productID ? $productID : $product->id;?>
|
||||
<?php $disabled = (isset($product) and $product->type == 'normal') ? "disabled='disabled'" : '';?>
|
||||
<?php echo html::select("branches[$caseID]", $branches, $product->type == 'normal' ? '' : $cases[$caseID]->branch, "class='form-control chosen' onchange='loadBranches($branchProductID, this.value, $caseID)', $disabled");?>
|
||||
<?php echo html::select("branches[$caseID]", $branchTagOption, $product->type == 'normal' ? '' : $cases[$caseID]->branch, "class='form-control chosen' onchange='loadBranches($branchProductID, this.value, $caseID)', $disabled");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<?php $caseProductID = isset($caseProductID) ? $caseProductID : $productID;?>
|
||||
|
||||
@@ -111,7 +111,7 @@ js::set('suiteID', $suiteID);
|
||||
<tbody>
|
||||
<?php foreach($cases as $case):?>
|
||||
<tr data-id='<?php echo $case->id?>'>
|
||||
<?php foreach($setting as $key => $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType, $useDatatable ? 'datatable' : 'table');?>
|
||||
<?php foreach($setting as $key => $value) $this->testcase->printCell($value, $case, $users, $branchOption, $modulePairs, $browseType, $useDatatable ? 'datatable' : 'table');?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
@@ -182,7 +182,7 @@ js::set('suiteID', $suiteID);
|
||||
<?php if(common::hasPriv('testcase', 'batchChangeBranch') and $this->session->currentProductType != 'normal'):?>
|
||||
<div class="btn-group dropup">
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->product->branchName[$this->session->currentProductType];?> <span class="caret"></span></button>
|
||||
<?php $withSearch = count($branches) > 6;?>
|
||||
<?php $withSearch = count($branchTagOption) > 6;?>
|
||||
<?php if($withSearch):?>
|
||||
<div class="dropdown-menu search-list search-box-sink" data-ride="searchList">
|
||||
<div class="input-control search-box has-icon-left has-icon-right search-example">
|
||||
@@ -190,13 +190,13 @@ js::set('suiteID', $suiteID);
|
||||
<label for="userSearchBox" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
|
||||
<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>
|
||||
</div>
|
||||
<?php $branchsPinYin = common::convert2Pinyin($branches);?>
|
||||
<?php $branchsPinYin = common::convert2Pinyin($branchTagOption);?>
|
||||
<?php else:?>
|
||||
<div class="dropdown-menu search-list">
|
||||
<?php endif;?>
|
||||
<div class="list-group">
|
||||
<?php
|
||||
foreach($branches as $branchID => $branchName)
|
||||
foreach($branchTagOption as $branchID => $branchName)
|
||||
{
|
||||
$searchKey = $withSearch ? ('data-key="' . zget($branchsPinYin, $branchName, '') . '"') : '';
|
||||
$actionLink = $this->createLink('testcase', 'batchChangeBranch', "branchID=$branchID");
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value)' class='form-control chosen'");?>
|
||||
<?php if(isset($product->type) and $product->type != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control'");?>
|
||||
<?php if(isset($product->type) and $product->type != 'normal') echo html::select('branch', $branchTagOption, $case->branch, "onchange='loadBranch();' class='form-control'");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user