summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-04-19 11:54:58 -0700
committerIvan Kohler <ivan@freeside.biz>2013-04-19 11:54:58 -0700
commit20aa565c8c1916a86a11726c33f087306f105164 (patch)
tree6795ba7439899193fccd443634fde70605003ef3 /httemplate
parent110a9f8a594aa5cf5ac1cc9c91aee90fea67c949 (diff)
package contacts / "name per packages", RT#22185
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/view/cust_main/packages/contact.html55
1 files changed, 33 insertions, 22 deletions
diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html
index c3b161b70..dd78239ab 100644
--- a/httemplate/view/cust_main/packages/contact.html
+++ b/httemplate/view/cust_main/packages/contact.html
@@ -1,18 +1,15 @@
% if ( $contact ) {
<% $contact->line |h %>
+% if ( $show_link ) {
+ <FONT SIZE=-1>
+ (&nbsp;<%pkg_change_contact_link($cust_pkg)%>&nbsp;)
+ </FONT>
+% }
+% } elsif ( $show_link ) {
+ <FONT SIZE=-1>
+ (&nbsp;<%pkg_add_contact_link($cust_pkg)%>&nbsp;)
+ </FONT>
% }
-
-% if ( ! $cust_pkg->get('cancel')
-% && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
-% )
-% {
- <FONT SIZE=-1>
-%#XXX (&nbsp;<%pkg_change_contact_link($cust_pkg)%>&nbsp;)
-%# % if ( $cust_pkg->contactnum ) {
-%# (&nbsp;<%edit_contact_link($cust_pkg->contactnum)%>&nbsp;)
-%# % }
- </FONT>
-% }
<%init>
my $conf = new FS::Conf;
@@ -20,27 +17,41 @@ my %opt = @_;
my $cust_pkg = $opt{'cust_pkg'};
+my $show_link =
+ ! $cust_pkg->get('cancel')
+ && $FS::CurrentUser::CurrentUser->access_right('Change customer package');
+
my $contact = $cust_pkg->contact_obj;
sub pkg_change_contact_link {
my $cust_pkg = shift;
- my $pkgpart = $cust_pkg->pkgpart;
+ #my $pkgpart = $cust_pkg->pkgpart;
include( '/elements/popup_link-cust_pkg.html',
-#XXX
- 'action' => $p. "misc/change_pkg.cgi?contactnum=-1",
- 'label' => emt('Change contact'),
+ 'action' => $p. "misc/change_pkg_contact.html",
+ 'label' => emt('Change'), # contact'),
'actionlabel' => emt('Change'),
'cust_pkg' => $cust_pkg,
);
}
-sub edit_contact_link {
- my $contactnum = shift;
- include( '/elements/popup_link.html',
- 'action' => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
- 'label' => emt('Edit contact'),
- 'actionlabel' => emt('Edit'),
+sub pkg_add_contact_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'),
+ 'cust_pkg' => $cust_pkg,
);
}
+#sub edit_contact_link {
+# my $contactnum = shift;
+# include( '/elements/popup_link.html',
+# 'action' => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
+# 'label' => emt('Edit contact'),
+# 'actionlabel' => emt('Edit'),
+# );
+#}
+
</%init>