summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/queue.cgi25
1 files changed, 25 insertions, 0 deletions
diff --git a/httemplate/misc/queue.cgi b/httemplate/misc/queue.cgi
new file mode 100644
index 000000000..7e962d498
--- /dev/null
+++ b/httemplate/misc/queue.cgi
@@ -0,0 +1,25 @@
+<%
+
+$cgi->param('jobnum') =~ /^(\d+)$/ or die "Illegal jobnum";
+my $jobnum = $1;
+my $job = qsearchs('queue', { 'jobnum' => $1 })
+ or die "unknown jobnum $jobnum";
+
+$cgi->param('action') =~ /^(new|del)$/ or die "Illegal action";
+my $action = $1;
+
+if ( $action eq 'new' ) {
+ my %hash = $job->hash;
+ $hash{'status'} = 'new';
+ $hash{'statustext'} = '';
+ my $new = new FS::queue \%hash;
+ my $error = $new->replace($job);
+ die $error if $error;
+} elsif ( $action eq 'del' ) {
+ my $error = $job->delete;
+ die $error if $error;
+}
+
+print $cgi->redirect(popurl(2). "browse/queue.cgi");
+
+%>