resolve style weirdness (fallout from RT integration), especially non-fixed-width...
[freeside.git] / httemplate / elements / header.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <HTML>
3   <HEAD>
4     <TITLE>
5       <% $title %>
6     </TITLE>
7     <META HTTP-Equiv="Cache-Control" Content="no-cache">
8     <META HTTP-Equiv="Pragma" Content="no-cache">
9     <META HTTP-Equiv="Expires" Content="0"> 
10
11     <% include('menu.html', 'freeside_baseurl' => $fsurl,
12                             'position'         => $menu_position,
13                             'nocss'            => $nocss,
14               ) |n
15     %>
16
17     <% include('init_overlib.html') |n %>
18
19     <SCRIPT TYPE="text/javascript">
20       function clearhint_search_cust (what) {
21         if ( what.value == '(cust #, name, company or contact phone)' )
22           what.value = '';
23       }
24
25       function clearhint_search_address2 (what) {
26         if ( what.value == '(Unit #)' )
27           what.value = '';
28       }
29
30       function clearhint_search_invoice (what) {
31         if ( what.value == '(inv #)' )
32           what.value = '';
33       }
34
35       function clearhint_search_svc (what) {
36         if ( what.value == '(user, email, ip, mac, domain or svc phone #)' )
37           what.value = '';
38       }
39
40       function clearhint_search_ticket (what) {
41         if ( what.value == '(ticket #, subject, email or fulltext:text)' )
42           what.value = '';
43       }
44     </SCRIPT>
45
46     <% $head |n %>
47
48   </HEAD>
49   <BODY <% $menu_position eq 'left' ? qq( BACKGROUND="${fsurl}images/background-cheat.png" ) : ' BGCOLOR="#e8e8e8" ' %> <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0">
50     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0; padding-right:4">
51       <tr>
52         <td BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="<%$fsurl%>view/REAL_logo.cgi"></td>
53         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
54           <font size=6><% $company_name || 'ExampleCo' %></font>
55         </td>
56         <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><% getotaker %>&nbsp;</b><br></FONT><FONT SIZE="-2"><a href="<%$fsurl%>pref/pref.html">Preferences</a>
57 %         if ( $conf->config("ticket_system")
58 %              && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
59             | <a href="<%$fsurl%>rt/User/Prefs.html">Ticketing preferences</a>
60 %         }
61           <BR></FONT>
62         </td>
63       </tr>
64     </table>
65
66 <style type="text/css">
67 input.fsblackbutton {
68          background-color:#333333;
69          color: #ffffff;
70          border:1px solid;
71          border-top-color:#cccccc;
72          border-left-color:#cccccc;
73          border-right-color:#aaaaaa;
74          border-bottom-color:#aaaaaa;
75          font-family: Arial, Verdana, Helvetica, sans-serif;
76          font-weight:bold;
77          padding-left:12px;
78          padding-right:12px;
79          padding-top:0px;
80          padding-bottom:0px;
81          margin-left:0px;
82          margin-right:0px;
83          margin-top:2px;
84          margin-bottom:0px;
85          overflow:visible;
86          filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
87 }
88
89 input.fsblackbuttonselected {
90          background-color:#7e0079;
91          color: #ffffff;
92          border:1px solid;
93          border-top-color:#cccccc;
94          border-left-color:#cccccc;
95          border-right-color:#aaaaaa;
96          border-bottom-color:#aaaaaa;
97          font-family: Arial, Verdana, Helvetica, sans-serif;
98          font-weight:bold;
99          padding-left:12px;
100          padding-right:12px;
101          padding-top:0px;
102          padding-bottom:0px;
103          margin-left:0px;
104          margin-right:0px;
105          margin-top:2px;
106          margin-bottom:0px;
107          overflow:visible;
108          filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
109 }
110
111 input.fstext {
112          border: 2px inset #eee;
113          /*border-top-color:#aaaaaa;
114          border-left-color:#aaaaaa;
115          border-right-color:#cccccc;
116          border-bottom-color:#cccccc;
117          */
118          vertical-align:bottom;
119          text-align:right;
120          font-family: Arial,Verdana,Helvetica,sans-serif;
121          padding-left: 0px;
122          padding-right: 0px;
123          padding-top: 0px;
124          padding-bottom: 0px;
125          margin-left:0px;
126          margin-right:0px;
127          margin-top:0px;
128          margin-bottom:1px;
129 }
130
131 </style>
132
133     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
134       <TR>
135         <TD COLSPAN=6 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
136       </TR>
137
138 % if ( $menu_position eq 'top' ) {
139
140       <TR>
141
142         <TD COLSPAN="4" WIDTH="100%" STYLE="padding:0" BGCOLOR="#000000">
143           <SCRIPT TYPE="text/javascript">
144             document.write(myBar);
145           </SCRIPT>
146         </TD>
147
148
149         <TD COLSPAN="2" ALIGN="right" STYLE="padding:0px 8px 0px 0px" BGCOLOR="#000000">
150           <TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000" BORDER=0>
151             <TR>
152               <TD ALIGN="right" STYLE="padding-right:3px;padding-bottom:1px;border-right:1px solid #999999"><% include('/elements/about_freeside.html') |n %></TD>
153               <TD ALIGN="left" STYLE="padding-left:3px;padding-bottom:1px"><% include('/elements/about_rt.html') |n %></TD>
154             </TR>
155           </TABLE>
156         </TD>
157
158       </TR>
159
160       <TR>
161         <TD COLSPAN="6" WIDTH="100%" HEIGHT="2px" STYLE="padding:0" BGCOLOR="#000000">
162         </TD>
163       </TR>
164       
165       <TR>
166         <TD COLSPAN="6" WIDTH="100%" HEIGHT="4px" STYLE="padding:0" BGCOLOR="#000000">
167         </TD>
168       </TR>
169
170 % }
171
172       <TR>
173
174         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
175 % if ( $curuser->access_right('List customers') ) {
176           <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
177             <INPUT NAME="search_cust" TYPE="text" VALUE="(cust #, name, company or contact phone)" SIZE="29" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" CLASS="fstext"><BR>
178             <A HREF="<%$fsurl%>search/report_cust_main.html" STYLE="color: #ffffff; font-size: 11px">Advanced</A>
179             <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
180           </FORM>
181 % }
182         </TD>
183
184         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="center">
185 % if ( $conf->exists('address2-search') ) { 
186             <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0;display:inline">
187               <INPUT TYPE="hidden" NAME="address2_on" VALUE="1">
188               <INPUT NAME="address2_text" TYPE="text" VALUE="(Unit #)" SIZE="4" onFocus="clearhint_search_address2(this);" onClick="clearhint_search_address2(this);" CLASS="fstext">
189               <BR>
190               <INPUT TYPE="submit" VALUE="Search units" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px;padding-left:2px;padding-right:2px">
191             </FORM>
192 % } 
193         </TD>
194
195         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
196 % if ( $curuser->access_right('View invoices') ) { 
197
198             <FORM ACTION="<%$fsurl%>search/cust_bill.html" METHOD="GET" STYLE="margin:0;display:inline">
199               <INPUT NAME="invnum" TYPE="text" VALUE="(inv #)" SIZE="10" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" CLASS="fstext">
200               <BR>
201 %   if ( $curuser->access_right('List invoices') ) { 
202                 <A HREF="<%$fsurl%>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 11px">Adv</A>
203 %   } 
204               <INPUT TYPE="submit" VALUE="Search invoices" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px;padding-left:0px;padding-right:0px">
205             </FORM>
206 % } 
207         </TD>
208
209         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
210 % if ( $curuser->access_right('View customer services') ) {
211           <FORM ACTION="<%$fsurl%>search/cust_svc.html" METHOD="GET" STYLE="margin:0">
212             <INPUT NAME="search_svc" TYPE="text" VALUE="(user, email, ip, mac, domain or svc phone #)" SIZE="32" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" CLASS="fstext"><BR>
213             <A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size:11px">Advanced</A>
214             <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
215           </FORM>
216 % }
217         </TD>
218
219         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-left:4px;padding-right:4px">
220 % if ( $conf->config("ticket_system") ) { 
221           <FORM ACTION="<% FS::TicketSystem->baseurl %>index.html" METHOD="GET" STYLE="margin:0">
222             <INPUT NAME="q" TYPE="text" VALUE="(ticket #, subject, email or fulltext:text)" SIZE=26 onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" CLASS="fstext"><BR>
223             <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" STYLE="color: #ffffff; font-size:11px">Advanced</A>
224             <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
225           </FORM>
226 % }
227         </TD>
228
229       </TR>
230     </TABLE>
231
232     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
233
234       <TR>
235
236 % if ( $menu_position eq 'left' ) {
237
238         <TD BGCOLOR="#000000" STYLE="padding:0" WIDTH="154"></TD>
239         <TD STYLE="padding:0" WIDTH="13"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-corner.png"></TD>
240
241 % }
242
243         <TD STYLE="padding:0" WIDTH="100%"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD>
244
245       </TR>
246
247       <TR HEIGHT="100%">
248
249 % if ( $menu_position eq 'left' ) {
250
251         <TD BGCOLOR="#000000" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right">
252           <SCRIPT TYPE="text/javascript">
253             document.write(myBar);
254           </SCRIPT>
255           <BR>
256           <IMG SRC="<%$fsurl%>images/32clear.gif" HEIGHT="1" WIDTH="154">
257
258           <TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000" WIDTH="100%">
259             <TR>
260               <TD ALIGN="left" STYLE="padding-bottom:1px;border-bottom:1px solid #999999"><% include('/elements/about_freeside.html') |n %></TD>
261             </TR>
262             <TR>
263               <TD ALIGN="right" STYLE="padding-bottom:1px"><% include('/elements/about_rt.html') |n %></TD>
264             </TR>
265           </TABLE>
266
267         </TD>
268         <TD STYLE="padding:0" HEIGHT="100%" WIDTH=13 VALIGN="top"><IMG WIDTH="13" HEIGHT="100%" BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-side.png"></TD>
269
270 % }
271
272         <TD BGCOLOR="#e8e8e8" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
273
274           <FONT SIZE=6>
275             <% $title %>
276           </FONT>
277
278 % unless ( $nobr ) {
279           <BR><BR>
280 % }
281
282           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
283 <%init>
284
285 my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
286 my( $nobr, $nocss ) = ( 0, 0 );
287 if ( ref($_[0]) ) {
288   my $opt = shift;
289   $title   = $opt->{title};
290   $menubar = $opt->{menubar};
291   $etc     = $opt->{etc};
292   $head    = $opt->{head};
293   $nobr    = $opt->{nobr};
294   $nocss   = $opt->{nocss};
295 } else {
296   ($title, $menubar) = ( shift, shift );
297   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
298   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
299 }
300
301 my $conf = new FS::Conf;
302
303 my $curuser = $FS::CurrentUser::CurrentUser;
304
305 my $menu_position = $curuser->option('menu_position')
306                     || 'top'; #new default for 1.9
307
308 my $company_name;
309 my @agentnums = $curuser->agentnums;
310 if ( scalar(@agentnums) == 1 ) {
311   $company_name = $conf->config('company_name', $agentnums[0] );
312 } else {
313   $company_name = $conf->config('company_name');
314 }
315
316 </%init>