Various requested fixes and updates.
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 7 May 2018 19:31:33 +0000 (15:31 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 7 May 2018 19:31:33 +0000 (15:31 -0400)
Completed Attendee notifications and other minor fixes.
Fixed "Show Completed Only" on attendee list to work at all times and default to on.
Added request delete method to dataRegRequest that takes out related data
Added cron driven task to delete old reg requests and reg accounts
Better integration of notifications display to Evnet Registrations Dashboad
Added actual class ID pointer output in dataRegRequestRegistrant.php
Added custom field data for reg level to attendee edit
Changed registrant and account hold days to management fields.
Added "Not Attending" checkbox to atteendees list.
Added getRegTimeSimplified() to dataRegTime.php
Fixed Paging for Attendee list and added time selection to filter

40 files changed:
classes/data/dataManagement.php
classes/data/dataRegEvent.php
classes/data/dataRegRequest.php
classes/data/dataRegRequestRegistrant.php
classes/data/dataRegTime.php
classes/regCartSupport.php
config/plugin.ini
css/admin.css
defines.php
index.php
js/frontRegApp.js
js/views/front/regTime.js
models/admin/ajax/regAdmin/attendee.php
models/admin/registrations/events.php
models/admin/registrations/events_notificationDisplay.php [new file with mode: 0644]
models/admin/registrations/events_registrants.php
models/admin/registrations/purgeOld.php [new file with mode: 0644]
models/admin/registrations/requests.php
models/admin/registrations/sendNotifications.php
models/front/registrations/checkoutProcess.php
setup/adminHooks.php
setup/adminMenus.php
setup/databaseScripts/create_database_V0.0.28.sql [deleted file]
setup/databaseScripts/create_database_V0.0.29.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/drop_database_V0.0.28.sql [deleted file]
setup/databaseScripts/drop_database_V0.0.29.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.29.sql [new file with mode: 0644]
setup/validActions.php
views/admin/management/registrations.html
views/admin/registrations/accountsDashboard.html
views/admin/registrations/eventEdit.html
views/admin/registrations/eventEditLevels.html
views/admin/registrations/eventEditNotification.html
views/admin/registrations/eventNotifications.html
views/admin/registrations/eventRegistrants.html
views/admin/registrations/eventsDashboard.html
views/admin/registrations/notificationDisplay.html [new file with mode: 0644]
views/admin/registrations/requestDashboard.html
views/admin/registrations/requestsDashboard.html

index 78b87c3..33cb40d 100644 (file)
@@ -383,6 +383,22 @@ class GlmDataRegistrationsManagement extends GlmDataAbstract
                 'default'  => 0
             ),
 
+            // Registration Request Hold Days
+            'reg_request_hold_days' => array (
+                'field' => 'reg_request_hold_days',
+                'type' => 'integer',
+                'use' => 'a',
+                'default'  => 0
+            ),
+
+            // Registration Account Hold Days
+            'reg_account_hold_days' => array (
+                'field' => 'reg_account_hold_days',
+                'type' => 'integer',
+                'use' => 'a',
+                'default'  => 0
+            ),
+
             // Show additional navigation aids
             'reg_show_navigation_aids' => array (
                 'field' => 'reg_show_navigation_aids',
index 0469982..4b3caf9 100644 (file)
@@ -226,7 +226,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 // 'default'   => 60, See models/admin/registrations/events.php - Search for "Add event to registrations"
                 'use'       => 'a'
             ),
-
+/* No longer in use - Now using defined parameter
             // 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',
@@ -235,7 +235,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 // 'default'   => 10, See models/admin/registrations/events.php - Search for "Add event to registrations"
                 'use'       => 'a'
             ),
-
+*/
             // Number of hours before an event that is the latest a registration may be submitted.
             'reg_hours_before' => array (
                 'field'     => 'reg_hours_before',
index b7a508b..c5b3a56 100644 (file)
@@ -496,6 +496,185 @@ class GlmDataRegistrationsRegRequest extends GlmDataAbstract
 
     }
 
+    /**
+     * Delete a registration request
+     *
+     * This method does the following...
+     *  * Deletes any holds on registration slots associated with this request
+     *  * Restores inventory consumed by the registrants
+     *  * Deletes any registrants included in this request
+     *  * Deletes any rate selections included with this request
+     *  * Deletes any class selections included with this request
+     *  * Deletes any event selections included with this event
+     *  * Deletes any accounts that were ONLY associated with this request
+     *  * Deletes any use of payment codes in this request
+     *  * Deletes the specified registration request record
+     *
+     * @param integer $id ID of registration request to delete
+     *
+     * @return boolean false if no errors, otherwise an error message
+     */
+    public function deleteRegRequest($requestId = false)
+    {
+
+        // Check that the request ID is valid
+        if (!$requestId) {
+            return false;
+        }
+        $requestId = $requestId - 0;
+        if ($requestId <= 0) {
+            return false;
+        }
+        $request = $this->getEntry($requestId);
+        if (!$request) {
+            return false;
+        }
+
+        // Start a transaction
+        $this->wpdb->query('START TRANSACTION');
+
+        // For each registrant
+        $registrants = $this->wpdb->get_results("
+            SELECT id, account, reg_time
+              FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_registrant
+             WHERE reg_request = $requestId
+        ", ARRAY_A);
+
+        if (is_array($registrants) && count($registrants) > 0) {
+            foreach ($registrants as $registrant) {
+
+                // Delete holds in reg_time_pending for this registrant
+                if (false === $this->wpdb->get_results("
+                    DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time_pending
+                          WHERE registrant = ".$registrant['id']
+                )) {
+                    $err = $this->wpdb->last_error;
+                    $this->wpdb->query('ROLLBACK');
+                    return $err;
+                }
+
+                // If request was submitted and inventory updated, restore inventory
+                $submittedStatus = array( 10, 30, 50, 60, 70 );                             // See config/plugin.ini in registrations
+                if (in_array($request['status']['value'], $submittedStatus)) {
+
+                    $this->wpdb->query("
+                        UPDATE ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time
+                           SET attendee_count = attendee_count - 1,
+                               attendees_available = attendees_available + 1
+                         WHERE id = ".$registrant['reg_time']."
+                    ");
+                }
+
+                // If registrant's account is not referenced by any other registrants or requests
+                $registrantAccountCount = $this->wpdb->get_var("
+                    SELECT count(id)
+                      FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_registrant
+                     WHERE account = ".$registrant['account']."
+                ");
+
+                $requestAccountCount = $this->wpdb->get_var("
+                    SELECT count(id)
+                      FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request
+                     WHERE account = ".$registrant['account']."
+                ");
+
+                // If number of registrants with this account is 1 and there are no requests with this account, delete the account
+                if ($registrantAccountCount == 1 && $requestAccountCount == 0) {
+
+                    if (false === $this->wpdb->query("
+                        DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "account
+                              WHERE id = ".$registrant['account']
+                    )) {
+                        $err = $this->wpdb->last_error;
+                        $this->wpdb->query('ROLLBACK');
+                        return $err;
+                    }
+
+                }
+
+                // Delete this registrant
+                if (false === $this->wpdb->query("
+                        DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_registrant
+                              WHERE id = ".$registrant['id']
+                    )) {
+                        $err = $this->wpdb->last_error;
+                        $this->wpdb->query('ROLLBACK');
+                        return $err;
+                }
+            }
+        }
+
+        // Delete all registration request rate entries for this request
+        if (false === $this->wpdb->query("
+            DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_rate
+                  WHERE reg_request = $requestId"
+        )) {
+            $err = $this->wpdb->last_error;
+            $this->wpdb->query('ROLLBACK');
+            return $err;
+        }
+
+        // Delete all registration request class entries for this request
+        if (false === $this->wpdb->query("
+            DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_class
+                  WHERE reg_request = $requestId"
+        )) {
+            $err = $this->wpdb->last_error;
+            $this->wpdb->query('ROLLBACK');
+            return $err;
+        }
+
+        // Delete all registration request event entries for this request
+        if (false === $this->wpdb->query("
+            DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_event
+                  WHERE reg_request = $requestId"
+        )) {
+            $err = $this->wpdb->last_error;
+            $this->wpdb->query('ROLLBACK');
+            return $err;
+        }
+
+        // Check if account is not referenceed by any registrants or other requests
+        $registrantAccountCount = $this->wpdb->get_var("
+                    SELECT count(id)
+                      FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_registrant
+                     WHERE account = ".$request['account']."
+                ");
+        $requestAccountCount = $this->wpdb->get_var("
+                    SELECT count(id)
+                      FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request
+                     WHERE account = ".$request['account']."
+                ");
+
+        // If there's no other registrants and only 1 request with this account, we can delete it
+        if ($registrantAccountCount == 0 && $requestAccountCount == 1) {
+            if (false === $this->wpdb->query("
+                DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "account
+                      WHERE id = ".$request['account']
+            )) {
+                $err = $this->wpdb->last_error;
+                $this->wpdb->query('ROLLBACK');
+                return $err;
+            }
+        }
+
+        // Now delete the request
+        if (false === $this->wpdb->query("
+                DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request
+                      WHERE id = $requestId
+        ")) {
+                $err = $this->wpdb->last_error;
+                $this->wpdb->query('ROLLBACK');
+                return $err;
+        }
+
+        $this->wpdb->query('COMMIT');
+
+        return false;
+
+    }
+
+
 
 }
 
index faf296d..6eef86a 100644 (file)
@@ -219,8 +219,27 @@ class GlmDataRegistrationsRequestRegistrant extends GlmDataAbstract
                 'use'       => 'a'
             ),
 
+            // Not attending flag
+            'not_attending' => array (
+                'field'     => 'not_attending',
+                'type'      => 'checkbox',
+                'use'       => 'a'
+            ),
+
             // Additional quick data
 
+            // Class ID
+            'class_id' => array (
+                'field'     => 'reg_request_class',
+                'as'        => 'class_id',
+                'type'      => 'pointer',
+                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_class',
+                    'p_field'   => 'class',
+                    'p_static'  => true,
+                'required'  => true,
+                'use'       => 'lg'
+            ),
+
             // Class Name
             'class_name' => array (
                 'field'     => 'reg_request_class',
index 53c41a9..9b7cd2f 100644 (file)
@@ -255,6 +255,36 @@ class GlmDataRegistrationsRegTime extends GlmDataAbstract
 
     }
 
+
+    /*
+     * Get simplified data
+     *
+     * @param string $where Where clause to select time entries
+     * @param string $order Order by
+     *
+     * @return array Simplified list of times
+     *
+     */
+    public function getRegTimeSimplified($where = '', $order = false)
+    {
+
+        $savedFields = $this->fields;
+
+        $this->fields = array(
+            'id'                => $savedFields['id'],
+            'active'            => $savedFields['active'],
+            'reg_event'         => $savedFields['reg_event'],
+            'start_datetime'    => $savedFields['start_datetime'],
+            'end_datetime'      => $savedFields['end_datetime']
+        );
+
+        $res = $this->getList($where, $order);
+
+        $this->fields = $savedFields;
+
+        return $res;
+    }
+
 }
 
 ?>
\ No newline at end of file
index 94ea65a..7b3e3a5 100644 (file)
@@ -1287,25 +1287,16 @@ class GlmRegCartSupport
      */
     public function sendHtmlEmail( $to, $subject, $htmlMessage )
     {
-         // change the default wordpress from name when sending mail
-        add_filter(
-            'wp_mail_from_name',
-            function ( $name ) {
-                $siteName = get_bloginfo( 'name' );
-                return $siteName;
-            }
-        );
+
         // Send confirmation email, set the content type to allow html by using this filter
         add_filter( 'wp_mail_content_type', array( $this, 'set_content_type' ) );
 
         $message  = $htmlMessage;
-        $header[] = 'From:' . $this->config['settings']['reg_org_from_email'];
+        $header[] = 'From:' . $this->config['settings']['reg_org_namel'].' <'.$this->config['settings']['reg_org_from_email'].'>';
         $header[] = 'Reply-To:' . $this->config['settings']['reg_org_from_email'];
 
         wp_mail( $to, $subject, $message, $header );
 
-        // remove the filter to avoid conflicts
-        remove_filter( 'wp_mail_content_type', array( $this, 'set_content_type' ) );
     }
 
     /**
@@ -1324,7 +1315,7 @@ class GlmRegCartSupport
      *
      * This method also removes holds associated with this request.
      *
-     * The reason inventory update and notify are both in this method is that they both
+     * The reason inventory update and notify are both in this method is that they both *********************************************************************  FIX WHEN DONE TESTING
      * happen at the same time and they both require walking through the cart data.
      *
      * @param string $summary HTML Summary of checkout for sending to owner and requesting address
index 57ed5b7..0621b53 100644 (file)
@@ -198,16 +198,16 @@ billing_field_numb['FAX']                       = 12
 ;
 ; Submission Status - Use as list only
 ;
-submission_status[0]                            = 'CART'
-submission_status[10]                           = 'COMPLETE'
-submission_status[20]                           = 'UNPAID'
-submission_status[30]                           = 'CC_PEND'
-submission_status[40]                           = 'CC_DECL'
-submission_status[50]                           = 'PAYMENT_PEND'
-submission_status[60]                           = 'ON ARRIVAL'
-submission_status[70]                           = 'ADMIN HOLD'
-submission_status[80]                           = 'FAILED'
-submission_status[99]                           = 'CANCELED'
+submission_status[0]                            = 'In Cart'
+submission_status[10]                           = 'Complete'
+submission_status[20]                           = 'Unpaid'
+submission_status[30]                           = 'Card Pending'
+submission_status[40]                           = 'Card Declined'
+submission_status[50]                           = 'Payment Pending'
+submission_status[60]                           = 'On Arrival'
+submission_status[70]                           = 'Administrative Hold'
+submission_status[80]                           = 'Failed Submission'
+submission_status[99]                           = 'Canceled'
 
 submission_status_numb['CART']                  = 0
 submission_status_numb['COMPLETE']              = 10
index 3ad99e3..a61a14d 100644 (file)
@@ -54,6 +54,9 @@
     margin-top: 1em;
     margin-left: 2em;
 }
+.glm-reg-gray {
+    color: gray;
+}
 
 
 
index abd0fa5..b521cd8 100644 (file)
@@ -75,4 +75,4 @@ define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_LIB_PATH', GLM_MEMBERS_REGISTRATIONS_PL
 define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_UPDATE_SERVER', 'http://www.gaslightmedia.com/update_server');
 
 // Security Secret
-define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_SECRET', 'reGS3creTt!4THis');
\ No newline at end of file
+define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_SECRET', 'reGS3creTt!4THis');
index 0917906..e1d4db5 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', '0.0.1');
-define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.28');
+define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.29');
 
 // 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 7897b4c..ac1067b 100644 (file)
@@ -996,7 +996,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
             return;
         }
         if ( email === '' ) {
-            var confAnsw = confirm( 'You have no email address! Are you sure you want to add this registrant?' );
+            var confAnsw = confirm( 'You did not supply an Email address! Are you sure you want to add this registrant?' );
             if ( !confAnsw ) {
                 // Hide the loading graphic
                 this.$('#loading-' + this.model.get('id') ).hide();
index a96fc2c..c4e9392 100644 (file)
@@ -102,7 +102,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
             return;
         }
         if ( email === '' ) {
-            var confAnsw = confirm( 'You have no email address! Are you sure you want to add this registrant?' );
+            var confAnsw = confirm( 'You did not supply and Email address! Are you sure you want to add this registrant?' );
             if ( !confAnsw ) {
                 // Hide the loading graphic
                 this.$('#loading-' + this.model.get('id') ).hide();
index 7ce938e..8f587c4 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Gaslight Media Members Database
- * Admin Registrations AJAX processing for Rates
+ * Admin Registrations AJAX processing for updating registrant information
  *
  * PHP version 5.5
  *
@@ -14,9 +14,9 @@
  */
 
 // Load Registrations data abstract
-require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRate.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php';
 
-class GlmMembersAdmin_registrations_ajax_attendee // extends GlmDataRegistrationsRequestRegistrant
+class GlmMembersAdmin_registrations_ajax_attendee extends GlmDataRegistrationsRequestRegistrant
 {
 
     /**
@@ -74,7 +74,7 @@ class GlmMembersAdmin_registrations_ajax_attendee // extends GlmDataRegistration
          * Note, the third parameter is a flag that indicates to the Contacts
          * data class that it should flag a group of fields as 'view_only'.
          */
-        // parent::__construct(false, false, true);
+        parent::__construct(false, false, true);
 
     }
 
@@ -86,14 +86,67 @@ class GlmMembersAdmin_registrations_ajax_attendee // extends GlmDataRegistration
 
             case 'update':
 
+                // Get certain registrant data
+                $savedFields = $this->fields;
+                $this->fields = array();
+                $this->fields['id'] = $savedFields['id'];
+                $this->fields['not_attending'] = $savedFields['not_attending'];
+                $this->fields['reg_time'] = $savedFields['reg_time'];
+                $this->fields['reg_time_avail'] = array (
+                    'field'     => 'reg_time',
+                    'as'        => 'reg_time_avail',
+                    'type'      => 'pointer',
+                        'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_time',
+                        'p_field'   => 'attendees_available',
+                        'p_static'  => true,
+                    'use'       => 'g'
+                );
+
+                $registrantData = $this->getEntry($modelData['reg_id']);
+                $this->fields = $savedFields;
+
+                $notAttending = ($modelData['not_attending'] == 'true');
+                $notAvailable = false;
+
+                // If Not attending was not set and we're asking for it now then back-out inventory
+                if (!$registrantData['not_attending']['value'] && $notAttending) {
+                    $this->wpdb->query("
+                        UPDATE ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time
+                           SET attendee_count = attendee_count - 1,
+                               attendees_available = attendees_available + 1
+                         WHERE id = ".$registrantData['reg_time']."
+                    ");
+                }
+
+                // If Not attending was set and we're asking for attending then grab inventory (if possible)
+                if ($registrantData['not_attending']['value'] && !$notAttending) {
+                    if ($registrantData['reg_time_avail'] > 0) {
+                        $this->wpdb->query("
+                            UPDATE ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time
+                               SET attendee_count = attendee_count + 1,
+                                   attendees_available = attendees_available - 1
+                             WHERE id = ".$registrantData['reg_time']."
+                        ");
+                    } else {
+                        // Tell front-end that the inventory wasn't available
+                        $notAvailable = true;
+                        $notAttending = true;
+                    }
+                }
+
                 $this->wpdb->update(
                     GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_registrant',
                     array(
+                        'not_attending' => $notAttending,
                         'fname' => $modelData['fname'],
                         'lname' => $modelData['lname'],
                     ),
                     array( 'id' => $modelData['reg_id'] ),
-                    '%s',
+                    array(
+                        '%d',
+                        '%s',
+                        '%s'
+                    ),
                     array( '%d' )
                 );
 
@@ -101,9 +154,12 @@ class GlmMembersAdmin_registrations_ajax_attendee // extends GlmDataRegistration
                     'id'    => $modelData['reg_id'],
                     'fname' => $modelData['fname'],
                     'lname' => $modelData['lname'],
+                    'notAttending' => $notAttending,
+                    'notAvailable' => $notAvailable
                 );
 
                 parse_str( $modelData['formData'], $queryParams );
+
                 // Store the custom field data
                 $_REQUEST = $queryParams;
 
@@ -111,7 +167,16 @@ class GlmMembersAdmin_registrations_ajax_attendee // extends GlmDataRegistration
                 apply_filters(
                     'glm-members-customfields-form-submit',
                     '',
-                    'glm_reg_customfields_reg_event_attendee_' . $modelData['reg_event_id'],
+                    'glm_reg_customfields_reg_event_attendee_'.$modelData['reg_event_id'],
+                    $modelData['reg_id'],
+                    true
+                );
+
+                // Save the custom field data if custom fields plugin is on
+                apply_filters(
+                    'glm-members-customfields-form-submit',
+                    '',
+                    'glm_reg_customfields_reg_event_'.$modelData['reg_event_id'].'_level_'.$modelData['reg_class_id'],
                     $modelData['reg_id'],
                     true
                 );
index 32caa79..c39648f 100644 (file)
@@ -125,11 +125,13 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
         $classes                   = false;
         $haveRegistrants           = false;
         $registrants               = false;
-        $completed                 = false;
+        $completed                 = true;
         $errorMsg                  = false;
         $newEntry                  = false;
         $when                      = false;
-
+        $haveTimes                 = false;
+        $times                     = false;
+        $notifications             = '';
 
         // Register the masked input script that we need for input controls
         wp_dequeue_script('glm-members-admin-maskedinput');
@@ -237,7 +239,11 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
             'completed'               => $completed,
             'errorMsg'                => $errorMsg,
             'newEntry'                => $newEntry,
-            'when'                    => $when
+            'when'                    => $when,
+            'haveTimes'               => $haveTimes,
+            'times'                   => $times,
+            'selectedTime'            => $selectedTime,
+            'notifications'           => $notifications
         );
 
         // echo "<pre>".print_r($templateData,1)."</pre>";
diff --git a/models/admin/registrations/events_notificationDisplay.php b/models/admin/registrations/events_notificationDisplay.php
new file mode 100644 (file)
index 0000000..51e4f4f
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Registrations Events Display Notifications for Today
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  events_dashboard.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH.'/models/admin/registrations/sendNotifications.php';
+$SendNotifications = new GlmMembersAdmin_registrations_sendNotifications($this->wpdb, $this->config);
+$notifications = $SendNotifications->modelAction(false, true);
+
+$view = 'notificationDisplay';
index 58c03d6..41f5d06 100644 (file)
@@ -13,6 +13,7 @@
  * @link     http://dev.gaslightmedia.com/
  */
 
+
 $whereParts = array();
 
 if (isset($_REQUEST['textSearch']) && trim($_REQUEST['textSearch'] != '')) {
@@ -29,13 +30,43 @@ $Registrants = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->con
 // Get the regEvent data
 $regEvent = $this->getEntry($regEventID);
 
-// Filter for complete if given
-if ( isset( $_REQUEST['complete'] ) && filter_var( $_REQUEST['complete'], FILTER_VALIDATE_BOOLEAN) ) {
-    $completed = true;
-    $whereParts[] = "T.reg_request in (
-                    SELECT id
-                      FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX .  "reg_request
-                     WHERE status = {$this->config['submission_status_numb']['COMPLETE']})";
+// If time / date specific event, get all times for time selection picklist
+if ($regEvent['time_specific']['value']) {
+    require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegTime.php';
+    $Times = new GlmDataRegistrationsRegTime($this->wpdb, $this->config);
+    $times = $Times->getRegTimeSimplified("T.reg_event = $regEventID", 'start_datetime');
+
+    if (is_array($times) && count($times) > 0) {
+        $haveTimes = true;
+    }
+}
+
+// Filter for specific time
+if (isset($_REQUEST['time'])) {
+    $selectedTime = filter_var( $_REQUEST['time'], FILTER_VALIDATE_INT);
+}
+if ($selectedTime) {
+    $whereParts[] = "T.reg_time = $selectedTime";
+}
+
+// Filter for not being in status CART
+if (isset($_REQUEST['limit'])) {
+    $completed = filter_var( $_REQUEST['complete'], FILTER_VALIDATE_BOOLEAN);
+}
+if ($completed) {
+    $whereParts[] = "
+        (
+        SELECT count(id)
+          FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX .  "reg_request
+         WHERE id = T.reg_request
+           AND status NOT IN
+                (
+                {$this->config['submission_status_numb']['CART']},
+                {$this->config['submission_status_numb']['FAILED']},
+                {$this->config['submission_status_numb']['CANCELED']}
+                )
+        ) > 0
+    ";
 }
 
 // Get list of all registrants for this event
@@ -58,11 +89,11 @@ if ( isset( $_REQUEST['pageSelect'] ) ) {
     }
 }
 
+// Check if custom fields add-on is active
 $customFieldsPluginActive = apply_filters( 'glm-members-customfields-plugin-active', false );
 
+// Get all of the registrant data
 $listResult = $Registrants->getFullRegistrantsData($regEventID, $where, $start, $limit);
-// echo '<pre>$listResult: ' . print_r( $listResult['list'], true ) . '</pre>';
-
 
 // Get count of registrants listed
 $registrantCount = $listResult['totalCount'];
diff --git a/models/admin/registrations/purgeOld.php b/models/admin/registrations/purgeOld.php
new file mode 100644 (file)
index 0000000..2aea25a
--- /dev/null
@@ -0,0 +1,164 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Registrations - Purge any Old Data - Called by GLM Cron via adminHooks.php
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+// Load Registrations Request Data Class
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php';
+
+class GlmMembersAdmin_registrations_purgeOld extends GlmDataRegistrationsRegRequest
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        /*
+         * Run constructor for the Registrations data class
+         *
+         * Note, the third parameter is a flag that indicates to the Contacts
+         * data class that it should flag a group of fields as 'view_only'.
+         */
+        parent::__construct(false, false, true);
+
+    }
+
+    public function modelAction($actionData = false)
+    {
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+            trigger_error('Registrations Purge Old Called', E_USER_NOTICE);
+        }
+
+        /*
+         * Purge old registration requests
+         *
+         * - Must be in status CART (never checked out)
+         * - Must not have been updated in "REQUEST HOLD DAYS"
+         *
+         */
+
+        // Calculate date earlier than which requests in CART status are purged
+        $requestPurgeDate = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s').' - '.$this->config['settings']['reg_request_hold_days'].' days'));
+
+
+        // Get all request IDs where status is CART and Updated is older thad cart_holddays in reg_event
+        $oldRequests = $this->wpdb->get_results("
+            SELECT id
+              FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request
+             WHERE status = ".$this->config['submission_status_numb']['CART']."
+               AND last_update < '$requestPurgeDate'
+        ", ARRAY_A);
+
+        // Purge these old requests
+        $requestsPurged = 0;
+        if (is_array($oldRequests) && count($oldRequests)> 0) {
+            foreach ($oldRequests as $request) {
+                $this->deleteRegRequest($request['id']);
+                $purged++;
+            }
+        }
+
+        /*
+         * Purge old accounts that are not in use
+         *
+         * - Must be accounts that have not been validated
+         * - Must not have any reg_request or registrant referring to the account
+         * - Must have been created earlier than "ACCOUNT HOLD DAYS"
+         */
+
+        // Calculate date earlier than create date for accounts that aren't in use
+        $accountPurgeDate = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s').' - '.$this->config['settings']['reg_account_hold_days'].' days'));
+
+        // Get accounts to purge
+        $oldAccounts = $this->wpdb->get_col("
+            SELECT A.id
+              FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "account A
+             WHERE ( A.validated IS NOT true )
+               AND A.date_created < '$accountPurgeDate'
+               AND (
+                    SELECT count(R.id)
+                      FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request R
+                     WHERE R.account = A.id
+                    ) = 0
+               AND (
+                    SELECT count(R.id)
+                      FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_registrant R
+                     WHERE R.account = A.id
+                    ) = 0
+        ");
+
+        // Purge these old Accounts
+        $oldAccountsIds = implode(',', $oldAccounts);
+        $accountsPurged = 0;
+        if ($oldAccountsIds != '') {
+            $this->wpdb->query("
+                DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "account
+                 WHERE id in($oldAccountsIds)
+            ");
+            $accountsPurged = count($oldAccounts);
+        }
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+            trigger_error("Registrations Purge Old: Requests =  $requestsPurged, Accounts = $accountsPurged", E_USER_NOTICE);
+        }
+
+        wp_die();
+    }
+
+}
index 4bc1f75..07d83b2 100644 (file)
@@ -89,6 +89,10 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
         $haveCart       = false;
         $option         = 'dashboard';
         $errorMsg       = false;
+        $showCartRequests = false;
+        $where          = '';
+        $deleted        = false;
+        $messages       = array();
 
         // Load registrations support class
         require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/regCartSupport.php';
@@ -101,16 +105,6 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
             '1.0'
         );
 
-
-
-        /* Test data */
-
-        /* Uncomment to create one complete sample registration request each time this action is called */
-        //  $regCartSupport->addTestData();
-
-        /* Uncomment to remove all registration data - *** WARNING - REMOVES ALL REQUEST DATA - NOT JUST TEST DATA *** */
-        //  $regCartSupport->removeRegistrationRequestData();
-
         // Check for option submitted
         if (isset($_REQUEST['option']) && $_REQUEST['option'] != '') {
             $option = $_REQUEST['option'];
@@ -149,6 +143,24 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
 
                 $cart = $regCartSupport->getRegistrationCart($requestID);
 
+                // If this is a delete request
+                if (isset($_REQUEST['delete']) && $_REQUEST['delete'] = 'true') {
+
+                    // Delete the entire request
+                    require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php';
+                    $RegRequest = new GlmDataRegistrationsRegRequest($this->wpdb, $this->config);
+                    $result = $RegRequest->deleteRegRequest($requestID);
+
+                    // If there's an error (not false return), add what's returned to the messages array
+                    if ($result !== false) {
+                        $messages[] = $result;
+                    } else {
+                        $deleted = true;
+                    }
+
+                }
+
+
                 if ($cart) {
                     $haveCart = true;
                 }
@@ -187,8 +199,16 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
             case 'dashboard':
             default:
 
+                // If this is a search form submission or paging button
+                if (isset($_REQUEST['limit'])) {
+                    $showCartRequests = filter_var( $_REQUEST['showCartRequests'], FILTER_VALIDATE_BOOLEAN);
+                }
+                if (!$showCartRequests) {
+                    $where = "T.status != {$this->config['submission_status_numb']['CART']}";
+                }
+
                 // Get list of requests
-                $requests = $this->getList();
+                $requests = $this->getList($where);
                 if ($requests) {
                     $haveRequests = true;
                 }
@@ -216,6 +236,9 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
             'haveCart'      => $haveCart,
             'errorMsg'      => $errorMsg,
             'option'        => $option,
+            'deleted'       => $deleted,
+            'showCartRequests' => $showCartRequests,
+            'messages'      => $messages,
             'regUrl'        => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/'
         );
              // Return status, any suggested view, and any data to controller
index 8c90131..4b13642 100644 (file)
@@ -33,13 +33,6 @@ class GlmMembersAdmin_registrations_sendNotifications extends GlmDataRegistratio
      * @access public
      */
     public $config;
-    /**
-     * Registrations Event ID
-     *
-     * @var $eventID
-     * @access public
-     */
-    public $accountID = false;
 
     /**
      * Constructor
@@ -85,13 +78,19 @@ class GlmMembersAdmin_registrations_sendNotifications extends GlmDataRegistratio
 
     }
 
-    public function modelAction($actionData = false)
+    // $notiicationTest to true to just display notification messages
+    public function modelAction($actionData = false, $notificationTest = false)
     {
+        if ($notificationTest) {
+            $notificationsOutput = '';
+        }
 
         if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
             trigger_error('Registrations Notifications Called', E_USER_NOTICE);
         }
 
+        $fromAddress = $this->config['settings']['reg_org_name'].' <'.$this->config['settings']['reg_org_from_email'].'>';
+
         // Get list of notifications for all active events
         $notifications = $this->wpdb->get_results(
             "
@@ -112,7 +111,8 @@ class GlmMembersAdmin_registrations_sendNotifications extends GlmDataRegistratio
         // If there's notifications
         if ($notifications and is_array($notifications) && count($notifications) > 0) {
 
-            $event = false;
+            $processed  = 0;
+            $noEmail    = 0;
 
             // For each notification
             foreach ($notifications as $notification) {
@@ -148,17 +148,19 @@ class GlmMembersAdmin_registrations_sendNotifications extends GlmDataRegistratio
                 }
 
                 $sql = "
-                    SELECT A.fname, A.lname, A.email, E.event_name, E.first_Datetime, E.last_datetime, E.descr,
-                           T.non_time_specific, T.start_datetime, T.end_datetime
+                    SELECT A.fname, A.lname, A.email, E.event_name, E.first_datetime, E.last_datetime, E.descr,
+                           T.non_time_specific, T.start_datetime, T.end_datetime, C.class_name
                       FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request_registrant R,
                            ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request Q,
                            ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."account A,
                            ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_time T,
-                           ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_event E
+                           ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_event E,
+                           ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request_class C
                      WHERE A.id = R.account
                        AND Q.id = R.reg_request
                        AND Q.status = ".$this->config['submission_status_numb']['COMPLETE']."
                        AND T.id = R.reg_time
+                       AND C.id = R.reg_request_class
                        AND E.id = R.reg_event
                        AND E.active
                        AND E.id = ".$notification['reg_event']."
@@ -168,23 +170,81 @@ class GlmMembersAdmin_registrations_sendNotifications extends GlmDataRegistratio
                 ";
                 $attendees = $this->wpdb->get_results($sql, ARRAY_A);
 
-echo "<pre>".print_r($attendees, 1)."</pre>";
-
                 // If there's any attendess to contact, process each
                 if (is_array($attendees) && count($attendees) > 0) {
                     foreach ($attendees as $attendee) {
 
-                        echo "E-Mail for ".$attendee['fname']."<br>";
-
-
+                        // Only process attendees with valid E-Mail addresses
+                        $email = filter_var($attendee['email'], FILTER_VALIDATE_EMAIL);
+                        if ($email) {
+
+                            // Get correct event date & time
+                            if ($attendee['non_time_specific']) {
+
+                                // Non date-time specific event
+                                $date = date('m/d/Y', strtotime($attendee['first_datetime']));
+                                $endDate = date('m/d/Y', strtotime($attendee['last_datetime']));
+                                if ($date != $endDate) {
+                                    $date .= " through $endDate";
+                                }
+                                $time = 'any time during the event';
+
+                            } else {
+
+                                // Date-time specific event
+                                $date = date('m/d/Y', strtotime($attendee['start_datetime']));
+                                $endDate = date('m/d/Y', strtotime($attendee['end_datetime']));
+                                if ($date != $endDate) {
+                                    $date .= ' through '.date('m/d/Y', strtotime($attendee['last_datetime']));
+                                }
+                                $time = date('h:i A', strtotime($attendee['start_datetime']));
+                                $endTime = date('h:i A', strtotime($attendee['end_datetime']));
+                                if ($time != $endTime) {
+                                    $time .= " to $endTime";
+                                }
+
+                            }
+
+                            $viewData = array(
+                                'event_name'        => stripslashes($attendee['event_name']),
+                                'first_name'        => stripslashes($attendee['fname']),
+                                'last_name'         => stripslashes($attendee['lname']),
+                                'level'             => stripslashes($attendee['class_name']),
+                                'event_date'        => $date,
+                                'event_time'        => $time,
+                                'from_name'         => stripslashes($this->config['settings']['reg_org_name']),
+                                'from_short_name'   => stripslashes($this->config['settings']['reg_org_short']),
+                                'from_address'      => stripslashes($this->config['settings']['reg_org_address']),
+                                'from_city'         => stripslashes($this->config['settings']['reg_org_city']),
+                                'from_state'        => stripslashes($this->config['settings']['reg_org_state']),
+                                'from_zip'          => $this->config['settings']['reg_org_zip'],
+                                'from_phone'        => $this->config['settings']['reg_org_phone'],
+                                'from_email'        => $this->config['settings']['reg_org_from_email']
+                            );
+
+                            // Send notification
+                            $subjectLine = $this->generateHTML($viewData, stripslashes($notification['name']), true);
+                            $emailMsg = $this->generateHTML($viewData, nl2br(stripslashes($notification['message'])), true);
+
+                            // If admin debug is on, display the messages rather than send them.
+                            if ($notificationTest) {
+                                $notificationsOutput = $this->displayEmailforTesting('Attendee Notification', $fromAddress, $email, $subjectLine, $emailMsg);
+                            } else {
+                                $this->sendHtmlEmail($fromAddress, $email, $subjectLine, $emailMsg);
+                            }
+
+                            $processed++;
+
+                        } else {
+                            $noEmail++;
+                        }
                     }
                 }
-
-
-
             }
+        }
 
-
+        if ($notificationTest) {
+            return $notificationsOutput;
         }
 
         // This model does not return any data
@@ -197,5 +257,142 @@ echo "<pre>".print_r($attendees, 1)."</pre>";
 
     }
 
+    /**
+     * sendHtmlEmail
+     *
+     * Create html email and send using wp_mail.
+     *
+     * @param mixed $to          To email address
+     * @param mixed $subject     Subject line for the email
+     * @param mixed $htmlMessage Html message for the email
+     *
+     * @access public
+     * @return void
+     */
+    public function sendHtmlEmail($from, $to, $subject, $htmlMessage)
+    {
+
+        // Send confirmation email, set the content type to allow html by using this filter
+        add_filter( 'wp_mail_content_type', array( $this, 'set_content_type' ) );
+
+
+        $message  = $htmlMessage;
+        $header[] = 'From:' . $fromAddress;
+        $header[] = 'Reply-To:' . $this->config['settings']['reg_org_from_email'];
+
+        wp_mail( $to, $subject, $message, $header );
+
+    }
+
+    /**
+     * Output an E-Mail message to screen for testing
+     *
+     * @param $whatMsg string What message is being sent
+     * @param $to string To Address
+     * @param $subject string Subject Line
+     * @param $msg string Message body
+     *
+     * @return void
+     *
+     */
+    function displayEmailforTesting($whatMsg, $from, $to, $subject, $msg)
+    {
+
+        return '
+            <div style="border: 1px solid black; padding: 10px; margin: 10px;">
+                <table>
+                    <tr><th>E-Mail Message:</th><td>'.$whatMsg.'</td></tr>
+                    <tr><td>From:</td><td>'.htmlentities($from).'</td></tr>
+                    <tr><td>To:</td><td>'.$to.'</td></tr>
+                    <tr><td>Subject:</td><td>'.$subject.'</td></tr>
+                    <tr><td valign="top">Body:</td><td>'.$msg.'</td></tr>
+                </table>
+            </div>
+        ';
+
+    }
+
+
+    /**
+     * Merge template and data to produce HTML
+     *
+     * Checks the theme's view directories and the view directories for
+     * this plugin for a matching view file.
+     *
+     * Note that $view needs to have the proper view directory path
+     * includes. (i.e. "/views/front/registrations/summary.html")
+     *
+     * $view may also be a template as a string if $viewIsString is true.
+     *
+     * @param $data array Array of data to merge with the template
+     * @param $view string Name of view file (see above))
+     * @param $viewIsString boolean If true, $view is a string containing the view.
+     *
+     * @access public
+     * @return void
+     */
+    function generateHTML($data, $view, $viewIsString = false)
+    {
+
+        // Load Smarty Template support
+        $smarty = new smartyTemplateSupport();
+
+        // Add standard parameters
+        require GLM_MEMBERS_PLUGIN_SETUP_PATH.'/standardTemplateParams.php';
+
+        // Add data from model to Smarty template
+        if (is_array($data) && count($data) > 0) {
+            foreach ($data as $k => $d) {
+                $smarty->templateAssign($k, $d);
+            }
+        }
+
+
+        // If is supplied as a string
+        if ($viewIsString) {
+
+            $out = $smarty->template->fetch('eval:'.$view);
+
+            // Otherwise $view is a file name
+        } else {
+
+            // Get the specified view file - check theme first
+            $viewPath = GLM_MEMBERS_PLUGIN_CURRENT_THEME_DIR."/views";
+            $viewPath2 = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH . "views";       // Save default
+
+            // If the view is not found in the theme, fall back to views in the plugin
+            if (!is_file($viewPath.'/'.$view)) {
+
+                // Next try the plugin/add-on
+                $viewPath = GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH . "/views";
+
+                if (!is_file($viewPath.'/'.$view)) {
+
+                    if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+                        trigger_error("Bad or missing view file when generating checkout HTML: $viewPath/$view", E_USER_NOTICE);
+                    }
+
+                }
+
+            }
+
+            // Update the Smarty view path
+            $smarty->template->setTemplateDir($viewPath);
+
+            // If the view path doesn't match the default, add the default (using theme view)
+            if ($viewPath2 != $viewPath) {
+                $smarty->template->addTemplateDir($viewPath2);
+            }
+
+            // Generate output from model data and view
+            $out = $smarty->template->fetch($view);
+
+        }
+
+        return $out;
+
+    }
+
+
 
 }
index 9b1601e..7fb2e45 100644 (file)
@@ -137,7 +137,7 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
         }
 
         // Check if cart has been successfully checked out or has been marked canceled.
-        if ($this->cart['request']['status']['name'] != 'CART') {
+        if ($this->cart['request']['status']['value'] != $this->config['submission_status_numb']['CART']) {
 
             $messages[] = "This request has already been submitted!<br>The information below is a summary of your submitted request.";
 
@@ -577,10 +577,6 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
 
         $now = date('Y-m-d H:i:s', time());
 
-        // Account ID
-        $reqData['account'] = $accountId;
-        $reqFormat[] = '%d';
-
         // Add billing data to requesst update arrays
         $reqData = array_merge(
             $reqData,
@@ -596,7 +592,7 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
                 'bill_zip'     => $billing['zip'],
                 'bill_country' => $billing['country'],
                 'bill_phone'   => $billing['phone'],
-                'bill_phone'   => $regAccount['fieldData']['email']
+                'bill_email'   => $regAccount['fieldData']['email']
             )
         );
         $reqFormat = array_merge(
@@ -620,52 +616,50 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
         // Check if request to do a test checkout only - Don't clear session or update inventory
         $doNotClear = $_REQUEST['bill_addr2'] == '*** GLM DO NOT CLEAR ***';
 
+        // User Trace data
+        $trace = array(
+            'DateTime'  => date('r'),
+            'UserAddr'  => $_SERVER['REMOTE_ADDR'],         // IP address of user's computer
+            'URI'       => $_SERVER['REQUEST_URI'],         // URI submitted to checkout
+            'UserAgent' => $_SERVER['HTTP_USER_AGENT'],     // User's browser user agent string
+            'Referrer'  => $_SERVER['HTTP_REFERER'],        // Page user came from, should be our checkout page
+            'Method'    => $_SERVER['REQUEST_METHOD']       // Request method: GET, POST, ...
+        );
+
         // Save date, pay method, status, total
         if (count($messages) == '' && !$doNotClear) {
 
             $reqData = array_merge(
                 $reqData,
                 array(
+                    'account'         => $accountId,
                     'date_submitted'  => $now,
+                    'last_update'     => $now,
                     'pay_method'      => $payMethod,
                     'status'          => $cartStatus,
                     'total'           => $this->cart['totalCharges'],
                     'total_discounts' => $this->cart['totalDiscounts'],
-                    'registrants'     => $this->cart['totalRegistrants']
+                    'registrants'     => $this->cart['totalRegistrants'],
+                    'user_trace_info' => serialize($trace)
                 )
             );
             $reqFormat = array_merge(
                 $reqFormat,
                 array(
+                    '%d',
+                    '%s',
                     '%s',
                     '%d',
                     '%d',
                     '%f',
                     '%f',
-                    '%d'
+                    '%d',
+                    '%s'
                 )
             );
 
         }
 
-        // Last update time
-        $reqData['last_update'] = $now;
-        $reqFormat[]            = '%s';
-
-        // User Trace data
-        $trace = array(
-            'DateTime'  => date('r'),
-            'UserAddr'  => $_SERVER['REMOTE_ADDR'],         // IP address of user's computer
-            'URI'       => $_SERVER['REQUEST_URI'],         // URI submitted to checkout
-            'UserAgent' => $_SERVER['HTTP_USER_AGENT'],     // User's browser user agent string
-            'Referrer'  => $_SERVER['HTTP_REFERER'],        // Page user came from, should be our checkout page
-            'Method'    => $_SERVER['REQUEST_METHOD']       // Request method: GET, POST, ...
-        );
-        $reqData['user_trace_info'] = serialize($trace);
-        $reqFormat[]                = '%s';
-
-        $reqFormat[] = '%s';
-
         // Store the data
         $updated = $this->wpdb->update(
             GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX.'reg_request',
index 170a2e4..6b97106 100644 (file)
@@ -110,7 +110,16 @@ add_filter('glm_associate_cron_request', function($request) {
             'menu'      => 'registrations',         // Menu where action exists
             'action'    => 'sendNotifications',     // Name of action to run
             'daysOfWeek'=> false,                   // All Days
-            'times'     => false, //array(3),                // 3 AM   *********************************************************************  FIX WHEN DONE TESTING
+            'times'     => array(3),                // 3 AM (actually 3:30 since the GLM Associate cron runs on the half-hour)
+            'params'    => false                    // Any parameters needed by the triggered action
+        );
+
+        // Purge Old Data
+        $request[] = array(
+            'menu'      => 'registrations',         // Menu where action exists
+            'action'    => 'purgeOld',              // Name of action to run
+            'daysOfWeek'=> false,                   // All Days
+            'times'     => array(4),                // 4 AM (actually 4:30 since the GLM Associate cron runs on the half-hour)
             'params'    => false                    // Any parameters needed by the triggered action
         );
 
index d0fa0a3..b7e7f34 100644 (file)
@@ -83,6 +83,7 @@ add_submenu_page(
     'glm-members-admin-menu-registrations-accounts',
     function() {$this->controller('registrations', 'accounts');}
 );
+/*
 add_submenu_page(
     'glm-members-admin-menu-members',
     $this->config['terms']['reg_term_registration_cap'].' Reports',
@@ -91,3 +92,4 @@ add_submenu_page(
     'glm-members-admin-menu-registrations-reports',
     function() {$this->controller('registrations', 'reports');}
     );
+*/
\ No newline at end of file
diff --git a/setup/databaseScripts/create_database_V0.0.28.sql b/setup/databaseScripts/create_database_V0.0.28.sql
deleted file mode 100644 (file)
index 182d710..0000000
+++ /dev/null
@@ -1,791 +0,0 @@
--- Gaslight Media Registration Database
--- File Created: 01/18/2017 14:40:00
--- Database Version: 0.0.19
--- Database Creation Script
---
--- To permit each query below to be executed separately,
--- all queries must be separated by a line with four dashes
---
-/*
- * General Database Organization
- * -----------------------------
- *
- * management - General options and configuration - Site manager access only
- *
- * misc - Misc settings and text - Site owner may update
- *
- * payment codes - Promotional payment codes - Used with various things
- *      --> 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)
- *
- * reg_account - Describes someone who submits / pays for a registration
- * Make these two things the same table....
- * registrant - A person who is registered for an event
- *
- * reg_request - Information on a specific request for registrations
- *      reg_request_event - Event selected (one or more)
- *          reg_request_class - Class of registration (one or more)
- *              reg_request_rate - Specific registration date/rate (one or more)
- *                  reg_request_registrant - Registrant (one or more)
- *
- * NOTE: additional fields and added fields data will be coming from the Custom Fields add-on
- *
- * Overall Flow
- * ------------
- *
- * User selects an event
- * If the event has available registrations
- *  User selects a date for the registration (or if only one that's selected automatically)
- *    User can log back into registrations at this point if they've been there before and have a password, create an ccount, or continue as guest ???
- *      User selects an available rate type and adds one or more registrants for that rate type
- *      User may loop back to select additional rate type(s) and registrants
- *    User may go back to date selection and request additional rate types and registrants for the addional dates
- *  User may go back to select additional dates and do registrations for those dates as above
- * User may go back to select other events and do registrations for them as above
- * User may select the "Cart" and deselect something added to it
- * User may checkout
- *
- */
-
-/*
- * NOTE: Anything below here may not be completed or accurate yet. I'm still working though this
- * Lines commented out are selected for possible deletion.
- * The INSERT statements are not up-to-date with the tables.
- * The "config/plugin.ini" file in this plugin is also a work in progress.
- */
-
--- Management Options
--- General configurationm parameters for the Registrations application
--- Only one entry in this table!
-CREATE TABLE {prefix}management (
-    id INT NOT NULL AUTO_INCREMENT,
-    canonical_reg_page TINYTEXT NULL,                              -- Canonical page slug for registrations
-    -- System Owner Information
-    reg_org_name TINYTEXT NULL,                                     -- Customer Information - Name of Organization
-    reg_org_short TINYTEXT NULL,
-    reg_org_address TINYTEXT NULL,
-    reg_org_city TINYTEXT NULL,
-    reg_org_state TINYTEXT NULL,
-    reg_org_zip TINYTEXT NULL,
-    reg_org_phone TINYTEXT NULL,
-    reg_org_toll_free TINYTEXT NULL,
-    reg_org_internal_email TINYTEXT NULL,
-    reg_org_from_email TINYTEXT NULL,
-    reg_payment_methods SMALLINT NULL,                              -- Payment methods available for all registrations - Bitmap - see payment_method in plugin.ini
-    reg_proc_methods SMALLINT NULL,                                 -- Credit Cart payment processing methods available - Bitmap - see proc_method in plugin.ini
-    reg_cc_accepts SMALLINT NULL,                                   -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
-    -- Authorize.net Credentials
-    reg_authorize_net_login TINYTEXT NULL,
-    reg_authorize_net_key TINYTEXT NULL,
-    reg_authorize_net_test TINYINT NULL,                            -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
-    reg_authorize_net_conf BOOLEAN NULL,                            -- Flag to send payment confirmation Email from Authorize.net
-    reg_authorize_net_merchant_email TINYTEXT NULL,                 -- E-Mail Authorize.net will send copy of confirmation E-Mail
-    reg_authorize_net_merchant_seal TEXT NULL,                      -- Authorize.net Verified Merchant Seal code
-    -- Merchant Solutions Credentials
-    reg_merchant_solutions_acctid TINYTEXT NULL,                    -- Merchant Solutions credentials
-    reg_merchant_solutions_merchantpin TINYTEXT NULL,
-    reg_merchant_solutions_test TINYINT NULL,                       -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
-    reg_merchant_solutions_conf BOOLEAN NULL,                       -- Flag to send payment confirmation Email
-    reg_merchant_solutions_merchant_email TINYTEXT NULL,            -- Merchant Solutions will send copy of confirmation E-Mail
-    -- Billing settings
-    reg_full_billing_info BOOLEAN NULL,                             -- Always request full billing information in checkout page regardless of the following settings
-    reg_bill_info_req_no_charge SMALLINT NULL,                      -- Bitmap of fields to use in checkout for these types of payments - See billing_field in plugin.conf
-    reg_bill_info_req_comp_code SMALLINT NULL,
-    reg_bill_info_req_cash SMALLINT NULL,
-    reg_bill_info_req_check SMALLINT NULL,
-    reg_bill_info_req_credit_card SMALLINT NULL,
-    reg_bill_info_req_merchant_call SMALLINT NULL,
-    -- Misc Options
-    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.
-    PRIMARY KEY (id)
-);
-
-----
-
--- Terms used in site modifiable on Management page in admin - Only 1 entry in this table
--- Terms in this table should be all self-explanatory
-CREATE TABLE {prefix}settings_terms (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_term_registrations_name TINYTEXT NULL,                      -- Term "Event Registration"
-    reg_term_registration TINYTEXT NULL,
-    reg_term_registration_cap TINYTEXT NULL,
-    reg_term_registration_plur TINYTEXT NULL,
-    reg_term_registration_plur_cap TINYTEXT NULL,
-    reg_term_register TINYTEXT NULL,
-    reg_term_register_cap TINYTEXT NULL,
-    reg_term_registers TINYTEXT NULL,                               -- Intransitive verb of register
-    reg_term_registering TINYTEXT NULL,
-    reg_term_registering_cap TINYTEXT NULL,
-    reg_term_registered TINYTEXT NULL,
-    reg_term_registered_cap TINYTEXT NULL,
-    reg_term_attendee TINYTEXT NULL,
-    reg_term_attendee_cap TINYTEXT NULL,
-    reg_term_attendee_plur TINYTEXT NULL,
-    reg_term_attendee_plur_cap TINYTEXT NULL,
-    reg_term_attending TINYTEXT NULL,
-    reg_term_attended TINYTEXT NULL,
-    reg_term_registered_user TINYTEXT NULL,
-    reg_term_registered_user_cap TINYTEXT NULL,
-    reg_term_registered_user_plur TINYTEXT NULL,
-    reg_term_registered_user_plur_cap TINYTEXT NULL,
-    reg_term_event TINYTEXT NULL,
-    reg_term_event_cap TINYTEXT NULL,
-    reg_term_event_plur TINYTEXT NULL,
-    reg_term_event_plur_cap TINYTEXT NULL,
-    reg_term_id TINYTEXT NULL,
-    reg_term_id_cap TINYTEXT NULL,
-    reg_term_id_plur TINYTEXT NULL,
-    reg_term_id_plur_cap TINYTEXT NULL,
-    reg_term_level TINYTEXT NULL,
-    reg_term_level_cap TINYTEXT NULL,
-    reg_term_level_plur TINYTEXT NULL,
-    reg_term_level_plur_cap TINYTEXT NULL,
-    reg_term_password TINYTEXT NULL,
-    reg_term_password_cap TINYTEXT NULL,
-    reg_term_password_plur TINYTEXT NULL,
-    reg_term_password_plur_cap TINYTEXT NULL,
-    reg_term_instructor TINYTEXT NULL,
-    reg_term_instructor_cap TINYTEXT NULL,
-    reg_term_instructor_plur TINYTEXT NULL,
-    reg_term_instructor_plur_cap TINYTEXT NULL,
-    reg_term_payment_code TINYTEXT NULL,
-    reg_term_payment_code_cap TINYTEXT NULL,
-    reg_term_payment_code_plur TINYTEXT NULL,
-    reg_term_payment_code_plur_cap TINYTEXT NULL,
-    reg_term_registration_button TINYTEXT NULL,
-    reg_term_contact_information TINYTEXT NULL,
-    PRIMARY KEY (id)
-);
-
-----
-
--- Misc system-wide customer configurable configuration
--- Various text and flags to be configured by customer
--- Only one entry in this table!
-CREATE TABLE {prefix}misc (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_bulletin TEXT NULL,                                     -- Text to display at top of first registration page
-    cart_page_text TEXT NULL,                                   -- Text to display at top of cart page
-    checkout_page_text TEXT NULL,                               -- Text to display at top of checkout page
-    summary_page_text TEXT NULL,                                -- Text to display at top of summary page (after checkout)
-    reg_terms TEXT NULL,                                        -- Registration terms and conditions
-    notify_subject TEXT NULL,                                   -- Subject of notification E-Mail to site owner
-    notify_text TEXT NULL,                                      -- Notification E-Mail text for site owner
-    instr_notify_subject TEXT NULL,                             -- Subject of notification E-Mail to instructor
-    instr_notify_text TEXT NULL,                                -- Notification E-Mail text for instructor
-    submission_notify_subject TEXT NULL,                        -- Subject of notification E-Mail to person submitting the registrations
-    submission_notify_text TEXT NULL,                           -- Notification E-Mail text to person submitting the registrations
-    registrant_notify_subject TEXT NULL,                        -- Subject of notification E-Mail to registrant
-    registrant_notify_text TEXT NULL,                           -- Text of notification E-Mail to registrant
-    submission_ack_subject TEXT NULL,                           -- Subject of acknowledgement E-Mail to person submitting the registrations
-    submission_ack_text TEXT NULL,                              -- Text of acknowledgement E-Mail text to person submitting the registrations
-    registrant_ack_subject TEXT NULL,                           -- Subject of acknowledgement E-Mail to registrant
-    registrant_ack_text TEXT NULL,                              -- Text of acknowledgement E-Mail to registrant
-    PRIMARY KEY (id)
-);
-
-----
-
--- Payment Codes
--- Promotional payment codes for free/discounted payment
-CREATE TABLE {prefix}payment_code (
-    id INT NOT NULL AUTO_INCREMENT,
-    code_type TINYINT NULL,                                     -- Type of adjustment - Free only to start with - See pay_code_type in plugin.ini
-    ref_type TINYINT NULL,                                      -- See payment_ref_type in plugin.ini
-    ref_dest INT NULL,                                          -- Pointer to the specific entity of ref_type
-    code TINYTEXT NULL,                                         -- Text code user must enter to use
-    amount FLOAT,                                               -- Amount of discount if not type "Free" - Either $ amount or percent
-    expire_date DATE NULL,                                      -- Expiration Date
-    descr TEXT NULL,
-    PRIMARY KEY (id),
-    INDEX (ref_dest),
-    INDEX (code(10))
-);
-
-----
-
--- Registration event specific information
--- One record for each event in Events add-on
--- Only created when an event is selected to offer registrations
-CREATE TABLE {prefix}reg_event (
-    id INT NOT NULL AUTO_INCREMENT,
-    event INT NULL,                                             -- Pointer to event in Events add-on - False if event record in Events add-on no longer exists
-    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 receive notification of a registration other than org_internal_email in management, comma separated
-    admin_active BOOLEAN NULL,                                  -- Active flag for admin from Events - If logged in Admin user for this event and this is true then admin user may enter registrations even if active is off.
-    active BOOLEAN NULL,                                        -- Active flag to indicate that this event is available for registrations and notifications
-    time_specific BOOLEAN NULL,                                 -- Registration for this event is not date/time specific. Can attend any date/time of 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
-    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
-    reg_hours_before MEDIUMINT NULL,                            -- Number of hours before an event that is the latest a registration may be submitted.
-    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
-    descr TEXT NULL,                                            -- Registrations specific description field for this event
-    terms TEXT NULL,                                            -- Terms and Conditions for registration
-    first_datetime DATETIME NULL,                               -- Start of first listed date/time for this event
-    last_datetime DATETIME NULL,                                -- Start of last listed date/time for this event
-    reg_file TINYTEXT NULL,                                     -- Name of a downloadable file
-    reg_file_title TINYTEXT NULL,                               -- Title for downloadable file
-    form_revision SMALLINT NULL,                                -- Current MagicForm form revision
-    notes TEXT NULL,                                            -- System operator's notes for this event - Not visible to users
-    PRIMARY KEY (id),
-    INDEX (event),
-    INDEX (event_code(10))
-);
-
-----
-
--- Registration Event Time - Information and summary data for a specific event instance (relates to a particular time record in events)
--- A pseudo entry is created if registration is not date/time sensitive for this event. The pseudo entry does not point to an event time.
--- 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,
-    active BOOLEAN NULL,                                        -- Flag. True if registrations is available for this time
-    non_time_specific BOOLEAN NULL,                             -- Flag. True if this is a pseudo time for non-time-specific events - Other informational times for the event will have this flag off
-    reg_event INT NULL,                                         -- Pointer to reg_event table
-    event_time INT NULL,                                        -- ID of events times table entry in Events add-on - If false (0), then this is a pseudo entry to use for all registrations (non-date/time specific)
-    start_datetime DATETIME NULL,                               -- Date and time when event instance starts
-    end_datetime DATETIME NULL,                                 -- Date and time when event instance ends
-    all_day BOOLEAN NULL,                                       -- All Day flag - Informational
-    attendees BOOLEAN NULL,                                     -- Flag if tracking attendees or if only one per registration submission (registers account submitting) - get from reg_event
-    attendee_max MEDIUMINT NULL,                                -- Attendee count limit - 0 = unlimited - get from reg_event record
-    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 checked out and attendees slots held)
-    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)
-    descr TEXT NULL,                                            -- Optional description field for this time entry
-    PRIMARY KEY (id),
-    INDEX (reg_event),
-    INDEX (event_time),
-    INDEX (start_datetime)
-);
-
-----
-
--- Pending Attendees - In carts but not checked out
--- Attendee counts may be held for a particular reg_time entry for carts that have not been checked out
--- These are held for reg_event reg_hold_minutes, afterwhich they are timed out and removed from this table
--- Cart entries are given the ID's for these entries when a hold is requested, if the entry is gone, the hold has expired
-CREATE TABLE {prefix}reg_time_pending (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_event INT NULL,                                         -- Pointer to reg_event table
-    reg_time INT NULL,                                          -- ID of time record
-    registrant INT NULL,                                        -- ID of reg_request_registrant record                                                  --
-    expire_time DATETIME NULL,                                  -- Time at which this hold expires
-    PRIMARY KEY (id),
-    INDEX (reg_event),
-    INDEX (reg_time)
-);
-
-----
-
--- 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 (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_event INT NULL,                                         -- Pointer to reg_event table
-    name TINYTEXT NULL,                                         -- Name of this registration type
-    descr TEXT NULL,                                            -- Description
-    PRIMARY KEY (id),
-    INDEX (reg_event)
-);
-
-----
-
--- 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_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,                                         -- Name of this rate
-    start_days INT NULL,                                        -- # of days before event time rate becomes available - may be selected as a date then converted for storage
-    end_days INT NULL,                                          -- # of days before event time rate becomes unavailable
-    base_rate FLOAT,                                            -- Base rate to register
-    per_registrant FLOAT,                                       -- Rate per registrant
-    registrant_credits TINYINT NULL,                            -- Number of registrants included in base rate
-    PRIMARY KEY (id),
-    INDEX (reg_event),
-    INDEX (reg_class)
-);
-
-----
-
--- Notifications
--- None or more for each reg event
-CREATE TABLE {prefix}reg_notification (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_event INT NULL,                                         -- Pointer to reg_event table
-    name TINYTEXT NULL,                                         -- Name of this notification
-    notification_days INT NULL,                                 -- # of days before or after event that notification takes place (- before, + after)
-    message TEXT NULL,                                          -- Content of message (uses template parameters to merge event/attendee data)
-    PRIMARY KEY (id),
-    INDEX (reg_event)
-);
-
-----
-
--- Notification Queue
-CREATE TABLE {prefix}notification_queue (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_notification INT NOT NULL,                              -- Pointer to the reg_notification table
-    account INT NOT NULL,                                       -- Pointer to the account table
-    queued_time DATETIME NOT NULL,                              -- Creation time
-    processed_time DATETIME NULL,                               -- The time this queue was processed. (sent out)
-    to_email TINYTEXT NOT NULL,                                 -- The To email address
-    from_email TINYTEXT NOT NULL,                               -- The From email address
-    subject TINYTEXT NOT NULL,                                  -- The subject
-    html_message TEXT NOT NULL,                                 -- The complete html message
-    PRIMARY KEY (id)
-);
-
-----
-
--- An account for a person submitting a registration or a registrant for an event
--- Depending on the use of these entries may not have all data included
--- A single account may be referenced as a person submitting registrations and/or a person registered for an event
-CREATE TABLE {prefix}account (
-    id INT NOT NULL AUTO_INCREMENT,
-    active BOOLEAN NULL,                                        -- Is active flag (may be accessed or used) - default is true
-    validated BOOLEAN NULL,                                     -- Flag indicating that the account has been validated - Set to false when recovering password
-    validation_code TINYTEXT NULL,                              -- Validation code and timestamp ("{validation code}-{timestamp}) - Clear this after validation
-    registered_by INT NULL,                                     -- Account
-    member_id TINYTEXT NULL,                                    -- Free-form field for a member ID (not a GLM Associate member ID - See "contact_member_id" below)
-    fname TINYTEXT NULL,                                        -- Account primary address
-    lname TINYTEXT NULL,
-    org TINYTEXT NULL,
-    title TINYTEXT NULL,
-    addr1 TINYTEXT NULL,
-    addr2 TINYTEXT NULL,
-    city TINYTEXT NULL,
-    state TINYTEXT NULL,
-    zip TINYTEXT NULL,
-    country TINYTEXT NULL,
-    phone TINYTEXT NULL,
-    fax TINYTEXT NULL,
-    bill_fname TINYTEXT NULL,                                   -- Last used billing information - Also stored in each registration request
-    bill_lname TINYTEXT NULL,
-    bill_org TINYTEXT NULL,
-    bill_title TINYTEXT NULL,
-    bill_addr1 TINYTEXT NULL,
-    bill_addr2 TINYTEXT NULL,
-    bill_city TINYTEXT NULL,
-    bill_state TINYTEXT NULL,
-    bill_zip TINYTEXT NULL,
-    bill_country TINYTEXT NULL,
-    bill_phone TINYTEXT NULL,
-    bill_fax TINYTEXT NULL,
-    email TINYTEXT NULL,
-    password TINYTEXT NULL,                                     -- Crypted password for login back into this account
-    email_ok BOOLEAN NULL,
-    is_member BOOLEAN NULL,                                     -- Is a member of the entity that owns the site
-    customer_profile_id TINYTEXT NULL,                          -- Stored Credit Card customer profile ID
-    payment_profile_id TINYTEXT NULL,                           -- Stored Credit Card payment profile ID
-    payment_profile_card TINYTEXT NULL,                         -- Stored Credit Card last card digits
-    contact_id INT NULL,                                        -- Pointer to GLM Associate member contact record if account is for a member contact
-    contact_member_id INT NULL,                                 -- Pointer to GLM Associate Member for this contact
-    contact_fname TINYTEXT NULL,
-    contact_lname TINYTEXT NULL,
-    contact_org TINYTEXT NULL,
-    contact_title TINYTEXT NULL,
-    contact_addr1 TINYTEXT NULL,
-    contact_addr2 TINYTEXT NULL,
-    contact_city TINYTEXT NULL,
-    contact_state TINYTEXT NULL,
-    contact_zip TINYTEXT NULL,
-    contact_country TINYTEXT NULL,
-    contact_phone TINYTEXT NULL,
-    contact_fax TINYTEXT NULL,
-    contact_email TINYTEXT NULL,
-    contact_email_ok BOOLEAN NULL,
-    guardian TINYTEXT NULL,
-    emer_contact TINYTEXT NULL,
-    emer_phone TINYTEXT NULL,
-    med_history TINYTEXT NULL,
-    allergy_med TINYTEXT NULL,
-    date_created DATE NULL,
-    notes TEXT NULL,                                            -- System operator's notes for this account - not visible to account owner
-    user_trace_info TINYTEXT NULL,                              -- IP Address of user computer and timestamp of last update
-    PRIMARY KEY (id),
-    INDEX (registered_by),
-    INDEX (member_id(10)),
-    INDEX (fname(10)),
-    INDEX (lname(10)),
-    INDEX (org(10)),
-    INDEX (city(10)),
-    INDEX (state(5)),
-    INDEX (zip(5)),
-    INDEX (email(10)),
-    INDEX (contact_id)
-);
-
-----
-
--- A request for registration
--- Has one or more reg_detail records associated with it
-CREATE TABLE {prefix}reg_request (
-    id INT NOT NULL AUTO_INCREMENT,
-    account INT NULL,                                           -- Pointer to user account (reg_account) who submitted the registrations. If 0 then guest request (prior to checkout)
-    validated BOOLEAN NULL,                                     -- Flag that indicates if request passed last validation with checkRegistrationRequest()
-    validation_message TEXT NULL,                               -- Reasons that request did not pass validation with checkRegistrationRequest() - Serialized array
-    bill_fname TINYTEXT NULL,                                   -- Billing information used for this registration submission - Updates account billing address - Kept here for each request
-    bill_lname TINYTEXT NULL,
-    bill_org TINYTEXT NULL,
-    bill_title TINYTEXT NULL,
-    bill_addr1 TINYTEXT NULL,
-    bill_addr2 TINYTEXT NULL,
-    bill_city TINYTEXT NULL,
-    bill_state TINYTEXT NULL,
-    bill_zip TINYTEXT NULL,
-    bill_country TINYTEXT NULL,
-    bill_phone TINYTEXT NULL,
-    bill_email TINYTEXT NULL,
-    date_submitted DATE NULL,                                   -- Date of final submission (checkout complete)
-    pay_method INT NULL,                                        -- See payment_method in plugin.ini
-    payment_code TINYTEXT NULL,                                 -- Payment_code text (comp code) - if submitted and validated
-    status SMALLINT NULL,                                       -- See submission_status in plugin.ini
-    total DOUBLE PRECISION NULL,                                -- Total charge including all fees and taxes
-    total_discounts DOUBLE PRECISION NULL,                      -- Total of all comps and discounts
-    registrants SMALLINT NULL,                                  -- Total number of registrants in this cart
-    cc_type TINYINT NULL,                                       -- Credit Card type (if used) - See credit_card in plugin.ini
-    cc_name TINYTEXT NULL,                                      -- Name on Credit Card or Name on Check
-    cc_numb TINYTEXT NULL,                                      -- Credit Card Number or Check Number
-    cc_exp TINYTEXT NULL,
-    cc_cvv TINYTEXT NULL,
-    cc_conf TINYTEXT NULL,                                      -- Confirmation code back from card processor
-    cc_proc_mesg TINYTEXT NULL,                                 -- Message received from payment processor
-    summary TEXT NULL,                                          -- HTML summary of cart contents, costs and payment - Use same HTML displayed to user
-    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    user_trace_info TEXT NULL,                                  -- IP Address of user computer and timestamp
-    date_created DATETIME NULL,                                 -- Date request was first created
-    last_update DATETIME NULL,                                  -- Last update date/time - Used for timing out pending carts and attendee counts
-    PRIMARY KEY (id),
-    INDEX (account),
-    INDEX (date_submitted)
-);
-
-----
-
--- Registration for a specific event
--- Has one or more reg_selected_rate records associated with it
-CREATE TABLE {prefix}reg_request_event (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_request INT NULL,                                       -- Pointer to reg_request table
-    reg_event INT NULL,                                         -- Pointer to reg_event
-    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    PRIMARY KEY (id),
-    INDEX (reg_request),
-    INDEX (reg_event)
-);
-
-----
-
---  A particular reg_class selected
---  Has one or more reg_request_rate records associated with it
-CREATE TABLE {prefix}reg_request_class (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_event INT NULL,                                         -- Pointer to reg_event entry
-    reg_request INT NULL,                                       -- Pointer to the registration request record
-    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
-    class INT NULL,                                             -- Pointer to event reg_class table - False (0) if registration class no longer exits
-    class_name TINYTEXT NULL,                                   -- Name of event class at the time selected
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    PRIMARY KEY (id),
-    INDEX (reg_event),
-    INDEX (reg_request_event)
-);
-
-----
-
---  A particular reg_rate selected
---  Has one or more reg_request_registrant records associated with it
-CREATE TABLE {prefix}reg_request_rate (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_event INT NULL,                                         -- Pointer to reg_event entry
-    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 - False (0) if registration rate no longer exists
-    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 registrants included in base rate at time of registration
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    PRIMARY KEY (id),
-    INDEX (reg_event),
-    INDEX (reg_request_event),
-    INDEX (reg_request_class)
-);
-
-----
-
---  A specific registrant for a selected registration rate
-CREATE TABLE {prefix}reg_request_registrant (
-    id INT NOT NULL AUTO_INCREMENT,
-    account INT NULL,                                           -- Pointer to the account entry for the person being registered - False (0) if account no longer exists or registrant account not needed
-    reg_event INT NULL,                                         -- Pointer to reg_event entry
-    reg_time INT NULL,                                          -- Pointer reg_time entry
-    event_datetime DATETIME NULL,                               -- Date and time of event time selected so it will always be in the cart
-    reg_request INT NULL,                                       -- Pointer to the registration request record
-    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
-    reg_request_class INT NULL,                                 -- Pointer to reg_request_class table entry
-    reg_request_rate INT NULL,                                  -- Pointer to reg_request_rate table entry
-    not_attending BOOLEAN DEFAULT false,                        -- Flag to say if registrant is not attending - set to true when not attending
-    fname TINYTEXT NULL,                                        -- First name of registrant at the time of selection
-    lname TINYTEXT NULL,                                        -- Last name of registrant at the time of selection
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    PRIMARY KEY (id),
-    INDEX (account),
-    INDEX (reg_event),
-    INDEX (reg_time),
-    INDEX (reg_request),
-    INDEX (reg_request_event),
-    INDEX (reg_request_class),
-    INDEX (reg_request_rate)
-);
-
-----
-
---  A specific use of a payment code in this request
-CREATE TABLE {prefix}reg_request_pay_code (
-    id INT NOT NULL AUTO_INCREMENT,
-    payment_code INT NULL,                                      -- Pointer to payment code
-    code TINYTEXT NULL,                                         -- Copy of Payment Code text in case payment code is deleted or changed
-    reg_request INT NULL,                                       -- Pointer to the registration request record
-    credit DOUBLE PRECISION NULL,                               -- Total credit for this payment code
-    expire_date DATE NULL,                                      -- Expiration Date - NOT USING NOW - Getting from payment_code table always
-    PRIMARY KEY (id),
-    INDEX (payment_code),
-    INDEX (reg_request)
-);
-
-----
-
--- Insert into management table
-INSERT INTO {prefix}management
-    (
-    canonical_reg_page,
-    reg_org_name,
-    reg_org_short,
-    reg_org_address,
-    reg_org_city,
-    reg_org_state,
-    reg_org_zip,
-    reg_org_phone,
-    reg_org_toll_free,
-    reg_org_internal_email,
-    reg_org_from_email,
-    reg_payment_methods,
-    reg_proc_methods,
-    reg_cc_accepts,
-    reg_authorize_net_login,
-    reg_authorize_net_key,
-    reg_authorize_net_test,
-    reg_authorize_net_conf,
-    reg_authorize_net_merchant_email,
-    reg_merchant_solutions_acctid,
-    reg_merchant_solutions_merchantpin,
-    reg_merchant_solutions_test,
-    reg_full_billing_info,
-    reg_bill_info_req_no_charge,
-    reg_bill_info_req_comp_code,
-    reg_bill_info_req_cash,
-    reg_bill_info_req_check,
-    reg_bill_info_req_credit_card,
-    reg_bill_info_req_merchant_call,
-    reg_medical_info
-    )
-    VALUES
-    (
-    'registrations',                                            -- reg_canonical_reg_page,
-    'Gaslight Media',                                           -- reg_org_name,
-    'GLM',                                                      -- reg_org_short,
-    '120 E. Lake St.',                                          -- reg_org_address,
-    'Petoskey',                                                 -- reg_org_city,
-    'MI',                                                       -- reg_org_state,
-    '49770',                                                    -- reg_org_zip,
-    '231-487-0692',                                             -- reg_org_phone,
-    '800-123-1234',                                             -- reg_org_toll_free,
-    'internal@gaslightmedia.com',                               -- reg_org_internal_email,
-    'info@gaslightmedia.com',                                   -- reg_org_from_email,
-    0,                                                          -- reg_payment_methods,
-    0,                                                          -- reg_proc_methods,
-    0,                                                          -- reg_cc_accepts,
-    '',                                                         -- reg_authorize_net_login,
-    '',                                                         -- reg_authorize_net_key,
-    1,                                                          -- reg_authorize_net_test,
-    true,                                                       -- reg_authorize_net_conf
-    '',                                                         -- reg_authorize_net_merchant_email,
-    '',                                                         -- reg_merchant_solutions_acctid,
-    '',                                                         -- reg_merchant_solutions_merchantpin,
-    1,                                                          -- reg_merchant_solutions_test,
-    true,                                                       -- reg_full_billing_info,
-    0,                                                          -- reg_bill_info_req_no_charge,
-    0,                                                          -- reg_bill_info_req_comp_code,
-    0,                                                          -- reg_bill_info_req_cash,
-    0,                                                          -- reg_bill_info_req_check,
-    0,                                                          -- reg_bill_info_req_credit_card,
-    0,                                                          -- reg_bill_info_req_merchant_call,
-    true                                                        -- reg_medical_info,
-    );
-
-----
-
--- Insert into settings_terms table
-INSERT INTO {prefix}settings_terms
-    (
-    reg_term_registrations_name,
-    reg_term_registration,
-    reg_term_registration_cap,
-    reg_term_registration_plur,
-    reg_term_registration_plur_cap,
-    reg_term_register,
-    reg_term_register_cap,
-    reg_term_registers,
-    reg_term_registering,
-    reg_term_registering_cap,
-    reg_term_registered,
-    reg_term_registered_cap,
-    reg_term_attendee,
-    reg_term_attendee_cap,
-    reg_term_attendee_plur,
-    reg_term_attendee_plur_cap,
-    reg_term_attending,
-    reg_term_attended,
-    reg_term_registered_user,
-    reg_term_registered_user_cap,
-    reg_term_registered_user_plur,
-    reg_term_registered_user_plur_cap,
-    reg_term_event,
-    reg_term_event_cap,
-    reg_term_event_plur,
-    reg_term_event_plur_cap,
-    reg_term_id,
-    reg_term_id_cap,
-    reg_term_id_plur,
-    reg_term_id_plur_cap,
-    reg_term_password,
-    reg_term_password_cap,
-    reg_term_password_plur,
-    reg_term_password_plur_cap,
-    reg_term_instructor,
-    reg_term_instructor_cap,
-    reg_term_instructor_plur,
-    reg_term_instructor_plur_cap,
-    reg_term_payment_code,
-    reg_term_payment_code_cap,
-    reg_term_payment_code_plur,
-    reg_term_payment_code_plur_cap,
-    reg_term_registration_button,
-    reg_term_contact_information
-    )
-    VALUES
-    (
-    'Event Registrations',                                      -- reg_term_registrations_name
-    'registration',                                             -- reg_term_registration
-    'Registration',                                             -- reg_term_registration_cap
-    'registrations',                                            -- reg_term_registration_plur
-    'Registrations',                                            -- reg_term_registration_plur_cap
-    'register',                                                 -- reg_term_registe
-    'Register',                                                 -- reg_term_register_cap
-    'registers',                                                -- reg_term_registers
-    'registering',                                              -- reg_term_registering
-    'Registering',                                              -- reg_term_registering_cap
-    'registered',                                               -- reg_term_registered
-    'Registered',                                               -- reg_term_registered_cap
-    'attendee',                                                 -- reg_term_attendee
-    'Attendee',                                                 -- reg_term_attendee_cap
-    'attendees',                                                -- reg_term_attendee_plur
-    'Attendees',                                                -- reg_term_attendee_plur_cap
-    'attending',                                                -- reg_term_attending
-    'attended',                                                 -- reg_term_attended
-    'user',                                                     -- reg_term_registered_user
-    'User',                                                     -- reg_term_registered_user_cap
-    'users',                                                    -- reg_term_registered_user_plur
-    'Users',                                                    -- reg_term_registered_user_plur_cap
-    'event',                                                    -- reg_term_event
-    'Event',                                                    -- reg_term_event_cap
-    'events',                                                   -- reg_term_event_plur
-    'Events',                                                   -- reg_term_event_plur_cap
-    'ID',                                                       -- reg_term_id
-    'ID',                                                       -- reg_term_id_cap
-    'IDs',                                                      -- reg_term_id_plur
-    'IDs',                                                      -- reg_term_id_plur_cap
-    'password',                                                 -- reg_term_password
-    'passwords',                                                -- reg_term_password_cap
-    'Password',                                                 -- reg_term_password_plur
-    'Passwords',                                                -- reg_term_password_plur_cap
-    'instructor',                                               -- reg_term_instructor
-    'Instructor',                                               -- reg_term_instructor_cap
-    'instructors',                                              -- reg_term_instructor_plur
-    'Instructors',                                              -- reg_term_instructor_plur_cap
-    'payment code',                                             -- reg_term_payment_code
-    'Payment code',                                             -- reg_term_payment_code_cap
-    'payment codes',                                            -- reg_term_payment_code_plur
-    'Payment codes',                                            -- reg_term_payment_code_plur_cap
-    'Register for Event',                                       -- reg_term_registration_button
-    'Contact Information'                                       -- reg_term_contact_information
-    );
-
-----
-
--- Insert into misc table
-INSERT INTO {prefix}misc
-    (
-    reg_bulletin,
-    cart_page_text,
-    checkout_page_text,
-    summary_page_text,
-    reg_terms,
-    notify_subject,
-    notify_text,
-    instr_notify_subject,
-    instr_notify_text,
-    submission_notify_subject,
-    submission_notify_text,
-    registrant_notify_subject,
-    registrant_notify_text,
-    submission_ack_subject,
-    submission_ack_text,
-    registrant_ack_subject,
-    registrant_ack_text
-    )
-    VALUES
-    (
-    'Registration Bulletin Text',
-    'Text for top of Cart Page',
-    'Text for top of Checkout Page',
-    'Text for top of Summary Page',
-    'Terms and Conditions',
-    'Subject of notification to site owner of a registration',
-    'Text of notification to site owner of a registration',
-    'Subject of notification to instructor of registration',
-    'Text for notification to instructor of registration',
-    'Subject of notification to person submitting registration',
-    'Text of notification to person submitting registration',
-    'Subject for notification to registrant',
-    'Text for notification to registrant',
-    'Subject of acknowledgement to person submitting registration',
-    'Text of acknowledgement to person submitting registration',
-    'Subject of acknowledgement to registrant',
-    'Text of acknowledgement to registrant'
-    );
diff --git a/setup/databaseScripts/create_database_V0.0.29.sql b/setup/databaseScripts/create_database_V0.0.29.sql
new file mode 100644 (file)
index 0000000..9b6a9fa
--- /dev/null
@@ -0,0 +1,793 @@
+-- Gaslight Media Registration Database
+-- File Created: 01/18/2017 14:40:00
+-- Database Version: 0.0.19
+-- Database Creation Script
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+--
+/*
+ * General Database Organization
+ * -----------------------------
+ *
+ * management - General options and configuration - Site manager access only
+ *
+ * misc - Misc settings and text - Site owner may update
+ *
+ * payment codes - Promotional payment codes - Used with various things
+ *      --> 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)
+ *
+ * reg_account - Describes someone who submits / pays for a registration
+ * Make these two things the same table....
+ * registrant - A person who is registered for an event
+ *
+ * reg_request - Information on a specific request for registrations
+ *      reg_request_event - Event selected (one or more)
+ *          reg_request_class - Class of registration (one or more)
+ *              reg_request_rate - Specific registration date/rate (one or more)
+ *                  reg_request_registrant - Registrant (one or more)
+ *
+ * NOTE: additional fields and added fields data will be coming from the Custom Fields add-on
+ *
+ * Overall Flow
+ * ------------
+ *
+ * User selects an event
+ * If the event has available registrations
+ *  User selects a date for the registration (or if only one that's selected automatically)
+ *    User can log back into registrations at this point if they've been there before and have a password, create an ccount, or continue as guest ???
+ *      User selects an available rate type and adds one or more registrants for that rate type
+ *      User may loop back to select additional rate type(s) and registrants
+ *    User may go back to date selection and request additional rate types and registrants for the addional dates
+ *  User may go back to select additional dates and do registrations for those dates as above
+ * User may go back to select other events and do registrations for them as above
+ * User may select the "Cart" and deselect something added to it
+ * User may checkout
+ *
+ */
+
+/*
+ * NOTE: Anything below here may not be completed or accurate yet. I'm still working though this
+ * Lines commented out are selected for possible deletion.
+ * The INSERT statements are not up-to-date with the tables.
+ * The "config/plugin.ini" file in this plugin is also a work in progress.
+ */
+
+-- Management Options
+-- General configurationm parameters for the Registrations application
+-- Only one entry in this table!
+CREATE TABLE {prefix}management (
+    id INT NOT NULL AUTO_INCREMENT,
+    canonical_reg_page TINYTEXT NULL,                              -- Canonical page slug for registrations
+    -- System Owner Information
+    reg_org_name TINYTEXT NULL,                                     -- Customer Information - Name of Organization
+    reg_org_short TINYTEXT NULL,
+    reg_org_address TINYTEXT NULL,
+    reg_org_city TINYTEXT NULL,
+    reg_org_state TINYTEXT NULL,
+    reg_org_zip TINYTEXT NULL,
+    reg_org_phone TINYTEXT NULL,
+    reg_org_toll_free TINYTEXT NULL,
+    reg_org_internal_email TINYTEXT NULL,
+    reg_org_from_email TINYTEXT NULL,
+    reg_payment_methods SMALLINT NULL,                              -- Payment methods available for all registrations - Bitmap - see payment_method in plugin.ini
+    reg_proc_methods SMALLINT NULL,                                 -- Credit Cart payment processing methods available - Bitmap - see proc_method in plugin.ini
+    reg_cc_accepts SMALLINT NULL,                                   -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
+    -- Authorize.net Credentials
+    reg_authorize_net_login TINYTEXT NULL,
+    reg_authorize_net_key TINYTEXT NULL,
+    reg_authorize_net_test TINYINT NULL,                            -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
+    reg_authorize_net_conf BOOLEAN NULL,                            -- Flag to send payment confirmation Email from Authorize.net
+    reg_authorize_net_merchant_email TINYTEXT NULL,                 -- E-Mail Authorize.net will send copy of confirmation E-Mail
+    reg_authorize_net_merchant_seal TEXT NULL,                      -- Authorize.net Verified Merchant Seal code
+    -- Merchant Solutions Credentials
+    reg_merchant_solutions_acctid TINYTEXT NULL,                    -- Merchant Solutions credentials
+    reg_merchant_solutions_merchantpin TINYTEXT NULL,
+    reg_merchant_solutions_test TINYINT NULL,                       -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
+    reg_merchant_solutions_conf BOOLEAN NULL,                       -- Flag to send payment confirmation Email
+    reg_merchant_solutions_merchant_email TINYTEXT NULL,            -- Merchant Solutions will send copy of confirmation E-Mail
+    -- Billing settings
+    reg_full_billing_info BOOLEAN NULL,                             -- Always request full billing information in checkout page regardless of the following settings
+    reg_bill_info_req_no_charge SMALLINT NULL,                      -- Bitmap of fields to use in checkout for these types of payments - See billing_field in plugin.conf
+    reg_bill_info_req_comp_code SMALLINT NULL,
+    reg_bill_info_req_cash SMALLINT NULL,
+    reg_bill_info_req_check SMALLINT NULL,
+    reg_bill_info_req_credit_card SMALLINT NULL,
+    reg_bill_info_req_merchant_call SMALLINT NULL,
+    -- Misc Options
+    reg_request_hold_days SMALLINT NULL,                            -- Number of days past last update that a request will be retained in "CART" status.
+    req_account_hold_days SMALLINT NULL,                            -- Number of days past last update that an account will be retained when there are no requests or registrants referring to it.
+    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.
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Terms used in site modifiable on Management page in admin - Only 1 entry in this table
+-- Terms in this table should be all self-explanatory
+CREATE TABLE {prefix}settings_terms (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_term_registrations_name TINYTEXT NULL,                      -- Term "Event Registration"
+    reg_term_registration TINYTEXT NULL,
+    reg_term_registration_cap TINYTEXT NULL,
+    reg_term_registration_plur TINYTEXT NULL,
+    reg_term_registration_plur_cap TINYTEXT NULL,
+    reg_term_register TINYTEXT NULL,
+    reg_term_register_cap TINYTEXT NULL,
+    reg_term_registers TINYTEXT NULL,                               -- Intransitive verb of register
+    reg_term_registering TINYTEXT NULL,
+    reg_term_registering_cap TINYTEXT NULL,
+    reg_term_registered TINYTEXT NULL,
+    reg_term_registered_cap TINYTEXT NULL,
+    reg_term_attendee TINYTEXT NULL,
+    reg_term_attendee_cap TINYTEXT NULL,
+    reg_term_attendee_plur TINYTEXT NULL,
+    reg_term_attendee_plur_cap TINYTEXT NULL,
+    reg_term_attending TINYTEXT NULL,
+    reg_term_attended TINYTEXT NULL,
+    reg_term_registered_user TINYTEXT NULL,
+    reg_term_registered_user_cap TINYTEXT NULL,
+    reg_term_registered_user_plur TINYTEXT NULL,
+    reg_term_registered_user_plur_cap TINYTEXT NULL,
+    reg_term_event TINYTEXT NULL,
+    reg_term_event_cap TINYTEXT NULL,
+    reg_term_event_plur TINYTEXT NULL,
+    reg_term_event_plur_cap TINYTEXT NULL,
+    reg_term_id TINYTEXT NULL,
+    reg_term_id_cap TINYTEXT NULL,
+    reg_term_id_plur TINYTEXT NULL,
+    reg_term_id_plur_cap TINYTEXT NULL,
+    reg_term_level TINYTEXT NULL,
+    reg_term_level_cap TINYTEXT NULL,
+    reg_term_level_plur TINYTEXT NULL,
+    reg_term_level_plur_cap TINYTEXT NULL,
+    reg_term_password TINYTEXT NULL,
+    reg_term_password_cap TINYTEXT NULL,
+    reg_term_password_plur TINYTEXT NULL,
+    reg_term_password_plur_cap TINYTEXT NULL,
+    reg_term_instructor TINYTEXT NULL,
+    reg_term_instructor_cap TINYTEXT NULL,
+    reg_term_instructor_plur TINYTEXT NULL,
+    reg_term_instructor_plur_cap TINYTEXT NULL,
+    reg_term_payment_code TINYTEXT NULL,
+    reg_term_payment_code_cap TINYTEXT NULL,
+    reg_term_payment_code_plur TINYTEXT NULL,
+    reg_term_payment_code_plur_cap TINYTEXT NULL,
+    reg_term_registration_button TINYTEXT NULL,
+    reg_term_contact_information TINYTEXT NULL,
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Misc system-wide customer configurable configuration
+-- Various text and flags to be configured by customer
+-- Only one entry in this table!
+CREATE TABLE {prefix}misc (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_bulletin TEXT NULL,                                     -- Text to display at top of first registration page
+    cart_page_text TEXT NULL,                                   -- Text to display at top of cart page
+    checkout_page_text TEXT NULL,                               -- Text to display at top of checkout page
+    summary_page_text TEXT NULL,                                -- Text to display at top of summary page (after checkout)
+    reg_terms TEXT NULL,                                        -- Registration terms and conditions
+    notify_subject TEXT NULL,                                   -- Subject of notification E-Mail to site owner
+    notify_text TEXT NULL,                                      -- Notification E-Mail text for site owner
+    instr_notify_subject TEXT NULL,                             -- Subject of notification E-Mail to instructor
+    instr_notify_text TEXT NULL,                                -- Notification E-Mail text for instructor
+    submission_notify_subject TEXT NULL,                        -- Subject of notification E-Mail to person submitting the registrations
+    submission_notify_text TEXT NULL,                           -- Notification E-Mail text to person submitting the registrations
+    registrant_notify_subject TEXT NULL,                        -- Subject of notification E-Mail to registrant
+    registrant_notify_text TEXT NULL,                           -- Text of notification E-Mail to registrant
+    submission_ack_subject TEXT NULL,                           -- Subject of acknowledgement E-Mail to person submitting the registrations
+    submission_ack_text TEXT NULL,                              -- Text of acknowledgement E-Mail text to person submitting the registrations
+    registrant_ack_subject TEXT NULL,                           -- Subject of acknowledgement E-Mail to registrant
+    registrant_ack_text TEXT NULL,                              -- Text of acknowledgement E-Mail to registrant
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Payment Codes
+-- Promotional payment codes for free/discounted payment
+CREATE TABLE {prefix}payment_code (
+    id INT NOT NULL AUTO_INCREMENT,
+    code_type TINYINT NULL,                                     -- Type of adjustment - Free only to start with - See pay_code_type in plugin.ini
+    ref_type TINYINT NULL,                                      -- See payment_ref_type in plugin.ini
+    ref_dest INT NULL,                                          -- Pointer to the specific entity of ref_type
+    code TINYTEXT NULL,                                         -- Text code user must enter to use
+    amount FLOAT,                                               -- Amount of discount if not type "Free" - Either $ amount or percent
+    expire_date DATE NULL,                                      -- Expiration Date
+    descr TEXT NULL,
+    PRIMARY KEY (id),
+    INDEX (ref_dest),
+    INDEX (code(10))
+);
+
+----
+
+-- Registration event specific information
+-- One record for each event in Events add-on
+-- Only created when an event is selected to offer registrations
+CREATE TABLE {prefix}reg_event (
+    id INT NOT NULL AUTO_INCREMENT,
+    event INT NULL,                                             -- Pointer to event in Events add-on - False if event record in Events add-on no longer exists
+    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 receive notification of a registration other than org_internal_email in management, comma separated
+    admin_active BOOLEAN NULL,                                  -- Active flag for admin from Events - If logged in Admin user for this event and this is true then admin user may enter registrations even if active is off.
+    active BOOLEAN NULL,                                        -- Active flag to indicate that this event is available for registrations and notifications
+    time_specific BOOLEAN NULL,                                 -- Registration for this event is not date/time specific. Can attend any date/time of 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
+    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,                              -- NO LONGER IN USE - Number of days hold time for inactive cart before cart is purged
+    reg_hours_before MEDIUMINT NULL,                            -- Number of hours before an event that is the latest a registration may be submitted.
+    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
+    descr TEXT NULL,                                            -- Registrations specific description field for this event
+    terms TEXT NULL,                                            -- Terms and Conditions for registration
+    first_datetime DATETIME NULL,                               -- Start of first listed date/time for this event
+    last_datetime DATETIME NULL,                                -- Start of last listed date/time for this event
+    reg_file TINYTEXT NULL,                                     -- Name of a downloadable file
+    reg_file_title TINYTEXT NULL,                               -- Title for downloadable file
+    form_revision SMALLINT NULL,                                -- Current MagicForm form revision
+    notes TEXT NULL,                                            -- System operator's notes for this event - Not visible to users
+    PRIMARY KEY (id),
+    INDEX (event),
+    INDEX (event_code(10))
+);
+
+----
+
+-- Registration Event Time - Information and summary data for a specific event instance (relates to a particular time record in events)
+-- A pseudo entry is created if registration is not date/time sensitive for this event. The pseudo entry does not point to an event time.
+-- 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,
+    active BOOLEAN NULL,                                        -- Flag. True if registrations is available for this time
+    non_time_specific BOOLEAN NULL,                             -- Flag. True if this is a pseudo time for non-time-specific events - Other informational times for the event will have this flag off
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    event_time INT NULL,                                        -- ID of events times table entry in Events add-on - If false (0), then this is a pseudo entry to use for all registrations (non-date/time specific)
+    start_datetime DATETIME NULL,                               -- Date and time when event instance starts
+    end_datetime DATETIME NULL,                                 -- Date and time when event instance ends
+    all_day BOOLEAN NULL,                                       -- All Day flag - Informational
+    attendees BOOLEAN NULL,                                     -- Flag if tracking attendees or if only one per registration submission (registers account submitting) - get from reg_event
+    attendee_max MEDIUMINT NULL,                                -- Attendee count limit - 0 = unlimited - get from reg_event record
+    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 checked out and attendees slots held)
+    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)
+    descr TEXT NULL,                                            -- Optional description field for this time entry
+    PRIMARY KEY (id),
+    INDEX (reg_event),
+    INDEX (event_time),
+    INDEX (start_datetime)
+);
+
+----
+
+-- Pending Attendees - In carts but not checked out
+-- Attendee counts may be held for a particular reg_time entry for carts that have not been checked out
+-- These are held for reg_event reg_hold_minutes, afterwhich they are timed out and removed from this table
+-- Cart entries are given the ID's for these entries when a hold is requested, if the entry is gone, the hold has expired
+CREATE TABLE {prefix}reg_time_pending (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    reg_time INT NULL,                                          -- ID of time record
+    registrant INT NULL,                                        -- ID of reg_request_registrant record                                                  --
+    expire_time DATETIME NULL,                                  -- Time at which this hold expires
+    PRIMARY KEY (id),
+    INDEX (reg_event),
+    INDEX (reg_time)
+);
+
+----
+
+-- 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 (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    name TINYTEXT NULL,                                         -- Name of this registration type
+    descr TEXT NULL,                                            -- Description
+    PRIMARY KEY (id),
+    INDEX (reg_event)
+);
+
+----
+
+-- 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_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,                                         -- Name of this rate
+    start_days INT NULL,                                        -- # of days before event time rate becomes available - may be selected as a date then converted for storage
+    end_days INT NULL,                                          -- # of days before event time rate becomes unavailable
+    base_rate FLOAT,                                            -- Base rate to register
+    per_registrant FLOAT,                                       -- Rate per registrant
+    registrant_credits TINYINT NULL,                            -- Number of registrants included in base rate
+    PRIMARY KEY (id),
+    INDEX (reg_event),
+    INDEX (reg_class)
+);
+
+----
+
+-- Notifications
+-- None or more for each reg event
+CREATE TABLE {prefix}reg_notification (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    name TINYTEXT NULL,                                         -- Name of this notification
+    notification_days INT NULL,                                 -- # of days before or after event that notification takes place (- before, + after)
+    message TEXT NULL,                                          -- Content of message (uses template parameters to merge event/attendee data)
+    PRIMARY KEY (id),
+    INDEX (reg_event)
+);
+
+----
+
+-- Notification Queue
+CREATE TABLE {prefix}notification_queue (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_notification INT NOT NULL,                              -- Pointer to the reg_notification table
+    account INT NOT NULL,                                       -- Pointer to the account table
+    queued_time DATETIME NOT NULL,                              -- Creation time
+    processed_time DATETIME NULL,                               -- The time this queue was processed. (sent out)
+    to_email TINYTEXT NOT NULL,                                 -- The To email address
+    from_email TINYTEXT NOT NULL,                               -- The From email address
+    subject TINYTEXT NOT NULL,                                  -- The subject
+    html_message TEXT NOT NULL,                                 -- The complete html message
+    PRIMARY KEY (id)
+);
+
+----
+
+-- An account for a person submitting a registration or a registrant for an event
+-- Depending on the use of these entries may not have all data included
+-- A single account may be referenced as a person submitting registrations and/or a person registered for an event
+CREATE TABLE {prefix}account (
+    id INT NOT NULL AUTO_INCREMENT,
+    active BOOLEAN NULL,                                        -- Is active flag (may be accessed or used) - default is true
+    validated BOOLEAN NULL,                                     -- Flag indicating that the account has been validated - Set to false when recovering password
+    validation_code TINYTEXT NULL,                              -- Validation code and timestamp ("{validation code}-{timestamp}) - Clear this after validation
+    registered_by INT NULL,                                     -- Account
+    member_id TINYTEXT NULL,                                    -- Free-form field for a member ID (not a GLM Associate member ID - See "contact_member_id" below)
+    fname TINYTEXT NULL,                                        -- Account primary address
+    lname TINYTEXT NULL,
+    org TINYTEXT NULL,
+    title TINYTEXT NULL,
+    addr1 TINYTEXT NULL,
+    addr2 TINYTEXT NULL,
+    city TINYTEXT NULL,
+    state TINYTEXT NULL,
+    zip TINYTEXT NULL,
+    country TINYTEXT NULL,
+    phone TINYTEXT NULL,
+    fax TINYTEXT NULL,
+    bill_fname TINYTEXT NULL,                                   -- Last used billing infodeletermation - Also stored in each registration request
+    bill_lname TINYTEXT NULL,
+    bill_org TINYTEXT NULL,
+    bill_title TINYTEXT NULL,
+    bill_addr1 TINYTEXT NULL,
+    bill_addr2 TINYTEXT NULL,
+    bill_city TINYTEXT NULL,
+    bill_state TINYTEXT NULL,
+    bill_zip TINYTEXT NULL,
+    bill_country TINYTEXT NULL,
+    bill_phone TINYTEXT NULL,
+    bill_fax TINYTEXT NULL,
+    email TINYTEXT NULL,
+    password TINYTEXT NULL,                                     -- Crypted password for login back into this account
+    email_ok BOOLEAN NULL,
+    is_member BOOLEAN NULL,                                     -- Is a member of the entity that owns the site
+    customer_profile_id TINYTEXT NULL,                          -- Stored Credit Card customer profile ID
+    payment_profile_id TINYTEXT NULL,                           -- Stored Credit Card payment profile ID
+    payment_profile_card TINYTEXT NULL,                         -- Stored Credit Card last card digits
+    contact_id INT NULL,                                        -- Pointer to GLM Associate member contact record if account is for a member contact
+    contact_member_id INT NULL,                                 -- Pointer to GLM Associate Member for this contact
+    contact_fname TINYTEXT NULL,
+    contact_lname TINYTEXT NULL,
+    contact_org TINYTEXT NULL,
+    contact_title TINYTEXT NULL,
+    contact_addr1 TINYTEXT NULL,
+    contact_addr2 TINYTEXT NULL,
+    contact_city TINYTEXT NULL,
+    contact_state TINYTEXT NULL,
+    contact_zip TINYTEXT NULL,
+    contact_country TINYTEXT NULL,
+    contact_phone TINYTEXT NULL,
+    contact_fax TINYTEXT NULL,
+    contact_email TINYTEXT NULL,
+    contact_email_ok BOOLEAN NULL,
+    guardian TINYTEXT NULL,
+    emer_contact TINYTEXT NULL,
+    emer_phone TINYTEXT NULL,
+    med_history TINYTEXT NULL,
+    allergy_med TINYTEXT NULL,
+    date_created DATE NULL,
+    notes TEXT NULL,                                            -- System operator's notes for this account - not visible to account owner
+    user_trace_info TINYTEXT NULL,                              -- IP Address of user computer and timestamp of last update
+    PRIMARY KEY (id),
+    INDEX (registered_by),
+    INDEX (member_id(10)),
+    INDEX (fname(10)),
+    INDEX (lname(10)),
+    INDEX (org(10)),
+    INDEX (city(10)),
+    INDEX (state(5)),
+    INDEX (zip(5)),
+    INDEX (email(10)),
+    INDEX (contact_id)
+);
+
+----
+
+-- A request for registration
+-- Has one or more reg_detail records associated with it
+CREATE TABLE {prefix}reg_request (
+    id INT NOT NULL AUTO_INCREMENT,
+    account INT NULL,                                           -- Pointer to user account (reg_account) who submitted the registrations. If 0 then guest request (prior to checkout)
+    validated BOOLEAN NULL,                                     -- Flag that indicates if request passed last validation with checkRegistrationRequest()
+    validation_message TEXT NULL,                               -- Reasons that request did not pass validation with checkRegistrationRequest() - Serialized array
+    bill_fname TINYTEXT NULL,                                   -- Billing information used for this registration submission - Updates account billing address - Kept here for each request
+    bill_lname TINYTEXT NULL,
+    bill_org TINYTEXT NULL,
+    bill_title TINYTEXT NULL,
+    bill_addr1 TINYTEXT NULL,
+    bill_addr2 TINYTEXT NULL,
+    bill_city TINYTEXT NULL,
+    bill_state TINYTEXT NULL,
+    bill_zip TINYTEXT NULL,
+    bill_country TINYTEXT NULL,
+    bill_phone TINYTEXT NULL,
+    bill_email TINYTEXT NULL,
+    date_submitted DATE NULL,                                   -- Date of final submission (checkout complete)
+    pay_method INT NULL,                                        -- See payment_method in plugin.ini
+    payment_code TINYTEXT NULL,                                 -- Payment_code text (comp code) - if submitted and validated
+    status SMALLINT NULL,                                       -- See submission_status in plugin.ini
+    total DOUBLE PRECISION NULL,                                -- Total charge including all fees and taxes
+    total_discounts DOUBLE PRECISION NULL,                      -- Total of all comps and discounts
+    registrants SMALLINT NULL,                                  -- Total number of registrants in this cart
+    cc_type TINYINT NULL,                                       -- Credit Card type (if used) - See credit_card in plugin.ini
+    cc_name TINYTEXT NULL,                                      -- Name on Credit Card or Name on Check
+    cc_numb TINYTEXT NULL,                                      -- Credit Card Number or Check Number
+    cc_exp TINYTEXT NULL,
+    cc_cvv TINYTEXT NULL,
+    cc_conf TINYTEXT NULL,                                      -- Confirmation code back from card processor
+    cc_proc_mesg TINYTEXT NULL,                                 -- Message received from payment processor
+    summary TEXT NULL,                                          -- HTML summary of cart contents, costs and payment - Use same HTML displayed to user
+    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    user_trace_info TEXT NULL,                                  -- IP Address of user computer and timestamp
+    date_created DATETIME NULL,                                 -- Date request was first created
+    last_update DATETIME NULL,                                  -- Last update date/time - Used for timing out pending carts and attendee counts
+    PRIMARY KEY (id),
+    INDEX (account),
+    INDEX (date_submitted)
+);
+
+----
+
+-- Registration for a specific event
+-- Has one or more reg_selected_rate records associated with it
+CREATE TABLE {prefix}reg_request_event (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_request INT NULL,                                       -- Pointer to reg_request table
+    reg_event INT NULL,                                         -- Pointer to reg_event
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    PRIMARY KEY (id),
+    INDEX (reg_request),
+    INDEX (reg_event)
+);
+
+----
+
+--  A particular reg_class selected
+--  Has one or more reg_request_rate records associated with it
+CREATE TABLE {prefix}reg_request_class (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event entry
+    reg_request INT NULL,                                       -- Pointer to the registration request record
+    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
+    class INT NULL,                                             -- Pointer to event reg_class table - False (0) if registration class no longer exits
+    class_name TINYTEXT NULL,                                   -- Name of event class at the time selected
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    PRIMARY KEY (id),
+    INDEX (reg_event),
+    INDEX (reg_request_event)
+);
+
+----
+
+--  A particular reg_rate selected
+--  Has one or more reg_request_registrant records associated with it
+CREATE TABLE {prefix}reg_request_rate (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event entry
+    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 - False (0) if registration rate no longer exists
+    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 registrants included in base rate at time of registration
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    PRIMARY KEY (id),
+    INDEX (reg_event),
+    INDEX (reg_request_event),
+    INDEX (reg_request_class)
+);
+
+----
+
+--  A specific registrant for a selected registration rate
+CREATE TABLE {prefix}reg_request_registrant (
+    id INT NOT NULL AUTO_INCREMENT,
+    account INT NULL,                                           -- Pointer to the account entry for the person being registered - False (0) if account no longer exists or registrant account not needed
+    reg_event INT NULL,                                         -- Pointer to reg_event entry
+    reg_time INT NULL,                                          -- Pointer reg_time entry
+    event_datetime DATETIME NULL,                               -- Date and time of event time selected so it will always be in the cart
+    reg_request INT NULL,                                       -- Pointer to the registration request record
+    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
+    reg_request_class INT NULL,                                 -- Pointer to reg_request_class table entry
+    reg_request_rate INT NULL,                                  -- Pointer to reg_request_rate table entry
+    not_attending BOOLEAN DEFAULT false,                        -- Flag to say if registrant is not attending - set to true when not attending
+    fname TINYTEXT NULL,                                        -- First name of registrant at the time of selection
+    lname TINYTEXT NULL,                                        -- Last name of registrant at the time of selection
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    PRIMARY KEY (id),
+    INDEX (account),
+    INDEX (reg_event),
+    INDEX (reg_time),
+    INDEX (reg_request),
+    INDEX (reg_request_event),
+    INDEX (reg_request_class),
+    INDEX (reg_request_rate)
+);
+
+----
+
+--  A specific use of a payment code in this request
+CREATE TABLE {prefix}reg_request_pay_code (
+    id INT NOT NULL AUTO_INCREMENT,
+    payment_code INT NULL,                                      -- Pointer to payment code
+    code TINYTEXT NULL,                                         -- Copy of Payment Code text in case payment code is deleted or changed
+    reg_request INT NULL,                                       -- Pointer to the registration request record
+    credit DOUBLE PRECISION NULL,                               -- Total credit for this payment code
+    expire_date DATE NULL,                                      -- Expiration Date - NOT USING NOW - Getting from payment_code table always
+    PRIMARY KEY (id),
+    INDEX (payment_code),
+    INDEX (reg_request)
+);
+
+----
+
+-- Insert into management table
+INSERT INTO {prefix}management
+    (
+    canonical_reg_page,
+    reg_org_name,
+    reg_org_short,
+    reg_org_address,
+    reg_org_city,
+    reg_org_state,
+    reg_org_zip,
+    reg_org_phone,
+    reg_org_toll_free,
+    reg_org_internal_email,
+    reg_org_from_email,
+    reg_payment_methods,
+    reg_proc_methods,
+    reg_cc_accepts,
+    reg_authorize_net_login,
+    reg_authorize_net_key,
+    reg_authorize_net_test,
+    reg_authorize_net_conf,
+    reg_authorize_net_merchant_email,
+    reg_merchant_solutions_acctid,
+    reg_merchant_solutions_merchantpin,
+    reg_merchant_solutions_test,
+    reg_full_billing_info,
+    reg_bill_info_req_no_charge,
+    reg_bill_info_req_comp_code,
+    reg_bill_info_req_cash,
+    reg_bill_info_req_check,
+    reg_bill_info_req_credit_card,
+    reg_bill_info_req_merchant_call,
+    reg_medical_info
+    )
+    VALUES
+    (
+    'registrations',                                            -- reg_canonical_reg_page,
+    'Gaslight Media',                                           -- reg_org_name,
+    'GLM',                                                      -- reg_org_short,
+    '120 E. Lake St.',                                          -- reg_org_address,
+    'Petoskey',                                                 -- reg_org_city,
+    'MI',                                                       -- reg_org_state,
+    '49770',                                                    -- reg_org_zip,
+    '231-487-0692',                                             -- reg_org_phone,
+    '800-123-1234',                                             -- reg_org_toll_free,
+    'internal@gaslightmedia.com',                               -- reg_org_internal_email,
+    'info@gaslightmedia.com',                                   -- reg_org_from_email,
+    0,                                                          -- reg_payment_methods,
+    0,                                                          -- reg_proc_methods,
+    0,                                                          -- reg_cc_accepts,
+    '',                                                         -- reg_authorize_net_login,
+    '',                                                         -- reg_authorize_net_key,
+    1,                                                          -- reg_authorize_net_test,
+    true,                                                       -- reg_authorize_net_conf
+    '',                                                         -- reg_authorize_net_merchant_email,
+    '',                                                         -- reg_merchant_solutions_acctid,
+    '',                                                         -- reg_merchant_solutions_merchantpin,
+    1,                                                          -- reg_merchant_solutions_test,
+    true,                                                       -- reg_full_billing_info,
+    0,                                                          -- reg_bill_info_req_no_charge,
+    0,                                                          -- reg_bill_info_req_comp_code,
+    0,                                                          -- reg_bill_info_req_cash,
+    0,                                                          -- reg_bill_info_req_check,
+    0,                                                          -- reg_bill_info_req_credit_card,
+    0,                                                          -- reg_bill_info_req_merchant_call,
+    true                                                        -- reg_medical_info,
+    );
+
+----
+
+-- Insert into settings_terms table
+INSERT INTO {prefix}settings_terms
+    (
+    reg_term_registrations_name,
+    reg_term_registration,
+    reg_term_registration_cap,
+    reg_term_registration_plur,
+    reg_term_registration_plur_cap,
+    reg_term_register,
+    reg_term_register_cap,
+    reg_term_registers,
+    reg_term_registering,
+    reg_term_registering_cap,
+    reg_term_registered,
+    reg_term_registered_cap,
+    reg_term_attendee,
+    reg_term_attendee_cap,
+    reg_term_attendee_plur,
+    reg_term_attendee_plur_cap,
+    reg_term_attending,
+    reg_term_attended,
+    reg_term_registered_user,
+    reg_term_registered_user_cap,
+    reg_term_registered_user_plur,
+    reg_term_registered_user_plur_cap,
+    reg_term_event,
+    reg_term_event_cap,
+    reg_term_event_plur,
+    reg_term_event_plur_cap,
+    reg_term_id,
+    reg_term_id_cap,
+    reg_term_id_plur,
+    reg_term_id_plur_cap,
+    reg_term_password,
+    reg_term_password_cap,
+    reg_term_password_plur,
+    reg_term_password_plur_cap,
+    reg_term_instructor,
+    reg_term_instructor_cap,
+    reg_term_instructor_plur,
+    reg_term_instructor_plur_cap,
+    reg_term_payment_code,
+    reg_term_payment_code_cap,
+    reg_term_payment_code_plur,
+    reg_term_payment_code_plur_cap,
+    reg_term_registration_button,
+    reg_term_contact_information
+    )
+    VALUES
+    (
+    'Event Registrations',                                      -- reg_term_registrations_name
+    'registration',                                             -- reg_term_registration
+    'Registration',                                             -- reg_term_registration_cap
+    'registrations',                                            -- reg_term_registration_plur
+    'Registrations',                                            -- reg_term_registration_plur_cap
+    'register',                                                 -- reg_term_registe
+    'Register',                                                 -- reg_term_register_cap
+    'registers',                                                -- reg_term_registers
+    'registering',                                              -- reg_term_registering
+    'Registering',                                              -- reg_term_registering_cap
+    'registered',                                               -- reg_term_registered
+    'Registered',                                               -- reg_term_registered_cap
+    'attendee',                                                 -- reg_term_attendee
+    'Attendee',                                                 -- reg_term_attendee_cap
+    'attendees',                                                -- reg_term_attendee_plur
+    'Attendees',                                                -- reg_term_attendee_plur_cap
+    'attending',                                                -- reg_term_attending
+    'attended',                                                 -- reg_term_attended
+    'user',                                                     -- reg_term_registered_user
+    'User',                                                     -- reg_term_registered_user_cap
+    'users',                                                    -- reg_term_registered_user_plur
+    'Users',                                                    -- reg_term_registered_user_plur_cap
+    'event',                                                    -- reg_term_event
+    'Event',                                                    -- reg_term_event_cap
+    'events',                                                   -- reg_term_event_plur
+    'Events',                                                   -- reg_term_event_plur_cap
+    'ID',                                                       -- reg_term_id
+    'ID',                                                       -- reg_term_id_cap
+    'IDs',                                                      -- reg_term_id_plur
+    'IDs',                                                      -- reg_term_id_plur_cap
+    'password',                                                 -- reg_term_password
+    'passwords',                                                -- reg_term_password_cap
+    'Password',                                                 -- reg_term_password_plur
+    'Passwords',                                                -- reg_term_password_plur_cap
+    'instructor',                                               -- reg_term_instructor
+    'Instructor',                                               -- reg_term_instructor_cap
+    'instructors',                                              -- reg_term_instructor_plur
+    'Instructors',                                              -- reg_term_instructor_plur_cap
+    'payment code',                                             -- reg_term_payment_code
+    'Payment code',                                             -- reg_term_payment_code_cap
+    'payment codes',                                            -- reg_term_payment_code_plur
+    'Payment codes',                                            -- reg_term_payment_code_plur_cap
+    'Register for Event',                                       -- reg_term_registration_button
+    'Contact Information'                                       -- reg_term_contact_information
+    );
+
+----
+
+-- Insert into misc table
+INSERT INTO {prefix}misc
+    (
+    reg_bulletin,
+    cart_page_text,
+    checkout_page_text,
+    summary_page_text,
+    reg_terms,
+    notify_subject,
+    notify_text,
+    instr_notify_subject,
+    instr_notify_text,
+    submission_notify_subject,
+    submission_notify_text,
+    registrant_notify_subject,
+    registrant_notify_text,
+    submission_ack_subject,
+    submission_ack_text,
+    registrant_ack_subject,
+    registrant_ack_text
+    )
+    VALUES
+    (
+    'Registration Bulletin Text',
+    'Text for top of Cart Page',
+    'Text for top of Checkout Page',
+    'Text for top of Summary Page',
+    'Terms and Conditions',
+    'Subject of notification to site owner of a registration',
+    'Text of notification to site owner of a registration',
+    'Subject of notification to instructor of registration',
+    'Text for notification to instructor of registration',
+    'Subject of notification to person submitting registration',
+    'Text of notification to person submitting registration',
+    'Subject for notification to registrant',
+    'Text for notification to registrant',
+    'Subject of acknowledgement to person submitting registration',
+    'Text of acknowledgement to person submitting registration',
+    'Subject of acknowledgement to registrant',
+    'Text of acknowledgement to registrant'
+    );
index 7dae6f2..88444c0 100644 (file)
@@ -30,8 +30,8 @@ $glmMembersRegistrationsDbVersions = array(
     '0.0.14' => array('version' => '0.0.14', 'tables' => 20, 'date' => '10/13/2017'),
     '0.0.15' => array('version' => '0.0.15', 'tables' => 15, 'date' => '10/18/2017'),
     '0.0.16' => array('version' => '0.0.16', 'tables' => 15, 'date' => '10/24/2017'),
-    '0.0.17' => array('version' => '0.0.17', 'tables' => 15, 'date' => '11/3/2017'),
-    '0.0.18' => array('version' => '0.0.18', 'tables' => 15, 'date' => '11/7/2017'),
+    '0.0.17' => array('version' => '0.0.17', 'tables' => 15, 'date' => '11/03/2017'),
+    '0.0.18' => array('version' => '0.0.18', 'tables' => 15, 'date' => '11/07/2017'),
     '0.0.19' => array('version' => '0.0.19', 'tables' => 15, 'date' => '11/22/2017'),
     '0.0.20' => array('version' => '0.0.20', 'tables' => 16, 'date' => '01/02/2018'),
     '0.0.21' => array('version' => '0.0.21', 'tables' => 17, 'date' => '01/08/2018'),
@@ -41,7 +41,8 @@ $glmMembersRegistrationsDbVersions = array(
     '0.0.25' => array('version' => '0.0.25', 'tables' => 18, 'date' => '02/02/2018'),
     '0.0.26' => array('version' => '0.0.26', 'tables' => 18, 'date' => '03/27/2018'),
     '0.0.27' => array('version' => '0.0.27', 'tables' => 18, 'date' => '04/05/2018'),
-    '0.0.28' => array('version' => '0.0.28', 'tables' => 18, 'date' => '04/12/2018')
+    '0.0.28' => array('version' => '0.0.28', 'tables' => 18, 'date' => '04/12/2018'),
+    '0.0.29' => array('version' => '0.0.29', 'tables' => 18, 'date' => '05/04/2018')
 );
 
 
diff --git a/setup/databaseScripts/drop_database_V0.0.28.sql b/setup/databaseScripts/drop_database_V0.0.28.sql
deleted file mode 100644 (file)
index 2ac0fe3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
--- Gaslight Media Members Database
--- File Created: 12/09/14 15:27:15
--- Database Version: 0.0.19
--- Database Deletion Script
--- Note: Tables with DELETE CASCADE must appear before referenced table
-
-DROP TABLE IF EXISTS
-    {prefix}management,
-    {prefix}settings_terms,
-    {prefix}misc,
-    {prefix}payment_code,
-    {prefix}reg_event,
-    {prefix}reg_time,
-    {prefix}reg_time_pending,
-    {prefix}reg_class,
-    {prefix}reg_rate,
-    {prefix}reg_notification,
-    {prefix}account,
-    {prefix}reg_request,
-    {prefix}reg_request_event,
-    {prefix}reg_request_class,
-    {prefix}reg_request_rate,
-    {prefix}reg_request_registrant,
-    {prefix}reg_request_pay_code
-;
-
diff --git a/setup/databaseScripts/drop_database_V0.0.29.sql b/setup/databaseScripts/drop_database_V0.0.29.sql
new file mode 100644 (file)
index 0000000..2ac0fe3
--- /dev/null
@@ -0,0 +1,26 @@
+-- Gaslight Media Members Database
+-- File Created: 12/09/14 15:27:15
+-- Database Version: 0.0.19
+-- Database Deletion Script
+-- Note: Tables with DELETE CASCADE must appear before referenced table
+
+DROP TABLE IF EXISTS
+    {prefix}management,
+    {prefix}settings_terms,
+    {prefix}misc,
+    {prefix}payment_code,
+    {prefix}reg_event,
+    {prefix}reg_time,
+    {prefix}reg_time_pending,
+    {prefix}reg_class,
+    {prefix}reg_rate,
+    {prefix}reg_notification,
+    {prefix}account,
+    {prefix}reg_request,
+    {prefix}reg_request_event,
+    {prefix}reg_request_class,
+    {prefix}reg_request_rate,
+    {prefix}reg_request_registrant,
+    {prefix}reg_request_pay_code
+;
+
diff --git a/setup/databaseScripts/update_database_V0.0.29.sql b/setup/databaseScripts/update_database_V0.0.29.sql
new file mode 100644 (file)
index 0000000..fedf42b
--- /dev/null
@@ -0,0 +1,23 @@
+-- Gaslight Media Members Database  - Registratiuons Add-On
+-- File Updated: 2018-04-12
+-- Database Version: 0.0.29
+-- 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_request_hold_days BOOLEAN;
+
+----
+
+ALTER TABLE {prefix}management ADD COLUMN reg_account_hold_days BOOLEAN;
+
+----
+
+UPDATE {prefix}management SET reg_request_hold_days = 10 WHERE ID = 1;
+
+----
+
+UPDATE {prefix}management SET reg_account_hold_days = 10 WHERE ID = 1;
+
+
index 5bf8b7d..3443045 100644 (file)
@@ -76,7 +76,8 @@ $glmMembersRegistrationsAddOnValidActions = array(
             'requests'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
             'accounts'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
             'reports'                   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
-            'sendNotifications'         => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
+            'sendNotifications'         => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+            'purgeOld'                  => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
         ),
         'management' => array(
             'registrations'             => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
index 5319d48..3b5db9c 100644 (file)
                         <td></td>
                         <th><p>Other General Options</p></th>
                     </tr>
+                    <tr>
+                        <th class="glm-nowrap-left-align{if $regSettings.fieldRequired.reg_request_hold_days} glm-required{/if}">Incomplete Request Retention Days:</th>
+                        <td {if $regSettings.fieldFail.reg_request_hold_days}class="glm-form-bad-input"{/if}>
+                            <input type="text" name="reg_request_hold_days" value="{$regSettings.fieldData.reg_request_hold_days}" class="glm-form-text-input-veryshort">
+                            {if $regSettings.fieldFail.reg_request_hold_days}<p>{$regSettings.fieldFail.reg_request_hold_days}</p>{/if}
+                        </td>
+                    </tr>
+                    <tr>
+                        <th class="glm-nowrap-left-align{if $regSettings.fieldRequired.reg_account_hold_days} glm-required{/if}">Unused Account Retention Days:</th>
+                        <td {if $regSettings.fieldFail.reg_account_hold_days}class="glm-form-bad-input"{/if}>
+                            <input type="text" name="reg_account_hold_days" value="{$regSettings.fieldData.reg_account_hold_days}" class="glm-form-text-input-veryshort">
+                            {if $regSettings.fieldFail.reg_account_hold_days}<p>{$regSettings.fieldFail.reg_account_hold_days}</p>{/if}
+                        </td>
+                    </tr>
                     </tr>
                         <th>Display additional navigation aids</th>
                         <td>
index 2dc4e15..b36e7a5 100644 (file)
@@ -25,8 +25,8 @@
     <p><b>Total found:</b> {$numAccounts}&nbsp;&nbsp;</p>
 
     {if $paging && $numAccounts}
-        <input type="Submit" name="pageSelect" value="Previous {$limit} {$terms.reg_term_event_plur_cap}" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
-        <input type="Submit" name="pageSelect" value="Next {$limit} {$terms.reg_term_event_plur_cap}" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+        <input type="Submit" name="pageSelect" value="Previous {$limit} Accounts" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+        <input type="Submit" name="pageSelect" value="Next {$limit} Accounts" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
     {/if}
 
 {if $hasAccounts}
@@ -37,6 +37,7 @@
                 <th>ID</th>
                 <th>Member ID</th>
                 <th>Active</th>
+                <th>Validated</th>
                 <th>First Name</th>
                 <th>Last Name</th>
                 <th>E-Mail Address</th>
@@ -58,6 +59,7 @@
             <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-accounts&glm_action=accounts&option=accountDashboard&accountID={$account.id}">{$account.id}</a></td>
             <td>{$account.member_id}</td>
             <td>{$account.active.name}</td>
+            <td>{$account.validated.name}</td>
             <td>{$account.fname}</td>
             <td>{$account.lname}</td>
             <td>{$account.email}</td>
@@ -74,8 +76,8 @@
 {/if}
 
     {if $paging && $numAccounts}
-        <input type="Submit" name="pageSelect" value="Previous {$limit} {$terms.reg_term_event_plur_cap}" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
-        <input type="Submit" name="pageSelect" value="Next {$limit} {$terms.reg_term_event_plur_cap}" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+        <input type="Submit" name="pageSelect" value="Previous {$limit} Accounts" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+        <input type="Submit" name="pageSelect" value="Next {$limit} Accounts" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
     {/if}
 
     </form>
index fb36c88..489d7a4 100644 (file)
@@ -80,6 +80,7 @@
                 {if $regEvent.fieldFail.reg_hold_minutes}<p>{$regEvent.fieldFail.reg_hold_minutes}</p>{/if}<br>
                 </td>
             </tr>
+<!-- No longer in use, now using defined parameter for all hold days for all requests
             <tr>
                 <th {if $regEvent.fieldRequired.cart_hold_days}class="glm-required-nowrap-left-align"{else}class="glm-nowrap-left-align"{/if}>Cart Hold (days):</th>
                 <td {if $regEvent.fieldFail.cart_hold_days}class="glm-form-bad-input" data-tabid="glm-cart_hold_days"{/if}>
@@ -90,6 +91,7 @@
                 {if $regEvent.fieldFail.cart_hold_days}<p>{$regEvent.fieldFail.cart_hold_days}</p>{/if}<br>
                 </td>
             </tr>
+-->            
             <tr>
                 <th {if $regEvent.fieldRequired.reg_hours_before}class="glm-required-nowrap-left-align"{else}class="glm-nowrap-left-align"{/if}>End of {$terms.reg_term_registration_cap}:</th>
                 <td {if $regEvent.fieldFail.reg_hours_before}class="glm-form-bad-input" data-tabid="glm-reg_hours_before"{/if}>
index 40f993d..d5b910f 100644 (file)
         </script>
 
         <script type="text/template" id="regClass-template">
-<div style="background-color: white; padding: .25rem; border: 1px solid black;">
-            <div class="class-display-template">
-                <div class="glm-class-header">
-                    <div class="glm-right">
-                        <a class="class-edit button button-secondary glm-button-small">Edit</a>
-                        <a class="class-delete button button-secondary glm-button-small">Delete</a>
-                        <a class="class-add-rate button button-secondary glm-button-small">Add Rate</a>
-                    </div>
-                    <div class="glm-class-label">
-                        <h3><%= name %></h3>
+            <div style="background-color: white; padding: .25rem; border: 1px solid black;">
+                <div class="class-display-template">
+                    <div class="glm-class-header">
+                        <div class="glm-right">
+                            <a class="class-edit button button-secondary glm-button-small">Edit</a>
+                            <a class="class-delete button button-secondary glm-button-small">Delete</a>
+                            <a class="class-add-rate button button-secondary glm-button-small">Add Rate</a>
+                        </div>
+                        <div class="glm-class-label">
+                            <h3><%= name %></h3>
+                        </div>
                     </div>
+                    <%= descr %>
                 </div>
-                <%= descr %>
-            </div>
-            <div class="class-edit-template" style="display: none;">
-                <div class="glm-class-header">
-                    <div class="glm-right">
-                        <a class="class-cancel button glm-button-small">Cancel</a>
-                        <a class="class-update button glm-button-small-highlighted">Update</a>
-                        <a class="class-add button glm-button-small-highlighted" style="display: none;">Add</a>
-                        <a class="class-delete button button-secondary glm-button-small">Delete</a>
-                    </div>
-                    <div class="glm-class-label" style="padding-bottom: .3em;">
-                        <b>Level Name:</b> <input class="class-name" type="text" name="name_<% if (id) { %><%- id %><% } else { %> new <% } %>" value="<% if (name) { %><%- name %><% } %>">
+                <div class="class-edit-template" style="display: none;">
+                    <div class="glm-class-header">
+                        <div class="glm-right">
+                            <a class="class-cancel button glm-button-small">Cancel</a>
+                            <a class="class-update button glm-button-small-highlighted">Update</a>
+                            <a class="class-add button glm-button-small-highlighted" style="display: none;">Add</a>
+                            <a class="class-delete button button-secondary glm-button-small">Delete</a>
+                        </div>
+                        <div class="glm-class-label" style="padding-bottom: .3em;">
+                            <b>Level Name:</b> <input class="class-name" type="text" name="name_<% if (id) { %><%- id %><% } else { %> new <% } %>" value="<% if (name) { %><%- name %><% } %>">
+                        </div>
                     </div>
+                    <b>Description:</b> <input class="class-descr" type="text" name="reg_descr_<% if (id) { %><%- id %><% } else { %> new <% } %>" size="90" value="<% if (descr) { %><%- descr %><% } %>">
+                </div>
+                <div class="class-rate-container">
                 </div>
-                <b>Description:</b> <input class="class-descr" type="text" name="reg_descr_<% if (id) { %><%- id %><% } else { %> new <% } %>" size="90" value="<% if (descr) { %><%- descr %><% } %>">
-            </div>
-            <div class="class-rate-container">
             </div>
-</div>
         </script>
 
         <script type="text/template" id="regRate-template">
index a7b65d6..4281cff 100644 (file)
@@ -34,7 +34,7 @@
                         required
                         type="text"
                         name="name[{if $newEntry}-1{else}{$regNotifications.fieldData.id}{/if}]"
-                        value="{if !$newEntry}{$regNotifications.fieldData.name}{/if}"
+                        value="{if !$newEntry}{$regNotifications.fieldData.name|stripslashes}{/if}"
                         class="glm-form-text-input-medium-long">
                     </div>
                 </div>
         </div>
     </div>
     <div class="glm-row">
-        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event.name}</h3></div>
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$last_name}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Last name of {/literal}{$terms.reg_term_attendee}{literal}.</div>
+    </div>
+    <div class="glm-row">
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$first_name}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">First name of {/literal}{$terms.reg_term_attendee}{literal}.</div>
+    </div>
+    <div class="glm-row">
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event_name}</h3></div>
         <div class="glm-small-12 glm-large-9 glm-column">Name of the {/literal}{$terms.reg_term_event}{literal}.</div>
     </div>
     <div class="glm-row">
-        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event.date}</h3></div>
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event_date}</h3></div>
         <div class="glm-small-12 glm-large-9 glm-column">Date for which the {/literal}{$terms.reg_term_attendee} has {$terms.reg_term_registered}{literal}.</div>
     </div>
     <div class="glm-row">
-        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event.time}</h3></div>
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event_time}</h3></div>
         <div class="glm-small-12 glm-large-9 glm-column">Time for which the {/literal}{$terms.reg_term_attendee} has {$terms.reg_term_registered}{literal}.</div>
     </div>
     <div class="glm-row">
-        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$registration.level}</h3></div>
-        <div class="glm-small-12 glm-large-9 glm-column">{/literal}{$terms.reg_term_registration_cap}{literal} Level</div>
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$level}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">{/literal}{$terms.reg_term_registration_cap} {$terms.reg_term_level}{literal}</div>
     </div>
+
     <div class="glm-row">
-        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$last.name}</h3></div>
-        <div class="glm-small-12 glm-large-9 glm-column">Last name of {/literal}{$terms.reg_term_attendee}{literal}.</div>
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$from_name}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Full name of your organization.</div>
     </div>
     <div class="glm-row">
-        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$first.name}</h3></div>
-        <div class="glm-small-12 glm-large-9 glm-column">First name of {/literal}{$terms.reg_term_attendee}{literal}.</div>
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$from_short_name}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Short name of your organization.</div>
+    </div>
+    <div class="glm-row">
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$from_address}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Your organization's street address.</div>
+    </div>
+    <div class="glm-row">
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$from_city}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Your organization's city.</div>
+    </div>
+    <div class="glm-row">
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$from_state}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Your organization's state.</div>
+    </div>
+    <div class="glm-row">
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$from_zip}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Your organization's ZIP/Postal code.</div>
+    </div>
+    <div class="glm-row">
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$from_phone]}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Your organization's phone number.</div>
+    </div>
+    <div class="glm-row">
+        <div class="glm-small-12 glm-large-2 glm-column"><h3>{$from_email}</h3></div>
+        <div class="glm-small-12 glm-large-9 glm-column">Your organization's E-Mail address.</div>
     </div>
 </div>
 {/literal}
index e30c320..ee862d8 100644 (file)
@@ -29,7 +29,7 @@
             {foreach $regNotifications as $n}
                 <tr class="{if $n@iteration is div by 2}alternate{/if}">
                     <td><a href="{$thisUrl}?page={$thisPage}&option=notifications&regEventID={$regEventID}&id={$n.id}">{$n.id}</a></td>
-                    <td><a href="{$thisUrl}?page={$thisPage}&option=notifications&regEventID={$regEventID}&id={$n.id}">{$n.name}</a></td>
+                    <td><a href="{$thisUrl}?page={$thisPage}&option=notifications&regEventID={$regEventID}&id={$n.id}">{$n.name|stripslashes}</a></td>
                     <td>{$n.notification_days|regex_replace:"/[-]/":""} days {if $n.notification_days > 0 }After{else}Before{/if}</td>
                     <td>
                         <a
index 4c8fd4b..afb9ced 100644 (file)
     <div>
         <p>
             <span class="glm-nowrap">
-                <b>Show Completed Only:</b>
+                <b>Don't show attendees in pending or invalid carts:</b>
                 <input type="checkbox" name="complete" value="1"{if $completed} checked{/if}>
             </span>
             <span class="glm-nowrap">
                 <b>Text Search:</b>
                 <input type="text" name="textSearch" value="{if $textSearch}{$textSearch}{/if}">
             </span>
+    {if $haveTimes}
+            <span class="glm-nowrap">
+                <b>Time Selected</b>
+                <select name="time">
+                    <option value=""></option>
+      {foreach $times as $time}
+                    <option value="{$time.id}"{if $selectedTime == $time.id} selected{/if}>{$time.start_datetime.datetime}</option>
+      {/foreach}                     
+                </select>
+            </span>
+    {/if}            
             <span clas="glm-nowrap">
                 <input type="submit" value="Submit">
             </span>
@@ -46,6 +57,9 @@
         <input type="hidden" name="page" value="{$thisPage}">
         <input type="hidden" name="option" value="registrants">
         <input type="hidden" name="regEventID" value="{$regEvent.id}">
+        <input type="hidden" name="complete" value="{if $completed}1{else}0{/if}">
+        <input type="hidden" name="textSearch" value="{if $textSearch}{$textSearch}{/if}">
+        <input type="hidden" name="time" value="{if $selectedTime}{$selectedTime}{/if}">
         <input type="hidden" name="prevStart" value="{$prevStart}">
         <input type="hidden" name="nextStart" value="{$nextStart}">
         <input type="hidden" name="limit" value="{$limit}">
                 <th>Rate</th>
                 <th>Status</th>
                 <th>Submitted</th>
+                <th>Not Attending</th>
             </tr>
         </thead>
         <tbody>
         {if $haveRegistrants}
             {assign var="i" value="0"}
             {foreach $registrants as $r}
-            <tr class="glm-attendee-line glm-edit-form glm-attendee-{$r.id}{if $i++ is odd by 1} {/if}" data-attendee="{$r.id}">
+            <tr id="glmRegAttedeeLine_{$r.id}" class="glm-attendee-line glm-edit-form glm-attendee-{$r.id}{if $i++ is odd by 1}{/if} {if $r.not_attending.value} glm-reg-gray{/if}" data-attendee="{$r.id}">
                 <td>
                     <span style="clear:right;float:left;display:block;width:100%;">
                         <span class="glm-attendee-fullname-{$r.id}">{$r.fname} {$r.lname}</span>
                 <td>{$r.rate_name}</td>
                 <td>{$r.request_status_name}</td>
                 <td>{$r.date_submitted}</td>
+                <td id="glmRegNotAttendingText_{$r.id}">{if $r.not_attending.value}NOT ATTENDING{/if}</td>
             </tr>
             <tr id="attendeeLinks_{$r.id}" class="glm-hidden glm-attendee-links"">
                 <td colspan="5" style="padding: .8rem; background-color: #fff;>
                     <span class="attendee-edit-link">
-                        <a class="glm-edit" href="#" data-registrant="{$r.id}">Edit {$terms.reg_term_attendee_cap}</a> |
+                        <a class="glm-edit" href="#" data-registrant="{$r.id}" data-class="{$r.class_id}">Edit {$terms.reg_term_attendee_cap}</a> |
                     </span>
                     <span class="attendee-edit-link">
                         <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.reg_request}">View Request</a> |
                     <div class="glm-row" style="margin-bottom: 0px !important; margin-top: .5rem;">
                         <div id="glm-attendee-{$r.id}" class="glm-columns glm-small-{if apply_filters('glm-members-customfields-plugin-active', false)}6{else}12{/if}">
                             <b>{$r.account.email}</b>
+                            <p>
+                                <input id="glmRegNotAttending_{$r.id}" type="checkbox" name="not_attending" value="1"{if $r.not_attending.value} checked{/if}> Not Attending<br>
+                                Note that if check this the inventory will be returned to permit another {$terms.reg_term_attendee} to {$terms.reg_term_register}.
+                                If you un-check this it will check to see if inventory is available and if not will not change this to {$terms.reg_term_attending}.
+                            </p>
                             <label>First Name</label>
                             <input class="glm-form-text-input-medium" type="text" name="fname" value="{$r.fname}">
                             <label>Last Name</label>
                         {if apply_filters('glm-members-customfields-plugin-active', false)}
                         <form action="#" id="glm-attendee-form-{$r.id}">
                             <div class="glm-columns glm-small-5">
-                                Additional Info
                                 <div class="customfields-attendee-{$r.id}">
                                 </div>
                             </div>
                     <div class="glm-row">
                         <div class="glm-columns glm-small-7">
                             <button class="glm-cancel button button-secondary" data-registrant="{$r.id}">Cancel</button>
-                            <button class="glm-update button button-secondary" data-registrant="{$r.id}">Update</button>
+                            <button class="glm-update button button-secondary" data-registrant="{$r.id}" data-class="{$r.class_id}">Update</button>
                         </div>
                     </div>
                 </td>
         <input type="hidden" name="page" value="{$thisPage}">
         <input type="hidden" name="option" value="registrants">
         <input type="hidden" name="regEventID" value="{$regEvent.id}">
+        <input type="hidden" name="complete" value="{if $completed}1{else}0{/if}">
+        <input type="hidden" name="textSearch" value="{if $textSearch}{$textSearch}{/if}">
+        <input type="hidden" name="time" value="{if $selectedTime}{$selectedTime}{/if}">
         <input type="hidden" name="prevStart" value="{$prevStart}">
         <input type="hidden" name="nextStart" value="{$nextStart}">
         <input type="hidden" name="limit" value="{$limit}">
             <tr><th>Show Only Completed:</th><td><input type="checkbox" name="complete" value="1"></td></tr>
             <tr>
                 <th>Name Search:</th>
-                <td><input type="text" name="text_search" value=""></td>
+                <td><input type="text" name="text_search" value=""></td>Charles Scott, President
+Gaslight Media
+120 E. Lake Street
+Petoskey, MI 49770
+http://www.gaslightmedia.com
+
+E-Mail: cscott@gaslightmedia.com
+Office: 231-487-0692
             </tr>
             <tr>
                 <th>Fields to export:</th>
                                 <input type="checkbox" name="exportEmail" checked> Email <br>
                                 <input type="checkbox" name="exportPhone" checked> Phone <br>
                                 <input type="checkbox" name="exportCounty" checked> County <br>
-                                <input type="checkbox" name="exportLevel" checked> Level <br>
+                                <input type="checkbox" name="exportLevel" checked> Level <br>                        '%s',
+                        '%s',
+                                
                                 <input type="checkbox" name="exportTime" checked> Date/Time <br>
                                 <input type="checkbox" name="exportRate" checked> Rate <br>
                                 <input type="checkbox" name="exportStatus" checked> Status <br>
@@ -225,7 +257,7 @@ jQuery(document).ready(function($){
         $('#exportRegistrantsDialog').dialog('close');
     });
 
-    // Setup the select and unselect all
+    // Setup the Export select and unselect all
     $('#selectAllExportFields').click(function(){
         $('.exportFieldsTd input[type="checkbox"]').each(function(){
             $(this).prop('checked', true);
@@ -236,13 +268,42 @@ jQuery(document).ready(function($){
             $(this).prop('checked', false);
         });
     });
+    
+    // Edit registrant
     $('.glm-edit').click(function(e){
         e.preventDefault();
         attendeeLinksEditSelected();
         $('.glm-edit-form-' + $(this).data('registrant')).show();
 //        $('.glm-attendee-' + $(this).data('registrant')).hide();
+
+        // If custom fields plugin is active - get custom fields for this attendee 
+  {if apply_filters('glm-members-customfields-plugin-active', false)}
+
+        // Get registrant ID and Class ID
         var refId = $(this).data('registrant');
-        {if apply_filters('glm-members-customfields-plugin-active', false)}
+        var classId = $(this).data('class');
+        var fieldsHtml = '';
+        
+        // Get event attendee custom fields
+        $.ajax({
+            cache: false,
+            type: 'POST',
+            url: '{$ajaxUrl}?action=glm_members_admin_ajax',
+            data: {
+                'action': 'glm_members_admin_ajax',
+                'glm_action': 'customFieldsFront',
+                'option': 'displayForm',
+                'option2': 'fieldsOnly',
+                'fid': 'glm_reg_customfields_reg_event_attendee_' + {$regEvent.id},
+                'recordId': refId,
+                'parentFormId': '',
+                'formData': false,
+            },
+        }).done(function( eventFieldsHtml ){
+
+            fieldsHtml = '<b>Additional data requested for this {$terms.reg_term_event}</b><br>' + eventFieldsHtml;
+            
+            // Next get event class attendee custom fields
             $.ajax({
                 cache: false,
                 type: 'POST',
@@ -251,38 +312,60 @@ jQuery(document).ready(function($){
                     'action': 'glm_members_admin_ajax',
                     'glm_action': 'customFieldsFront',
                     'option': 'displayForm',
-                    'fid': 'glm_reg_customfields_reg_event_attendee_' + {$regEvent.id},
+                    'option2': 'fieldsOnly',
+                    'fid': 'glm_reg_customfields_reg_event_' + {$regEvent.id} + '_level_' + classId,
                     'recordId': refId,
                     'parentFormId': '',
                     'formData': false,
                 },
-            }).done(function( formHtml ){
-                $('.customfields-attendee-' + refId).html( formHtml );
+            }).done(function( eventClassFieldsHtml ){
+
+                fieldsHtml += '<b>Additional data requested for this {$terms.reg_term_level}</b><br>' + eventClassFieldsHtml;
+
+                // Add custom fields to form
+                $('.customfields-attendee-' + refId).html( fieldsHtml);
+                
             }).fail();
-        {/if}
+
+        }).fail();
+
+        
+  {/if}
     });
+
+    // Cancel Edit
     $('.glm-cancel').click(function(e){
         e.preventDefault();
         clearAttendeeLinks();
         $('.glm-edit-form-' + $(this).data('registrant')).hide();
         $('.glm-attendee-' + $(this).data('registrant')).show();
     });
+
+    // View Account
+/*
     $('.glm-account').click(function(e){
         e.preventDefault();
     });
     $('.glm-detail').click(function(e){
         e.preventDefault();
     });
+*/    
+
+    // Submit Attendee Edit Form
     $('.glm-update').click(function(e){
         e.preventDefault();
         var refId = $(this).data('registrant');
+        var classId = $(this).data('class');
 
         // Get possible custom field data
         var attendeeFormData = $('#glm-attendee-form-' + refId).serialize();
         console.log(attendeeFormData);
 
+        var notAttending = $('#glmRegNotAttending_' + refId).prop('checked');
+        
         var accountFname = $('#glm-attendee-' + refId + ' input[name=fname]').val().trim();
         var accountLname = $('#glm-attendee-' + refId + ' input[name=lname]').val().trim();
+
         $.ajax({
             context: this,
             url: '{$ajaxUrl}?action=glm_members_admin_ajax',
@@ -294,13 +377,25 @@ jQuery(document).ready(function($){
                 reg_id: refId,
                 fname: accountFname,
                 lname: accountLname,
+                not_attending: notAttending,
                 reg_event_id: {$regEvent.id},
+                reg_class_id: classId,
                 formData: attendeeFormData,
             }
         }).done(function(account){
             // Have to change the actual td display too.
             $('.glm-attendee-fullname-' + account.id ).html( account.fname + ' ' + account.lname );
             // And update the edit form also
+            if (account.notAvailable) {
+                alert('No availability to permit this {$terms.reg_term_attendee}.');
+            }            
+            if (account.notAttending) {
+                $('#glmRegAttedeeLine_' + refId).addClass('glm-reg-gray');
+                $('#glmRegNotAttendingText_' + refId).html('NOT ATTENDING');
+            } else {
+                $('#glmRegAttedeeLine_' + refId).removeClass('glm-reg-gray');
+                $('#glmRegNotAttendingText_' + refId).html('');
+                           }
             $('#glm-attendee-form-' + account.id + ' input[name=fname]').val( account.fname );
             $('#glm-attendee-form-' + account.id + ' input[name=lname]').val( account.lname );
             $('.glm-edit-form-' + $(this).data('registrant')).hide();
index ef7e7ee..ffc5e00 100644 (file)
@@ -9,7 +9,10 @@
         <input type="hidden" name="limit" value="{$limit}">
         <input type="hidden" name="savedAlpha" value="{$alphaSelected}">
 
-        <p><h2 class="glm-admin-table-header">List&nbsp;of&nbsp;{$terms.reg_term_registration_cap}&nbsp;{$terms.reg_term_event_plur_cap}</h2></p>
+        <p>
+            <a href="{$adminUrl}?page=glm-members-admin-menu-registrations-events&option=notificationDisplay" class="button button-secondary glm-button glm-right" target="notifyEmail">Display Notification E-Mails sent today</a>
+            <h2 class="glm-admin-table-header">List&nbsp;of&nbsp;{$terms.reg_term_registration_cap}&nbsp;{$terms.reg_term_event_plur_cap}</h2>
+        </p>
         
         <div class="glm-row">   
             <b>Text Search: </b><input  class="glmRegEventsSearch" type="text" name="text_search" id="autoTest" value="{$textSearch}">
diff --git a/views/admin/registrations/notificationDisplay.html b/views/admin/registrations/notificationDisplay.html
new file mode 100644 (file)
index 0000000..ec28e13
--- /dev/null
@@ -0,0 +1,14 @@
+{include file='admin/registrations/eventHeader.html'}
+
+
+ <div id="glm-admin-member-dashboard" class="glm-admin-table">
+
+    {if $notifications == ''}
+        <h1>No notifications scheduled to be sent today.</h1>
+    {else}
+        <h1>Notifications scheduled to be sent today.</h1>
+        {$notifications}
+    {/if}
+    
+{include file='admin/footer.html'}
+
index dff8cc0..758eb99 100644 (file)
@@ -5,8 +5,18 @@
 {$acct = $cart.request.account}
 
 <div class="glm-admin-table-inner glm-admin-table">
+
+{if $deleted}
+    <div style="border-bottom: 1px solid black; padding: 10px; margin: 10px;">
+        <h2 class="glm-error">This request has been DELETED!</h2>
+        <p>* All {$terms.reg_term_attendee_plur} included in this request have been removed along with all associated data.</p>
+        <p>* All {$terms.reg_term_attendee} availability inventory that was consumed by this request has been made available again.</p>
+        <p>* This deleted request cannot be restored.</p> 
+    </div>
+{else}    
+    <a href="" class="button button-secondary glm-button glm-right" id="glm-admin-reg_delete-request">Delete Request</a>
+{/if}    
     
-    <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&glm_action=requests&option=edit&account={$acct}" class="button button-secondary glm-button glm-right">Edit Request</a>
     <h1>Request</h1>
     
     <div id="glm-admin-member-registrations-request-overview" class="glm-admin-table">
                             {if $cart.request.validated.value}Yes{else}{if $cart.request.validation_message}{$cart.request.validation_message}{else}(not yet validated){/if}{/if}
                         </div>
                     </div>
+                    <div class="glm-row">
+                        <div class="glm-small-12 glm-column">
+                            <h3>Created:</h3>
+                        </div>
+                        <div class="glm-small-12 glm-column">
+                            {$cart.request.date_created.datetime}
+                        </div>
+                    </div>
+                    <div class="glm-row">
+                        <div class="glm-small-12 glm-column">
+                            <h3>Last Update:</h3>
+                        </div>
+                        <div class="glm-small-12 glm-column">
+                            {$cart.request.last_update.datetime}
+                        </div>
+                    </div>
                 </div>
             </div>
         </div>
 
 <div class="glm-admin-table-inner glm-admin-table">
     
-    <h1>Current Cart Contents</h1>
+    <h1>Cart Contents When Submitted</h1>
+    <p class="glm-notice" style="font-size: 1.2em;">
+        NOTE: The summary below is a historical record (exact copy) of the checkout summary at the time the cart was submitted. 
+        Editing {$terms.reg_term_attendee_plur} and other updates will not change the information below.
+    </p>
     
     <div>
 
 </div>    
     
     
+<div id="deleteRegSubmissionDialog" title="Delete {$terms.reg_term_registration_cap} Confirmation">
+    <h3 class="glm-error glm-center">You are deleting the registration request shown on this page!</h3>
+    <p>Clicking "Delete This Request" below will permanently remove this request and any information associated with it.</p>
+    <h2 class="glm-error glm-center">This action is NOT REVERSABLE!</h2>
+    <p>This will:<br>
+        * Remove this request<br>
+        * Remove all {$terms.reg_term_attendee_plur} in this request from the listed events<br>
+        * Restore all inventory consumed by {$terms.reg_term_attendee_plur} in this request<br>
+        * Remove any holds on {$terms.reg_term_attendee} inventory asscoiated with this request<br>
+        * Remove any account records assoicated only with this request<br>
+        Clicking "Delete This Request" below will remove any record that this request was ever submitted
+    </p>
+    <p class="glm-notice">
+        NOTE: You may remove any specific {$terms.reg_term_attendee} from an {$terms.reg_term_event} using the
+        {$terms.reg_term_attendee_plur_cap} list for that {$terms.reg_term_event}. Doing so will retain the
+        request information and will not affect any other attendees in this request. To do this click "CLICK HERE TO CANCEL"
+        now and select the "{$terms.reg_term_event_plur_cap}" menu item at the left.
+    </p>
+    <p>To delete this request as described above, click "Delete This Request" below.</p>
+</div>
+    
+    
 
 
 </div>
         $('#viewSummaryButton').click( function() {
             $('#viewSummaryDialog').dialog('open');
         });
+
+
+        // Delete request dialog box
+        $("#deleteRegSubmissionDialog").dialog({
+            autoOpen: false,
+            resizable: true,
+            width: 700,
+            modal: true,
+            buttons: {
+                "Delete This Request" : function() {
+                    window.location.href = '{$thisUrl}?page=glm-members-admin-menu-registrations-requests&glm_action=requests&option=requestDashboard&delete=true&account={$acct}';
+                },
+                "CLICK HERE TO CANCEL" : function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+
+        $('#glm-admin-reg_delete-request').on('click', function(e) {
+            e.preventDefault();
+            $('#deleteRegSubmissionDialog').dialog('open');
+            return false;
+        });
+        
     });
 </script>
 
index e23df89..3d176c3 100644 (file)
     The name, organization, and other information are for the person sumbiting the request. Pending requests may not have this data.
 <p>
 
+<form method="post" action="{$thisUrl}?page={$thisPage}">
+    <input type="hidden" name="option" value="dashboard">
+    <input type="hidden" name="regEventID" value="{$regEvent.id}">
+    <input type="hidden" name="prevStart" value="{$prevStart}">
+    <input type="hidden" name="nextStart" value="{$nextStart}">
+    <input type="hidden" name="limit" value="{$limit}">
+    <div>
+        <p>
+            <span class="glm-nowrap">
+                <b>Show attendees in pending carts (not yet submitted):</b>
+                <input type="checkbox" name="showCartRequests" value="1"{if $showCartRequests} checked{/if}>
+            </span>
+<!--             
+            <span class="glm-nowrap">
+                <b>Text Search:</b>
+                <input type="text" name="textSearch" value="{if $textSearch}{$textSearch}{/if}">
+            </span>
+-->            
+            <span clas="glm-nowrap">
+                <input type="submit" value="Submit">
+            </span>
+        </p>
+    </div>
+</form>
+
 <div class="glm-admin-table-inner glm-admin-table">
 
         <table class="wp-list-table striped glm-admin-table">
@@ -24,6 +49,8 @@
                     <th>Country</th>
                     <th>Phone</th>
                     <th>E-mail</th>
+                    <th>Created</th>
+                    <th>Updated</th>
                     <th>Status</th>
                 </tr>
             </thead>
@@ -40,6 +67,8 @@
                     <td>{$r.bill_country}</td>
                     <td>{$r.bill_phone}</td>
                     <td>{$r.bill_email}</td>
+                    <td>{$r.date_created.datetime|substr:0:10}</td>
+                    <td>{$r.last_update.datetime|substr:0:10}</td>
                     <td>{$r.status.name}</td>
                 </tr>
         {/foreach}