This commit is contained in:
王怡栋
2022-11-15 13:47:55 +08:00
11 changed files with 50 additions and 21 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project);
</div>
</td>
</tr>
<tr class='<?php if($product->shadow and zget($project, 'model') != 'scrum') echo 'hide'?>'>
<tr class='<?php if(!($product->shadow and zget($project, 'model') == 'scrum' and $project->multiple)) echo 'hide'?>'>
<th><?php echo $lang->bug->productplan;?></th>
<td>
<span id="planIdBox"><?php echo html::select('plan', $plans, $bug->plan, "class='form-control chosen'");?></span>
+1 -1
View File
@@ -343,7 +343,7 @@ tbody tr td:first-child input {display: none;}
<td>
<?php $builds = '';?>
<?php foreach(explode(',', $build->builds) as $buildID):?>
<?php $builds .= html::a($this->createLink('build', 'view', "buildID=$buildID") . "#app={$app->tab}", zget($buildPairs, $buildID)) . $lang->comma;?>
<?php if($buildID) $builds .= html::a($this->createLink('build', 'view', "buildID=$buildID") . "#app={$app->tab}", zget($buildPairs, $buildID)) . $lang->comma;?>
<?php endforeach;?>
<?php echo rtrim($builds, $lang->comma);?>
</td>
+18
View File
@@ -1733,10 +1733,28 @@ class execution extends control
$this->view->linkedBranches = $linkedBranches;
}
if(!$project->hasProduct)
{
$shadowProduct = $this->loadModel('product')->getShadowProductByProject($project->id);
$productPlan = $this->loadModel('productplan')->getPairs($shadowProduct->id, '0,0', 'noclosed,unexpired', true);
}
if(!empty($_POST))
{
if(isset($_POST['attribute']) and in_array($_POST['attribute'], array('request', 'design', 'review'))) unset($_POST['plans']);
/* No product execution link plans. */
if(!$project->hasProduct and !empty($_POST['plans']))
{
$plansItem = array();
foreach($_POST['plans'] as $planItem)
{
if(empty($planItem[0][0])) continue;
$plansItem[] = $planItem[0][0];
}
$_POST['plans'] = array($_POST['products'][0] => array(0 => $plansItem));
}
$executionID = $this->execution->create($copyExecutionID);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
+4 -1
View File
@@ -79,7 +79,7 @@
<?php endif;?>
<?php
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", "<i class='icon icon-export muted'></i> " . $lang->story->export, '', "class='btn btn-link export iframe'");
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;
if(common::canModify('execution', $execution))
@@ -253,6 +253,7 @@
foreach($setting as $key => $value)
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue;
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAction);
@@ -271,6 +272,7 @@
<?php foreach($setting as $key => $value)
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue;
$this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $execution, $showBranch);
}
?>
@@ -285,6 +287,7 @@
<?php foreach($setting as $key => $value)
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue;
$this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $execution);
}?>
</tr>
+2 -1
View File
@@ -11,7 +11,8 @@ $config->project->editor->activate = array('id' => 'comment', 'tools' => 'simple
$config->project->editor->view = array('id' => 'lastComment', 'tools' => 'simpleTools');
$config->project->list = new stdclass();
$config->project->list->exportFields = 'id,parent,code,name,hasProduct,linkedProducts,status,begin,end,budget,PM,end,desc';
$config->project->list->exportFields = 'id,code,name,hasProduct,linkedProducts,status,begin,end,budget,PM,end,desc';
if($config->systemMode == 'ALM') $config->project->list->exportFields = substr_replace($config->project->list->exportFields, ',parent', 2, 0);
$config->project->create = new stdclass();
$config->project->edit = new stdclass();
+2
View File
@@ -42,10 +42,12 @@
<?php if(common::hasPriv('execution', 'task')) echo html::checkbox('showTask', array('1' => $lang->programplan->stageCustom->task), '', $this->cookie->showTask ? 'checked=checked' : '');?>
</div>
<div class='btn-toolbar pull-right'>
<?php if($project->model == 'waterfall'):?>
<div class="btn-group">
<?php echo html::a('', "<i class='icon-list'></i> &nbsp;", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->project->bylist}'");?>
<?php echo html::a($this->createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=gantt"), "<i class='icon-gantt-alt'></i> &nbsp;", '', "class='btn btn-icon switchBtn' title='{$lang->programplan->gantt}'");?>
</div>
<?php endif;?>
<?php common::printLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=project", "<i class='icon-export muted'> </i> " . $lang->export, '', "class='btn btn-link export'")?>
<?php if(common::hasPriv('programplan', 'create') and $isStage):?>
<?php echo html::a($this->createLink('programplan', 'create', "projectID=$projectID&productID=$productID"), "<i class='icon icon-plus'></i> " . $lang->programplan->create, '', "class='btn btn-primary'");?>
+6 -4
View File
@@ -973,10 +973,11 @@ class searchModel extends model
if($this->app->user->admin) return $results;
$this->loadModel('doc');
$products = $this->app->user->view->products;
$programs = $this->app->user->view->programs;
$projects = $this->app->user->view->projects;
$executions = $this->app->user->view->sprints;
$products = $this->app->user->view->products;
$shadowProducts = $this->dao->select('id')->from(TABLE_PRODUCT)->where('shadow')->eq(1)->fetchPairs('id');
$programs = $this->app->user->view->programs;
$projects = $this->app->user->view->projects;
$executions = $this->app->user->view->sprints;
$objectPairs = array();
$total = count($results);
@@ -1014,6 +1015,7 @@ class searchModel extends model
foreach($objectIdList as $productID => $recordID)
{
if(strpos(",$products,", ",$productID,") === false) unset($results[$recordID]);
if(in_array($productID, $shadowProducts)) unset($results[$recordID]);
}
}
elseif($objectType == 'program')
+3 -3
View File
@@ -1085,7 +1085,7 @@ class story extends control
}
/* Set ditto option for users. */
$users = $this->loadModel('user')->getPairs('nodeleted');
$users = $this->loadModel('user')->getPairs('nodeleted|noclosed');
$users = array('' => '', 'ditto' => $this->lang->story->ditto) + $users;
/* Set Custom*/
@@ -2777,7 +2777,7 @@ class story extends control
$this->config->story->datatable->fieldList['plan']['dataSource'] = array('module' => 'productplan', 'method' => 'getPairs', 'params' => $productIdList);
}
$this->post->set('rows', $this->story->getExportStorys($executionID, $orderBy));
$this->post->set('rows', $this->story->getExportStorys($executionID, $orderBy, $storyType));
$this->fetch('transfer', 'export', 'model=story');
}
@@ -2816,7 +2816,7 @@ class story extends control
if(isset($project->hasProduct) && !$project->hasProduct)
{
$filterFields = array('product,', 'branch,');
if($project->model != 'scrum') $filterFields[] = 'plan';
if($project->model != 'scrum') $filterFields[] = 'plan,';
$this->config->story->exportFields = str_replace($filterFields, '', $this->config->story->exportFields);
}
+6 -3
View File
@@ -4218,7 +4218,7 @@ class storyModel extends model
if($action == 'batchcreate' and $story->parent > 0) return false;
if($action == 'batchcreate' and $story->type == 'requirement' and $story->status != 'closed') return strpos('draft,reviewing,changing', $story->status) === false;
if($action == 'batchcreate' and $config->vision == 'lite' and ($story->status == 'active' and ($story->stage == 'wait' or $story->stage == 'projected'))) return true;
/* Adjust code, hide split entry, fix bug #29432. */
/* Adjust code, hide split entry. */
if($action == 'batchcreate' and ($story->status != 'active' or (isset($shadowProducts[$story->product])) or (!isset($shadowProducts[$story->product]) && $story->stage != 'wait') or !empty($story->plan))) return false;
return true;
@@ -4489,7 +4489,7 @@ class storyModel extends model
$executionID = empty($execution) ? 0 : $execution->id;
/* Adjust code, hide split entry, fix bug #29432. */
/* Adjust code, hide split entry. */
if(common::hasPriv('story', 'batchCreate') and !$execution->multiple and !$execution->hasProduct and false)
{
$isClick = $this->isClickable($story, 'batchcreate');
@@ -5878,13 +5878,16 @@ class storyModel extends model
*
* @param int $executionID
* @param string $orderBy
* @param string $storyType
* @access public
* @return void
*/
public function getExportStorys($executionID, $orderBy = 'id_desc')
public function getExportStorys($executionID, $orderBy = 'id_desc', $storyType = 'story')
{
$this->loadModel('file');
$this->loadModel('branch');
$this->replaceURLang($storyType);
$storyLang = $this->lang->story;
$storyConfig = $this->config->story;
+2 -2
View File
@@ -159,14 +159,14 @@ class transfer extends control
if($model == 'story')
{
$product = $this->loadModel('product')->getByID($this->session->storyPortParams['productID']);
$product = $this->loadModel('product')->getByID($this->session->storyTransferParams['productID']);
if($product->type == 'normal') unset($fields['branch']);
if($this->session->storyType == 'requirement') unset($fields['plan']);
}
if($model == 'bug')
{
$product = $this->loadModel('product')->getByID($this->session->bugPortParams['productID']);
$product = $this->loadModel('product')->getByID($this->session->bugTransferParams['productID']);
if($product->type == 'normal') unset($fields['branch']);
if($product->shadow and ($this->app->tab == 'execution' or $this->app->tab == 'project')) unset($fields['product']);
}
+5 -5
View File
@@ -56,16 +56,16 @@ class transferModel extends model
}
/**
* Check tmpFile.
* Check tmp file.
*
* @access public
* @return void
*/
public function checkTmpFile()
{
$file = $this->session->fileImportFileName;
$tmpPath = $this->loadModel('file')->getPathOfImportedFile();
$tmpFile = $tmpPath . DS . md5(basename($file));
$file = $this->session->fileImportFileName;
$tmpPath = $this->loadModel('file')->getPathOfImportedFile();
$tmpFile = $tmpPath . DS . md5(basename($file));
if($this->maxImport and file_exists($tmpFile)) return $tmpFile;
return false;
@@ -196,7 +196,7 @@ class transferModel extends model
$rows = $this->getRows($model, $fieldList);
if($model == 'story')
{
$product = $this->loadModel('product')->getByID((int)$this->session->storyPortParams['productID']);
$product = $this->loadModel('product')->getByID((int)$this->session->storyTransferParams['productID']);
if($product and $product->shadow)
{
foreach($rows as $id => $row)