mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch '6219_Comprobacion_paradas_planificadas' into 'develop'
Fixed problems in scheduled downtime CLI See merge request artica/pandorafms!1806
This commit is contained in:
commit
3c548f1c98
@ -99,7 +99,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…
x
Reference in New Issue
Block a user