From 288bfe5758b48a6aeea682334b3c7e86d798b626 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Thu, 25 Feb 2016 15:21:04 +0800 Subject: [PATCH] * finish task *2467. --- module/search/control.php | 15 ++++++++++++++- module/search/view/buildform.html.php | 11 +++++------ module/testtask/view/browse.html.php | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/module/search/control.php b/module/search/control.php index 5328f65aee..bc74ad3d15 100644 --- a/module/search/control.php +++ b/module/search/control.php @@ -78,6 +78,19 @@ class search extends control public function deleteQuery($queryID) { $this->dao->delete()->from(TABLE_USERQUERY)->where('id')->eq($queryID)->andWhere('account')->eq($this->app->user->account)->exec(); - die(js::reload('parent')); + $this->ajaxGetQuery(); + } + + /** + * Ajax get query. + * + * @access public + * @return void + */ + public function ajaxGetQuery() + { + $module = $this->session->searchParams['module']; + $queries = $this->search->getQueryPairs($module); + die(html::select('queryID', $queries, '', 'onchange=executeQuery(this.value) class=form-control')); } } diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index b0e0dbf829..4e20a46651 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -245,7 +245,7 @@ function saveQuery() saveQueryLink = createLink('search', 'saveQuery'); $.post(saveQueryLink, {title: r, module: module}, function(data) { - if(data == 'success') location.reload(); + if(data == 'success') $('#queryBox').load(createLink('search', 'ajaxGetQuery')); }); }); } @@ -273,7 +273,8 @@ function deleteQuery() { queryID = $('#queryID').val(); if(!queryID) return; - hiddenwin.location.href = createLink('search', 'deleteQuery', 'queryID=' + queryID); + deleteLink = createLink('search', 'deleteQuery', 'queryID=' + queryID); + $('#queryBox').load(deleteLink); } @@ -413,10 +414,8 @@ foreach($fieldParams as $fieldName => $param)
- " . html::a('javascript:deleteQuery()', '', '', 'class=btn') . ''; - ?> + + " . html::a('javascript:deleteQuery()', '', '', 'class=btn') . '';?>
diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php index b5e6e6f759..3ecaf58135 100644 --- a/module/testtask/view/browse.html.php +++ b/module/testtask/view/browse.html.php @@ -51,7 +51,7 @@ id", 'play', 'list', 'smile'); - common::printIcon('testtask', 'view', "taskID=$task->id", '', 'list', 'file'); + common::printIcon('testtask', 'view', "taskID=$task->id", '', 'list', 'file'); common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'list', 'link'); common::printIcon('testtask', 'edit', "taskID=$task->id", '', 'list');