X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fnotes.html;h=7a19f8b3833103556581b9b96e05298c2247d72d;hb=1cde870268b03197da75f089669d60a7ba3c5617;hp=c1a33b0204feb68da566b682d6687a06f1bac936;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/httemplate/view/cust_main/notes.html b/httemplate/view/cust_main/notes.html index c1a33b020..7a19f8b38 100755 --- a/httemplate/view/cust_main/notes.html +++ b/httemplate/view/cust_main/notes.html @@ -1,74 +1,70 @@ -% -% my $conf = new FS::Conf; -% -% $cgi->param('custnum') =~ /^(\d+)$/ -% or die "No customer specified (bad URL)!"; -% my $custnum = $1; -% -% my $cust_main = qsearchs('cust_main', {'custnum' => $custnum} ); -% die "Custimer not found!" unless $cust_main; -% -% my (@notes) = $cust_main->notes(); -% if ( scalar(@notes) ) { - - +% # Notes, if any + +% my $notecount = scalar($cust_main->notes(0)); +% if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { - +% unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { +

+ <% mt('Notes') |h %> +

-%#<% include('/elements/table-grid.html') %> -% my $bgcolor1 = '#eeeeee'; -% my $bgcolor2 = '#ffffff'; -% my $bgcolor = ''; -% -% foreach my $note (@notes) { -% -% if ( $bgcolor eq $bgcolor1 ) { -% $bgcolor = $bgcolor2; -% } else { -% $bgcolor = $bgcolor1; % } -% -% - - <% note_datestr($note,$conf,$bgcolor) %> - - - +
-% } #end display notes +% # actually display notes +<& notes/notes.html, 'cust_main' => $cust_main &> +
+% } # end of notes -
-  <%$note->otaker%>  - -  <%$note->comments%> -
-% } else { +% # Attachments +% # XXX at some point move all of this into notes/attachments.html +% if( $curuser->access_right('View attachments') ) { +% # List attachments +<& notes/attachments.html, 'cust_main' => $cust_main &> +% if ($cgi->param('show_deleted')) { +">(<% mt('Show active attachments') |h %>) +% } elsif($curuser->access_right('View deleted attachments')) { +">(<% mt('Show deleted attachments') |h %>) +% } +% }
-% } -% -%#subroutines -% -%sub note_datestr { -% my($note, $conf, $bgcolor) = @_ or return ''; -% my $format=qq{%b}. -% qq{ %o,}. -% qq{ %Y }; -% $format .= qq{ %l}. -% qq{:}. -% qq{%M}. -% qq{ %P } -% if $conf->exists('cust_main_note-display_times'); -% ( my $strip = time2str($format, $note->_date) ) =~ s/ (\d)/$1/g; -% $strip; +% if ( $curuser->access_right('View email logs') +% and FS::cust_msg->count("custnum = $custnum")) { +
+<& notes/email.html, 'cust_main' => $cust_main &> +
% } -% +<%init> + +use HTML::Defang; + +my $conf = new FS::Conf; +my $curuser = $FS::CurrentUser::CurrentUser; + +my(%opt) = @_; + +my $cust_main = $opt{'cust_main'}; +my $custnum = $cust_main->custnum; + +my $view = $cgi->param('show') || $curuser->default_customer_view; +