diff --git a/module/bug/control.php b/module/bug/control.php index 361d61b687..e43f9fc73a 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -105,7 +105,6 @@ class bug extends control /* Build the search form. */ $actionURL = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->bug->buildSearchForm($productID, $this->products, $queryID, $actionURL); - $this->loadModel('search')->setSearchParams($this->config->bug->search); /* Set view. */ $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common; diff --git a/module/company/control.php b/module/company/control.php index 06324b1dca..242386c6c7 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -68,7 +68,6 @@ class company extends control $queryID = $type == 'bydept' ? 0 : (int)$param; $actionURL = $this->createLink('company', 'browse', "param=myQueryID&type=bysearch"); $this->company->buildSearchForm($queryID, $actionURL); - $this->loadModel('search')->setSearchParams($this->config->company->browse->search); /* Get users. */ $users = $this->company->getUsers($type, $queryID, $deptID, $sort, $pager); diff --git a/module/company/model.php b/module/company/model.php index 7b3e22ec31..a503998f2c 100644 --- a/module/company/model.php +++ b/module/company/model.php @@ -137,5 +137,7 @@ class companyModel extends model $this->config->company->browse->search['actionURL'] = $actionURL; $this->config->company->browse->search['queryID'] = $queryID; $this->config->company->browse->search['params']['dept']['values'] = array('' => '') + $this->loadModel('dept')->getOptionMenu(); + + $this->loadModel('search')->setSearchParams($this->config->company->browse->search); } } diff --git a/module/doc/control.php b/module/doc/control.php index 41f976594f..93c6b88213 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -85,7 +85,6 @@ class doc extends control /* Build the search form. */ $actionURL = $this->createLink('doc', 'browse', "libID=$libID&moduleID=$moduleID&procuctID=$productID&projectID=$projectID&browseType=bySearch&queryID=myQueryID"); $this->doc->buildSearchForm($libID, $this->libs, $queryID, $actionURL); - $this->search->setSearchParams($this->config->doc->search); $this->view->libID = $libID; $this->view->libName = $this->libs[$libID]; diff --git a/module/doc/model.php b/module/doc/model.php index 15051e2584..5acce721e0 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -324,6 +324,8 @@ class docModel extends model $moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($libID, 'customdoc', $startModuleID = 0); } $this->config->doc->search['params']['module']['values'] = $moduleOptionMenu; + + $this->search->setSearchParams($this->config->doc->search); } /** diff --git a/module/product/control.php b/module/product/control.php index 7f03c3399f..36ad991d29 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -145,7 +145,6 @@ class product extends control /* Build search form. */ $actionURL = $this->createLink('product', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->product->buildSearchForm($productID, $this->products, $queryID, $actionURL); - $this->loadModel('search')->setSearchParams($this->config->product->search); /* Assign. */ $this->view->title = $this->products[$productID]. $this->lang->colon . $this->lang->product->browse; diff --git a/module/product/model.php b/module/product/model.php index 63d47b671e..d41fd6bd4b 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -427,6 +427,8 @@ class productModel extends model $this->config->product->search['fields']['branch'] = $this->lang->product->branch; $this->config->product->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty'); } + + $this->loadModel('search')->setSearchParams($this->config->product->search); } /** diff --git a/module/project/control.php b/module/project/control.php index 32a7dac462..75dfd0ee34 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -166,7 +166,6 @@ class project extends control /* Build the search form. */ $actionURL = $this->createLink('project', 'task', "projectID=$projectID&status=bySearch¶m=myQueryID"); $this->project->buildSearchForm($projectID, $this->projects, $queryID, $actionURL); - $this->search->setSearchParams($this->config->project->search); /* team member pairs. */ $memberPairs = array(); diff --git a/module/project/model.php b/module/project/model.php index bc37af19c9..4a5d677861 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1774,5 +1774,7 @@ class projectModel extends model $this->config->project->search['queryID'] = $queryID; $this->config->project->search['params']['project']['values'] = array(''=>'', $projectID => $projects[$projectID], 'all' => $this->lang->project->allProject); $this->config->project->search['params']['module']['values'] = $this->loadModel('tree')->getTaskOptionMenu($projectID, $startModuleID = 0); + + $this->search->setSearchParams($this->config->project->search); } } diff --git a/module/testcase/control.php b/module/testcase/control.php index ec5a3073b3..422572a0ba 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -89,7 +89,6 @@ class testcase extends control /* Build the search form. */ $actionURL = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL); - $this->loadModel('search')->setSearchParams($this->config->testcase->search); /* Assign. */ $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common; @@ -649,7 +648,6 @@ class testcase extends control /* Build the search form. */ $actionURL = $this->createLink('testcase', 'linkCases', "caseID=$caseID&browseType=bySearch&queryID=myQueryID", '', true); $this->testcase->buildSearchForm($case->product, $this->products, $queryID, $actionURL); - $this->loadModel('search')->setSearchParams($this->config->testcase->search); /* Get cases to link. */ $cases2Link = $this->testcase->getCases2Link($caseID, $browseType, $queryID); diff --git a/module/testcase/model.php b/module/testcase/model.php index 5c6b195673..b42c039318 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -857,5 +857,7 @@ class testcaseModel extends model } $this->config->testcase->search['actionURL'] = $actionURL; $this->config->testcase->search['queryID'] = $queryID; + + $this->loadModel('search')->setSearchParams($this->config->testcase->search); } }