diff --git a/module/execution/control.php b/module/execution/control.php index e1b7e89e63..2022012ff6 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1604,6 +1604,7 @@ class execution extends control $this->view->rdUsers = $rdUsers; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); $this->view->allProjects = $this->project->getPairsByModel('all', 0, 'noclosed'); + $this->view->project = $this->project->getById($execution->project); $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; diff --git a/module/execution/js/common.js b/module/execution/js/common.js index 9e61566158..8bb7171a8d 100644 --- a/module/execution/js/common.js +++ b/module/execution/js/common.js @@ -139,7 +139,7 @@ function loadBranches(product) if($('#productsBox .input-group:last select:first').val() != 0) { var length = $('#productsBox .input-group').size(); - $('#productsBox .row').append('
' + $('#productsBox .col-sm-4:last').html() + '
'); + $('#productsBox .row').append('
' + $('#productsBox .col-sm-4:last').html().replace('required', '') + '
'); if($('#productsBox .input-group:last select').size() >= 2) $('#productsBox .input-group:last select:last').remove(); $('#productsBox .input-group:last .chosen-container').remove(); $('#productsBox .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length); diff --git a/module/execution/model.php b/module/execution/model.php index 4114d2dc0e..69cc47c87b 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -302,13 +302,13 @@ class executionModel extends model if($project) $type = zget($this->config->execution->modelList, $project->model, 'sprint'); /* If the execution model is a stage, determine whether the product is linked. */ - if($type == 'stage' and empty($this->post->products[0])) + if($type == 'stage' and empty(array_filter($this->post->products))) { dao::$errors['message'][] = $this->lang->execution->noLinkProduct; return false; } - if($type == 'kanban' and empty($this->post->products[0])) + if($type == 'kanban' and empty(array_filter($this->post->products))) { dao::$errors['message'][] = $this->lang->execution->kanbanNoLinkProduct; return false; @@ -470,12 +470,18 @@ class executionModel extends model return false; } - if($oldExecution->type == 'stage' and empty($this->post->products[0])) + if($oldExecution->type == 'stage' and empty(array_filter($this->post->products))) { dao::$errors['message'][] = $this->lang->execution->noLinkProduct; return false; } + if($oldExecution->type == 'kanban' and empty(array_filter($this->post->products))) + { + dao::$errors['message'][] = $this->lang->execution->kanbanNoLinkProduct; + return false; + } + /* Get the data from the post. */ $execution = fixer::input('post') ->setDefault('lastEditedBy', $this->app->user->account) diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index d9738e31ab..7cc9de664d 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -144,7 +144,7 @@
-
+
diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index 0316288f4f..d78120ecc3 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -141,7 +141,7 @@ type != 'normal' and isset($branchGroups[$product->id]);?> id] as $branchID => $branch):?>
-
+
"> id, "class='form-control chosen' $class onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='". $product->type ."'");?> id], $branchID, "class='form-control chosen' $class onchange=\"loadPlans('#products{$i}', this.value)\" data-last='" . $branchID . "'");?>