X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fphone_avail.html;h=8dec7b247531f3e5bc81ebab2afb1acf51662a89;hb=636dd1f25af52d35efe7a323a5765ff5adeadf83;hp=e1c264fb662db61636d36d122553b4fef3f2d809;hpb=87fbaed3903546e36a9ce8da91c609999caf140b;p=freeside.git diff --git a/httemplate/search/phone_avail.html b/httemplate/search/phone_avail.html index e1c264fb6..8dec7b247 100644 --- a/httemplate/search/phone_avail.html +++ b/httemplate/search/phone_avail.html @@ -29,25 +29,35 @@ '+'. $pn->countrycode. ' '. $pn->npa. ' '. $pn->nxx. '-'. $pn->station; }, - 'name', + 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,13 +79,15 @@ '', '', FS::UI::Web::cust_styles(), + '', ], ) %> <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); + unless ( $FS::CurrentUser::CurrentUser->access_right('List inventory') + ); my @search = (); @@ -128,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']; + } + ''; +}; +