X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fqual.cgi;h=7b718e498a76ac86695643d1f69f28cfb625cf5a;hp=58e011406bf8dd993e74b7fc27184d6a68750d10;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hpb=c58774a70c3326ad2ba5a7a38b174dfbd76a9f78 diff --git a/httemplate/search/qual.cgi b/httemplate/search/qual.cgi index 58e011406..7b718e498 100755 --- a/httemplate/search/qual.cgi +++ b/httemplate/search/qual.cgi @@ -1,4 +1,4 @@ -<% include( 'elements/search.html', +<& elements/search.html, 'title' => 'Qualifications', 'name_singular' => 'qualification', 'query' => { 'table' => 'qual', @@ -21,19 +21,11 @@ my $self = shift; $self->status_long; }, - sub { - my $self = shift; - my $cust_or_prospect = $self->cust_or_prospect; - return $cust_or_prospect->name - if $cust_or_prospect->get('custnum'); - return "Prospect #".$cust_or_prospect->prospectnum - if $cust_or_prospect->get('prospectnum'); - ''; - }, - 'phonenum', + sub { shift->cust_or_prospect->name }, + sub { shift->phonenum || '(none - dry loop)' }, sub { my $self = shift; - my %location_hash = $self->location; + my %location_hash= $self->location_hash; # ugh... if ( %location_hash ) { my $loc = new FS::cust_location(\%location_hash); @@ -43,7 +35,7 @@ }, sub { my $self = shift; - my $export = $self->export; + my $export = $self->part_export; my $result = '(manual)'; $result = $export->exportname if $export; $result; @@ -59,8 +51,8 @@ '', '', ], - ) -%> + +&> <%init> die "access denied" @@ -73,6 +65,10 @@ my $extra_sql = ''; if ( $cgi->param('custnum') && $cgi->param('custnum') =~ /^(\d+)$/ ) { $extra_sql = " where custnum = $1 or locationnum in " . " (select locationnum from cust_location where custnum = $1)"; +} elsif ( $cgi->param('prospectnum') + && $cgi->param('prospectnum') =~ /^(\d+)$/ ) { + $extra_sql = " where prospectnum = $1 or locationnum in " + . " (select locationnum from cust_location where prospectnum = $1)"; }