From ec49e826250476a58686bfb322e7f1839e35983d Mon Sep 17 00:00:00 2001 From: levinse Date: Tue, 28 Dec 2010 17:20:15 +0000 Subject: [PATCH] UI enhancements to phone_avail report, RT10464 --- FS/FS/phone_avail.pm | 11 +++++++++++ httemplate/search/phone_avail.html | 33 +++++++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/FS/FS/phone_avail.pm b/FS/FS/phone_avail.pm index 967d7179e..92286abb7 100644 --- a/FS/FS/phone_avail.pm +++ b/FS/FS/phone_avail.pm @@ -162,6 +162,17 @@ sub cust_svc { qsearchs('cust_svc', { 'svcnum' => $self->svcnum }); } +=item part_export + +=cut + +sub part_export { + my $self = shift; + return '' unless $self->exportnum; + qsearchs('part_export', { 'exportnum' => $self->exportnum }); +} + + sub process_batch_import { my $job = shift; diff --git a/httemplate/search/phone_avail.html b/httemplate/search/phone_avail.html index 0ca09467c..8dec7b247 100644 --- a/httemplate/search/phone_avail.html +++ b/httemplate/search/phone_avail.html @@ -31,23 +31,33 @@ }, sub { shift->get('name') }, 'availbatch', - 'exportnum', #XXX - #sub { }, - 'svcnum', #XXX + sub { + my $pa = shift; + return '' unless $pa->part_export; + $pa->part_export->exportname; + }, + sub { + my $pa = shift; + return '' unless $pa->cust_svc; + my($label,$value) = $pa->cust_svc->label; + $label . ": " . $value; + }, \&FS::UI::Web::cust_fields, + '', ], - 'align' => 'rllllll'.FS::UI::Web::cust_aligns(), + 'align' => 'rllllllc'.FS::UI::Web::cust_aligns(), 'links' => [ '', '', '', '', '', - '', #XXX #$export_link - '', #XXX #$svc_link + '', #XXX #$export_link - to what exactly? + $svc_link, ( map { $_ ne 'Cust. Status' ? $link_cust : '' } FS::UI::Web::cust_header() ), + '', ], 'color' => [ '', @@ -58,6 +68,7 @@ '', '', FS::UI::Web::cust_colors(), + '', ], 'style' => [ '', @@ -68,6 +79,7 @@ '', '', FS::UI::Web::cust_styles(), + '', ], ) %> @@ -129,4 +141,13 @@ my $link_cust = sub { ''; }; +my $svc_link = sub { + my $phone_avail = shift; + my $cust_svc = $phone_avail->cust_svc; + if ( $cust_svc ) { + return [ "${p}view/svc_phone.cgi?", 'svcnum']; + } + ''; +}; + -- 2.11.0