$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();
'Accurate',
'Priority',
'SpoolData',
- 'WritePartAfterJob',
'MaxRunSchedTime',
'NextPool'
);
'2nd' => 'second',
'3rd' => 'third',
'4th' => 'fourth',
- '5th' => 'fifth'
+ '5th' => 'fifth',
+ '6th' => 'sixth'
);
public static $wdays = array(
'sun' => 'Sunday',
$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];
$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;
}
msgid "Disabled"
msgstr "Disabled"
-msgid "Single month"
-msgstr "Single month"
-
-msgid "Month range"
-msgstr "Month range"
-
msgid "From month"
msgstr "From month"
msgid "Month"
msgstr "Month"
-msgid "Single day"
-msgstr "Single day"
-
-msgid "Day range"
-msgstr "Day range"
-
msgid "From day"
msgstr "From 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"
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"
+
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:"
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"
msgid "Hour"
msgstr "Hour"
-msgid "Hourly at"
-msgstr "Hourly at"
-
msgid "Hours"
msgstr "Hours"
msgid "Month"
msgstr "Month"
-msgid "Month range"
-msgstr "Month range"
-
msgid "More jobs"
msgstr "ジョブ一覧"
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 "サイズ"
msgid "Week"
msgstr "Week"
-msgid "Week range"
-msgstr "Week range"
-
msgid "Welcome"
msgstr "Welcome"
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"
+
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"
msgid "Month"
msgstr "MiesiÄ…c"
-msgid "Single day"
-msgstr "Pojedynczy dzień"
-
-msgid "Day range"
-msgstr "Zakres dni"
-
msgid "From day"
msgstr "Od 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"
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"
+
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"
msgid "Month"
msgstr "Mês"
-msgid "Single day"
-msgstr "Único dia"
-
-msgid "Day range"
-msgstr "Intervalo do dia"
-
msgid "From day"
msgstr "Do 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"
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"
+
);
private $overwrite_directives = array(
- 'Level',
'Pool',
- 'Storage',
- 'Messages',
'FullPool',
- 'DifferentialPool',
'IncrementalPool',
- 'Accurate',
+ 'DifferentialPool',
+ 'Level',
+ 'Storage',
+ 'Messages',
'Priority',
'SpoolData',
- 'writepartafterjob',
'MaxRunSchedTime',
+ 'Accurate',
'NextPool'
);
$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);
$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);
$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);
$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);
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);
*/
$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);
}
}
+ 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());
// 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();
$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;
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);
}
$this->setData($data);
$this->SourceTemplateControl->setShowAllDirectives(true);
- $this->loadConfig(null, null);
+ $this->loadConfig();
}
}
?>
<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> <%[ 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>
a.raw {
text-decoration: none;
}
+
+.option_cell {
+ width: 330px;
+}