fix A/R report
[freeside.git] / httemplate / elements / popup_link-cust_svc.html
1 <%doc>
2
3 Example:
4
5   include('/elements/init_overlib.html')
6
7   include('/elements/popup_link-cust_svc.html', { #hashref or a list, either way
8
9     #required
10     'action'         => 'content.html', # uri for content of popup which should
11                                         # be suitable for appending '?svcnum='
12     'label'          => 'click me',     # text of <A> tag
13     'cust_svc'       => $cust_svc       # a FS::cust_svc object or FS::svc_* object
14    
15     #strongly recommended (you want a title, right?)
16     'actionlabel'    => 'You clicked',  # popup title
17    
18     #opt
19     'width'          => '540',
20     'color'          => '#ff0000',
21     'closetext'      => 'Go Away',      # the value '' removes the link
22   )
23
24 </%doc>
25 % if ( $params->{'cust_svc'} ) {
26 <% include( '/elements/popup_link.html', $params ) %>\
27 % }
28 <%init>
29
30 my $params = { 'closetext' => 'Close',
31                'width'     => 392,
32              };
33
34 if (ref($_[0]) eq 'HASH') {
35   $params = { %$params, %{ $_[0] } };
36 } else {
37   $params = { %$params, @_ };
38 }
39
40 $params->{'action'} .=
41   ( $params->{'action'} =~ /\?/ ? ';' : '?' ).
42   'svcnum='. $params->{'cust_svc'}->svcnum;
43
44 $params->{'actionlabel'} .=
45   ' service '. $params->{'cust_svc'}->svcnum; #XXX svcnum? really?
46
47 </%init>