[freeside-commits] branch FREESIDE_4_BRANCH updated. 70c70dbaa188bd8c8c9850657c1cd8d5a61cc8c5

Ivan ivan at 420.am
Thu Nov 10 22:46:10 PST 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  70c70dbaa188bd8c8c9850657c1cd8d5a61cc8c5 (commit)
      from  ac5d60b9226178a10eb0e680bcbadb9be02b4fa4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 70c70dbaa188bd8c8c9850657c1cd8d5a61cc8c5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Nov 10 22:45:36 2016 -0800

    clean up package list UI: put actions in a dropdown

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>
-      ( <%pkg_add_contact_link($cust_pkg)%> )
-    </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'} ) {
-      ( <%pkg_change_location_link($cust_pkg)%> )
-%     }
-%     if ( $cust_pkg->locationnum && ! $opt{no_links} ) {
-        ( <%pkg_edit_location_link($cust_pkg->locationnum)%> )
-%     }
-  </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,
+                 },
+
                ],
              ],
         &>

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/cust_main/packages/contact.html  |   22 ----------
 httemplate/view/cust_main/packages/location.html |   42 +-----------------
 httemplate/view/cust_main/packages/package.html  |   51 ++++++++++++++++++++++
 3 files changed, 52 insertions(+), 63 deletions(-)




More information about the freeside-commits mailing list