Update package list for member manager.
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 11 Oct 2016 19:02:48 +0000 (15:02 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 11 Oct 2016 19:02:48 +0000 (15:02 -0400)
make the list not limit to 5. Only get the current packages.

models/admin/dashboard/packaging.php
views/admin/dashboard/packaging.html

index b4f5b15..375c774 100644 (file)
@@ -129,10 +129,10 @@ class GlmMembersAdmin_dashboard_packaging extends GlmDataPackages
 
         } else {
             // This should be the Current Packages that are current running.
-            $where = '';
-            $packages = $this->getList( $where, '', true, 'id', 1, 5 );
+            $where    = 'T.start_date <= now() and T.end_date >= now()';
+            $packages = $this->getList( $where );
             // If we have some, tell the template
-            if ($packages && count($packages['list']) > 0) {
+            if ($packages && count($packages) > 0) {
                 $havePackages = true;
             }
         }
@@ -152,7 +152,7 @@ class GlmMembersAdmin_dashboard_packaging extends GlmDataPackages
         $templateData = array(
             'lockedToMember' => $lockedToMember,
             'havePackages'   => $havePackages,
-            'packages'       => $packages['list'],
+            'packages'       => (isset($packages['list']) ? $packages['list']: $packages),
             'memberID'       => $memberID,
         );
 
index 95b2f2c..563089e 100644 (file)
@@ -4,6 +4,8 @@
             <a href="{$thisUrl}?page=glm-members-admin-menu-packaging-index">Packages</a>
              {if $lockedToMember}
             <a href="{$thisUrl}?page=glm-members-admin-menu-packaging-index&glm_action=index&option=add" class="button glm-right">&nbsp;Add a New Package for this {$terms.term_member_cap}&nbsp;</a>
+            {else}
+            (Current)
              {/if}
         </h2>
         <div class="glm-widget-content">