diff options
author | jeff <jeff> | 2006-10-27 17:01:31 +0000 |
---|---|---|
committer | jeff <jeff> | 2006-10-27 17:01:31 +0000 |
commit | 576c6b48428aa95e0fd80db011fe73c0b728c88b (patch) | |
tree | 79b8ddfe015d3732269f402d7129d4d36194bb9e /httemplate/edit/cust_main_note.cgi | |
parent | fc3483c8679daf2e00467db05342e9fcd314d541 (diff) |
editable notes
Diffstat (limited to 'httemplate/edit/cust_main_note.cgi')
-rwxr-xr-x | httemplate/edit/cust_main_note.cgi | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/httemplate/edit/cust_main_note.cgi b/httemplate/edit/cust_main_note.cgi index 468ef0051..303895bd8 100755 --- a/httemplate/edit/cust_main_note.cgi +++ b/httemplate/edit/cust_main_note.cgi @@ -1,4 +1,4 @@ -<% include('/elements/header-popup.html', 'Add Customer Note') %> +<% include('/elements/header-popup.html', "$action Customer Note") %> % if ( $cgi->param('error') ) { <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT> @@ -7,6 +7,7 @@ <FORM ACTION="<% popurl(1) %>process/cust_main_note.cgi" METHOD=POST> <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>"> +<INPUT TYPE="hidden" NAME="notenum" VALUE="<% $notenum %>"> <BR><BR> @@ -15,23 +16,36 @@ </TEXTAREA> <BR><BR> -<INPUT TYPE="submit" VALUE="Add note"> +<INPUT TYPE="submit" VALUE="<% $notenum ? "Apply Changes" : "Add Note" %>"> </FORM> </BODY> </HTML> <%init> -my($custnum, $comment); +my($custnum, $comment, $notenum, $action); $comment = ''; if ( $cgi->param('error') ) { $comment = $cgi->param('comment'); +}elsif ($cgi->param('notenum')) { + $cgi->param('notenum') =~ /^(\d+)$/; + $notenum = $1; + die "illegal query ". $cgi->keywords unless $notenum; + my $note = qsearchs('cust_main_note', { 'notenum' => $notenum }); + die "no such note: ". $notenum unless $note; + $comment = $note->comments; } + +$cgi->param('notenum') =~ /^(\d+)$/; +$notenum = $1; + $cgi->param('custnum') =~ /^(\d+)$/; $custnum = $1; die "illegal query ". $cgi->keywords unless $custnum; +$action = $notenum ? 'Edit' : 'Add'; + </%init> |