]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix #2558 saving day or day range in schedule resource - reported by Jose...
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 9 Aug 2020 17:41:09 +0000 (19:41 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 9 Aug 2020 17:41:50 +0000 (19:41 +0200)
gui/baculum/protected/API/Class/BaculaSetting.php
gui/baculum/protected/Web/Portlets/DirectiveSchedule.php

index 650caedd44812a264a1db876974a7a9470594fa7..22eb9bc7e2bc94db0dde639ef472e4ff9d0c2462 100644 (file)
@@ -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) {
index 76ca7f13905c7d7cad46e710fe1b6cede5f72204..60eed26af690ef861151a218ad8f3d97c5d35022 100644 (file)
@@ -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;
                        }