From: ivan Date: Tue, 2 Jan 2007 21:46:33 +0000 (+0000) Subject: fix service searching & links X-Git-Tag: TRIXBOX_2_6~780 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=7c654c2d085070a605fd14d1f86558880efca0ab fix service searching & links --- diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 3348d670e..15ec1a730 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -81,6 +81,8 @@ passed as a list of name-value pairs, and include: # 'svcdb' => 'svc_table', # # 'query' => #optional query string + # # (pass a blank string if you want a "raw" URL to add your + # # own svcnum to) # #OR # 'svc' => $svc_x, #or $cust_svc, it just needs a svcnum # @@ -107,7 +109,7 @@ sub svc_url { my $generic = $opt{action} eq 'search' ? 'cust_svc' : 'svc_Common'; $url = "$generic.html?svcdb=$svcdb;"; - $url .= 'svcnum=' if $query =~ /^\d+(;|$)/; + $url .= 'svcnum=' if $query =~ /^\d+(;|$)/ or $query eq ''; } my $p = popurl(2); #? diff --git a/httemplate/search/cust_svc.html b/httemplate/search/cust_svc.html index 568b43b18..1ab5ed171 100644 --- a/httemplate/search/cust_svc.html +++ b/httemplate/search/cust_svc.html @@ -106,5 +106,18 @@ my $link = sub { #'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 { + ''; + } +}; + +