From 413ce39a1b3f1d4d26d8708807060bda7297c39b Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 12 Jun 2018 17:10:21 -0400 Subject: [PATCH] Added manaement option for display of attendees list on event registration page and code to display that. --- classes/data/dataManagement.php | 8 ++++++++ index.php | 2 +- models/front/registrations/registration.php | 12 ++++++++++++ setup/databaseScripts/create_database_V1.0.0.sql | 3 ++- setup/databaseScripts/dbVersions.php | 3 ++- setup/databaseScripts/update_database_V1.0.1.sql | 13 +++++++++++++ views/admin/management/registrations.html | 6 ++++++ views/front/registrations/registration.html | 12 ++++++++++++ 8 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 setup/databaseScripts/update_database_V1.0.1.sql diff --git a/classes/data/dataManagement.php b/classes/data/dataManagement.php index b71dc4b..5bfbd5f 100644 --- a/classes/data/dataManagement.php +++ b/classes/data/dataManagement.php @@ -450,6 +450,14 @@ class GlmDataRegistrationsManagement extends GlmDataAbstract 'type' => 'checkbox', 'use' => 'a', 'default' => 0 + ), + + // Show registrants list on registration page + 'reg_show_attendees_on_reg_page' => array ( + 'field' => 'reg_show_attendees_on_reg_page', + 'type' => 'checkbox', + 'use' => 'a', + 'default' => 0 ) diff --git a/index.php b/index.php index 6876d28..554c73d 100644 --- a/index.php +++ b/index.php @@ -44,7 +44,7 @@ if (!defined('ABSPATH')) { * version from this plugin. */ define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '1.0.0'); -define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '1.0.0'); +define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '1.0.1'); // 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.27'); diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 573981e..01fecef 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -37,6 +37,7 @@ public function modelAction($actionData = false) { + // Clear the headers for wordpress. nocache_headers(); @@ -45,6 +46,7 @@ $cartId = false; $haveCart = false; $regEventFirstTime = false; + $registrantsList = false; // Get misc texts require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php'; @@ -343,6 +345,15 @@ } // - End loop through events. } + // If enabled, get list of registrants for this event + $registrantsList = false; + if ($this->config['settings']['reg_show_attendees_on_reg_page']) { + require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php'; + $RegRequestRegistrant = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config); + $registrantsList = $RegRequestRegistrant->getList("T.reg_event = $regEventId", "T.lname, T.fname"); + } + + // echo "
".print_r($registrantsList,1)."
"; // Compile template data $templateData = array( @@ -368,6 +379,7 @@ 'states_list' => $this->config['states'], 'country_list' => $this->config['countries'], 'pluginAssetsUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL, + 'registrantsList' => $registrantsList ); diff --git a/setup/databaseScripts/create_database_V1.0.0.sql b/setup/databaseScripts/create_database_V1.0.0.sql index 87ae381..06ae576 100644 --- a/setup/databaseScripts/create_database_V1.0.0.sql +++ b/setup/databaseScripts/create_database_V1.0.0.sql @@ -1,6 +1,6 @@ -- Gaslight Media Registration Database -- File Created: 01/18/2017 14:40:00 --- Database Version: 0.0.19 +-- Database Version: 1.0.1 -- Database Creation Script -- -- To permit each query below to be executed separately, @@ -111,6 +111,7 @@ CREATE TABLE {prefix}management ( reg_not_submitted_dialog BOOLEAN NULL, -- Flag to show page not submitted dialog boxes reg_medical_info BOOLEAN NULL, -- This site can ask for "Medical Info" - set in main category of an event reg_show_navigation_aids BOOLEAN NULL, -- No, not marine navigational aids, this enables additional text, arrows, etc to direct a user to do something specific that would not normally be required. + reg_show_attendees_on_reg_page BOOLEAN NULL, -- Flag to show a list of attendees on the registraitons page for an event PRIMARY KEY (id) ); diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 863ef9e..095118c 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -47,7 +47,8 @@ $glmMembersRegistrationsDbVersions = array( '0.0.31' => array('version' => '0.0.31', 'tables' => 18, 'date' => '05/15/2018'), '0.0.32' => array('version' => '0.0.32', 'tables' => 18, 'date' => '05/22/2018'), - '1.0.0' => array('version' => '1.0.0', 'tables' => 18, 'date' => '06/04/2018') + '1.0.0' => array('version' => '1.0.0', 'tables' => 18, 'date' => '06/04/2018'), + '1.0.1' => array('version' => '1.0.1', 'tables' => 18, 'date' => '06/12/2018') ); diff --git a/setup/databaseScripts/update_database_V1.0.1.sql b/setup/databaseScripts/update_database_V1.0.1.sql new file mode 100644 index 0000000..958a321 --- /dev/null +++ b/setup/databaseScripts/update_database_V1.0.1.sql @@ -0,0 +1,13 @@ +-- Gaslight Media Members Database - Registratiuons Add-On +-- File Updated: 2018-05-22 +-- Database Version: 1.0.1 +-- 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}management ADD COLUMN reg_show_attendees_on_reg_page BOOLEAN; + +---- + +UPDATE {prefix}management SET reg_show_attendees_on_reg_page = false; diff --git a/views/admin/management/registrations.html b/views/admin/management/registrations.html index c9067d5..7577ddc 100644 --- a/views/admin/management/registrations.html +++ b/views/admin/management/registrations.html @@ -334,6 +334,12 @@ + + Show Registrants list on Event Registration Page + + + +

Billing Information Fields

diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index 0ea3c75..181aa89 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -469,6 +469,18 @@
+ {if $registrantsList} +
+

Currrent List of Registrants for This Event

+
+ {foreach $registrantsList as $registrantAttending} + {if !$registrantAttending.not_attending.value && $registrantAttending.request_status_name == "Complete"} + {$registrantAttending.fname} {$registrantAttending.fname}
+ {/if} + {/foreach} +
+
+ {/if} {* Bootstrap the models needed on page load *} {* Need to have RegEvent model created *} -- 2.17.1