clean up package list UI: put actions in a dropdown
[freeside.git] / httemplate / view / cust_main / packages / contact.html
1 % if ( $contact ) {
2     <% $contact->line |h %>
3 % if ( $show_change_link && ! $opt{no_links} ) {
4         <FONT SIZE=-1>
5           (&nbsp;<%pkg_change_contact_link($cust_pkg)%>&nbsp;)
6         </FONT>
7 % }
8 % if ( $show_detach_link && ! $opt{no_links} ) {
9         <FONT SIZE=-1>
10           (&nbsp;<%pkg_detach_link($cust_pkg)%>&nbsp;)
11         </FONT>
12 %    }
13     <BR>
14 % }
15 <%init>
16
17 my %opt = @_;
18
19 my $cust_pkg       = $opt{'cust_pkg'};
20
21 my $show_change_link = 
22   ! $cust_pkg->get('cancel')
23   && $FS::CurrentUser::CurrentUser->access_right('Change customer package');
24
25 my $show_detach_link =
26   ! $cust_pkg->get('cancel')
27   && $FS::CurrentUser::CurrentUser->access_right('Detach customer package');
28
29 my $contact = $cust_pkg->contact_obj;
30
31 sub pkg_change_contact_link {
32   my $cust_pkg = shift;
33   #my $pkgpart = $cust_pkg->pkgpart;
34   include( '/elements/popup_link-cust_pkg.html',
35     'action'      => $p. "misc/change_pkg_contact.html",
36     'label'       => emt('Change'), # contact'),
37     'actionlabel' => emt('Change'),
38     'cust_pkg'    => $cust_pkg,
39     'width'       => 616,
40     'height'      => 220,
41   );
42 }
43
44 sub pkg_detach_link {
45   my $cust_pkg = shift;
46   #my $pkgpart = $cust_pkg->pkgpart;
47   include( '/elements/popup_link-cust_pkg.html',
48     'action'      => $p. "misc/detach_pkg.html",
49     'label'       => emt('Detach'),
50     'actionlabel' => emt('Detach'),
51     'cust_pkg'    => $cust_pkg,
52     'width'       => 616,
53     'height'      => 720,
54   );
55 }
56
57 #sub edit_contact_link {
58 #  my $contactnum = shift;
59 #  include( '/elements/popup_link.html',
60 #    'action'      => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
61 #    'label'       => emt('Edit contact'),
62 #    'actionlabel' => emt('Edit'),
63 #  );
64 #}
65
66 </%init>