diff --git a/Layout/default/AddressDB/Index.php b/Layout/default/AddressDB/Index.php index 733275147..6ce026e4f 100644 --- a/Layout/default/AddressDB/Index.php +++ b/Layout/default/AddressDB/Index.php @@ -125,7 +125,7 @@
diff --git a/application/AddressDB/AddressDBController.php b/application/AddressDB/AddressDBController.php index bd7346501..b4702e362 100644 --- a/application/AddressDB/AddressDBController.php +++ b/application/AddressDB/AddressDBController.php @@ -18,14 +18,22 @@ class AddressDBController extends mfBaseController { protected function indexAction() { $this->layout()->setTemplate("AddressDB/Index"); - $rfilter = $this->request->filter; - iF(!is_array($rfilter)) { - $rfilter = []; + if($this->request->resetFilter) { + unset($_SESSION[MFAPPNAME.'-AddressDB-filter']); } - $this->layout->set("filter", $rfilter); - - $filter = $this->getPreparedFilter($rfilter); + $filter = []; + if(is_array($this->request->filter)) { + $filter = $this->request->filter; + $_SESSION[MFAPPNAME.'-AddressDB-filter'] = $filter; + } else { + if(array_key_exists(MFAPPNAME.'-AddressDB-filter', $_SESSION) && count($_SESSION[MFAPPNAME.'-AddressDB-filter'])) { + $filter = $_SESSION[MFAPPNAME.'-AddressDB-filter']; + } + } + + $this->layout->set("filter", $filter); + $filter = $this->getPreparedFilter($filter); // pagination defaults $pagination = []; @@ -118,7 +126,7 @@ class AddressDBController extends mfBaseController { } if(array_key_exists("oaid", $filter) && $filter['oaid']) { - $new_filter['oaid%'] = $filter['oaid']; + $new_filter['oaid%'] = "%".$filter['oaid']; unset($filter['oaid']); } diff --git a/application/Preordernotification/PreordernotificationModel.php b/application/Preordernotification/PreordernotificationModel.php index 4334ada32..acc2e5af0 100644 --- a/application/Preordernotification/PreordernotificationModel.php +++ b/application/Preordernotification/PreordernotificationModel.php @@ -160,14 +160,14 @@ class PreordernotificationModel { } if(array_key_exists("send_finish", $filter)) { - $send_finish = $db->escape($filter['send_finish']); + $send_finish = $filter['send_finish']; if($send_finish === null) { $where .= " AND Preordernotification.send_finish = NULL"; } } if(array_key_exists("send_lock", $filter)) { - $send_lock = $db->escape($filter['send_lock']); + $send_lock = $filter['send_lock']; if($send_lock === null) { $where .= " AND Preordernotification.send_lock = NULL"; } diff --git a/scripts/send_preordernotifications.php b/scripts/send_preordernotifications.php old mode 100644 new mode 100755