- should finish off the part_svc -> part_export s/one-to-many/many-to-many/
[freeside.git] / httemplate / misc / queue.cgi
1 <%
2
3 $cgi->param('jobnum') =~ /^(\d+)$/ or die "Illegal jobnum";
4 my $jobnum = $1;
5 my $job = qsearchs('queue', { 'jobnum' => $1 })
6   or die "unknown jobnum $jobnum";
7
8 $cgi->param('action') =~ /^(new|del)$/ or die "Illegal action";
9 my $action = $1;
10
11 if ( $action eq 'new' ) {
12   my %hash = $job->hash;
13   $hash{'status'} = 'new';
14   $hash{'statustext'} = '';
15   my $new = new FS::queue \%hash;
16   my $error = $new->replace($job);
17   die $error if $error;
18 } elsif ( $action eq 'del' ) {
19   my $error = $job->delete;
20   die $error if $error;
21 }
22
23 print $cgi->redirect(popurl(2). "browse/queue.cgi");
24
25 %>