2 # Convert inputs into a schedule string, and update the original field
4 require './bacula-backup-lib.pl';
6 &error_setup($text{'chooser_err'});
8 # Validate inputs and make the object
10 foreach $f ("months", "weekdays", "weekdaynums", "days") {
12 $sched->{$f."_all"} = 1;
15 defined($in{$f}) || &error($text{'chooser_e'.$f});
16 $sched->{$f} = [ split(/\0/, $in{$f}) ];
19 $in{'hour'} =~ /^\d+$/ && $in{'hour'} >= 0 && $in{'hour'} < 24 ||
20 &error($text{'chooser_ehour'});
21 $sched->{'hour'} = $in{'hour'};
22 $in{'minute'} =~ /^\d+$/ && $in{'minute'} >= 0 && $in{'minute'} < 60 ||
23 &error($text{'chooser_eminute'});
24 $sched->{'minute'} = $in{'minute'};
26 # Update the original field
27 $str = &join_schedule($sched);
28 &popup_header($text{'chooser_title'});
32 top.opener.ifield.value = "$str";