From 457da870c23db87fbbc29d7c667a73f41422dd71 Mon Sep 17 00:00:00 2001 From: levinse Date: Fri, 10 Dec 2010 06:02:53 +0000 Subject: implement customer note classes, RT9995 --- httemplate/browse/cust_note_class.html | 34 +++++++++ httemplate/edit/cust_main_note.cgi | 19 ++++- httemplate/edit/cust_note_class.html | 6 ++ httemplate/edit/elements/class_Common.html | 8 ++- httemplate/edit/process/cust_main_note.cgi | 4 ++ httemplate/edit/process/cust_note_class.html | 11 +++ httemplate/elements/menu.html | 3 + httemplate/view/cust_main.cgi | 2 +- httemplate/view/cust_main/notes.html | 102 ++++++++++++++++++++++----- 9 files changed, 169 insertions(+), 20 deletions(-) create mode 100644 httemplate/browse/cust_note_class.html create mode 100644 httemplate/edit/cust_note_class.html create mode 100644 httemplate/edit/process/cust_note_class.html (limited to 'httemplate') diff --git a/httemplate/browse/cust_note_class.html b/httemplate/browse/cust_note_class.html new file mode 100644 index 000000000..f5d450b9f --- /dev/null +++ b/httemplate/browse/cust_note_class.html @@ -0,0 +1,34 @@ +<% include( 'elements/browse.html', + 'title' => 'Customer note classes', + 'html_init' => $html_init, + 'name' => 'customer note classes', + 'disableable' => 1, + 'disabled_statuspos' => 2, + 'query' => { 'table' => 'cust_note_class', + 'hashref' => {}, + 'order_by' => 'ORDER BY classnum', + }, + 'count_query' => $count_query, + 'header' => $header, + 'fields' => $fields, + 'links' => $links, + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $html_init = + 'Customer note classes define groups of notes for reporting.

'. + qq!Add a customer note class

!; + +my $count_query = 'SELECT COUNT(*) FROM cust_note_class'; + +my $link = [ $p.'edit/cust_note_class.html?', 'classnum' ]; + +my $header = [ '#', 'Class' ]; +my $fields = [ 'classnum', 'classname' ]; +my $links = [ $link, $link ]; + + diff --git a/httemplate/edit/cust_main_note.cgi b/httemplate/edit/cust_main_note.cgi index 439c84414..c4ec071b8 100755 --- a/httemplate/edit/cust_main_note.cgi +++ b/httemplate/edit/cust_main_note.cgi @@ -6,6 +6,18 @@ +% if ($conf->exists('note-classes') && $conf->config('note-classes') > 0) { + Class   + <% include( '/elements/select-table.html', + 'table' => 'cust_note_class', + 'name_col' => 'classname', + 'curr_value' => $classnum, + 'empty_label' => '(none)', + 'hashref' => { 'disabled' => '' }, + ) %> +
+% } + % if( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) {