From: ivan Date: Thu, 6 Oct 2005 01:40:35 +0000 (+0000) Subject: fix bug with IE and advertising sources (refnum) - needed to make sure the SELECT... X-Git-Tag: BEFORE_FINAL_MASONIZE~378 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=a25c3f9493bf910a5e8bfe586c66c1ba5d6c8210 fix bug with IE and advertising sources (refnum) - needed to make sure the SELECT OPTIONs have explicitly specified VALUEs --- diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index d10b21a4a..bfd396881 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -104,59 +104,65 @@ my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first <% } %> + + <% +my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; +if ( $custnum && ! $conf->exists('editreferrals') ) { +%> -# (referral and referring customer still need to be "template"ized) + -#referral +<% + } else { -my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; -if ( $custnum && ! $conf->exists('editreferrals') ) { - print qq!!; -} else { - my(@referrals) = qsearch('part_referral',{}); - if ( scalar(@referrals) == 0 ) { - eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources."; - } elsif ( scalar(@referrals) == 1 ) { - $refnum ||= $referrals[0]->refnum; - print qq!!; - } else { - print qq!

${r}Advertising source "; - } -} + my(@referrals) = qsearch('part_referral',{}); + if ( scalar(@referrals) == 0 ) { + eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources."; + } elsif ( scalar(@referrals) == 1 ) { + $refnum ||= $referrals[0]->refnum; +%> + + + +<% } else { %> -#referring customer +

<%=$r%>Advertising source + +<% } %> + +<% } %> + + -#print qq!

Referring Customer: !; +<% my $referring_cust_main = ''; if ( $cust_main->referral_custnum and $referring_cust_main = qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) ) { - print '

Referring Customer: '. - $cust_main->referral_custnum. ': '. - ( $referring_cust_main->company - || $referring_cust_main->last. ', '. $referring_cust_main->first ). - ''; -} elsif ( ! $conf->exists('disable_customer_referrals') ) { - print '

Referring customer number: '; -} else { - print ''; -} - %> +

Referring Customer: + <%= $cust_main->referral_custnum %>: <%= $referring_cust_main->name %> + + +<% } elsif ( ! $conf->exists('disable_customer_referrals') ) { %> + +

Referring customer number: + + +<% } else { %> + + + +<% } %> +

@@ -306,7 +312,7 @@ function copyelement(from, to) { to.value = from.value; } } - //alert(from + ": " + to.name + " => " + to.value); + //alert(from + " (" + from.type + "): " + to.name + " => " + to.value); }