blob: 6b5237240600ed202bafe988f9ac09dfbbf7e3ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
<%
#<!-- $Id: queue.cgi,v 1.6 2001-10-31 16:52:42 ivan Exp $ -->
use strict;
use vars qw( $cgi $p ); # $part_referral );
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Date::Format;
use FS::UID qw(cgisuidsetup);
use FS::Record qw(qsearch);
use FS::CGI qw(header menubar popurl table);
use FS::queue;
$cgi = new CGI;
&cgisuidsetup($cgi);
$p = popurl(2);
print header("Job Queue", menubar(
'Main Menu' => $p,
# 'Add new referral' => "../edit/part_referral.cgi",
)), &table(), <<END;
<TR>
<TH COLSPAN=2>Job</TH>
<TH>Args</TH>
<TH>Date</TH>
<TH>Status</TH>
</TR>
END
foreach my $queue ( sort {
$a->getfield('jobnum') <=> $b->getfield('jobnum')
} qsearch('queue',{}) ) {
my($hashref)=$queue->hashref;
my $jobnum = $hashref->{jobnum};
my $args = join(' ', $queue->args);
my $date = time2str( "%a %b %e %T %Y", $queue->_date );
my $status = $hashref->{status};
if ( $status eq 'failed' || $status eq 'locked' ) {
$status .=
qq! ( <A HREF="$p/edit/queue.cgi?jobnum=$jobnum&action=new">retry</A> |!.
qq! <A HREF="$p/edit/queue.cgi?jobnum$jobnum&action=del">remove </A> )!;
}
print <<END;
<TR>
<TD>$jobnum</TD>
<TD>$hashref->{job}</TD>
<TD>$args</TD>
<TD>$date</TD>
<TD>$status</TD>
</TR>
END
}
print <<END;
</TABLE>
</BODY>
</HTML>
END
%>
|