From 323fd30fe6aa9c516950c667f98201ab623c8537 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Fri, 12 May 2017 11:29:35 -0400 Subject: [PATCH] Committing current development work --- classes/data/dataRegEvent.php | 8 ++--- classes/data/dataRegTime.php | 8 ++--- classes/registrationsSupport.php | 5 ++-- index.php | 2 +- models/admin/registrations/requests.php | 6 +--- setup/adminHooks.php | 15 ++++++++++ ..._V0.0.7.sql => create_database_V0.0.8.sql} | 6 ++-- setup/databaseScripts/dbVersions.php | 3 +- ...se_V0.0.7.sql => drop_database_V0.0.8.sql} | 0 .../update_database_V0.0.7.sql | 2 +- .../update_database_V0.0.8.sql | 30 +++++++++++++++++++ views/admin/registrations/editAccount.html | 8 ++--- views/admin/registrations/editRequest.html | 1 - 13 files changed, 67 insertions(+), 27 deletions(-) rename setup/databaseScripts/{create_database_V0.0.7.sql => create_database_V0.0.8.sql} (99%) rename setup/databaseScripts/{drop_database_V0.0.7.sql => drop_database_V0.0.8.sql} (100%) create mode 100644 setup/databaseScripts/update_database_V0.0.8.sql diff --git a/classes/data/dataRegEvent.php b/classes/data/dataRegEvent.php index b1c523b..03f05b6 100644 --- a/classes/data/dataRegEvent.php +++ b/classes/data/dataRegEvent.php @@ -216,10 +216,10 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract ), // Bitmap of payment methods available to users for this event - See payment_method in plugin.ini - 'payment_method' => array ( - 'field' => 'payment_method', + 'payment_methods' => array ( + 'field' => 'payment_methods', 'type' => 'bitmap', - 'bitmap' => $this->config['payment_methods'], + 'bitmap' => $this->config['payment_method'], 'default' => 0, // none selected 'use' => 'a' ), @@ -228,7 +228,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'restricted_payment_methods' => array ( 'field' => 'restricted_payment_methods', 'type' => 'bitmap', - 'bitmap' => $this->config['restricted_payment_methods'], + 'bitmap' => $this->config['payment_method'], 'default' => 0, // none selected 'use' => 'a' ), diff --git a/classes/data/dataRegTime.php b/classes/data/dataRegTime.php index 43cd0f3..0113596 100644 --- a/classes/data/dataRegTime.php +++ b/classes/data/dataRegTime.php @@ -100,7 +100,7 @@ class GlmDataRegistrationsRegTime extends GlmDataAbstract /* * Table Name */ - $this->table = GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event'; + $this->table = GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_time'; /* * Table Data Fields @@ -116,9 +116,9 @@ class GlmDataRegistrationsRegTime extends GlmDataAbstract 'use' => 'a' ), - // Pointer to event in Events add-on - 'event' => array ( - 'field' => 'event', + // Pointer to reg_event table entry + 'reg_event' => array ( + 'field' => 'reg_event', 'type' => 'integer', 'required' => true, 'use' => 'lgneud' diff --git a/classes/registrationsSupport.php b/classes/registrationsSupport.php index 71d0dc3..c78aff4 100644 --- a/classes/registrationsSupport.php +++ b/classes/registrationsSupport.php @@ -106,7 +106,7 @@ class GlmRegistrationsSupport { $RegEvent = new GlmDataRegistrationsRegEvent($this->wpdb, $this->config); - $RegTime = new GlmDataRegistrationsRegTime($this-->wpdb, $this->config); + $RegTime = new GlmDataRegistrationsRegTime($this->wpdb, $this->config); $RegRequest = new GlmDataRegistrationsRequest($this->wpdb, $this->config); $RequestEvent = new GlmDataRegistrationsRequestEvent($this->wpdb, $this->config); $RequestClass = new GlmDataRegistrationsRequestClass($this->wpdb, $this->config); @@ -187,7 +187,6 @@ class GlmRegistrationsSupport } // Each Class } - } // Each Event } @@ -330,7 +329,7 @@ class GlmRegistrationsSupport // Try to get the account record for the person who submitted (is submitting) the request $RegTime = new GlmDataRegistrationsRegTime($this->wpdb, $this->config); - $time = $Account->getEntry($timeId); + $time = $RegTime->getEntry($timeId); // If time was not found if (!$time) { diff --git a/index.php b/index.php index 405dcc1..d98a7a7 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.7'); +define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.8'); // 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 8ce01b3..307cc6b 100644 --- a/models/admin/registrations/requests.php +++ b/models/admin/registrations/requests.php @@ -161,9 +161,6 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRequest } -// Temporary debug info -//$cart_r = print_r($requestCart,1); - // Compile template data $templateData = array( 'haveRequests' => $haveRequests, @@ -171,8 +168,7 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRequest 'haveRequest' => $haveRequest, 'cart' => $requestCart, 'errorMsg' => $errorMsg, - - 'cart_r' => $cart_r + 'option' => $option ); // Return status, any suggested view, and any data to controller return array( diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 9805205..c2b0eaf 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -42,3 +42,18 @@ add_filter('glm-member-db-admin-management-hooksHelp', function($content) { 10, 2 ); + +// Add a filter to include a link to either create registrations for an event or to update that. +add_filter( + 'glm_members_add_link_to_event_list_entry', + function( $content, $eventId ){ + + // Check if there's an existing reg_event record for the supplied event ID. + require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php'; + + + return ''; + }, + 10, + 2 +); diff --git a/setup/databaseScripts/create_database_V0.0.7.sql b/setup/databaseScripts/create_database_V0.0.8.sql similarity index 99% rename from setup/databaseScripts/create_database_V0.0.7.sql rename to setup/databaseScripts/create_database_V0.0.8.sql index 5bb41af..2cce0b1 100644 --- a/setup/databaseScripts/create_database_V0.0.7.sql +++ b/setup/databaseScripts/create_database_V0.0.8.sql @@ -532,6 +532,7 @@ CREATE TABLE {prefix}reg_request_class ( account INT NULL, -- Pointer to account (person submitting the registration) reg_event INT NULL, -- Pointer to reg_event entry event_name TINYTEXT NULL, -- Name of Event so it will always be in the cart data + reg_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 reg_request INT NULL, -- Pointer to the registration request record reg_request_event INT NULL, -- Pointer to reg_request_event table entry @@ -556,9 +557,8 @@ CREATE TABLE {prefix}reg_request_rate ( account INT NULL, -- Pointer to account (person submitting the registration) reg_event INT NULL, -- Pointer to reg_event entry event_name TINYTEXT NULL, -- Name of Event so it will always be in the cart data - event_datetime DATETIME N // Add registrant account to accounts table - $this->addAccountToCart($registrant['account']); -ULL, -- Date and time of event time selected so it will always be in the cart + reg_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 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 diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index a86cd05..f454c41 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -20,7 +20,8 @@ $glmMembersRegistrationsDbVersions = array( '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'), - '0.0.7' => array('version' => '0.0.7', 'tables' => 19, 'date' => '04/07/2017') + '0.0.7' => array('version' => '0.0.7', 'tables' => 19, 'date' => '04/07/2017'), + '0.0.8' => array('version' => '0.0.8', 'tables' => 19, 'date' => '04/18/2017') ); diff --git a/setup/databaseScripts/drop_database_V0.0.7.sql b/setup/databaseScripts/drop_database_V0.0.8.sql similarity index 100% rename from setup/databaseScripts/drop_database_V0.0.7.sql rename to setup/databaseScripts/drop_database_V0.0.8.sql diff --git a/setup/databaseScripts/update_database_V0.0.7.sql b/setup/databaseScripts/update_database_V0.0.7.sql index fa17062..bedfc9a 100644 --- a/setup/databaseScripts/update_database_V0.0.7.sql +++ b/setup/databaseScripts/update_database_V0.0.7.sql @@ -6,7 +6,7 @@ -- 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 validated BOOLEAN; +ALTER TABLE {prefix}reg_request ADD COLUMN reg_time ; ---- diff --git a/setup/databaseScripts/update_database_V0.0.8.sql b/setup/databaseScripts/update_database_V0.0.8.sql new file mode 100644 index 0000000..54394bc --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.8.sql @@ -0,0 +1,30 @@ +-- Gaslight Media Members Database - Registratiuons Add-On +-- File Created: 08/30/16 09:47:15 +-- Database Version: 0.0.8 +-- 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_event ADD COLUMN reg_time INT; + +---- + +CREATE INDEX reg_time ON {prefix}reg_request_event (reg_time); + +---- + +ALTER TABLE {prefix}reg_request_class ADD COLUMN reg_time INT; + +---- + +CREATE INDEX reg_time ON {prefix}reg_request_class (reg_time); + +---- + +ALTER TABLE {prefix}reg_request_rate ADD COLUMN reg_time INT; + +---- + +CREATE INDEX reg_time ON {prefix}reg_request_rate (reg_time); + diff --git a/views/admin/registrations/editAccount.html b/views/admin/registrations/editAccount.html index f2d9c51..58f9a2d 100644 --- a/views/admin/registrations/editAccount.html +++ b/views/admin/registrations/editAccount.html @@ -78,7 +78,7 @@ - Information +

General Information

First Name @@ -176,7 +176,7 @@ - Billing Information +

Billing Information

First Name @@ -316,7 +316,7 @@ - Contact Information +

Contact Information

First Name @@ -438,7 +438,7 @@ - Emergency Contact Information +

Emergency Contact Information

diff --git a/views/admin/registrations/editRequest.html b/views/admin/registrations/editRequest.html index cddd5c7..3eeb609 100644 --- a/views/admin/registrations/editRequest.html +++ b/views/admin/registrations/editRequest.html @@ -2,7 +2,6 @@ {include file='admin/registrations/header.html'}
-

Return to Registration Requests List

Check Reguest & Update Holds

-- 2.17.1