diff --git a/module/build/control.php b/module/build/control.php index 5deb4f5750..1729efc776 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -22,10 +22,7 @@ class build extends control public function create($executionID, $productID = 0) { /* Create execution if no execution. */ - if($executionID == 0) - { - die(js::locate($this->createLink('project', 'create'), 'parent')); - } + if($executionID == 0) die(js::locate($this->createLink('project', 'create'), 'parent')); if(!empty($_POST)) { @@ -144,7 +141,7 @@ class build extends control $this->view->products = $products; $this->view->users = $this->loadModel('user')->getPairs('noletter', $build->builder); $this->view->build = $build; - $this->view->testtask = $this->dao->select('id')->from(TABLE_TESTTASK)->where('build')->eq($build->id)->andWhere('deleted')->eq(0)->fetch('id'); + $this->view->testtaskID = $this->dao->select('id')->from(TABLE_TESTTASK)->where('build')->eq($build->id)->andWhere('deleted')->eq(0)->fetch('id'); $this->display(); } diff --git a/module/build/model.php b/module/build/model.php index 7241339872..d337632ed5 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -147,6 +147,7 @@ class buildModel extends model } } + if($this->session->projectBuildQuery == false) $this->session->set('projectBuildQuery', ' 1 = 1'); $buildQuery = $this->session->projectBuildQuery; /* Distinguish between repeated fields. */ @@ -207,6 +208,7 @@ class buildModel extends model } } + if($this->session->executionBuildQuery == false) $this->session->set('executionBuildQuery', ' 1 = 1'); $buildQuery = $this->session->executionBuildQuery; /* Distinguish between repeated fields. */ diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index a816c0981e..5ba5dd1d40 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -28,7 +28,7 @@ stories or $build->bugs or $testtask) $disabled = 'disabled'; + if($build->stories or $build->bugs or $testtaskID) $disabled = 'disabled'; ?>
product, "onchange='loadBranches(this.value);' class='form-control chosen' $disabled required");?> @@ -44,7 +44,7 @@ build->notice->changeProduct;?> - + build->project;?> project, "class='form-control chosen' required $disabled");?> build->notice->changeProject;?> diff --git a/module/productplan/control.php b/module/productplan/control.php index d11104e680..7d529eefee 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -502,9 +502,9 @@ class productplan extends control $this->loadModel('bug'); $plan = $this->productplan->getByID($planID); $this->commonAction($plan->product, $plan->branch); - $products = $this->product->getPairs('nocode'); - $productID = $plan->product; - $queryID = ($browseType == 'bysearch') ? (int)$param : 0; + $productID = $plan->product; + $productName = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch('name'); + $queryID = ($browseType == 'bysearch') ? (int)$param : 0; /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -514,7 +514,7 @@ class productplan extends control $this->config->bug->search['actionURL'] = $this->createLink('productplan', 'view', "planID=$planID&type=bug&orderBy=$orderBy&link=true¶m=" . helper::safe64Encode('&browseType=bySearch&queryID=myQueryID')); $this->config->bug->search['queryID'] = $queryID; $this->config->bug->search['style'] = 'simple'; - $this->config->bug->search['params']['product']['values'] = array($productID => $products[$productID], 'all' => $this->lang->bug->allProduct); + $this->config->bug->search['params']['product']['values'] = array($productID => $productName, 'all' => $this->lang->bug->allProduct); $this->config->bug->search['params']['plan']['values'] = $this->productplan->getForProducts(array($plan->product => $plan->product)); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); $this->config->bug->search['params']['project']['values'] = $this->product->getExecutionPairsByProduct($productID); @@ -547,7 +547,6 @@ class productplan extends control $this->view->allBugs = $allBugs; $this->view->planBugs = $planBugs; - $this->view->products = $products; $this->view->plan = $plan; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->browseType = $browseType; diff --git a/module/task/control.php b/module/task/control.php index fa6d2125f0..e279e8047f 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -157,7 +157,7 @@ class task extends control elseif($this->post->after == 'toTaskList') { setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, false); - $taskLink = $this->createLink('project', 'task', "projectID=$projectID&status=bymodule¶m=$moduleID&orderBy=id_desc"); + $taskLink = $this->createLink('project', 'task', "projectID=$projectID&status=unclosed¶m=0&orderBy=id_desc"); $response['locate'] = $taskLink; $this->send($response); } @@ -1028,9 +1028,10 @@ class task extends control if(dao::isError()) die(js::error(dao::getError())); - if(!empty($changes)) + if($this->post->comment != '' or !empty($changes)) { - $actionID = $this->action->create('task', $taskID, 'Closed', $this->post->comment); + $action = (!empty($changes)) ? 'Closed' : 'Commented'; + $actionID = $this->action->create('task', $taskID, $action, $this->post->comment); $this->action->logHistory($actionID, $changes); } diff --git a/module/task/model.php b/module/task/model.php index 58cea6e334..907c17af8e 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1677,12 +1677,12 @@ class taskModel extends model * * @param int $taskID * @access public - * @return void + * @return array */ public function close($taskID) { $oldTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch(); - if($oldTask->status == 'closed') return; + if($oldTask->status == 'closed') return array(); $now = helper::now(); $task = fixer::input('post') diff --git a/module/task/view/finish.html.php b/module/task/view/finish.html.php index 5106ad7bef..2c9b16a134 100644 --- a/module/task/view/finish.html.php +++ b/module/task/view/finish.html.php @@ -67,7 +67,7 @@ task->realStarted;?> -
realStarted != '0000-00-00' ? $task->realStarted : '', "class='form-control form-datetime'");?>
+
realStarted != '0000-00-00 00:00:00' ? $task->realStarted : '', "class='form-control form-datetime'");?>
task->finishedDate;?>