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)%> )
22 my $conf = new FS::Conf;
25 my $cust_pkg = $opt{'cust_pkg'};
27 my $show_change_link =
28 ! $cust_pkg->get('cancel')
29 && $FS::CurrentUser::CurrentUser->access_right('Change customer package');
31 my $show_detach_link =
32 ! $cust_pkg->get('cancel')
33 && $FS::CurrentUser::CurrentUser->access_right('Detach customer package');
35 my $show_contact_link =
36 ! $cust_pkg->get('cancel')
37 ; #&& $FS::CurrentUser::CurrentUser->access_right('Add package contact'); #or something like that
39 my $contact = $cust_pkg->contact_obj;
41 sub pkg_change_contact_link {
43 #my $pkgpart = $cust_pkg->pkgpart;
44 include( '/elements/popup_link-cust_pkg.html',
45 'action' => $p. "misc/change_pkg_contact.html",
46 'label' => emt('Change'), # contact'),
47 'actionlabel' => emt('Change'),
48 'cust_pkg' => $cust_pkg,
54 sub pkg_add_contact_link {
56 #my $pkgpart = $cust_pkg->pkgpart;
57 include( '/elements/popup_link-cust_pkg.html',
58 'action' => $p. "misc/change_pkg_contact.html",
59 'label' => emt('Add contact'),
60 'actionlabel' => emt('Add contact'),
61 'cust_pkg' => $cust_pkg,
69 #my $pkgpart = $cust_pkg->pkgpart;
70 include( '/elements/popup_link-cust_pkg.html',
71 'action' => $p. "misc/detach_pkg.html",
72 'label' => emt('Detach'),
73 'actionlabel' => emt('Detach'),
74 'cust_pkg' => $cust_pkg,
80 #sub edit_contact_link {
81 # my $contactnum = shift;
82 # include( '/elements/popup_link.html',
83 # 'action' => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
84 # 'label' => emt('Edit contact'),
85 # 'actionlabel' => emt('Edit'),