From e3654eeb73fe790bc1691bff499bd41fb5d08bb0 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Tue, 15 Dec 2020 05:18:43 +0100 Subject: [PATCH] baculum: Fix problem with setting hourly schedule - reported by Elias Pereira --- .../protected/API/Class/BaculaSetting.php | 2 +- gui/baculum/protected/Web/Lang/en/messages.po | 3 --- gui/baculum/protected/Web/Lang/ja/messages.po | 3 --- gui/baculum/protected/Web/Lang/pl/messages.po | 3 --- gui/baculum/protected/Web/Lang/pt/messages.po | 3 --- gui/baculum/protected/Web/Lang/ru/messages.po | 3 --- .../Web/Portlets/DirectiveSchedule.php | 2 ++ .../Web/Portlets/DirectiveSchedule.tpl | 18 ------------------ 8 files changed, 3 insertions(+), 34 deletions(-) diff --git a/gui/baculum/protected/API/Class/BaculaSetting.php b/gui/baculum/protected/API/Class/BaculaSetting.php index 2a820cbfc..612a8e44f 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 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 da5911ca2..0c9b9691f 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 216ac2c00..a7c3a99b5 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); - -