diff --git a/module/execution/model.php b/module/execution/model.php index c4a482031a..3680700e54 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -66,8 +66,6 @@ class executionModel extends model $execution = $this->getByID($executionID); if(!$execution) return; - if($execution->type == 'stage') unset($this->lang->execution->menu->settings['subMenu']->products); - if($execution and $execution->type == 'kanban') { global $lang; @@ -88,6 +86,10 @@ class executionModel extends model $this->lang->execution->menu->settings['subMenu']->whitelist = array('link' => "{$this->lang->whitelist}|execution|whitelist|executionID=%s", 'subModule' => 'personnel', 'alias' => 'addwhitelist'); } + $project = $this->loadModel('project')->getByID($execution->project); + + if($execution->type == 'stage' or (!empty($project) and $project->model == 'waterfallplus')) unset($this->lang->execution->menu->settings['subMenu']->products); + if(!$this->app->user->admin and strpos(",{$this->app->user->view->sprints},", ",$executionID,") === false and !defined('TUTORIAL') and $executionID != 0) return print(js::error($this->lang->execution->accessDenied) . js::locate('back')); $executions = $this->getPairs(0, 'all', 'nocode'); diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index c6fa24596b..addf01954d 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -143,8 +143,9 @@ - attribute, array('request', 'design', 'review'))): ?> + type != 'stage' or ($execution->type == 'stage' and !in_array($execution->attribute, array('request', 'design', 'review')))): ?> + model == 'waterfall' or $project->model == 'waterfallplus') ? 'disabled="disabled"' : '';?> hasProduct)) $hidden = ''?> @@ -160,7 +161,7 @@
'> product->common;?> type == 'stage' and !$execution->division) ? "disabled='disabled'" : '';?> - id, "class='form-control chosen' $disabled onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='" . $product->type . "'");?> + id, "class='form-control chosen' $disabled $attr onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='" . $product->type . "'");?> type == 'stage' and !$execution->division) echo html::hidden("products[$i]", $product->id);?>
@@ -168,7 +169,7 @@
product->branchName['branch'];?> branches);?> - id]) ? $branchGroups[$product->id] : array(), $branchIdList, "class='form-control chosen' multiple onchange=\"loadPlans('#products{$i}', this)\"");?> + id]) ? $branchGroups[$product->id] : array(), $branchIdList, "class='form-control chosen' $attr multiple onchange=\"loadPlans('#products{$i}', this)\"");?>
@@ -176,8 +177,8 @@
> product->plan;?> - id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), $product->plans, "class='form-control chosen' multiple");?> - type == 'stage' and !$execution->division)):?> + id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), $product->plans, "class='form-control chosen' $attr multiple");?> + type == 'stage' and !$execution->division) and $project->model != 'waterfall' and $project->model != 'waterfallplus'):?>
>