X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fnotes%2Fnotes.html;h=f998ba4c01882d82a0f8d37548a1e267dba44ad3;hp=f36d7d8789d521fb175a3be89346a257204b3bd1;hb=f675734f1eda5b39f891a6fc8f2f29cbd2e36c35;hpb=511c1f635c1c64c90a7ae882730504f145c8a09c diff --git a/httemplate/view/cust_main/notes/notes.html b/httemplate/view/cust_main/notes/notes.html index f36d7d878..f998ba4c0 100644 --- a/httemplate/view/cust_main/notes/notes.html +++ b/httemplate/view/cust_main/notes/notes.html @@ -2,60 +2,44 @@ <& /elements/init_overlib.html &> -% if ( $note_classes_conf ) { +% if ( $use_class_tabs ) { <% mt('Show notes of class:') |h %>   % # list unclassified last -% foreach my $classnum ( (grep { $_ != 0} sort { $a <=> $b } (keys %classes)), '0' ) { - $b } (keys %classes)), '0' ) { + <% $classes{$classnum} %> -% } +% }
-% } +% } <& /elements/table-grid.html &> @@ -64,7 +48,7 @@ function display_notes_classnum (classnum) { <% mt('Time') |h %> % } <% mt('Employee') |h %> -% if ($note_classes_conf) { +% if ($use_classes) { <% mt('Class') |h %> % } <% mt('Note') |h %> @@ -100,15 +84,14 @@ function display_notes_classnum (classnum) { % '('.emt('delete').')'; % } % - > + > <% note_datestr($note,$conf) %>  <% $note->usernum ? $note->access_user->name : $note->otaker %> -% if ($note_classes_conf) { +% if ($use_classes) { <% $note->classname %> @@ -122,9 +105,13 @@ function display_notes_classnum (classnum) { % } #end foreach note +% if (@notes) { +% } else { +

<% emt('No notes for this customer') %>

+% } <%init> @@ -138,11 +125,11 @@ my(%opt) = @_; my $cust_main = $opt{'cust_main'}; my $custnum = $cust_main->custnum; -my $note_classes_conf = $conf->exists('note-classes') ? $conf->config('note-classes') : ''; - my (@notes) = $cust_main->notes(); my %classes = map { ($_->classnum || 0) => ( $_->classname ne '' ? $_->classname : '('.emt('unclassified').')' ) } @notes; +my $use_classes = grep { $_ > 0 } keys %classes; # show class column +my $use_class_tabs = (keys %classes > 1) ? 1 : 0; # use class tabs $classes{'-1'} = 'All'; #subroutines