* adjust for ajax get search form.
This commit is contained in:
@@ -121,6 +121,7 @@ class bug extends control
|
||||
$this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID);
|
||||
$this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID);
|
||||
$this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID);
|
||||
$this->loadModel('search')->setSearchParams($this->config->bug->search);
|
||||
|
||||
$users = $this->user->getPairs('noletter');
|
||||
|
||||
@@ -148,7 +149,6 @@ class bug extends control
|
||||
$this->view->productID = $productID;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'));
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->bug->search);
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->users = $users;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
<script language='Javascript'>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
var formUrl = '<?php echo $formUrl;?>';
|
||||
var moduleID = '<?php echo $moduleID;?>';
|
||||
var customed = <?php echo (int)$customed;?>;
|
||||
</script>
|
||||
|
||||
@@ -258,10 +258,10 @@ class company extends control
|
||||
$this->config->company->dynamic->search['params']['project']['values'] = $projects;
|
||||
$this->config->company->dynamic->search['params']['product']['values'] = $products;
|
||||
$this->config->company->dynamic->search['params']['actor']['values'] = $users;
|
||||
$this->loadModel('search')->setSearchParams($this->config->company->dynamic->search);
|
||||
|
||||
/* Assign. */
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->company->dynamic->search);
|
||||
$this->view->account = $account;
|
||||
$this->view->product = $product;
|
||||
$this->view->project = $project;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<?php include '../../common/view/tablesorter.html.php';?>
|
||||
<script language='Javascript'>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
var formUrl = '<?php echo $formUrl;?>';
|
||||
</script>
|
||||
<div id='featurebar'>
|
||||
<?php
|
||||
|
||||
@@ -126,6 +126,7 @@ class doc extends control
|
||||
$this->config->doc->search['params']['project']['values'] = array(''=>'') + $this->project->getPairs() + array('all'=>$this->lang->doc->allProject);
|
||||
$this->config->doc->search['params']['lib']['values'] = array(''=>'') + $this->libs;
|
||||
$this->config->doc->search['params']['type']['values'] = array(''=>'') + $this->config->doc->search['params']['type']['values'];
|
||||
$this->loadModel('search')->setSearchParams($this->config->doc->search);
|
||||
|
||||
/* Get the modules. */
|
||||
if($libID == 'product' or $libID == 'project')
|
||||
@@ -139,7 +140,6 @@ class doc extends control
|
||||
$this->config->doc->search['params']['module']['values'] = array(''=>'') + $moduleOptionMenu;
|
||||
|
||||
$this->view->libID = $libID;
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->doc->search);
|
||||
$this->view->libName = $this->libs[$libID];
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->moduleTree = $moduleTree;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
<script language='Javascript'>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
var formUrl = '<?php echo $formUrl;?>';
|
||||
</script>
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
|
||||
@@ -132,6 +132,7 @@ class product extends control
|
||||
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID);
|
||||
$this->config->product->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->product->allProduct);
|
||||
$this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($productID, $viewType = 'story', $startModuleID = 0);
|
||||
$this->loadModel('search')->setSearchParams($this->config->product->search);
|
||||
|
||||
$this->view->productID = $productID;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
@@ -144,7 +145,6 @@ class product extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->product->search);
|
||||
$this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
<script language='Javascript'>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
var formUrl = '<?php echo $formUrl;?>';
|
||||
</script>
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
|
||||
@@ -178,6 +178,7 @@ class project extends control
|
||||
$this->config->project->search['queryID'] = $queryID;
|
||||
$this->config->project->search['params']['project']['values'] = array(''=>'', $projectID => $this->projects[$projectID], 'all' => $this->lang->project->allProject);
|
||||
$this->config->project->search['params']['module']['values'] = $this->tree->getOptionMenu($projectID, $viewType = 'task', $startModuleID = 0);
|
||||
$this->loadModel('search')->setSearchParams($this->config->project->search);
|
||||
|
||||
/* Assign. */
|
||||
$this->view->tasks = $tasks;
|
||||
@@ -193,7 +194,6 @@ class project extends control
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->project = $project;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->project->search);
|
||||
$this->view->moduleTree = $this->tree->getTreeMenu($projectID, $viewType = 'task', $startModuleID = 0, array('treeModel', 'createTaskLink'));
|
||||
$this->view->projectTree = $this->project->tree();
|
||||
|
||||
@@ -452,10 +452,10 @@ class project extends control
|
||||
unset($this->config->bug->search['params']['resolvedBuild']);
|
||||
unset($this->config->bug->search['params']['resolvedDate']);
|
||||
unset($this->config->bug->search['params']['closedDate']);
|
||||
$this->loadModel('search')->setSearchParams($this->config->bug->search);
|
||||
|
||||
/* Assign. */
|
||||
$this->view->header = $header;
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->bug->search);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->recTotal = $pager->recTotal;
|
||||
@@ -1171,6 +1171,7 @@ class project extends control
|
||||
$this->config->product->search['queryID'] = $queryID;
|
||||
$this->config->product->search['params']['product']['values'] = $products + array('all' => $this->lang->product->allProductsOfProject);
|
||||
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts($products);
|
||||
$this->loadModel('search')->setSearchParams($this->config->product->search);
|
||||
|
||||
$header['title'] = $project->name . $this->lang->colon . $this->lang->project->linkStory;
|
||||
$position[] = html::a($browseLink, $project->name);
|
||||
@@ -1193,7 +1194,6 @@ class project extends control
|
||||
$this->view->allStories = $allStories;
|
||||
$this->view->prjStories = $prjStories;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->product->search);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ $(function(){
|
||||
$(".preview").colorbox({width:1000, height:700, iframe:true, transition:'elastic', speed:350, scrolling:true});
|
||||
})
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
var formUrl = '<?php echo $formUrl;?>';
|
||||
</script>
|
||||
<div id='querybox'></div>
|
||||
<div>
|
||||
|
||||
@@ -59,8 +59,5 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
<script type='text/javascript'>
|
||||
var formUrl = '<?php echo $formUrl?>';
|
||||
$(function(){ajaxGetSearchForm()});
|
||||
</script>
|
||||
<script type='text/javascript'>$(function(){ajaxGetSearchForm()});</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<?php include './taskheader.html.php';?>
|
||||
<script language='Javascript'>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
var formUrl = '<?php echo $formUrl?>';
|
||||
</script>
|
||||
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'></div>
|
||||
<table class='cont-lt1'>
|
||||
|
||||
@@ -22,11 +22,13 @@ class search extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildForm($module, $searchFields, $fieldParams, $actionURL, $queryID = 0)
|
||||
public function buildForm($module = '', $searchFields = '', $fieldParams = '', $actionURL = '', $queryID = 0)
|
||||
{
|
||||
$searchFields = is_array($searchFields) ? $searchFields : json_decode(helper::safe64Decode($searchFields), true);
|
||||
$fieldParams = is_array($fieldParams) ? $fieldParams : json_decode(helper::safe64Decode($fieldParams), true);
|
||||
$actionURL = (strpos($actionURL, '/') !== false) ? $actionURL : helper::safe64Decode($actionURL);
|
||||
$queryID = (empty($module) and empty($queryID)) ? $this->session->searchParams['queryID'] : $queryID;
|
||||
$module = empty($module) ? $this->session->searchParams['module'] : $module;
|
||||
$searchFields = empty($searchFields) ? json_decode($this->session->searchParams['searchFields'], true) : $searchFields;
|
||||
$fieldParams = empty($fieldParams) ? json_decode($this->session->searchParams['fieldParams'], true) : $fieldParams;
|
||||
$actionURL = empty($actionURL) ? $this->session->searchParams['actionURL'] : $actionURL;
|
||||
$this->search->initSession($module, $searchFields, $fieldParams);
|
||||
|
||||
$this->view->module = $module;
|
||||
|
||||
@@ -15,23 +15,20 @@ class searchModel extends model
|
||||
{
|
||||
|
||||
/**
|
||||
* Get search form URL.
|
||||
* Set search params to session.
|
||||
*
|
||||
* @param array $searchConfig
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getFormUrl($searchConfig)
|
||||
public function setSearchParams($searchConfig)
|
||||
{
|
||||
$module = $searchConfig['module'];
|
||||
$searchFields = $searchConfig['fields'];
|
||||
$fieldParams = $searchConfig['params'];
|
||||
$actionURL = $searchConfig['actionURL'];
|
||||
$queryID = isset($searchConfig['queryID']) ? $searchConfig['queryID'] : 0;
|
||||
$searchFields = helper::safe64Encode(json_encode($searchFields));
|
||||
$fieldParams = helper::safe64Encode(json_encode($fieldParams));
|
||||
$actionURL = helper::safe64Encode($actionURL);
|
||||
return helper::createLink('search', 'buildForm', "module=$module&searchFields=$searchFields&fieldParams=$fieldParams&actionURL=$actionURL&queryID=$queryID");
|
||||
$searchParams['module'] = $searchConfig['module'];
|
||||
$searchParams['searchFields'] = json_encode($searchConfig['fields']);
|
||||
$searchParams['fieldParams'] = json_encode($searchConfig['params']);
|
||||
$searchParams['actionURL'] = $searchConfig['actionURL'];
|
||||
$searchParams['queryID'] = isset($searchConfig['queryID']) ? $searchConfig['queryID'] : 0;
|
||||
$this->session->set('searchParams', $searchParams);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -127,6 +127,7 @@ class testcase extends control
|
||||
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
|
||||
$this->config->testcase->search['actionURL'] = $this->createLink('testcase', 'browse', "productID=$productID&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->testcase->search['queryID'] = $queryID;
|
||||
$this->loadModel('search')->setSearchParams($this->config->testcase->search);
|
||||
|
||||
/* Assign. */
|
||||
$this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
|
||||
@@ -141,7 +142,6 @@ class testcase extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->testcase->search);
|
||||
$this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden';
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<script language="Javascript">
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
var moduleID = '<?php echo $moduleID;?>';
|
||||
var formUrl = '<?php echo $formUrl;?>';
|
||||
</script>
|
||||
|
||||
<div id='featurebar'>
|
||||
|
||||
@@ -353,6 +353,7 @@ class testtask extends control
|
||||
$this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
|
||||
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
|
||||
$this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID");
|
||||
$this->loadModel('search')->setSearchParams($this->config->testcase->search);
|
||||
|
||||
/* Save session. */
|
||||
$this->testtask->setMenu($this->products, $productID);
|
||||
@@ -404,7 +405,6 @@ class testtask extends control
|
||||
$this->view->cases = $cases;
|
||||
$this->view->taskID = $taskID;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->formUrl = $this->loadModel('search')->getFormUrl($this->config->testcase->search);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -67,8 +67,5 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
<script type='text/javascript'>
|
||||
var formUrl = '<?php echo $formUrl?>';
|
||||
ajaxGetSearchForm();
|
||||
</script>
|
||||
<script type='text/javascript'>ajaxGetSearchForm();</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* Set the error reporting. */
|
||||
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
|
||||
error_reporting(0);
|
||||
/* Start output buffer. */
|
||||
ob_start();
|
||||
@@ -40,3 +41,9 @@ $app->loadModule();
|
||||
|
||||
/* Flush the buffer. */
|
||||
ob_end_flush();
|
||||
$data = xhprof_disable();
|
||||
include_once "xhprof_lib/utils/xhprof_lib.php";
|
||||
include_once "xhprof_lib/utils/xhprof_runs.php";
|
||||
$objXhprofRun = new XHProfRuns_Default();
|
||||
$run_id = $objXhprofRun->save_run($data, "xhprof");
|
||||
echo $run_id;
|
||||
|
||||
@@ -663,7 +663,7 @@ function ajaxGetSearchForm()
|
||||
{
|
||||
if($('#querybox').html() == '')
|
||||
{
|
||||
$.get(formUrl, function(data){
|
||||
$.get(createLink('search', 'buildForm'), function(data){
|
||||
$('#querybox').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user