rest of per-agent config for company_name, company_address, logo, etc.. RT#3989
[freeside.git] / httemplate / elements / header.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <HTML>
3   <HEAD>
4     <TITLE>
5       <% $title %>
6     </TITLE>
7     <META HTTP-Equiv="Cache-Control" Content="no-cache">
8     <META HTTP-Equiv="Pragma" Content="no-cache">
9     <META HTTP-Equiv="Expires" Content="0"> 
10
11     <% include('menu.html', 'freeside_baseurl' => $fsurl,
12                             'position'         => $menu_position,
13               ) |n
14     %>
15
16     <% include('init_overlib.html') |n %>
17
18     <SCRIPT TYPE="text/javascript">
19       function clearhint_search_cust (what) {
20         if ( what.value == '(cust #, name, company or phone)' )
21           what.value = '';
22       }
23
24       function clearhint_search_address2 (what) {
25         if ( what.value == '(Unit #)' )
26           what.value = '';
27       }
28
29       function clearhint_search_invoice (what) {
30         if ( what.value == '(inv #)' )
31           what.value = '';
32       }
33
34       function clearhint_search_svc (what) {
35         if ( what.value == '(user, email, ip, mac, or domain)' )
36           what.value = '';
37       }
38
39       function clearhint_search_ticket (what) {
40         if ( what.value == '(ticket #, subject, email or fulltext:text)' )
41           what.value = '';
42       }
43     </SCRIPT>
44
45     <% $head |n %>
46
47   </HEAD>
48   <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">
49     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0; padding-right:4">
50       <tr>
51         <td rowspan=2 BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" SRC="<%$fsurl%>view/REAL_logo.cgi"></td>
52         <td align=left rowspan=2 BGCOLOR="#ffffff"> <!-- valign="top" -->
53           <font size=6><% $company_name || 'ExampleCo' %></font>
54         </td>
55         <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">Preferences</a>&nbsp;<BR></FONT>
56         </td>
57       </tr>
58       <tr>
59         <td align=right valign=bottom BGCOLOR="#ffffff">
60   
61           <table>
62             <tr>
63               <td align=right BGCOLOR="#ffffff">
64                 <FONT SIZE="-2">
65                   <% include('/elements/popup_link.html',
66                                'action'      => $fsurl.'docs/about.html',
67                                'label'       => 'Freeside',
68                                'actionlabel' => 'About',
69                                'width'       => 300,
70                                'height'      => 360,
71                                'color'       => '#7e0079',
72                                'scrolling'   => 'no',
73                             ) |n
74                  %>&nbsp;v<% $FS::VERSION %><BR>
75                  <A HREF="<% $conf->config('support-key') ? "http://www.freeside.biz/mediawiki/index.php/Supported:Documentation" : "http://www.freeside.biz/mediawiki/index.php/Freeside:1.9:Documentation" %>" TARGET="_blank">Documentation</A><BR>
76                 </FONT>
77               </td>
78 % if ( $conf->config('ticket_system') eq 'RT_Internal' ) { 
79 % eval "use RT;"; 
80
81                 <td bgcolor=#000000></td>
82                 <td align=left>
83                   <FONT SIZE="-2">
84                    <A HREF="http://www.bestpractical.com/rt" TARGET="_blank">RT<A>&nbsp;v<% $RT::VERSION %><BR>
85                    <A HREF="http://wiki.bestpractical.com/" TARGET="_blank">Documentation</A><BR>
86                   </FONT>
87                 </td>
88 % } 
89
90   
91             </tr>
92           </table>
93   
94         </td>
95       </tr>
96     </table>
97
98 <style type="text/css">
99 input.fsblackbutton {
100          background-color:#333333;
101          color: #ffffff;
102          border:1px solid;
103          border-top-color:#cccccc;
104          border-left-color:#cccccc;
105          border-right-color:#aaaaaa;
106          border-bottom-color:#aaaaaa;
107          font-weight:bold;
108          padding-left:12px;
109          padding-right:12px;
110          overflow:visible;
111          filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
112 }
113
114 input.fsblackbuttonselected {
115          background-color:#7e0079;
116          color: #ffffff;
117          border:1px solid;
118          border-top-color:#cccccc;
119          border-left-color:#cccccc;
120          border-right-color:#aaaaaa;
121          border-bottom-color:#aaaaaa;
122          font-weight:bold;
123          padding-left:12px;
124          padding-right:12px;
125          overflow:visible;
126          filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
127 }
128 </style>
129
130     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
131       <TR>
132         <TD COLSPAN=6 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
133       </TR>
134
135 % if ( $menu_position eq 'top' ) {
136
137       <TR>
138
139         <TD COLSPAN="6" WIDTH="100%" STYLE="padding:0">
140           <SCRIPT TYPE="text/javascript">
141             document.write(myBar);
142           </SCRIPT>
143         </TD>
144
145       </TR>
146
147       <TR>
148         <TD COLSPAN="6" WIDTH="100%" HEIGHT="2px" STYLE="padding:0" BGCOLOR="#000000">
149         </TD>
150       </TR>
151       
152       <TR>
153         <TD COLSPAN="6" WIDTH="100%" HEIGHT="4px" STYLE="padding:0" BGCOLOR="#000000">
154         </TD>
155       </TR>
156
157 % }
158
159       <TR>
160
161         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
162           <FORM ACTION="<%$fsurl%>edit/cust_main.cgi" METHOD="GET" STYLE="margin:0">
163             <INPUT TYPE="submit" VALUE="New customer" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="vertical-align:bottom; font-size:100%">
164           </FORM>
165         </TD>
166
167         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
168 % if ( $curuser->access_right('List customers') ) {
169           <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
170             <INPUT NAME="search_cust" TYPE="text" VALUE="(cust #, name, company or phone)" SIZE="28" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
171             <A HREF="<%$fsurl%>search/report_cust_main.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A>
172             <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
173           </FORM>
174 % }
175         </TD>
176
177         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="center">
178 % if ( $conf->exists('address2-search') ) { 
179             <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0;display:inline">
180               <INPUT TYPE="hidden" NAME="address2_on" VALUE="1">
181               <INPUT NAME="address2_text" TYPE="text" VALUE="(Unit #)" SIZE="4" onFocus="clearhint_search_address2(this);" onClick="clearhint_search_address2(this);" STYLE="vertical-align:bottom;text-align:right;margin-bottom:1px">
182               <BR>
183               <INPUT TYPE="submit" VALUE="Search units" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%;padding-left:2px;padding-right:2px">
184             </FORM>
185 % } 
186         </TD>
187
188         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
189 % if ( $curuser->access_right('View invoices') ) { 
190
191             <FORM ACTION="<%$fsurl%>search/cust_bill.html" METHOD="GET" STYLE="margin:0;display:inline">
192               <INPUT NAME="invnum" TYPE="text" VALUE="(inv #)" SIZE="4" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" STYLE="vertical-align:bottom;text-align:right;margin-bottom:1px">
193 %   if ( $curuser->access_right('List invoices') ) { 
194
195                 <A HREF="<%$fsurl%>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A>
196 %   } 
197
198               <BR>
199               <INPUT TYPE="submit" VALUE="Search invoices" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
200             </FORM>
201 % } 
202         </TD>
203
204         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
205           <FORM ACTION="<%$fsurl%>search/cust_svc.html" METHOD="GET" STYLE="margin:0">
206             <INPUT NAME="search_svc" TYPE="text" VALUE="(user, email, ip, mac, or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
207             <A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%">Advanced</A>
208             <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
209           </FORM>
210         </TD>
211
212         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-right:4px">
213 % if ( $conf->config("ticket_system") ) { 
214           <FORM ACTION="<% FS::TicketSystem->baseurl %>index.html" METHOD="GET" STYLE="margin:0">
215             <INPUT NAME="q" TYPE="text" VALUE="(ticket #, subject, email or fulltext:text)" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
216             <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A>
217             <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%;padding-left:2px;padding-right:2px">
218           </FORM>
219 % }
220         </TD>
221
222       </TR>
223     </TABLE>
224
225     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
226
227       <TR>
228
229 % if ( $menu_position eq 'left' ) {
230
231         <TD BGCOLOR="#000000" STYLE="padding:0" WIDTH="154"></TD>
232         <TD STYLE="padding:0" WIDTH="13"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-corner.png"></TD>
233
234 % }
235
236         <TD STYLE="padding:0" WIDTH="100%"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD>
237
238       </TR>
239
240       <TR HEIGHT="100%">
241
242 % if ( $menu_position eq 'left' ) {
243
244         <TD BGCOLOR="#000000" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right">
245           <SCRIPT TYPE="text/javascript">
246             document.write(myBar);
247           </SCRIPT>
248           <BR>
249           <IMG SRC="<%$fsurl%>images/32clear.gif" HEIGHT="1" WIDTH="154">
250
251         </TD>
252         <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>
253
254 % }
255
256         <TD BGCOLOR="#e8e8e8" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
257
258           <FONT SIZE=6>
259             <% $title %>
260           </FONT>
261
262 % unless ( $nobr ) {
263           <BR><BR>
264 % }
265
266           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
267 <%init>
268
269 my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
270 my( $nobr ) = ( 0 );
271 if ( ref($_[0]) ) {
272   my $opt = shift;
273   $title   = $opt->{title};
274   $menubar = $opt->{menubar};
275   $etc     = $opt->{etc};
276   $head    = $opt->{head};
277   $nobr    = $opt->{nobr};
278 } else {
279   ($title, $menubar) = ( shift, shift );
280   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
281   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
282 }
283
284 my $conf = new FS::Conf;
285
286 my $curuser = $FS::CurrentUser::CurrentUser;
287
288 my $menu_position = $curuser->option('menu_position')
289                     || 'top'; #new default for 1.9
290
291 my $company_name;
292 my @agentnums = $curuser->agentnums;
293 if ( scalar(@agentnums) == 1 ) {
294   $company_name = $conf->config('company_name', $agentnums[0] );
295 } else {
296   $company_name = $conf->config('company_name');
297 }
298
299 </%init>