Significant usability issues for admin registrations.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 17 Jul 2018 19:20:45 +0000 (15:20 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 17 Jul 2018 19:20:45 +0000 (15:20 -0400)
Fixed problem with submitting account E-Mail not being available to send message in checkoutUpdateInventoryAndNotify()
Now adding E-Mail address to create account form after checkout
Added sort option to attendee export
Removing 1969 dates (0 timestamp) in "Time Selected" picklist in Event Attendees list.
Reoganized parmeter initialization and view data for admin/registrations/events.php and sub-models. Now with appropriate model.
Added enhanced multi-pick for selection of attnedees by status and other search enhancements to registrants list.
Cleaned up missing parameters due to reorganizing parameters.
Added links from requests list to request detail and if still in cart to front-end cart.
Added links from registrants list to request detail and if still in cart to front-end cart.

25 files changed:
config/plugin.ini
models/admin/ajax/registrantsListExport.php
models/admin/registrations/events.php
models/admin/registrations/events_addEdit.php
models/admin/registrations/events_configureEvent.php
models/admin/registrations/events_dashboard.php
models/admin/registrations/events_delete.php
models/admin/registrations/events_eventCustomFields.php
models/admin/registrations/events_eventDashboard.php
models/admin/registrations/events_globalCodes.php
models/admin/registrations/events_notificationDisplay.php
models/admin/registrations/events_notifications.php
models/admin/registrations/events_notificationsUpdate.php
models/admin/registrations/events_paymentCodes.php
models/admin/registrations/events_registrants.php
models/admin/registrations/events_update.php
models/admin/registrations/requests.php
models/front/registrations/cart.php
models/front/registrations/checkoutProcess.php
views/admin/ajax/registrantsListExport.html
views/admin/ajax/registrantsListExportCsv.html
views/admin/registrations/eventRegistrants.html
views/admin/registrations/requestsDashboard.html
views/front/registrations/cartSecurityViolation.html [new file with mode: 0644]
views/front/registrations/summary.html

index 4d786a2..b68e8f8 100644 (file)
@@ -7,6 +7,8 @@
 
 [common]
 
+cart_id_check_secret                           = 'GlMREGcartSecret4ID' 
+
 ;
 ; Show Rate type (how it rates will be displayed in lists) - Use as List
 ;
index a9e6198..c0c7752 100644 (file)
  * @version  0.1
  */
 
-
 // Load Registrant Info data abstract
-require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH .
+        '/data/dataRegRequestRegistrant.php';
 
 /**
- *
  * This class exports the currently selected registrants list
  * to a printable HTML file, to a CSV file, or otherwise.
  */
@@ -32,6 +31,7 @@ class GlmMembersAdmin_ajax_registrantsListExport extends GlmDataRegistrationsReq
      * @access public
      */
     public $wpdb;
+
     /**
      * Plugin Configuration Data
      *
@@ -49,7 +49,7 @@ class GlmMembersAdmin_ajax_registrantsListExport extends GlmDataRegistrationsReq
      * @return object Class object
      *
      */
-    public function __construct ($wpdb, $config)
+    public function __construct($wpdb, $config)
     {
 
         // Save WordPress Database object
@@ -62,61 +62,71 @@ class GlmMembersAdmin_ajax_registrantsListExport extends GlmDataRegistrationsReq
 
     }
 
-    public function checkFlag($t) {return isset($_REQUEST[$t]) && $_REQUEST[$t] == 'on';}
+    public function checkFlag($t)
+    {
+
+        return isset($_REQUEST[$t]) && $_REQUEST[$t] == 'on';
+
+    }
+
     /**
      * Perform Model Action
      *
      * This modelAction takes an AJAX image upload and stores the image in the
      * media/images directory of the plugin.
      *
-     * This model action does not return, it simply does it's work then calls die();
+     * This model action does not return, it simply does it's work then calls
+     * die();
      *
-     * @param $actionData
+     * @param
+     *            $actionData
      *
      * @return void Echos JSON string as response and does not return
      */
-    public function modelAction ($actionData = false)
+    public function modelAction($actionData = false)
     {
 
-        // When processing registrant info records, also get primary contact data
+        // When processing registrant info records, also get primary contact
+        // data
         $this->postProcessPrimaryContact = true;
 
-        $where              = ' true ';
-        $categories         = false;
-        $haveRegistrants    = false;
-        $list               = false;
-        $success            = false;
-        $filterPending      = false;
-        $filterArchived     = false;
-        $haveFilter         = false;
-        $numbDisplayed      = false;
-        $lastDisplayed      = false;
-        $paging             = true;
-        $prevStart          = false;
-        $nextStart          = false;
-        $start              = 1;
-        $limit              = 20;        // Set to the number of listings per page
-        $namesList          = false;
+        $message = '';
+        $where = ' true ';
+        $categories = false;
+        $haveRegistrants = false;
+        $list = false;
+        $success = false;
+        $filterPending = false;
+        $filterArchived = false;
+        $haveFilter = false;
+        $numbDisplayed = false;
+        $lastDisplayed = false;
+        $paging = true;
+        $prevStart = false;
+        $nextStart = false;
+        $start = 1;
+        $limit = 20; // Set to the number of listings per page
+        $namesList = false;
         $customFieldHeaders = false;
 
         // Check selected fields
         $select = array(
-            'exportId'           => $this->checkFlag('exportId'),
-            'exportRegistrant'   => $this->checkFlag('exportRegistrant'),
-            'exportAddr1'        => $this->checkFlag('exportAddr1'),
-            'exportAddr2'        => $this->checkFlag('exportAddr2'),
-            'exportCity'         => $this->checkFlag('exportCity'),
-            'exportState'        => $this->checkFlag('exportState'),
-            'exportZip'          => $this->checkFlag('exportZip'),
-            'exportEmail'        => $this->checkFlag('exportEmail'),
-            'exportPhone'        => $this->checkFlag('exportPhone'),
-            'exportCounty'       => $this->checkFlag('exportCounty'),
-            'exportLevel'        => $this->checkFlag('exportLevel'),
-            'exportTime'         => $this->checkFlag('exportTime'),
-            'exportRate'         => $this->checkFlag('exportRate'),
-            'exportStatus'       => $this->checkFlag('exportStatus'),
+            'exportId' => $this->checkFlag('exportId'),
+            'exportRegistrant' => $this->checkFlag('exportRegistrant'),
+            'exportAddr1' => $this->checkFlag('exportAddr1'),
+            'exportAddr2' => $this->checkFlag('exportAddr2'),
+            'exportCity' => $this->checkFlag('exportCity'),
+            'exportState' => $this->checkFlag('exportState'),
+            'exportZip' => $this->checkFlag('exportZip'),
+            'exportEmail' => $this->checkFlag('exportEmail'),
+            'exportPhone' => $this->checkFlag('exportPhone'),
+            'exportCounty' => $this->checkFlag('exportCounty'),
+            'exportLevel' => $this->checkFlag('exportLevel'),
+            'exportTime' => $this->checkFlag('exportTime'),
+            'exportRate' => $this->checkFlag('exportRate'),
+            'exportStatus' => $this->checkFlag('exportStatus'),
             'exportRegisteredBy' => $this->checkFlag('exportRegisteredBy'),
-            'exportCustom'       => $this->checkFlag('exportCustom'),
+            'exportCustom' => $this->checkFlag('exportCustom')
         );
 
         // Get registration event ID if supplied
@@ -124,109 +134,198 @@ class GlmMembersAdmin_ajax_registrantsListExport extends GlmDataRegistrationsReq
 
             // Make sure it's numeric
             $regEventID = ($_REQUEST['regEventID'] - 0);
-
         } else {
 
             // Try to get saved
-            $regEventID = get_option('glmMembersDatabaseRegistrationsRegEventID');
-
+            $regEventID = get_option(
+                    'glmMembersDatabaseRegistrationsRegEventID');
         }
 
-        if (!$regEventID || $regEventID <= 0) {
+        // Check if there's a potential event ID
+        if ($regEventID && ($regEventID - 0) > 0) {
+
+            // Get basic event information
+            require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH .
+                    '/data/dataRegEvent.php';
+            $Events = new GlmDataRegistrationsRegEvent($this->wpdb, $this->config);
+            $eventData = $Events->getRegEventSimplified($regEventID);
+        } else {
             $regEventID = false;
         }
-        // Only return information records that are active
 
-        $whereParts = array();
+        // If we have a valid event
+        if ($regEventID && $eventData) {
 
-        // Filter for complete if given
-        if ( isset($_REQUEST['status']) && is_array($_REQUEST['status']) && count($_REQUEST['status']) > 0 ) {
+            // Only return information records that are active
 
-            // Collect all checked status values
-            $statusSelected = array();
-            foreach ($_REQUEST['status'] as $statusValue => $statusName) {
-                $statusSelected[] = $statusValue;
-            }
-            $statusList = implode(',', $statusSelected);
-
-            $whereParts[] = "
-                (
-                SELECT count(id)
-                  FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX .  "reg_request
-                 WHERE id = T.reg_request
-                   AND status IN ($statusList)
-                ) > 0
-            ";
-        } else {
-            // In case script doesn't catch not having any set
-            die('ERROR: No status selected');
-        }
+            $whereParts = array();
 
-        $whereParts[] = "T.not_attending <> true";
+            // Filter for complete if given
+            if (isset($_REQUEST['status']) && is_array($_REQUEST['status']) &&
+                    count($_REQUEST['status']) > 0) {
 
-        // Check for a text search
-        if (isset($_REQUEST['text_search']) && trim($_REQUEST['text_search'] != '')) {
-            $textSearch = trim($_REQUEST['text_search']);
-            $whereParts[] = "concat( T.fname, ' ', T.lname) LIKE '%".$textSearch."%'";
+                // Collect all checked status values
+                $statusSelected = array();
+                foreach($_REQUEST['status'] as $statusValue=>$statusName) {
+                    $statusSelected[] = $statusValue;
+                }
+                $statusList = implode(',', $statusSelected);
+
+                $whereParts[] = "
+                    (
+                    SELECT count(id)
+                      FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request
+                     WHERE id = T.reg_request
+                       AND status IN ($statusList)
+                    ) > 0
+                ";
+            } else {
+                // In case script doesn't catch not having any set
+                die('ERROR: No status selected');
+            }
 
-            // Clean up for use in redisplaying search value
-            $textSearch = stripslashes($textSearch);
-        }
+            $whereParts[] = "T.not_attending <> true";
 
-        // Get list of all registrants for this event
-        $where = implode( ' AND ', $whereParts );
+            // Check for a text search
+            if (isset($_REQUEST['text_search']) &&
+                    trim($_REQUEST['text_search'] != '')) {
+                $textSearch = trim($_REQUEST['text_search']);
+                $whereParts[] = "concat( T.fname, ' ', T.lname) LIKE '%" .
+                        $textSearch . "%'";
 
-        // $list = $this->getList($where, "lname");
-        $listResult = $this->getFullRegistrantsData($regEventID, $where, false, false);
-        $list = $listResult['list'];
-        $customFieldsPluginActive = apply_filters( 'glm-members-customfields-plugin-active', false );
-        $customFieldHeaders = false;
-        // Go through the $listResult to pull out the custom fields if available and if plugin is on
-        if ( $customFieldsPluginActive && $listResult['list'] ) {
-            $index = 1;
-            foreach ( $list as $attendee ) {
-                if ( $attendee['custom_data'] ) {
-                    if ( $index === 1 ) {
-                        $customFieldHeaders = array_keys( $attendee['custom_data'] );
+                // Clean up for use in redisplaying search value
+                $textSearch = stripslashes($textSearch);
+            }
+
+            // Get list of all registrants for this event
+            $where = implode(' AND ', $whereParts);
+
+            // $list = $this->getList($where, "lname");
+            $listResult = $this->getFullRegistrantsData($regEventID, $where,
+                    false, false, $orderBy);
+            $list = $listResult['list'];
+            $customFieldsPluginActive = apply_filters(
+                    'glm-members-customfields-plugin-active', false);
+            $customFieldHeaders = false;
+            // Go through the $listResult to pull out the custom fields if
+            // available and if plugin is on
+            if ($customFieldsPluginActive && $listResult['list']) {
+                $index = 1;
+                foreach($list as $attendee) {
+                    if ($attendee['custom_data']) {
+                        if ($index === 1) {
+                            $customFieldHeaders = array_keys(
+                                    $attendee['custom_data']);
+                        }
                     }
+                    break;
                 }
-                break;
             }
-        }
-        // echo '<pre>$customFieldHeaders: ' . print_r( $customFieldHeaders, true ) . '</pre>';
-        // echo '<pre>$list: ' . print_r( $list, true ) . '</pre>';
-        // exit;
 
-        // If we have list entries - even if it's an empty list
-        $success         = true;
-        $haveRegistrants = false;
-        if ($list !== false) {
+            // If we have list entries - even if it's an empty list
             $success = true;
-
-            // If we have any entries
-            $registrantCount = count($list);
-            if ($registrantCount > 0) {
-                $haveRegistrants = true;
+            $haveRegistrants = false;
+            if ($list !== false) {
+                $success = true;
+
+                // If we have any entries
+                $registrantCount = count($list);
+                if ($registrantCount > 0) {
+                    $haveRegistrants = true;
+
+                    // Sort by selection
+                    $orderField = '';
+                    $orderField2 = '';
+                    if (isset($_REQUEST['sortOrder'])) {
+
+                        switch ($_REQUEST['sortOrder']) {
+
+                            case 'registeredBy':
+                                $orderField = 'registered_by';
+                                break;
+
+                            case 'status':
+                                $orderField = 'request_status';
+                                break;
+
+                            case 'city':
+                                $orderField = 'account';
+                                $orderField2 = 'city';
+                                break;
+
+                            case 'state':
+                                $orderField = 'acount';
+                                $orderField2 = 'state';
+                                break;
+
+                            case 'zip':
+                                $orderField = 'account';
+                                $orderField2 = 'zip';
+                                break;
+
+                            case 'level':
+                                $orderField = 'class_name';
+                                break;
+
+                            case 'rate':
+                                $orderField = 'rate_name';
+                                break;
+
+                            case 'dateTime':
+                                $orderField = 'event_time';
+                                break;
+
+                            case 'name':
+                            default:
+                                // already sorted this way
+                                break;
+                        }
+                    }
+                    if ($orderField != '') {
+                        uksort($list,
+                                function ($a, $b) use ($list, $orderField,
+                                $orderField2)
+                                {
+                                    if ($orderField2 == '') {
+                                        return strcmp($list[$a][$orderField],
+                                                $list[$b][$orderField]);
+                                    } else {
+                                        return strcmp(
+                                                $list[$a][$orderField][$orderField2],
+                                                $list[$b][$orderField][$orderField2]);
+                                    }
+                                });
+                    }
+                }
+            } else { // If list
+                $message = "No " .
+                        $this->config['terms']['reg_term_attendee_plur_cap'] .
+                        " Selected";
             }
+        } else { // Have valid event
+            $message = "Event Not Found";
         }
 
         // Compile template data
         $templateData = array(
-            'select'             => $select,
-            'haveRegistrants'    => $haveRegistrants,
-            'registrants'        => $list,
-            'registrantCount'    => $registrantCount,
-            'categories'         => $categories,
-            'haveFilter'         => $haveFilter,
-            'numbDisplayed'      => $numbDisplayed,
-            'lastDisplayed'      => $lastDisplayed,
-            'paging'             => $paging,
-            'prevStart'          => $prevStart,
-            'nextStart'          => $nextStart,
-            'start'              => $start,
-            'limit'              => $limit,
-            'namesList'          => $namesList,
+            'message' => $message,
+            'select' => $select,
+            'haveRegistrants' => $haveRegistrants,
+            'registrants' => $list,
+            'registrantCount' => $registrantCount,
+            'categories' => $categories,
+            'haveFilter' => $haveFilter,
+            'numbDisplayed' => $numbDisplayed,
+            'lastDisplayed' => $lastDisplayed,
+            'paging' => $paging,
+            'prevStart' => $prevStart,
+            'nextStart' => $nextStart,
+            'start' => $start,
+            'limit' => $limit,
+            'namesList' => $namesList,
             'customFieldHeaders' => $customFieldHeaders,
+            'time' => time(),
+            'event' => $eventData
         );
 
         $view = 'admin/ajax/registrantsListExport.html';
@@ -240,17 +339,20 @@ class GlmMembersAdmin_ajax_registrantsListExport extends GlmDataRegistrationsReq
         }
 
         // Disable caching
-        header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1
+        header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP
+                                                                      // 1.1
         header("Pragma: no-cache"); // HTTP 1.0
         header("Expires: 0"); // Proxies
 
+        // echo "<pre>".print_r($list,1)."</pre>";
+
         // Return status, suggested view, and data to controller
         return array(
-            'status'           => $success,
+            'status' => $success,
             'menuItemRedirect' => false,
-            'modelRedirect'    => false,
-            'view'             => $view,
-            'data'             => $templateData
+            'modelRedirect' => false,
+            'view' => $view,
+            'data' => $templateData
         );
 
     }
index ace9d88..f58ed87 100644 (file)
@@ -20,7 +20,7 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
 {
 
     /**
-     * WordPress Database Object
+     * WordPress Database Objectf
      *
      * @var $wpdb
      * @access public
@@ -78,63 +78,13 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
     public function modelAction($actionData = false)
     {
 
-        // *** Need to move the parameters below to their appropriate sub-model file ***
-
         $messages                  = array();
         $option                    = 'dashboard';
         $view                      = false;
-        $numbDisplayed             = false;
-        $lastDisplayed             = false;
-        $paging                    = true;
-        $prevStart                 = false;
-        $nextStart                 = false;
-        $start                     = 1;
-        $limit                     = 20;        // Set to the number of listings per page
-        $registrantCount           = 0;
-        $textSearch                = false;
-        $where                     = ' TRUE ';
-        $alphaList                 = false;
-        $alphaWhere                = '';
-        $alphaSelected             = false;
-        $haveRegEvents             = false;
-        $regEventsCount            = false;
-        $list                      = false;
-        $namesList                 = false;
-        $regEvent                  = false;
         $regEventID                = false;
-        $haveRegEvent              = false;
-        $haveRegEventRecurrences   = false;
-        $haveRegEventTimes         = false;
-        $defaultCalendarDate       = false;
-        $regEventFirstTime         = false;
-        $regEventLastTime          = false;
-        $regEventUpdated           = false;
-        $regEventUpdateError       = false;
         $regEventAdded             = false;
-        $regEventSample            = false;
-        $regEventJSON              = false;
-        $regClassesJSON            = false;
-        $regTimesJSON              = false;
-        $regEventDeleted           = false;
-        $regNotifications          = false;
-        $regNotifyUpdated          = false;
-        $havePayCodes              = false;
-        $payCodes                  = false;
-        $newPayCode                = false;
-        $refPaycodeType            = false;
-        $classes                   = false;
-        $haveRegistrants           = false;
-        $registrants               = false;
-        $completed                 = true;
-        $errorMsg                  = false;
-        $newEntry                  = false;
-        $when                      = false;
-        $haveTimes                 = false;
-        $times                     = false;
-        $selectedTime              = false;
-        $notifications             = '';
-
-        // Register the masked input script that we need for input controls
+
+      // Register the masked input script that we need for input controls
         wp_dequeue_script('glm-members-admin-maskedinput');
         wp_register_script(
             'glm-members-reg-admin-mask',
@@ -191,62 +141,17 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
         /*
          * *** Need to move the template data compilation to the individual sub-model files.
          */
+
         // Compile template data
-        $templateData = array(
-            'haveMessages'            => count($messages) > 0,
-            'messages'                => $messages,
-            'option'                  => $option,
-            'regEventsCount'          => $regEventsCount,
-            'haveRegEvents'           => $haveRegEvents,
-            'regEvents'               => $list,
-            'alphaList'               => $alphaList,
-            'alphaSelected'           => $alphaSelected,
-            'numbDisplayed'           => $numbDisplayed,
-            'lastDisplayed'           => $lastDisplayed,
-            'paging'                  => $paging,
-            'prevStart'               => $prevStart,
-            'nextStart'               => $nextStart,
-            'start'                   => $start,
-            'limit'                   => $limit,
-            'registrantCount'         => $registrantCount,
-            'namesList'               => $namesList,
-            'textSearch'              => $textSearch,
-            'regEventID'              => $regEventID,
-            'regEvent'                => $regEvent,
-            'haveRegEvent'            => $haveRegEvent,
-            'haveRegEventRecurrences' => $haveRegEventRecurrences,
-            'haveRegEventTimes'       => $haveRegEventTimes,
-            'defaultCalendarDate'     => $defaultCalendarDate,
-            'regEventFirstTime'       => $regEventFirstTime,
-            'regEventLastTime'        => $regEventLastTime,
-            'regEventUpdated'         => $regEventUpdated,
-            'regEventUpdateError'     => $regEventUpdateError,
-            'regEventAdded'           => $regEventAdded,
-            'entry'                   => $regEventSample,
-            'regNotifications'        => $regNotifications,
-            'regNotifyUpdated'        => $regNotifyUpdated,
-            'havePayCodes'            => $havePayCodes,
-            'payCodes'                => $payCodes,
-            'newPayCode'              => $newPayCode,
-            'eventPaycodeType'        => $refPaycodeType,
-            'currentUrl'              => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ADMIN_URL,
-            'thisJsUrl'               => GLM_MEMBERS_REGISTRATIONS_PLUGIN_URL . '/js',
-            'regEventJSON'            => $regEventJSON,
-            'regClassesJSON'          => $regClassesJSON,
-            'regTimesJSON'            => $regTimesJSON,
-            'classes'                 => $classes,
-            'haveRegistrants'         => $haveRegistrants,
-            'registrants'             => $registrants,
-            'completed'               => $completed,
-            'errorMsg'                => $errorMsg,
-            'newEntry'                => $newEntry,
-            'when'                    => $when,
-            'haveTimes'               => $haveTimes,
-            'times'                   => $times,
-            'selectedTime'            => $selectedTime,
-            'notifications'           => $notifications,
-            'submitStatus'            => $this->config['submission_status']
-        );
+
+        $templateData['haveMessages']       = count($messages) > 0;
+        $templateData['messages']           = $messages;
+        $templateData['option']             = $option;
+        $templateData['regEventID']         = $regEventID;
+        $templateData['regEventAdded']      = $regEventAdded;
+        $templateData['currentUrl']         = GLM_MEMBERS_REGISTRATIONS_PLUGIN_ADMIN_URL;
+        $templateDAta['thisJsUrl']          = GLM_MEMBERS_REGISTRATIONS_PLUGIN_URL . '/js';
+
 
        // echo "<pre>".print_r($this->config['submission_status'],1)."</pre>";
 
index fcc5712..cd4adda 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
-$problem = false;
+$problem                = false;
+$regEvent               = false;
+$haveRegEvent           = false;
+$regEventUpdated        = false;
+$regEventUpdateError    = false;
 
 // If we're adding a new reg event
 if ($option == 'add') {
@@ -106,5 +110,12 @@ if (!$problem) {
 
 //echo "<pre>".print_r($regEvent,1)."</pre>";
 
+$templateData = array(
+    'regEvent'                => $regEvent,
+    'haveRegEvent'            => $haveRegEvent,
+    'regEventUpdated'         => $regEventUpdated,
+    'regEventUpdateError'     => $regEventUpdateError
+);
+
 $view = 'eventEdit';
 
index 90240ae..347fde1 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$regEvent                  = false;
+$regEventJSON              = false;
+$regClassesJSON            = false;
+$regTimesJSON              = false;
+$regEventUpdated           = false;
+$regEventUpdateError       = false;
+
 $scripts = array(
     'backbone-local' => 'js/lib/backbone.localStorage.min.js',
     'regApp'         => 'js/adminRegApp.js',
@@ -55,5 +62,15 @@ unset($regEvent['reg_class']);
 unset($regEvent['reg_time']);
 $regEventJSON = json_encode($regEvent);
 
+
+$templateData = array(
+    'regEvent'                => $regEvent,
+    'regEventJSON'            => $regEventJSON,
+    'regClassesJSON'          => $regClassesJSON,
+    'regTimesJSON'            => $regTimesJSON,
+    'regEventUpdated'         => $regEventUpdated,
+    'regEventUpdateError'     => $regEventUpdateError
+);
+
 $view = 'eventEditLevels';
 
index 564bcfa..48a8e78 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$regEvent           = false;
+$regEventsCount     = false;
+$haveRegEvents      = false;
+$list               = false;
+$alphaList          = false;
+$alphaSelected      = false;
+$numbDisplayed      = false;
+$lastDisplayed      = false;
+$paging             = true;
+$prevStart          = false;
+$nextStart          = false;
+$start              = 1;
+$limit              = 20;        // Set to the number of listings per page
+$namesList          = false;
+$textSearch         = false;
+$haveRegEvent       = false;
+$alphaWhere         = '';
+$where              = ' TRUE ';
+
+
+
 // If doing alpha list
 if (isset($_REQUEST['alpha'])) {
     $actionData['request']['alpha'] = $_REQUEST['alpha'];
@@ -28,7 +49,6 @@ if ($actionData['request']['alpha'] && strlen($actionData['request']['alpha']) =
     $alphaWhere .= " AND T.event_name LIKE '$alphaSelected%'";
 }
 
-$where = ' TRUE ';
 if (isset($_REQUEST['text_search']) && trim($_REQUEST['text_search'] != '')) {
     $textSearch = trim($_REQUEST['text_search']);
     $where = "event_name LIKE '%".$textSearch."%'";
@@ -81,4 +101,23 @@ if ($list !== false) {
 // Get full list of event names matching the current where clause for text search box
 $namesList = $this->getSimpleRegEventsList($where);
 
+$templateData = array(
+    'regEventsCount'          => $regEventsCount,
+    'haveRegEvents'           => $haveRegEvents,
+    'regEvents'               => $list,
+    'alphaList'               => $alphaList,
+    'alphaSelected'           => $alphaSelected,
+    'numbDisplayed'           => $numbDisplayed,
+    'lastDisplayed'           => $lastDisplayed,
+    'paging'                  => $paging,
+    'prevStart'               => $prevStart,
+    'nextStart'               => $nextStart,
+    'start'                   => $start,
+    'limit'                   => $limit,
+    'namesList'               => $namesList,
+    'textSearch'              => $textSearch,
+    'regEvent'                => $regEvent,
+    'haveRegEvent'            => $haveRegEvent
+);
+
 $view = 'eventsDashboard';
index d8ac88b..fe97483 100644 (file)
@@ -13,7 +13,9 @@
  * @link     http://dev.gaslightmedia.com/
  */
 
-$regEventDeleted = false;
+$regEventDeleted    = false;
+$regEvent           = false;
+
 
 // If we don't have a registration Event ID
 if (!$regEventID) {
@@ -61,3 +63,4 @@ if ($regEventDeleted) {
 require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH.'/models/admin/registrations/events_dashboard.php';
 
 }
+
index 713047d..c4a94c7 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$regEvent                  = false;
+$classes                   = false;
+$regEventUpdated           = false;
+$regEventUpdateError       = false;
+
 require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegClass.php';
 $RegClasses = new GlmDataRegistrationsRegClass($this->wpdb, $this->config);
 $classes = $RegClasses->getList("T.reg_event = $regEventID");
 
 $regEvent = $this->getEntry($regEventID);
 
+$templateData = array(
+    'regEvent'                => $regEvent,
+    'classes'                 => $classes,
+    'regEventUpdated'         => $regEventUpdated,
+    'regEventUpdateError'     => $regEventUpdateError
+);
+
+
 $view = 'eventEditCustomFields';
index 9431ba1..a981643 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$regEvent                  = false;
+$haveRegEvent              = false;
+$haveRegEventTimes         = false;
+$defaultCalendarDate       = false;
+$regEventFirstTime         = false;
+$regEventLastTime          = false;
+
+
 // Check if there's a request to add event times from the event
 $getTimesFromEvent = false;
 if (isset($_REQUEST) && isset($_REQUEST['getTimesFromEvent']) && $_REQUEST['getTimesFromEvent'] == 'yes') {
@@ -64,4 +72,17 @@ if ($regEvent !== false) {
 }
 // echo "<pre>".print_r($regEvent,1)."</pre>";
 
+
+$templateData = array(
+    'regEvent'                => $regEvent,
+    'haveRegEvent'            => $haveRegEvent,
+    'haveRegEventTimes'       => $haveRegEventTimes,
+    'defaultCalendarDate'     => $defaultCalendarDate,
+    'regEventFirstTime'       => $regEventFirstTime,
+    'regEventFirstTime'       => $regEventFirstTime,
+    'regEventLastTime'        => $regEventLastTime,
+
+);
+
+
 $view = 'eventDashboard';
index 705c152..9f6d4ec 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$havePayCodes              = false;
+$payCodes                  = false;
+$newPayCode                = false;
+$refPaycodeType            = false;
+
+
 require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataPaymentCode.php';
 $PayCode = new GlmDataRegistrationsPaymentCode($this->wpdb, $this->config);
 
@@ -63,5 +69,12 @@ if ($payCodes) {
     $havePayCodes = true;
 }
 
+$templateData = array(
+    'havePayCodes'            => $havePayCodes,
+    'payCodes'                => $payCodes,
+    'newPayCode'              => $newPayCode,
+    'eventPaycodeType'        => $refPaycodeType,
+
+);
 
 $view = 'eventPaymentCodes';
index 51e4f4f..7309d2e 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$notifications             = '';
+
 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);
 
+$templateData = array(
+    'notifications'           => $notifications,
+);
+
 $view = 'notificationDisplay';
index a9bfa6c..7401c81 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$regEvent                  = false;
+$regNotifications          = false;
+$newEntry                  = false;
+$when                      = false;
+$regNotifyUpdated          = false;
+
+
 require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegNotification.php';
 $Notifications = new GlmDataRegistrationsRegNotification($this->wpdb, $this->config);
 
@@ -44,3 +51,12 @@ if ( isset( $_REQUEST['delete'] ) && filter_var( $_REQUEST['delete'], FILTER_VAL
 }
 
 // echo '<pre>$regNotifications: ' . print_r( $regNotifications, true ) . '</pre>';
+
+$templateData = array(
+    'regEvent'                => $regEvent,
+    'regNotifications'        => $regNotifications,
+    'newEntry'                => $newEntry,
+    'when'                    => $when,
+    'regNotifyUpdated'        => $regNotifyUpdated
+);
+
index 3bd743c..e3f8833 100644 (file)
@@ -13,6 +13,9 @@
  * @link     http://dev.gaslightmedia.com/
  */
 
+$regNotifyUpdated          = false;
+
+
 // New and updated notifications
 if ( isset( $_REQUEST['name'] ) && is_array( $_REQUEST['name'] ) ) {
 
@@ -76,5 +79,11 @@ if ( isset( $_REQUEST['delete'] ) && filter_var( $_REQUEST['delete'], FILTER_VAL
 
 $regNotifyUpdated = true;
 
+$templateData= array(
+    'regNotifyUpdated'        => $regNotifyUpdated,
+
+);
+
+
 // Fall through to get the data again
 require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH . '/models/admin/registrations/events_notifications.php';
index 7cd7c74..42c8005 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$regEvent                  = false;
+$havePayCodes              = false;
+$payCodes                  = false;
+$newPayCode                = false;
+$refPaycodeType            = false;
+
+
 // Get event ID
 $eventId = filter_input(INPUT_GET, 'regEventID', FILTER_SANITIZE_NUMBER_INT);
 
@@ -75,5 +82,13 @@ if ($payCodes) {
 
 $regEvent = $this->getEntry($regEventID);
 
+$templateData = array(
+    'regEvent'                => $regEvent,
+    'havePayCodes'            => $havePayCodes,
+    'payCodes'                => $payCodes,
+    'newPayCode'              => $newPayCode,
+    'eventPaycodeType'        => $refPaycodeType
+);
+
 
 $view = 'eventPaymentCodes';
index 41f5d06..1a1d4d1 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$numbDisplayed         = false;
+$lastDisplayed         = false;
+$paging                = true;
+$prevStart             = false;
+$nextStart             = false;
+$start                 = 1;
+$limit                 = 20;        // Set to the number of listings per page
+$registrantCount       = 0;
+$textSearch            = false;
+$regEvent              = false;
+$haveRegistrants       = false;
+$registrants           = false;
+$haveTimes             = false;
+$times                 = false;
+$selectedTime          = false;
+$errorMsg              = false;
+$completed             = false;
+
 
 $whereParts = array();
 
@@ -27,7 +45,8 @@ if (isset($_REQUEST['textSearch']) && trim($_REQUEST['textSearch'] != '')) {
 require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php';
 $Registrants = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config);
 
-// Get the regEvent data
+// Get the regEvent dataecho "<pre>".print_r($registrants,1)."</pre>";
+
 $regEvent = $this->getEntry($regEventID);
 
 // If time / date specific event, get all times for time selection picklist
@@ -49,26 +68,90 @@ 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);
+// Filter for status
+if (isset($_REQUEST['status']) && is_array($_REQUEST['status']) && count($_REQUEST['status']) > 0) {
+
+    // Status supplied
+    $statusSelected = $_REQUEST['status'];
+
+} else {
+
+    // Not supplied so use defaults
+    $statusSelected = array(
+        $this->config['submission_status_numb']['COMPLETE'],
+        $this->config['submission_status_numb']['UNPAID'],
+        $this->config['submission_status_numb']['CC_PEND'],
+        $this->config['submission_status_numb']['CC_DECL'],
+        $this->config['submission_status_numb']['PAYMENT_PEND'],
+        $this->config['submission_status_numb']['ON_ARRIVAL'],
+        $this->config['submission_status_numb']['ADMIN_HOLD']
+    );
+
 }
-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
-    ";
+
+// Build data for picklist output
+$status = $this->config['submission_status'];
+
+
+/**
+ * ******* TEMPORARY - USE SAME FUNCTION IN MAIN PLUGIN WHEN THAT'S UPDATED (less the number 2 at the end)  *************
+ */
+function glmMembersConfigArraySetup2( $configTable, $configNumbTable = false, $configSelectedArray)
+{
+
+    // Check if config table array exits
+    if (!is_array($configTable) || count($configTable) == 0) {
+        return false;
+    }
+
+    // Build base array
+    $conf = array();
+    foreach ($configTable as $key=>$descr) {
+        $conf[$key] = array(
+            'id' => $key,
+            'descr' => $descr,
+            'name' => false,
+            'selected' => false
+        );
+    }
+
+    // If name->number array add that data
+    if (is_array($configNumbTable) && count($configNumbTable) > 0) {
+        foreach ($configNumbTable as $name=>$key) {
+            if (isset($conf[$key])) {
+                $conf[$key]['name'] = $name;
+            }
+        }
+    }
+
+    // If a selected array is provided, add that data
+    if (is_array($configSelectedArray) && count($configSelectedArray) > 0) {
+        foreach ($configSelectedArray as $key) {
+            if (isset($conf[$key])) {
+                $conf[$key]['selected'] = true;
+            }
+        }
+    }
+
+    return $conf;
+
 }
 
+// Build array of status options for view
+$statusOptions = glmMembersConfigArraySetup2($this->config['submission_status'], $this->config['submission_status_numb'], $statusSelected);
+
+
+// Build where clause for status and add to where parts
+$statusWhere = "(".implode(',', $statusSelected).")";
+$whereParts[] = "
+    (
+    SELECT count(id)
+      FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX .  "reg_request
+     WHERE id = T.reg_request
+       AND status IN $statusWhere
+    ) > 0
+";
+
 // Get list of all registrants for this event
 $where = implode( ' AND ', $whereParts );
 
@@ -100,7 +183,7 @@ $registrantCount = $listResult['totalCount'];
 
 // If the number of registrants is less than a page, don't do paging
 if ($registrantCount <= $limit) {
-    // $paging = false;
+    $paging = false;
 }
 
 // Get paging results
@@ -119,6 +202,11 @@ if ($listResult['returned'] == $limit) {
 }
 $registrants = $listResult['list'];
 
+// Calc Cart ID check
+foreach ($registrants as $key=>$val) {
+    $registrants[$key]['cartCheck'] = md5($val['reg_request'].$this->config['cart_id_check_secret']);
+}
+
 $success = true;
 $haveRegistrants = false;
 if ($registrants !== false) {
@@ -132,4 +220,26 @@ if ($registrants !== false) {
 }
 // echo "<pre>".print_r($registrants,1)."</pre>";
 
+$templateData = array(
+    'numbDisplayed'           => $numbDisplayed,
+    'lastDisplayed'           => $lastDisplayed,
+    'paging'                  => $paging,
+    'prevStart'               => $prevStart,
+    'nextStart'               => $nextStart,
+    'start'                   => $start,
+    'limit'                   => $limit,
+    'registrantCount'         => $registrantCount,
+    'textSearch'              => $textSearch,
+    'regEvent'                => $regEvent,
+    'haveRegistrants'         => $haveRegistrants,
+    'registrants'             => $registrants,
+    'haveTimes'               => $haveTimes,
+    'times'                   => $times,
+    'selectedTime'            => $selectedTime,
+    'statusOptions'           => $statusOptions,
+    'errorMsg'                => $errorMsg,
+    'completed'               => $completed,
+    'regUrl'        => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/'
+);
+
 $view = 'eventRegistrants';
index 13048a9..9e915ea 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
+$regEvent                  = false;
+$regEventUpdated           = false;
+$regEventUpdateError       = false;
+
+
 // Get the current reg event type to check for change
 $timeSpecific = $this->wpdb->get_var("
     SELECT time_specific
@@ -95,4 +100,11 @@ if ($regEvent['status']) {
     $regEventUpdateError = true;
 }
 
+$templateData = array(
+    'regEvent'                => $regEvent,
+    'regEventUpdated'         => $regEventUpdated,
+    'regEventUpdateError'     => $regEventUpdateError
+);
+
+
 $view = 'eventEdit';
index a940390..a9d6e73 100644 (file)
@@ -84,19 +84,30 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
         // ***** THIS IS ONLY TEMPORARY AS WE TRANSITION AWAY FROM OPTION FOR LAST REQUEST ID - Can be deleted after 1.0.1 ******
         delete_option('glmMembersDatabaseRegistrationsRequestID');
 
+        $numbDisplayed  = false;
+        $lastDisplayed  = false;
+        $paging         = true;
+        $prevStart      = false;
+        $nextStart      = false;
+        $start          = 1;
+        $limit          = 20;        // Set to the number of listings per page
+        $orderBy        = 'id';
         $haveRequests   = false;
         $requests       = false;
+        $requestsCount  = false;
         $requestID      = false;
         $haveRequest    = false;
         $cart           = false;
         $haveCart       = false;
         $option         = 'dashboard';
         $errorMsg       = false;
-        $showCartRequests = false;
-        $where          = '';
+        $textSearch     = false;
+        $statusOptions  = false;
+        $where          = 'TRUE';
         $deleted        = false;
         $messages       = array();
 
+
         // Load registrations support class
         require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/regCartSupport.php';
         $regCartSupport = new GlmRegCartSupport($this->wpdb, $this->config);
@@ -209,18 +220,182 @@ 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 (isset($_REQUEST['textSearch']) && trim($_REQUEST['textSearch'] != '')) {
+                    $textSearch = trim($_REQUEST['textSearch']);
+                    $where .= " AND concat( T.bill_fname, ' ', T.bill_lname) LIKE '%".$textSearch."%'";
+
+                    // Clean up for use in redisplaying search value
+                    $textSearch = stripslashes($textSearch);
+                }
+
+                // Filter for status
+                if (isset($_REQUEST['status']) && is_array($_REQUEST['status']) && count($_REQUEST['status']) > 0) {
+
+                    // Status supplied
+                    $statusSelected = $_REQUEST['status'];
+
+                } else {
+
+                    // Not supplied so use defaults
+                    $statusSelected = array(
+                        $this->config['submission_status_numb']['COMPLETE'],
+                        $this->config['submission_status_numb']['UNPAID'],
+                        $this->config['submission_status_numb']['CC_PEND'],
+                        $this->config['submission_status_numb']['CC_DECL'],
+                        $this->config['submission_status_numb']['PAYMENT_PEND'],
+                        $this->config['submission_status_numb']['ON_ARRIVAL'],
+                        $this->config['submission_status_numb']['ADMIN_HOLD']
+                    );
+
+                }
+
+                // Build data for picklist output
+                $status = $this->config['submission_status'];
+
+
+                /**
+                 * ******* TEMPORARY - USE SAME FUNCTION IN MAIN PLUGIN WHEN THAT'S UPDATED (less the number 2 at the end)  *************
+                 */
+                function glmMembersConfigArraySetup2( $configTable, $configNumbTable = false, $configSelectedArray)
+                {
+
+                    // Check if config table array exits
+                    if (!is_array($configTable) || count($configTable) == 0) {
+                        return false;
+                    }
+
+                    // Build base array
+                    $conf = array();
+                    foreach ($configTable as $key=>$descr) {
+                        $conf[$key] = array(
+                            'id' => $key,
+                            'descr' => $descr,
+                            'name' => false,
+                            'selected' => false
+                        );
+                    }
+
+                    // If name->number array add that data
+                    if (is_array($configNumbTable) && count($configNumbTable) > 0) {
+                        foreach ($configNumbTable as $name=>$key) {
+                            if (isset($conf[$key])) {
+                                $conf[$key]['name'] = $name;
+                            }
+                        }
+                    }
+
+                    // If a selected array is provided, add that data
+                    if (is_array($configSelectedArray) && count($configSelectedArray) > 0) {
+                        foreach ($configSelectedArray as $key) {
+                            if (isset($conf[$key])) {
+                                $conf[$key]['selected'] = true;
+                            }
+                        }
+                    }
+
+                    return $conf;
+
+                }
+
+                // Build array of status options for view
+                $statusOptions = glmMembersConfigArraySetup2($this->config['submission_status'], $this->config['submission_status_numb'], $statusSelected);
+
+
+                // Build where clause for status and add to where parts
+                $statusWhere = "(".implode(',', $statusSelected).")";
+                $where .= " AND T.status IN $statusWhere";
+
+                // Get selected ordering
+                $orderBy = $_REQUEST['orderBy'];
+                switch ($orderBy) {
+
+                    case 'status':
+                        $order = 'T.status';
+                        break;
+
+                    case 'name':
+                        $order = 'T.bill_lname, $.bill_fname';
+                        break;
+
+                    case 'org':
+                        $order = 'T.bill_org';
+                        break;
+
+                    case 'city':
+                        $order = 'T.bill_city';
+                        break;
+
+                    case 'state':
+                        $order = 'T.bill_state';
+                        break;
+
+                    case 'created':
+                        $order = 'T.date_created';
+                        break;
+
+                    case 'updated':
+                        $order = 'T.last_update';
+                        break;
+
+                    case 'id':
+                    default:
+                        $order = 'T.id';
+                        $orderBy = 'id';
+                        break;
                 }
-                if (!$showCartRequests) {
-                    $where = "T.status != {$this->config['submission_status_numb']['CART']}";
+
+                // Check if we're doing paging
+                if ( isset( $_REQUEST['pageSelect'] ) ) {
+
+                    // If request is for Next
+                    if ( $_REQUEST['pageSelect'][0] == 'N' ) {
+                        $newStart = $_REQUEST['nextStart'] - 0;
+
+                        // Otherwise it must be Previous
+                    } else {
+                        $newStart = $_REQUEST['prevStart'] - 0;
+                    }
+
+                    if ($newStart > 0) {
+                        $start = $newStart;
+                    }
                 }
 
                 // Get list of requests
-                $requests = $this->getList($where);
-                if ($requests) {
+                $requestsResult = $this->getList($where, $order, true, 'id', $start, $limit);
+                if ($requestsResult) {
+
                     $haveRequests = true;
+                    $requests = $requestsResult['list'];
+
+                    // Get total numbers of requests
+                    $requestsCount = $this->getStats($where);
+
+                    // If the number of registrants is less than a page, don't do paging
+                    if ($requestsCount <= $limit) {
+                        $paging = false;
+                    }
+
+                    // Get paging results
+                    $numbDisplayed = $requestsResult['returned'];
+                    $lastDisplayed = $requestsResult['last'];
+                    if ($start == 1) {
+                        $prevStart = false;
+                    } else {
+                        $prevStart = $start - $limit;
+                        if ($start < 1) {
+                            $start = 1;
+                        }
+                    }
+                    if ($requestsResult['returned'] == $limit) {
+                        $nextStart = $start + $limit;
+                    }
+
+                    // Calc Cart ID check
+                    foreach ($requests as $key=>$val) {
+                        $requests[$key]['cartCheck'] = md5($val['id'].$this->config['cart_id_check_secret']);
+                    }
+
                 }
 
                 $view = 'requestsDashboard.html';
@@ -234,12 +409,22 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
             setcookie("glmMembersDatabaseRegistrationRequestID", $requestID, time()+86400);
         }
 
-        // echo "<pre>".print_r($cart,1)."</pre>";
+        //echo "<pre>".print_r($requests,1)."</pre>";
 
         // Compile template data
         $templateData = array(
+            'numbDisplayed' => $numbDisplayed,
+            'lastDisplayed' => $lastDisplayed,
+            'paging'        => $paging,
+            'prevStart'     => $prevStart,
+            'nextStart'     => $nextStart,
+            'start'         => $start,
+            'limit'         => $limit,
+            'orderBy'       => $orderBy,
             'haveRequests'  => $haveRequests,
             'requests'      => $requests,
+            'requestsCount' => $requestsCount,
+            'orderBy'       => $orderBy,
             'haveRequest'   => $haveRequest,
             'requestID'     => $requestID,
             'cart'          => $cart,
@@ -247,7 +432,8 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
             'errorMsg'      => $errorMsg,
             'option'        => $option,
             'deleted'       => $deleted,
-            'showCartRequests' => $showCartRequests,
+            'textSearch'    => $textSearch,
+            'statusOptions' => $statusOptions,
             'messages'      => $messages,
             'regUrl'        => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/'
         );
index e125d29..61595fb 100644 (file)
@@ -83,6 +83,7 @@ class GlmMembersFront_registrations_cart extends GlmRegCartSupport
         $haveCart       = false;
         $option         = false;
         $blockCheckout  = false;
+        $view           = 'cart';
 
         // Get misc texts
         require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php';
@@ -111,6 +112,11 @@ class GlmMembersFront_registrations_cart extends GlmRegCartSupport
             // Get ID from REQUEST Make sure it's numeric
             $cartId = ($_REQUEST['cartId'] - 0);
 
+            // Supplied ID requires check code
+            if ($_REQUEST['cartCheck'] != md5($cartId.$this->config['cart_id_check_secret'])) {
+                $view = 'cartSecurityViolation';
+            }
+
             // If bad cart ID, set to false
             if ($cartId <= 0) {
                 $cartId = false;
@@ -140,8 +146,6 @@ class GlmMembersFront_registrations_cart extends GlmRegCartSupport
 
         }
 
-        $view = 'cart';
-
         // Compile template data
         $templateData = array(
             'page'          => 'cart',
index 117de0b..4321096 100644 (file)
@@ -828,6 +828,9 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
             $messages[] = 'Cart Summary did not store. This is a technical issue that means our systems could not store a summmary of what you submitted.';
         }
 
+        // Get the entire request again to make sure all of the data is available.
+        $this->checkRegistrationRequest($requestId);
+
         // Update inventory totals and send notifications unless this is a test submission
         $this->checkoutUpdateInventoryAndNotify($summary, false, $doNotClear);
 
@@ -859,13 +862,15 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
             'summary'        => $summary,
             'misc'           => $misc,
             'reg_account_id' => $accountId,
-            'regAccount'     => $regAccount,
+            'regAccount'     => $Account->editEntry($accountId),
             'states_list'    => $this->config['states'],
             'country_list'   => $this->config['countries'],
             'emailError'     => $emailError,
             'passwordError'  => $passwordError,
         );
 
+        // echo "<pre>".print_r($templateData['regAccount'],1)."</pre>";
+
         // Return status, any suggested view, and any data to controller
         return array(
             'status'        => true,
index 0fcbb1c..f7cb58d 100644 (file)
@@ -1,10 +1,24 @@
 <html>
     <head>
+        <style>
+            table {
+                border-collapse: collapse;
+            }
+            table, th, td {
+                border: 1px solid gray;
+                padding-left: 3px;
+                padding-right: 3px;
+            }
+        </style>
     </head>
     <body>
 
-        <span style="float: right;"><b>Total found: {$registrantCount}&nbsp;&nbsp;</b></span>
-        <b>List&nbsp;of&nbsp;{$terms.reg_term_attendee_plur_cap}</b>
+        <b style="white-space; nowrap;">
+            List of {$terms.reg_term_attendee_plur_cap}
+            <span style="padding-left: 3em;">Event: {$event.event_name}
+            <span style="padding-left: 3em;">Time of Report:  {$time|date_format: "%D %I:%M %p"}</span>
+            <span style="padding-left: 3em;">Results found {$registrantCount}</span>
+        </b>
         <br clear="all">
 
 
@@ -61,7 +75,7 @@
                 </tr>
         {/foreach}
     {else}
-                <tr class="alternate"><td colspan="2">(no {$terms.reg_term_attendee_plur_cap} listed)</td></tr>
+                <tr class="alternate"><th colspan="2">**** {$message} ****</th></tr>
     {/if}
             </tbody>
         </table>
index 0cac653..d1a223b 100644 (file)
@@ -33,4 +33,5 @@
 {if $select.exportCustom && $customFieldHeaders}{foreach $m.custom_data as $cData},"{$cData}"{/foreach}{/if}
 
 {/foreach}
-{else}No {$terms.reg_term_attendee_plur_cap} Selected{/if}
+"Total","{$registrantCount}"
+{else}**** {$message} ****{/if}
index d1c680d..2f20dc9 100644 (file)
@@ -4,11 +4,6 @@
 {if $errorMsg}
     <h3 class="glm-error">{$errorMsg}</h3>
 {/if}
-<style>
-.glm-edit-form label {
-    display: block;
-}
-</style>
 <h1>{$terms.reg_term_attendee_plur_cap} List</h1>
 
 <div id="exportRegistrantsButton" class="button button-secondary glm-admin-export-button">Export {$terms.reg_term_attendee_plur}</div>
     <input type="hidden" name="limit" value="{$limit}">
     <div>
         <p>
+<!-- 
             <span class="glm-nowrap">
                 <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>
+                <b>Text Search:<input type="text" name="textSearch"  value="{if $textSearch}{$textSearch}{/if}"></b>
+            </span>&nbsp;&nbsp;&nbsp;
+            <span class="glm-nowarp">
+                Status: (Select at least one)
+                <select id="statusFieldsSelect" name="status[]" multiple="multiple" size="1">
+    {foreach $statusOptions as $status}
+                    <option value="{$status.id}"{if $status.selected} selected{/if}>
+                        {$status.name}
+                    </option>
+    {/foreach}
+                </select>
+            </span>&nbsp;&nbsp;&nbsp;
     {if $haveTimes}
             <span class="glm-nowrap">
                 <b>Time Selected</b>
                 <select name="time">
                     <option value=""></option>
       {foreach $times as $time}
+        {if $time.start_datetime.timestamp}
                     <option value="{$time.id}"{if $selectedTime == $time.id} selected{/if}>{$time.start_datetime.datetime}</option>
+        {/if}
       {/foreach}
                 </select>
             </span>
     {/if}
             <span clas="glm-nowrap">
-                <input type="submit" value="Submit">
+                <input type="submit" value="Display List">
             </span>
         </p>
     </div>
@@ -80,6 +88,7 @@
                 <th>Status</th>
                 <th>Submitted</th>
                 <th>Not Attending</th>
+                <th>&nbsp;</th>
             </tr>
         </thead>
         <tbody>
                 <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>
+                <td>
+                    <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.reg_request}" class="button button-secondary glm-button">View Request</a>
+            {if $r.request_status.value == 0}
+                    <a href="{$regUrl}?page=cart&cartId={$r.reg_request}&cartCheck={$r.cartCheck}" class="button button-secondary glm-button" target="_cart">Access Cart</a>
+            {/if}                        
+                </td>
+                
             </tr>
             <tr id="attendeeLinks_{$r.id}" class="glm-hidden glm-attendee-links"">
                 <td colspan="5" style="padding: .8rem; background-color: #fff;>
                     <table padding="3">
                         <tr>
                             <td class="exportFieldsTd">
-                                <a id="selectAllStatusFields" class="button button-secondary button-small">Check All</a> <a class="button button-secondary button-small" id="unselectAllStatusFields">Uncheck All</a> Please select at least one.<br>
-                {foreach from=$submitStatus key=status_id item=status_name}
-                                <input class="statusCheckbox" type="checkbox" name="status[{$status_id}]"> {$status_name}<br>
-                {/foreach}
+                                <a id="selectAllStatusFields" class="button button-secondary button-small">Check All</a> <a class="button button-secondary button-small" id="unselectAllStatusFields">Uncheck All</a><br>
+                                Please select at least one.<br>
+                    {foreach $statusOptions as $status}
+                                <input class="statusCheckbox" type="checkbox" name="status[{$status.id}]"{if $status.selected} checked="checked"{/if}> {$status.name}<br>
+                    {/foreach}
                             </td>
                         </tr>
                     </table>
                     </table>
                 </td>
             </tr>
+            <tr>
+                <th style="white-space: nowrap;">Sort/Group Results By:</th>
+                <td>
+                    <table padding="3">
+                        <tr>
+                            <td class="exportFieldsTd">
+                                <select name="sortOrder">
+                                    <option value="name" selected="selected">{$terms.reg_term_attendee_cap} Name</opion>
+                                    <option value="registeredBy">{$terms.reg_term_registered_cap} By</option>
+                                    <option value="status">Submission Status</opion>
+                                    <option value="city">City</opion>
+                                    <option value="state">State</opion>
+                                    <option value="zip">ZIP/Postal Code</option>
+                                    <option value="level">{$terms.reg_term_registration_cap} Level</option>
+                                    <option value="rate">{$terms.reg_term_registration_cap} Rate</option>
+                                    <option value="dateTime">{$terms.reg_term_event_cap} Date/Time</option>
+                                </select>
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
             <tr>
                 <th>Export to: </th>
                 <td>
@@ -455,6 +494,8 @@ jQuery(document).ready(function($){
     $('.glm-admin-table-inner').mouseleave( function() {
         $('#attendeeLinks_' + attendeeHoverId).addClass('glm-hidden');
     })
+    
+    $('#statusFieldsSelect').multiselect();
 });
 </script>
 
index 3d176c3..5405894 100644 (file)
     <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">
+                <b>Text Search:<input type="text" name="textSearch"  value="{if $textSearch}{$textSearch}{/if}"></b>
+            </span>&nbsp;&nbsp;&nbsp;
+            <span class="glm-nowarp">
+                Status: (Select at least one)
+                <select id="statusFieldsSelect" name="status[]" multiple="multiple" size="1">
+    {foreach $statusOptions as $status}
+                    <option value="{$status.id}"{if $status.selected} selected{/if}>
+                        {$status.name}
+                    </option>
+    {/foreach}
+                </select>
+            </span>&nbsp;&nbsp;&nbsp;
+            <span class="glm-nowarp">
+                Order/Group By: {$orderBy}
+                <select name="orderBy">
+                    <option value="id"{if $orderBy == 'id'} selected{/if}>Request ID</option>
+                    <option value="status"{if $orderBy == 'status'} selected{/if}>Status</option>
+                    <option value="name"{if $orderBy == 'name'} selected{/if}>Name</option>
+                    <option value="org"{if $orderBy == 'org'} selected{/if}>Organization</option>
+                    <option value="city"{if $orderBy == 'city'} selected{/if}>City</option>
+                    <option value="state"{if $orderBy == 'state'} selected{/if}>State</option>
+                    <option value="created"{if $orderBy == 'created'} selected{/if}>Date Created</option>
+                    <option value="updated"{if $orderBy == 'updated'} selected{/if}>Last Updated</option>
+                </select>
+            </span>&nbsp;&nbsp;&nbsp;
                 <input type="submit" value="Submit">
             </span>
         </p>
     </div>
-</form>
 
-<div class="glm-admin-table-inner glm-admin-table">
+  <div class="glm-admin-table-inner glm-admin-table">
+  
+     <p><b>Total found:</b> {if $haveRequests}{$requestsCount}{else}(none){/if}&nbsp;&nbsp;</p>
+    {if $paging}
+        <input type="Submit" name="pageSelect" value="Previous {$limit} Requests" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+        <input type="Submit" name="pageSelect" value="Next {$limit} Requests" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+    {/if}
 
         <table class="wp-list-table striped glm-admin-table">
             <thead>
                     <th>Created</th>
                     <th>Updated</th>
                     <th>Status</th>
+                    <th>&nbsp;</th>
                 </tr>
             </thead>
             <tbody>
     {if $haveRequests}
         {foreach $requests as $r}
                 <tr>
-                    <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.id}">{$r.id}</a></td>
+                    <td>{$r.id}</td>
                     <td>{$r.bill_fname}</td>
                     <td>{$r.bill_lname}</td>
                     <td>{$r.bill_org}</td>
                     <td>{$r.date_created.datetime|substr:0:10}</td>
                     <td>{$r.last_update.datetime|substr:0:10}</td>
                     <td>{$r.status.name}</td>
+                    <td>
+                        <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.id}" class="button button-secondary glm-button">View Request</a>
+                {if $r.status.value == 0}
+                        <a href="{$regUrl}?page=cart&cartId={$r.id}&cartCheck={$r.cartCheck}" class="button button-secondary glm-button" target="_cart">Access Cart</a>
+                {/if}                        
+                    </td>
                 </tr>
         {/foreach}
     {else}
             </tbody>
         </table>
 
-</div>
+    {if $paging}
+        <input type="Submit" name="pageSelect" value="Previous {$limit} Requests" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+        <input type="Submit" name="pageSelect" value="Next {$limit} Requests" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+    {/if}
+
+  </div>
+
+</form>
+  
+
+<script>
+jQuery(document).ready(function($){
+
+
+    $('#statusFieldsSelect').multiselect();
+    
+});
+</script>
     
 {include file='admin/footer.html'}
 
diff --git a/views/front/registrations/cartSecurityViolation.html b/views/front/registrations/cartSecurityViolation.html
new file mode 100644 (file)
index 0000000..4fab9f3
--- /dev/null
@@ -0,0 +1,3 @@
+<div>
+    <center><h2>You are not permitted access to this page.</h2></center>
+</div>
\ No newline at end of file
index 19ddaca..0e1a8e3 100644 (file)
@@ -39,7 +39,7 @@
                 <div class="small-12 large-6 columns">
                     <label class="error">Email Address
                         {if $emailError} <span class="glm-error">{$emailError}</span> {/if}
-                        <input name="email" value="" required>
+                        <input name="email" value="{$regAccount.fieldData.email}" required>
                     </label>
                 </div>
                 <div class="small-12 large-6 columns">