Skip to content
Snippets Groups Projects
Verified Commit 0d97e866 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #251 define 0 in delay input

parent 78f494a0
No related branches found
No related tags found
No related merge requests found
...@@ -362,19 +362,16 @@ class DoctypeController ...@@ -362,19 +362,16 @@ class DoctypeController
!Validator::intVal()->validate($aArgs['doctypes_second_level_id'])) { !Validator::intVal()->validate($aArgs['doctypes_second_level_id'])) {
$errors[]= 'Invalid doctypes_second_level_id value'; $errors[]= 'Invalid doctypes_second_level_id value';
} }
if (!Validator::notEmpty()->validate($aArgs['process_delay']) || if (!Validator::notEmpty()->validate($aArgs['process_delay']) &&
!Validator::intVal()->validate($aArgs['process_delay']) || (!Validator::intVal()->validate($aArgs['process_delay']) || $aArgs['process_delay'] < 0)) {
$aArgs['process_delay'] < 0) {
$errors[]= 'Invalid process_delay value'; $errors[]= 'Invalid process_delay value';
} }
if (!Validator::notEmpty()->validate($aArgs['delay1']) || if (!Validator::notEmpty()->validate($aArgs['delay1']) &&
!Validator::intVal()->validate($aArgs['delay1']) || (!Validator::intVal()->validate($aArgs['delay1']) || $aArgs['delay1'] < 0)) {
$aArgs['delay1'] < 0) {
$errors[]= 'Invalid delay1 value'; $errors[]= 'Invalid delay1 value';
} }
if (!Validator::notEmpty()->validate($aArgs['delay2']) || if (!Validator::notEmpty()->validate($aArgs['delay2']) &&
!Validator::intVal()->validate($aArgs['delay2']) || (!Validator::intVal()->validate($aArgs['delay2']) || $aArgs['delay2'] < 0)) {
$aArgs['delay2'] < 0) {
$errors[]= 'Invalid delay2 value'; $errors[]= 'Invalid delay2 value';
} }
if (Validator::notEmpty()->validate($aArgs['duration_current_use']) && if (Validator::notEmpty()->validate($aArgs['duration_current_use']) &&
......
...@@ -42,8 +42,8 @@ class DoctypeExtModelAbstract ...@@ -42,8 +42,8 @@ class DoctypeExtModelAbstract
public static function create(array $aArgs) public static function create(array $aArgs)
{ {
ValidatorModel::notEmpty($aArgs, ['type_id', 'process_delay', 'delay1', 'delay2', 'process_mode']); ValidatorModel::notEmpty($aArgs, ['type_id', 'process_mode']);
ValidatorModel::intVal($aArgs, ['type_id', 'process_delay', 'delay1', 'delay2']); ValidatorModel::intVal($aArgs, ['type_id']);
DatabaseModel::insert([ DatabaseModel::insert([
'table' => 'mlb_doctype_ext', 'table' => 'mlb_doctype_ext',
...@@ -55,8 +55,8 @@ class DoctypeExtModelAbstract ...@@ -55,8 +55,8 @@ class DoctypeExtModelAbstract
public static function update(array $aArgs) public static function update(array $aArgs)
{ {
ValidatorModel::notEmpty($aArgs, ['type_id', 'process_delay', 'delay1', 'delay2', 'process_mode']); ValidatorModel::notEmpty($aArgs, ['type_id', 'process_mode']);
ValidatorModel::intVal($aArgs, ['type_id', 'process_delay', 'delay1', 'delay2']); ValidatorModel::intVal($aArgs, ['type_id']);
DatabaseModel::update([ DatabaseModel::update([
'table' => 'mlb_doctype_ext', 'table' => 'mlb_doctype_ext',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment