Added manaement option for display of attendees list on event registration page and...
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 12 Jun 2018 21:10:21 +0000 (17:10 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 12 Jun 2018 21:10:21 +0000 (17:10 -0400)
classes/data/dataManagement.php
index.php
models/front/registrations/registration.php
setup/databaseScripts/create_database_V1.0.0.sql
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V1.0.1.sql [new file with mode: 0644]
views/admin/management/registrations.html
views/front/registrations/registration.html

index b71dc4b..5bfbd5f 100644 (file)
@@ -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
             )
 
 
index 6876d28..554c73d 100644 (file)
--- 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');
index 573981e..01fecef 100644 (file)
@@ -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';
             } // - 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 "<pre>".print_r($registrantsList,1)."</pre>";
 
         // Compile template data
         $templateData = array(
             'states_list'       => $this->config['states'],
             'country_list'      => $this->config['countries'],
             'pluginAssetsUrl'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL,
+            'registrantsList'   => $registrantsList
         );
 
 
index 87ae381..06ae576 100644 (file)
@@ -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)
 );
 
index 863ef9e..095118c 100644 (file)
@@ -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 (file)
index 0000000..958a321
--- /dev/null
@@ -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;
index c9067d5..7577ddc 100644 (file)
                             <input type="checkbox" name="reg_not_submitted_dialog"{if $regSettings.fieldData.reg_not_submitted_dialog.value} checked="checked"{/if}>
                         </td>
                     </tr>
+                    <tr>
+                        <th>Show Registrants list on Event Registration Page</th>
+                        <td>
+                            <input type="checkbox" name="reg_show_attendees_on_reg_page"{if $regSettings.fieldData.reg_show_attendees_on_reg_page.value} checked="checked"{/if}>
+                        </td>
+                    </tr>
                     <tr>
                         <td></td>
                         <th><p>Billing Information Fields</p></th>
index 0ea3c75..181aa89 100644 (file)
         <div id="regApp" class="columns small-12">
         </div>
     </div>
+  {if $registrantsList}
+    <div>
+        <h3>Currrent List of Registrants for This Event</h3>
+        <div style="overflow-y: scroll; height:200px; width: 50%; border: 1px black solid; margin-bottom: 5px; padding: 5px;">  
+    {foreach $registrantsList as $registrantAttending}
+       {if !$registrantAttending.not_attending.value && $registrantAttending.request_status_name == "Complete"}
+            {$registrantAttending.fname} {$registrantAttending.fname}<br>
+       {/if}
+    {/foreach}
+        </div>
+    </div>
+  {/if}
 </div>
 {* Bootstrap the models needed on page load *}
 {* Need to have RegEvent model created *}