From 68126b54f187721f2c9b9fe5e71095b96e41c4fd Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 6 Apr 2017 16:23:51 -0400 Subject: [PATCH] More work completed on reading carts. Initial output of registrations list and detail. Added data table for event times that will track summary data for registrations for a particular event time. Added some additional fields to various tables to help track hold status for cart registrations that have now been processed. --- classes/data/dataMagicform.php | 48 ++-- classes/data/dataMfData.php | 40 +-- classes/data/dataMfTempFile.php | 10 +- classes/data/dataPaymentCode.php | 4 +- classes/data/dataRegClass.php | 18 +- classes/data/dataRegEvent.php | 77 +++--- .../{dataRegRates.php => dataRegRate.php} | 52 ++-- classes/data/dataRegRequest.php | 10 +- classes/data/dataRegRequestClass.php | 86 ++++--- classes/data/dataRegRequestEvent.php | 68 +++--- classes/data/dataRegRequestRate.php | 105 ++++---- classes/data/dataRegRequestRegistrant.php | 110 +++++---- classes/registrationsSupport.php | 228 ++++++++++++++---- index.php | 2 +- models/admin/registrations/requests.php | 6 +- ..._V0.0.2.sql => create_database_V0.0.6.sql} | 66 ++++- setup/databaseScripts/dbVersions.php | 6 +- ...se_V0.0.2.sql => drop_database_V0.0.6.sql} | 3 +- .../update_database_V0.0.3.sql | 9 + .../update_database_V0.0.4.sql | 45 ++++ .../update_database_V0.0.5.sql | 33 +++ .../update_database_V0.0.6.sql | 49 ++++ views/admin/registrations/editRequest.html | 123 ++++++++-- views/admin/registrations/requests.html | 8 +- 24 files changed, 838 insertions(+), 368 deletions(-) rename classes/data/{dataRegRates.php => dataRegRate.php} (80%) rename setup/databaseScripts/{create_database_V0.0.2.sql => create_database_V0.0.6.sql} (86%) rename setup/databaseScripts/{drop_database_V0.0.2.sql => drop_database_V0.0.6.sql} (93%) create mode 100644 setup/databaseScripts/update_database_V0.0.3.sql create mode 100644 setup/databaseScripts/update_database_V0.0.4.sql create mode 100644 setup/databaseScripts/update_database_V0.0.5.sql create mode 100644 setup/databaseScripts/update_database_V0.0.6.sql diff --git a/classes/data/dataMagicform.php b/classes/data/dataMagicform.php index b8abf9f..330f800 100644 --- a/classes/data/dataMagicform.php +++ b/classes/data/dataMagicform.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataMagicForm.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsMagicform class * * PHP version 5 * @@ -21,7 +21,7 @@ * @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 + * @release SVN: $Id: dataMagicForm.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ class GlmDataRegistrationsMagicform extends GlmDataAbstract @@ -115,7 +115,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Form ID 'form_id' => array ( 'field' => 'form_id', @@ -123,7 +123,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Custom ID 'custom_id' => array ( 'field' => 'custom_id', @@ -131,7 +131,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Form Title 'title' => array ( 'field' => 'title', @@ -139,7 +139,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Form Title 'type' => array ( 'field' => 'type', @@ -147,7 +147,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Form Description 'descr' => array ( 'field' => 'descr', @@ -155,7 +155,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Active 'active' => array ( 'field' => 'active', @@ -163,7 +163,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'use' => 'a', 'default' => '0' ), - + // Required 'required' => array ( 'field' => 'required', @@ -171,7 +171,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'use' => 'a', 'default' => '0' ), - + // Data 1 'data1' => array ( 'field' => 'data1', @@ -179,7 +179,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Sort 'sort' => array ( 'field' => 'sort', @@ -187,7 +187,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Expanded 'expanded' => array ( 'field' => 'expanded', @@ -195,7 +195,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'use' => 'a', 'default' => '0' ), - + // Style 'style' => array ( 'field' => 'style', @@ -203,7 +203,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // File 'file' => array ( 'field' => 'file', @@ -211,7 +211,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => '', 'use' => 'a' ), - + // Columns 'cols' => array ( 'field' => 'cols', @@ -219,7 +219,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Rows 'rows' => array ( 'field' => 'rows', @@ -227,7 +227,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Size 'size' => array ( 'field' => 'size', @@ -235,7 +235,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Format 'format' => array ( 'field' => 'format', @@ -243,16 +243,16 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Default Value 'default_val' => array ( 'field' => 'default_val', 'type' => 'text', 'required' => true, 'use' => 'a' - ), - - + ), + + ); } diff --git a/classes/data/dataMfData.php b/classes/data/dataMfData.php index d5f8e67..e9cf2d4 100644 --- a/classes/data/dataMfData.php +++ b/classes/data/dataMfData.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataMfData.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsMfData class * * PHP version 5 * @@ -21,7 +21,7 @@ * @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 + * @release SVN: $Id: dataMfData.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ class GlmDataRegistrationsMfData extends GlmDataAbstract @@ -108,14 +108,14 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract $this->fields = array ( - + 'id' => array ( 'field' => 'id', 'type' => 'integer', 'view_only' => true, 'use' => 'a' ), - + // FIID 'fiid' => array ( 'field' => 'fiid', @@ -123,7 +123,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Form ID 'form_id' => array ( 'field' => 'form_id', @@ -131,7 +131,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Field ID 'field_id' => array ( 'field' => 'field_id', @@ -139,7 +139,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Level 'level' => array ( 'field' => 'level', @@ -147,7 +147,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Form Title 'title' => array ( 'field' => 'title', @@ -155,7 +155,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Form Type 'type' => array ( 'field' => 'type', @@ -163,7 +163,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Text Type 'txt_type' => array ( 'field' => 'txt_type', @@ -171,7 +171,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Value 'value' => array ( 'field' => 'value', @@ -179,7 +179,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Number Value 'numb_value' => array ( 'field' => 'numb_value', @@ -187,7 +187,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Text Value 'txt_value' => array ( 'field' => 'txt_value', @@ -195,7 +195,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Option Number 'opt_num' => array ( 'field' => 'opt_num', @@ -203,7 +203,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Valid 'valid' => array ( 'field' => 'valid', @@ -211,7 +211,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'use' => 'a', 'default' => 0 ), - + // Required 'required' => array ( 'field' => 'required', @@ -219,7 +219,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'use' => 'a', 'default' => 0 ), - + // Failure 'failure' => array ( 'field' => 'failure', @@ -227,7 +227,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + ); } diff --git a/classes/data/dataMfTempFile.php b/classes/data/dataMfTempFile.php index bec8eba..266e12f 100644 --- a/classes/data/dataMfTempFile.php +++ b/classes/data/dataMfTempFile.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataMfTempFile.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsMfTempFile class * * PHP version 5 * @@ -21,10 +21,10 @@ * @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 + * @release SVN: $Id: dataMfTempFile.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ -class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract +class GlmDataRegistrationsMfTempFile extends GlmDataAbstract { /** diff --git a/classes/data/dataPaymentCode.php b/classes/data/dataPaymentCode.php index 8395737..9e11e6a 100644 --- a/classes/data/dataPaymentCode.php +++ b/classes/data/dataPaymentCode.php @@ -21,7 +21,7 @@ * @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 + * @release SVN: $Id: dataPaymentCode.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ class GlmDataRegistrationsPaymentCode extends GlmDataAbstract @@ -114,7 +114,7 @@ class GlmDataRegistrationsPaymentCode extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Payment Code Type 'code_type' => array ( diff --git a/classes/data/dataRegClass.php b/classes/data/dataRegClass.php index 8993ba8..164fea0 100644 --- a/classes/data/dataRegClass.php +++ b/classes/data/dataRegClass.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataRegClass.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsRegClass class * * PHP version 5 * @@ -21,7 +21,7 @@ * @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 + * @release SVN: $Id: dataRegClass.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ class GlmDataRegistrationsRegClass extends GlmDataAbstract @@ -107,7 +107,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract */ $this->fields = array ( - + // ID 'id' => array ( 'field' => 'id', @@ -115,7 +115,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Pointer to reg_event table 'reg_event' => array ( 'field' => 'reg_event', @@ -126,7 +126,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract 'required' => true, 'use' => 'lgneud' ), - + // Name of this registration type 'name' => array ( 'field' => 'name', @@ -134,7 +134,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Registration Description 'descr' => array ( 'field' => 'descr', @@ -142,7 +142,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + ); } diff --git a/classes/data/dataRegEvent.php b/classes/data/dataRegEvent.php index bb2f9ec..8c741c1 100644 --- a/classes/data/dataRegEvent.php +++ b/classes/data/dataRegEvent.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataRegEvent.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsRegEvent class * * PHP version 5 * @@ -21,7 +21,7 @@ * @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 + * @release SVN: $Id: dataRegEvent.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ class GlmDataRegistrationsRegEvent extends GlmDataAbstract @@ -115,18 +115,23 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Pointer to event in Events add-on 'event' => array ( 'field' => 'event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'events', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Event Name + 'event_name' => array ( + 'field' => 'event_name', + 'type' => 'text', 'required' => true, 'use' => 'lgneud' ), - + // A short code used to reference this event 'event_code' => array ( 'field' => 'event_code', @@ -134,7 +139,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // E-Mail addresses to recieve notification of a registration other than org_internal_email in management, comma separated 'notify_email' => array ( 'field' => 'notify_email', @@ -142,7 +147,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => true, 'use' => 'a' ), - + // Active flag for admin from Events - If false, then does not show as a link from events to manage event. Still shows in registrations admin 'admin_active' => array ( 'field' => 'admin_active', @@ -150,7 +155,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'use' => 'a', 'default' => 0 ), - + // Active flag to indicate that this event is available for registrations 'active' => array ( 'field' => 'active', @@ -158,7 +163,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'use' => 'a', 'default' => 0 ), - + // Registration requires attendees - Otherwise the person submitting the registration is the registrant 'attendees' => array ( 'field' => 'attendees', @@ -166,7 +171,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'use' => 'a', 'default' => 0 ), - + // Attendee limit - 0 = unlimited 'attendee_max' => array ( 'field' => 'attendee_max', @@ -174,7 +179,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Maximum attendees per registration submission - 0 = unlimited 'attendee_max_per_reg' => array ( 'field' => 'attendee_max_per_reg', @@ -182,15 +187,25 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - - // Last calculated attendee count - 'attendee_count' => array ( - 'field' => 'attendee_count', + + // Registration hold in Minutes since last cart access - How log to hold an attendee slot in a cart that has not completed checkout + 'reg_hold_minutes' => array ( + 'field' => 'reg_hold_minutes', 'type' => 'integer', - 'required' => false, + 'required' => true, + 'default' => 60, + 'use' => 'a' + ), + + // Cart hold in days since last cart access - How long to retain a cart that has not checked and has had no access + 'cart_hold_days' => array ( + 'field' => 'cart_hold_days', + 'type' => 'integer', + 'required' => true, + 'default' => 10, 'use' => 'a' ), - + // Bitmap of how user accounts may be used for this event - See registration_account_option in plugin.ini 'registration_account_options' => array ( 'field' => 'registration_account_options', @@ -199,7 +214,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'default' => 0, // none selected 'use' => 'a' ), - + // Bitmap of payment methods available to users for this event - See payment_method in plugin.ini 'payment_methods' => array ( 'field' => 'payment_methods', @@ -208,8 +223,8 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'default' => 0, // none selected 'use' => 'a' ), - - + + // Bitmap of restricted (admin use only) payment methods for this event - see payment_method 'restricted_payment_methods' => array ( 'field' => 'restricted_payment_methods', @@ -218,7 +233,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'default' => 0, // none selected 'use' => 'a' ), - + // Terms and Conditions for registration 'terms' => array ( 'field' => 'terms', @@ -226,7 +241,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Name of a downloadable file 'reg_file' => array ( 'field' => 'reg_file', @@ -234,7 +249,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Title for downloadable file 'reg_file_title' => array ( 'field' => 'reg_file_title', @@ -242,7 +257,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Current MagicForm form revision 'form_revision' => array ( 'field' => 'form_revision', @@ -250,7 +265,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // System operator's notes for this event - Not visible to users 'notes' => array ( 'field' => 'notes', @@ -258,7 +273,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + ); } diff --git a/classes/data/dataRegRates.php b/classes/data/dataRegRate.php similarity index 80% rename from classes/data/dataRegRates.php rename to classes/data/dataRegRate.php index 5aa128a..6c49032 100644 --- a/classes/data/dataRegRates.php +++ b/classes/data/dataRegRate.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataRegRate.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsRegRates class * * PHP version 5 * @@ -21,7 +21,7 @@ * @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 + * @release SVN: $Id: dataRegRate.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ class GlmDataRegistrationsRegRates extends GlmDataAbstract @@ -100,14 +100,14 @@ class GlmDataRegistrationsRegRates extends GlmDataAbstract /* * Table Name */ - $this->table = GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_rates'; + $this->table = GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_rate'; /* * Table Data Fields */ $this->fields = array ( - + // ID 'id' => array ( 'field' => 'id', @@ -115,31 +115,31 @@ class GlmDataRegistrationsRegRates extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Pointer to reg_event table 'reg_event' => array ( - 'field' => 'id', - 'as' => 'reg_event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event', - 'p_field' => 'id', - 'p_static' => true, + 'field' => 'reg_event', + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_class table 'reg_class' => array ( - 'field' => 'id', - 'as' => 'reg_class', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_class', - 'p_field' => 'id', - 'p_static' => true, + 'field' => 'reg_class', + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + + // Name of this rate + 'name' => array ( + 'field' => 'name', + 'type' => 'text', + 'required' => true, + 'use' => 'lgneud' + ), + // # of days before event time rate becomes available - may be entered as a date then coverted for storage 'start_days' => array ( 'field' => 'start_days', @@ -147,7 +147,7 @@ class GlmDataRegistrationsRegRates extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // # of days before event time rate becomes available - may be entered as a date then coverted for storage 'end_days' => array ( 'field' => 'end_days', @@ -155,7 +155,7 @@ class GlmDataRegistrationsRegRates extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Base rate to register 'base_rate' => array ( 'field' => 'base_rate', @@ -163,7 +163,7 @@ class GlmDataRegistrationsRegRates extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Rate per registrant 'per_registrant' => array ( 'field' => 'per_registrant', @@ -171,7 +171,7 @@ class GlmDataRegistrationsRegRates extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Number of registrants included in base rate 'registrant_credits' => array ( 'field' => 'registrant_credits', @@ -179,7 +179,7 @@ class GlmDataRegistrationsRegRates extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + ); } diff --git a/classes/data/dataRegRequest.php b/classes/data/dataRegRequest.php index 31ec304..56203d8 100644 --- a/classes/data/dataRegRequest.php +++ b/classes/data/dataRegRequest.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataRegRequest.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsRequest class * * PHP version 5 * @@ -21,10 +21,10 @@ * @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 + * @release SVN: $Id: dataRegRequest.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ -class GlmDataRegistrationRequest extends GlmDataAbstract +class GlmDataRegistrationsRequest extends GlmDataAbstract { /** diff --git a/classes/data/dataRegRequestClass.php b/classes/data/dataRegRequestClass.php index cb3b16b..af8768a 100644 --- a/classes/data/dataRegRequestClass.php +++ b/classes/data/dataRegRequestClass.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataRegRequestClass.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsRequestClass class * * PHP version 5 * @@ -21,7 +21,7 @@ * @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 + * @release SVN: $Id: dataRegRequestClass.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ class GlmDataRegistrationsRequestClass extends GlmDataAbstract @@ -107,7 +107,7 @@ class GlmDataRegistrationsRequestClass extends GlmDataAbstract */ $this->fields = array ( - + // ID 'id' => array ( 'field' => 'id', @@ -115,67 +115,87 @@ class GlmDataRegistrationsRequestClass extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Pointer to account (person submitting the registration) 'account' => array ( - 'field' => 'contact_id', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account', - 'p_field' => 'id', - 'p_static' => true, + 'field' => 'account', + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_event 'event' => array ( 'field' => 'event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Event Name + 'event_name' => array ( + 'field' => 'event_name', + 'type' => 'text', 'required' => true, 'use' => 'lgneud' ), - - // Pointer to event_times table entry in Events add-on + + // Pointer to times table entry in Events add-on 'event_time' => array ( 'field' => 'event_time', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'event_times', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Selected Start Time + 'event_datetime' => array ( + 'field' => 'event_datetime', + 'type' => 'datetime', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_request_event table 'reg_request_event' => array ( 'field' => 'reg_request_event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_event', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Pointer to reg_class table entry + 'class' => array ( + 'field' => 'class', + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Class Name + 'class_name' => array ( + 'field' => 'class_name', + 'type' => 'text', 'required' => true, 'use' => 'lgneud' ), - - // Last calculated total of all charges for registration to this event for all registrants + + // Last calculated total of all charges for registration to this event for all registrants 'total_class_charge' => array ( 'field' => 'total_class_charge', 'type' => 'money', 'required' => false, 'use' => 'a' ), - - // Any MagicForm data associated with requested event + + // Any MagicForm data associated with requested event 'mf_data' => array ( 'field' => 'mf_data', 'type' => 'text', 'required' => false, 'use' => 'a' ), - + // System operator's notes for this registration request 'notes' => array ( 'field' => 'notes', @@ -183,7 +203,7 @@ class GlmDataRegistrationsRequestClass extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + ); } diff --git a/classes/data/dataRegRequestEvent.php b/classes/data/dataRegRequestEvent.php index d87ff4e..4c4ad62 100644 --- a/classes/data/dataRegRequestEvent.php +++ b/classes/data/dataRegRequestEvent.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataRegRequestEvent.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsRequestEvent class * * PHP version 5 * @@ -21,10 +21,10 @@ * @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 + * @release SVN: $Id: dataRegRequestEvent.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ -class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract +class GlmDataRegistrationsRequestEvent extends GlmDataAbstract { /** @@ -115,59 +115,63 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Pointer to account (person submitting the registration) 'account' => array ( - 'field' => 'contact_id', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account', - 'p_field' => 'id', - 'p_static' => true, + 'field' => 'account', + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_request table 'reg_request' => array ( 'field' => 'reg_request', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_event 'event' => array ( 'field' => 'event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Event Name + 'event_name' => array ( + 'field' => 'event_name', + 'type' => 'text', 'required' => true, 'use' => 'lgneud' ), - - // Pointer to event_times table entry in Events add-on + + // Pointer to times table entry in Events add-on 'event_time' => array ( 'field' => 'event_time', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'event_times', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Selected Start Time + 'event_datetime' => array ( + 'field' => 'event_datetime', + 'type' => 'datetime', 'required' => true, 'use' => 'lgneud' ), - - // Last calculated total of all charges for registration to this event for all registrants + + // Last calculated total of all charges for registration to this event for all registrants 'total_charge' => array ( 'field' => 'total_charge', 'type' => 'money', 'required' => false, 'use' => 'a' ), - + // System operator's notes for this registration request 'notes' => array ( 'field' => 'notes', @@ -175,14 +179,14 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - // Any MagicForm data associated with requested event + // Any MagicForm data associated with requested event 'mf_data' => array ( 'field' => 'mf_data', 'type' => 'text', 'required' => false, 'use' => 'a' ), - + ); } diff --git a/classes/data/dataRegRequestRate.php b/classes/data/dataRegRequestRate.php index dcfbc81..c0c8c7a 100644 --- a/classes/data/dataRegRequestRate.php +++ b/classes/data/dataRegRequestRate.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataRegRequestRate.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsRegRequestRate class * * PHP version 5 * @@ -21,10 +21,10 @@ * @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 + * @release SVN: $Id: dataRegRequestRate.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ -class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract +class GlmDataRegistrationsRegRequestRate extends GlmDataAbstract { /** @@ -107,8 +107,8 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract */ $this->fields = array ( - - + + // ID 'id' => array ( 'field' => 'id', @@ -116,70 +116,87 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Pointer to account (person submitting the registration) 'account' => array ( - 'field' => 'contact_id', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account', - 'p_field' => 'id', - 'p_static' => true, + 'field' => 'account', + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_event entry 'event' => array ( 'field' => 'event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Event Name + 'event_name' => array ( + 'field' => 'event_name', + 'type' => 'text', 'required' => true, 'use' => 'lgneud' ), - - // Pointer to event_times table entry in Events add-on - To help with registrant searches + + // Pointer to times table entry in Events add-on - To help with registrant searches 'event_time' => array ( 'field' => 'event_time', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'event_times', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Selected Start Time + 'event_datetime' => array ( + 'field' => 'event_datetime', + 'type' => 'datetime', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_request_event table entry 'reg_request_event' => array ( 'field' => 'reg_request_event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_event', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_request_class table entry 'reg_request_class' => array ( 'field' => 'reg_request_class', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_class', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Pointer to reg_rate table entry + 'rate' => array ( + 'field' => 'rate', + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + + // Rate Name + 'rate_name' => array ( + 'field' => 'rate_name', + 'type' => 'text', + 'required' => true, + 'use' => 'lgneud' + ), + // Base rate at time of registration - 'rate_base' => array ( - 'field' => 'rate_base', + 'base_rate' => array ( + 'field' => 'base_rate', 'type' => 'money', 'required' => false, 'use' => 'a' ), - + // Per Registrant Rate at time of registration 'per_registrant' => array ( 'field' => 'per_registrant', @@ -187,7 +204,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Number of registrant credits in base rate at time of registration 'registrant_credits' => array ( 'field' => 'registrant_credits', @@ -195,7 +212,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Last calculated number of registrants with this rate 'numb_registrants' => array ( 'field' => 'numb_registrants', @@ -203,7 +220,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Per Registrant Rate at time of registration 'total_registrant_charges' => array ( 'field' => 'total_registrant_charges', @@ -211,7 +228,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Any MagicForm data associated with registrant 'mf_data' => array ( 'field' => 'mf_data', @@ -219,7 +236,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // System operator's notes for this registration request 'notes' => array ( 'field' => 'notes', @@ -227,7 +244,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + ); } diff --git a/classes/data/dataRegRequestRegistrant.php b/classes/data/dataRegRequestRegistrant.php index a8561fd..6af8dde 100644 --- a/classes/data/dataRegRequestRegistrant.php +++ b/classes/data/dataRegRequestRegistrant.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataRegRequestRegistrant.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /** - * GlmDataRegistrationsAddedInfoFields class + * GlmDataRegistrationsRequestRegistrant class * * PHP version 5 * @@ -21,10 +21,10 @@ * @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 + * @release SVN: $Id: dataRegRequestRegistrant.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ -class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract +class GlmDataRegistrationsRequestRegistrant extends GlmDataAbstract { /** @@ -107,7 +107,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract */ $this->fields = array ( - + // ID 'id' => array ( 'field' => 'id', @@ -115,84 +115,102 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), - + // Pointer to account for person submitting the registration 'account' => array ( - 'field' => 'contact_id', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account', - 'p_field' => 'id', - 'p_static' => true, + 'field' => 'account', + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_event entry 'event' => array ( 'field' => 'event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Event Name + 'event_name' => array ( + 'field' => 'event_name', + 'type' => 'text', 'required' => true, 'use' => 'lgneud' ), - - // Pointer to event_times table entry in Events add-on - To help with registrant searches + + // Pointer to times table entry in Events add-on - To help with registrant searches 'event_time' => array ( 'field' => 'event_time', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'event_times', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // Selected Start Time + 'event_datetime' => array ( + 'field' => 'event_datetime', + 'type' => 'datetime', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_request_event table entry 'reg_request_event' => array ( 'field' => 'reg_request_event', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_event', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_request_class table entry 'reg_request_class' => array ( 'field' => 'reg_request_class', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_class', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to reg_request_rate table entry 'reg_request_rate' => array ( 'field' => 'reg_request_rate', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_rate', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', 'required' => true, 'use' => 'lgneud' ), - + // Pointer to account for registrant (person attending) - Not needed if registrants are off for the event 'reg_request_registrant' => array ( 'field' => 'reg_request_registrant', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_registrant', - 'p_field' => 'id', - 'p_static' => true, + 'type' => 'integer', + 'required' => true, + 'use' => 'lgneud' + ), + + // First Name of registrant + 'reg_request_hold' => array ( + 'field' => 'reg_request_hold', + 'type' => 'checkbox', + 'use' => 'lgneud' + ), + + // First Name of registrant + 'fname' => array ( + 'field' => 'fname', + 'type' => 'text', + 'required' => true, + 'use' => 'lgneud' + ), + + // Last Name + 'lname' => array ( + 'field' => 'lname', + 'type' => 'text', 'required' => true, 'use' => 'lgneud' ), - + // Any MagicForm data associated with registrant 'mf_data' => array ( 'field' => 'mf_data', @@ -200,7 +218,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // System operator's notes for this registration request 'notes' => array ( 'field' => 'notes', @@ -208,7 +226,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + ); } diff --git a/classes/registrationsSupport.php b/classes/registrationsSupport.php index 817353a..58351f4 100644 --- a/classes/registrationsSupport.php +++ b/classes/registrationsSupport.php @@ -14,9 +14,19 @@ * @link http://dev.gaslightmedia.com/ */ -/* - * This class provides some standard methods used by this plugin - */ +// Load required data classes for registration events +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php'; +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegClass.php'; +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRate.php'; + +// Load required data classes for registration requests +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataAccount.php'; +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php'; +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestEvent.php'; +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestClass.php'; +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRate.php'; +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php'; + class GlmRegistrationsSupport { @@ -34,6 +44,13 @@ class GlmRegistrationsSupport * @access public */ public $config; + /** + * Registration Request Cart + * + * $var $cart + * @access public + */ + public $cart = false; /** * Constructor @@ -64,81 +81,144 @@ class GlmRegistrationsSupport /* * Retrieve a complete cart * + * Structure of returned data + * + * array ( + * status + * errorMsg + * notes + * accounts Array of accounts associated with this cart, both for the person submitting and those being registered - Index is account ID + * request Array of base request data - If no submission account yet, that value is false + * events Array of events requested + * classes Array of registration classes being requested + * rates Array of rates selected for this event class + * registrants Array of registrants selected for this rate - Also points to account for registrants in "accounts" array above + * + * ) + * * @param integer $requestID * * @return array Array of request and all associated information or false * @access public */ - public function getRegistrationCart($requestID = false) + public function getRegistrationCart($requestId = false) { - // Create return data array - $cart = array( + // Clear cart data + $this->cart = array( 'status' => false, // Return status, default to false, true if valid request returned 'errorMsg' => '', // Any applicable error message 'notes' => array(), // System generated notes regarding status of request 'accounts' => array(), // Accounts associated with this request - both requesting and attending (might be the same) // Index in this array is the account ID as used in data below - 'request' => false, // Request reccord - 'events' => false // Array of events with 'class', 'rate', 'registrant' data under each event + 'request' => false, // Base request record + 'events' => array() // List of events requested ); // Validate request ID - if (!$requestID || ($requestID-0) <= 0) { + if (!$requestId || ($requestId-0) <= 0) { return false; } - /* - * Base registration request - */ + // Try to get the base registration request data + $RegRequest = new GlmDataRegistrationsRequest($this->wpdb, $this->config); + $this->cart['request'] = $RegRequest->getEntry($requestId); + if (!$this->cart['request']) { + $this->cart['errorMsg'] = 'Unable to retrieve the requested registration request.'; + return $this->cart; + } - // Load Registration Requests data abstract - require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php'; - $RegRequest = new GlmDataRegistrationRequest($this->wpdb, $this->config); + // Add submitting account if not guest submission (at this point) + $this->addAccountToCart($this->cart['request']['account']); - // Try to get the base registration request data - $cart['request'] = $RegRequest->getEntry($requestID); + // Get list of events being requested + $RequestEvent = new GlmDataRegistrationsRequestEvent($this->wpdb, $this->config); + $this->cart['events'] = $RequestEvent->getList("T.reg_request = $requestId"); - if (!$cart['request']) { - $cart['errorMsg'] = 'Unable to retrieve the requested registration request.'; - return $cart; - } + // For each event + if ($this->cart['events']) { + foreach ($this->cart['events'] as $eventKey => $event) { - /* - * Registration requested by - */ + // Get list of event classes requested for this event + $RequestClass = new GlmDataRegistrationsRequestClass($this->wpdb, $this->config); + $this->cart['events'][$eventKey]['classes'] = $RequestClass->getList("T.reg_request = $requestId"); - // Load Registration Requests data abstract - require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataAccount.php'; - $Account = new GlmDataRegistrationsAccount($this->wpdb, $this->config); + // For each class selected for this event + if ($this->cart['events'][$eventKey]['classes']) { + foreach ($this->cart['events'][$eventKey]['classes'] as $classKey => $class) { - // Try to get the account record for the person who submitted (is submitting) the request - if ($cart['request']['account']) { + // Get list of rates requested for this class + $RequestRate = new GlmDataRegistrationsRegRequestRate($this->wpdb, $this->config); + $this->cart['events'][$eventKey]['classes'][$classKey]['rates'] = $RequestRate->getList("T.reg_request = $requestId"); + + // For each rate selected for this class + if ($this->cart['events'][$eventKey]['classes'][$classKey]['rates']) { + foreach ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'] as $rateKey => $rate) { + + // Get list of registrants requested for this rate + $RequestRegistrant = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config); + $this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'] = $RequestRegistrant->getList("T.reg_request = $requestId"); - // Get the the account ID of the person who submitted the request - $accountID = ($cart['request']['account'] - 0); + // For each rate selected for this class + if ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants']) { + foreach ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'] as $registrantKey => $registrant) { - // Make sure it's a positive integer - if (is_int($accountID) && $accountID > 0) { + // Add registrant account to accounts table + $this->addAccountToCart($registrant['account']); - // Try to get account information - $account = $Account->getEntry($accountID); + } // Each Registrant + } - // If we found a good account, add that to the accounts list in the cart. - if ($account) { - $cart['accounts'][$account['id']] = $account; - } else { - $cart['notes'][] = 'Registration request does not have an account for the person submitting the request. (Guest registration?)'; + } // Each Rate + } + + + } // Each Class } - } + } // Each Event } - return $cart; + return $this->cart; } + /* + * Add an account to the accounts list if not already there + * + * + * @param integer $accountId + * + * @return boolean Success or fail + * @access public + */ + public function addAccountToCart($accountId) + { + + // Check the supplied account ID + $accountId = ($accountId-0); + if ($accountId == 0) { + return false; + } + + // Try to get the account record for the person who submitted (is submitting) the request + $Account = new GlmDataRegistrationsAccount($this->wpdb, $this->config); + $account = $Account->getEntry($accountId); + + // If account was not found + if (!$account) { + return false; + } + + // If the account doesn't exist in the accounts array, add it + if (!isset($this->cart['accounts'][$accountId])) { + $this->cart['accounts'][$account['id']] = $account; + } + + return true; + + } /* * Add temporary test data @@ -164,17 +244,31 @@ class GlmRegistrationsSupport public function addTestData() { + // Grab the first event from the events database + $sql = "SELECT id, name FROM ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX."events LIMIT 1"; + $event = $this->wpdb->get_results($sql, ARRAY_A); + $eventId = $event[0]['id']; + $eventName = $event[0]['name']; + + // Grab the first time from this event + $sql = "SELECT id, start_time FROM ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX."times WHERE event = $eventId LIMIT 1"; + $time = $this->wpdb->get_results($sql, ARRAY_A); + $timeId = $event[0]['id']; + $eventTime = $time[0]['start_time']; + // Event $sql = " INSERT INTO ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_event ( event, + event_name, event_code, active ) VALUES ( - 0, + $eventId, + '$eventName', 'TEST-EVENT', true ) @@ -200,12 +294,13 @@ class GlmRegistrationsSupport $this->wpdb->query($sql); $regClassID = $this->wpdb->insert_id; - // Event Registration Rates + // Event Registration Rate $sql = " - INSERT INTO ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_rates + INSERT INTO ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_rate ( reg_event, reg_class, + name, start_days, end_days, base_rate, @@ -216,6 +311,7 @@ class GlmRegistrationsSupport ( $regEventID, $regClassID, + 'Rate Name', 100, 50, 20, @@ -306,8 +402,6 @@ class GlmRegistrationsSupport $this->wpdb->query($sql); $requestID = $this->wpdb->insert_id; -// **** NEED TO RECHECK EVERYTHING FROM HERE DOWN **** - // Registration Request Event $sql = " INSERT INTO ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request_event @@ -315,7 +409,9 @@ class GlmRegistrationsSupport account, reg_request, event, + event_name, event_time, + event_datetime, total_charge, mf_data, notes @@ -325,7 +421,9 @@ class GlmRegistrationsSupport $accountID, $requestID, $regEventID, - 0, + '$eventName', + $timeId, + '$eventTime', 100, '', '' @@ -340,9 +438,13 @@ class GlmRegistrationsSupport ( account, event, + event_name, event_time, + event_datetime, reg_request, reg_request_event, + class, + class_name, total_class_charge, mf_data, notes @@ -351,9 +453,13 @@ class GlmRegistrationsSupport ( $accountID, $regEventID, - 0, + '$eventName', + $timeId, + '$eventTime', $requestID, $requestEventID, + 0, + 'Class Name', 100, '', '' @@ -369,10 +475,14 @@ class GlmRegistrationsSupport ( account, event, + event_name, event_time, + event_datetime, reg_request, reg_request_event, reg_request_class, + rate, + rate_name, base_rate, per_registrant, registrant_credits, @@ -385,10 +495,14 @@ class GlmRegistrationsSupport ( $accountID, $regEventID, - 0, + '$eventName', + $timeId, + '$eventTime', $requestID, $requestEventID, $requestClassID, + 0, + 'Rate Name', 100, 10, 1, @@ -408,12 +522,16 @@ class GlmRegistrationsSupport ( account, event, + event_name, event_time, + event_datetime, reg_request, reg_request_event, reg_request_class, reg_request_rate, reg_request_registrant, + fname, + lname, mf_data, notes ) @@ -421,12 +539,16 @@ class GlmRegistrationsSupport ( $accountID, $regEventID, - 0, + '$eventName', + $timeId, + '$eventTime', $requestID, $requestEventID, $requestClassID, $requestRateID, $accountID, + 'First', + 'Last', '', '' ) @@ -438,11 +560,11 @@ class GlmRegistrationsSupport } - public function removeRegistrationRequestData($testIDs) + public function removeRegistrationRequestData() { $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_event;"); $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_class;"); - $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_rates;"); + $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_rate;"); $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."account;"); $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request;"); $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request_event;"); diff --git a/index.php b/index.php index 25e2ffe..a8d5b61 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ * version from this plugin. */ define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '0.0.1'); -define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.2'); +define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.6'); // 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.8.0'); diff --git a/models/admin/registrations/requests.php b/models/admin/registrations/requests.php index b67f3cb..aad096c 100644 --- a/models/admin/registrations/requests.php +++ b/models/admin/registrations/requests.php @@ -16,7 +16,7 @@ // Load Registration Requests data abstract require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php'; -class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationRequest +class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRequest { /** @@ -157,14 +157,14 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationRequest } // Temporary debug info -$cart_r = print_r($requestCart,1); +//$cart_r = print_r($requestCart,1); // Compile template data $templateData = array( 'haveRequests' => $haveRequests, 'requests' => $requests, 'haveRequest' => $haveRequest, - 'requestCart' => $requestCart, + 'cart' => $requestCart, 'errorMsg' => $errorMsg, 'cart_r' => $cart_r diff --git a/setup/databaseScripts/create_database_V0.0.2.sql b/setup/databaseScripts/create_database_V0.0.6.sql similarity index 86% rename from setup/databaseScripts/create_database_V0.0.2.sql rename to setup/databaseScripts/create_database_V0.0.6.sql index d2c3a72..5a9b410 100644 --- a/setup/databaseScripts/create_database_V0.0.2.sql +++ b/setup/databaseScripts/create_database_V0.0.6.sql @@ -29,6 +29,7 @@ * --> Event, Submission, Event Registration, Event Registrant, Account or global * * reg_event - Describes registration for that event + * reg_time - One record for each date/time this event has people registered - Primarily tracks attendee counts and charge totals * reg_class - Type of registration for this event (one or more) * reg_rates - Date range / rate for a reg class (one or more) * @@ -301,6 +302,7 @@ CREATE TABLE {prefix}payment_code ( CREATE TABLE {prefix}reg_event ( id INT NOT NULL AUTO_INCREMENT, event INT NULL, -- Pointer to event in Events add-on + event_name TINYTEXT NULL, -- Name of Event so it will always be in the cart data event_code TINYTEXT NULL, -- A short code used to reference this event - can be used to directly select an event to register for notify_email TINYTEXT NULL, -- E-Mail addresses to recieve notification of a registration other than org_internal_email in management, comma separated admin_active BOOLEAN NULL, -- Active flag for admin from Events - If false, then does not show as a link from events to manage event. Still shows in registrations admin @@ -308,10 +310,11 @@ CREATE TABLE {prefix}reg_event ( attendees BOOLEAN NULL, -- Registration requires attendees - Otherwise the person submitting the registration is the registrant attendee_max MEDIUMINT NULL, -- Attendee limit - 0 = unlimited attendee_max_per_reg TINYINT NULL, -- Maximum attendees per registration submission - 0 = unlimited - attendee_count MEDIUMINT NULL, -- Last calculated attendee count - registration_account_options SMALLINT NULL, -- Bitmap of how user accounts may be used for this event - See registration_account_option in plugin.ini - payment_methods SMALLINT NULL, -- Bitmap of payment methods available to users for this event - See payment_method in plugin.ini - restricted_payment_methods SMALLINT NULL, -- Bitmap of restricted (admin use only) payment methods for this event - see payment_method + reg_hold_minutes MEDIUMINT NULL, -- Number of minutes hold time for an inactive cart before registrant count hold expires (after which cart attempts to hold again on next access) + cart_hold_days MEDIUMINT NULL, -- Number of days hold time for inactive cart before cart is purged + registration_account_options SMALLINT NULL, -- Bitmap of how user accounts may be used for this event - See registration_account_option in plugin.ini + payment_methods SMALLINT NULL, -- Bitmap of payment methods available to users for this event - See payment_method in plugin.ini + restricted_payment_methods SMALLINT NULL, -- Bitmap of restricted (admin use only) payment methods for this event - see payment_method terms TEXT NULL, -- Terms and Conditions for registration reg_file TINYTEXT NULL, -- Name of a downloadable file reg_file_title TINYTEXT NULL, -- Title for downloadable file @@ -324,6 +327,34 @@ CREATE TABLE {prefix}reg_event ( ---- +-- Registration Event Time - Information and summary data for a specific event instance (relates to a perticular time record in events) +-- These are created the first time a person tries to register for an event instance (time) +-- One or more for each event +CREATE TABLE {prefix}reg_time ( + id INT NOT NULL AUTO_INCREMENT, + reg_event INT NULL, -- Pointer to reg_event table + event_time INT NULL, -- Pointer to events times table entry + 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 + 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 + attendee_count MEDIUMINT NULL, -- Current attendee count - calculated on the fly and stored here for reference + attendees_pending MEDIUMINT NULL, -- Current number of attendees for this time in active pending carts (not processed) - Updated when carts are processed + attendees_available MEDIUMINT NULL, -- Currently available attendee count (limit - current - pending) + total_base_charge DOUBLE NULL, -- Total base charges + total_per_attendee DOUBLE NULL, -- Total per-attendee charges + total_other DOUBLE NULL, -- Total other charges (meals, extras, fees, ...) + total_taxes DOUBLE NULL, -- Total taxes charged + total_charges DOUBLE NULL, -- Total charges (sum of all above) + total_discounts DOUBLE NULL, -- Total discounts of all types (applied payment codes, etc...) + total_payments DOUBLE NULL, -- Total net payments (total charges - total discounts) + PRIMARY KEY (id), + INDEX (reg_event) +); + +---- + -- Registration Class - Type of registration for a specific event - Equates to "Rate Options" in the old system -- One or more for each event CREATE TABLE {prefix}reg_class ( @@ -339,10 +370,11 @@ CREATE TABLE {prefix}reg_class ( -- Rates and dates for a particular reg_class -- One or more per reg_class - **** Days should not overlap for a particular reg_class -CREATE TABLE {prefix}reg_rates ( +CREATE TABLE {prefix}reg_rate ( id INT NOT NULL AUTO_INCREMENT, reg_event INT NULL, -- Pointer to reg_event table reg_class INT NULL, -- Pointer to reg_class table + name TINYTEXT NULL, -- Namme of this rate start_days INT NULL, -- # of days before event time rate becomes available - may be entered as a date then coverted for storage end_days INT NULL, -- # of days before event time rate becomes unavailable base_rate FLOAT, -- Base rate to register @@ -459,6 +491,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 + last_update DATETIME NULL, -- Last update date/time - Used for timing out pending carts and attendee counts PRIMARY KEY (id), INDEX (account), INDEX (date_submitted) @@ -473,7 +506,9 @@ CREATE TABLE {prefix}reg_request_event ( account INT NULL, -- Pointer to account (person submitting the registration) reg_request INT NULL, -- Pointer to reg_request table event INT NULL, -- Pointer to reg_event - event_time INT NULL, -- Pointer to event_times table entry in Events add-on + event_name TINYTEXT NULL, -- Name of Event so it will always be in the cart data + event_time INT NULL, -- Pointer to times table entry in Events add-on + event_datetime DATETIME NULL, -- Date and time of event time selected so it will always be in the cart total_charge FLOAT, -- Last calculated total of all charges for registration to this event for all registrants mf_data TEXT NULL, -- Any MagicForm data associated with requested event notes TEXT NULL, -- System operator's notes for this registration request @@ -492,9 +527,13 @@ CREATE TABLE {prefix}reg_request_class ( id INT NOT NULL AUTO_INCREMENT, account INT NULL, -- Pointer to account (person submitting the registration) event INT NULL, -- Pointer to reg_event entry - event_time INT NULL, -- Pointer to event_times table entry in Events add-on - To help with registrant searches + event_name TINYTEXT NULL, -- Name of Event so it will always be in the cart data + event_time INT NULL, -- Pointer to times table entry in Events add-on - To help with registrant searches + 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 + class_name TINYTEXT NULL, -- Name of event class at the time selected total_class_charge FLOAT, -- Last calculated total of all charges for this registration class for this request mf_data TEXT NULL, -- Any MagicForm data associated with registrant notes TEXT NULL, -- System operator's notes for this registration request @@ -513,10 +552,14 @@ CREATE TABLE {prefix}reg_request_rate ( id INT NOT NULL AUTO_INCREMENT, account INT NULL, -- Pointer to account (person submitting the registration) event INT NULL, -- Pointer to reg_event entry - event_time INT NULL, -- Pointer to event_times table entry in Events add-on - To help with registrant searches + event_name TINYTEXT NULL, -- Name of Event so it will always be in the cart data + event_time INT NULL, -- Pointer to times table entry in Events add-on - To help with registrant searches + 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 + rate INT NULL, -- Pointer to event reg_rate table + rate_name TINYTEXT NULL, -- Name of event class rate at the time selected 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 registrant credits in base rate at time of registration @@ -539,12 +582,17 @@ CREATE TABLE {prefix}reg_request_registrant ( id INT NOT NULL AUTO_INCREMENT, account INT NULL, -- Pointer to account for person submitting the registration event INT NULL, -- Pointer to reg_event entry - event_time INT NULL, -- Pointer to event_times table entry in Events add-on - To help with registrant searches + event_name TINYTEXT NULL, -- Name of Event so it will always be in the cart data + event_time INT NULL, -- Pointer to times table entry in Events add-on - To help with registrant searches + 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 reg_request_rate INT NULL, -- Pointer to reg_request_rate table entry reg_request_registrant INT NULL, -- Pointer to account for registrant (person attending) - Not needed if registrants are off for the event + reg_request_hold BOOLEAN NULL, -- Registrant hold active - Registrant slots held certain time since last cart access - After this the slot needs to be updated if available + 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), diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index c922a13..4a4bca7 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -15,7 +15,11 @@ $glmMembersRegistrationsDbVersions = array( '0.0.1' => array('version' => '0.0.1', 'tables' => 18, 'date' => '03/3/2017'), - '0.0.2' => array('version' => '0.0.2', 'tables' => 18, 'date' => '03/28/2017') + '0.0.2' => array('version' => '0.0.2', 'tables' => 18, 'date' => '03/28/2017'), + '0.0.3' => array('version' => '0.0.3', 'tables' => 18, 'date' => '04/03/2017'), + '0.0.4' => array('version' => '0.0.4', 'tables' => 18, 'date' => '04/03/2017'), + '0.0.5' => array('version' => '0.0.5', 'tables' => 18, 'date' => '04/04/2017'), + '0.0.6' => array('version' => '0.0.6', 'tables' => 19, 'date' => '04/06/2017') ); diff --git a/setup/databaseScripts/drop_database_V0.0.2.sql b/setup/databaseScripts/drop_database_V0.0.6.sql similarity index 93% rename from setup/databaseScripts/drop_database_V0.0.2.sql rename to setup/databaseScripts/drop_database_V0.0.6.sql index eb608ea..ef68960 100644 --- a/setup/databaseScripts/drop_database_V0.0.2.sql +++ b/setup/databaseScripts/drop_database_V0.0.6.sql @@ -15,8 +15,9 @@ DROP TABLE IF EXISTS {prefix}mf_temp_file, {prefix}payment_code, {prefix}reg_event, + {prefix}reg_time, {prefix}reg_class, - {prefix}reg_rates, + {prefix}reg_rate, {prefix}account, {prefix}reg_request, {prefix}reg_request_event, diff --git a/setup/databaseScripts/update_database_V0.0.3.sql b/setup/databaseScripts/update_database_V0.0.3.sql new file mode 100644 index 0000000..e877349 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.3.sql @@ -0,0 +1,9 @@ +-- Gaslight Media Members Database - Registrations Add-On +-- File Created: 03/28/17 11:33:00 +-- Database Version: 0.0.2 +-- 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 dashses + +RENAME TABLE {prefix}reg_rates TO {prefix}reg_rate; diff --git a/setup/databaseScripts/update_database_V0.0.4.sql b/setup/databaseScripts/update_database_V0.0.4.sql new file mode 100644 index 0000000..caa1193 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.4.sql @@ -0,0 +1,45 @@ +-- Gaslight Media Members Database - Registrations Add-On +-- File Created: 03/28/17 11:33:00 +-- Database Version: 0.0.2 +-- 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 dashses + +ALTER TABLE {prefix}reg_event ADD COLUMN event_name TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_event ADD COLUMN event_name TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_event ADD COLUMN event_datetime DATETIME; + +---- + +ALTER TABLE {prefix}reg_request_class ADD COLUMN event_name TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_class ADD COLUMN event_datetime DATETIME; + +---- + +ALTER TABLE {prefix}reg_request_rate ADD COLUMN event_name TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_rate ADD COLUMN event_datetime DATETIME; + +---- + +ALTER TABLE {prefix}reg_request_registrant ADD COLUMN event_name TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_registrant ADD COLUMN event_datetime DATETIME; + + + + diff --git a/setup/databaseScripts/update_database_V0.0.5.sql b/setup/databaseScripts/update_database_V0.0.5.sql new file mode 100644 index 0000000..8e2c887 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.5.sql @@ -0,0 +1,33 @@ +-- Gaslight Media Members Database - Registrations Add-On +-- File Created: 03/28/17 11:33:00 +-- Database Version: 0.0.2 +-- 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 dashses + +ALTER TABLE {prefix}reg_rate ADD COLUMN name TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_class ADD COLUMN class INTEGER; + +---- + +ALTER TABLE {prefix}reg_request_class ADD COLUMN class_name TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_rate ADD COLUMN rate INTEGER; + +---- + +ALTER TABLE {prefix}reg_request_rate ADD COLUMN rate_name TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_registrant ADD COLUMN fname TINYTEXT; + +---- + +ALTER TABLE {prefix}reg_request_registrant ADD COLUMN lname TINYTEXT; diff --git a/setup/databaseScripts/update_database_V0.0.6.sql b/setup/databaseScripts/update_database_V0.0.6.sql new file mode 100644 index 0000000..4bb12c6 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.6.sql @@ -0,0 +1,49 @@ +-- Gaslight Media Members Database - Registratiuons Add-On +-- File Created: 08/30/16 09:47:15 +-- Database Version: 0.0.23 +-- 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 + +-- Registration Event Time - Information and summary data for a specific event instance (relates to a perticular time record in events) +-- These are created the first time a person tries to register for an event instance (time) +-- One or more for each event +CREATE TABLE {prefix}reg_time ( + id INT NOT NULL AUTO_INCREMENT, + reg_event INT NULL, -- Pointer to reg_event table + event_time INT NULL, -- Pointer to events times table entry + 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 + 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 + attendee_count MEDIUMINT NULL, -- Current attendee count - calculated on the fly and stored here for reference + attendees_pending MEDIUMINT NULL, -- Current number of attendees for this time in active pending carts (not processed) - Updated when carts are processed + attendees_available MEDIUMINT NULL, -- Currently available attendee count (limit - current - pending) + total_base_charge DOUBLE NULL, -- Total base charges + total_per_attendee DOUBLE NULL, -- Total per-attendee charges + total_other DOUBLE NULL, -- Total other charges (meals, extras, fees, ...) + total_taxes DOUBLE NULL, -- Total taxes charged + total_charges DOUBLE NULL, -- Total charges (sum of all above) + total_discounts DOUBLE NULL, -- Total discounts of all types (applied payment codes, etc...) + total_payments DOUBLE NULL, -- Total net payments (total charges - total discounts) + PRIMARY KEY (id), + INDEX (reg_event) +); + +---- + +ALTER TABLE {prefix}reg_event DROP COLUMN attendee_count; + +---- + +ALTER TABLE {prefix}reg_event ADD COLUMN reg_hold_minutes MEDIUMINT; + +---- + +ALTER TABLE {prefix}reg_event ADD COLUMN cart_hold_days MEDIUMINT; + +---- + +ALTER TABLE {prefix}reg_request_registrant ADD COLUMN reg_request_hold BOOLEAN; diff --git a/views/admin/registrations/editRequest.html b/views/admin/registrations/editRequest.html index 9fd144e..23b56ad 100644 --- a/views/admin/registrations/editRequest.html +++ b/views/admin/registrations/editRequest.html @@ -1,25 +1,110 @@ -

Registration Request

+{include file='admin/registrations/header.html'} -

Person submitting the registration: {$requestCart.request.bill_fname} (ID = {$requestCart.request.id})

- -

-Info in registration request: -{if $requestCart.request.account} - {$requestCart.accounts.{$requestCart.request.account}.fname} -{else} - (No account) -{/if} - - -

- -

Info from account of person who submitted the registration

- -

Events selected:

+ Return to Registration Requests List + {if $option == 'edit' || $option == 'update'} +*** Edit or Update *** + {else} + {$req = $cart.request} + + + + + + {if $req.notes} + + {/if} + +
+ + + + + + + + + + + + + + + + + +
+ + + + + -{include file='admin/footer.html'} + {/if} -
{$cart_r}
+{include file='admin/footer.html'} diff --git a/views/admin/registrations/requests.html b/views/admin/registrations/requests.html index 5e3a229..b2931a0 100644 --- a/views/admin/registrations/requests.html +++ b/views/admin/registrations/requests.html @@ -21,10 +21,10 @@ {if $haveRequests} {foreach $requests as $r} - {$r.id} - {$r.bill_fname} - {$r.bill_lname} - {$r.bill_org} + {$r.id} + {$r.bill_fname} + {$r.bill_lname} + {$r.bill_org} {$r.bill_city} {$r.bill_state} -- 2.17.1