Handle hostnames with upper-case letters
[webmin.git] / bacula-backup / list_schedules.cgi
1 #!/usr/local/bin/perl
2 # Show a list of all backup schedules
3
4 require './bacula-backup-lib.pl';
5 &ui_print_header(undef, $text{'schedules_title'}, "", "schedules");
6
7 $conf = &get_director_config();
8 @schedules = &find("Schedule", $conf);
9 &sort_by_name(\@schedules);
10 if (@schedules) {
11         print &ui_form_start("delete_schedules.cgi", "post");
12         @links = ( &select_all_link("d"),
13                    &select_invert_link("d"),
14                    "<a href='edit_schedule.cgi?new=1'>".
15                    "$text{'schedules_add'}</a>" );
16         print &ui_links_row(\@links);
17         @tds = ( "width=5", "width=30%", "width=70%" );
18         print &ui_columns_start([ "", $text{'schedules_name'},
19                                   $text{'schedules_sched'} ], "100%", 0, \@tds);
20         foreach $f (@schedules) {
21                 $name = &find_value("Name", $f->{'members'});
22                 @runs = &find_value("Run", $f->{'members'});
23                 if (@runs > 2) {
24                         @runs = ( @runs[0..1], "..." );
25                         }
26                 print &ui_checked_columns_row([
27                         "<a href='edit_schedule.cgi?name=".&urlize($name)."'>".
28                         $name."</a>",
29                         join(" , ", @runs),
30                         ], \@tds, "d", $name);
31                 }
32         print &ui_columns_end();
33         print &ui_links_row(\@links);
34         print &ui_form_end([ [ "delete", $text{'schedules_delete'} ] ]);
35         }
36 else {
37         print "<b>$text{'schedules_none'}</b><p>\n";
38         print "<a href='edit_schedule.cgi?new=1'>$text{'schedules_add'}</a><br>\n";
39         }
40
41 &ui_print_footer("", $text{'index_return'});
42