]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Miscellaneous improvements to schedule configuration
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 3 Nov 2019 10:01:42 +0000 (11:01 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 14 Dec 2019 14:59:52 +0000 (15:59 +0100)
 - add capability to remove schedule resource Run blocks
 - visual improvements (including support for mobile devices)
 - disable WritePartAfterJob setting in schedule run directive
 - fix support for sixth week
 - improve labels to setup month, week, day, day of week, hour and minute
 - add required fields validation

13 files changed:
gui/baculum/protected/API/Class/BaculaSetting.php
gui/baculum/protected/Common/Class/Params.php
gui/baculum/protected/Web/Lang/en/messages.mo
gui/baculum/protected/Web/Lang/en/messages.po
gui/baculum/protected/Web/Lang/ja/messages.mo
gui/baculum/protected/Web/Lang/ja/messages.po
gui/baculum/protected/Web/Lang/pl/messages.mo
gui/baculum/protected/Web/Lang/pl/messages.po
gui/baculum/protected/Web/Lang/pt/messages.mo
gui/baculum/protected/Web/Lang/pt/messages.po
gui/baculum/protected/Web/Portlets/DirectiveSchedule.php
gui/baculum/protected/Web/Portlets/DirectiveSchedule.tpl
gui/baculum/themes/Baculum-v2/css/baculum.css

index 9d2a6e8c39ad75c0904900cb926131b7f5bb4c04..c8ca53bfee33df632cd063cc671e8cf36d54d34e 100644 (file)
@@ -306,22 +306,29 @@ class BaculaSetting extends APIModule {
                                                                $overwrite_directive = implode(' ', array_filter($overwrite_directive));
                                                                $hour = $directive_value[$i]['Hour'][0];
                                                                $hourly = '';
-                                                               if (count($directive_value[$i]['Hour']) === 24) {
-                                                                       $hourly = 'hourly';
-                                                               }
+                                                               $min = 0;
                                                                $minute = '00';
                                                                /**
                                                                 * Check if Minute key exists because of bug about missing Minute
                                                                 * @see http://bugs.bacula.org/view.php?id=2318
                                                                 */
                                                                if (array_key_exists('Minute', $directive_value[$i])) {
-                                                                       $minute = sprintf('%02d', $directive_value[$i]['Minute']);
+                                                                       $min = $directive_value[$i]['Minute'];
+                                                                       $minute = sprintf('%02d', $min);
                                                                }
                                                                $day = Params::getDaysConfig($directive_value[$i]['Day']);
                                                                $month = Params::getMonthsConfig($directive_value[$i]['Month']);
                                                                $week = Params::getWeeksConfig($directive_value[$i]['WeekOfMonth']);
                                                                $wday = Params::getWdaysConfig($directive_value[$i]['DayOfWeek']);
-                                                               $value = array($overwrite_directive, $month, $week, $day, $wday, $hourly, 'at', "$hour:$minute");
+                                                               $value = array($overwrite_directive, $month, $week, $day, $wday);
+                                                               $hour_len = count($directive_value[$i]['Hour']);
+                                                               if ($hour_len == 24 && $min != 0) {
+                                                                       $value[] = 'hourly';
+                                                               }
+                                                               if ($hour_len == 1 || ($hour_len == 24 && $min != 0)) {
+                                                                       $value[] = 'at';
+                                                                       $value[] = "$hour:$minute";
+                                                               }
                                                                $value = array_filter($value);
                                                                if (!array_key_exists($directive_name, $resource[$resource_type])) {
                                                                        $resource[$resource_type][$directive_name] = array();
@@ -587,7 +594,6 @@ function overwrite_directives_callback($directive_name, $directive_value) {
                'Accurate',
                'Priority',
                'SpoolData',
-               'WritePartAfterJob',
                'MaxRunSchedTime',
                'NextPool'
        );
index ed527cd1aa74735fb2880a76fe688bd56e8c8f4d..b45ccd0dfee223ef6b1c66c569ecb063a41c7dd2 100644 (file)
@@ -46,7 +46,8 @@ class Params extends CommonModule {
                '2nd' => 'second',
                '3rd' => 'third',
                '4th' => 'fourth',
-               '5th' => 'fifth'
+               '5th' => 'fifth',
+               '6th' => 'sixth'
        );
        public static $wdays = array(
                'sun' => 'Sunday',
@@ -78,7 +79,7 @@ class Params extends CommonModule {
                $week = '';
                $week_count = count($weeks_cfg);
                $weeks = array_keys(Params::$weeks);
-               if ($week_count < 5) {
+               if ($week_count < 6) {
                        if ($week_count > 1) {
                                $week_start = $weeks_cfg[0];
                                $week_end = $weeks_cfg[$week_count-1];
@@ -116,7 +117,7 @@ class Params extends CommonModule {
                $days = '';
                if (count($days_cfg) < 31) {
                        $days_map = array_map(array('Params', 'getDayByNo') , $days_cfg);
-                       $days = 'on ' . implode(',', $days_map);
+                       $days = implode(',', $days_map);
                }
                return $days;
        }
index 96ab103de507d91d1fb1d0a954abc08dab5f2222..6087799c24c9d0ac980f8af1415b85b93043a790 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/en/messages.mo and b/gui/baculum/protected/Web/Lang/en/messages.mo differ
index f2ce7046eef5082889dc44ff7539ed8ab7456dea..4ed4b3f92ee98f9b085742cd53fb8ae04e5107e8 100644 (file)
@@ -1223,12 +1223,6 @@ msgstr "Step 4 - Finish"
 msgid "Disabled"
 msgstr "Disabled"
 
-msgid "Single month"
-msgstr "Single month"
-
-msgid "Month range"
-msgstr "Month range"
-
 msgid "From month"
 msgstr "From month"
 
@@ -1238,12 +1232,6 @@ msgstr "To month"
 msgid "Month"
 msgstr "Month"
 
-msgid "Single day"
-msgstr "Single day"
-
-msgid "Day range"
-msgstr "Day range"
-
 msgid "From day"
 msgstr "From day"
 
@@ -1253,39 +1241,21 @@ msgstr "To day"
 msgid "Day"
 msgstr "Day"
 
-msgid "Single day of week"
-msgstr "Single day of week"
-
 msgid "Day of week"
 msgstr "Day of week"
 
-msgid "Day of week range"
-msgstr "Day of week range"
-
 msgid "From day of week"
 msgstr "From day of week"
 
 msgid "To day of week"
 msgstr "To day of week"
 
-msgid "At HH:MM"
-msgstr "At HH:MM"
-
-msgid "Hourly at"
-msgstr "Hourly at"
-
 msgid "Hour"
 msgstr "Hour"
 
 msgid "Minute"
 msgstr "Minute"
 
-msgid "Single week"
-msgstr "Single week"
-
-msgid "Week range"
-msgstr "Week range"
-
 msgid "From week"
 msgstr "From week"
 
@@ -2398,3 +2368,88 @@ msgstr "Refresh job log"
 
 msgid "Set job log order (ascending/descending)"
 msgstr "Set job log order (ascending/descending)"
+
+msgid "Run every month"
+msgstr "Run every month"
+
+msgid "Run one month a year"
+msgstr "Run one month a year"
+
+msgid "Run from month to month a year (range)"
+msgstr "Run from month to month a year (range)"
+
+msgid "Run every week"
+msgstr "Run every week"
+
+msgid "Run one week a month"
+msgstr "Run one week a month"
+
+msgid "Run from week to week a month (range)"
+msgstr "Run from week to week a month (range)"
+
+msgid "Run every day"
+msgstr "Run every day"
+
+msgid "Run one day a month"
+msgstr "Run one day a month"
+
+msgid "Run from day to day a month (range)"
+msgstr "Run from day to day a month (range)"
+
+msgid "Run every day of week"
+msgstr "Run every day of week"
+
+msgid "Run one day of week"
+msgstr "Run one day of week"
+
+msgid "Run from day of week to day of week (range)"
+msgstr "Run from day of week to day of week (range)"
+
+msgid "Run every full hour"
+msgstr "Run every full hour"
+
+msgid "Run at hour and minute"
+msgstr "Run at hour and minute"
+
+msgid "Run hourly at minute"
+msgstr "Run hourly at minute"
+
+msgid "Hour and minute"
+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"
+
+msgid "Please select month range in Run block"
+msgstr "Please select month range in Run block"
+
+msgid "Please select week in Run block"
+msgstr "Please select week in Run block"
+
+msgid "Please select week range in Run block"
+msgstr "Please select week range in Run block"
+
+msgid "Please select day in Run block"
+msgstr "Please select day in Run block"
+
+msgid "Please select day range in Run block"
+msgstr "Please select day range in Run block"
+
+msgid "Please select day of week in Run block"
+msgstr "Please select day of week in Run block"
+
+msgid "Please select day of week range in Run block"
+msgstr "Please select day of week range in Run block"
+
+msgid "Please select hour in Run block"
+msgstr "Please select hour in Run block"
+
+msgid "Please select hour and minute in Run block"
+msgstr "Please select hour and minute in Run block"
+
index e33f848f22da6cf0c44c55f2447af80327a3fdc2..f30f0f76d5baf52d0e63dfdf1ac285cbe61bf4ff 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/ja/messages.mo and b/gui/baculum/protected/Web/Lang/ja/messages.mo differ
index 32b22ec2937455d77d4dbd63eb88ddaec46413cc..e9e76cbd4bd28476e9de3e42bbd88c620e59b721 100644 (file)
@@ -158,9 +158,6 @@ msgstr "Are you sure that you want to remove %s resource \"%s\"?"
 msgid "Are you sure you want to remove this resource?"
 msgstr "Are you sure you want to remove this resource?"
 
-msgid "At HH:MM"
-msgstr "At HH:MM"
-
 msgid "Auth Type:"
 msgstr "Auth Type:"
 
@@ -399,12 +396,6 @@ msgstr "Day"
 msgid "Day of week"
 msgstr "Day of week"
 
-msgid "Day of week range"
-msgstr "Day of week range"
-
-msgid "Day range"
-msgstr "Day range"
-
 msgid "Days"
 msgstr "Days"
 
@@ -633,9 +624,6 @@ msgstr "Host:"
 msgid "Hour"
 msgstr "Hour"
 
-msgid "Hourly at"
-msgstr "Hourly at"
-
 msgid "Hours"
 msgstr "Hours"
 
@@ -979,9 +967,6 @@ msgstr "Minutes"
 msgid "Month"
 msgstr "Month"
 
-msgid "Month range"
-msgstr "Month range"
-
 msgid "More jobs"
 msgstr "ジョブ一覧"
 
@@ -1395,18 +1380,6 @@ msgstr "Show the resource raw config"
 msgid "Show/hide all resource directives"
 msgstr "Show/hide all resource directives"
 
-msgid "Single day"
-msgstr "Single day"
-
-msgid "Single day of week"
-msgstr "Single day of week"
-
-msgid "Single month"
-msgstr "Single month"
-
-msgid "Single week"
-msgstr "Single week"
-
 msgid "Size"
 msgstr "サイズ"
 
@@ -1784,9 +1757,6 @@ msgstr ""
 msgid "Week"
 msgstr "Week"
 
-msgid "Week range"
-msgstr "Week range"
-
 msgid "Welcome"
 msgstr "Welcome"
 
@@ -2484,3 +2454,88 @@ msgstr "Refresh job log"
 
 msgid "Set job log order (ascending/descending)"
 msgstr "Set job log order (ascending/descending)"
+
+msgid "Run every month"
+msgstr "Run every month"
+
+msgid "Run one month a year"
+msgstr "Run one month a year"
+
+msgid "Run from month to month a year (range)"
+msgstr "Run from month to month a year (range)"
+
+msgid "Run every week"
+msgstr "Run every week"
+
+msgid "Run one week a month"
+msgstr "Run one week a month"
+
+msgid "Run from week to week a month (range)"
+msgstr "Run from week to week a month (range)"
+
+msgid "Run every day"
+msgstr "Run every day"
+
+msgid "Run one day a month"
+msgstr "Run one day a month"
+
+msgid "Run from day to day a month (range)"
+msgstr "Run from day to day a month (range)"
+
+msgid "Run every day of week"
+msgstr "Run every day of week"
+
+msgid "Run one day of week"
+msgstr "Run one day of week"
+
+msgid "Run from day of week to day of week (range)"
+msgstr "Run from day of week to day of week (range)"
+
+msgid "Run every full hour"
+msgstr "Run every full hour"
+
+msgid "Run at hour and minute"
+msgstr "Run at hour and minute"
+
+msgid "Run hourly at minute"
+msgstr "Run hourly at minute"
+
+msgid "Hour and minute"
+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"
+
+msgid "Please select month range in Run block"
+msgstr "Please select month range in Run block"
+
+msgid "Please select week in Run block"
+msgstr "Please select week in Run block"
+
+msgid "Please select week range in Run block"
+msgstr "Please select week range in Run block"
+
+msgid "Please select day in Run block"
+msgstr "Please select day in Run block"
+
+msgid "Please select day range in Run block"
+msgstr "Please select day range in Run block"
+
+msgid "Please select day of week in Run block"
+msgstr "Please select day of week in Run block"
+
+msgid "Please select day of week range in Run block"
+msgstr "Please select day of week range in Run block"
+
+msgid "Please select hour in Run block"
+msgstr "Please select hour in Run block"
+
+msgid "Please select hour and minute in Run block"
+msgstr "Please select hour and minute in Run block"
+
index 48fd52f633971a7ebcdbf37c12210c0cc69b80e3..e80944ac63fa882b6ff1a215443820f550dfbebe 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pl/messages.mo and b/gui/baculum/protected/Web/Lang/pl/messages.mo differ
index 894d823316819fb329172c8b72cb1942287eef51..8898217c52419ba8c45edc77295c8a4b84a9e501 100644 (file)
@@ -1233,12 +1233,6 @@ msgstr "Krok 4 - Koniec"
 msgid "Disabled"
 msgstr "Wyłączony"
 
-msgid "Single month"
-msgstr "Pojedynczy miesiÄ…c"
-
-msgid "Month range"
-msgstr "Zakres miesiÄ™cy"
-
 msgid "From month"
 msgstr "Od miesiÄ…ca"
 
@@ -1248,12 +1242,6 @@ msgstr "Do miesiÄ…ca"
 msgid "Month"
 msgstr "MiesiÄ…c"
 
-msgid "Single day"
-msgstr "Pojedynczy dzieÅ„"
-
-msgid "Day range"
-msgstr "Zakres dni"
-
 msgid "From day"
 msgstr "Od dnia"
 
@@ -1263,39 +1251,21 @@ msgstr "Do dnia"
 msgid "Day"
 msgstr "DzieÅ„"
 
-msgid "Single day of week"
-msgstr "Pojedynczy dzieÅ„ tygodnia"
-
 msgid "Day of week"
 msgstr "DzieÅ„ tygodnia"
 
-msgid "Day of week range"
-msgstr "Zakres dni tygodnia"
-
 msgid "From day of week"
 msgstr "Od dnia tygodnia"
 
 msgid "To day of week"
 msgstr "Do dnia tygodnia"
 
-msgid "At HH:MM"
-msgstr "O godz. HH:MM"
-
-msgid "Hourly at"
-msgstr "Co godzinÄ™ o"
-
 msgid "Hour"
 msgstr "Godzina"
 
 msgid "Minute"
 msgstr "Minuta"
 
-msgid "Single week"
-msgstr "Pojedynczy tydzieÅ„"
-
-msgid "Week range"
-msgstr "Zakres tygodni"
-
 msgid "From week"
 msgstr "Od tygodnia"
 
@@ -2405,3 +2375,88 @@ msgstr "OdÅ›wież dziennik zadania"
 
 msgid "Set job log order (ascending/descending)"
 msgstr "Ustaw kolejność dziennika zadania (rosnÄ…co/malejÄ…co)"
+
+msgid "Run every month"
+msgstr "Uruchom każdego miesiÄ…ca"
+
+msgid "Run one month a year"
+msgstr "Uruchom jeden miesiÄ…c w roku"
+
+msgid "Run from month to month a year (range)"
+msgstr "Uruchom od miesiÄ…ca do miesiÄ…ca w roku (zakres)"
+
+msgid "Run every week"
+msgstr "Uruchom każdego tygodnia"
+
+msgid "Run one week a month"
+msgstr "Uruchom jeden tydzieÅ„ w miesiÄ…cu"
+
+msgid "Run from week to week a month (range)"
+msgstr "Uruchom od tygodnia do tygodnia w miesiÄ…cu (zakres)"
+
+msgid "Run every day"
+msgstr "Uruchom każdego dnia"
+
+msgid "Run one day a month"
+msgstr "Uruchom jeden dzieÅ„ w miesiÄ…cu"
+
+msgid "Run from day to day a month (range)"
+msgstr "Uruchom od dnia do dnia w miesiÄ…cu (zakres)"
+
+msgid "Run every day of week"
+msgstr "Uruchom każdego dnia tygodnia"
+
+msgid "Run one day of week"
+msgstr "Uruchom jednego dnia tygodnia"
+
+msgid "Run from day of week to day of week (range)"
+msgstr "Uruchom od dnia tygodnia do dnia tygodnia (zakres)"
+
+msgid "Run every full hour"
+msgstr "Uruchom każdej peÅ‚nej godziny"
+
+msgid "Run at hour and minute"
+msgstr "Uruchom o godzinie i minucie"
+
+msgid "Run hourly at minute"
+msgstr "Uruchom co godzinÄ™ o minucie"
+
+msgid "Hour and minute"
+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"
+
+msgid "Please select month range in Run block"
+msgstr "ProszÄ™ wybrać zakres miesiÄ™cy w bloku Uruchom"
+
+msgid "Please select week in Run block"
+msgstr "ProszÄ™ wybrać tydzieÅ„ w bloku Uruchom"
+
+msgid "Please select week range in Run block"
+msgstr "ProszÄ™ wybrać zakres tygodni w bloku Uruchom"
+
+msgid "Please select day in Run block"
+msgstr "ProszÄ™ wybrać dzieÅ„ w bloku Uruchom"
+
+msgid "Please select day range in Run block"
+msgstr "ProszÄ™ wybrać zakres dni w bloku Uruchom"
+
+msgid "Please select day of week in Run block"
+msgstr "ProszÄ™ wybrać dzieÅ„ tygodnia w bloku Uruchom"
+
+msgid "Please select day of week range in Run block"
+msgstr "ProszÄ™ wybrać zakres dni tygodnia w bloku Uruchom"
+
+msgid "Please select hour in Run block"
+msgstr "ProszÄ™ wybrać godzinÄ™ w bloku Uruchom"
+
+msgid "Please select hour and minute in Run block"
+msgstr "ProszÄ™ wybrać godzinÄ™ i minutÄ™ w bloku Uruchom"
+
index 562489f1ce9def7e794fac83b6705e303c54b14b..148cd2642c9b6ee30aeab56ca64a6bf66563ea8f 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pt/messages.mo and b/gui/baculum/protected/Web/Lang/pt/messages.mo differ
index 814b116cd918ec0dfe89338f05283d571dab3b47..2c634198eda1f3281da8edbd3ee1ae50e042affa 100644 (file)
@@ -1241,12 +1241,6 @@ msgstr "Etapa 4 - Finalizar"
 msgid "Disabled"
 msgstr "Desabilitado"
 
-msgid "Single month"
-msgstr "Único mês"
-
-msgid "Month range"
-msgstr "Intervalo do mês"
-
 msgid "From month"
 msgstr "Do mês"
 
@@ -1256,12 +1250,6 @@ msgstr "Até o mês"
 msgid "Month"
 msgstr "Mês"
 
-msgid "Single day"
-msgstr "Único dia"
-
-msgid "Day range"
-msgstr "Intervalo do dia"
-
 msgid "From day"
 msgstr "Do dia"
 
@@ -1271,39 +1259,21 @@ msgstr "Até o dia"
 msgid "Day"
 msgstr "Dia"
 
-msgid "Single day of week"
-msgstr "Único dia da semana"
-
 msgid "Day of week"
 msgstr "Dia da semana"
 
-msgid "Day of week range"
-msgstr "Intervalo de dia da semana"
-
 msgid "From day of week"
 msgstr "Do dia da semana"
 
 msgid "To day of week"
 msgstr "Até o dia da semana"
 
-msgid "At HH:MM"
-msgstr "Em HH:MM"
-
-msgid "Hourly at"
-msgstr "Por hora"
-
 msgid "Hour"
 msgstr "Hora"
 
 msgid "Minute"
 msgstr "Minuto"
 
-msgid "Single week"
-msgstr "Única semana"
-
-msgid "Week range"
-msgstr "Intervalo da semana"
-
 msgid "From week"
 msgstr "Da semana"
 
@@ -2413,3 +2383,88 @@ msgstr "Refresh job log"
 
 msgid "Set job log order (ascending/descending)"
 msgstr "Set job log order (ascending/descending)"
+
+msgid "Run every month"
+msgstr "Run every month"
+
+msgid "Run one month a year"
+msgstr "Run one month a year"
+
+msgid "Run from month to month a year (range)"
+msgstr "Run from month to month a year (range)"
+
+msgid "Run every week"
+msgstr "Run every week"
+
+msgid "Run one week a month"
+msgstr "Run one week a month"
+
+msgid "Run from week to week a month (range)"
+msgstr "Run from week to week a month (range)"
+
+msgid "Run every day"
+msgstr "Run every day"
+
+msgid "Run one day a month"
+msgstr "Run one day a month"
+
+msgid "Run from day to day a month (range)"
+msgstr "Run from day to day a month (range)"
+
+msgid "Run every day of week"
+msgstr "Run every day of week"
+
+msgid "Run one day of week"
+msgstr "Run one day of week"
+
+msgid "Run from day of week to day of week (range)"
+msgstr "Run from day of week to day of week (range)"
+
+msgid "Run every full hour"
+msgstr "Run every full hour"
+
+msgid "Run at hour and minute"
+msgstr "Run at hour and minute"
+
+msgid "Run hourly at minute"
+msgstr "Run hourly at minute"
+
+msgid "Hour and minute"
+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"
+
+msgid "Please select month range in Run block"
+msgstr "Please select month range in Run block"
+
+msgid "Please select week in Run block"
+msgstr "Please select week in Run block"
+
+msgid "Please select week range in Run block"
+msgstr "Please select week range in Run block"
+
+msgid "Please select day in Run block"
+msgstr "Please select day in Run block"
+
+msgid "Please select day range in Run block"
+msgstr "Please select day range in Run block"
+
+msgid "Please select day of week in Run block"
+msgstr "Please select day of week in Run block"
+
+msgid "Please select day of week range in Run block"
+msgstr "Please select day of week range in Run block"
+
+msgid "Please select hour in Run block"
+msgstr "Please select hour in Run block"
+
+msgid "Please select hour and minute in Run block"
+msgstr "Please select hour and minute in Run block"
+
index ccc36bb91f6dd66334acbe61e60b93cfadc159f3..bfdf0f7f0389d1c763f2793103b9515a1dd3f329 100644 (file)
@@ -37,18 +37,17 @@ class DirectiveSchedule extends DirectiveListTemplate {
        );
 
        private $overwrite_directives = array(
-               'Level',
                'Pool',
-               'Storage',
-               'Messages',
                'FullPool',
-               'DifferentialPool',
                'IncrementalPool',
-               'Accurate',
+               'DifferentialPool',
+               'Level',
+               'Storage',
+               'Messages',
                'Priority',
                'SpoolData',
-               'writepartafterjob',
                'MaxRunSchedTime',
+               'Accurate',
                'NextPool'
        );
 
@@ -209,11 +208,9 @@ class DirectiveSchedule extends DirectiveListTemplate {
 
                $directive = $param->Item->Data['time_directives']['Month']['directive_values'];
 
-               $months_long = array_values(Params::$months);
+               $months = array_keys(Params::$months);
 
-               $single_months = Params::$months;
-               $single_months['monthly'] = 'Monthly';
-               $param->Item->Month->setData($single_months);
+               $param->Item->Month->setData(Params::$months);
                $param->Item->MonthRangeFrom->setData(Params::$months);
                $param->Item->MonthRangeTo->setData(Params::$months);
 
@@ -222,15 +219,15 @@ class DirectiveSchedule extends DirectiveListTemplate {
                $month_range_to = null;
                $month_count = $load_values ? count($directive->Month) : 0;
                if ($month_count === 12) {
-                       $month_single = 'Monthly';
+                       $param->Item->MonthDisable->Checked = true;
                } elseif ($month_count == 1) {
-                       $month_single = $months_long[$directive->Month[0]];
+                       $month_single = $months[$directive->Month[0]];
                        $param->Item->MonthSingle->Checked = true;
                } elseif ($month_count > 0 && $month_count < 12) {
                        $month_start = $directive->Month[0];
                        $month_end = $directive->Month[$month_count-1];
-                       $month_range_from = $months_long[$month_start];
-                       $month_range_to = $months_long[$month_end];
+                       $month_range_from = $months[$month_start];
+                       $month_range_to = $months[$month_end];
                        $param->Item->MonthRange->Checked = true;
                }
                $param->Item->Month->setDirectiveValue($month_single);
@@ -238,9 +235,7 @@ class DirectiveSchedule extends DirectiveListTemplate {
                $param->Item->MonthRangeTo->setDirectiveValue($month_range_to);
 
                $days = range(1, 31);
-               $single_days = $days;
-               $single_days['daily'] = 'Daily';
-               $param->Item->Day->setData($single_days);
+               $param->Item->Day->setData($days);
                $param->Item->DayRangeFrom->setData($days);
                $param->Item->DayRangeTo->setData($days);
 
@@ -249,49 +244,47 @@ class DirectiveSchedule extends DirectiveListTemplate {
                $day_range_to = null;
                $day_count = $load_values ? count($directive->Day) : 0;
                if ($day_count === 31) {
-                       $day_single = 'Daily';
+                       $param->Item->DayDisable->Checked = true;
                } elseif ($day_count === 1) {
                        $day_single = $days[$directive->Day[0]];
                        $param->Item->DaySingle->Checked = true;
                } elseif ($day_count > 0 && $day_count < 31) {
                        $day_start = $directive->Day[0];
                        $day_end = $directive->Day[$day_count-1];
-                       $day_range_from = $day_start;
-                       $day_range_to = $day_end;
+                       $day_range_from = $days[$day_start];
+                       $day_range_to = $days[$day_end];
                        $param->Item->DayRange->Checked = true;
                }
                $param->Item->Day->setDirectiveValue($day_single);
                $param->Item->DayRangeFrom->setDirectiveValue($day_range_from);
                $param->Item->DayRangeTo->setDirectiveValue($day_range_to);
 
-               $weeks_long = array_values(Params::$weeks);
+               $weeks = array_keys(Params::$weeks);
 
-               $single_weeks = Params::$weeks;
-               $single_weeks['weekly'] = 'Weekly';
-               $param->Item->Week->setData($single_weeks);
+               $param->Item->Week->setData(Params::$weeks);
                $param->Item->WeekRangeFrom->setData(Params::$weeks);
                $param->Item->WeekRangeTo->setData(Params::$weeks);
                $week_single = null;
                $week_range_from = null;
                $week_range_to = null;
                $week_count = $load_values ? count($directive->WeekOfMonth) : 0;
-               if ($week_count === 5) {
-                       $week_single = 'Weekly';
+               if ($week_count == 6) {
+                       $param->Item->WeekDisable->Checked = true;
                } elseif ($week_count == 1) {
-                       $week_single = $weeks_long[$directive->WeekOfMonth[0]];
+                       $week_single = $weeks[$directive->WeekOfMonth[0]];
                        $param->Item->WeekSingle->Checked = true;
-               } elseif ($week_count > 0 && $week_count < 5) {
+               } elseif ($week_count > 0 && $week_count < 6) {
                        $week_start = $directive->WeekOfMonth[0];
                        $week_end = $directive->WeekOfMonth[$week_count-1];
-                       $week_range_from = $weeks_long[$week_start];
-                       $week_range_to = $weeks_long[$week_end];
+                       $week_range_from = $weeks[$week_start];
+                       $week_range_to = $weeks[$week_end];
                        $param->Item->WeekRange->Checked = true;
                }
                $param->Item->Week->setDirectiveValue($week_single);
                $param->Item->WeekRangeFrom->setDirectiveValue($week_range_from);
                $param->Item->WeekRangeTo->setDirectiveValue($week_range_to);
 
-               $wdays_long = array_values(Params::$wdays);
+               $wdays = array_keys(Params::$wdays);
                $param->Item->Wday->setData(Params::$wdays);
                $param->Item->WdayRangeFrom->setData(Params::$wdays);
                $param->Item->WdayRangeTo->setData(Params::$wdays);
@@ -303,13 +296,13 @@ class DirectiveSchedule extends DirectiveListTemplate {
                if ($wday_count === 7) {
                        $wday_single = '';
                } elseif ($wday_count === 1) {
-                       $wday_single = $wdays_long[$directive->DayOfWeek[0]];
+                       $wday_single = $wdays[$directive->DayOfWeek[0]];
                        $param->Item->WdaySingle->Checked = true;
                } elseif ($wday_count > 0 && $wday_count < 7) {
                        $wday_start = $directive->DayOfWeek[0];
                        $wday_end = $directive->DayOfWeek[$wday_count-1];
-                       $wday_range_from = $wdays_long[$wday_start];
-                       $wday_range_to = $wdays_long[$wday_end];
+                       $wday_range_from = $wdays[$wday_start];
+                       $wday_range_to = $wdays[$wday_end];
                        $param->Item->WdayRange->Checked = true;
                }
                $param->Item->Wday->setDirectiveValue($wday_single);
@@ -326,10 +319,17 @@ class DirectiveSchedule extends DirectiveListTemplate {
                         */
                        $minute = property_exists($directive, 'Minute') ? $directive->Minute : 0;
                }
+               $param->Item->TimeHourAt->setDirectiveValue(0);
+               $param->Item->TimeMinAt->setDirectiveValue(0);
+               $param->Item->TimeMinHourly->setDirectiveValue(0);
                if ($load_values) {
                        if (count($directive->Hour) == 24) {
-                               $param->Item->TimeHourly->Checked = true;
-                               $param->Item->TimeMinHourly->setDirectiveValue($minute);
+                               if ($minute === 0) {
+                                       $param->Item->TimeDisable->Checked = true;
+                               } else {
+                                       $param->Item->TimeHourly->Checked = true;
+                                       $param->Item->TimeMinHourly->setDirectiveValue($minute);
+                               }
                        } elseif (count($directive->Hour) == 1) {
                                $param->Item->TimeAt->Checked = true;
                                $param->Item->TimeHourAt->setDirectiveValue($hour);
@@ -349,6 +349,16 @@ class DirectiveSchedule extends DirectiveListTemplate {
                }
        }
 
+       public function removeSchedule($sender, $param) {
+               if ($param instanceof Prado\Web\UI\TCommandEventParameter) {
+                       $idx = $param->getCommandName();
+                       $data = $this->getDirectiveValue(true);
+                       array_splice($data, $idx, 1);
+                       $this->setData($data);
+                       $this->loadConfig();
+               }
+       }
+
        public function getDirectiveValue($ret_obj = false) {
                $directive_values = array();
                $values = array('Run' => array());
@@ -375,67 +385,71 @@ class DirectiveSchedule extends DirectiveListTemplate {
                                        // value the same as default value, skip it
                                        continue;
                                }
+                               $obj->{$directive_name} = $directive_value;
                                if (get_class($control) === 'DirectiveCheckBox') {
                                        $directive_value = Params::getBoolValue($directive_value);
                                }
                                $directive_values[] = "{$directive_name}=\"{$directive_value}\"";
-                               $obj->{$directive_name} = $directive_value;
                        }
 
                        $obj->Month = range(0, 11);
-                       $months_short = array_keys(Params::$months);
+                       $months = array_keys(Params::$months);
                        if ($value->MonthSingle->Checked === true) {
-                               $directive_values[] = $value->Month->getDirectiveValue();
-                               $obj->Month = array(array_search($value->Month->getDirectiveValue(), $months_short));
+                               $month_val = $value->Month->getDirectiveValue();
+                               $directive_values[] = $month_val;
+                               $obj->Month = array(array_search($month_val, $months));
                        } elseif ($value->MonthRange->Checked === true) {
                                $from = $value->MonthRangeFrom->getDirectiveValue();
                                $to = $value->MonthRangeTo->getDirectiveValue();
                                $directive_values[] = "{$from}-{$to}";
-                               $f = array_search($from, $months_short);
-                               $t = array_search($to, $months_short);
+                               $f = array_search($from, $months);
+                               $t = array_search($to, $months);
                                $obj->Month = range($f, $t);
                        }
 
-                       $obj->WeekOfMonth = range(0, 6);
-                       $weeks_short = array_keys(Params::$weeks);
+                       $obj->WeekOfMonth = range(0, 5);
+                       $weeks = array_keys(Params::$weeks);
                        if ($value->WeekSingle->Checked === true) {
-                               $directive_values[] = $value->Week->getDirectiveValue();
-                               $obj->WeekOfMonth = array(array_search($value->Week->getDirectiveValue(), $weeks_short));
+                               $week_val = $value->Week->getDirectiveValue();
+                               $directive_values[] = $week_val;
+                               $obj->WeekOfMonth = array(array_search($week_val, $weeks));
                        } elseif ($value->WeekRange->Checked === true) {
                                $from = $value->WeekRangeFrom->getDirectiveValue();
                                $to = $value->WeekRangeTo->getDirectiveValue();
                                $directive_values[] = "{$from}-{$to}";
-                               $f = array_search($from, $weeks_short);
-                               $t = array_search($to, $weeks_short);
+                               $f = array_search($from, $weeks);
+                               $t = array_search($to, $weeks);
                                $obj->WeekOfMonth = range($f, $t);
                        }
 
                        $obj->Day = range(0, 30);
                        if ($value->DaySingle->Checked === true) {
-                               $directive_values[] = $value->Day->getDirectiveValue();
-                               $obj->Day = array($value->Day->getDirectiveValue());
+                               $day = $value->Day->getDirectiveValue();
+                               $directive_values[] = $day;
+                               $obj->Day = array($day-1);
                        } elseif ($value->DayRange->Checked === true) {
-                               $from = $value->DayRangeFrom->getDirectiveValue();
-                               $to = $value->DayRangeTo->getDirectiveValue();
-                               $directive_values[] = "{$from}-{$to}";
-                               $obj->Day = range($from, $to);
+                               $from = $value->DayRangeFrom->getDirectiveValue()-1;
+                               $to = $value->DayRangeTo->getDirectiveValue()-1;
+                               $day_range = range($from, $to);
+                               $directive_values[] = Params::getDaysConfig($day_range);
+                               $obj->Day = $day_range;
                        }
 
                        $obj->DayOfWeek = range(0, 6);
-                       $wdays_short = array_values(Params::$wdays);
+                       $wdays = array_keys(Params::$wdays);
                        if ($value->WdaySingle->Checked === true) {
                                $directive_values[] = $value->Wday->getDirectiveValue();
-                               $obj->DayOfWeek = array(array_search($value->Wday->getDirectiveValue(), $wdays_short));
+                               $obj->DayOfWeek = array(array_search($value->Wday->getDirectiveValue(), $wdays));
                        } elseif ($value->WdayRange->Checked === true) {
                                $from = $value->WdayRangeFrom->getDirectiveValue();
                                $to = $value->WdayRangeTo->getDirectiveValue();
                                $directive_values[] = "{$from}-{$to}";
-                               $f = array_search($from, $wdays_short);
-                               $t = array_search($to, $wdays_short);
+                               $f = array_search($from, $wdays);
+                               $t = array_search($to, $wdays);
                                $obj->DayOfWeek = range($f, $t);
                        }
 
-                       $obj->Hour = array(0);
+                       $obj->Hour = range(0, 23);
                        $obj->Minute = 0;
                        if ($value->TimeAt->Checked === true) {
                                $hour = $value->TimeHourAt->getDirectiveValue();
@@ -448,8 +462,8 @@ class DirectiveSchedule extends DirectiveListTemplate {
                                $hour = '00';
                                $minute = sprintf('%02d', $value->TimeMinHourly->getDirectiveValue());
                                $directive_values[] = "hourly at {$hour}:{$minute}";
-                               $obj->Hour = array(0);
-                               $obj->Minute = $minute;
+                               $obj->Hour = range(0, 23);
+                               $obj->Minute = $value->TimeMinHourly->getDirectiveValue();
                        }
                        $values['Run'][] = implode(' ', $directive_values);
                        $objs[] = $obj;
@@ -462,7 +476,7 @@ class DirectiveSchedule extends DirectiveListTemplate {
        public function newScheduleDirective() {
                $data = $this->getDirectiveValue(true);
                $obj = new StdClass;
-               $obj->Hour = array(0);
+               $obj->Hour = range(0, 23);
                $obj->Minute = 0;
                $obj->Day = range(0, 30);
                $obj->Month = range(0, 11);
@@ -477,7 +491,7 @@ class DirectiveSchedule extends DirectiveListTemplate {
                }
                $this->setData($data);
                $this->SourceTemplateControl->setShowAllDirectives(true);
-               $this->loadConfig(null, null);
+               $this->loadConfig();
        }
 }
 ?>
index e38e9499b76be438b4c6c2a91ee28dceac319a1c..16d669596e60393e3247f82339eed4e5c5584ea4 100644 (file)
@@ -3,6 +3,14 @@
 <com:TActiveRepeater ID="RepeaterScheduleRuns" OnItemDataBound="createRunItem">
        <prop:ItemTemplate>
                <div class="w3-card-4 w3-padding w3-margin-bottom directive runscript">
+               <com:TActiveLinkButton
+                       CssClass="w3-button w3-green w3-right"
+                       OnCommand="SourceTemplateControl.removeSchedule"
+                       CommandName="<%=$this->ItemIndex%>"
+                       CommandParameter="save"
+               >
+                       <i class="fa fa-trash-alt"></i> &nbsp;<%[ Remove ]%>
+               </com:TActiveLinkButton>
                        <h2 class="schedule_options"><%[ Run ]%> #<%=($this->ItemIndex+1)%></h2>
                        <com:Application.Web.Portlets.DirectiveComboBox
                                ID="Level"
                        />
                        <com:Application.Web.Portlets.DirectiveTextBox
                                ID="Priority"
+                               CssClass="smallbox"
                        />
                        <com:Application.Web.Portlets.DirectiveCheckBox
                                ID="SpoolData"
                        />
-                       <com:Application.Web.Portlets.DirectiveCheckBox
-                               ID="writepartafterjob"
-                       />
                        <com:Application.Web.Portlets.DirectiveTimePeriod
                                ID="MaxRunSchedTime"
                        />
-               <com:TRadioButton
-                       ID="MonthDisable"
-                       CssClass="w3-radio"
-                       GroupName="Month"
-                       Attributes.onchange="$('.month<%=$this->MonthSingle->ClientID%>').hide();"
-                       Checked="true" />
-               <com:TLabel ForControl="MonthDisable" Text="<%[ Disabled ]%>" />
-               <com:TRadioButton
-                       ID="MonthSingle"
-                       CssClass="w3-radio"
-                       GroupName="Month"
-                       Attributes.onchange="$('.month<%=$this->MonthSingle->ClientID%>').hide();$('#month<%=$this->MonthSingle->ClientID%>').show()" />
-               <com:TLabel ForControl="MonthSingle" Text="<%[ Single month ]%>" />
-               <com:TRadioButton
-                       ID="MonthRange"
-                       CssClass="w3-radio"
-                       GroupName="Month"
-                       Attributes.onchange="$('.month<%=$this->MonthSingle->ClientID%>').hide();$('#month_range<%=$this->MonthSingle->ClientID%>').show()" />
-               <com:TLabel ForControl="MonthRange" Text="<%[ Month range ]%>" />
-               <div id="month<%=$this->MonthSingle->ClientID%>" class="w3-margin month<%=$this->MonthSingle->ClientID%>" style="display: <%=$this->MonthSingle->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="Month"
-                               Label="<%[ Month ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
+               <div class="w3-border w3-padding w3-margin-top w3-margin-bottom">
+                       <h3><%[ Month ]%></h3>
+                       <div style="display: flex; flex-wrap: wrap;">
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="MonthDisable"
+                                               CssClass="w3-radio"
+                                               GroupName="Month"
+                                               Attributes.onchange="$('.month<%=$this->MonthSingle->ClientID%>').hide();"
+                                               Checked="true" />
+                                       <com:TLabel ForControl="MonthDisable" Text="<%[ Run every month ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="MonthSingle"
+                                               CssClass="w3-radio"
+                                               GroupName="Month"
+                                               Attributes.onchange="$('.month<%=$this->MonthSingle->ClientID%>').hide();$('#month<%=$this->MonthSingle->ClientID%>').show()" />
+                                       <com:TLabel ForControl="MonthSingle" Text="<%[ Run one month a year ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="MonthRange"
+                                               CssClass="w3-radio"
+                                               GroupName="Month"
+                                               Attributes.onchange="$('.month<%=$this->MonthSingle->ClientID%>').hide();$('#month_range<%=$this->MonthSingle->ClientID%>').show()" />
+                                       <com:TLabel ForControl="MonthRange" Text="<%[ Run from month to month a year (range) ]%>" />
+                               </div>
+                       </div>
+                       <div id="month<%=$this->MonthSingle->ClientID%>" class="w3-margin month<%=$this->MonthSingle->ClientID%>" style="display: <%=$this->MonthSingle->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="Month"
+                                       Label="<%[ Month ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="MonthSingle"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select month in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->MonthSingle->ClientID%>').prop('checked') && ($('#<%=$this->Month->ClientID%>_Directive').val()).trim() === '');
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
+                       <div id="month_range<%=$this->MonthSingle->ClientID%>" class="w3-margin month<%=$this->MonthSingle->ClientID%>" style="display: <%=$this->MonthRange->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="MonthRangeFrom"
+                                       Label="<%[ From month ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="MonthRangeTo"
+                                       Label="<%[ To month ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="MonthRange"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select month range in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->MonthRange->ClientID%>').prop('checked') && (($('#<%=$this->MonthRangeFrom->ClientID%>_Directive').val()).trim() === '' || ($('#<%=$this->MonthRangeTo->ClientID%>_Directive').val()).trim() === ''));
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
                </div>
-               <div id="month_range<%=$this->MonthSingle->ClientID%>" class="w3-margin month<%=$this->MonthSingle->ClientID%>" style="display: <%=$this->MonthRange->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="MonthRangeFrom"
-                               Label="<%[ From month ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="MonthRangeTo"
-                               Label="<%[ To month ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
+               <div class="w3-border w3-padding w3-margin-top w3-margin-bottom">
+                       <h3><%[ Week ]%></h3>
+                       <div style="display: flex; flex-wrap: wrap;">
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="WeekDisable"
+                                               CssClass="w3-radio"
+                                               GroupName="Week"
+                                               Attributes.onchange="$('.week<%=$this->WeekSingle->ClientID%>').hide();"
+                                               Checked="true" />
+                                       <com:TLabel ForControl="WeekDisable" Text="<%[ Run every week ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="WeekSingle"
+                                               CssClass="w3-radio"
+                                               GroupName="Week"
+                                               Attributes.onchange="$('.week<%=$this->WeekSingle->ClientID%>').hide();$('#week<%=$this->WeekSingle->ClientID%>').show()" />
+                                       <com:TLabel ForControl="WeekSingle" Text="<%[ Run one week a month ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="WeekRange"
+                                               CssClass="w3-radio"
+                                               GroupName="Week"
+                                               Attributes.onchange="$('.week<%=$this->WeekSingle->ClientID%>').hide();$('#week_range<%=$this->WeekSingle->ClientID%>').show()" />
+                                       <com:TLabel ForControl="WeekRange" Text="<%[ Run from week to week a month (range) ]%>" />
+                               </div>
+                       </div>
+                       <div id="week<%=$this->WeekSingle->ClientID%>" class="w3-margin week<%=$this->WeekSingle->ClientID%>" style="display: <%=$this->WeekSingle->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="Week"
+                                       Label="<%[ Week ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="WeekSingle"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select week in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->WeekSingle->ClientID%>').prop('checked') && ($('#<%=$this->Week->ClientID%>_Directive').val()).trim() === '');
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
+                       <div id="week_range<%=$this->WeekSingle->ClientID%>" class="w3-margin week<%=$this->WeekSingle->ClientID%>" style="display: <%=$this->WeekRange->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="WeekRangeFrom"
+                                       Label="<%[ From week ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="WeekRangeTo"
+                                       Label="<%[ To week ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="MonthRange"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select week range in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->WeekRange->ClientID%>').prop('checked') && (($('#<%=$this->WeekRangeFrom->ClientID%>_Directive').val()).trim() === '' || ($('#<%=$this->WeekRangeTo->ClientID%>_Directive').val()).trim() === ''));
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
                </div>
-               <hr />
-               <com:TRadioButton
-                       ID="WeekDisable"
-                       CssClass="w3-radio"
-                       GroupName="Week"
-                       Attributes.onchange="$('.week<%=$this->WeekSingle->ClientID%>').hide();"
-                       Checked="true" />
-               <com:TLabel ForControl="WeekDisable" Text="<%[ Disabled ]%>" />
-               <com:TRadioButton
-                       ID="WeekSingle"
-                       CssClass="w3-radio"
-                       GroupName="Week"
-                       Attributes.onchange="$('.week<%=$this->WeekSingle->ClientID%>').hide();$('#week<%=$this->WeekSingle->ClientID%>').show()" />
-               <com:TLabel ForControl="WeekSingle" Text="<%[ Single week ]%>" />
-               <com:TRadioButton
-                       ID="WeekRange"
-                       CssClass="w3-radio"
-                       GroupName="Week"
-                       Attributes.onchange="$('.week<%=$this->WeekSingle->ClientID%>').hide();$('#week_range<%=$this->WeekSingle->ClientID%>').show()" />
-               <com:TLabel ForControl="WeekRange" Text="<%[ Week range ]%>" />
-               <div id="week<%=$this->WeekSingle->ClientID%>" class="w3-margin week<%=$this->WeekSingle->ClientID%>" style="display: <%=$this->WeekSingle->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="Week"
-                               Label="<%[ Week ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
+               <div class="w3-border w3-padding w3-margin-top w3-margin-bottom">
+                       <h3><%[ Day ]%></h3>
+                       <div style="display: flex; flex-wrap: wrap;">
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="DayDisable"
+                                               CssClass="w3-radio"
+                                               GroupName="Day"
+                                               Attributes.onchange="$('.day<%=$this->DaySingle->ClientID%>').hide();"
+                                               Checked="true" />
+                                       <com:TLabel ForControl="DayDisable" Text="<%[ Run every day ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="DaySingle"
+                                               CssClass="w3-radio"
+                                               GroupName="Day"
+                                               Attributes.onchange="$('.day<%=$this->DaySingle->ClientID%>').hide();$('#day<%=$this->DaySingle->ClientID%>').show()" />
+                                       <com:TLabel ForControl="DaySingle" Text="<%[ Run one day a month ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="DayRange"
+                                               CssClass="w3-radio"
+                                               GroupName="Day"
+                                               Attributes.onchange="$('.day<%=$this->DaySingle->ClientID%>').hide();$('#day_range<%=$this->DaySingle->ClientID%>').show()" />
+                                       <com:TLabel ForControl="DayRange" Text="<%[ Run from day to day a month (range) ]%>" />
+                               </div>
+                       </div>
+                       <div id="day<%=$this->DaySingle->ClientID%>" class="w3-margin day<%=$this->DaySingle->ClientID%>" style="display: <%=$this->DaySingle->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="Day"
+                                       Label="<%[ Day ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="DaySingle"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select day in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->DaySingle->ClientID%>').prop('checked') && ($('#<%=$this->Day->ClientID%>_Directive').val()).trim() === '');
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
+                       <div id="day_range<%=$this->DaySingle->ClientID%>" class="w3-margin day<%=$this->DaySingle->ClientID%>" style="display: <%=$this->DayRange->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="DayRangeFrom"
+                                       Label="<%[ From day ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="DayRangeTo"
+                                       Label="<%[ To day ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="DayRange"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select day range in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->DayRange->ClientID%>').prop('checked') && (($('#<%=$this->DayRangeFrom->ClientID%>_Directive').val()).trim() === '' || ($('#<%=$this->DayRangeTo->ClientID%>_Directive').val()).trim() === ''));
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
                </div>
-               <div id="week_range<%=$this->WeekSingle->ClientID%>" class="w3-margin week<%=$this->WeekSingle->ClientID%>" style="display: <%=$this->WeekRange->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="WeekRangeFrom"
-                               Label="<%[ From week ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="WeekRangeTo"
-                               Label="<%[ To week ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
+               <div class="w3-border w3-padding w3-margin-top w3-margin-bottom">
+                       <h3><%[ Day of week ]%></h3>
+                       <div style="display: flex; flex-wrap: wrap;">
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="WdayDisable"
+                                               CssClass="w3-radio"
+                                               GroupName="Wday"
+                                               Attributes.onchange="$('.day<%=$this->WdaySingle->ClientID%>').hide();"
+                                               Checked="true" />
+                                       <com:TLabel ForControl="WdayDisable" Text="<%[ Run every day of week ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="WdaySingle"
+                                               CssClass="w3-radio"
+                                               GroupName="Wday"
+                                               Attributes.onchange="$('.day<%=$this->WdaySingle->ClientID%>').hide();$('#day<%=$this->WdaySingle->ClientID%>').show()" />
+                                       <com:TLabel ForControl="WdaySingle" Text="<%[ Run one day of week ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="WdayRange"
+                                               CssClass="w3-radio"
+                                               GroupName="Wday"
+                                               Attributes.onchange="$('.day<%=$this->WdaySingle->ClientID%>').hide();$('#day_range<%=$this->WdaySingle->ClientID%>').show()" />
+                                       <com:TLabel ForControl="WdayRange" Text="<%[ Run from day of week to day of week (range) ]%>" />
+                               </div>
+                       </div>
+                       <div id="day<%=$this->WdaySingle->ClientID%>" class="w3-margin day<%=$this->WdaySingle->ClientID%>" style="display: <%=$this->WdaySingle->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="Wday"
+                                       Label="<%[ Day of week ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="WdaySingle"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select day of week in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->WdaySingle->ClientID%>').prop('checked') && ($('#<%=$this->Wday->ClientID%>_Directive').val()).trim() === '');
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
+                       <div id="day_range<%=$this->WdaySingle->ClientID%>" class="w3-margin day<%=$this->WdaySingle->ClientID%>" style="display: <%=$this->WdayRange->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="WdayRangeFrom"
+                                       Label="<%[ From day of week ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:Application.Web.Portlets.DirectiveComboBox
+                                       ID="WdayRangeTo"
+                                       Label="<%[ To day of week ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="WdayRange"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select day of week range in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->WdayRange->ClientID%>').prop('checked') && (($('#<%=$this->WdayRangeFrom->ClientID%>_Directive').val()).trim() === '' || ($('#<%=$this->WdayRangeTo->ClientID%>_Directive').val()).trim() === ''));
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
                </div>
-
-               <hr />
-               <com:TRadioButton
-                       ID="DayDisable"
-                       CssClass="w3-radio"
-                       GroupName="Day"
-                       Attributes.onchange="$('.day<%=$this->DaySingle->ClientID%>').hide();"
-                       Checked="true" />
-               <com:TLabel ForControl="DayDisable" Text="<%[ Disabled ]%>" />
-               <com:TRadioButton
-                       ID="DaySingle"
-                       CssClass="w3-radio"
-                       GroupName="Day"
-                       Attributes.onchange="$('.day<%=$this->DaySingle->ClientID%>').hide();$('#day<%=$this->DaySingle->ClientID%>').show()" />
-               <com:TLabel ForControl="DaySingle" Text="<%[ Single day ]%>" />
-               <com:TRadioButton
-                       ID="DayRange"
-                       CssClass="w3-radio"
-                       GroupName="Day"
-                       Attributes.onchange="$('.day<%=$this->DaySingle->ClientID%>').hide();$('#day_range<%=$this->DaySingle->ClientID%>').show()" />
-               <com:TLabel ForControl="DayRange" Text="<%[ Day range ]%>" />
-               <div id="day<%=$this->DaySingle->ClientID%>" class="w3-margin day<%=$this->DaySingle->ClientID%>" style="display: <%=$this->DaySingle->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="Day"
-                               Label="<%[ Day ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-               </div>
-               <div id="day_range<%=$this->DaySingle->ClientID%>" class="w3-margin day<%=$this->DaySingle->ClientID%>" style="display: <%=$this->DayRange->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="DayRangeFrom"
-                               Label="<%[ From day ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="DayRangeTo"
-                               Label="<%[ To day ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-               </div>
-               <hr />
-               <com:TRadioButton
-                       ID="WdayDisable"
-                       CssClass="w3-radio"
-                       GroupName="Wday"
-                       Attributes.onchange="$('.day<%=$this->WdaySingle->ClientID%>').hide();"
-                       Checked="true" />
-               <com:TLabel ForControl="WdayDisable" Text="<%[ Disabled ]%>" />
-               <com:TRadioButton
-                       ID="WdaySingle"
-                       CssClass="w3-radio"
-                       GroupName="Wday"
-                       Attributes.onchange="$('.day<%=$this->WdaySingle->ClientID%>').hide();$('#day<%=$this->WdaySingle->ClientID%>').show()" />
-               <com:TLabel ForControl="WdaySingle" Text="<%[ Single day of week ]%>" />
-               <com:TRadioButton
-                       ID="WdayRange"
-                       CssClass="w3-radio"
-                       GroupName="Wday"
-                       Attributes.onchange="$('.day<%=$this->WdaySingle->ClientID%>').hide();$('#day_range<%=$this->WdaySingle->ClientID%>').show()" />
-               <com:TLabel ForControl="WdayRange" Text="<%[ Day of week range ]%>" />
-               <div id="day<%=$this->WdaySingle->ClientID%>" class="w3-margin day<%=$this->WdaySingle->ClientID%>" style="display: <%=$this->WdaySingle->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="Wday"
-                               Label="<%[ Day of week ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-               </div>
-               <div id="day_range<%=$this->WdaySingle->ClientID%>" class="w3-margin day<%=$this->WdaySingle->ClientID%>" style="display: <%=$this->WdayRange->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="WdayRangeFrom"
-                               Label="<%[ From day of week ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-                       <com:Application.Web.Portlets.DirectiveComboBox
-                               ID="WdayRangeTo"
-                               Label="<%[ To day of week ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-               </div>
-               <hr />
-               <com:TRadioButton
-                       ID="TimeDisable"
-                       CssClass="w3-radio"
-                       GroupName="Time"
-                       Attributes.onchange="$('.day<%=$this->TimeAt->ClientID%>').hide();"
-                       Checked="true" />
-               <com:TLabel ForControl="TimeDisable" Text="<%[ Disabled ]%>" />
-               <com:TRadioButton
-                       ID="TimeAt"
-                       CssClass="w3-radio"
-                       GroupName="Time"
-                       Attributes.onchange="$('.day<%=$this->TimeAt->ClientID%>').hide();$('#day<%=$this->TimeAt->ClientID%>').show()" />
-               <com:TLabel ForControl="TimeAt" Text="<%[ At HH:MM ]%>" />
-               <com:TRadioButton
-                       ID="TimeHourly"
-                       CssClass="w3-radio"
-                       GroupName="Time"
-                       Attributes.onchange="$('.day<%=$this->TimeAt->ClientID%>').hide();$('#day_range<%=$this->TimeAt->ClientID%>').show()" />
-               <com:TLabel ForControl="TimeHourly" Text="<%[ Hourly at ]%>" />
-               <div id="day<%=$this->TimeAt->ClientID%>" class="w3-margin day<%=$this->TimeAt->ClientID%>" style="display: <%=$this->TimeAt->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveTextBox
-                               ID="TimeHourAt"
-                               Label="<%[ Hour ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-                       <com:Application.Web.Portlets.DirectiveTextBox
-                               ID="TimeMinAt"
-                               Label="<%[ Minute ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
-               </div>
-               <div id="day_range<%=$this->TimeAt->ClientID%>" class="w3-margin day<%=$this->TimeAt->ClientID%>" style="display: <%=$this->TimeHourly->Checked ? 'block' : 'none'%>">
-                       <com:Application.Web.Portlets.DirectiveTextBox
-                               ID="TimeMinHourly"
-                               Label="<%[ Minute ]%>"
-                               InConfig="true"
-                               Show="true"
-                               CssClass="smallbox"
-                       />
+               <div class="w3-border w3-padding w3-margin-top w3-margin-bottom">
+                       <h3><%[ Hour and minute ]%></h3>
+                       <div style="display: flex; flex-wrap: wrap;">
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="TimeDisable"
+                                               CssClass="w3-radio"
+                                               GroupName="Time"
+                                               Attributes.onchange="$('.day<%=$this->TimeAt->ClientID%>').hide();" />
+                                       <com:TLabel ForControl="TimeDisable" Text="<%[ Run every full hour ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="TimeAt"
+                                               CssClass="w3-radio"
+                                               GroupName="Time"
+                                               Attributes.onchange="$('.day<%=$this->TimeAt->ClientID%>').hide();$('#day<%=$this->TimeAt->ClientID%>').show()" />
+                                       <com:TLabel ForControl="TimeAt" Text="<%[ Run at hour and minute ]%>" />
+                               </div>
+                               <div class="option_cell">
+                                       <com:TRadioButton
+                                               ID="TimeHourly"
+                                               CssClass="w3-radio"
+                                               GroupName="Time"
+                                               Attributes.onchange="$('.day<%=$this->TimeAt->ClientID%>').hide();$('#day_range<%=$this->TimeAt->ClientID%>').show()" />
+                                       <com:TLabel ForControl="TimeHourly" Text="<%[ Run hourly at minute ]%>" />
+                               </div>
+                       </div>
+                       <div id="day<%=$this->TimeAt->ClientID%>" class="w3-margin day<%=$this->TimeAt->ClientID%>" style="display: <%=$this->TimeAt->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveTextBox
+                                       ID="TimeHourAt"
+                                       Label="<%[ Hour ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:Application.Web.Portlets.DirectiveTextBox
+                                       ID="TimeMinAt"
+                                       Label="<%[ Minute ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="TimeAt"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select hour and minute in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->TimeAt->ClientID%>').prop('checked') && (($('#<%=$this->TimeHourAt->ClientID%>_Directive').val()).trim() === '' || ($('#<%=$this->TimeMinAt->ClientID%>_Directive').val()).trim() === ''));
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
+                       <div id="day_range<%=$this->TimeAt->ClientID%>" class="w3-margin day<%=$this->TimeAt->ClientID%>" style="display: <%=$this->TimeHourly->Checked ? 'block' : 'none'%>">
+                               <com:Application.Web.Portlets.DirectiveTextBox
+                                       ID="TimeMinHourly"
+                                       Label="<%[ Minute ]%>"
+                                       InConfig="true"
+                                       Show="true"
+                                       CssClass="smallbox"
+                               />
+                               <com:TCustomValidator
+                                       ValidationGroup="Directive"
+                                       ControlToValidate="TimeHourly"
+                                       Display="None"
+                                       ClientValidationFunction="schedule_required_fields_validator"
+                                       ErrorMessage="<%=Prado::localize('Please select hour in Run block')%> #<%=($this->ItemIndex+1)%>.">
+                                       <prop:ClientSide.OnValidate>
+                                               sender.enabled = ($('#<%=$this->TimeHourly->ClientID%>').prop('checked') && ($('#<%=$this->TimeMinHourly->ClientID%>_Directive').val()).trim() === '');
+                                       </prop:ClientSide.OnValidate>
+                               </com:TCustomValidator>
+                       </div>
                </div>
        </div>
+       <com:TCustomValidator
+               ValidationGroup="Directive"
+               ControlToValidate="TimeDisable"
+               Display="None"
+               ClientValidationFunction="schedule_required_fields_validator"
+               ErrorMessage="<%=Prado::localize('Please choose at least month or week or day of week or hour in Run block')%> #<%=($this->ItemIndex+1)%>.">
+               <prop:ClientSide.OnValidate>
+                       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);
+               </prop:ClientSide.OnValidate>
+       </com:TCustomValidator>
        </prop:ItemTemplate>
 </com:TActiveRepeater>
+<com:TValidationSummary
+        ValidationGroup="Directive"
+        Display="None"
+       HeaderText="<%[ Validation error ]%>"
+ />
+<script>
+function schedule_required_fields_validator(sender, param) {
+       return false;
+}
+</script>
index 2b03ebedc4dfc2737cd9cb9b973a68a02576d150..54d3d9e43048ae27844a9c4e37ad6a8bed550a04 100644 (file)
@@ -270,3 +270,7 @@ table.status_table td, table.status_table td i {
 a.raw {
        text-decoration: none;
 }
+
+.option_cell {
+       width: 330px;
+}