From: Chuck Scott Date: Tue, 6 Mar 2018 22:09:42 +0000 (-0500) Subject: Started building admin assets dashboard X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=0d66c67682a0d46bcf4a975dd92d08a1db41d8bd;p=WP-Plugins%2Fglm-member-db-assets.git Started building admin assets dashboard Fixed issues with dataFacilities.php data class Updated index.php to have assets management and terms added to config --- diff --git a/classes/data/dataFacilities.php b/classes/data/dataFacilities.php index d24433f..982d307 100644 --- a/classes/data/dataFacilities.php +++ b/classes/data/dataFacilities.php @@ -1,7 +1,7 @@ table = GLM_MEMBERS_ASSETS_PLUGIN_DB_PREFIX . 'asset_type'; + $this->table = GLM_MEMBERS_ASSETS_PLUGIN_DB_PREFIX . 'facility'; /* * Table Data Fields diff --git a/index.php b/index.php index 9a4b661..3354b2e 100644 --- a/index.php +++ b/index.php @@ -143,10 +143,11 @@ if (is_file(GLM_MEMBERS_ASSETS_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) { } // Load Add-On Management Settings data -/* None - Need to figure out a smooth way to do this. $glmMembersAssetsManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_ASSETS_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); unset($glmMembersAssetsManagementSettings['id']); -*/ +$glmMembersAssetsManagementTerms = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_ASSETS_PLUGIN_DB_PREFIX."settings_terms WHERE id = 1", ARRAY_A ); +unset($glmMembersAssetsManagementTerms['id']); + function glmMembersAssetsRegisterAddOn($addOns) { @@ -158,6 +159,8 @@ function glmMembersAssetsRegisterAddOn($addOns) { 'slug' => GLM_MEMBERS_ASSETS_PLUGIN_SLUG, 'actions' => $GLOBALS['glmMembersAssetsAddOnValidActions'], 'config' => array( + 'settings' => $GLOBALS['glmMembersAssetsManagementSettings'], + 'terms' => $GLOBALS['glmMembersAssetsManagementTerms'] ), 'shortcodes' => $GLOBALS['glmMembersAssetsShortcodes'], 'shortcodesDescription' => $GLOBALS['glmMembersAssetsShortcodesDescription'] diff --git a/models/admin/assets/index.php b/models/admin/assets/index.php index 43b6677..6e7c53f 100644 --- a/models/admin/assets/index.php +++ b/models/admin/assets/index.php @@ -14,9 +14,9 @@ */ // Load Assets data abstract -// require_once GLM_MEMBERS_ASSETS_PLUGIN_CLASS_PATH.'/data/dataAssets.php'; +require_once GLM_MEMBERS_ASSETS_PLUGIN_CLASS_PATH.'/data/dataFacilities.php'; -class GlmMembersAdmin_assets_index // extends GlmDataAssetsIndex +class GlmMembersAdmin_assets_index extends GlmDataAssetsFacilities { /** @@ -71,17 +71,25 @@ class GlmMembersAdmin_assets_index // extends GlmDataAssetsIndex /* * Run constructor for the Assets data class */ - // parent::__construct(false, false, true); + parent::__construct(false, false, true); } public function modelAction($actionData = false) { $view = 'index'; + $haveFacilities = false; + // Get all facility data with assets items and any future assignments of those assets items + $facilities = $this->getList(); + + if (is_array($facilities) && count(facilities) > 0) { + $haveFacilities = true; + } // Compile template data $templateData = array( + 'haveFacilities' => $haveFacilities ); // Return status, any suggested view, and any data to controller diff --git a/views/admin/assets/index.html b/views/admin/assets/index.html index ae11402..9652e34 100644 --- a/views/admin/assets/index.html +++ b/views/admin/assets/index.html @@ -1,15 +1,307 @@ -

Asset Management Dashboard

+
-
-

Pending Actions

-
-
-

Assets List

-
+ + + +

{$terms.assets_term_assets_name} Dashboard

+
+ + +
+
+ + Add a Facility + + +{if $haveFacilities} + +
+ + {foreach $facilities as $facility} +
(Facility Name)
-
-

Assets Calendar

+ + +
Asset Type
+
Name
+
Number
+
Quantity
+ + {foreach $facility.assets as $asset} + +
Room
+
Ballroom
+
101
+
1
+ + + +
Start
+
End
+
Account
+
Quantity
+ + {foreach $asset.assignments as $assignment} +
1/1/2018 07:00 AM
+
1/1/2018 05:00 PM
+
Gaslight Media
+
1
+ + + {/foreach} + + {/foreach} + {/foreach} +{else} +
No Facilities Listed
+{/if} + + + + + + + +
+
+ + + + + +{include file='admin/footer.html'}