Merge branch 'sprint/zentaopms256_lanzongjun' into 'zentaopms_256'
add check module See merge request easycorp/zentaopms!6003
This commit is contained in:
@@ -203,7 +203,7 @@ function loadModuleForSiblings(productID, branch, branchIndex)
|
||||
{
|
||||
/* Load module */
|
||||
var currentModule = 0;
|
||||
var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + branchIndex + '&needManage=true&extra=¤tModuleID=' + currentModule);
|
||||
var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + branchIndex + '&needManage=false&extra=¤tModuleID=' + currentModule);
|
||||
if(branchIndex > 0)
|
||||
{
|
||||
var $moduleIDBox = $('.addBranchesBox'+ branchIndex +' #moduleIdBox');
|
||||
@@ -217,7 +217,7 @@ function loadModuleForSiblings(productID, branch, branchIndex)
|
||||
$moduleIDBox.find('#modules' + branchIndex).chosen();
|
||||
if(branchIndex == 0)
|
||||
{
|
||||
$('.switchBranch #moduleIdBox span:first-child').remove()
|
||||
$('.switchBranch #moduleIdBox > span:first-child').remove()
|
||||
}
|
||||
$moduleIDBox.prepend("<span class='input-group-addon fix-border'>" + storyModule + "</span>" );
|
||||
|
||||
@@ -240,7 +240,7 @@ function loadPlanForSiblings(productID, branch, branchIndex)
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(!branch) branch = 0;
|
||||
var expired = config.currentMethod == 'create' ? 'unexpired' : '';
|
||||
planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&fieldID=' + branchIndex + '&needCreate=true&expired='+ expired +'¶m=skipParent,' + config.currentMethod);
|
||||
planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&fieldID=' + branchIndex + '&needCreate=false&expired='+ expired +'¶m=skipParent,' + config.currentMethod);
|
||||
if(branchIndex > 0)
|
||||
{
|
||||
var $planIdBox = $('.addBranchesBox'+ branchIndex +' #planIdBox');
|
||||
|
||||
+14
-3
@@ -251,6 +251,20 @@ class storyModel extends model
|
||||
$this->post->plans = isset($story->plan) ? array($story->plan) : array(0 => 0);
|
||||
}
|
||||
|
||||
/* check module */
|
||||
$requiredFields = "," . $this->config->story->create->requiredFields . ",";
|
||||
if(strpos($requiredFields, ',module,') !== false)
|
||||
{
|
||||
foreach($this->post->modules as $module)
|
||||
{
|
||||
if(empty($module))
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->story->module);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$storyIds = array();
|
||||
$mainStoryID = 0;
|
||||
foreach($this->post->branches as $key => $branch)
|
||||
@@ -260,9 +274,6 @@ class storyModel extends model
|
||||
$story->plan = $this->post->plans[$key];
|
||||
|
||||
if(strpos('draft,reviewing', $story->status) !== false) $story->stage = $this->post->plan > 0 ? 'planned' : 'wait';
|
||||
|
||||
$requiredFields = "," . $this->config->story->create->requiredFields . ",";
|
||||
|
||||
if($story->type == 'requirement') $requiredFields = str_replace(',plan,', ',', $requiredFields);
|
||||
if(strpos($requiredFields, ',estimate,') !== false)
|
||||
{
|
||||
|
||||
@@ -544,7 +544,7 @@ class tree extends control
|
||||
$currentModuleID = (isset($currentModule->branch) and $currentModule->branch == 0) ? $currentModuleID : 0;
|
||||
|
||||
$output = html::select("$field", $optionMenu, $currentModuleID, "class='form-control' $changeFunc");
|
||||
if(count($optionMenu) == 1 and $needManage)
|
||||
if(count($optionMenu) == 1 and $needManage !== 'false')
|
||||
{
|
||||
$output .= "<span class='input-group-addon'>";
|
||||
$output .= html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=$viewType¤tModuleID=0&branch=$branch", '', true), $this->lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
|
||||
Reference in New Issue
Block a user