mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
#12789 fixed regex in event table
This commit is contained in:
parent
a4b1ccb4e6
commit
f01902903c
@ -1,3 +1,5 @@
|
||||
/* global $ */
|
||||
|
||||
var dt = dt;
|
||||
var config = config;
|
||||
|
||||
@ -141,6 +143,8 @@ if (dt.no_move_elements_to_action === true) {
|
||||
noMoveElementsToAction = true;
|
||||
}
|
||||
|
||||
var showAlwaysPagination = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
function checkPages() {
|
||||
if (dt_table.page.info().pages > 1) {
|
||||
@ -253,7 +257,11 @@ $(document).ready(function() {
|
||||
$("div.pagination-child-div").hide();
|
||||
$("div.dataTables_info").hide();
|
||||
$(`#${dt.id}_wrapper`).hide();
|
||||
if (showAlwaysPagination) {
|
||||
$(`.action_buttons_right_content .pagination-child-div`).show();
|
||||
} else {
|
||||
$(`.action_buttons_right_content .pagination-child-div`).hide();
|
||||
}
|
||||
} else {
|
||||
$(`.datatable-msg-info-${dt.id}`).hide();
|
||||
$(`table#${dt.id}`).show();
|
||||
@ -283,6 +291,12 @@ $(document).ready(function() {
|
||||
$(`#${dt.form_id}_loading`).remove();
|
||||
}
|
||||
|
||||
if (json.showAlwaysPagination) {
|
||||
showAlwaysPagination = true;
|
||||
} else {
|
||||
showAlwaysPagination = false;
|
||||
}
|
||||
|
||||
if (json.error) {
|
||||
console.error(json.error);
|
||||
$(`#error-${dt.id}`).html(json.error);
|
||||
|
@ -1229,26 +1229,28 @@ if (is_ajax() === true) {
|
||||
}
|
||||
}
|
||||
|
||||
$no_return = false;
|
||||
if (empty($tmp) === false && $regex !== '') {
|
||||
$regex_validation = false;
|
||||
if (empty($tmp) === false && $regex !== '') {
|
||||
foreach (json_decode(json_encode($tmp), true) as $key => $field) {
|
||||
if ($key === 'b64') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$field = strip_tags($field);
|
||||
|
||||
if (preg_match('/'.$regex.'/', $field)) {
|
||||
$regex_validation = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($regex_validation === false) {
|
||||
$no_return = true;
|
||||
if ($regex_validation === true) {
|
||||
$carry[] = $tmp;
|
||||
}
|
||||
} else {
|
||||
$carry[] = $tmp;
|
||||
}
|
||||
|
||||
if ($no_return === false) {
|
||||
$carry[] = $tmp;
|
||||
return $carry;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1260,6 +1262,7 @@ if (is_ajax() === true) {
|
||||
'buffers' => $buffers,
|
||||
'recordsTotal' => $count,
|
||||
'recordsFiltered' => $count,
|
||||
'showAlwaysPagination' => (empty($regex) === false) ? true : false,
|
||||
]
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user