Admin assets index model and view creted and added to menu and valid actions.
Added initial database tables for management and settings.
<?php
/**
- * Plugin Name: Gaslight Media Members Database Asset Management Add-On Plugin
+ * Plugin Name: Gaslight Media Members Database Asset Management
* Plugin URI: http://www.gaslightmedia.com/
* Description: Provides management of various assets (i.e. room assignments).
* Version: 0.0.1
* version from this plugin.
*/
define('GLM_MEMBERS_ASSETS_PLUGIN_VERSION', '0.0.1');
-//define('GLM_MEMBERS_ASSETS_PLUGIN_DB_VERSION', '0.0.1');
+define('GLM_MEMBERS_ASSETS_PLUGIN_DB_VERSION', '0.0.1');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
-define('GLM_MEMBERS_ASSETS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
+define('GLM_MEMBERS_ASSETS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.10.24');
// Check if plugin version is not current in WordPress option and if needed updated it
if (GLM_MEMBERS_ASSETS_PLUGIN_VERSION != get_option('glmMembersAssetsPluginVersion')) {
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Asset Management Dashboard
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2018/03/02 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+// Load Assets data abstract
+// require_once GLM_MEMBERS_ASSETS_PLUGIN_CLASS_PATH.'/data/dataAssets.php';
+
+class GlmMembersAdmin_assets_index // extends GlmDataAssetsIndex
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /**
+ * Constructor
+ *
+ * This contructor performs the work for this model. This model returns
+ * an array containing the following.
+ *
+ * 'status'
+ *
+ * True if successfull and false if there was a fatal failure.
+ *
+ * 'view'
+ *
+ * A suggested view name that the contoller should use instead of the
+ * default view for this model or false to indicate that the default view
+ * should be used.
+ *
+ * 'data'
+ *
+ * Data that the model is returning for use in merging with the view to
+ * produce output.
+ *
+ * @wpdb object WordPress database object
+ *
+ * @return array Array containing status, suggested view, and any data
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ /*
+ * Run constructor for the Assets data class
+ */
+ // parent::__construct(false, false, true);
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+ $view = 'index';
+
+
+ // Compile template data
+ $templateData = array(
+ );
+
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/assets/'.$view.'.html',
+ 'data' => $templateData
+ );
+
+ }
+
+}
\ No newline at end of file
*
*/
+add_submenu_page(
+ 'glm-members-admin-menu-members',
+ 'Asset Management',
+ 'Asset Mgt',
+ 'glm_members_members',
+ 'glm-members-admin-menu-assets-index',
+ function() {$this->controller('assets', 'index');}
+ );
+
--- /dev/null
+-- Gaslight Media Assets Database
+-- File Created: 03/02/2018 14:40:00
+-- Database Version: 0.0.19
+-- Database Creation Script
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+--
+/*
+ * General Database Organization
+ * -----------------------------
+ *
+ */
+
+-- Management Options
+-- General configurationm parameters for the Asset Management application
+-- Only one entry in this table!
+CREATE TABLE {prefix}management (
+ id INT NOT NULL AUTO_INCREMENT,
+ canonical_asset_page TINYTEXT NULL, -- Canonical page slug for assets
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Terms used in site modifiable on Management page in admin - Only 1 entry in this table
+-- Terms in this table should be all self-explanatory
+CREATE TABLE {prefix}settings_terms (
+ id INT NOT NULL AUTO_INCREMENT,
+ assets_term_assets_name TINYTEXT NULL, -- Term "Asset Management"
+ assets_term_asset TINYTEXT NULL,
+ assets_term_asset_cap TINYTEXT NULL,
+ assets_term_asset_plur TINYTEXT NULL,
+ assets_term_asset_plur_cap TINYTEXT NULL,
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Insert into management table
+INSERT INTO {prefix}management
+ (
+ canonical_asset_page
+ )
+ VALUES
+ (
+ 'assets' -- assets_canonical_assets_page
+ );
+
+----
+
+-- Insert into settings_terms table
+INSERT INTO {prefix}settings_terms
+ (
+ assets_term_assets_name,
+ assets_term_asset,
+ assets_term_asset_cap,
+ assets_term_asset_plur,
+ assets_term_asset_plur_cap
+ )
+ VALUES
+ (
+ 'Asset Management', -- assets_term_assets_name
+ 'asset', -- assets_term_asset
+ 'Asset', -- assets_term_asset_cap
+ 'assets', -- assets_term_asset_plur
+ 'Assets' -- assets_term_asset_plur_cap
+ );
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members Asset Management DB Versions
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMemberEventAssetsDatabase
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release dbVersions.php $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+$glmMembersAssetsDbVersions = array(
+ '0.0.1' => array('version' => '0.0.1', 'tables' => 2, 'date' => '03/2/2018')
+);
+
+
$glmMembersAssetsAddOnValidActions = array(
'adminActions' => array(
+ 'assets' => array(
+ 'index' => GLM_MEMBERS_ASSETS_PLUGIN_SLUG
+ )
),
'frontActions' => array(
)
--- /dev/null
+<h1 class="glm-admin-table-header">Asset Management Dashboard</h1>
+
+<div>
+ <h3>Pending Actions</h3>
+</div>
+
+<div>
+ <h3>Assets List</h3>
+</div>
+
+
+<div>
+ <h3>Assets Calendar</h3>
+</div>
+