3 # Display a list of packages where the name or description matches some string
5 require './cluster-software-lib.pl';
9 @hosts = &list_software_hosts();
10 @servers = &list_servers();
13 foreach $p (@{$h->{'packages'}}) {
14 if (($p->{'name'} =~ /\Q$s\E/i || $p->{'desc'} =~ /\Q$s\E/i) &&
15 !$already{$p->{'name'}}++) {
21 push(@servs, &host_to_server($h));
25 &redirect("edit_pack.cgi?package=".&urlize($match[0]->{'name'}));
29 &ui_print_header(undef, $text{'search_title'}, "", "search");
31 @match = sort { lc($a->{'name'}) cmp lc($b->{'name'}) } @match;
32 print "<b>",&text('search_match', "<tt>$s</tt>"),"</b><br>\n";
34 print &ui_form_start("delete_packs.cgi", "post");
35 print &ui_hidden("search", $in{'search'}),"\n";
36 @links = ( &select_all_link("del", 0),
37 &select_invert_link("del", 0) );
39 print &ui_links_row(\@links);
40 print &ui_columns_start([ "",
42 $text{'search_class'},
43 $text{'search_desc'} ], 100, 0, \@tds);
46 push(@cols, "<a href=\"edit_pack.cgi?search=$s&package=".
47 &urlize($i->{'name'})."\">$i->{'name'}</a>");
49 push(@cols, $i->{'class'} || $text{'search_none'});
50 push(@cols, $i->{'desc'});
51 print &ui_checked_columns_row(\@cols, \@tds,
54 print &ui_columns_end();
55 print &ui_links_row(\@links);
57 # Show button to delete, and servers to remove from
58 print &ui_submit($text{'search_delete'}),"\n";
59 print &ui_select("server", undef,
60 [ [ -1, $text{'edit_all'} ],
61 map { [ $_->{'id'}, &server_name($_) ] } @servs ]);
65 print "<b>",&text('search_nomatch', "<tt>$s</tt>"),"</b>\n";
68 &ui_print_footer("", $text{'index_return'});