RT# 21110, Updated files to use jquery-validate jquery plugin. This allows for field...
[freeside.git] / httemplate / elements / header-full.html
1 <%doc>
2
3 Example:
4
5   <& /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          'no_jquery' => #for use from RT, which loads its own
13        }
14   &>
15
16   %#old-style
17   <& /elements/header.html, 'Title', $menubar, $etc, $head &>
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       <% encode_entities($title) || $title_noescape |n %>
28     </TITLE>
29     <!-- per RT, to prevent IE compatibility mode -->
30     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
31     <!-- The X-UA-Compatible <meta> tag above must be very early in <head> -->
32     <META HTTP-Equiv="Cache-Control" Content="no-cache">
33     <META HTTP-Equiv="Pragma" Content="no-cache">
34     <META HTTP-Equiv="Expires" Content="0"> 
35 % if ( $mobile ) {
36     <META NAME="viewport" content="width=device-width height=device-height user-scalable=yes">
37 % }
38
39     <% include('menu.html', 'freeside_baseurl' => $fsurl,
40                             'position'         => $menu_position,
41                             'nocss'            => $nocss,
42                             'mobile'           => $mobile,
43               ) |n
44     %>
45
46 %   unless ( $no_jquery ) {
47       <link rel="stylesheet" href="<% $fsurl %>elements/jquery-ui.min.css">
48       <SCRIPT SRC="<% $fsurl %>elements/jquery.js"></SCRIPT>
49       <SCRIPT SRC="<% $fsurl %>elements/jquery-ui.min.js"></SCRIPT>
50       <SCRIPT SRC="<% $fsurl %>elements/jquery.validate.min.js"></SCRIPT>
51 %     if ( $FS::CurrentUser::CurrentUser->option('printtofit') ) {
52       <SCRIPT SRC="<% $fsurl %>elements/printtofit.js"></SCRIPT>
53 %     }
54 %   }
55     <% include('init_overlib.html') |n %>
56     <% include('rs_init_object.html') |n %>
57     <script type="text/javascript" src="<% $fsurl %>elements/topreload.js"></script>
58     <% $head |n %>
59
60 %# announce our base path, and the Mason comp path of this page
61   <script type="text/javascript">
62   window.fsurl = <% $fsurl |js_string %>;
63   window.request_comp_path = <% $m->request_comp->path |js_string %>;
64   </script>
65
66   </HEAD>
67   <BODY BGCOLOR="#f8f8f8" <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0px; margin-right:0px">
68     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0px; padding-right:4px" CLASS="fshead">
69       <tr>
70         <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>
71         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
72           <font size=6><% $company_name || 'ExampleCo' %></font>
73         </td>
74         <td align="right" BGCOLOR="#ffffff">
75           <& notify-tickets.html &>
76         </td>
77         <td align=right valign=top BGCOLOR="#ffffff">
78           <FONT SIZE="-1"><% mt('Logged in as') |h %>
79             <b><% $FS::CurrentUser::CurrentUser->username |h %>&nbsp;</b>
80             <FONT SIZE="-2"><a href="<%$fsurl%>loginout/logout.html">
81               <% mt('logout') |h %>
82             </a></FONT>
83           <br>
84           </FONT>
85           <FONT SIZE="-2"><a href="<%$fsurl%>pref/pref.html" STYLE="color: #000000"><% mt('Preferences') |h %></a>
86 %         if ( $conf->config("ticket_system")
87 %              && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
88             | <a href="<%$fsurl%>rt/Prefs/Other.html" STYLE="color: #000000"><% mt('Ticketing preferences') |h %></a>
89 %         }
90           <BR></FONT>
91         </td>
92       </tr>
93     </table>
94
95     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
96
97 <link href="<%$fsurl%>elements/freeside-menu.css" type="text/css" rel="stylesheet">
98
99 % if ( $menu_position eq 'top' ) {
100
101       <TR CLASS="fsmenubar">
102
103 %       if ( $mobile ) {
104
105         <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#dddddd">
106           <SCRIPT TYPE="text/javascript">
107             document.write(myBar.toString());
108           </SCRIPT>
109         </TD>
110         <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#dddddd">
111             <% include('searchbar-combined.html') |n %>
112         </TD>
113
114 %       } else {
115
116         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#dddddd">
117           <SCRIPT TYPE="text/javascript">
118             document.write(myBar);
119           </SCRIPT>
120         </TD>
121
122       </TR>
123
124       <TR CLASS="fssearchbar">
125
126         <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right" STYLE="padding-left:2px">
127           <% include('searchbar-prospect.html') |n %>
128         </TD>
129
130         <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right" STYLE="padding-left:2px">
131           <% include('searchbar-cust_main.html') |n %>
132         </TD>
133
134         <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="center">
135           <% include('searchbar-address2.html') |n %>
136         </TD>
137
138         <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right">
139           <% include('searchbar-cust_bill.html') |n %>
140         </TD>
141
142         <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right" STYLE="padding-left:2px">
143           <% include('searchbar-cust_svc.html') |n %>
144         </TD>
145
146         <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
147           <% include('searchbar-ticket.html') |n %>
148         </TD>
149 %       }
150
151       </TR>
152     </TABLE>
153
154 % } else { #$menu_position eq 'left'
155
156       <TR CLASS="fsmenubar">
157
158         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#dddddd">
159         </TD>
160
161       </TR>
162
163 % }
164
165
166     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
167
168       <TR HEIGHT="100%">
169
170 % if ( $menu_position eq 'left' ) {
171
172         <TD BGCOLOR="#dddddd" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right" CLASS="fsmenubar">
173           <SCRIPT TYPE="text/javascript">
174             document.write(myBar);
175           </SCRIPT>
176
177           <BR>
178           <% include('searchbar-prospect.html') |n %>
179           <% include('searchbar-cust_main.html') |n %>
180           <% include('searchbar-address2.html') |n %>
181           <% include('searchbar-cust_bill.html') |n %>
182           <% include('searchbar-cust_svc.html') |n %>
183           <% include('searchbar-ticket.html') |n %>
184
185         </TD>
186
187 % } else { #$menu_position eq 'top'
188     <BR>
189 % }
190 %# page content starts here
191         <TD CLASS="background" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
192
193           <H1>
194             <% $title_noescape || encode_entities($title) %>
195           </H1>
196
197 % my %cookies = CGI::Cookie->fetch($r);
198 % if ( $cookies{freeside_status} ) {
199     <BR>
200 %   foreach my $status_msg ( $cookies{freeside_status}->value ) {
201       <TABLE CLASS="fsinnerbox" STYLE="background-color:#eeffee"><TR>
202         <TD><IMG SRC="<% $fsurl %>images/tick.png"> <% $status_msg |h %></TD>
203       </TR></TABLE>
204 %   }
205     <script src="<% $fsurl %>elements/js.cookie.js"></script>
206     <SCRIPT TYPE="text/javascript">
207       Cookies.remove('freeside_status', { path: '/' });
208     </SCRIPT>
209 % }
210
211 % unless ( $nobr ) {
212           <BR>
213 % }
214
215           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
216
217 <%init>
218
219 my( $title, $title_noescape, $menubar, $etc, $head ) = ( '', '', '', '', '' );
220 my( $nobr, $nocss, $no_jquery ) = ( 0, 0, 0 );
221
222 my $mobile;
223
224 if ( ref($_[0]) ) {
225   my $opt = shift;
226   $title   = $opt->{title};
227   $title_noescape = $opt->{title_noescape};
228   $menubar    = $opt->{menubar};
229   $etc        = $opt->{etc};
230   $head       = $opt->{head};
231   $nobr       = $opt->{nobr};
232   $nocss      = $opt->{nocss};
233   $mobile     = $opt->{mobile};
234   $no_jquery  = $opt->{no_jquery};
235 } else {
236   ($title, $menubar) = ( shift, shift );
237   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
238   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
239 }
240
241 my $conf = new FS::Conf;
242
243 my $curuser = $FS::CurrentUser::CurrentUser;
244
245 my $menu_position = $curuser->option('menu_position')
246                     || 'top'; #new default for 1.9
247
248 if ( !defined($mobile) ) {
249   $mobile = $curuser->option('mobile_menu',1) && FS::UI::Web::is_mobile();
250 }
251 if ( $cgi->param('mobile') =~ /^(\d)$/ ) { # allow client to override
252   $mobile = $1;
253 }
254
255 my($company_name, $company_url);
256 my @agentnums = $curuser->agentnums;
257 if ( scalar(@agentnums) == 1 ) {
258   $company_name = $conf->config('company_name', $agentnums[0] );
259   $company_url  = $conf->config('company_url',  $agentnums[0] );
260 } else {
261   $company_name = $conf->config('company_name');
262   $company_url  = $conf->config('company_url');
263 }
264
265 </%init>