From d3ba55f5ebc2bc8cfddeded855573bd1c91f0af7 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 24 Oct 2017 11:01:33 -0400 Subject: [PATCH] Added first_datetime and last_datetime to reg_event record for quick reference. Added date_created to reg_request. Dropped event_datetime and mf_data from reg_request_event, reg_request_class and reg_request_date. Dropped mf_data from reg_request_registrant. Updated database version to 0.0.16 Deleted dataAddedInfoData.php, dataAddedInfoFields.php, dataMfData.php, dataMfTempFile.php, dataMagicform.php Updated cart widget other cart select dialog to show both created and updated date/time. --- classes/data/dataAddedInfoData.php | 161 ----------- classes/data/dataAddedInfoFields.php | 158 ----------- classes/data/dataMagicform.php | 262 ------------------ classes/data/dataMfData.php | 237 ---------------- classes/data/dataMfTempFile.php | 117 -------- classes/data/dataRegEvent.php | 32 +++ classes/data/dataRegRequest.php | 9 + index.php | 2 +- models/front/registrations/list.php | 5 +- ...0.0.15.sql => create_database_V0.0.16.sql} | 18 +- setup/databaseScripts/dbVersions.php | 3 +- ..._V0.0.15.sql => drop_database_V0.0.16.sql} | 0 .../update_database_V0.0.14.sql | 2 +- .../update_database_V0.0.15.sql | 2 +- .../update_database_V0.0.16.sql | 49 ++++ views/front/registrations/cart.html | 57 ++-- views/front/registrations/cartLinkWidget.html | 11 +- 17 files changed, 148 insertions(+), 977 deletions(-) delete mode 100644 classes/data/dataAddedInfoData.php delete mode 100644 classes/data/dataAddedInfoFields.php delete mode 100644 classes/data/dataMagicform.php delete mode 100644 classes/data/dataMfData.php delete mode 100644 classes/data/dataMfTempFile.php rename setup/databaseScripts/{create_database_V0.0.15.sql => create_database_V0.0.16.sql} (97%) rename setup/databaseScripts/{drop_database_V0.0.15.sql => drop_database_V0.0.16.sql} (100%) create mode 100644 setup/databaseScripts/update_database_V0.0.16.sql diff --git a/classes/data/dataAddedInfoData.php b/classes/data/dataAddedInfoData.php deleted file mode 100644 index 862abff..0000000 --- a/classes/data/dataAddedInfoData.php +++ /dev/null @@ -1,161 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoData.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ - */ - -/** - * GlmDataRegistrationsAddedInfoData class - * - * PHP version 5 - * - * @category Data - * @package GLM Member DB - * @author Chuck Scott - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoData.php,v 1.0 2011/01/25 19:31:47 cscott - * Exp $ - */ -class GlmDataRegistrationsAddedInfoData 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_REGISTRATIONS_PLUGIN_DB_PREFIX . 'added_info_data'; - - /* - * Table Data Fields - */ - - $this->fields = array ( - - // ID - 'id' => array ( - 'field' => 'id', - 'type' => 'integer', - 'view_only' => true, - 'use' => 'a' - ), - - // Pointer to added_info_field Table - 'added_info_field' => array ( - 'field' => 'added_info_field', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . 'added_info_field', - 'p_field' => 'id', - 'p_static' => true, - 'required' => true, - 'use' => 'lgneud' - ), - - // Ref Type - 'ref_type' => array ( - 'field' => 'ref_type', - 'type' => 'list', - 'list' => $this->config['data_ref_type'], - 'required' => true, - 'use' => 'a' - ), - - // Pointer to specific entry of the correct type (user submitted data record) - 'ref_dest' => array ( - 'field' => 'ref_dest', - 'type' => 'int', - 'required' => true, - 'use' => 'a' - ), - - // Text value of field - 'field_value' => array ( - 'field' => 'field_value', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ) - - ); - - } - -} - -?> \ No newline at end of file diff --git a/classes/data/dataAddedInfoFields.php b/classes/data/dataAddedInfoFields.php deleted file mode 100644 index 39e2b63..0000000 --- a/classes/data/dataAddedInfoFields.php +++ /dev/null @@ -1,158 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ - */ - -/** - * GlmDataRegistrationsAddedInfoFields class - * - * PHP version 5 - * - * @category Data - * @package GLM Member DB - * @author Chuck Scott - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott - * Exp $ - */ -class GlmDataRegistrationsAddedInfoFields 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_REGISTRATIONS_PLUGIN_DB_PREFIX . 'added_info_fields'; - - /* - * Table Data Fields - */ - - $this->fields = array ( - - // ID - 'id' => array ( - 'field' => 'id', - 'type' => 'integer', - 'view_only' => true, - 'use' => 'a' - ), - - // Ref Type - 'ref_type' => array ( - 'field' => 'ref_type', - 'type' => 'list', - 'list' => $this->config['data_ref_type'], - 'required' => true, - 'use' => 'a' - ), - - // Pointer to specific entryt of the correct type (user submitted data record) - 'ref_dest' => array ( - 'field' => 'ref_dest', - 'type' => 'int', - 'required' => true, - 'use' => 'a' - ), - - // Name of field / prompt - 'name' => array ( - 'field' => 'name', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Field description / explantion - 'description' => array ( - 'field' => 'description', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ) - - ); - - } - -} - -?> \ No newline at end of file diff --git a/classes/data/dataMagicform.php b/classes/data/dataMagicform.php deleted file mode 100644 index 330f800..0000000 --- a/classes/data/dataMagicform.php +++ /dev/null @@ -1,262 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataMagicForm.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ - */ - -/** - * GlmDataRegistrationsMagicform class - * - * PHP version 5 - * - * @category Data - * @package GLM Member DB - * @author Chuck Scott - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataMagicForm.php,v 1.0 2011/01/25 19:31:47 cscott - * Exp $ - */ -class GlmDataRegistrationsMagicform 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_REGISTRATIONS_PLUGIN_DB_PREFIX . 'magicform'; - - /* - * Table Data Fields - */ - - $this->fields = array ( - - // ID - 'id' => array ( - 'field' => 'id', - 'type' => 'integer', - 'view_only' => true, - 'use' => 'a' - ), - - // Form ID - 'form_id' => array ( - 'field' => 'form_id', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Custom ID - 'custom_id' => array ( - 'field' => 'custom_id', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Form Title - 'title' => array ( - 'field' => 'title', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Form Title - 'type' => array ( - 'field' => 'type', - 'type' => 'integer', - 'required' => true, - 'use' => 'a' - ), - - // Form Description - 'descr' => array ( - 'field' => 'descr', - 'type' => 'text', - 'required' => false, - 'use' => 'a' - ), - - // Active - 'active' => array ( - 'field' => 'active', - 'type' => 'checkbox', - 'use' => 'a', - 'default' => '0' - ), - - // Required - 'required' => array ( - 'field' => 'required', - 'type' => 'checkox', - 'use' => 'a', - 'default' => '0' - ), - - // Data 1 - 'data1' => array ( - 'field' => 'data1', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Sort - 'sort' => array ( - 'field' => 'sort', - 'type' => 'integer', - 'required' => true, - 'use' => 'a' - ), - - // Expanded - 'expanded' => array ( - 'field' => 'expanded', - 'type' => 'checkbox', - 'use' => 'a', - 'default' => '0' - ), - - // Style - 'style' => array ( - 'field' => 'style', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // File - 'file' => array ( - 'field' => 'file', - 'type' => 'text', - 'required' => '', - 'use' => 'a' - ), - - // Columns - 'cols' => array ( - 'field' => 'cols', - 'type' => 'integer', - 'required' => true, - 'use' => 'a' - ), - - // Rows - 'rows' => array ( - 'field' => 'rows', - 'type' => 'integer', - 'required' => true, - 'use' => 'a' - ), - - // Size - 'size' => array ( - 'field' => 'size', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Format - 'format' => array ( - 'field' => 'format', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Default Value - 'default_val' => array ( - 'field' => 'default_val', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - - ); - - } - -} - -?> \ No newline at end of file diff --git a/classes/data/dataMfData.php b/classes/data/dataMfData.php deleted file mode 100644 index e9cf2d4..0000000 --- a/classes/data/dataMfData.php +++ /dev/null @@ -1,237 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataMfData.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ - */ - -/** - * GlmDataRegistrationsMfData class - * - * PHP version 5 - * - * @category Data - * @package GLM Member DB - * @author Chuck Scott - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataMfData.php,v 1.0 2011/01/25 19:31:47 cscott - * Exp $ - */ -class GlmDataRegistrationsMfData 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_REGISTRATIONS_PLUGIN_DB_PREFIX . 'mf_data'; - - /* - * Table Data Fields - */ - - $this->fields = array ( - - - 'id' => array ( - 'field' => 'id', - 'type' => 'integer', - 'view_only' => true, - 'use' => 'a' - ), - - // FIID - 'fiid' => array ( - 'field' => 'fiid', - 'type' => 'integer', - 'required' => true, - 'use' => 'a' - ), - - // Form ID - 'form_id' => array ( - 'field' => 'form_id', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Field ID - 'field_id' => array ( - 'field' => 'field_id', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Level - 'level' => array ( - 'field' => 'level', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Form Title - 'title' => array ( - 'field' => 'title', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Form Type - 'type' => array ( - 'field' => 'type', - 'type' => 'integer', - 'required' => true, - 'use' => 'a' - ), - - // Text Type - 'txt_type' => array ( - 'field' => 'txt_type', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Value - 'value' => array ( - 'field' => 'value', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Number Value - 'numb_value' => array ( - 'field' => 'numb_value', - 'type' => 'float', - 'required' => true, - 'use' => 'a' - ), - - // Text Value - 'txt_value' => array ( - 'field' => 'txt_value', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - // Option Number - 'opt_num' => array ( - 'field' => 'opt_num', - 'type' => 'integer', - 'required' => true, - 'use' => 'a' - ), - - // Valid - 'valid' => array ( - 'field' => 'valid', - 'type' => 'checkbox', - 'use' => 'a', - 'default' => 0 - ), - - // Required - 'required' => array ( - 'field' => 'required', - 'type' => 'checkbox', - 'use' => 'a', - 'default' => 0 - ), - - // Failure - 'failure' => array ( - 'field' => 'failure', - 'type' => 'text', - 'required' => true, - 'use' => 'a' - ), - - ); - - } - -} - -?> \ No newline at end of file diff --git a/classes/data/dataMfTempFile.php b/classes/data/dataMfTempFile.php deleted file mode 100644 index 266e12f..0000000 --- a/classes/data/dataMfTempFile.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataMfTempFile.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ - */ - -/** - * GlmDataRegistrationsMfTempFile class - * - * PHP version 5 - * - * @category Data - * @package GLM Member DB - * @author Chuck Scott - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataMfTempFile.php,v 1.0 2011/01/25 19:31:47 cscott - * Exp $ - */ -class GlmDataRegistrationsMfTempFile 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_REGISTRATIONS_PLUGIN_DB_PREFIX . 'mf_temp_file'; - - /* - * Table Data Fields - */ - - $this->fields = array ( - - ); - - } - -} - -?> \ No newline at end of file diff --git a/classes/data/dataRegEvent.php b/classes/data/dataRegEvent.php index 4c5d754..cbe5183 100644 --- a/classes/data/dataRegEvent.php +++ b/classes/data/dataRegEvent.php @@ -281,6 +281,20 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'use' => 'a' ), + // First event instance start date/time - Updated when displaying reg event dashboard + 'first_datetime' => array ( + 'field' => 'first_datetime', + 'type' => 'datetime', + 'use' => 'lged' + ), + + // Last event instance start date/time - Updated when displaying reg event dashboard + 'last_datetime' => array ( + 'field' => 'last_datetime', + 'type' => 'datetime', + 'use' => 'lged' + ), + // Name of a downloadable file 'reg_file' => array ( 'field' => 'reg_file', @@ -564,6 +578,24 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract $this->regEventData['firstTime'] = $regEventFirstTime; $this->regEventData['lastTime'] = $regEventLastTime; + // Check if we need to update first and/or last event times in database - if so, do that + if ($this->regEventData['first_datetime']['timestamp'] != $regEventFirstTime['start_time']['timestamp'] || + $this->regEventData['last_datetime']['timestamp'] != $regEventLastTime['start_time']['timestamp'] + ) { + $this->wpdb->update( + GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX.'reg_event', + array( + 'first_datetime' => date('Y-m-d H:is', $regEventFirstTime['start_time']['timestamp']), + 'last_datetime' => date('Y-m-d H:is', $regEventLastTime['start_time']['timestamp']), + ), + array( 'id' => $this->regEventData['id'] ), + array( + '%s', + '%s' + ) + ); + } + // Add Recurrence summary to event data $this->regEventData['recurrenceSummary'] = $recurrenceSummary; diff --git a/classes/data/dataRegRequest.php b/classes/data/dataRegRequest.php index 8194654..5f8ef3b 100644 --- a/classes/data/dataRegRequest.php +++ b/classes/data/dataRegRequest.php @@ -343,6 +343,13 @@ class GlmDataRegistrationsRegRequest extends GlmDataAbstract 'use' => 'a' ), + // Date/Time request was first created + 'date_created' => array ( + 'field' => 'date_created', + 'type' => 'datetime', + 'use' => 'lged' + ), + // Date/Time last updated 'last_update' => array ( 'field' => 'last_update', @@ -414,6 +421,7 @@ class GlmDataRegistrationsRegRequest extends GlmDataAbstract 'account_fname' => $savedFields['account_fname'], 'account_lname' => $savedFields['account_lname'], 'status' => $savedFields['status'], + 'date_created' => $savedFields['date_created'], 'last_update' => $savedFields['last_update'] ); @@ -448,6 +456,7 @@ class GlmDataRegistrationsRegRequest extends GlmDataAbstract 'account_fname' => $savedFields['account_fname'], 'account_lname' => $savedFields['account_lname'], 'status' => $savedFields['status'], + 'date_created' => $savedFields['date_created'], 'last_update' => $savedFields['last_update'] ); diff --git a/index.php b/index.php index cafe600..47ca90c 100644 --- a/index.php +++ b/index.php @@ -44,7 +44,7 @@ if (!defined('ABSPATH')) { * version from this plugin. */ define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '0.0.1'); -define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.15'); +define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.16'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.10.10'); diff --git a/models/front/registrations/list.php b/models/front/registrations/list.php index 93614f2..55adf32 100644 --- a/models/front/registrations/list.php +++ b/models/front/registrations/list.php @@ -96,7 +96,10 @@ default: - // Get a current list of reg events + // Build Where clause to select only active future reg events + $where .= "T.active AND T.last_datetime > now()"; + + // Get a current list of reg events $listResult = $this->getSimpleRegEventsList($where.$alphaWhere, 'event_name', true, 'id', $start, $limit, true); //echo '
$listResult: ' . print_r( $listResult, true ) . '
'; diff --git a/setup/databaseScripts/create_database_V0.0.15.sql b/setup/databaseScripts/create_database_V0.0.16.sql similarity index 97% rename from setup/databaseScripts/create_database_V0.0.15.sql rename to setup/databaseScripts/create_database_V0.0.16.sql index 5ba3b76..3ca1fcd 100644 --- a/setup/databaseScripts/create_database_V0.0.15.sql +++ b/setup/databaseScripts/create_database_V0.0.16.sql @@ -1,6 +1,6 @@ -- Gaslight Media Registration Database -- File Created: 01/18/2017 14:40:00 --- Database Version: 0.0.3 +-- Database Version: 0.0.16 -- Database Creation Script -- -- To permit each query below to be executed separately, @@ -219,6 +219,8 @@ CREATE TABLE {prefix}reg_event ( restricted_payment_methods SMALLINT NULL, -- Bitmap of restricted (admin use only) payment methods for this event - see payment_method descr TEXT NULL, -- Registrations specific description field for this event terms TEXT NULL, -- Terms and Conditions for registration + first_datetime DATETIME NULL, -- Start of first listed date/time for this event + last_datetime DATETIME NULL, -- Start of last listed date/time for this event reg_file TINYTEXT NULL, -- Name of a downloadable file reg_file_title TINYTEXT NULL, -- Title for downloadable file form_revision SMALLINT NULL, -- Current MagicForm form revision @@ -238,8 +240,8 @@ CREATE TABLE {prefix}reg_time ( id INT NOT NULL AUTO_INCREMENT, reg_event INT NULL, -- Pointer to reg_event table event_time INT NULL, -- ID of events times table entry in Events add-on - If false (0), then this is a pseudo entry to use for all registrations (non-date/time specific) - start_datetime DATETIME NULL, -- Date and time when event instance starts - Informational - Actual events data is definitive - end_datetime DATETIME NULL, -- Date and time when event instance ends - Informational + start_datetime DATETIME NULL, -- Date and time when event instance starts + end_datetime DATETIME NULL, -- Date and time when event instance ends all_day BOOLEAN NULL, -- All Day flag - Informational attendees BOOLEAN NULL, -- Flag if tracking attendees or if only one per registration submission (registers account submitting) - get from reg_event attendee_max MEDIUMINT NULL, -- Attendee count limit - 0 = unlimited - get from reg_event record @@ -270,7 +272,7 @@ CREATE TABLE {prefix}reg_time_pending ( id INT NOT NULL AUTO_INCREMENT, reg_event INT NULL, -- Pointer to reg_event table reg_time INT NULL, -- ID of time record -++ registrant INT NULL, -- ID of reg_request_registrant record -- + registrant INT NULL, -- ID of reg_request_registrant record -- expire_time DATETIME NULL, -- Time at which this hold expires PRIMARY KEY (id), INDEX (reg_event), @@ -419,6 +421,7 @@ CREATE TABLE {prefix}reg_request ( mf_data TEXT NULL, -- Any MagicForm data associated with registrant notes TEXT NULL, -- System operator's notes for this registration request user_trace_info TINYTEXT NULL, -- IP Address of user computer and timestamp + date_created DATETIME NULL, -- Date request was first created last_update DATETIME NULL, -- Last update date/time - Used for timing out pending carts and attendee counts PRIMARY KEY (id), INDEX (account), @@ -434,8 +437,6 @@ CREATE TABLE {prefix}reg_request_event ( reg_request INT NULL, -- Pointer to reg_request table reg_event INT NULL, -- Pointer to reg_event event_name TINYTEXT NULL, -- Name of Event so it will always be in the cart data --- event_datetime DATETIME NULL, -- Date and time of event time selected so it will always be in the cart --- mf_data TEXT NULL, -- Any MagicForm data associated with requested event notes TEXT NULL, -- System operator's notes for this registration request PRIMARY KEY (id), INDEX (reg_request), @@ -450,12 +451,10 @@ CREATE TABLE {prefix}reg_request_event ( CREATE TABLE {prefix}reg_request_class ( id INT NOT NULL AUTO_INCREMENT, reg_event INT NULL, -- Pointer to reg_event entry --- event_datetime DATETIME NULL, -- Date and time of event time selected so it will always be in the cart reg_request INT NULL, -- Pointer to the registration request record reg_request_event INT NULL, -- Pointer to reg_request_event table entry class INT NULL, -- Pointer to event reg_class table - False (0) if registration class no longer exits class_name TINYTEXT NULL, -- Name of event class at the time selected --- mf_data TEXT NULL, -- Any MagicForm data associated with registrant notes TEXT NULL, -- System operator's notes for this registration request PRIMARY KEY (id), INDEX (reg_event), @@ -470,7 +469,6 @@ CREATE TABLE {prefix}reg_request_class ( CREATE TABLE {prefix}reg_request_rate ( id INT NOT NULL AUTO_INCREMENT, reg_event INT NULL, -- Pointer to reg_event entry --- event_datetime DATETIME NULL, -- Date and time of event time selected so it will always be in the cart reg_request INT NULL, -- Pointer to the registration request record reg_request_event INT NULL, -- Pointer to reg_request_event table entry reg_request_class INT NULL, -- Pointer to reg_request_class table entry @@ -479,7 +477,6 @@ CREATE TABLE {prefix}reg_request_rate ( base_rate FLOAT, -- Base rate at time of registration per_registrant FLOAT, -- Per Registrant Rate at time of registration registrant_credits TINYINT NULL, -- Number of registrants included in base rate at time of registration --- mf_data TEXT NULL, -- Any MagicForm data associated with registrant notes TEXT NULL, -- System operator's notes for this registration request PRIMARY KEY (id), INDEX (reg_event), @@ -503,7 +500,6 @@ CREATE TABLE {prefix}reg_request_registrant ( reg_request_rate INT NULL, -- Pointer to reg_request_rate table entry fname TINYTEXT NULL, -- First name of registrant at the time of selection lname TINYTEXT NULL, -- Last name of registrant at the time of selection --- mf_data TEXT NULL, -- Any MagicForm data associated with registrant notes TEXT NULL, -- System operator's notes for this registration request PRIMARY KEY (id), INDEX (account), diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 7e8a609..1c44fac 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -28,7 +28,8 @@ $glmMembersRegistrationsDbVersions = array( '0.0.12' => array('version' => '0.0.12', 'tables' => 20, 'date' => '09/11/2017'), '0.0.13' => array('version' => '0.0.13', 'tables' => 20, 'date' => '10/03/2017'), '0.0.14' => array('version' => '0.0.14', 'tables' => 20, 'date' => '10/13/2017'), - '0.0.15' => array('version' => '0.0.15', 'tables' => 15, 'date' => '10/18/2017') + '0.0.15' => array('version' => '0.0.15', 'tables' => 15, 'date' => '10/18/2017'), + '0.0.16' => array('version' => '0.0.16', 'tables' => 15, 'date' => '10/24/2017') ); diff --git a/setup/databaseScripts/drop_database_V0.0.15.sql b/setup/databaseScripts/drop_database_V0.0.16.sql similarity index 100% rename from setup/databaseScripts/drop_database_V0.0.15.sql rename to setup/databaseScripts/drop_database_V0.0.16.sql diff --git a/setup/databaseScripts/update_database_V0.0.14.sql b/setup/databaseScripts/update_database_V0.0.14.sql index 870cd23..bc9b51a 100644 --- a/setup/databaseScripts/update_database_V0.0.14.sql +++ b/setup/databaseScripts/update_database_V0.0.14.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database - Registratiuons Add-On -- File Created: 10/03/17 11:00:00 --- Database Version: 0.0.13 +-- Database Version: 0.0.14 -- Database Update From Previous Version Script -- -- To permit each query below to be executed separately, diff --git a/setup/databaseScripts/update_database_V0.0.15.sql b/setup/databaseScripts/update_database_V0.0.15.sql index 31c0d33..155cfca 100644 --- a/setup/databaseScripts/update_database_V0.0.15.sql +++ b/setup/databaseScripts/update_database_V0.0.15.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database - Registratiuons Add-On -- File Created: 10/03/17 11:00:00 --- Database Version: 0.0.13 +-- Database Version: 0.0.15 -- Database Update From Previous Version Script -- -- To permit each query below to be executed separately, diff --git a/setup/databaseScripts/update_database_V0.0.16.sql b/setup/databaseScripts/update_database_V0.0.16.sql new file mode 100644 index 0000000..9e4b355 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.16.sql @@ -0,0 +1,49 @@ +-- Gaslight Media Members Database - Registratiuons Add-On +-- File Created: 10/03/17 11:00:00 +-- Database Version: 0.0.16 +-- Database Update From Previous Version Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + +ALTER TABLE {prefix}reg_request ADD COLUMN date_created DATETIME; + +---- + +ALTER TABLE {prefix}reg_event ADD COLUMN first_datetime DATETIME; + +---- + +ALTER TABLE {prefix}reg_event ADD COLUMN last_datetime DATETIME; + +---- + +ALTER TABLE {prefix}reg_time_pending ADD COLUMN registrant INT; + +---- + +ALTER TABLE {prefix}reg_request_event DROP COLUMN event_datetime; + +---- + +ALTER TABLE {prefix}reg_request_event DROP COLUMN mf_data; + +---- + +ALTER TABLE {prefix}reg_request_class DROP COLUMN event_datetime; + +---- + +ALTER TABLE {prefix}reg_request_class DROP COLUMN mf_data; + +---- + +ALTER TABLE {prefix}reg_request_rate DROP COLUMN event_datetime; + +---- + +ALTER TABLE {prefix}reg_request_rate DROP COLUMN mf_data; + +---- + +ALTER TABLE {prefix}reg_request_registrant DROP COLUMN mf_data; diff --git a/views/front/registrations/cart.html b/views/front/registrations/cart.html index 99d3cc3..1401848 100644 --- a/views/front/registrations/cart.html +++ b/views/front/registrations/cart.html @@ -25,8 +25,8 @@ Registering Registrant Date/Time - Discount - Rate + Discount + Rate @@ -37,7 +37,7 @@ {foreach $cart.events as $event} - Event: {$event.event_name} + Event: {$event.event_name} {foreach $event.classes as $class} @@ -53,7 +53,7 @@ {foreach $rate.registrants as $registrant} - + {$registrant.fname} {$registrant.lname} {$registrant.event_time} @@ -71,27 +71,42 @@ {/if} - {/foreach} - {/foreach} - {/foreach} - {/foreach} - + {/foreach} {* registrants *} + {/foreach} {* rates *} + {/foreach} {* classes *} + +   - Total registrants: {$cart.totalRegistrants} - - {if $cart.totalDiscounts > 0} - ${$cart.totalDiscounts|number_format:2} - {else} -   - {/if} + Event registrants: {$event.eventRegistrants} + {if $event.eventDiscounts > 0} + + {$event.eventDiscounts|number_format:2} - ${$cart.totalCharges|number_format:2} - - + {else} +   + {/if} + {$event.eventCharges|number_format:2} + + + + {/foreach} {* events *} + + +   + Total registrants: {$cart.totalRegistrants} + + {if $cart.totalDiscounts > 0} + ${$cart.totalDiscounts|number_format:2} + {else} +   + {/if} + + ${$cart.totalCharges|number_format:2} + {else} - Your cart is empty. Please click "Register for Another Event" button above. + Your cart is empty. Please click "Register for Another Event" button above. + {/if} - diff --git a/views/front/registrations/cartLinkWidget.html b/views/front/registrations/cartLinkWidget.html index f5d3a8b..e029df6 100644 --- a/views/front/registrations/cartLinkWidget.html +++ b/views/front/registrations/cartLinkWidget.html @@ -28,18 +28,18 @@ -
+
-

Your other pending registration requests

- + {foreach $regRequests as $rr} - + + {/foreach} @@ -53,7 +53,8 @@ $("#glm-cart-select-dialog").dialog({ autoOpen: true, resizable: false, - modal: true + modal: true, + width: 400 }); }); -- 2.17.1
IDDate request was created
IDDate createdDate last updated
{$rr.id}{$rr.last_update.datetime}{$rr.date_created.datetime}{$rr.last_update.datetime}