Added expired 'where' and fixed some filter details
authorLaury GvR <laury@gaslightmedia.com>
Tue, 25 Sep 2018 13:45:06 +0000 (09:45 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 25 Sep 2018 13:45:06 +0000 (09:45 -0400)
setup/adminHooks.php

index cf10620..f5e90e8 100644 (file)
@@ -94,6 +94,7 @@ add_filter(
                 ],
                 [
                     'id'       => 'entityAmount',
+                    'title'    => 'Number of Packages',
                     'order'    => 1,
                     'template' => 'entityAmount',
                     'table'    => $packagesTable,
@@ -109,18 +110,18 @@ add_filter(
                     'where'     => 'title',
                     'resultUrl' => $packagingIndexPage . "&option=edit",
                 ],
-                [
-                    'id'        => 'active',
-                    'title'     => "Active Packages",
-                    'slug'      => "active-packages",
-                    'order'     => 3,
-                    'template'  => 'list',
-                    'entityID'  => 'packageID',
-                    'table'     => $packagesTable,
-                    'fields'    => "id, title, ref_type, ref_dest",
-                    'where'     => 'status='.$this->config['status_numb']['Active'],
-                    'resultUrl' => $packagingEditPage,
-                ],
+                // [
+                //     'id'        => 'active',
+                //     'title'     => "Active Packages",
+                //     'slug'      => "active-packages",
+                //     'order'     => 3,
+                //     'template'  => 'list',
+                //     'entityID'  => 'packageID',
+                //     'table'     => $packagesTable,
+                //     'fields'    => "id, title, ref_type, ref_dest",
+                //     'where'     => 'status='.$this->config['status_numb']['Active'],
+                //     'resultUrl' => $packagingEditPage,
+                // ],
                 [
                     'id'        => 'pending', 
                     'title'     => "Pending Packages",
@@ -131,7 +132,7 @@ add_filter(
                     'table'     => $packagesTable,
                     'fields'    => "id, title, ref_type, ref_dest",
                     'where'     => 'status='.$this->config['status_numb']['Pending'],
-                    'resultUrl' => $packagingEditPage,
+                    'url'       => $packagingEditPage,
                 ],
                 [
                     'id'        => 'expired',
@@ -142,13 +143,9 @@ add_filter(
                     'entityID'  => 'packageID',
                     'table'     => $packagesTable,
                     'fields'    => "id, title, ref_type, ref_dest, expire_date",
-                    'where'     => 'WHERE expire_date < NOW()',
-                    // 'fields' => [
-                    //     'id',
-                    //     'title',
-                    //     'ref_dest',
-                    // ],
-                    //'where' => 'status = '.$this->config['status_numb']['Expired']
+                    'where'     => 'expire_date < NOW()',
+                    'orderBy'   => 'expire_date DESC',
+                    'url'       => $packagingEditPage,
                 ],
             ]
         ];