* adjust for show onMenuBar checkbox when search save query.
This commit is contained in:
@@ -114,6 +114,7 @@ class bug extends control
|
||||
|
||||
/* Build the search form. */
|
||||
$actionURL = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->bug->search['onMenuBar'] = 'yes';
|
||||
$this->bug->buildSearchForm($productID, $this->products, $queryID, $actionURL);
|
||||
$this->loadModel('search')->mergeFeatureBar('bug', 'browse');
|
||||
|
||||
|
||||
@@ -160,6 +160,7 @@ class product extends control
|
||||
|
||||
/* Build search form. */
|
||||
$actionURL = $this->createLink('product', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->product->search['onMenuBar'] = 'yes';
|
||||
$this->product->buildSearchForm($productID, $this->products, $queryID, $actionURL);
|
||||
$this->loadModel('search')->mergeFeatureBar('product', 'browse');
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ class project extends control
|
||||
|
||||
/* Build the search form. */
|
||||
$actionURL = $this->createLink('project', 'task', "projectID=$projectID&status=bySearch¶m=myQueryID");
|
||||
$this->config->project->search['onMenuBar'] = 'yes';
|
||||
$this->project->buildSearchForm($projectID, $this->projects, $queryID, $actionURL);
|
||||
$this->loadModel('search')->mergeFeatureBar('project', 'task');
|
||||
|
||||
@@ -1682,6 +1683,8 @@ class project extends control
|
||||
$productType = 'normal';
|
||||
$productNum = count($products);
|
||||
$branches = array();
|
||||
$modules = array();
|
||||
$this->loadModel('tree');
|
||||
foreach($products as $product)
|
||||
{
|
||||
$productPairs[$product->id] = $product->name;
|
||||
@@ -1703,14 +1706,16 @@ class project extends control
|
||||
$branchPairs += $productBranches;
|
||||
}
|
||||
}
|
||||
foreach($this->tree->getOptionMenu($product->id) as $moduleID => $moduleName) $modules[$moduleID] = $moduleName;
|
||||
}
|
||||
|
||||
/* Build search form. */
|
||||
unset($this->config->product->search['fields']['module']);
|
||||
if(count($products) >= 2) unset($this->config->product->search['fields']['module']);
|
||||
$this->config->product->search['actionURL'] = $this->createLink('project', 'linkStory', "projectID=$projectID&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->product->search['queryID'] = $queryID;
|
||||
$this->config->product->search['params']['product']['values'] = $productPairs + array('all' => $this->lang->product->allProductsOfProject);
|
||||
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts($products);
|
||||
if(count($products) == 1) $this->config->product->search['params']['module']['values'] = $modules;
|
||||
unset($this->lang->story->statusList['draft']);
|
||||
if($productType == 'normal')
|
||||
{
|
||||
@@ -1748,6 +1753,7 @@ class project extends control
|
||||
$this->view->prjStories = $prjStories;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->productType = $productType;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->branchGroups = $branchGroups;
|
||||
$this->display();
|
||||
|
||||
@@ -30,6 +30,7 @@ class search extends control
|
||||
$fieldParams = empty($fieldParams) ? json_decode($this->session->searchParams['fieldParams'], true) : $fieldParams;
|
||||
$actionURL = empty($actionURL) ? $this->session->searchParams['actionURL'] : $actionURL;
|
||||
$style = isset($_SESSION['searchParams']['style']) ? $this->session->searchParams['style'] : '';
|
||||
$onMenuBar = isset($_SESSION['searchParams']['onMenuBar']) ? $this->session->searchParams['onMenuBar'] : '';
|
||||
$this->search->initSession($module, $searchFields, $fieldParams);
|
||||
|
||||
$this->view->module = $module;
|
||||
@@ -40,6 +41,7 @@ class search extends control
|
||||
$this->view->queries = $this->search->getQueryPairs($module);
|
||||
$this->view->queryID = $queryID;
|
||||
$this->view->style = empty($style) ? 'full' : $style;
|
||||
$this->view->onMenuBar = empty($onMenuBar) ? 'no' : $onMenuBar;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -61,7 +63,7 @@ class search extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveQuery($module)
|
||||
public function saveQuery($module, $onMenuBar = 'no')
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
@@ -69,7 +71,8 @@ class search extends control
|
||||
if(!$queryID) die(js::error(dao::getError()));
|
||||
die(js::closeModal('parent.parent', '', "function(){parent.parent.loadQueries($queryID)}"));
|
||||
}
|
||||
$this->view->module = $module;
|
||||
$this->view->module = $module;
|
||||
$this->view->onMenuBar = $onMenuBar;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ class searchModel extends model
|
||||
$searchParams['fieldParams'] = json_encode($searchConfig['params']);
|
||||
$searchParams['actionURL'] = $searchConfig['actionURL'];
|
||||
$searchParams['style'] = zget($searchConfig, 'style', 'full');
|
||||
$searchParams['onMenuBar'] = zget($searchConfig, 'onMenuBar', 'no');
|
||||
$searchParams['queryID'] = isset($searchConfig['queryID']) ? $searchConfig['queryID'] : 0;
|
||||
|
||||
$this->session->set('searchParams', $searchParams);
|
||||
|
||||
@@ -400,7 +400,7 @@ foreach($fieldParams as $fieldName => $param)
|
||||
if($style != 'simple')
|
||||
{
|
||||
echo html::commonButton($lang->search->reset, 'onclick=resetForm(this)');
|
||||
if(common::hasPriv('search', 'saveQuery')) echo html::a($this->createLink('search', 'saveQuery', "module=$module"), $lang->save, '', "class='saveQuery btn'");
|
||||
if(common::hasPriv('search', 'saveQuery')) echo html::a($this->createLink('search', 'saveQuery', "module=$module&onMenuBar=$onMenuBar"), $lang->save, '', "class='saveQuery btn'");
|
||||
}
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<form target='hiddenwin' method='post' style='padding: 20px 5% 30px'>
|
||||
<div class='input-group'>
|
||||
<input name='title' id='title' class="form-control" autocomplete="off" type="text">
|
||||
<?php if($module != 'user'):?>
|
||||
<?php if($onMenuBar == 'yes'):?>
|
||||
<span class='input-group-addon'>
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="onMenuBar" value="1" id="onMenuBar" />
|
||||
|
||||
@@ -104,6 +104,7 @@ class testcase extends control
|
||||
|
||||
/* Build the search form. */
|
||||
$actionURL = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->testcase->search['onMenuBar'] = 'yes';
|
||||
$this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL);
|
||||
$this->loadModel('search')->mergeFeatureBar('testcase', 'browse');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user