From 1e0dbd55775c7d9eba7db3d17a6173d03e3c2d0a Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 21 Apr 2006 12:45:29 +0000 Subject: s(browse/queue.cgi)(search/queue.html) --- httemplate/search/queue.html | 124 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 httemplate/search/queue.html (limited to 'httemplate/search/queue.html') diff --git a/httemplate/search/queue.html b/httemplate/search/queue.html new file mode 100644 index 000000000..132c05129 --- /dev/null +++ b/httemplate/search/queue.html @@ -0,0 +1,124 @@ +<% + +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', + 'title' => 'Job Queue', + 'menubar' => [ 'Main menu' => $p, ], + 'name' => 'jobs', + 'query' => { 'table' => 'queue', + 'hashref' => $hashref, + 'extra_sql' => 'ORDER BY jobnum', + }, + 'count_query' => $count_query, + 'header' => [ '#', + 'Job', + 'Args', + 'Date', + 'Status', + 'Account', # unless $hashref->{'svcnum'} + '', # checkbox column + ], + 'fields' => [ + 'jobnum', + 'job', + sub { + my $queue = shift; + if ( $dangerous + || $queue->job !~ /^FS::part_export::/ + || !$noactions + ) + { + encode_entities( join(' ', $queue->args) ); + } else { + ''; + } + }, + sub { + time2str( "%a %b %e %T %Y", shift->_date ); + }, + sub { + my $queue = shift; + my $jobnum = $queue->jobnum; + my $status = $queue->status; + $status .= ': '. $queue->statustext + if $queue->statustext; + my @queue_depend = $queue->queue_depend; + $status .= ' (waiting for '. + join(', ', map { $_->depend_jobnum } + @queue_depend + ). + ')' + if @queue_depend; + my $changable = $dangerous + || ( ! $noactions + && $status =~ /^failed/ + || $status =~ /^locked/ + ); + if ( $changable ) { + $status .= + qq! ( retry |!. + qq! remove )!; + } + $status; + }, + sub { + my $queue = shift; + # return '' if $hashref->{'svcnum'} + my $cust_svc = $queue->cust_svc; + my $account; + if ( $cust_svc ) { + my $table = $cust_svc->part_svc->svcdb; + my $label = ( $cust_svc->label )[1]; + qq!$label!; + } else { + ''; + } + }, + sub { + my $queue = shift; + my $jobnum = $queue->jobnum; + my $status = $queue->status; + my $changable = $dangerous + || ( ! $noactions + && $status eq 'failed' + || $status eq 'locked' + ); + if ( $changable ) { + $areboxes = 1; + qq!!; + } else { + ''; + } + }, + ], + #'links' => [ + # '', + # '', + # '', + # '', + # '', + # '', #$acct_link, + # '', + # ], + 'html_foot' => sub { + if ( $areboxes ) { + '
'. + '
'; + } else { + ''; + } + }, + ) + +%> -- cgit v1.2.1 From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/search/queue.html | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'httemplate/search/queue.html') diff --git a/httemplate/search/queue.html b/httemplate/search/queue.html index 132c05129..fa6c1a1ca 100644 --- a/httemplate/search/queue.html +++ b/httemplate/search/queue.html @@ -1,17 +1,18 @@ -<% - -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', +% +% +%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', 'title' => 'Job Queue', 'menubar' => [ 'Main menu' => $p, ], 'name' => 'jobs', -- cgit v1.2.1 From f27a5a08ba712678bf826a47f82f96568208bab3 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 22 Dec 2006 06:18:21 +0000 Subject: patch fixing "retry selected" and "remove select" in queue view --- httemplate/search/queue.html | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/search/queue.html') diff --git a/httemplate/search/queue.html b/httemplate/search/queue.html index fa6c1a1ca..63a5d6c96 100644 --- a/httemplate/search/queue.html +++ b/httemplate/search/queue.html @@ -16,6 +16,7 @@ 'title' => 'Job Queue', 'menubar' => [ 'Main menu' => $p, ], 'name' => 'jobs', + 'html_form' => qq!
!, 'query' => { 'table' => 'queue', 'hashref' => $hashref, 'extra_sql' => 'ORDER BY jobnum', -- cgit v1.2.1 From 61f3f998fe85b1d099100fbe52bc238deebf80f0 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 10 Jan 2007 23:21:14 +0000 Subject: add "select all" and "unselect" all buttons to bulk queue operations --- httemplate/search/queue.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'httemplate/search/queue.html') diff --git a/httemplate/search/queue.html b/httemplate/search/queue.html index 63a5d6c96..675fccd0b 100644 --- a/httemplate/search/queue.html +++ b/httemplate/search/queue.html @@ -16,7 +16,7 @@ 'title' => 'Job Queue', 'menubar' => [ 'Main menu' => $p, ], 'name' => 'jobs', - 'html_form' => qq!!, + 'html_form' => qq!!, 'query' => { 'table' => 'queue', 'hashref' => $hashref, 'extra_sql' => 'ORDER BY jobnum', @@ -115,8 +115,18 @@ # ], 'html_foot' => sub { if ( $areboxes ) { + '
'. + ''. '
'. - '
'; + '
'. + ''; } else { ''; } -- cgit v1.2.1 From 590603ecaea3184f64530755a76626be8205da49 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 3 Feb 2007 11:36:30 +0000 Subject: add customer status column to customer & most other reports. also put the C in ACL in the search/ and graph/ directories. --- httemplate/search/queue.html | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'httemplate/search/queue.html') diff --git a/httemplate/search/queue.html b/httemplate/search/queue.html index 675fccd0b..c343014cc 100644 --- a/httemplate/search/queue.html +++ b/httemplate/search/queue.html @@ -1,17 +1,3 @@ -% -% -%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', 'title' => 'Job Queue', 'menubar' => [ 'Main menu' => $p, ], @@ -134,3 +120,20 @@ ) %> +<%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; + + -- cgit v1.2.1