'Order customer package',
'One-time charge',
'Change customer package',
+ 'Detach customer package',
'Bulk change customer packages',
'Edit customer package dates',
'Discount customer package', #NEW
'Financial reports' => [ 'Employees: Commission Report',
'Employees: Audit Report',
],
+ 'Change customer package' => 'Detach customer package',
;
foreach my $old_acl ( keys %onetime ) {
% if ( $contact ) {
<% $contact->line |h %>
-% if ( $show_link ) {
+% if ( $show_change_link ) {
<FONT SIZE=-1>
( <%pkg_change_contact_link($cust_pkg)%> )
+ </FONT>
+% }
+% if ( $show_detach_link ) {
( <%pkg_detach_link($cust_pkg)%> )
</FONT>
% }
-% } elsif ( $show_link ) {
- <FONT SIZE=-1>
- ( <%pkg_add_contact_link($cust_pkg)%> )
- </FONT>
+% } elsif ( $show_contact_link ) {
+ <FONT SIZE=-1>
+ ( <%pkg_add_contact_link($cust_pkg)%> )
+ </FONT>
% }
<%init>
my $cust_pkg = $opt{'cust_pkg'};
-my $show_link =
+my $show_change_link =
! $cust_pkg->get('cancel')
&& $FS::CurrentUser::CurrentUser->access_right('Change customer package');
+my $show_detach_link =
+ ! $cust_pkg->get('cancel')
+ && $FS::CurrentUser::CurrentUser->access_right('Detach customer package');
+
+my $show_contact_link =
+ ! $cust_pkg->get('cancel')
+ ; #&& $FS::CurrentUser::CurrentUser->access_right('Add package contact'); #or something like that
+
my $contact = $cust_pkg->contact_obj;
sub pkg_change_contact_link {
include( '/elements/popup_link-cust_pkg.html',
'action' => $p. "misc/change_pkg_contact.html",
'label' => emt('Add contact'),
- 'actionlabel' => emt('Change'),
+ 'actionlabel' => emt('Add contact'),
'cust_pkg' => $cust_pkg,
'width' => 616,
'height' => 192,