5 <& /elements/header.html',
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
17 <& /elements/header.html, 'Title', $menubar, $etc, $head &>
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?
27 <% encode_entities($title) || $title_noescape |n %>
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">
36 <META NAME="viewport" content="width=device-width height=device-height user-scalable=yes">
39 <% include('menu.html', 'freeside_baseurl' => $fsurl,
40 'position' => $menu_position,
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>
55 <% include('init_overlib.html') |n %>
56 <% include('rs_init_object.html') |n %>
57 <script type="text/javascript" src="<% $fsurl %>elements/topreload.js"></script>
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 %>;
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">
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>
74 <td align="right" BGCOLOR="#ffffff">
75 <& notify-tickets.html &>
77 <td align=right valign=top BGCOLOR="#ffffff">
78 <FONT SIZE="-1"><% mt('Logged in as') |h %>
79 <b><% $FS::CurrentUser::CurrentUser->username |h %> </b>
80 <FONT SIZE="-2"><a href="<%$fsurl%>loginout/logout.html">
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>
95 <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
97 <link href="<%$fsurl%>elements/freeside-menu.css" type="text/css" rel="stylesheet">
99 % if ( $menu_position eq 'top' ) {
101 <TR CLASS="fsmenubar">
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());
110 <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#dddddd">
111 <% include('searchbar-combined.html') |n %>
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);
124 <TR CLASS="fssearchbar">
126 <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right" STYLE="padding-left:2px">
127 <% include('searchbar-prospect.html') |n %>
130 <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right" STYLE="padding-left:2px">
131 <% include('searchbar-cust_main.html') |n %>
134 <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="center">
135 <% include('searchbar-address2.html') |n %>
138 <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right">
139 <% include('searchbar-cust_bill.html') |n %>
142 <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right" STYLE="padding-left:2px">
143 <% include('searchbar-cust_svc.html') |n %>
146 <TD COLSPAN=1 BGCOLOR="#dddddd" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
147 <% include('searchbar-ticket.html') |n %>
154 % } else { #$menu_position eq 'left'
156 <TR CLASS="fsmenubar">
158 <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#dddddd">
166 <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
170 % if ( $menu_position eq 'left' ) {
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);
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 %>
187 % } else { #$menu_position eq 'top'
190 %# page content starts here
191 <TD CLASS="background" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
194 <% $title_noescape || encode_entities($title) %>
197 % my %cookies = CGI::Cookie->fetch($r);
198 % if ( $cookies{freeside_status} ) {
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>
205 <script src="<% $fsurl %>elements/js.cookie.js"></script>
206 <SCRIPT TYPE="text/javascript">
207 Cookies.remove('freeside_status', { path: '/' });
215 <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
219 my( $title, $title_noescape, $menubar, $etc, $head ) = ( '', '', '', '', '' );
220 my( $nobr, $nocss, $no_jquery ) = ( 0, 0, 0 );
226 $title = $opt->{title};
227 $title_noescape = $opt->{title_noescape};
228 $menubar = $opt->{menubar};
230 $head = $opt->{head};
231 $nobr = $opt->{nobr};
232 $nocss = $opt->{nocss};
233 $mobile = $opt->{mobile};
234 $no_jquery = $opt->{no_jquery};
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
241 my $conf = new FS::Conf;
243 my $curuser = $FS::CurrentUser::CurrentUser;
245 my $menu_position = $curuser->option('menu_position')
246 || 'top'; #new default for 1.9
248 if ( !defined($mobile) ) {
249 $mobile = $curuser->option('mobile_menu',1) && FS::UI::Web::is_mobile();
251 if ( $cgi->param('mobile') =~ /^(\d)$/ ) { # allow client to override
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] );
261 $company_name = $conf->config('company_name');
262 $company_url = $conf->config('company_url');