Added test 'active' table, replaced some common strings with variables, removed baseU...
authorLaury GvR <laury@gaslightmedia.com>
Thu, 20 Sep 2018 16:59:56 +0000 (12:59 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 20 Sep 2018 16:59:56 +0000 (12:59 -0400)
setup/adminHooks.php

index 58f5fa9..b790dd1 100644 (file)
@@ -49,6 +49,7 @@ add_filter(
     function ( $member = null ) {
         $packagingIndexPage = GLM_MEMBERS_PACKAGING_PLUGIN_ADMIN_URL . '?page=glm-members-admin-menu-packaging-index&glm_action=index';
         $packagesTable = GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX . "packages";
+        $packagingEditPage = GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE.'member&glm_action=packaging&option=edit';
         $content = [
             'title' => 'Packaging',
             'buttons' => [
@@ -89,26 +90,39 @@ add_filter(
             'textSearch' => [
                 'order'     => 2,
                 'component' => 'textSearch',
+                'entityID'  => 'packageID',
                 'table'     => $packagesTable,
                 'fields'    => "id, title, image, ref_dest",
-                'baseUrl'   => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE.'member&glm_action=packaging',
-                'resultUrl' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE.'member&glm_action=packaging&option=edit',
-                'entityID'  => 'packageID'
+                'resultUrl' => $packagingEditPage,
+            ],
+            'active' => [
+                'title' => "Active Packages",
+                'slug' => "active-packages",
+                'order' => 3,
+                'component' => 'list',
+                'entityID'  => 'packageID',
+                'table' => $packagesTable,
+                'fields' => "id, title, ref_dest",
+                'where' => 'status='.$this->config['status_numb']['Active'] . '',
+                'resultUrl' => $packagingEditPage,
             ],
             'pending' => [
                 'title' => "Pending Packages",
                 'slug' => "pending-packages",
                 'order' => 3,
                 'component' => 'list',
+                'entityID'  => 'packageID',
                 'table' => $packagesTable,
                 'fields' => "id, title, ref_dest",
-                'where' => 'status = '.$this->config['status_numb']['Pending'],
+                'where' => 'status='.$this->config['status_numb']['Pending'] . '',
+                'resultUrl' => $packagingEditPage,
             ],
             'expired' => [
                 'title' => "Expired Packages",
                 'slug' => "expired-packages",
                 'order' => 4,
                 'component' => 'list',
+                'entityID'  => 'packageID',
                 'table' => $packagesTable,
                 'fields' => "id, title, ref_dest",
                 // 'fields' => [