From 4ef2b08f0918f723f5f92bac36f5ab92cc95d314 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 2 Dec 2015 17:08:42 +0100 Subject: [PATCH] Change form of send dates in planned downtimes --- pandora_console/include/functions_api.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index a23e1952c2..073159f269 100755 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -3798,12 +3798,12 @@ function api_set_tag($id, $thrash1, $other, $thrash3) { * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) * example: * - * api.php?op=set&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=json + * api.php?op=get&op2=all_planned_downtimes&other=test|0|quiet|periodically|weekly&other_mode=url_encode_separator_|&return_type=json * * @param type of return json or csv. */ -function api_get_all_planned_downtimes ($thrash1, $thrash2, $other, $returnType) { +function api_get_all_planned_downtimes ($thrash1, $thrash2, $other, $returnType = 'json') { if (defined ('METACONSOLE')) { return; } @@ -3899,7 +3899,7 @@ function api_set_planned_downtimes_deleted ($id, $thrash1, $thrash2, $returnType * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) * example: * - * api.php?op=set&op2=planned_downtimes_created&id=pepito&other=testing|1448035508|1448039108|0|1|1|1|1|1|1|1|17:06:00|19:06:00|1|31|quiet|periodically|weekly&other_mode=url_encode_separator_| + * api.php?op=set&op2=planned_downtimes_created&id=pepito&other=testing|08-22-2015|08-31-2015|0|1|1|1|1|1|1|1|17:06:00|19:06:00|1|31|quiet|periodically|weekly&other_mode=url_encode_separator_| * * @param $thrash3 Don't use. */ @@ -3909,13 +3909,17 @@ function api_set_planned_downtimes_created ($id, $thrash1, $other, $thrash3) { return; } + + $date_from = strtotime($other['data'][1]); + $date_to = strtotime($other['data'][2]); + $values = array(); $values['name'] = $id; $values = array( 'name' => $id, 'description' => $other['data'][0], - 'date_from' => $other['data'][1], - 'date_to' => $other['data'][2], + 'datetime_from' => $date_from, + 'datetime_to' => $date_to, 'id_group' => $other['data'][3], 'monday' => $other['data'][4], 'tuesday' => $other['data'][5],