1 <& elements/search.html,
2 'title' => 'Job Queue',
4 'html_form' => qq!<FORM NAME="jobForm" ACTION="$p/misc/queue.cgi" METHOD="POST">!,
5 'query' => { 'table' => 'queue',
7 'order_by' => 'ORDER BY jobnum',
9 'count_query' => $count_query,
15 'Account', # unless $hashref->{'svcnum'}
25 || $queue->job !~ /^FS::part_export::/
29 encode_entities( join(' ', $queue->args) );
35 time2str( "%a %b %e %T %Y", shift->_date );
39 my $jobnum = $queue->jobnum;
40 my $status = $queue->status;
41 $status .= ': '. $queue->statustext
42 if $queue->statustext;
43 my @queue_depend = $queue->queue_depend;
44 $status .= ' (waiting for '.
45 join(', ', map { $_->depend_jobnum }
50 my $changable = $dangerous
52 && $status =~ /^failed/
53 || $status =~ /^locked/
59 qq! <A HREF="$p/misc/queue.cgi?jobnum=$jobnum&action=new">retry</A> |!
60 unless $status =~ /^done/;
62 qq! <A HREF="$p/misc/queue.cgi?jobnum=$jobnum&action=del">remove</A> )!;
68 # return '' if $hashref->{'svcnum'}
69 my $cust_svc = $queue->cust_svc;
72 my $table = $cust_svc->part_svc->svcdb;
73 my $label = ( $cust_svc->label )[1];
74 qq!<A HREF="../view/$table.cgi?!. $queue->svcnum.
82 my $access_user = $queue->access_user;
83 return $access_user ? $access_user->username : '';
87 my $jobnum = $queue->jobnum;
88 my $status = $queue->status;
89 my $changable = $dangerous
91 && $status eq 'failed'
92 || $status eq 'locked'
96 qq!<INPUT NAME="jobnum$jobnum" TYPE="checkbox" VALUE="1">!;
113 '<BR><INPUT TYPE="button" VALUE="select all" onClick="setAll(true)">'.
114 '<INPUT TYPE="button" VALUE="unselect all" onClick="setAll(false)">'.
115 '<BR><INPUT TYPE="submit" NAME="action" VALUE="retry selected">'.
116 '<INPUT TYPE="submit" NAME="action" VALUE="remove selected"><BR>'.
117 '<SCRIPT TYPE="text/javascript">'.
118 ' function setAll(setTo) { '.
119 ' theForm = document.jobForm;'.
120 ' for (i=0,n=theForm.elements.length;i<n;i++)'.
121 ' if (theForm.elements[i].name.indexOf("jobnum") != -1)'.
122 ' theForm.elements[i].checked = setTo;'.
134 unless $FS::CurrentUser::CurrentUser->access_right('Job queue');
138 my $conf = new FS::Conf;
139 my $dangerous = $conf->exists('queue_dangerous_controls');
143 my $count_query = 'SELECT COUNT(*) FROM queue'; # + $hashref