2 <% $contact->line |h %>
3 % if ( $show_change_link && ! $opt{no_links} ) {
5 ( <%pkg_change_contact_link($cust_pkg)%> )
8 % if ( $show_detach_link && ! $opt{no_links} ) {
10 ( <%pkg_detach_link($cust_pkg)%> )
14 % } elsif ( $show_contact_link && ! $opt{no_links} ) {
16 ( <%pkg_add_contact_link($cust_pkg)%> )
24 my $cust_pkg = $opt{'cust_pkg'};
26 my $show_change_link =
27 ! $cust_pkg->get('cancel')
28 && $FS::CurrentUser::CurrentUser->access_right('Change customer package');
30 my $show_detach_link =
31 ! $cust_pkg->get('cancel')
32 && $FS::CurrentUser::CurrentUser->access_right('Detach customer package');
34 my $show_contact_link =
35 ! $cust_pkg->get('cancel')
36 ; #&& $FS::CurrentUser::CurrentUser->access_right('Add package contact'); #or something like that
38 my $contact = $cust_pkg->contact_obj;
40 sub pkg_change_contact_link {
42 #my $pkgpart = $cust_pkg->pkgpart;
43 include( '/elements/popup_link-cust_pkg.html',
44 'action' => $p. "misc/change_pkg_contact.html",
45 'label' => emt('Change'), # contact'),
46 'actionlabel' => emt('Change'),
47 'cust_pkg' => $cust_pkg,
53 sub pkg_add_contact_link {
55 #my $pkgpart = $cust_pkg->pkgpart;
56 include( '/elements/popup_link-cust_pkg.html',
57 'action' => $p. "misc/change_pkg_contact.html",
58 'label' => emt('Add contact'),
59 'actionlabel' => emt('Add contact'),
60 'cust_pkg' => $cust_pkg,
68 #my $pkgpart = $cust_pkg->pkgpart;
69 include( '/elements/popup_link-cust_pkg.html',
70 'action' => $p. "misc/detach_pkg.html",
71 'label' => emt('Detach'),
72 'actionlabel' => emt('Detach'),
73 'cust_pkg' => $cust_pkg,
79 #sub edit_contact_link {
80 # my $contactnum = shift;
81 # include( '/elements/popup_link.html',
82 # 'action' => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
83 # 'label' => emt('Edit contact'),
84 # 'actionlabel' => emt('Edit'),