4.x style one-time charge
[freeside.git] / httemplate / elements / header-cust_main.html
1 <%doc>
2
3 Examples:
4
5   <& /elements/header-cust_main.html,
6        view      => 'basics', #required
7        cust_main => $cust_main, # cust_main or custnum is required
8        custnum   => $custnum,   #
9   &>
10
11 </%doc>
12 <& /elements/header.html, {
13              'title'          => $title,
14              'title_noescape' => $title_noescape,
15              'head'           => $head,
16              'nobr'           => 1,
17              'etc'            => $opt{'etc'},
18           }
19 &>
20
21 % my @part_tag = $cust_main->part_tag;
22 % if ( $conf->config('cust_tag-location') eq 'top' && @part_tag ) {
23 <TABLE STYLE="margin-bottom:8px" CELLSPACING=2>
24 %   foreach my $part_tag ( @part_tag ) {
25 <TR>
26   <TD>
27       <FONT SIZE="+1"
28             <% length($part_tag->tagcolor)
29                  ? 'STYLE="background-color:#'.$part_tag->tagcolor.'"'
30                  : ''
31       %>><% $part_tag->tagname.': '. $part_tag->tagdesc |h %></FONT>
32   </TD>
33 </TR>
34 %   }
35 </TABLE>
36 % }
37 <& /view/cust_main/menu.html, cust_main => $cust_main, show => $opt{'view'} &>
38 <BR>
39
40 <DIV CLASS="fstabcontainer">
41
42 <& /elements/init_overlib.html &>
43
44 <SCRIPT TYPE="text/javascript">
45 function areyousure(href, message) {
46   if (confirm(message) == true)
47     window.location.href = href;
48 }
49 function areyousure_popup(message, action, actionlabel) {
50   if (confirm(message) == true) {
51 <% include('/elements/popup_link_onclick.html',
52      'js_action' => 'action',
53      'js_actionlabel' => 'actionlabel',
54    ) %>
55   }
56 }
57 </SCRIPT>
58
59 <%init>
60
61 my $curuser = $FS::CurrentUser::CurrentUser;
62
63 my $conf = new FS::Conf;
64
65 my %opt = @_;
66
67 my $cust_main = $opt{'cust_main'} || qsearchs( {
68   'table'     => 'cust_main',
69   'hashref'   => { 'custnum' => $opt{'custnum'} },
70   'extra_sql' => ' AND '. $curuser->agentnums_sql,
71 });
72 die "Customer not found!" unless $cust_main;
73
74 my $title = mt("Customer").' #'. $cust_main->display_custnum. ': ';
75 my $title_noescape = $title. encode_entities($cust_main->name);
76 $title .= $cust_main->name;
77
78 if ( $curuser->num_agents ) {
79   $title_noescape =
80     encode_entities($cust_main->agent->agent). " $title_noescape";
81   $title = $cust_main->agent->agent. " $title";
82 }
83
84 my $status = $cust_main->status_label;
85 $status .= ' (Cancelled)' if $cust_main->is_status_delay_cancel;
86 $title_noescape .= ' (<B><FONT COLOR="#'. $cust_main->statuscolor. '">'. $status.  '</FONT></B>)';
87 $title .= " ($status)";
88
89 my $ie_compat = $conf->config('ie-compatibility_mode');
90 my $head = '';
91 if ( $ie_compat ) {
92   $head = qq(<meta http-equiv="X-UA-Compatible" content="IE=$ie_compat" />);
93 }
94
95 </%init>