Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
This commit is contained in:
commit
9291a9ff8f
@ -426,6 +426,11 @@ function verificationsAfterFieldChange (urlField, multiEdit, theType) {
|
||||
$thisInput.removeAttr('min');
|
||||
$thisInput.removeAttr('max');
|
||||
// @todo: put back attributes if corresponding function is deselected
|
||||
|
||||
if ($thisFunction.val() === 'NOW') {
|
||||
$thisInput.attr('min', 0);
|
||||
$thisInput.attr('max', $thisInput.parent().attr('data-decimals'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($thisInput.data('rulesadded') === null && ! functionSelected) {
|
||||
|
||||
@ -306,7 +306,7 @@ AJAX.registerOnload('table/select.js', function () {
|
||||
|
||||
// Get the operator.
|
||||
const operator = ($(this).val() as string);
|
||||
const $targetField = $(this).closest('tr').find('[name*="criteriaValues"]')
|
||||
const $targetField = $(this).closest('tr').find('[name*="criteriaValues"]');
|
||||
|
||||
$targetField.prop('disabled', opIsUnary(operator));
|
||||
$targetField.siblings('.ui-datepicker-trigger').eq(0).toggle(!opIsUnary(operator));
|
||||
|
||||
@ -24,6 +24,7 @@ use function htmlspecialchars;
|
||||
use function implode;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
use function is_numeric;
|
||||
use function is_string;
|
||||
use function json_encode;
|
||||
use function max;
|
||||
@ -44,7 +45,7 @@ use const PASSWORD_DEFAULT;
|
||||
|
||||
class InsertEdit
|
||||
{
|
||||
private const FUNC_OPTIONAL_PARAM = ['RAND', 'UNIX_TIMESTAMP'];
|
||||
private const FUNC_OPTIONAL_PARAM = ['NOW', 'RAND', 'UNIX_TIMESTAMP'];
|
||||
|
||||
private const FUNC_NO_PARAM = [
|
||||
'CONNECTION_ID',
|
||||
@ -1132,6 +1133,13 @@ class InsertEdit
|
||||
. $this->dbi->quoteString($editField->salt) . ')';
|
||||
}
|
||||
|
||||
if (
|
||||
$editField->function === 'NOW'
|
||||
&& (is_numeric($editField->value) && $editField->value >= 0 && $editField->value <= 6)
|
||||
) {
|
||||
return $editField->function . '(' . (int) $editField->value . ')';
|
||||
}
|
||||
|
||||
return $editField->function . '(' . $this->dbi->quoteString($editField->value) . ')';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user