From 7733b3a6313b7fb729e21f6b5bfcc1f164b73324 Mon Sep 17 00:00:00 2001 From: Sergey Davydov Date: Thu, 8 Feb 2018 16:07:14 +0300 Subject: [PATCH 1/3] =?UTF-8?q?[webix]=20[+]=20=D0=B2=D0=BE=D0=B7=D0=BC?= =?UTF-8?q?=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=83=D0=BA=D0=B0?= =?UTF-8?q?=D0=B7=D0=B0=D1=82=D1=8C=20=D0=BF=D0=BE=D0=BB=D1=8F=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BF=D0=BE=20=D1=82=D0=BE=D1=87=D0=BD=D0=BE?= =?UTF-8?q?=D0=BC=D1=83=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/modules/webixtable/action.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/modules/webixtable/action.php b/assets/modules/webixtable/action.php index a87f42f..b6b1902 100644 --- a/assets/modules/webixtable/action.php +++ b/assets/modules/webixtable/action.php @@ -28,6 +28,7 @@ $fields_names = isset($fields_names) ? explode(',', str_replace(', ', ',', trim($fields_names))) : false; $table = isset($table) ? trim($table) : false; $display = isset($display) && (int)$display > 0 ? (int)$display : 10; +$filterEq = isset($filterEq) ? explode(',', str_replace(', ', ',', trim($filterEq))) : false; //$modx->logEvent(1,1,json_encode($_REQUEST),'REQUEST'); @@ -107,7 +108,10 @@ $tmp = array(); foreach ($fields as $field) { if (isset($_REQUEST['filter'][$field]) && !empty($_REQUEST['filter'][$field]) && $_REQUEST['filter'][$field] != "") { - $tmp[] = "`" . $field . "` LIKE '%" . $modx->db->escape($_REQUEST['filter'][$field]) . "%'"; + if (in_array($field,$filterEq)) + $tmp[] = "`" . $field . "` = '" . $modx->db->escape($_REQUEST['filter'][$field]) . "'"; + else + $tmp[] = "`" . $field . "` LIKE '%" . $modx->db->escape($_REQUEST['filter'][$field]) . "%'"; } } if (!empty($tmp)) { From 46c5f20870bd7b4f08df1f6eb57040bf01b25497 Mon Sep 17 00:00:00 2001 From: Sergey Davydov Date: Thu, 8 Feb 2018 16:19:49 +0300 Subject: [PATCH 2/3] [webix] fix "0" filtering --- assets/modules/webixtable/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/modules/webixtable/action.php b/assets/modules/webixtable/action.php index b6b1902..f2f4c6b 100644 --- a/assets/modules/webixtable/action.php +++ b/assets/modules/webixtable/action.php @@ -107,7 +107,7 @@ if (isset($_REQUEST['filter'])) { $tmp = array(); foreach ($fields as $field) { - if (isset($_REQUEST['filter'][$field]) && !empty($_REQUEST['filter'][$field]) && $_REQUEST['filter'][$field] != "") { + if (isset($_REQUEST['filter'][$field]) && $_REQUEST['filter'][$field] != "") { if (in_array($field,$filterEq)) $tmp[] = "`" . $field . "` = '" . $modx->db->escape($_REQUEST['filter'][$field]) . "'"; else From 5a0f0bda20025849fc181564e99712e2c33c6ede Mon Sep 17 00:00:00 2001 From: Sergey Davydov Date: Mon, 12 Feb 2018 14:33:15 +0300 Subject: [PATCH 3/3] [webix] allow eq filter setting --- install/assets/modules/module.webixtable.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/modules/module.webixtable.tpl b/install/assets/modules/module.webixtable.tpl index 2620d07..23a192b 100644 --- a/install/assets/modules/module.webixtable.tpl +++ b/install/assets/modules/module.webixtable.tpl @@ -9,7 +9,7 @@ * @version 0.1 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @guid webixtable - * @internal @properties &name=Заголовок модуля;text;&fields=Поля в таблице БД (comma separated);text;&fields_for_popup_editor=Поля, для которых нужно popup-редактирование;text;&fields_names=Названия колонок полей БД в модуле (comma separated);text;&idField=Уник.поле в БД;text;id&table=Имя таблицы в БД;text;&display=Показывать по;text;10&tpl=Имя шаблона (без .tpl);text;main&inline_edit=Inline-редактирование;text;1&modal_edit=Modal-редактирование;text;0 + * @internal @properties &name=Заголовок модуля;text;&fields=Поля в таблице БД (comma separated);text;&fields_for_popup_editor=Поля, для которых нужно popup-редактирование;text;&fields_names=Названия колонок полей БД в модуле (comma separated);text;&idField=Уник.поле в БД;text;id&table=Имя таблицы в БД;text;&display=Показывать по;text;10&tpl=Имя шаблона (без .tpl);text;main&inline_edit=Inline-редактирование;text;1&modal_edit=Modal-редактирование;text;0&filterEq=Фильтр полей по точному соответствию;text; * @internal @modx_category Manager and Admin * @internal @installset base, sample */