X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fcontact.html;h=8c596155278d612ed808525e84ed34f8874f267b;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hp=93129915fe7ddab894be2b12d9bb724e9c1f55d5;hpb=ded0ab5cac02f099b387de360fb6dd6bd8cbb6b4;p=freeside.git
diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html
index 93129915f..8c5961552 100644
--- a/httemplate/view/cust_main/packages/contact.html
+++ b/httemplate/view/cust_main/packages/contact.html
@@ -1,26 +1,31 @@
% if ( $contact ) {
<% $contact->line |h %>
-% if ( $show_link ) {
+% if ( $show_change_link && ! $opt{no_links} ) {
( <%pkg_change_contact_link($cust_pkg)%> )
-% }
-% } elsif ( $show_link ) {
+% }
+% if ( $show_detach_link && ! $opt{no_links} ) {
- ( <%pkg_add_contact_link($cust_pkg)%> )
+ ( <%pkg_detach_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 $contact = $cust_pkg->contact_obj;
sub pkg_change_contact_link {
@@ -36,16 +41,16 @@ sub pkg_change_contact_link {
);
}
-sub pkg_add_contact_link {
+sub pkg_detach_link {
my $cust_pkg = shift;
#my $pkgpart = $cust_pkg->pkgpart;
include( '/elements/popup_link-cust_pkg.html',
- 'action' => $p. "misc/change_pkg_contact.html",
- 'label' => emt('Add contact'),
- 'actionlabel' => emt('Change'),
+ 'action' => $p. "misc/detach_pkg.html",
+ 'label' => emt('Detach'),
+ 'actionlabel' => emt('Detach'),
'cust_pkg' => $cust_pkg,
'width' => 616,
- 'height' => 192,
+ 'height' => 720,
);
}