ho ho ho, merry XSSmas
[freeside.git] / httemplate / edit / cust_main_note.cgi
1 <% include('/elements/header-popup.html', "$action Customer Note") %>
2
3 <% include('/elements/error.html') %>
4
5 <FORM ACTION="<% popurl(1) %>process/cust_main_note.cgi" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
7 <INPUT TYPE="hidden" NAME="notenum" VALUE="<% $notenum %>">
8
9
10 <BR><BR>
11 <TEXTAREA NAME="comment" ROWS="12" COLS="60">
12 <% $comment %>
13 </TEXTAREA>
14
15 <BR><BR>
16 <INPUT TYPE="submit" VALUE="<% $notenum ? "Apply Changes" : "Add Note" %>">
17
18 </FORM>
19 </BODY>
20 </HTML>
21
22 <%init>
23 my($custnum, $comment, $notenum, $action); 
24 $comment = '';
25
26 if ( $cgi->param('error') ) {
27   $comment     = $cgi->param('comment');
28 }elsif ($cgi->param('notenum')) {
29   $cgi->param('notenum') =~ /^(\d+)$/;
30   $notenum = $1;
31   die "illegal query ". $cgi->keywords unless $notenum;
32   my $note = qsearchs('cust_main_note', { 'notenum' => $notenum });
33   die "no such note: ". $notenum unless $note;
34   $comment = $note->comments;
35 }
36
37 $cgi->param('notenum') =~ /^(\d+)$/;
38 $notenum = $1;
39
40 $cgi->param('custnum') =~ /^(\d+)$/;
41 $custnum     = $1;
42
43 die "illegal query ". $cgi->keywords unless $custnum;
44
45 $action = $notenum ? 'Edit' : 'Add';
46
47 </%init>
48