Merge branch 'sprint/master_lanzongjun_fixbug'

This commit is contained in:
王怡栋
2022-11-15 16:27:34 +08:00
27 changed files with 129 additions and 103 deletions
+2 -1
View File
@@ -9,6 +9,7 @@
* @version $Id: view.html.php 4728 2013-05-03 06:14:34Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
@@ -161,7 +162,7 @@
<th><?php echo $lang->bug->fromCase;?></th>
<td><?php if($bug->case) echo html::a(helper::createLink('testcase', 'view', "caseID=$bug->case&version=$bug->caseVersion", '', true), "<i class='icon icon-sitemap'></i> {$lang->bug->fromCase}$lang->colon$bug->case", '', isonlybody() ? '' : "data-toggle='modal' data-type='iframe' data-width='80%'");?></td>
</tr>
<tr valign='middle' class='<?php if($product->shadow and zget($project, 'model') != 'scrum') echo 'hide'?>'>
<tr valign='middle' class='<?php if(!($product->shadow and zget($project, 'model') == 'scrum' and $project->multiple)) echo 'hide'?>'>
<th><?php echo $lang->bug->productplan;?></th>
<td><?php if(!$bug->plan or !common::printLink('productplan', 'view', "planID=$bug->plan&type=bug", $bug->planName)) echo $bug->planName;?></td>
</tr>
+1 -1
View File
@@ -343,7 +343,7 @@ $lang->execution->menu->view = array('link' => "$lang->view|execution|grouptas
if($config->edition != 'open') $lang->execution->menu->view = array('link' => "$lang->view|execution|gantt|executionID=%s", 'alias' => 'grouptask,tree,taskeffort,gantt,calendar,relation,maintainrelation');
$lang->execution->menu->storyGroup = array('link' => "{$lang->common->story}|execution|story|executionID=%s",'class' => 'dropdown dropdown-hover', 'subModule' => 'story', 'alias' => 'batchcreate,storykanban');
$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'storykanban');
$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'storykanban,linkstory');
$lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|bug|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport');
$lang->execution->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo');
$lang->execution->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=execution&objectID=%s", 'subModule' => 'doc');
+3 -3
View File
@@ -180,7 +180,7 @@ class execution extends control
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('taskList', $uri . "#app={$this->app->tab}", 'execution');
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->executionTaskOrder ? $this->cookie->executionTaskOrder : 'status,id_desc';
@@ -685,12 +685,12 @@ class execution extends control
unset($this->config->bug->search['fields']['resolvedDate']);
unset($this->config->bug->search['fields']['closedDate']);
unset($this->config->bug->search['fields']['branch']);
if(empty($execution->multiple) && empty($execution->hasProduct)) unset($this->config->bug->search['fields']['plan']);
if(empty($project->hasProduct))
{
unset($this->config->bug->search['fields']['product']);
if($project->model !== 'scrum') unset($this->config->bug->search['fields']['plan']);
}
unset($this->config->bug->search['params']['resolvedBy']);
unset($this->config->bug->search['params']['closedBy']);
unset($this->config->bug->search['params']['status']);
@@ -1844,7 +1844,7 @@ class execution extends control
$this->view->code = $code;
$this->view->team = $team;
$this->view->teams = array(0 => '') + $this->execution->getCanCopyObjects((int)$projectID);
$this->view->allProjects = array(0 => '') + $this->project->getPairsByModel('all', 0, 'noclosed');
$this->view->allProjects = array(0 => '') + $this->project->getPairsByModel('all', 0, 'noclosed,multiple');
$this->view->copyProjects = $copyProjects;
$this->view->copyExecutions = array('' => '') + $this->execution->getList($copyProjectID);
$this->view->executionID = $executionID;
+1
View File
@@ -345,6 +345,7 @@ $lang->execution->wbs = "Aufgaben aufteilen";
$lang->execution->batchWBS = "Mehrere aufteilen";
$lang->execution->howToUpdateBurn = "<a href='http://api.zentao.net/goto.php?item=burndown&lang=zh-cn' target='_blank' title='Wie wird der Burndown Chart aktualisiert?' class='btn btn-link'>Hilfe <i class='icon icon-help'></i></a>";
$lang->execution->whyNoStories = "Keine Story kann verknüpft werden. Bitte prüfen Sie ob ein Story mit {$lang->executionCommon} verknüpft ist {$lang->productCommon} und stellen Sie sicher das diese geprüft ist.";
$lang->execution->projectNoStories = "No story can be linked. Please check whether there is any story in project and make sure it has been reviewed.";
$lang->execution->productStories = "{$lang->executionCommon} verknüpfte Story ist ein Subset von {$lang->productCommon}, welche nur nach überprüfung verknüpft werden kann. Bitte <a href='%s'> Story verknüpfen</a>。";
$lang->execution->haveDraft = "There are %s draft stories can't be linked.";
$lang->execution->doneExecutions = 'Erledigt';
+1
View File
@@ -345,6 +345,7 @@ $lang->execution->wbs = "Create Task";
$lang->execution->batchWBS = "Batch Create Tasks";
$lang->execution->howToUpdateBurn = "<a href='https://api.zentao.pm/goto.php?item=burndown' target='_blank' title='How to update the Burndown Chart?' class='btn btn-link'>Help <i class='icon icon-help'></i></a>";
$lang->execution->whyNoStories = "No story can be linked. Please check whether there is any story in {$lang->executionCommon} which is linked to {$lang->productCommon} and make sure it has been reviewed.";
$lang->execution->projectNoStories = "No story can be linked. Please check whether there is any story in project and make sure it has been reviewed.";
$lang->execution->productStories = "Stories linked to {$lang->executionCommon} are the subeset of stories linked to {$lang->productCommon}. Stories can only be linked after they pass the review. <a href='%s'> Link Stories</a> now.";
$lang->execution->haveDraft = "%s stories in draft, so they can't be linked.";
$lang->execution->doneExecutions = 'Finished';
+1
View File
@@ -345,6 +345,7 @@ $lang->execution->wbs = "Créer Tâche";
$lang->execution->batchWBS = "Créer Tâche en lot";
$lang->execution->howToUpdateBurn = "<a href='https://api.zentao.pm/goto.php?item=burndown' target='_blank' title='Comment mettre à jour le Graphe d´atterrissage ?' class='btn btn-link'>Mise à jour <i class='icon icon-help'></i></a>";
$lang->execution->whyNoStories = "Aucune story ne peut être associée. Vérifiez s'il existe des stories dans {$lang->executionCommon} qui sont associées à {$lang->productCommon} et vérifiez qu'elles ont bien été validées.";
$lang->execution->projectNoStories = "No story can be linked. Please check whether there is any story in project and make sure it has been reviewed.";
$lang->execution->productStories = "Les stories associées au {$lang->executionCommon} sont une portion des stories associées au {$lang->productCommon}. Les stories ne peuvent être associées à un {$lang->executionCommon} qu'après avoir été validées. <a href='%s'> Associer Stories</a> maintenant.";
$lang->execution->haveDraft = "%s stories sont encore en conception, elles ne peuvent pas être associées au {$lang->executionCommon} actuellement.";
$lang->execution->doneExecutions = 'Terminé';
+1
View File
@@ -281,6 +281,7 @@ $lang->execution->wbs = "Tạo nhiệm vụ";
$lang->execution->batchWBS = "Tạo nhiệm vụ hàng loạt";
$lang->execution->howToUpdateBurn = "<a href='https://api.zentao.pm/goto.php?item=burndown' target='_blank' title='Làm thế nào để cập nhật biểu đồ Burndown?' class='btn btn-link'>Giúp<i class='icon icon-help'></i></a>";
$lang->execution->whyNoStories = "Không có câu chuyện có thể liên kết. Vui lòng kiểm tra có câu chuyện trong {$lang->executionCommon} cái liên kết tới {$lang->productCommon} và chắc chắn nó đã được duyệt.";
$lang->execution->projectNoStories = "No story can be linked. Please check whether there is any story in project and make sure it has been reviewed.";
$lang->execution->productStories = "Câu chuyện liên kết tới {$lang->executionCommon} là tập hợp con của câu chuyện liên kết tới {$lang->productCommon}. Các câu chuyện chỉ có thể liên kết sau khi chúng đã được duyệt. <a href='%s'> Liên kết câu chuyện</a> now.";
$lang->execution->haveDraft = "%s câu chuyện đang nháp, bởi vậy chúng không thể liên kết.";
$lang->execution->doneExecutions = 'Kết thúc';
+1
View File
@@ -345,6 +345,7 @@ $lang->execution->wbs = "分解任务";
$lang->execution->batchWBS = "批量分解";
$lang->execution->howToUpdateBurn = "<a href='https://api.zentao.net/goto.php?item=burndown&lang=zh-cn' target='_blank' title='如何更新燃尽图?' class='btn btn-link'>帮助 <i class='icon icon-help'></i></a>";
$lang->execution->whyNoStories = "看起来没有{$lang->SRCommon}可以关联。请检查下{$lang->executionCommon}关联的{$lang->productCommon}中有没有{$lang->SRCommon},而且要确保它们已经审核通过。";
$lang->execution->projectNoStories = "看起来没有{$lang->SRCommon}可以关联。请检查下项目中有没有{$lang->SRCommon},而且要确保它们已经审核通过。";
$lang->execution->productStories = "{$lang->executionCommon}关联的{$lang->SRCommon}是{$lang->productCommon}{$lang->SRCommon}的子集,并且只有评审通过的{$lang->SRCommon}才能关联。请<a href='%s'>关联{$lang->SRCommon}</a>。";
$lang->execution->haveDraft = "有%s条草稿状态的{$lang->SRCommon}无法关联到该执行";
$lang->execution->doneExecutions = '已结束';
-2
View File
@@ -51,7 +51,6 @@
<th class="c-id-sm"><?php echo $lang->build->id;?></th>
<th class="c-name w-200px text-left <?php echo $hidden;?>"><?php echo $lang->build->product;?></th>
<th class="c-name text-left"><?php echo $lang->build->name;?></th>
<th class="c-name w-200px text-left"><?php echo $lang->build->product;?></th>
<th class="c-url"><?php echo $lang->build->scmPath;?></th>
<th class="c-url"><?php echo $lang->build->filePath;?></th>
<th class="c-date"><?php echo $lang->build->date;?></th>
@@ -69,7 +68,6 @@
<?php if($build->branchName) echo "<span class='label label-outline label-badge'>{$build->branchName}</span>"?>
<?php echo html::a($this->createLink('build', 'view', "build=$build->id"), $build->name);?>
</td>
<td class="c-name text-left" title='<?php echo $build->productName;?>'><?php echo $build->productName;?></td>
<td class="c-url" title="<?php echo $build->scmPath?>"><?php echo strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?></td>
<td class="c-url" title="<?php echo $build->filePath?>"><?php echo strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?></td>
<td class="c-date"><?php echo $build->date?></td>
+1 -1
View File
@@ -74,7 +74,7 @@ $canBatchCreateBug = ($productID and common::hasPriv('bug', 'batchCreate') and
$canImportBug = ($productID and common::hasPriv('execution', 'importBug'));
$canCreateStory = ($productID and common::hasPriv('story', 'create'));
$canBatchCreateStory = ($productID and common::hasPriv('story', 'batchCreate'));
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory'));
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory') and !empty($execution->hasProduct));
$canLinkStoryByPlan = ($productID and common::hasPriv('execution', 'importplanstories') and !empty($project->hasProduct));
$hasStoryButton = ($canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan);
$hasTaskButton = ($canCreateTask or $canBatchCreateTask or $canImportBug);
+2 -1
View File
@@ -105,7 +105,8 @@
</div>
<?php else:?>
<div class="table-empty-tip">
<p><span class="text-muted"><?php echo $lang->{$app->rawModule}->whyNoStories;?></p>
<?php $emptyTips = ($app->rawModule == 'execution' and !$project->hasProduct) ? 'projectNoStories' : 'whyNoStories';?>
<p><span class="text-muted"><?php echo $lang->{$app->rawModule}->{$emptyTips};?></p>
</div>
<?php endif;?>
</form>
+4 -1
View File
@@ -81,7 +81,7 @@
if($productID) common::printIcon('story', 'report', "productID=$productID&branchID=&storyType=$storyType&browseType=$type&moduleID=$param&chartType=pie&projectID=$execution->id", '', 'button', 'bar-chart muted');
common::printLink('story', 'export', "productID=$productID&orderBy=id_desc&executionID=$execution->id&browseType=$type&storyType=$storyType", "<i class='icon icon-export muted'></i> " . $lang->story->export, '', "class='btn btn-link export iframe'");
$canLinkStory = $execution->hasProduct or $execution->multiple;
$canLinkStory = $execution->multiple;
if(common::canModify('execution', $execution))
{
$this->lang->story->create = $this->lang->execution->createStory;
@@ -254,6 +254,7 @@
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue;
if(!$execution->hasProduct and !$execution->multiple and $storyType == 'requirement' and $value->id == 'taskCount') continue;
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAction);
@@ -273,6 +274,7 @@
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue;
if(!$execution->hasProduct and !$execution->multiple and $storyType == 'requirement' and $value->id == 'taskCount') continue;
$this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $execution, $showBranch);
}
?>
@@ -288,6 +290,7 @@
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue;
if(!$execution->hasProduct and !$execution->multiple and $storyType == 'requirement' and $value->id == 'taskCount') continue;
$this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $execution);
}?>
</tr>
+2 -2
View File
@@ -90,8 +90,8 @@
$canImportBug = ($productID and common::hasPriv('execution', 'importBug'));
$canCreateStory = ($productID and common::hasPriv('story', 'create'));
$canBatchCreateStory = ($productID and common::hasPriv('story', 'batchCreate'));
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory'));
$canLinkStoryByPlan = ($productID and common::hasPriv('execution', 'importplanstories') and !$hiddenPlan);
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory') and !empty($execution->hasProduct));
$canLinkStoryByPlan = ($productID and common::hasPriv('execution', 'importplanstories') and !$hiddenPlan and !empty($execution->hasProduct));
$hasStoryButton = ($canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan);
$hasTaskButton = ($canCreateTask or $canBatchCreateTask or $canImportBug);
$hasBugButton = ($canCreateBug or $canBatchCreateBug);
+1 -1
View File
@@ -1378,7 +1378,7 @@ class kanban extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->projects = array($this->lang->kanban->allProjects) + $this->project->getPairsByProgram();
$this->view->projects = array($this->lang->kanban->allProjects) + $this->project->getPairsByProgram('', 'all', false, '', '', '', 'multiple');
$this->view->selectedProjectID = $selectedProjectID;
$this->view->lanePairs = $this->kanban->getLanePairsByGroup($groupID);
$this->view->executions2Imported = $this->execution->getStatData($selectedProjectID, 'undone', 0, 0, false, '', 'id_asc', $pager);
+5 -3
View File
@@ -104,15 +104,16 @@
<td class='c-name <?php if(!empty($task->children)) echo 'has-child';?>' title='<?php echo $task->name?>'>
<?php if(!empty($task->team)) echo '<span class="label label-badge label-light">' . $this->lang->task->multipleAB . '</span> ';?>
<?php
$dataApp = empty($task->executionMultiple) ? 'project' : 'execution';
if($task->parent > 0)
{
echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ' . html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->parentName . ' / '. $task->name, '', "title='{$task->parentName} / {$task->name}'");
echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ' . html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->parentName . ' / '. $task->name, '', "title='{$task->parentName} / {$task->name}' data-app='$dataApp'");
}
else
{
$onlybody = $task->executionType == 'kanban' ? true : '';
$class = $task->executionType == 'kanban' ? 'iframe' : '';
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', $onlybody, $task->project), $task->name, null, "class='$class' data-width='80%' style='color: $task->color'");
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', $onlybody, $task->project), $task->name, null, "class='$class' data-width='80%' style='color: $task->color' data-app='$dataApp'");
}
?>
<?php if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-angle-right"></i></a>';?>
@@ -189,8 +190,9 @@
<?php printf('%03d', $child->id);?>
</td>
<td class='c-name' title='<?php echo $child->name?>'>
<?php $dataApp = empty($child->executionMultiple) ? 'project' : 'execution';?>
<?php if($child->parent > 0) echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';?>
<?php echo html::a($this->createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color'");?>
<?php echo html::a($this->createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color' data-app='$dataApp'");?>
</td>
<td class="c-pri"><span class='label-pri <?php echo 'label-pri-' . $child->pri;?>' title='<?php echo zget($lang->task->priList, $child->pri);?>'><?php echo zget($lang->task->priList, $child->pri);?></span></td>
<td class='c-status'>
+12 -43
View File
@@ -67,10 +67,11 @@ class programModel extends model
* @param string $status all|noclosed
* @param string|array $append
* @param string|int $shadow all | 0 | 1
* @param bool $withProgram
* @access public
* @return array
*/
public function getProductPairs($programID = 0, $mode = 'assign', $status = 'all', $append = '', $shadow = 0)
public function getProductPairs($programID = 0, $mode = 'assign', $status = 'all', $append = '', $shadow = 0, $withProgram = false)
{
/* Get the top programID. */
if($programID)
@@ -84,72 +85,40 @@ class programModel extends model
if(!empty($append) and is_array($append)) $append = implode(',', $append);
$views = empty($append) ? $this->app->user->view->products : $this->app->user->view->products . ",$append";
return $this->dao->select('*')->from(TABLE_PRODUCT)
$dao = $this->dao->select('id, name, program')->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->beginIF($shadow !== 'all')->andWhere('shadow')->eq((int)$shadow)->fi()
->beginIF($mode == 'assign')->andWhere('program')->eq($programID)->fi()
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($views)->fi()
->fetchPairs('id', 'name');
}
->beginIF(!$this->app->user->admin)->andWhere('id')->in($views)->fi();
/**
* Get product pairs which name with program.
*
* @param int $programID
* @param string $mode
* @param string $status
* @param string $append
* @param int $shadow
* @access public
* @return array
*/
public function getProductPairsWithProgram($programID = 0, $mode = 'assign', $status = 'all', $append = '', $shadow = 0)
{
/* Get the top programID. */
if($programID)
{
$program = $this->getByID($programID);
$path = array_filter(explode(',', $program->path));
$programID = current($path);
}
if(!$withProgram) return $dao->fetchPairs('id', 'name');
/* When mode equals assign and programID equals 0, you can query the standalone product. */
if(!empty($append) and is_array($append)) $append = implode(',', $append);
$views = empty($append) ? $this->app->user->view->products : $this->app->user->view->products . ",$append";
$products = $this->dao->select("t1.id, t1.program, CONCAT(IF(t2.name IS NOT NULL, t2.name, ''), '/', t1.name) AS name")->from(TABLE_PRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.program = t2.id')
->where('t1.deleted')->eq('0')
->andWhere('t1.vision')->eq($this->config->vision)
->beginIF($shadow !== 'all')->andWhere('t1.shadow')->eq((int)$shadow)->fi()
->beginIF($mode == 'assign')->andWhere('t1.program')->eq($programID)->fi()
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('t1.status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($views)->fi()
->orderBy('t1.program, t1.order_asc')
->fetchGroup('program');
$products = $dao->orderBy('program,order')->fetchGroup('program');
$productPrograms = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('type')->eq('program')->andWhere('deleted')->eq('0')->fetchPairs();
/* Put products of current program first.*/
if($mode != 'assign' && $programID)
{
$currentProgramProducts = $products[$programID];
unset($products[$programID]);
array_unshift($products, $currentProgramProducts);
}
$productPairs = array();
foreach($products as $programProducts)
{
foreach($programProducts as $product) $productPairs[$product->id] = $product->name;
foreach($programProducts as $product)
{
$programName = zget($productPrograms, $product->program, '') . '/';
$productPairs[$product->id] = $programName . $product->name;
}
}
return $productPairs;
}
/**
* Get program by id.
*
+40 -30
View File
@@ -283,7 +283,8 @@ class project extends control
if($objectType == 'program')
{
$allProducts = array(0 => '') + $this->program->getProductPairsWithProgram($selectedProgramID, 'all', 'noclosed');
$withProgram = $this->config->systemMode == 'ALM' ? true : false;
$allProducts = array(0 => '') + $this->program->getProductPairs($selectedProgramID, 'all', 'noclosed', '', 0, $withProgram);
$data['allProducts'] = html::select("products[]", $allProducts, '', "class='form-control chosen' onchange='loadBranches(this)'");
$data['plans'] = html::select('plans[][][]', '', '', 'class=\'form-control chosen\' multiple');
}
@@ -603,13 +604,16 @@ class project extends control
$this->config->executionCommonList[$this->app->getClientLang()][0] :
$this->config->executionCommonList[$this->app->getClientLang()][1];
$withProgram = $this->config->systemMode == 'ALM' ? true : false;
$allProducts = array('0' => '') + $this->program->getProductPairs($programID, 'all', 'noclosed', '', $shadow, $withProgram);
$this->view->title = $this->lang->project->create;
$this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('project', 'browse') : '';
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst');
$this->view->users = $this->user->getPairs('noclosed|nodeleted');
$this->view->copyProjects = $this->project->getPairsByModel($model);
$this->view->products = $products;
$this->view->allProducts = array('0' => '') + $this->program->getProductPairsWithProgram(0, 'all', 'noclosed', '', $shadow);
$this->view->allProducts = $allProducts;
$this->view->productPlans = array('0' => '') + $productPlans;
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
$this->view->programID = $programID;
@@ -713,12 +717,14 @@ class project extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink));
}
$withProgram = $this->config->systemMode == 'ALM' ? true : false;
$linkedBranches = array();
$linkedBranchList = array();
$productPlans = array(0 => '');
$branches = $this->project->getBranchesByProject($projectID);
$linkedProductIdList = empty($branches) ? '' : array_keys($branches);
$allProducts = $this->program->getProductPairsWithProgram($project->parent, 'all', 'noclosed');
$allProducts = $this->program->getProductPairs($project->parent, 'all', 'noclosed', '', 0, $withProgram);
$linkedProducts = $this->loadModel('product')->getProducts($projectID, 'all', '', true, $linkedProductIdList);
$parentProject = $this->program->getByID($project->parent);
$plans = $this->productplan->getGroupByProduct(array_keys($linkedProducts), 'skipParent|unexpired');
@@ -2228,43 +2234,48 @@ class project extends control
}
}
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), 'ignoreNormal|noclosed');
$productsGroupByProgram = $this->product->getProductsGroupByProgram();
$currentProducts = array();
$otherProducts = array();
foreach($productsGroupByProgram as $programID => $programProducts)
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), 'ignoreNormal|noclosed');
if($this->config->systemMode == 'ALM')
{
if($programID != $project->parent)
{
foreach($programProducts as $productID => $productName)
{
if(!empty($branchGroups[$productID]))
{
foreach($branchGroups[$productID] as $branchID => $branchName)
{
if(isset($linkedProducts[$productID]) and isset($linkedBranches[$productID][$branchID])) continue;
$productsGroupByProgram = $this->product->getProductsGroupByProgram();
$otherProducts["{$productID}_{$branchID}"] = $productName . '_' . $branchName;
$currentProducts = array();
$otherProducts = array();
foreach($productsGroupByProgram as $programID => $programProducts)
{
if($programID != $project->parent)
{
foreach($programProducts as $productID => $productName)
{
if(!empty($branchGroups[$productID]))
{
foreach($branchGroups[$productID] as $branchID => $branchName)
{
if(isset($linkedProducts[$productID]) and isset($linkedBranches[$productID][$branchID])) continue;
$otherProducts["{$productID}_{$branchID}"] = $productName . '_' . $branchName;
}
}
else
{
if(isset($linkedProducts[$productID])) continue;
$otherProducts[$productID] = $productName;
}
}
else
{
if(isset($linkedProducts[$productID])) continue;
$otherProducts[$productID] = $productName;
}
}
else
{
$currentProducts += $programProducts;
}
}
else
{
$currentProducts += $programProducts;
}
$this->view->currentProducts = $currentProducts;
$this->view->otherProducts = $otherProducts;
}
/* Assign. */
$this->view->title = $this->lang->project->manageProducts . $this->lang->colon . $project->name;
$this->view->project = $project;
$this->view->currentProducts = $currentProducts;
$this->view->linkedProducts = $linkedProducts;
$this->view->linkedBranches = $linkedBranches;
$this->view->branches = $branches;
@@ -2275,7 +2286,6 @@ class project extends control
$this->view->branchGroups = $branchGroups;
$this->view->allBranches = $this->branch->getByProducts(array_keys($allProducts), 'ignoreNormal');
$this->view->allProducts = $allProducts;
$this->view->otherProducts = $otherProducts;
$this->display();
}
+37 -4
View File
@@ -23,9 +23,11 @@
<span class='btn btn-link btn-active-text'><span class='text'><?php echo $lang->project->manageProducts;?></span></span>
</div>
<?php if($this->config->systemMode == 'ALM'):?>
<div class='btn-toolbar pull-right'>
<button type='button' class='btn btn-primary' data-toggle='modal' data-target='#otherProductsModal'><i class='icon icon-link'></i> <?php echo $lang->project->manageOtherProducts; ?></button>
</div>
<?php endif;?>
</div>
<div id='mainContent'>
<div class='cell'>
@@ -46,9 +48,34 @@
</div>
</div>
<?php echo html::hidden("branch[$i]", $branchID);?>
<?php if(!isset($branchGroups[$productID])) unset($currentProducts[$productID]);?>
<?php if(isset($branchGroups[$productID][$branchID])) unset($branchGroups[$productID][$branchID]);?>
<?php if(isset($branchGroups[$productID]) and empty($branchGroups[$productID])) unset($currentProducts[$productID]);?>
<?php
if(!isset($branchGroups[$productID]))
{
if($this->config->systemMode == 'ALM')
{
unset($currentProducts[$productID]);
}
else
{
unset($allProducts[$productID]);
}
}
if(isset($branchGroups[$productID][$branchID])) unset($branchGroups[$productID][$branchID]);
if(isset($branchGroups[$productID]) and empty($branchGroups[$productID]))
{
if($this->config->systemMode == 'ALM')
{
unset($currentProducts[$productID]);
}
else
{
unset($allProducts[$productID]);
}
}
?>
<?php $i++;?>
<?php endforeach;?>
<?php endforeach;?>
@@ -57,7 +84,10 @@
<div class='detail'>
<div class='detail-title'><?php echo $lang->project->unlinkedProducts;?></div>
<div class='detail-content row'>
<?php foreach($currentProducts as $productID => $productName):?>
<?php
$unlinkedProducts = $this->config->systemMode == 'ALM' ? $currentProducts : $allProducts;
foreach($unlinkedProducts as $productID => $productName):
?>
<div class='col-sm-4'>
<div class='product<?php echo isset($branchGroups[$productID]) ? ' has-branch' : ''?>'>
<div class="checkbox-primary" title='<?php echo $productName;?>'>
@@ -75,6 +105,8 @@
<?php echo html::hidden("post", 'post');?>
<?php echo html::submitButton();?>
</div>
<?php if($this->config->systemMode == 'ALM'):?>
<div class='modal fade' id='otherProductsModal'>
<div class='modal-content'>
<div class='modal-dialog w-600px'>
@@ -97,6 +129,7 @@
</div>
</div>
</div>
<?php endif;?>
</form>
</div>
</div>
+4
View File
@@ -396,6 +396,7 @@ class story extends control
/* Hidden some fields of projects without products. */
$this->view->hiddenProduct = false;
$this->view->hiddenParent = false;
$this->view->hiddenPlan = false;
$this->view->hiddenURS = false;
$this->view->teamUsers = array();
@@ -409,6 +410,7 @@ class story extends control
{
$this->view->teamUsers = $this->project->getTeamMemberPairs($project->id);
$this->view->hiddenProduct = true;
$this->view->hiddenParent = true;
if($project->model !== 'scrum') $this->view->hiddenPlan = true;
if(!$project->multiple) $this->view->hiddenPlan = true;
@@ -883,6 +885,7 @@ class story extends control
/* Hidden some fields of projects without products. */
$this->view->hiddenProduct = false;
$this->view->hiddenParent = false;
$this->view->hiddenPlan = false;
$this->view->hiddenURS = false;
$this->view->teamUsers = array();
@@ -892,6 +895,7 @@ class story extends control
$project = $this->project->getByShadowProduct($product->id);
$this->view->teamUsers = $this->project->getTeamMemberPairs($project->id);
$this->view->hiddenProduct = true;
$this->view->hiddenParent = true;
if($project->model !== 'scrum') $this->view->hiddenPlan = true;
if(!$project->multiple) $this->view->hiddenPlan = true;
+2 -2
View File
@@ -161,7 +161,7 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
<tr>
<th><?php echo $hiddenURS ? $lang->story->parent : $lang->story->requirement;?></th>
<td colspan="2" class="<?php if($hiddenURS) echo 'hidden';?>"><?php echo html::select('URS[]', $URS, '', "class='form-control chosen' multiple");?></td>
<td colspan="2">
<td colspan="2" <?php if($hiddenParent) echo 'hidden';?>>
<div class='input-group' id='moduleIdBox'>
<?php if(!$hiddenURS):?>
<div class="input-group-addon"><?php echo $lang->story->parent;?></div>
@@ -171,7 +171,7 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
</td>
</tr>
<?php else:?>
<tr>
<tr <?php if($hiddenParent) echo 'hidden';?>>
<th><?php echo $lang->story->parent;?></th>
<td colspan="4"><?php echo html::select('parent', $stories, '', "class='form-control chosen'");?></td>
</tr>
+1 -1
View File
@@ -166,7 +166,7 @@
</td>
</tr>
<?php if($story->parent >= 0 and $story->type == 'story'):?>
<tr>
<tr class="<?php if($hiddenParent) echo 'hidden';?>">
<th><?php echo $lang->story->parent;?></th>
<td><?php echo html::select('parent', $stories, $story->parent, "class='form-control chosen'");?></td>
</tr>
+1 -1
View File
@@ -53,7 +53,7 @@
<?php
$otherParam = 'storyID=&projectID=';
$tab = 'product';
if($this->app->rawModule == 'projectstory')
if($this->app->rawModule == 'projectstory' or $this->app->tab == 'project')
{
$otherParam = "storyID=&projectID={$this->session->project}";
$tab = 'project';
+1 -1
View File
@@ -343,7 +343,7 @@ function setStories(moduleID, executionID)
$("#story").addClass('filled').chosen();
/* If there is no story option, select will be hidden and text will be displayed; otherwise, the opposite is true */
if($('#story option').length > 1)
if($('#story option').length > 1 || parseInt(hasProduct) == 0)
{
$('#story').parent().removeClass('hidden');
$('#storyBox').addClass('hidden');
+1
View File
@@ -23,6 +23,7 @@
<?php js::set('estimateNotEmpty', sprintf($lang->error->gt, $lang->task->estimate, '0'))?>
<?php js::set('lifetime', $execution->lifetime);?>
<?php js::set('lifetimeList', $lifetimeList);?>
<?php js::set('hasProduct', $execution->hasProduct);?>
<?php
$requiredFields = array();
foreach(explode(',', $config->task->create->requiredFields) as $field)
-2
View File
@@ -348,8 +348,6 @@ class testcase extends control
$stories = array_chunk($stories, $pager->recPerPage);
$this->view->title = $this->lang->story->zeroCase;
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $products[$productID]);
$this->view->position[] = $this->lang->story->zeroCase;
$this->view->stories = empty($stories) ? $stories : $stories[$pageID - 1];
$this->view->users = $this->user->getPairs('noletter');
+3 -2
View File
@@ -400,15 +400,16 @@ class tree extends control
$this->view->branch = $branch;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted', $module->owner);
$showProduct = strpos('story|bug|case', $type) !== false ? true : false;
$this->view->showProduct = $showProduct;
$showProduct = strpos('story|bug|case', $type) !== false ? true : false;
if($showProduct)
{
$product = $this->loadModel('product')->getById($module->root);
if($product->type != 'normal') $this->view->branches = $this->loadModel('branch')->getPairs($module->root, 'withClosed');
$this->view->product = $product;
$this->view->products = $this->product->getPairs('', $product->program);
if($product->shadow) $showProduct = false;
}
$this->view->showProduct = $showProduct;
/* Remove self and childs from the $optionMenu. Because it's parent can't be self or childs. */
$childs = $this->tree->getAllChildId($moduleID);
+1 -1
View File
@@ -852,7 +852,7 @@ class treeModel extends model
{
$extra['productID'] = $id;
$projectProductLink = helper::createLink('projectstory', 'story', "projectID=$rootID&productID=$id&branch=all");
$executionProductLink = helper::createLink('execution', 'story', "executionID=$rootID&ordery=&status=byProduct&praram=$id");
$executionProductLink = helper::createLink('execution', 'story', "executionID=$rootID&storyType=story&orderBy=&type=byProduct&praram=$id");
$link = $this->app->rawModule == 'projectstory' ? $projectProductLink : $executionProductLink;
if($productNum > 1) $menu .= "<li>" . html::a($link, $product, '_self', "id='product$id' title=$product");