[freeside-commits] branch master updated. 00755aee33cc3ecdf3634bcc0f50f54814bfc400

Mark Wells mark at 420.am
Mon Apr 29 11:37:03 PDT 2013


The branch, master has been updated
       via  00755aee33cc3ecdf3634bcc0f50f54814bfc400 (commit)
      from  f4ee951f84a23a683cff75ed8cfd88cf693e462c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 00755aee33cc3ecdf3634bcc0f50f54814bfc400
Author: Mark Wells <mark at freeside.biz>
Date:   Mon Apr 29 11:36:01 2013 -0700

    delete customer notes, #22296

diff --git a/httemplate/misc/delete-note.html b/httemplate/misc/delete-note.html
new file mode 100644
index 0000000..436326f
--- /dev/null
+++ b/httemplate/misc/delete-note.html
@@ -0,0 +1,11 @@
+<%init>
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Edit customer note');
+
+my ($notenum) = $cgi->keywords;
+$notenum =~ /^\d+$/ or die "bad notenum '$notenum'";
+my $note = FS::cust_main_note->by_key($notenum)
+  or die "notenum '$notenum' not found";
+$note->delete;
+</%init>
+<% $cgi->redirect($p.'view/cust_main.cgi?'.$note->custnum) %>
diff --git a/httemplate/view/cust_main/notes.html b/httemplate/view/cust_main/notes.html
index 1e9f464..2de68ff 100755
--- a/httemplate/view/cust_main/notes.html
+++ b/httemplate/view/cust_main/notes.html
@@ -63,7 +63,11 @@
 %
 %   my $edit = '';
 %   if ($curuser->access_right('Edit customer note') ) {
-%     $edit = qq! <A HREF="javascript:void(0);" $clickjs>(!.emt('edit').')</A>';
+%     my $delete_url = $fsurl.'misc/delete-note.html?'.$notenum;
+%     $edit = qq! <A HREF="javascript:void(0);" $clickjs>(!.emt('edit').')</A>'.
+%             qq! <A HREF="$delete_url" !.
+%             qq! onclick="return confirm('Delete this note?')">!.
+%             '('.emt('delete').')</A>';
 %   }
 %
 % if ( $last_classnum != $note->classnum && !$skipheader ) {

-----------------------------------------------------------------------

Summary of changes:
 httemplate/misc/delete-note.html     |   11 +++++++++++
 httemplate/view/cust_main/notes.html |    6 +++++-
 2 files changed, 16 insertions(+), 1 deletions(-)
 create mode 100644 httemplate/misc/delete-note.html




More information about the freeside-commits mailing list