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)%> )
13 % } elsif ( $show_contact_link && ! $opt{no_links} ) {
15 ( <%pkg_add_contact_link($cust_pkg)%> )
22 my $cust_pkg = $opt{'cust_pkg'};
24 my $show_change_link =
25 ! $cust_pkg->get('cancel')
26 && $FS::CurrentUser::CurrentUser->access_right('Change customer package');
28 my $show_detach_link =
29 ! $cust_pkg->get('cancel')
30 && $FS::CurrentUser::CurrentUser->access_right('Detach customer package');
32 my $show_contact_link =
33 ! $cust_pkg->get('cancel')
34 ; #&& $FS::CurrentUser::CurrentUser->access_right('Add package contact'); #or something like that
36 my $contact = $cust_pkg->contact_obj;
38 sub pkg_change_contact_link {
40 #my $pkgpart = $cust_pkg->pkgpart;
41 include( '/elements/popup_link-cust_pkg.html',
42 'action' => $p. "misc/change_pkg_contact.html",
43 'label' => emt('Change'), # contact'),
44 'actionlabel' => emt('Change'),
45 'cust_pkg' => $cust_pkg,
51 sub pkg_add_contact_link {
53 #my $pkgpart = $cust_pkg->pkgpart;
54 include( '/elements/popup_link-cust_pkg.html',
55 'action' => $p. "misc/change_pkg_contact.html",
56 'label' => emt('Add contact'),
57 'actionlabel' => emt('Add contact'),
58 'cust_pkg' => $cust_pkg,
66 #my $pkgpart = $cust_pkg->pkgpart;
67 include( '/elements/popup_link-cust_pkg.html',
68 'action' => $p. "misc/detach_pkg.html",
69 'label' => emt('Detach'),
70 'actionlabel' => emt('Detach'),
71 'cust_pkg' => $cust_pkg,
77 #sub edit_contact_link {
78 # my $contactnum = shift;
79 # include( '/elements/popup_link.html',
80 # 'action' => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
81 # 'label' => emt('Edit contact'),
82 # 'actionlabel' => emt('Edit'),