fix table titles for new bg color
[freeside.git] / httemplate / elements / header.html
1 <%doc>
2
3 Example:
4
5   include( '/elements/header.html',
6            {
7              'title'   => 'Title',
8              'menubar' => \@menubar,
9              'etc'     => '', #included in <BODY> tag, for things like onLoad=
10              'head'    => '', #included before closing </HEAD> tag
11              'nobr'    => 0,  #1 for no <BR><BR> after the title
12            }
13          );
14
15   #old-style
16   include( '/elements/header.html', 'Title', $menubar, $etc, $head);
17
18
19 </%doc>
20 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
21 %#<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22 %# above is what RT declares, should we switch now? hopefully no glitches result
23 %# or just fuck it, XHTML died anyway, HTML 5 or bust?
24 <HTML>
25   <HEAD>
26     <TITLE>
27       <% $title |h %>
28     </TITLE>
29     <META HTTP-Equiv="Cache-Control" Content="no-cache">
30     <META HTTP-Equiv="Pragma" Content="no-cache">
31     <META HTTP-Equiv="Expires" Content="0"> 
32
33     <% include('menu.html', 'freeside_baseurl' => $fsurl,
34                             'position'         => $menu_position,
35                             'nocss'            => $nocss,
36               ) |n
37     %>
38
39     <% include('init_overlib.html') |n %>
40     <% include('rs_init_object.html') |n %>
41     <% include('logout.html') |n %>
42
43     <% $head |n %>
44
45   </HEAD>
46   <BODY BGCOLOR="#f8f8f8" <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0">
47     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0; padding-right:4">
48       <tr>
49         <td BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="<%$fsurl%>view/REAL_logo.cgi"></td>
50         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
51           <font size=6><% $company_name || 'ExampleCo' %></font>
52         </td>
53         <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><% getotaker %>&nbsp;</b> <FONT SIZE="-2"><a href="javascript:void(0);" onClick="logout();">logout</a></FONT><br></FONT><FONT SIZE="-2"><a href="<%$fsurl%>pref/pref.html" STYLE="color: #000000">Preferences</a>
54 %         if ( $conf->config("ticket_system")
55 %              && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
56             | <a href="<%$fsurl%>rt/Prefs/Other.html" STYLE="color: #000000">Ticketing preferences</a>
57 %         }
58           <BR></FONT>
59         </td>
60       </tr>
61     </table>
62
63     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
64
65 <link href="<%$fsurl%>elements/freeside-menu.css" type="text/css" rel="stylesheet">
66
67 % if ( $menu_position eq 'top' ) {
68
69       <TR>
70
71         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
72           <SCRIPT TYPE="text/javascript">
73             document.write(myBar);
74           </SCRIPT>
75         </TD>
76
77       </TR>
78
79       <TR>
80
81         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
82           <% include('searchbar-prospect.html') |n %>
83         </TD>
84
85         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
86           <% include('searchbar-cust_main.html') |n %>
87         </TD>
88
89         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="center">
90           <% include('searchbar-address2.html') |n %>
91         </TD>
92
93         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right">
94           <% include('searchbar-cust_bill.html') |n %>
95         </TD>
96
97         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
98           <% include('searchbar-cust_svc.html') |n %>
99         </TD>
100
101         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
102           <% include('searchbar-ticket.html') |n %>
103         </TD>
104
105       </TR>
106     </TABLE>
107
108 % } else { #$menu_position eq 'left'
109
110       <TR>
111
112         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
113         </TD>
114
115       </TR>
116
117 % }
118
119
120     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
121
122       <TR HEIGHT="100%">
123
124 % if ( $menu_position eq 'left' ) {
125
126         <TD BGCOLOR="#cccccc" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right">
127           <SCRIPT TYPE="text/javascript">
128             document.write(myBar);
129           </SCRIPT>
130
131           <BR>
132           <% include('searchbar-prospect.html') |n %>
133           <% include('searchbar-cust_main.html') |n %>
134           <% include('searchbar-address2.html') |n %>
135           <% include('searchbar-cust_bill.html') |n %>
136           <% include('searchbar-cust_svc.html') |n %>
137           <% include('searchbar-ticket.html') |n %>
138
139         </TD>
140
141 % }
142
143         <TD CLASS="background" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
144
145           <FONT SIZE=6>
146             <% $title |h %>
147           </FONT>
148
149 % unless ( $nobr ) {
150           <BR><BR>
151 % }
152
153           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
154 <%init>
155
156 my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
157 my( $nobr, $nocss ) = ( 0, 0 );
158 if ( ref($_[0]) ) {
159   my $opt = shift;
160   $title   = $opt->{title};
161   $menubar = $opt->{menubar};
162   $etc     = $opt->{etc};
163   $head    = $opt->{head};
164   $nobr    = $opt->{nobr};
165   $nocss   = $opt->{nocss};
166 } else {
167   ($title, $menubar) = ( shift, shift );
168   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
169   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
170 }
171
172 my $conf = new FS::Conf;
173
174 my $curuser = $FS::CurrentUser::CurrentUser;
175
176 my $menu_position = $curuser->option('menu_position')
177                     || 'top'; #new default for 1.9
178
179 my $company_name;
180 my @agentnums = $curuser->agentnums;
181 if ( scalar(@agentnums) == 1 ) {
182   $company_name = $conf->config('company_name', $agentnums[0] );
183 } else {
184   $company_name = $conf->config('company_name');
185 }
186
187 </%init>