first part of ACL and re-skinning work and some other small stuff
[freeside.git] / httemplate / edit / part_referral.cgi
1 <%
2
3 my $part_referral;
4 if ( $cgi->param('error') ) {
5   $part_referral = new FS::part_referral ( {
6     map { $_, scalar($cgi->param($_)) } fields('part_referral')
7   } );
8 } elsif ( $cgi->keywords ) {
9   my($query) = $cgi->keywords;
10   $query =~ /^(\d+)$/;
11   $part_referral = qsearchs( 'part_referral', { 'refnum' => $1 } );
12 } else { #adding
13   $part_referral = new FS::part_referral {};
14 }
15 my $action = $part_referral->refnum ? 'Edit' : 'Add';
16 my $hashref = $part_referral->hashref;
17
18 my $p1 = popurl(1);
19
20 %><%= include('/elements/header.html', "$action Advertising source", menubar(
21   'Main Menu' => popurl(2),
22   'View all advertising sources' => popurl(2). "browse/part_referral.cgi",
23 )) %>
24
25 <% if ( $cgi->param('error') ) { %>
26   <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
27 <% } %>
28
29 <FORM ACTION="<%= $p1 %>process/part_referral.cgi" METHOD=POST>
30
31 <INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $hashref->{refnum} %>">
32
33 <%
34 #print "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)";
35 %>
36
37 Advertising source <INPUT TYPE="text" NAME="referral" SIZE=32 VALUE="<%= $hashref->{referral} %>">
38
39 <BR>
40 <INPUT TYPE="submit" VALUE="<%= $hashref->{refnum} ? "Apply changes" : "Add advertising source" %>">
41
42 </FORM>
43
44 <%= include('/elements/footer.html') %>