From 6c6ff205cf80240573644db297974cd10252489d Mon Sep 17 00:00:00 2001 From: wangxiaomeng Date: Mon, 18 Apr 2022 14:52:18 +0800 Subject: [PATCH 1/6] fixbug_#21650,21773. --- module/search/model.php | 14 ++++++++++++++ module/search/view/buildform.html.php | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/module/search/model.php b/module/search/model.php index 09aff5165d..fa67677d55 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -357,6 +357,20 @@ class searchModel extends model return $query; } + /** + * Get a query. + * + * @param int $queryID + * @access public + * @return string + */ + public function getById() + { + $query = $this->dao->findByID($queryID)->from(TABLE_USERQUERY)->fetch(); + if(!$query) return false; + return $query; + } + /** * Save current query to db. * diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index 4b1efa682f..538d356e77 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -228,7 +228,7 @@ foreach($fieldParams as $fieldName => $param) @@ -363,7 +363,9 @@ $(function() var setDateField = function(query, fieldNO) { var $period = $('#selectPeriod'); - if($period.length) $period.remove(); + + // bug #21650 + // if($period.length) $period.remove(); "; From 82a5ef9a66cf5abcf9ee88a7c83ba71e025a95ab Mon Sep 17 00:00:00 2001 From: wangxiaomeng Date: Mon, 18 Apr 2022 14:56:48 +0800 Subject: [PATCH 2/6] fix_bug_#21773. --- module/search/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/search/model.php b/module/search/model.php index fa67677d55..b76528636a 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -364,7 +364,7 @@ class searchModel extends model * @access public * @return string */ - public function getById() + public function getById($queryID) { $query = $this->dao->findByID($queryID)->from(TABLE_USERQUERY)->fetch(); if(!$query) return false; From 230851d9031629b0de0d7254880a73431a7da96d Mon Sep 17 00:00:00 2001 From: wangxiaomeng Date: Mon, 18 Apr 2022 15:16:01 +0800 Subject: [PATCH 3/6] fix_bug_#21773 --- module/search/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/search/model.php b/module/search/model.php index b76528636a..de3a5b243f 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -334,7 +334,7 @@ class searchModel extends model * * @param int $queryID * @access public - * @return string + * @return object */ public function getQuery($queryID) { @@ -362,7 +362,7 @@ class searchModel extends model * * @param int $queryID * @access public - * @return string + * @return object */ public function getById($queryID) { From c18bceef35f52917403c6e9cbdf04c8a7694a6b6 Mon Sep 17 00:00:00 2001 From: wangxiaomeng Date: Tue, 19 Apr 2022 08:17:54 +0800 Subject: [PATCH 4/6] Hidden Comment --- module/search/view/buildform.html.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index 538d356e77..fcc3dfe595 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -364,9 +364,6 @@ $(function() { var $period = $('#selectPeriod'); - // bug #21650 - // if($period.length) $period.remove(); - "; $selectPeriod .= ""; From 821413f1c4e920fe5075e47c0a56d2a5d55a7dc4 Mon Sep 17 00:00:00 2001 From: wangxiaomeng Date: Wed, 20 Apr 2022 09:10:03 +0800 Subject: [PATCH 5/6] fixbug_21650 edit getByID. --- module/search/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/search/model.php b/module/search/model.php index de3a5b243f..bf03bc7b3b 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -364,7 +364,7 @@ class searchModel extends model * @access public * @return object */ - public function getById($queryID) + public function getByID($queryID) { $query = $this->dao->findByID($queryID)->from(TABLE_USERQUERY)->fetch(); if(!$query) return false; From b635d1bf59f27de0114a5026e862df9a669e358c Mon Sep 17 00:00:00 2001 From: wangxiaomeng Date: Wed, 20 Apr 2022 15:55:24 +0800 Subject: [PATCH 6/6] fixbug_21650 edit getByID. --- module/search/view/buildform.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index fcc3dfe595..1b08d8b61a 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -228,7 +228,7 @@ foreach($fieldParams as $fieldName => $param)
    $queryName):?> - search->getById($queryID);?> + search->getByID($queryID);?>
  • app->user->account == $query->account) ? '' : ''), '', "class='label user-query' data-query-id='$queryID' title='{$queryName}'");?>