This commit was generated by cvs2svn to compensate for changes in r8593,
[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 %>
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
41     <SCRIPT TYPE="text/javascript">
42       function clearhint_search_cust (what) {
43         if ( what.value == '<% $cust_label |n %>' )
44           what.value = '';
45       }
46
47       function clearhint_search_address2 (what) {
48         if ( what.value == '<% $address2_label |n %>' )
49           what.value = '';
50       }
51
52       function clearhint_search_invoice (what) {
53         if ( what.value == '<% $inv_label |n %>' )
54           what.value = '';
55       }
56
57       function clearhint_search_svc (what) {
58         if ( what.value == '<% $svc_label |n %>' )
59           what.value = '';
60       }
61
62       function clearhint_search_ticket (what) {
63         if ( what.value == '<% $ticketing_label |n %>' )
64           what.value = '';
65       }
66     </SCRIPT>
67
68     <% $head |n %>
69
70   </HEAD>
71   <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">
72     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0; padding-right:4">
73       <tr>
74         <td BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="<%$fsurl%>view/REAL_logo.cgi"></td>
75         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
76           <font size=6><% $company_name || 'ExampleCo' %></font>
77         </td>
78         <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" STYLE="color: #000000">Preferences</a>
79 %         if ( $conf->config("ticket_system")
80 %              && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
81             | <a href="<%$fsurl%>rt/User/Prefs.html" STYLE="color: #000000">Ticketing preferences</a>
82 %         }
83           <BR></FONT>
84         </td>
85       </tr>
86     </table>
87
88 <style type="text/css">
89 input.fsblackbutton {
90          background-color:#333333;
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='#ff333333',EndColorStr='#ff666666')
109 }
110
111 input.fsblackbuttonselected {
112          background-color:#7e0079;
113          color: #ffffff;
114          border:1px solid;
115          border-top-color:#cccccc;
116          border-left-color:#cccccc;
117          border-right-color:#aaaaaa;
118          border-bottom-color:#aaaaaa;
119          font-family: Arial, Verdana, Helvetica, sans-serif;
120          font-weight:bold;
121          padding-left:12px;
122          padding-right:12px;
123          padding-top:0px;
124          padding-bottom:0px;
125          margin-left:0px;
126          margin-right:0px;
127          margin-top:2px;
128          margin-bottom:0px;
129          overflow:visible;
130          filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
131 }
132
133 input.fstext {
134          border: 2px inset #eee;
135          /*border-top-color:#aaaaaa;
136          border-left-color:#aaaaaa;
137          border-right-color:#cccccc;
138          border-bottom-color:#cccccc;
139          */
140          vertical-align:bottom;
141          text-align:right;
142          font-family: Arial,Verdana,Helvetica,sans-serif;
143          padding-left: 0px;
144          padding-right: 0px;
145          padding-top: 0px;
146          padding-bottom: 0px;
147          margin-left:0px;
148          margin-right:0px;
149          margin-top:0px;
150          margin-bottom:1px;
151 }
152
153 </style>
154
155     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
156       <TR>
157         <TD COLSPAN=6 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
158       </TR>
159
160 % if ( $menu_position eq 'top' ) {
161
162       <TR>
163
164         <TD COLSPAN="4" WIDTH="100%" STYLE="padding:0" BGCOLOR="#000000">
165           <SCRIPT TYPE="text/javascript">
166             document.write(myBar);
167           </SCRIPT>
168         </TD>
169
170
171         <TD COLSPAN="2" ALIGN="right" STYLE="padding:0px 8px 0px 0px" BGCOLOR="#000000">
172           <TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000" BORDER=0>
173             <TR>
174               <TD ALIGN="right" STYLE="padding-right:3px;padding-bottom:1px;border-right:1px solid #999999"><% include('/elements/about_freeside.html') |n %></TD>
175               <TD ALIGN="left" STYLE="padding-left:3px;padding-bottom:1px"><% include('/elements/about_rt.html') |n %></TD>
176             </TR>
177           </TABLE>
178         </TD>
179
180       </TR>
181
182       <TR>
183         <TD COLSPAN="6" WIDTH="100%" HEIGHT="2px" STYLE="padding:0" BGCOLOR="#000000">
184         </TD>
185       </TR>
186       
187       <TR>
188         <TD COLSPAN="6" WIDTH="100%" HEIGHT="4px" STYLE="padding:0" BGCOLOR="#000000">
189         </TD>
190       </TR>
191
192 % }
193
194       <TR>
195
196         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
197 % if ( $curuser->access_right('List customers') ) {
198           <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
199             <INPUT NAME="search_cust" TYPE="text" VALUE="<% $cust_label |n %>" STYLE="width:<%$cust_width%>px" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" CLASS="fstext"><BR>
200             <A HREF="<%$fsurl%>search/report_cust_main.html" STYLE="color: #ffffff; font-size: 11px">Advanced</A>
201             <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
202           </FORM>
203 % }
204         </TD>
205
206         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="center">
207 % if ( $conf->exists('address2-search') ) { 
208             <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0;display:inline">
209               <INPUT TYPE="hidden" NAME="address2_on" VALUE="1">
210               <INPUT NAME="address2_text" TYPE="text" VALUE="<% $address2_label |n %>" STYLE="width:67px" onFocus="clearhint_search_address2(this);" onClick="clearhint_search_address2(this);" CLASS="fstext">
211               <BR>
212               <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">
213             </FORM>
214 % } 
215         </TD>
216
217         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
218 % if ( $curuser->access_right('View invoices') ) { 
219             <FORM ACTION="<%$fsurl%>search/cust_bill.html" METHOD="GET" STYLE="margin:0;display:inline">
220               <INPUT NAME="invnum" TYPE="text" VALUE="<% $inv_label |n %>" STYLE="width:64px" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" CLASS="fstext">
221 %   if ( $curuser->access_right('List invoices') ) { 
222               <A HREF="<%$fsurl%>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 11px">Adv</A>\
223 %   } 
224 <BR>
225               <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:2px;padding-right:2px">
226             </FORM>
227 % } 
228         </TD>
229
230         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
231 % if ( $curuser->access_right('View customer services') ) {
232           <FORM ACTION="<%$fsurl%>search/cust_svc.html" METHOD="GET" STYLE="margin:0">
233             <INPUT NAME="search_svc" TYPE="text" VALUE="<% $svc_label |n %>" STYLE="width:324px" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" CLASS="fstext"><BR>
234             <A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size:11px">Advanced</A>
235             <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
236           </FORM>
237 % }
238         </TD>
239
240         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-left:4px;padding-right:4px">
241 % if ( $conf->config("ticket_system") ) { 
242           <FORM ACTION="<% FS::TicketSystem->baseurl %>index.html" METHOD="GET" STYLE="margin:0">
243             <INPUT NAME="q" TYPE="text" VALUE="<% $ticketing_label |n %>" STYLE="width:256px" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" CLASS="fstext"><BR>
244             <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" STYLE="color: #ffffff; font-size:11px">Advanced</A>
245             <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
246           </FORM>
247 % }
248         </TD>
249
250       </TR>
251     </TABLE>
252
253     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
254
255       <TR>
256
257 % if ( $menu_position eq 'left' ) {
258
259         <TD BGCOLOR="#000000" STYLE="padding:0" WIDTH="154"></TD>
260         <TD STYLE="padding:0" WIDTH="13"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-corner.png"></TD>
261
262 % }
263
264         <TD STYLE="padding:0" WIDTH="100%"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD>
265
266       </TR>
267
268       <TR HEIGHT="100%">
269
270 % if ( $menu_position eq 'left' ) {
271
272         <TD BGCOLOR="#000000" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right">
273           <SCRIPT TYPE="text/javascript">
274             document.write(myBar);
275           </SCRIPT>
276           <BR>
277           <IMG SRC="<%$fsurl%>images/32clear.gif" HEIGHT="1" WIDTH="154">
278
279           <TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000" WIDTH="100%">
280             <TR>
281               <TD ALIGN="left" STYLE="padding-bottom:1px;border-bottom:1px solid #999999"><% include('/elements/about_freeside.html') |n %></TD>
282             </TR>
283             <TR>
284               <TD ALIGN="right" STYLE="padding-bottom:1px"><% include('/elements/about_rt.html') |n %></TD>
285             </TR>
286           </TABLE>
287
288         </TD>
289         <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>
290
291 % }
292
293         <TD BGCOLOR="#e8e8e8" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
294
295           <FONT SIZE=6>
296             <% $title %>
297           </FONT>
298
299 % unless ( $nobr ) {
300           <BR><BR>
301 % }
302
303           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
304 <%init>
305
306 my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
307 my( $nobr, $nocss ) = ( 0, 0 );
308 if ( ref($_[0]) ) {
309   my $opt = shift;
310   $title   = $opt->{title};
311   $menubar = $opt->{menubar};
312   $etc     = $opt->{etc};
313   $head    = $opt->{head};
314   $nobr    = $opt->{nobr};
315   $nocss   = $opt->{nocss};
316 } else {
317   ($title, $menubar) = ( shift, shift );
318   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
319   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
320 }
321
322 my $conf = new FS::Conf;
323
324 my $curuser = $FS::CurrentUser::CurrentUser;
325
326 my $menu_position = $curuser->option('menu_position')
327                     || 'top'; #new default for 1.9
328
329 my $company_name;
330 my @agentnums = $curuser->agentnums;
331 if ( scalar(@agentnums) == 1 ) {
332   $company_name = $conf->config('company_name', $agentnums[0] );
333 } else {
334   $company_name = $conf->config('company_name');
335 }
336
337 my $cust_width = 288; #251 #ok for IE, slightly bigger for windows firefox
338 my $cust_label = '(cust #, name, company';
339 if ( $conf->exists('address1-search') ) {
340   $cust_label .= ', address';
341   $cust_width += 64;
342 }
343 $cust_label .= ' or contact phone)';
344
345 my $address2_label = '(Unit #)';
346 my $inv_label = '(inv #)';
347 my $svc_label = '(user, email, ip, mac, domain or service phone)';
348 my $ticketing_label = '(ticket #, subject, email or fulltext:text)';
349
350 </%init>