-%
-%
-%my $hashref = {};
-%
-%my $conf = new FS::Conf;
-%my $dangerous = $conf->exists('queue_dangerous_controls');
-%
-%my $noactions = 0;
-%
-%my $count_query = 'SELECT COUNT(*) FROM queue'; # + $hashref
-%
-%my $areboxes = 0;
-%
-%
-<% include( 'elements/search.html',
+<& elements/search.html,
'title' => 'Job Queue',
- 'menubar' => [ 'Main menu' => $p, ],
'name' => 'jobs',
'html_form' => qq!<FORM NAME="jobForm" ACTION="$p/misc/queue.cgi" METHOD="POST">!,
'query' => { 'table' => 'queue',
'hashref' => $hashref,
- 'extra_sql' => 'ORDER BY jobnum',
+ 'order_by' => 'ORDER BY jobnum',
},
'count_query' => $count_query,
'header' => [ '#',
|| ( ! $noactions
&& $status =~ /^failed/
|| $status =~ /^locked/
+ || $status =~ /^done/
);
if ( $changable ) {
+ $status .= qq! (!;
+ $status .=
+ qq! <A HREF="$p/misc/queue.cgi?jobnum=$jobnum&action=new">retry</A> |!
+ unless $status =~ /^done/;
$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> )!;
}
$status;
'';
}
},
- )
+
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Job queue');
+
+my $hashref = {};
+
+my $conf = new FS::Conf;
+my $dangerous = $conf->exists('queue_dangerous_controls');
+
+my $noactions = 0;
+
+my $count_query = 'SELECT COUNT(*) FROM queue'; # + $hashref
+
+my $areboxes = 0;
-%>
+</%init>