From: Chuck Scott Date: Mon, 5 Mar 2018 21:25:45 +0000 (-0500) Subject: Added data classes for Asset Types, Facillities, and Terms for asset management. X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=b9b8b367b12bb0ec0497e7e06d4d0a40b19225da;p=WP-Plugins%2Fglm-member-db-assets.git Added data classes for Asset Types, Facillities, and Terms for asset management. --- diff --git a/classes/data/dataAssetType.php b/classes/data/dataAssetType.php new file mode 100644 index 0000000..1d253b3 --- /dev/null +++ b/classes/data/dataAssetType.php @@ -0,0 +1,184 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataSettingsTerms.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + */ + +/** + * GlmDataAssetsAssetTypes class + * + * PHP version 5 + * + * @category Data + * @package GLM Member DB + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataSettingsTerms.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmDataAssetsAssetTypes extends GlmDataAbstract +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + /** + * Data Table Name + * + * @var $table + * @access public + */ + public $table; + /** + * Field definitions + * + * 'type' is type of field as defined by the application + * text Regular text field + * pointer Pointer to an entry in another table + * 'filters' is the filter name for a particular filter ID in PHP filter + * functions + * See PHP filter_id() + * + * 'use' is when to use the field + * l = List + * g = Get + * n = New + * i = Insert + * e = Edit + * u = Update + * d = Delete + * a = All + * + * @var $ini + * @access public + */ + public $fields = false; + + /** + * Constructor + * + * @param object $d database connection + * @param array $config Configuration array + * @param bool $limitedEdit Flag to say indicate limited edit requested + * + * @return void + * @access public + */ + public function __construct($wpdb, $config, $limitedEdit = false) + { + + // If this class is not being extended along with existing $wpdb and $config + if (!$this->wpdb) { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + /* + * Table Name + */ + $this->table = GLM_MEMBERS_ASSETS_PLUGIN_DB_PREFIX . 'asset_type'; + + /* + * Table Data Fields + */ + + $this->fields = array ( + + // ID + 'id' => array ( + 'field' => 'id', + 'type' => 'integer', + 'view_only' => true, + 'use' => 'a' + ), + + // Asset Type Name + 'name' => array ( + 'field' => 'name', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + + // Description + 'descr' => array ( + 'field' => 'descr', + 'type' => 'text', + 'use' => 'a' + ), + + // Use Type + 'use_type' => array ( + 'field' => 'state', + 'type' => 'list', + 'list' => $this->config['use_type'], + 'force_list' => true, + 'use' => 'a' + ), + + // Lead Time + 'lead_time' => array ( + 'field' => 'lead_time', + 'type' => 'integer', + 'use' => 'a' + ), + + // Reuse Time + 'reuse_time' => array ( + 'field' => 'reuse_time', + 'type' => 'integer', + 'use' => 'a' + ), + + // Cost + 'cost' => array ( + 'field' => 'cost', + 'type' => 'money', + 'use' => 'a' + ), + + // Hold Time + 'hold_time' => array ( + 'field' => 'hold_time', + 'type' => 'integer', + 'use' => 'a' + ), + + // Map Item Type + 'map_item_type' => array ( + 'field' => 'map_item_type', + 'type' => 'list', + 'list' => $this->config['map_item_type'], + 'force_list' => true, + 'use' => 'a' + ) + + ); + + } + +} \ No newline at end of file diff --git a/classes/data/dataFacility.php b/classes/data/dataFacility.php new file mode 100644 index 0000000..d24433f --- /dev/null +++ b/classes/data/dataFacility.php @@ -0,0 +1,229 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataSettingsTerms.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + */ + +/** + * GlmDataAssetsAssetTypes class + * + * PHP version 5 + * + * @category Data + * @package GLM Member DB + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataSettingsTerms.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmDataAssetsAssetTypes extends GlmDataAbstract +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + /** + * Data Table Name + * + * @var $table + * @access public + */ + public $table; + /** + * Field definitions + * + * 'type' is type of field as defined by the application + * text Regular text field + * pointer Pointer to an entry in another table + * 'filters' is the filter name for a particular filter ID in PHP filter + * functions + * See PHP filter_id() + * + * 'use' is when to use the field + * l = List + * g = Get + * n = New + * i = Insert + * e = Edit + * u = Update + * d = Delete + * a = All + * + * @var $ini + * @access public + */ + public $fields = false; + + /** + * Constructor + * + * @param object $d database connection + * @param array $config Configuration array + * @param bool $limitedEdit Flag to say indicate limited edit requested + * + * @return void + * @access public + */ + public function __construct($wpdb, $config, $limitedEdit = false) + { + + // If this class is not being extended along with existing $wpdb and $config + if (!$this->wpdb) { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + /* + * Table Name + */ + $this->table = GLM_MEMBERS_ASSETS_PLUGIN_DB_PREFIX . 'asset_type'; + + /* + * Table Data Fields + */ + + $this->fields = array ( + + // ID + 'id' => array ( + 'field' => 'id', + 'type' => 'integer', + 'view_only' => true, + 'use' => 'a' + ), + + // Asset Type Name + 'name' => array ( + 'field' => 'name', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + + // Description + 'descr' => array ( + 'field' => 'descr', + 'type' => 'text', + 'use' => 'a' + ), + + // Address + 'address' => array ( + 'field' => 'address', + 'type' => 'text', + 'use' => 'a' + ), + + // City - References main plugin cities table + 'city' => array ( + 'field' => 'city', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'cities', + 'p_field' => 'name', + 'p_orderby' => 'name', + 'p_blank' => true, + 'force_list' => true, + 'use' => 'a' + ), + + // State + 'state' => array ( + 'field' => 'state', + 'type' => 'list', + 'list' => $this->config['states'], + 'default' => 'MI', + 'force_list' => true, + 'use' => 'a' + ), + + // ZIP / Postal Code + 'zip' => array ( + 'field' => 'zip', + 'type' => 'text', + 'use' => 'a' + ), + + // Country + 'country' => array ( + 'field' => 'country', + 'type' => 'list', + 'list' => $this->config['countries'], + 'default' => 'US', + 'force_list' => true, + 'use' => 'a' + ), + + // Latitude + 'lat' => array( + 'field' => 'lat', + 'type' => 'float', + 'default' => $this->config['settings']['maps_default_lat'], + 'use' => 'a' + ), + + // Longitude + 'lon' => array( + 'field' => 'lon', + 'type' => 'float', + 'default' => $this->config['settings']['maps_default_lon'], + 'use' => 'a' + ), + + // Phone + 'phone' => array ( + 'field' => 'phone', + 'type' => 'text', + 'required' => false, + 'use' => 'a' + ), + + // URl + 'url' => array ( + 'field' => 'url', + 'type' => 'text', + 'use' => 'a' + ), + + // E-Mail + 'email' => array ( + 'field' => 'email', + 'type' => 'text', + 'use' => 'a' + ), + + // Facility Map + 'facility_map' => array( + 'field' => 'facility_map', + 'type' => 'image', + 'use' => 'a' + ) + + ); + + } + +} diff --git a/classes/data/dataSettingsTerms.php b/classes/data/dataSettingsTerms.php new file mode 100644 index 0000000..4a9a465 --- /dev/null +++ b/classes/data/dataSettingsTerms.php @@ -0,0 +1,204 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataSettingsTerms.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + */ + +/** + * GlmDataAssetsTerms class + * + * PHP version 5 + * + * @category Data + * @package GLM Member DB + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataSettingsTerms.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmDataAssetsSettingsTerms extends GlmDataAbstract +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + /** + * Data Table Name + * + * @var $table + * @access public + */ + public $table; + /** + * Field definitions + * + * 'type' is type of field as defined by the application + * text Regular text field + * pointer Pointer to an entry in another table + * 'filters' is the filter name for a particular filter ID in PHP filter + * functions + * See PHP filter_id() + * + * 'use' is when to use the field + * l = List + * g = Get + * n = New + * i = Insert + * e = Edit + * u = Update + * d = Delete + * a = All + * + * @var $ini + * @access public + */ + public $fields = false; + + /** + * Constructor + * + * @param object $d database connection + * @param array $config Configuration array + * @param bool $limitedEdit Flag to say indicate limited edit requested + * + * @return void + * @access public + */ + public function __construct($wpdb, $config, $limitedEdit = false) + { + + // If this class is not being extended along with existing $wpdb and $config + if (!$this->wpdb) { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + /* + * Table Name + */ + $this->table = GLM_MEMBERS_ASSETS_PLUGIN_DB_PREFIX . 'settings_terms'; + + /* + * Table Data Fields + */ + + $this->fields = array ( + + // Term for Asset Management Name + 'assets_term_assets_name' => array ( + 'field' => 'assets_term_assets_name', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + + // Terms for Asset + 'assets_term_asset' => array ( + 'field' => 'assets_term_asset', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_asset_plur' => array ( + 'field' => 'assets_term_asset_plur', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_asset_cap' => array ( + 'field' => 'assets_term_asset_cap', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_asset_plur_cap' => array ( + 'field' => 'assets_term_asset_plur_cap', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + + // Terms for Facility + 'assets_term_facility' => array ( + 'field' => 'assets_term_facility', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_facility_plur' => array ( + 'field' => 'assets_term_facility_plur', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_facility_cap' => array ( + 'field' => 'assets_term_facility_cap', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_facility_plur_cap' => array ( + 'field' => 'assets_term_facility_plur_cap', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + + // Terms for Facility + 'assets_term_item' => array ( + 'field' => 'assets_term_item', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_item_plur' => array ( + 'field' => 'assets_term_item_plur', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_item_cap' => array ( + 'field' => 'assets_term_item_cap', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ), + 'assets_term_item_plur_cap' => array ( + 'field' => 'assets_term_item_plur_cap', + 'type' => 'text', + 'required' => true, + 'use' => 'a' + ) + + ); + + } + + +} + +?> \ No newline at end of file