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;
|
||||
default:
|
||||
returnData("string",
|
||||
array('type' => 'string', 'data' => __($typeError)));
|
||||
array('type' => 'string', 'data' => __($returnType)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -666,6 +666,7 @@ function planned_downtimes_stop ($downtime) {
|
|||
function planned_downtimes_created ($values) {
|
||||
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']);
|
||||
|
||||
$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') . ". "
|
||||
. __('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 {
|
||||
if (trim(io_safe_output($values['name'])) != '') {
|
||||
if (!$check) {
|
||||
|
|
Loading…
Reference in New Issue