1 % if ( scalar( @{$opt{'part_referrals'}} ) == 0 ) {
2 <P><FONT SIZE="+1" COLOR="#ff0000">
3 <% mt('At least one advertising source must be created prior to adding a customer, but none have been created.') |h %>
6 % my $createlink = qq!<A HREF="<% popurl(2) %>browse/part_referral.html">!;
7 % my $createlabel = emt("To create one, see [_1]advertising source listing","XXXLINKXXX").'</A>';
8 % $createlabel =~ s/XXXLINKXXX/$createlink/;
12 % } elsif ( scalar( @{$opt{'part_referrals'}} ) == 1 ) {
14 <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'refnum' %>" VALUE="<% $opt{'part_referrals'}->[0]->refnum %>">
17 <& /elements/tr-td-label.html, label => 'Advertising source', %opt &>
18 <TD COLSPAN="<% $colspan %>">
19 <& /elements/select-part_referral.html,
20 'curr_value' => $refnum,
30 my $refnum = $opt{'curr_value'} || $opt{'value'};
32 $opt{'part_referrals'} ||=
33 [ FS::part_referral->all_part_referral( 1 ) ]; #1: include global
35 my $colspan = delete($opt{'colspan'}) || 1;
37 my $r = qq!<font color="#ff0000">*</font> !;