X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_svc.html;h=9a43a4139b0a1d45cbe7b060c13500593d82ed65;hb=4688c4a55a51c4ce2100c1c98e7e650eb77ac95d;hp=568b43b18a89f707a638e442f5c7e099644441e2;hpb=633c48448d9468690b7ad77eb6ff7c660a286658;p=freeside.git diff --git a/httemplate/search/cust_svc.html b/httemplate/search/cust_svc.html index 568b43b18..9a43a4139 100644 --- a/httemplate/search/cust_svc.html +++ b/httemplate/search/cust_svc.html @@ -21,14 +21,28 @@ 'links' => [ $link, $link, # package? - ( map { $link_cust } + ( map { $_ ne 'Cust. Status' ? $link_cust : '' } FS::UI::Web::cust_header() ), ], + 'align' => 'rl'. FS::UI::Web::cust_aligns(), + 'color' => [ + '', + '', + FS::UI::Web::cust_colors(), + ], + 'style' => [ + '', + '', + FS::UI::Web::cust_styles(), + ], ) %> <%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('List services'); + my $addl_from = ' LEFT JOIN part_svc USING ( svcpart ) '. ' LEFT JOIN cust_pkg USING ( pkgnum ) '. ' LEFT JOIN cust_main USING ( custnum ) '; @@ -39,6 +53,7 @@ my $orderby = 'ORDER BY svcnum'; #has to be ordered by something if ( length( $cgi->param('search_svc') ) ) { my $string = $cgi->param('search_svc'); + $string =~ s/(^\s+|\s+$)//; #trim leading & trailing whitespace # implement fuzzy searching in subclasses too at some point? # service searching maybe shouldn't be fuzzy... @@ -100,11 +115,24 @@ my $count_query = "SELECT COUNT(*) FROM cust_svc $addl_from $extra_sql"; my $link = sub { my $cust_svc = shift; - my $url = FS::UI::Web::svc_url( + my $url = svc_url( 'm' => $m, 'action' => 'view', #'part_svc' => $cust_svc->part_svc, 'svcdb' => $cust_svc->svcdb, #we have it from the joined search #'svc' => $cust_svc, #redundant - 'query' => 'svcnum=', + 'query' => '', ); + [ $url, 'svcnum' ]; +}; + +my $link_cust = sub { + my $cust_svc = shift; + if ( $cust_svc->custnum ) { + [ "${p}view/cust_main.cgi?", 'custnum' ]; + } else { + ''; + } +}; + +