Merge branch 'sprint/master_lanzongjun_fixbug' into 'master'
* finish task #75912#75908#75904#75919#75923#75924#76338 See merge request easycorp/zentaopms!6142
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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()));
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user