This commit was generated by cvs2svn to compensate for changes in r4888,
[freeside.git] / httemplate / view / cust_main / notes.html
1 %
2 % my $conf = new FS::Conf;
3 %
4 % $cgi->param('custnum') =~ /^(\d+)$/
5 %   or die "No customer specified (bad URL)!";
6 % my $custnum = $1;
7 %
8 % my $cust_main = qsearchs('cust_main', {'custnum' => $custnum} );
9 % die "Custimer not found!" unless $cust_main;
10 %
11 % my (@notes) = $cust_main->notes();
12 % if ( scalar(@notes) ) { 
13
14 <STYLE TYPE="text/css">
15
16 body { background: #e8e8e8 }
17 .inv table { border: none }
18 .inv TH { border: none }
19 .inv TD { border: none }
20
21 </STYLE>
22
23 <TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0 BORDER=0 >
24
25 %#<% include('/elements/table-grid.html') %>
26 %   my $bgcolor1 = '#eeeeee';
27 %   my $bgcolor2 = '#ffffff';
28 %   my $bgcolor = '';
29 %
30 %   foreach my $note (@notes) {
31 %
32 %   if ( $bgcolor eq $bgcolor1 ) {
33 %     $bgcolor = $bgcolor2;
34 %   } else {
35 %     $bgcolor = $bgcolor1;
36 %   }
37 %
38 %
39
40 <TR>
41   <% note_datestr($note,$conf,$bgcolor) %>
42   <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
43     &nbsp;<%$note->otaker%>&nbsp;
44   </TD>
45   <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
46     &nbsp;<%$note->comments%>
47   </TD>
48 </TR>
49
50 % } #end display notes
51
52 </TABLE>
53 % } else { 
54
55 <BR>
56 % } 
57 %
58 %#subroutines
59 %
60 %sub note_datestr {
61 % my($note, $conf, $bgcolor) = @_ or return '';
62 % my $format=qq{<TD class="inv" bgcolor="$bgcolor" align="left"><B>%b</B></TD>}.
63 %            qq{<TD class="inv" bgcolor="$bgcolor" align="right"><B>&nbsp;%o,</B></TD>}.
64 %            qq{<TD class="inv" bgcolor="$bgcolor" align="right"><B>&nbsp;%Y&nbsp;</B></TD>};
65 % $format .= qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="right"><B>&nbsp;%l</TD>}.
66 %            qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="center"><B>:</B></TD>}.
67 %            qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="left"><B>%M</B></TD>}.
68 %            qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="left"><B>&nbsp;%P&nbsp;</B></TD>}
69 %     if $conf->exists('cust_main_note-display_times');
70 %   ( my $strip = time2str($format, $note->_date) ) =~ s/ (\d)/$1/g;
71 %   $strip;
72 % }
73 %
74