beginning of prospect/CRM/contact work
[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 %>
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
41     <SCRIPT TYPE="text/javascript">
42
43       function clearhint_search_prospect (what) {
44         if ( what.value == '<% $prospect_label |n %>' )
45           what.value = '';
46       }
47
48       function clearhint_search_cust (what) {
49         if ( what.value == '<% $cust_label |n %>' )
50           what.value = '';
51       }
52
53       function clearhint_search_address2 (what) {
54         if ( what.value == '<% $address2_label |n %>' )
55           what.value = '';
56       }
57
58       function clearhint_search_invoice (what) {
59         if ( what.value == '<% $inv_label |n %>' )
60           what.value = '';
61       }
62
63       function clearhint_search_svc (what) {
64         if ( what.value == '<% $svc_label |n %>' )
65           what.value = '';
66       }
67
68       function clearhint_search_ticket (what) {
69         if ( what.value == '<% $ticketing_label |n %>' )
70           what.value = '';
71       }
72
73     </SCRIPT>
74
75     <% $head |n %>
76
77   </HEAD>
78   <BODY <% $menu_position eq 'left' ? qq( BACKGROUND="${fsurl}images/background-cheat.png" ) : ' BGCOLOR="#e8e8e8" ' %> <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0">
79     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0; padding-right:4">
80       <tr>
81         <td BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="<%$fsurl%>view/REAL_logo.cgi"></td>
82         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
83           <font size=6><% $company_name || 'ExampleCo' %></font>
84         </td>
85         <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><% getotaker %>&nbsp;</b><br></FONT><FONT SIZE="-2"><a href="<%$fsurl%>pref/pref.html" STYLE="color: #000000">Preferences</a>
86 %         if ( $conf->config("ticket_system")
87 %              && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
88             | <a href="<%$fsurl%>rt/User/Prefs.html" STYLE="color: #000000">Ticketing preferences</a>
89 %         }
90           <BR></FONT>
91         </td>
92       </tr>
93     </table>
94
95 <style type="text/css">
96 input.fsblackbutton {
97          background-color:#333333;
98          color: #ffffff;
99          border:1px solid;
100          border-top-color:#cccccc;
101          border-left-color:#cccccc;
102          border-right-color:#aaaaaa;
103          border-bottom-color:#aaaaaa;
104          font-family: Arial, Verdana, Helvetica, sans-serif;
105          font-weight:bold;
106          padding-left:12px;
107          padding-right:12px;
108          padding-top:0px;
109          padding-bottom:0px;
110          margin-left:0px;
111          margin-right:0px;
112          margin-top:2px;
113          margin-bottom:0px;
114          overflow:visible;
115          filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
116 }
117
118 input.fsblackbuttonselected {
119          background-color:#7e0079;
120          color: #ffffff;
121          border:1px solid;
122          border-top-color:#cccccc;
123          border-left-color:#cccccc;
124          border-right-color:#aaaaaa;
125          border-bottom-color:#aaaaaa;
126          font-family: Arial, Verdana, Helvetica, sans-serif;
127          font-weight:bold;
128          padding-left:12px;
129          padding-right:12px;
130          padding-top:0px;
131          padding-bottom:0px;
132          margin-left:0px;
133          margin-right:0px;
134          margin-top:2px;
135          margin-bottom:0px;
136          overflow:visible;
137          filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
138 }
139
140 input.fstext {
141          border: 2px inset #eee;
142          /*border-top-color:#aaaaaa;
143          border-left-color:#aaaaaa;
144          border-right-color:#cccccc;
145          border-bottom-color:#cccccc;
146          */
147          vertical-align:bottom;
148          text-align:right;
149          font-family: Arial,Verdana,Helvetica,sans-serif;
150          font-size: 13px;
151          padding-left: 0px;
152          padding-right: 0px;
153          padding-top: 0px;
154          padding-bottom: 0px;
155          margin-left:0px;
156          margin-right:0px;
157          margin-top:0px;
158          margin-bottom:1px;
159 }
160
161 </style>
162
163     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
164       <TR>
165         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
166       </TR>
167
168 % if ( $menu_position eq 'top' ) {
169
170       <TR>
171
172         <TD COLSPAN="5" WIDTH="100%" STYLE="padding:0" BGCOLOR="#000000">
173           <SCRIPT TYPE="text/javascript">
174             document.write(myBar);
175           </SCRIPT>
176         </TD>
177
178
179         <TD COLSPAN="2" ALIGN="right" STYLE="padding:0px 8px 0px 0px" BGCOLOR="#000000">
180           <TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000" BORDER=0>
181             <TR>
182               <TD ALIGN="right" STYLE="padding-right:3px;padding-bottom:1px;border-right:1px solid #999999"><% include('/elements/about_freeside.html') |n %></TD>
183               <TD ALIGN="left" STYLE="padding-left:3px;padding-bottom:1px"><% include('/elements/about_rt.html') |n %></TD>
184             </TR>
185           </TABLE>
186         </TD>
187
188       </TR>
189
190       <TR>
191         <TD COLSPAN="7" WIDTH="100%" HEIGHT="2px" STYLE="padding:0" BGCOLOR="#000000">
192         </TD>
193       </TR>
194       
195       <TR>
196         <TD COLSPAN="7" WIDTH="100%" HEIGHT="4px" STYLE="padding:0" BGCOLOR="#000000">
197         </TD>
198       </TR>
199
200 % }
201
202       <TR>
203
204         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-left:2px">
205 % if ( $curuser->access_right('List prospects') ) {
206           <FORM ACTION="<%$fsurl%>search/prospect_main.html" METHOD="GET" STYLE="margin:0">
207             <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>
208             <A HREF="<%$fsurl%>search/report_prospect_main.html" STYLE="color: #ffffff; font-size: 11px">Adv</A>
209             <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"">
210           </FORM>
211 % }
212         </TD>
213
214         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-left:2px">
215 % if ( $curuser->access_right('List customers') ) {
216           <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
217             <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>
218             <A HREF="<%$fsurl%>search/report_cust_main.html" STYLE="color: #ffffff; font-size: 11px">Advanced</A>
219             <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
220           </FORM>
221 % }
222         </TD>
223
224         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="center">
225 % if ( $conf->exists('address2-search') ) { 
226             <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0;display:inline">
227               <INPUT TYPE="hidden" NAME="address2_on" VALUE="1">
228               <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">
229               <BR>
230               <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">
231             </FORM>
232 % } 
233         </TD>
234
235         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
236 % if ( $curuser->access_right('View invoices') ) { 
237             <FORM ACTION="<%$fsurl%>search/cust_bill.html" METHOD="GET" STYLE="margin:0;display:inline">
238               <INPUT NAME="invnum" TYPE="text" VALUE="<% $inv_label |n %>" STYLE="width:56px" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" CLASS="fstext">
239 %   if ( $curuser->access_right('List invoices') ) { 
240               <A HREF="<%$fsurl%>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 11px">Adv</A>\
241 %   } 
242 <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">
243             </FORM>
244 % } 
245         </TD>
246
247         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-left:2px">
248 % if ( $curuser->access_right('View customer services') ) {
249           <FORM ACTION="<%$fsurl%>search/cust_svc.html" METHOD="GET" STYLE="margin:0">
250             <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>
251             <A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size:11px">Advanced</A>
252             <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
253           </FORM>
254 % }
255         </TD>
256
257         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
258 % if ( $conf->config("ticket_system") ) { 
259           <FORM ACTION="<% FS::TicketSystem->baseurl %>index.html" METHOD="GET" STYLE="margin:0">
260             <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>
261             <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" STYLE="color: #ffffff; font-size:11px">Advanced</A>
262             <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
263           </FORM>
264 % }
265         </TD>
266
267       </TR>
268     </TABLE>
269
270     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
271
272       <TR>
273
274 % if ( $menu_position eq 'left' ) {
275
276         <TD BGCOLOR="#000000" STYLE="padding:0" WIDTH="154"></TD>
277         <TD STYLE="padding:0" WIDTH="13"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-corner.png"></TD>
278
279 % }
280
281         <TD STYLE="padding:0" WIDTH="100%"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD>
282
283       </TR>
284
285       <TR HEIGHT="100%">
286
287 % if ( $menu_position eq 'left' ) {
288
289         <TD BGCOLOR="#000000" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right">
290           <SCRIPT TYPE="text/javascript">
291             document.write(myBar);
292           </SCRIPT>
293           <BR>
294           <IMG SRC="<%$fsurl%>images/32clear.gif" HEIGHT="1" WIDTH="154">
295
296           <TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000" WIDTH="100%">
297             <TR>
298               <TD ALIGN="left" STYLE="padding-bottom:1px;border-bottom:1px solid #999999"><% include('/elements/about_freeside.html') |n %></TD>
299             </TR>
300             <TR>
301               <TD ALIGN="right" STYLE="padding-bottom:1px"><% include('/elements/about_rt.html') |n %></TD>
302             </TR>
303           </TABLE>
304
305         </TD>
306         <TD STYLE="padding:0" HEIGHT="100%" WIDTH=13 VALIGN="top"><IMG WIDTH="13" HEIGHT="100%" BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-side.png"></TD>
307
308 % }
309
310         <TD BGCOLOR="#e8e8e8" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
311
312           <FONT SIZE=6>
313             <% $title %>
314           </FONT>
315
316 % unless ( $nobr ) {
317           <BR><BR>
318 % }
319
320           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
321 <%init>
322
323 my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
324 my( $nobr, $nocss ) = ( 0, 0 );
325 if ( ref($_[0]) ) {
326   my $opt = shift;
327   $title   = $opt->{title};
328   $menubar = $opt->{menubar};
329   $etc     = $opt->{etc};
330   $head    = $opt->{head};
331   $nobr    = $opt->{nobr};
332   $nocss   = $opt->{nocss};
333 } else {
334   ($title, $menubar) = ( shift, shift );
335   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
336   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
337 }
338
339 my $conf = new FS::Conf;
340
341 my $curuser = $FS::CurrentUser::CurrentUser;
342
343 my $menu_position = $curuser->option('menu_position')
344                     || 'top'; #new default for 1.9
345
346 my $company_name;
347 my @agentnums = $curuser->agentnums;
348 if ( scalar(@agentnums) == 1 ) {
349   $company_name = $conf->config('company_name', $agentnums[0] );
350 } else {
351   $company_name = $conf->config('company_name');
352 }
353
354 my $prospect_label = '(name, company or phone)';
355
356 my $cust_width = 246;
357 my $cust_label = '(cust #, name, company';
358 if ( $conf->exists('address1-search') ) {
359   $cust_label .= ', address';
360   $cust_width += 56;
361 }
362 $cust_label .= ' or contact phone)';
363
364 my $address2_label = '(Unit #)';
365 my $inv_label = '(inv #)';
366 my $svc_label = '(user, email, ip, mac, domain or service phone)';
367 my $ticketing_label = '(ticket #, subject, email or fulltext:text)';
368
369 </%init>