Handle hostnames with upper-case letters
[webmin.git] / bacula-backup / list_gjobs.cgi
1 #!/usr/local/bin/perl
2 # Show a list of backup jobs that use node groups
3
4 require './bacula-backup-lib.pl';
5 &ui_print_header(undef, $text{'gjobs_title'}, "", "gjobs");
6
7 $conf = &get_director_config();
8 @jobs = grep { &is_oc_object($_) } &find("JobDefs", $conf);
9 &sort_by_name(\@jobs);
10 if (@jobs) {
11         print &ui_form_start("delete_gjobs.cgi", "post");
12         @links = ( &select_all_link("d"),
13                    &select_invert_link("d"),
14                    "<a href='edit_gjob.cgi?new=1'>$text{'gjobs_add'}</a>" );
15         print &ui_links_row(\@links);
16         @tds = ( "width=5", "width=40%", "width=20%", "width=20%",
17                  "width=20%" );
18         print &ui_columns_start([ "", $text{'jobs_name'},
19                                   $text{'jobs_type'},
20                                   $text{'gjobs_client'},
21                                   $text{'jobs_fileset'} ], "100%", 0, \@tds);
22         foreach $f (@jobs) {
23                 $name = &find_value("Name", $f->{'members'});
24                 $name = &is_oc_object($name);
25                 $type = &find_value("Type", $f->{'members'});
26                 $client = &find_value("Client", $f->{'members'});
27                 $client = &is_oc_object($client);
28                 $fileset = &find_value("FileSet", $f->{'members'});
29                 print &ui_checked_columns_row([
30                         "<a href='edit_gjob.cgi?name=".&urlize($name)."'>".
31                         $name."</a>",
32                         $type || "<i>$text{'default'}</i>",
33                         $client || "<i>$text{'default'}</i>",
34                         $fileset || "<i>$text{'default'}</i>",
35                         ], \@tds, "d", $name);
36                 }
37         print &ui_columns_end();
38         print &ui_links_row(\@links);
39         print &ui_form_end([ [ "delete", $text{'gjobs_delete'} ] ]);
40         }
41 else {
42         print "<b>$text{'jobs_none'}</b><p>\n";
43         print "<a href='edit_gjob.cgi?new=1'>$text{'gjobs_add'}</a><br>\n";
44         }
45
46 &ui_print_footer("", $text{'index_return'});
47