From: Steve Sutton Date: Tue, 11 Oct 2016 19:02:48 +0000 (-0400) Subject: Update package list for member manager. X-Git-Tag: v1.2.0^2~1^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=7dea24937003f49c4631163daaed44d909a5dd5c;p=WP-Plugins%2Fglm-member-db-packaging.git Update package list for member manager. make the list not limit to 5. Only get the current packages. --- diff --git a/models/admin/dashboard/packaging.php b/models/admin/dashboard/packaging.php index b4f5b15..375c774 100644 --- a/models/admin/dashboard/packaging.php +++ b/models/admin/dashboard/packaging.php @@ -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, ); diff --git a/views/admin/dashboard/packaging.html b/views/admin/dashboard/packaging.html index 95b2f2c..563089e 100644 --- a/views/admin/dashboard/packaging.html +++ b/views/admin/dashboard/packaging.html @@ -4,6 +4,8 @@ Packages {if $lockedToMember}  Add a New Package for this {$terms.term_member_cap}  + {else} + (Current) {/if}