From 30c3ff2acf90e1386fae00759078899c859faf36 Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 3 Oct 2006 22:44:28 +0000 Subject: Enhanced customer notes --- httemplate/edit/process/cust_main_note.cgi | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 httemplate/edit/process/cust_main_note.cgi (limited to 'httemplate/edit/process/cust_main_note.cgi') diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi new file mode 100755 index 000000000..d9251f042 --- /dev/null +++ b/httemplate/edit/process/cust_main_note.cgi @@ -0,0 +1,34 @@ +% +% +%$cgi->param('custnum') =~ /^(\d+)$/ +% or die "Illegal custnum: ". $cgi->param('custnum'); +%my $custnum = $1; +% +%my $otaker = $FS::CurrentUser::CurrentUser->name; +%$otaker = $FS::CurrentUser::CurrentUser->username +% if ($otaker eq "User, Legacy"); +% +%my $new = new FS::cust_main_note ( { +% custnum => $custnum, +% _date => time, +% otaker => $otaker, +% comments => $cgi->param('comment'), +%} ); +% +%my $error = $new->insert; +% +%if ($error) { +% $cgi->param('error', $error); +% print $cgi->redirect(popurl(2). 'cust_main_note.cgi?'. $cgi->query_string ); +%} +% +% +<% header('Note added') %> + + + +% +% + -- cgit v1.2.1 From 576c6b48428aa95e0fd80db011fe73c0b728c88b Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 27 Oct 2006 17:01:31 +0000 Subject: editable notes --- httemplate/edit/process/cust_main_note.cgi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_main_note.cgi') diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi index d9251f042..b94d2271c 100755 --- a/httemplate/edit/process/cust_main_note.cgi +++ b/httemplate/edit/process/cust_main_note.cgi @@ -4,18 +4,33 @@ % or die "Illegal custnum: ". $cgi->param('custnum'); %my $custnum = $1; % +%$cgi->param('notenum') =~ /^(\d+)$/ +% or die "Illegal notenum: ". $cgi->param('notenum'); +%my $notenum = $1; +% %my $otaker = $FS::CurrentUser::CurrentUser->name; %$otaker = $FS::CurrentUser::CurrentUser->username % if ($otaker eq "User, Legacy"); % %my $new = new FS::cust_main_note ( { +% notenum => $notenum, % custnum => $custnum, % _date => time, % otaker => $otaker, % comments => $cgi->param('comment'), %} ); % -%my $error = $new->insert; +%my $error; +%if ($notenum){ +% my $old = qsearchs('cust_main_note', { 'notenum' => $notenum }); +% $error = "No such note: $notenum" unless $old; +% unless($error){ +% map { $new->$_($old->$_) } ('_date', 'otaker'); +% $error = $new->replace($old); +% } +%}else{ +% $error = $new->insert; +%} % %if ($error) { % $cgi->param('error', $error); @@ -23,7 +38,7 @@ %} % % -<% header('Note added') %> +<% header('Note ' . ($notenum ? 'updated' : 'added') ) %> -- cgit v1.2.1 From 9c119c252a4b5e3755426daf454f8d70ff7a7dd7 Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 31 Oct 2006 16:57:30 +0000 Subject: ugh, too restrictive --- httemplate/edit/process/cust_main_note.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/process/cust_main_note.cgi') diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi index b94d2271c..2de9b7f57 100755 --- a/httemplate/edit/process/cust_main_note.cgi +++ b/httemplate/edit/process/cust_main_note.cgi @@ -4,7 +4,7 @@ % or die "Illegal custnum: ". $cgi->param('custnum'); %my $custnum = $1; % -%$cgi->param('notenum') =~ /^(\d+)$/ +%$cgi->param('notenum') =~ /^(\d*)$/ % or die "Illegal notenum: ". $cgi->param('notenum'); %my $notenum = $1; % -- cgit v1.2.1 From 88a07a3c2aac1fff33bd1f400ee5c0672ce716a0 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 26 Nov 2006 23:06:37 +0000 Subject: more ajaxy customer notes --- httemplate/edit/process/cust_main_note.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_main_note.cgi') diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi index 2de9b7f57..8b9105bd8 100755 --- a/httemplate/edit/process/cust_main_note.cgi +++ b/httemplate/edit/process/cust_main_note.cgi @@ -40,9 +40,12 @@ % <% header('Note ' . ($notenum ? 'updated' : 'added') ) %> - % % -- cgit v1.2.1