From eb4ff7f73c5d4bdf74a3472448b5a195598ff4cd Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 1 Aug 2007 22:26:52 +0000 Subject: event refactor, landing on HEAD! --- httemplate/elements/tr-select-part_referral.html | 37 ++++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'httemplate/elements/tr-select-part_referral.html') diff --git a/httemplate/elements/tr-select-part_referral.html b/httemplate/elements/tr-select-part_referral.html index 35c5b8047..cd26c254d 100644 --- a/httemplate/elements/tr-select-part_referral.html +++ b/httemplate/elements/tr-select-part_referral.html @@ -1,30 +1,35 @@ -% -% my( $refnum, %opt ) = @_; -% -% $opt{'part_referrals'} ||= -% [ FS::part_referral->all_part_referral( 1 ) ]; #1: include global -% -% my $r = qq!* !; -% -% % if ( scalar( @{$opt{'part_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.html and create one or more advertising sources."; % } elsif ( scalar( @{$opt{'part_referrals'}} ) == 1 ) { -% + - % } else { - - <%$r%>Advertising source +% if ( $opt{'label'} ) { + <% $opt{'label'} %> +% } else { + <%$r%>Advertising source +% } - <% include( '/elements/select-part_referral.html', $refnum, - 'part_referrals' => $opt{'part_referrals'}, - ) + <% include( '/elements/select-part_referral.html', + 'curr_value' => $refnum, + %opt + ) %> + % } +<%init> + +my %opt = @_; +my $refnum = $opt{'curr_value'} || $opt{'value'}; + +$opt{'part_referrals'} ||= + [ FS::part_referral->all_part_referral( 1 ) ]; #1: include global + +my $r = qq!* !; + -- cgit v1.2.1