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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3772a4548a38025f4b8734c004fa740c50ad8227;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 22eb9bc7e..0c7296927 100644 --- a/gui/baculum/protected/API/Class/BaculaSetting.php +++ b/gui/baculum/protected/API/Class/BaculaSetting.php @@ -327,7 +327,7 @@ class BaculaSetting extends APIModule { } $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 cf77eb21b..2873ea5f4 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 b5b0730de..168466d68 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 aba90d09d..6eb1629e8 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 e1453ce1b..525dc3fe5 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 bc56ae3ea..bd4c92a75 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 60eed26af..0d0f95369 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php +++ b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php @@ -471,6 +471,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['Run'][] = implode(' ', $directive_values); $objs[] = $obj; diff --git a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl index c61701980..ee63af37e 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl +++ b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl @@ -424,24 +424,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); - -