5 include( '/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 include( '/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>
52 <% include('init_overlib.html') |n %>
53 <% include('rs_init_object.html') |n %>
54 <% include('logout.html') |n %>
55 % my $timeout = $conf->config('logout-timeout');
56 % if ( $timeout && $timeout =~ /^\s*\d+\s*$/ ) {
57 <script type="text/javascript">
58 setTimeout('logout()', <% 60000 * $timeout %>);
64 %# announce our base path, and the Mason comp path of this page
65 <script type="text/javascript">
66 window.fsurl = <% $fsurl |js_string %>;
67 window.request_comp_path = <% $m->request_comp->path |js_string %>;
71 <BODY BGCOLOR="#f8f8f8" <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0px; margin-right:0px">
72 <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0px; padding-right:4px" CLASS="fshead">
74 <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>
75 <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
76 <font size=6><% $company_name || 'ExampleCo' %></font>
78 <td align="right" BGCOLOR="#ffffff">
79 <& notify-tickets.html &>
81 <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><% getotaker %> </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>
82 % if ( $conf->config("ticket_system")
83 % && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
84 | <a href="<%$fsurl%>rt/Prefs/Other.html" STYLE="color: #000000">Ticketing preferences</a>
91 <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
93 <link href="<%$fsurl%>elements/freeside-menu.css" type="text/css" rel="stylesheet">
95 % if ( $menu_position eq 'top' ) {
97 <TR CLASS="fsmenubar">
101 <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#cccccc">
102 <SCRIPT TYPE="text/javascript">
103 document.write(myBar.toString());
106 <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#cccccc">
107 <% include('searchbar-combined.html') |n %>
112 <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
113 <SCRIPT TYPE="text/javascript">
114 document.write(myBar);
120 <TR CLASS="fssearchbar">
122 <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
123 <% include('searchbar-prospect.html') |n %>
126 <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
127 <% include('searchbar-cust_main.html') |n %>
130 <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="center">
131 <% include('searchbar-address2.html') |n %>
134 <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right">
135 <% include('searchbar-cust_bill.html') |n %>
138 <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
139 <% include('searchbar-cust_svc.html') |n %>
142 <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
143 <% include('searchbar-ticket.html') |n %>
150 % } else { #$menu_position eq 'left'
152 <TR CLASS="fsmenubar">
154 <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
162 <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
166 % if ( $menu_position eq 'left' ) {
168 <TD BGCOLOR="#cccccc" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right" CLASS="fsmenubar">
169 <SCRIPT TYPE="text/javascript">
170 document.write(myBar);
174 <% include('searchbar-prospect.html') |n %>
175 <% include('searchbar-cust_main.html') |n %>
176 <% include('searchbar-address2.html') |n %>
177 <% include('searchbar-cust_bill.html') |n %>
178 <% include('searchbar-cust_svc.html') |n %>
179 <% include('searchbar-ticket.html') |n %>
184 %# page content starts here
185 <TD CLASS="background" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
188 <% $title_noescape || encode_entities($title) %>
195 <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
199 my( $title, $title_noescape, $menubar, $etc, $head ) = ( '', '', '', '', '' );
200 my( $nobr, $nocss, $no_jquery ) = ( 0, 0, 0 );
206 $title = $opt->{title};
207 $title_noescape = $opt->{title_noescape};
208 $menubar = $opt->{menubar};
210 $head = $opt->{head};
211 $nobr = $opt->{nobr};
212 $nocss = $opt->{nocss};
213 $mobile = $opt->{mobile};
214 $no_jquery = exists($opt->{no_jquery}) ? $opt->{no_jquery} : 1; #v3 only, 0 on v4+
216 ($title, $menubar) = ( shift, shift );
217 $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
218 $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
221 my $conf = new FS::Conf;
223 my $curuser = $FS::CurrentUser::CurrentUser;
225 my $menu_position = $curuser->option('menu_position')
226 || 'top'; #new default for 1.9
228 if ( !defined($mobile) ) {
229 $mobile = $curuser->option('mobile_menu',1) && FS::UI::Web::is_mobile();
231 if ( $cgi->param('mobile') =~ /^(\d)$/ ) { # allow client to override
235 my($company_name, $company_url);
236 my @agentnums = $curuser->agentnums;
237 if ( scalar(@agentnums) == 1 ) {
238 $company_name = $conf->config('company_name', $agentnums[0] );
239 $company_url = $conf->config('company_url', $agentnums[0] );
241 $company_name = $conf->config('company_name');
242 $company_url = $conf->config('company_url');