X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fcontact.html;h=88f8afb4c75f2a6d1868f716617805a934a637dc;hb=f92a083465019a7224d912cd78b6881f8aef1b52;hp=4e0551b3192ebe251fcdffaaaecb8fec5a98f14a;hpb=51d26d73eb99d9f7f45591fa6a4b99c3a3429565;p=freeside.git
diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html
index 4e0551b31..88f8afb4c 100644
--- a/httemplate/view/cust_main/packages/contact.html
+++ b/httemplate/view/cust_main/packages/contact.html
@@ -1,27 +1,40 @@
% if ( $contact ) {
<% $contact->line |h %>
-% if ( $show_link ) {
+% if ( $show_change_link && ! $opt{no_links} ) {
( <%pkg_change_contact_link($cust_pkg)%> )
- ( <%pkg_detach_link($cust_pkg)%> )
-% }
-% } elsif ( $show_link ) {
+% }
+% if ( $show_detach_link && ! $opt{no_links} ) {
- ( <%pkg_add_contact_link($cust_pkg)%> )
+ ( <%pkg_detach_link($cust_pkg)%> )
+% }
+
+% } elsif ( $show_contact_link && ! $opt{no_links} ) {
+
+ ( <%pkg_add_contact_link($cust_pkg)%> )
+
+
% }
<%init>
-my $conf = new FS::Conf;
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 +56,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 +72,7 @@ sub pkg_detach_link {
'actionlabel' => emt('Detach'),
'cust_pkg' => $cust_pkg,
'width' => 616,
- 'height' => 676,
+ 'height' => 720,
);
}