summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-11-10 22:45:36 -0800
committerIvan Kohler <ivan@freeside.biz>2016-11-10 22:46:06 -0800
commit70c70dbaa188bd8c8c9850657c1cd8d5a61cc8c5 (patch)
tree9096e0fd1e2812d4ec46b83f60614100f30a4e5d
parentac5d60b9226178a10eb0e680bcbadb9be02b4fa4 (diff)
clean up package list UI: put actions in a dropdown
-rw-r--r--httemplate/view/cust_main/packages/contact.html22
-rw-r--r--httemplate/view/cust_main/packages/location.html42
-rw-r--r--httemplate/view/cust_main/packages/package.html51
3 files changed, 52 insertions, 63 deletions
diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html
index 88f8afb..8c59615 100644
--- a/httemplate/view/cust_main/packages/contact.html
+++ b/httemplate/view/cust_main/packages/contact.html
@@ -11,11 +11,6 @@
</FONT>
% }
<BR>
-% } elsif ( $show_contact_link && ! $opt{no_links} ) {
- <FONT SIZE=-1>
- (&nbsp;<%pkg_add_contact_link($cust_pkg)%>&nbsp;)
- </FONT>
- <BR>
% }
<%init>
@@ -31,10 +26,6 @@ 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 {
@@ -50,19 +41,6 @@ sub pkg_change_contact_link {
);
}
-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('Add contact'),
- 'cust_pkg' => $cust_pkg,
- 'width' => 616,
- 'height' => 192,
- );
-}
-
sub pkg_detach_link {
my $cust_pkg = shift;
#my $pkgpart = $cust_pkg->pkgpart;
diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html
index 595d6b3..b855e6a 100644
--- a/httemplate/view/cust_main/packages/location.html
+++ b/httemplate/view/cust_main/packages/location.html
@@ -19,7 +19,7 @@
% if ( $loc->latitude && $loc->longitude ) {
<BR>
<FONT SIZE=-1>
- <% $loc->latitude %>, <% $loc->longitude %>
+ <!-- <% $loc->latitude %>, <% $loc->longitude %> -->
<& /elements/coord-links.html, {
'latitude' => $loc->latitude,
'longitude' => $loc->longitude,
@@ -50,20 +50,6 @@
% } # all of this is hidden if packages are grouped by location, because
% # it's in the top banner
-% if ( ! $cust_pkg->get('cancel')
-% && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
-% )
-% {
- <BR>
- <FONT SIZE=-1>
-% unless ( $opt{no_links} or $opt{'change_from'} ) {
- (&nbsp;<%pkg_change_location_link($cust_pkg)%>&nbsp;)
-% }
-% if ( $cust_pkg->locationnum && ! $opt{no_links} ) {
- (&nbsp;<%pkg_edit_location_link($cust_pkg->locationnum)%>&nbsp;)
-% }
- </FONT>
-% }
% } # if the package is a scheduled future package change without location
% # change, then don't show any of this at all. It's all implied by the
% # preceding package.
@@ -80,30 +66,4 @@ my $loc = $cust_pkg->cust_location_or_main('_cache'=>$opt{cust_location_cache});
# dubious--they should all have a location now
my $default = $cust_pkg->locationnum == $opt{'cust_main'}->ship_locationnum;
-sub pkg_change_location_link {
- my $cust_pkg = shift;
- my $pkgpart = $cust_pkg->pkgpart;
- include( '/elements/popup_link-cust_pkg.html',
- 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
- "address1=;address2=;city=;county=;state=$statedefault;".
- "zip=;country=$countrydefault",
- 'label' => emt('Change location'),
- 'actionlabel' => emt('Change'),
- 'cust_pkg' => $cust_pkg,
- 'width' => 960,
- 'height' => 530,
- );
-}
-
-sub pkg_edit_location_link {
- my $locationnum = shift;
- include( '/elements/popup_link.html',
- 'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
- 'label' => emt('Edit location'),
- 'actionlabel' => emt('Edit'),
- 'width' => 700,
- 'height' => 355,
- );
-}
-
</%init>
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 9fed5b5..14f7fb0 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -280,6 +280,10 @@
';clone='. $part_pkg->pkgpart,
},
+ { label => '-',
+ content => '-',
+ },
+
{ label => 'View package events',
acl => [ 'Billing event reports',
'View customer billing events', ],
@@ -287,6 +291,11 @@
url => "search/cust_event.html?$plink",
},
+ { label => '-',
+ condition => sub { $cust_pkg->exists_cust_event },
+ content => '-',
+ },
+
{ label => 'Change quantity',
acl => 'Change customer package',
condition => sub { $part_pkg->freq ne '0'
@@ -314,6 +323,10 @@
height => 220,
},
+ { label => '-',
+ content => '-',
+ },
+
{ label => (@invoice_detail ? 'Edit' : 'Add').
' invoice details',
acl => 'Edit customer package invoice details',
@@ -551,6 +564,44 @@
},
+ { label => '-',
+ condition => sub { $part_pkg->freq ne '0'
+ && ! $change_from
+ && ! $cust_pkg->get('cancel')
+ },
+ content => '-',
+ },
+
+ { label => 'Add contact',
+ #acl => 'Add package contact',#or something like that
+ condition => sub { ! $cust_pkg->get('cancel') },
+ popup => "misc/change_pkg-contact.html?$plink",
+ actionlabel => emt('Add contact'),
+ width => 616,
+ height => 192,
+ },
+
+ { label => 'Change location',
+ acl => 'Change customer package',
+ condition => sub { ! $change_from },
+ popup => "misc/change_pkg.cgi?locationnum=-1;$plink;".
+ "address1=;address2=;city=;county=;state=$statedefault;".
+ "zip=;country=$countrydefault",
+ actionlabel => emt('Change location'),
+ width => 960,
+ height => 530,
+ },
+
+ { label => 'Edit location',
+ acl => 'Change customer package',
+ condition => sub { ! $change_from && $cust_pkg->locationnum != $cust_pkg->cust_main->ship_locationnum },
+ popup => 'misc/cust_location.cgi?locationnum='.
+ $cust_pkg->locationnum,
+ actionlabel => emt('Edit location'),
+ width => 700,
+ height => 355,
+ },
+
],
],
&>