diff options
author | ivan <ivan> | 2006-08-23 22:25:39 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-08-23 22:25:39 +0000 |
commit | 3ce7691203a7737406bf2d4442f7fd84b81f847e (patch) | |
tree | 90658b097da96772224f04771888ac6ca1a940aa /httemplate/misc/queue.cgi | |
parent | 15e561850b61b10a92a46d8f3e316d53d4970087 (diff) |
Will things ever be the same again?
It's the final masonize
Diffstat (limited to 'httemplate/misc/queue.cgi')
-rw-r--r-- | httemplate/misc/queue.cgi | 93 |
1 files changed, 47 insertions, 46 deletions
diff --git a/httemplate/misc/queue.cgi b/httemplate/misc/queue.cgi index d8e910fb7..7370aabe1 100644 --- a/httemplate/misc/queue.cgi +++ b/httemplate/misc/queue.cgi @@ -1,47 +1,48 @@ -<% +% +% +%$cgi->param('action') =~ /^(new|del|(retry|remove) selected)$/ +% or die "Illegal action"; +%my $action = $1; +% +%my $job; +%if ( $action eq 'new' || $action eq 'del' ) { +% $cgi->param('jobnum') =~ /^(\d+)$/ or die "Illegal jobnum"; +% my $jobnum = $1; +% $job = qsearchs('queue', { 'jobnum' => $1 }) +% or die "unknown jobnum $jobnum - ". +% "it probably completed normally or was removed by another user"; +%} +% +%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; +%} elsif ( $action =~ /^(retry|remove) selected$/ ) { +% foreach my $jobnum ( +% map { /^jobnum(\d+)$/; $1; } grep /^jobnum\d+$/, $cgi->param +% ) { +% my $job = qsearchs('queue', { 'jobnum' => $jobnum }); +% if ( $action eq 'retry selected' && $job ) { #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 'remove selected' && $job ) { #del +% my $error = $job->delete; +% die $error if $error; +% } +% } +%} +% +%print $cgi->redirect(popurl(2). "search/queue.html"); +% +% -$cgi->param('action') =~ /^(new|del|(retry|remove) selected)$/ - or die "Illegal action"; -my $action = $1; - -my $job; -if ( $action eq 'new' || $action eq 'del' ) { - $cgi->param('jobnum') =~ /^(\d+)$/ or die "Illegal jobnum"; - my $jobnum = $1; - $job = qsearchs('queue', { 'jobnum' => $1 }) - or die "unknown jobnum $jobnum - ". - "it probably completed normally or was removed by another user"; -} - -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; -} elsif ( $action =~ /^(retry|remove) selected$/ ) { - foreach my $jobnum ( - map { /^jobnum(\d+)$/; $1; } grep /^jobnum\d+$/, $cgi->param - ) { - my $job = qsearchs('queue', { 'jobnum' => $jobnum }); - if ( $action eq 'retry selected' && $job ) { #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 'remove selected' && $job ) { #del - my $error = $job->delete; - die $error if $error; - } - } -} - -print $cgi->redirect(popurl(2). "search/queue.html"); - -%> |