Fixed problems in scheduled downtime CLI
This commit is contained in:
parent
010207e6ad
commit
cc5104024d
|
@ -100,7 +100,7 @@ function returnError($typeError, $returnType = 'string') {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
returnData("string",
|
returnData("string",
|
||||||
array('type' => 'string', 'data' => __($typeError)));
|
array('type' => 'string', 'data' => __($returnType)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -666,6 +666,7 @@ function planned_downtimes_stop ($downtime) {
|
||||||
function planned_downtimes_created ($values) {
|
function planned_downtimes_created ($values) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
$check_group = (bool) db_get_value ('id_grupo', 'tgrupo', 'id_grupo', $values['id_group']);
|
||||||
$check = (bool) db_get_value ('name', 'tplanned_downtime', 'name', $values['name']);
|
$check = (bool) db_get_value ('name', 'tplanned_downtime', 'name', $values['name']);
|
||||||
|
|
||||||
$datetime_from = strtotime ($values['once_date_from'] . ' ' . $values['once_time_from']);
|
$datetime_from = strtotime ($values['once_date_from'] . ' ' . $values['once_time_from']);
|
||||||
|
@ -702,6 +703,11 @@ function planned_downtimes_created ($values) {
|
||||||
'message' => __('Not created. Error inserting data') . ". "
|
'message' => __('Not created. Error inserting data') . ". "
|
||||||
. __('The end day must be higher than the start day'));
|
. __('The end day must be higher than the start day'));
|
||||||
}
|
}
|
||||||
|
else if (!$check_group && $values['id_group'] != 0) {
|
||||||
|
return array('return' => false,
|
||||||
|
'message' => __('Not created. Error inserting data') . ". "
|
||||||
|
. __('Group not exist'));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (trim(io_safe_output($values['name'])) != '') {
|
if (trim(io_safe_output($values['name'])) != '') {
|
||||||
if (!$check) {
|
if (!$check) {
|
||||||
|
|
Loading…
Reference in New Issue