X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-part_referral.html;h=a589528d780942510c85e450f4862abe8d0e34e4;hb=63a268637b2d51a8766412617724b9436439deb6;hp=0108388bc36a1f9a11d3dd4c6e1aaec1ae3e36f8;hpb=e47e9758f480c664bfc3917d798cd69c7d354999;p=freeside.git diff --git a/httemplate/elements/tr-select-part_referral.html b/httemplate/elements/tr-select-part_referral.html index 0108388bc..a589528d7 100644 --- a/httemplate/elements/tr-select-part_referral.html +++ b/httemplate/elements/tr-select-part_referral.html @@ -1,30 +1,37 @@ -<% - my( $refnum, %opt ) = @_; +% if ( scalar( @{$opt{'part_referrals'}} ) == 0 ) { +

You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to advertising source listing and create one or more advertising sources. +% } elsif ( scalar( @{$opt{'part_referrals'}} ) == 1 ) { - $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 { %> +% } else { - <%=$r%>Advertising source - - <%= include( '/elements/select-part_referral.html', $refnum, - 'part_referrals' => $opt{'part_referrals'}, - ) +% if ( $opt{'label'} ) { + <% $opt{'label'} %> +% } else { + <%$r%>Advertising source +% } + + <% 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 $colspan = delete($opt{'colspan'}) || 1; + +my $r = qq!* !; + +