From: Marcin Haba Date: Tue, 15 Dec 2020 04:18:43 +0000 (+0100) Subject: baculum: Fix problem with setting hourly schedule - reported by Elias Pereira X-Git-Tag: Release-11.3.2~942 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3654eeb73fe790bc1691bff499bd41fb5d08bb0;p=thirdparty%2Fbacula.git baculum: Fix problem with setting hourly schedule - reported by Elias Pereira --- diff --git a/gui/baculum/protected/API/Class/BaculaSetting.php b/gui/baculum/protected/API/Class/BaculaSetting.php index 2a820cbfcd..612a8e44ff 100644 --- a/gui/baculum/protected/API/Class/BaculaSetting.php +++ b/gui/baculum/protected/API/Class/BaculaSetting.php @@ -324,7 +324,7 @@ class BaculaSetting extends APIModule { $wday = Params::getWdaysConfig($directive_value[$i]['DayOfWeek']); $value = array($overwrite_directive, $month, $week, $day, $wday); $hour_len = count($directive_value[$i]['Hour']); - if ($hour_len == 24 && $min != 0) { + if ($hour_len == 24) { $value[] = 'hourly'; } if ($hour_len == 1 || ($hour_len == 24 && $min != 0)) { diff --git a/gui/baculum/protected/Web/Lang/en/messages.po b/gui/baculum/protected/Web/Lang/en/messages.po index cf77eb21b9..2873ea5f4f 100644 --- a/gui/baculum/protected/Web/Lang/en/messages.po +++ b/gui/baculum/protected/Web/Lang/en/messages.po @@ -2399,9 +2399,6 @@ msgstr "Hour and minute" msgid "Validation error" msgstr "Validation error" -msgid "Please choose at least month or week or day of week or hour in Run block" -msgstr "Please choose at least month or week or day of week or hour in Run block" - msgid "Please select month in Run block" msgstr "Please select month in Run block" diff --git a/gui/baculum/protected/Web/Lang/ja/messages.po b/gui/baculum/protected/Web/Lang/ja/messages.po index b5b0730de5..168466d68d 100644 --- a/gui/baculum/protected/Web/Lang/ja/messages.po +++ b/gui/baculum/protected/Web/Lang/ja/messages.po @@ -2485,9 +2485,6 @@ msgstr "Hour and minute" msgid "Validation error" msgstr "Validation error" -msgid "Please choose at least month or week or day of week or hour in Run block" -msgstr "Please choose at least month or week or day of week or hour in Run block" - msgid "Please select month in Run block" msgstr "Please select month in Run block" diff --git a/gui/baculum/protected/Web/Lang/pl/messages.po b/gui/baculum/protected/Web/Lang/pl/messages.po index aba90d09d1..6eb1629e87 100644 --- a/gui/baculum/protected/Web/Lang/pl/messages.po +++ b/gui/baculum/protected/Web/Lang/pl/messages.po @@ -2409,9 +2409,6 @@ msgstr "Godzina i minuta" msgid "Validation error" msgstr "Błąd walidacji" -msgid "Please choose at least month or week or day of week or hour in Run block" -msgstr "Proszę wybrać co najmniej miesiąc lub tydzień lub dzień tygodnia lub godzinę w bloku Uruchom" - msgid "Please select month in Run block" msgstr "Proszę wybrać miesiąc w bloku Uruchom" diff --git a/gui/baculum/protected/Web/Lang/pt/messages.po b/gui/baculum/protected/Web/Lang/pt/messages.po index e1453ce1bb..525dc3fe59 100644 --- a/gui/baculum/protected/Web/Lang/pt/messages.po +++ b/gui/baculum/protected/Web/Lang/pt/messages.po @@ -2409,9 +2409,6 @@ msgstr "Hora e minuto" msgid "Validation error" msgstr "Erro de validação" -msgid "Please choose at least month or week or day of week or hour in Run block" -msgstr "Por favor selecione pelo menos o mês ou semana ou dia da semana ou hora no bloco Executar" - msgid "Please select month in Run block" msgstr "Selecione o mês no bloco Executar" diff --git a/gui/baculum/protected/Web/Lang/ru/messages.po b/gui/baculum/protected/Web/Lang/ru/messages.po index bc56ae3eac..bd4c92a75d 100644 --- a/gui/baculum/protected/Web/Lang/ru/messages.po +++ b/gui/baculum/protected/Web/Lang/ru/messages.po @@ -2409,9 +2409,6 @@ msgstr "Часы и минуты" msgid "Validation error" msgstr "Ошибка проверки" -msgid "Please choose at least month or week or day of week or hour in Run block" -msgstr "Пожалуйста, выберите хотя бы месяц или неделю или день недели или час в блоке \"Выполнить\"" - msgid "Please select month in Run block" msgstr "Пожалуйста, выберите месяц в блоке \"Выполнить\"" diff --git a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php index da5911ca23..0c9b9691ff 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php +++ b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php @@ -516,6 +516,8 @@ class DirectiveSchedule extends DirectiveListTemplate { $directive_values[] = "hourly at {$hour}:{$minute}"; $obj->Hour = range(0, 23); $obj->Minute = $value->TimeMinHourly->getDirectiveValue(); + } else { + $directive_values[] = 'hourly'; } $values[$directive_name][] = implode(' ', $directive_values); $objs[] = $obj; diff --git a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl index 216ac2c00b..a7c3a99b54 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl +++ b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl @@ -427,24 +427,6 @@ - - - var m = ($('#<%=$this->MonthSingle->ClientID%>').prop('checked') && $('#<%=$this->Month->ClientID%>_Directive').val()); - var m_r = ($('#<%=$this->MonthRange->ClientID%>').prop('checked') && $('#<%=$this->MonthRangeFrom->ClientID%>_Directive').val() && $('#<%=$this->MonthRangeTo->ClientID%>_Directive').val()); - var w = ($('#<%=$this->WeekSingle->ClientID%>').prop('checked') && $('#<%=$this->Week->ClientID%>_Directive').val()); - var w_r = ($('#<%=$this->WeekRange->ClientID%>').prop('checked') && $('#<%=$this->WeekRangeFrom->ClientID%>_Directive').val() && $('#<%=$this->WeekRangeTo->ClientID%>_Directive').val()); - var wd = ($('#<%=$this->WdaySingle->ClientID%>').prop('checked') && $('#<%=$this->Wday->ClientID%>_Directive').val()); - var wd_r = ($('#<%=$this->WdayRange->ClientID%>').prop('checked') && $('#<%=$this->WdayRangeFrom->ClientID%>_Directive').val() && $('#<%=$this->WdayRangeTo->ClientID%>_Directive').val()); - var t = ($('#<%=$this->TimeAt->ClientID%>').prop('checked') && $('#<%=$this->TimeHourAt->ClientID%>_Directive').val() && $('#<%=$this->TimeMinAt->ClientID%>_Directive').val()); - var t_h = ($('#<%=$this->TimeHourly->ClientID%>').prop('checked') && $('#<%=$this->TimeMinHourly->ClientID%>_Directive').val()); - sender.enabled = (!t && !t_h && !m && !m_r && !w && !w_r && !wd && !wd_r); - -