Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions assets/modules/webixtable/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -106,8 +107,11 @@
if (isset($_REQUEST['filter'])) {
$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 (isset($_REQUEST['filter'][$field]) && $_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)) {
Expand Down
2 changes: 1 addition & 1 deletion install/assets/modules/module.webixtable.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down