export svc_mailinglist to CGP groups, RT#7514
[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 |h %>
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 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="7" 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       </TR>
112
113 % }
114
115       <TR>
116
117         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
118 % if ( $curuser->access_right('List prospects') ) {
119           <FORM ACTION="<%$fsurl%>search/prospect_main.html" METHOD="GET" STYLE="margin:0">
120             <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>
121             <A HREF="<%$fsurl%>search/report_prospect_main.html" CLASS="fslink" STYLE="font-size: 11px">Adv</A>
122             <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"">
123           </FORM>
124 % }
125         </TD>
126
127         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
128 % if ( $curuser->access_right('List customers') ) {
129           <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
130             <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>
131             <A HREF="<%$fsurl%>search/report_cust_main.html" CLASS="fslink" STYLE="font-size: 11px">Advanced</A>
132             <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
133           </FORM>
134 % }
135         </TD>
136
137         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="center">
138 % if ( $conf->exists('address2-search') ) { 
139             <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0;display:inline">
140               <INPUT TYPE="hidden" NAME="address2_on" VALUE="1">
141               <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">
142               <BR>
143               <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">
144             </FORM>
145 % } 
146         </TD>
147
148         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right">
149 % if ( $curuser->access_right('View invoices') ) { 
150             <FORM ACTION="<%$fsurl%>search/cust_bill.html" METHOD="GET" STYLE="margin:0;display:inline">
151               <INPUT NAME="invnum" TYPE="text" VALUE="<% $inv_label |n %>" STYLE="width:56px" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" CLASS="fstext">
152 %   if ( $curuser->access_right('List invoices') ) { 
153               <A HREF="<%$fsurl%>search/report_cust_bill.html" CLASS="fslink" STYLE="font-size: 11px">Adv</A>\
154 %   } 
155 <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">
156             </FORM>
157 % } 
158         </TD>
159
160         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
161 % if ( $curuser->access_right('View customer services') ) {
162           <FORM ACTION="<%$fsurl%>search/cust_svc.html" METHOD="GET" STYLE="margin:0">
163             <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>
164             <A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #cccccc; font-size:11px">Advanced</A>
165             <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
166           </FORM>
167 % }
168         </TD>
169
170         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
171 % if ( $conf->config("ticket_system") ) { 
172           <FORM ACTION="<% FS::TicketSystem->baseurl %>index.html" METHOD="GET" STYLE="margin:0">
173             <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>
174             <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" CLASS="fslink" STYLE="font-size:11px">Advanced</A>
175             <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
176           </FORM>
177 % }
178         </TD>
179
180       </TR>
181     </TABLE>
182
183     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
184
185       <TR HEIGHT="100%">
186
187 % if ( $menu_position eq 'left' ) {
188
189         <TD BGCOLOR="#cccccc" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right">
190           <SCRIPT TYPE="text/javascript">
191             document.write(myBar);
192           </SCRIPT>
193         </TD>
194
195 % }
196
197         <TD BGCOLOR="#f8f8f8" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
198
199           <FONT SIZE=6>
200             <% $title |h %>
201           </FONT>
202
203 % unless ( $nobr ) {
204           <BR><BR>
205 % }
206
207           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
208 <%init>
209
210 my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
211 my( $nobr, $nocss ) = ( 0, 0 );
212 if ( ref($_[0]) ) {
213   my $opt = shift;
214   $title   = $opt->{title};
215   $menubar = $opt->{menubar};
216   $etc     = $opt->{etc};
217   $head    = $opt->{head};
218   $nobr    = $opt->{nobr};
219   $nocss   = $opt->{nocss};
220 } else {
221   ($title, $menubar) = ( shift, shift );
222   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
223   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
224 }
225
226 my $conf = new FS::Conf;
227
228 my $curuser = $FS::CurrentUser::CurrentUser;
229
230 my $menu_position = $curuser->option('menu_position')
231                     || 'top'; #new default for 1.9
232
233 my $company_name;
234 my @agentnums = $curuser->agentnums;
235 if ( scalar(@agentnums) == 1 ) {
236   $company_name = $conf->config('company_name', $agentnums[0] );
237 } else {
238   $company_name = $conf->config('company_name');
239 }
240
241 my $prospect_label = '(name, company or phone)';
242
243 my $cust_width = 246;
244 my $cust_label = '(cust #, name, company';
245 if ( $conf->exists('address1-search') ) {
246   $cust_label .= ', address';
247   $cust_width += 56;
248 }
249 $cust_label .= ' or contact phone)';
250
251 my $address2_label = '(Unit #)';
252 my $inv_label = '(inv #)';
253 my $svc_label = '(user, email, ip, mac, domain or service phone)';
254 my $ticketing_label = '(ticket #, subject, email or fulltext:text)';
255
256 </%init>