diff options
author | ivan <ivan> | 2006-08-11 08:02:26 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-08-11 08:02:26 +0000 |
commit | e47e9758f480c664bfc3917d798cd69c7d354999 (patch) | |
tree | e776a5753a1214a797731f4da39518979f1400eb /httemplate/elements/tr-select-part_referral.html | |
parent | dbc120189697e8306f62349c310f5410f8382491 (diff) |
virtualize referrals on customer addition
Diffstat (limited to 'httemplate/elements/tr-select-part_referral.html')
-rw-r--r-- | httemplate/elements/tr-select-part_referral.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/httemplate/elements/tr-select-part_referral.html b/httemplate/elements/tr-select-part_referral.html new file mode 100644 index 000000000..0108388bc --- /dev/null +++ b/httemplate/elements/tr-select-part_referral.html @@ -0,0 +1,30 @@ +<% + my( $refnum, %opt ) = @_; + + $opt{'part_referrals'} ||= + [ FS::part_referral->all_part_referral( 1 ) ]; #1: include global + + my $r = qq!<font color="#ff0000">*</font> !; + +%> + +<% 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 ) { +%> + + <INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $opt{'part_referrals'}->[0]->refnum %>"> + +<% } else { %> + + <TR> + <TH ALIGN="right"><%=$r%>Advertising source</TH> + <TD> + <%= include( '/elements/select-part_referral.html', $refnum, + 'part_referrals' => $opt{'part_referrals'}, + ) + %> + </TD> + </TR> + +<% } %> |