From: Marcin Haba Date: Sun, 9 Aug 2020 17:41:09 +0000 (+0200) Subject: baculum: Fix #2558 saving day or day range in schedule resource - reported by Jose... X-Git-Tag: Release-9.6.6~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8444ed5f44f746c315836edfdb68bf26b9484a5c;p=thirdparty%2Fbacula.git baculum: Fix #2558 saving day or day range in schedule resource - reported by Jose Alberto --- diff --git a/gui/baculum/protected/API/Class/BaculaSetting.php b/gui/baculum/protected/API/Class/BaculaSetting.php index 650caedd4..22eb9bc7e 100644 --- a/gui/baculum/protected/API/Class/BaculaSetting.php +++ b/gui/baculum/protected/API/Class/BaculaSetting.php @@ -322,6 +322,9 @@ class BaculaSetting extends APIModule { $month = Params::getMonthsConfig($directive_value[$i]['Month']); $week = Params::getWeeksConfig($directive_value[$i]['WeekOfMonth']); $wday = Params::getWdaysConfig($directive_value[$i]['DayOfWeek']); + if (!empty($day)) { + $day = 'on ' . $day; + } $value = array($overwrite_directive, $month, $week, $day, $wday); $hour_len = count($directive_value[$i]['Hour']); if ($hour_len == 24 && $min != 0) { diff --git a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php index 76ca7f139..60eed26af 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php +++ b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php @@ -432,13 +432,13 @@ class DirectiveSchedule extends DirectiveListTemplate { $obj->Day = range(0, 30); if ($value->DaySingle->Checked === true) { $day = $value->Day->getDirectiveValue(); - $directive_values[] = $day; + $directive_values[] = 'on ' . $day; $obj->Day = array($day-1); } elseif ($value->DayRange->Checked === true) { $from = $value->DayRangeFrom->getDirectiveValue()-1; $to = $value->DayRangeTo->getDirectiveValue()-1; $day_range = range($from, $to); - $directive_values[] = Params::getDaysConfig($day_range); + $directive_values[] = 'on ' . Params::getDaysConfig($day_range); $obj->Day = $day_range; }