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