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