9b24828590bfe24916a6592ae16f653f0e3df971
[freeside.git] / httemplate / elements / header-full.html
1 <<<<<<< HEAD
2 <%doc>
3
4 Example:
5
6   include( '/elements/header.html',
7            {
8              'title'   => 'Title',
9              'menubar' => \@menubar,
10              'etc'     => '', #included in <BODY> tag, for things like onLoad=
11              'head'    => '', #included before closing </HEAD> tag
12              'nobr'    => 0,  #1 for no <BR><BR> after the title
13              'no_jquery' => #for use from RT, which loads its own
14            }
15          );
16
17   #old-style
18   include( '/elements/header.html', 'Title', $menubar, $etc, $head);
19
20 </%doc>
21 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
22 %#<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
23 %# above is what RT declares, should we switch now? hopefully no glitches result
24 %# or just fuck it, XHTML died anyway, HTML 5 or bust?
25 <HTML>
26   <HEAD>
27     <TITLE>
28       <% encode_entities($title) || $title_noescape |n %>
29     </TITLE>
30     <!-- per RT, to prevent IE compatibility mode -->
31     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
32     <!-- The X-UA-Compatible <meta> tag above must be very early in <head> -->
33     <META HTTP-Equiv="Cache-Control" Content="no-cache">
34     <META HTTP-Equiv="Pragma" Content="no-cache">
35     <META HTTP-Equiv="Expires" Content="0"> 
36 % if ( $mobile ) {
37     <META NAME="viewport" content="width=device-width height=device-height user-scalable=yes">
38 % }
39
40     <% include('menu.html', 'freeside_baseurl' => $fsurl,
41                             'position'         => $menu_position,
42                             'nocss'            => $nocss,
43                             'mobile'           => $mobile,
44               ) |n
45     %>
46
47 %   unless ( $no_jquery ) {
48       <link rel="stylesheet" href="<% $fsurl %>elements/jquery-ui.min.css">
49       <SCRIPT SRC="<% $fsurl %>elements/jquery.js"></SCRIPT>
50       <SCRIPT SRC="<% $fsurl %>elements/jquery-ui.min.js"></SCRIPT>
51 %   }
52
53     <% include('init_overlib.html') |n %>
54     <% include('rs_init_object.html') |n %>
55     <% include('logout.html') |n %>
56 %   my $timeout =  $conf->config('logout-timeout');
57 %   if ( $timeout && $timeout =~ /^\s*\d+\s*$/ ) {
58       <script type="text/javascript">
59         setTimeout('logout()', <% 60000 * $timeout %>);
60       </script>
61 %   }
62
63     <% $head |n %>
64
65 %# announce our base path, and the Mason comp path of this page
66   <script type="text/javascript">
67   window.fsurl = <% $fsurl |js_string %>;
68   window.request_comp_path = <% $m->request_comp->path |js_string %>;
69   </script>
70
71   </HEAD>
72   <BODY BGCOLOR="#f8f8f8" <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0px; margin-right:0px">
73     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0px; padding-right:4px" CLASS="fshead">
74       <tr>
75         <td BGCOLOR="#ffffff"><% $company_url ? qq(<A HREF="$company_url">) : '' |n %><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="<%$fsurl%>view/REAL_logo.cgi"><% $company_url ? '</A>' : '' |n %></td>
76         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
77           <font size=6><% $company_name || 'ExampleCo' %></font>
78         </td>
79         <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>
80 %         if ( $conf->config("ticket_system")
81 %              && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
82             | <a href="<%$fsurl%>rt/Prefs/Other.html" STYLE="color: #000000">Ticketing preferences</a>
83 %         }
84           <BR></FONT>
85         </td>
86       </tr>
87     </table>
88
89     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
90
91 <link href="<%$fsurl%>elements/freeside-menu.css" type="text/css" rel="stylesheet">
92
93 % if ( $menu_position eq 'top' ) {
94
95       <TR CLASS="fsmenubar">
96
97 %       if ( $mobile ) {
98
99         <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#cccccc">
100           <SCRIPT TYPE="text/javascript">
101             document.write(myBar.toString());
102           </SCRIPT>
103         </TD>
104         <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#cccccc">
105             <% include('searchbar-combined.html') |n %>
106         </TD>
107
108 %       } else {
109
110         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
111           <SCRIPT TYPE="text/javascript">
112             document.write(myBar);
113           </SCRIPT>
114         </TD>
115
116       </TR>
117
118       <TR CLASS="fssearchbar">
119
120         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
121           <% include('searchbar-prospect.html') |n %>
122         </TD>
123
124         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
125           <% include('searchbar-cust_main.html') |n %>
126         </TD>
127
128         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="center">
129           <% include('searchbar-address2.html') |n %>
130         </TD>
131
132         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right">
133           <% include('searchbar-cust_bill.html') |n %>
134         </TD>
135
136         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
137           <% include('searchbar-cust_svc.html') |n %>
138         </TD>
139
140         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
141           <% include('searchbar-ticket.html') |n %>
142         </TD>
143 %       }
144
145       </TR>
146     </TABLE>
147
148 % } else { #$menu_position eq 'left'
149
150       <TR CLASS="fsmenubar">
151
152         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
153         </TD>
154
155       </TR>
156
157 % }
158
159
160     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
161
162       <TR HEIGHT="100%">
163
164 % if ( $menu_position eq 'left' ) {
165
166         <TD BGCOLOR="#cccccc" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right" CLASS="fsmenubar">
167           <SCRIPT TYPE="text/javascript">
168             document.write(myBar);
169           </SCRIPT>
170
171           <BR>
172           <% include('searchbar-prospect.html') |n %>
173           <% include('searchbar-cust_main.html') |n %>
174           <% include('searchbar-address2.html') |n %>
175           <% include('searchbar-cust_bill.html') |n %>
176           <% include('searchbar-cust_svc.html') |n %>
177           <% include('searchbar-ticket.html') |n %>
178
179         </TD>
180
181 % }
182 %# page content starts here
183         <TD CLASS="background" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
184
185           <FONT SIZE=6>
186             <% $title_noescape || encode_entities($title) %>
187           </FONT>
188
189 % unless ( $nobr ) {
190           <BR><BR>
191 % }
192
193           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
194
195 <%init>
196
197 my( $title, $title_noescape, $menubar, $etc, $head ) = ( '', '', '', '', '' );
198 my( $nobr, $nocss, $no_jquery ) = ( 0, 0, 0 );
199
200 my $mobile;
201
202 if ( ref($_[0]) ) {
203   my $opt = shift;
204   $title   = $opt->{title};
205   $title_noescape = $opt->{title_noescape};
206   $menubar    = $opt->{menubar};
207   $etc        = $opt->{etc};
208   $head       = $opt->{head};
209   $nobr       = $opt->{nobr};
210   $nocss      = $opt->{nocss};
211   $mobile     = $opt->{mobile};
212   $no_jquery  = exists($opt->{no_jquery}) ? $opt->{no_jquery} : 1; #v3 only, 0 on v4+
213 } else {
214   ($title, $menubar) = ( shift, shift );
215   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
216   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
217 }
218
219 my $conf = new FS::Conf;
220
221 my $curuser = $FS::CurrentUser::CurrentUser;
222
223 my $menu_position = $curuser->option('menu_position')
224                     || 'top'; #new default for 1.9
225
226 if ( !defined($mobile) ) {
227   $mobile = $curuser->option('mobile_menu',1) && FS::UI::Web::is_mobile();
228 }
229 if ( $cgi->param('mobile') =~ /^(\d)$/ ) { # allow client to override
230   $mobile = $1;
231 }
232
233 my($company_name, $company_url);
234 my @agentnums = $curuser->agentnums;
235 if ( scalar(@agentnums) == 1 ) {
236   $company_name = $conf->config('company_name', $agentnums[0] );
237   $company_url  = $conf->config('company_url',  $agentnums[0] );
238 } else {
239   $company_name = $conf->config('company_name');
240   $company_url  = $conf->config('company_url');
241 }
242
243 </%init>
244 =======
245 % # for testing, disable the page menus/search boxes
246 % if ( $FS::CurrentUser::CurrentUser->option('header-minimal') ) {
247 <& header-minimal.html, @_ &>
248 % } else {
249 <& header-full.html, @_ &>
250 % }
251 >>>>>>> cb6214a... more robust testing platform, #37340