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