summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/packages
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-05-02 23:40:22 -0700
committerIvan Kohler <ivan@freeside.biz>2013-05-02 23:40:22 -0700
commit4a3e900ad42a15a6a999e1d1461b816d7fac2230 (patch)
tree55330f56f163b1215098a2f18a2607b20eb75d36 /httemplate/view/cust_main/packages
parent51d26d73eb99d9f7f45591fa6a4b99c3a3429565 (diff)
detach a package into a new customer, RT#22185
Diffstat (limited to 'httemplate/view/cust_main/packages')
-rw-r--r--httemplate/view/cust_main/packages/contact.html25
1 files changed, 18 insertions, 7 deletions
diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html
index 4e0551b31..0c81eb39d 100644
--- a/httemplate/view/cust_main/packages/contact.html
+++ b/httemplate/view/cust_main/packages/contact.html
@@ -1,15 +1,18 @@
% if ( $contact ) {
<% $contact->line |h %>
-% if ( $show_link ) {
+% if ( $show_change_link ) {
<FONT SIZE=-1>
(&nbsp;<%pkg_change_contact_link($cust_pkg)%>&nbsp;)
+ </FONT>
+% }
+% if ( $show_detach_link ) {
(&nbsp;<%pkg_detach_link($cust_pkg)%>&nbsp;)
</FONT>
% }
-% } elsif ( $show_link ) {
- <FONT SIZE=-1>
- (&nbsp;<%pkg_add_contact_link($cust_pkg)%>&nbsp;)
- </FONT>
+% } elsif ( $show_contact_link ) {
+ <FONT SIZE=-1>
+ (&nbsp;<%pkg_add_contact_link($cust_pkg)%>&nbsp;)
+ </FONT>
% }
<%init>
@@ -18,10 +21,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 +54,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,