summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/packages/contact.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view/cust_main/packages/contact.html')
-rw-r--r--httemplate/view/cust_main/packages/contact.html28
1 files changed, 20 insertions, 8 deletions
diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html
index 4e0551b31..fe8b71534 100644
--- a/httemplate/view/cust_main/packages/contact.html
+++ b/httemplate/view/cust_main/packages/contact.html
@@ -1,15 +1,19 @@
% if ( $contact ) {
<% $contact->line |h %>
-% if ( $show_link ) {
+% if ( $show_change_link ) {
<FONT SIZE=-1>
(&nbsp;<%pkg_change_contact_link($cust_pkg)%>&nbsp;)
- (&nbsp;<%pkg_detach_link($cust_pkg)%>&nbsp;)
</FONT>
-% }
-% } elsif ( $show_link ) {
+% }
+% if ( $show_detach_link ) {
<FONT SIZE=-1>
- (&nbsp;<%pkg_add_contact_link($cust_pkg)%>&nbsp;)
+ (&nbsp;<%pkg_detach_link($cust_pkg)%>&nbsp;)
</FONT>
+% }
+% } elsif ( $show_contact_link ) {
+ <FONT SIZE=-1>
+ (&nbsp;<%pkg_add_contact_link($cust_pkg)%>&nbsp;)
+ </FONT>
% }
<%init>
@@ -18,10 +22,18 @@ my %opt = @_;
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 {
@@ -43,7 +55,7 @@ sub pkg_add_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,
@@ -59,7 +71,7 @@ sub pkg_detach_link {
'actionlabel' => emt('Detach'),
'cust_pkg' => $cust_pkg,
'width' => 616,
- 'height' => 676,
+ 'height' => 684,
);
}