diff options
author | ivan <ivan> | 2002-04-13 08:51:54 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-04-13 08:51:54 +0000 |
commit | f70985da9714a8a2c5dd87f56d891ed0197ef590 (patch) | |
tree | f9c95bdd40f9f2444fa46d9bb595aed50e8c02d9 /FS/FS/queue.pm | |
parent | 81faa8d34d1287a61fd723d73ab02a022cf5d050 (diff) |
bulk queue operations (closes: Bug#389)
Diffstat (limited to 'FS/FS/queue.pm')
-rw-r--r-- | FS/FS/queue.pm | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/FS/FS/queue.pm b/FS/FS/queue.pm index 4b880a23c..5719eff70 100644 --- a/FS/FS/queue.pm +++ b/FS/FS/queue.pm @@ -241,7 +241,10 @@ sub joblisting { my @queue = qsearch( 'queue', $hashref ); return '' unless scalar(@queue); - my $html = FS::CGI::table(). <<END; + my $p = FS::CGI::popurl(2); + + my $html = qq!<FORM ACTION="$p/misc/queue.cgi" METHOD="POST">!. + FS::CGI::table(). <<END; <TR> <TH COLSPAN=2>Job</TH> <TH>Args</TH> @@ -253,7 +256,8 @@ END my $dangerous = $conf->exists('queue_dangerous_controls'); - my $p = FS::CGI::popurl(2); + my $areboxes = 0; + foreach my $queue ( sort { $a->getfield('jobnum') <=> $b->getfield('jobnum') } @queue ) { @@ -270,8 +274,9 @@ END my $date = time2str( "%a %b %e %T %Y", $queue->_date ); my $status = $queue->status; $status .= ': '. $queue->statustext if $queue->statustext; - if ( $dangerous - || ( ! $noactions && $status =~ /^failed/ || $status =~ /^locked/ ) ) { + my $changable = $dangerous + || ( ! $noactions && $status =~ /^failed/ || $status =~ /^locked/ ); + if ( $changable ) { $status .= qq! ( <A HREF="$p/misc/queue.cgi?jobnum=$jobnum&action=new">retry</A> |!. qq! <A HREF="$p/misc/queue.cgi?jobnum=$jobnum&action=del">remove</A> )!; @@ -300,12 +305,24 @@ END $html .= "<TD>$account</TD>"; } + if ( $changable ) { + $areboxes=1; + $html .= + qq!<TD><INPUT NAME="jobnum$jobnum" TYPE="checkbox" VALUE="1"></TD>!; + + } + $html .= '</TR>'; } $html .= '</TABLE>'; + if ( $areboxes ) { + $html .= '<BR><INPUT TYPE="submit" NAME="action" VALUE="retry selected">'. + '<INPUT TYPE="submit" NAME="action" VALUE="remove selected"><BR>'; + } + $html; } @@ -314,7 +331,7 @@ END =head1 VERSION -$Id: queue.pm,v 1.10 2002-03-27 07:08:08 ivan Exp $ +$Id: queue.pm,v 1.11 2002-04-13 08:51:54 ivan Exp $ =head1 BUGS |