diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 7f11fcfa4f..7cc63b0fa8 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -251,7 +251,7 @@
- " . zget($lang->bug->browserList, $browser) . "";?> + " . zget($lang->bug->browserList, $browser) . "";?>
diff --git a/module/common/model.php b/module/common/model.php index 0e10011cc8..0d9ffa989f 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -3047,6 +3047,14 @@ EOD; } if($productsStatus[$object->product] == 'closed') return false; } + elseif(!empty($object->product) and is_string($object->product) and empty($config->CRProduct)) + { + $products = array(0) + explode(',', $object->product); + $products = $app->control->loadModel('product')->getByIdList($products); + $productStatus = array(); + foreach($products as $product) $productStatus[$product->status] = 1; + if(!empty($productStatus['closed']) and count($productStatus) == 1) return false; + } /* Check the execution is closed. */ $productModuleList = array('story', 'bug', 'testtask'); diff --git a/module/execution/control.php b/module/execution/control.php index 0c473b3597..91312d698f 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1703,6 +1703,8 @@ class execution extends control global $lang; $lang->executionCommon = $lang->execution->stage; include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; + + $this->config->execution->create->requiredFields .= ',products0'; } $this->app->loadLang('program'); diff --git a/module/execution/model.php b/module/execution/model.php index df16b218f8..2b0bab014f 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -386,6 +386,8 @@ class executionModel extends model if(($project->model == 'waterfall' or $project->model == 'waterfallplus') and isset($this->config->setPercent) and $this->config->setPercent == 1) { + $_POST['products'] = array_filter($_POST['products']); + if(empty($_POST['products'])) dao::$errors['products0'] = $this->lang->project->errorNoProducts; $this->checkWorkload('create', $_POST['percent'], $project); if(dao::isError()) return false; } @@ -1883,7 +1885,7 @@ class executionModel extends model ->page($pager, 't1.id') ->fetchAll('id'); - if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchPairs(); + if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, GROUP_CONCAT(product) as product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->groupBy('project')->fetchPairs(); $hours = $this->loadModel('project')->computerProgress($executions); $burns = $this->getBurnData($executions); diff --git a/module/project/control.php b/module/project/control.php index 260801420f..f6f57af86a 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -2190,7 +2190,7 @@ class project extends control } $oldProducts = $this->product->getProducts($projectID); - if($project->multiple and $project->model != 'waterfall') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product'); + if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product'); $this->project->updateProducts($projectID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); @@ -2216,7 +2216,7 @@ class project extends control } } - if($project->multiple and $project->model != 'waterfall') + if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus') { $unlinkedProducts = array_diff($oldProductIDs, $newProductIDs); if(!empty($unlinkedProducts)) diff --git a/module/project/js/edit.js b/module/project/js/edit.js index fdc708019d..cb2f850d72 100644 --- a/module/project/js/edit.js +++ b/module/project/js/edit.js @@ -205,7 +205,7 @@ function loadBranches(product) } }); - (chosenProducts.length > 1 && model == 'waterfall' && model == 'waterfallplus') ? $('.division').removeClass('hide') : $('.division').addClass('hide'); + (chosenProducts.length > 1 && (model == 'waterfall' || model == 'waterfallplus')) ? $('.division').removeClass('hide') : $('.division').addClass('hide'); var $tableRow = $(product).closest('.table-row'); var index = $tableRow.find('select:first').attr('id').replace('products' , ''); @@ -301,5 +301,12 @@ function removeLine(obj) { $(obj).closest('tr').remove(); disableSelectedProduct(); - if($("select[name^='products']").length < 2) $('.division').addClass('hide'); + + var chosenProducts = 0; + $(".productsBox select[name^='products']").each(function() + { + if($(this).val() > 0) chosenProducts ++; + }); + + (chosenProducts.length > 1 && (model == 'waterfall' || model == 'waterfallplus')) ? $('.division').removeClass('hide') : $('.division').addClass('hide'); } diff --git a/module/project/model.php b/module/project/model.php index ce5b643326..94343659c6 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1521,6 +1521,7 @@ class projectModel extends model ->setDefault('team', $this->post->name) ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', helper::now()) + ->setDefault('days', '0') ->setIF($this->post->delta == 999, 'end', LONG_TIME) ->setIF($this->post->delta == 999, 'days', 0) ->setIF($this->post->begin == '0000-00-00', 'begin', '') @@ -2502,6 +2503,13 @@ class projectModel extends model $this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec(); $this->dao->update(TABLE_EXECUTION)->set('division')->eq('1')->where('project')->eq((int)$projectID)->exec(); } + + $project = $this->getByID($projectID); + if(!empty($project) and ($project->model == 'waterfall' or $project->model == 'waterfallplus') and empty($project->division) and !empty($executions)) + { + $this->loadModel('execution'); + foreach($executions as $executionID) $this->execution->updateProducts($executionID); + } } $oldProductKeys = array_keys($oldProjectProducts); diff --git a/module/search/model.php b/module/search/model.php index 69ac1589bb..695a4ab088 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -29,6 +29,7 @@ class searchModel extends model { $flowModule = $module; if($module == 'projectStory' || $module == 'executionStory') $flowModule = 'story'; + if($module == 'projectBuild' || $module == 'executionBuild') $flowModule = 'build'; if($module == 'projectBug') $flowModule = 'bug'; $buildin = false;