diff options
Diffstat (limited to 'httemplate/search/svc_forward.cgi')
-rwxr-xr-x | httemplate/search/svc_forward.cgi | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/httemplate/search/svc_forward.cgi b/httemplate/search/svc_forward.cgi index dc002d96a..4d44c9ca6 100755 --- a/httemplate/search/svc_forward.cgi +++ b/httemplate/search/svc_forward.cgi @@ -1,23 +1,19 @@ -% -% %my $conf = new FS::Conf; % -%my($query)=$cgi->keywords; -%$query ||= ''; #to avoid use of unitialized value errors +%my $orderby = 'ORDER BY svcnum'; +%my @extra_sql = (); +%if ( $cgi->param('magic') =~ /^(all|unlinked)$/ ) { % -%my $orderby; +% push @extra_sql, 'pkgnum IS NULL' +% if $cgi->param('magic') eq 'unlinked'; % -%my @extra_sql = (); -%if ( $query =~ /^UN_(.*)$/ ) { #UN searches need to be acl'ed (and need to -% #fix $agentnums_sql -% $query = $1; -% push @extra_sql, 'pkgnum IS NULL'; -%} +% if ( $cgi->param('sortby') =~ /^(\w+)$/ ) { +% my $sortby = $1; +% $orderby = "ORDER BY $sortby"; +% } % -%if ( $query eq 'svcnum' ) { -% $orderby = 'ORDER BY svcnum'; -%} else { -% eidiot('unimplemented'); +%} elsif ( $cgi->param('svcpart') =~ /^(\d+)$/ ) { +% push @extra_sql, "svcpart = $1"; %} % %my $addl_from = ' LEFT JOIN cust_svc USING ( svcnum ) '. |