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