summaryrefslogtreecommitdiff
path: root/httemplate/misc/queue.cgi
blob: 7e962d4985e7b9005427c75a154e391551dcb875 (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
<%

$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");

%>