X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcontact.html;h=24cb237c3ad591b004e84b6bb0ca512d8ee38d8f;hb=1ecd36ac737059c2fd80cd3260cd330df305b304;hp=aaa591cf4b6952bf3a6d8aa8896c6c7e32490da4;hpb=633ca08b978e5c9fa061d24ee2a2f78918e218de;p=freeside.git diff --git a/httemplate/search/contact.html b/httemplate/search/contact.html index aaa591cf4..24cb237c3 100644 --- a/httemplate/search/contact.html +++ b/httemplate/search/contact.html @@ -162,10 +162,10 @@ my %classname = # And now for something completly different: my @report = ( - { label => 'First', field => sub { shift->contact_first }}, - { label => 'Last', field => sub { shift->contact_last }}, - { label => 'Title', field => sub { shift->contact_title }}, - { label => 'E-Mail', field => sub { shift->contact_email_emailaddress }}, + { label => 'First', field => 'contact_first' }, + { label => 'Last', field => 'contact_last' }, + { label => 'Title', field => 'contact_title' }, + { label => 'E-Mail', field => 'contact_email_emailaddress' }, { label => 'Work Phone', field => $get_phone_sub->('Work') }, { label => 'Mobile Phone', field => $get_phone_sub->('Mobile') }, { label => 'Home Phone', field => $get_phone_sub->('Home') }, @@ -195,19 +195,27 @@ my @report = ( $rec->cust_contact_message_dest ? 'Y' : 'N'; }}, { label => 'Customer', - link => sub { - my $rec = shift; - $rec->cust_main_custnum - ? ["${p}view/cust_main.cgi?", 'cust_main_custnum' ] - : ["${p}view/prospect_main.html?", 'prospect_main_prospectnum' ]; - }, + link => [ + "${fsurl}view/", + sub { + my $row = shift; + $row->cust_contact_custnum + ? 'cust_main.cgi?'.$row->cust_contact_custnum + : 'prospect_main.html?'.$row->prospect_contact_prospectnum + } + ], field => sub { my $rec = shift; if ($rec->prospect_contact_prospectnum) { - return $rec->contact_company - || $rec->contact_last.' '.$rec->contact_first; + return encode_entities( + $rec->contact_company + || $rec->contact_last.' '.$rec->contact_first + ); } - $rec->cust_main_company || $rec->cust_main_last.' '.$rec->cust_main_first; + encode_entities( + $rec->cust_main_company + || $rec->cust_main_last.' '.$rec->cust_main_first + ); }}, { label => 'Self-service', field => sub { @@ -218,9 +226,11 @@ my @report = ( { label => 'Comment', field => sub { my $rec = shift; - $rec->prospect_contact_prospectnum - ? $rec->prospect_contact_comment - : $rec->cust_contact_comment; + encode_entities( + $rec->prospect_contact_prospectnum + ? $rec->prospect_contact_comment + : $rec->cust_contact_comment + ); }}, ); @@ -233,10 +243,15 @@ for my $col (@report) { my $classnum_url_part; if (@classnum) { - $classnum_url_part = join '', map{ "&classnums=$_" } @classnum, @dest; + $classnum_url_part = join '', map{ "&classnums=$_" } @classnum; $classnum_url_part .= '&classnums=0' if $classnum_null; } +my $dest_url_part; +if (@dest) { + $dest_url_part = join '', map{ "&dest=$_" } @dest; +} + # E-mail pipeline, from email-customers.html through to email queue job, # doesn't support cust_prospect table my $send_email_link = undef; @@ -252,6 +267,7 @@ if ($link eq 'cust_main') { '&refnum=1'. '&with_email=on'. $classnum_url_part. + $dest_url_part. "\">Email a notice to these customers"; }