Updates to list of reqistrants in request dashboard.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 2 Oct 2018 19:31:19 +0000 (15:31 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 2 Oct 2018 19:31:19 +0000 (15:31 -0400)
Also fixed a front-end link for the reg events list page where a link went nowhere.

classes/data/dataAccount.php
classes/data/dataRegRequest.php
models/admin/registrations/requests.php
views/admin/registrations/accountDashboard.html
views/admin/registrations/requestDashboard.html
views/front/registrations/list.html

index 3c0e01f..98609f1 100755 (executable)
@@ -673,7 +673,7 @@ class GlmDataRegistrationsAccount extends GlmDataAbstract
 
                 require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php';
                 $RegRequestRegistrant = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config);
-                $result_data['registrants'] = $RegRequestRegistrant-> getList('T.account = '.$result_data['id'], 'event_datetime');
+                $result_data['registrants'] = $RegRequestRegistrant->getList('T.account = '.$result_data['id'], 'event_datetime');
                 $result_data['numb_registrants'] = is_array($result_data['registrants']) * count($result_data['registrants']);
 
             }
index 5228eaa..c1e3a25 100755 (executable)
@@ -80,6 +80,18 @@ class GlmDataRegistrationsRegRequest extends GlmDataAbstract
      * @access public
      */
     public $fields = false;
+    /**
+     * Get Registrants for the request flag
+     *
+     * If this is set then post-processing will include a list of the registrants
+     * for each request retrieved.
+     *
+     * This option is false by default and must be specifically set if it is desired.
+     *
+     * @var $getRegistrantslist
+     * @access public
+     */
+    public $getRegistrantslist = false;
 
     /**
      * Constructor
@@ -422,6 +434,16 @@ class GlmDataRegistrationsRegRequest extends GlmDataAbstract
 
         }
 
+        // If requested, get a list of the registrants
+        if (in_array($action, array('l', 'g')) && $this->getRegistrantslist) {
+
+            require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php';
+            $RegRequestRegistrant = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config);
+            $result_data['registrants'] = $RegRequestRegistrant->getList('T.reg_request = '.$result_data['id'], 'lname, fname');
+            $result_data['numb_registrants'] = is_array($result_data['registrants']) * count($result_data['registrants']);
+
+        }
+
         return $result_data;
 
     }
index 48a83d9..47681cb 100755 (executable)
@@ -147,7 +147,7 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
         // If we have a request ID
         if ($requestID && $requestID > 0) {
 
-            // Try to check and get the request (cart)
+            // Try to get the request (cart)
             $cart = $regCartSupport->getRegistrationCart($requestID);
 
             // If there's no valid cart
@@ -431,7 +431,7 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ
             setcookie("glmMembersDatabaseRegistrationRequestID", $requestID, time()+86400);
         }
 
-        //echo "<pre>".print_r($requests,1)."</pre>";
+        // echo "<pre>".print_r($cart,1)."</pre>";
 
         // Compile template data
         $templateData = array(
index 878a866..38976d7 100755 (executable)
@@ -99,7 +99,7 @@
                 <td style="padding-right: 1em;">{$terms.reg_term_event_cap}</td>
                 <td style="padding-right: 1em;">Level</td>
                 <td style="padding-right: 1em;">Rate</td>
-                <td style="padding-right: 1em;">Requeest Status</td>
+                <td style="padding-right: 1em;">Request Status</td>
                 <td>Attending</td>
             </tr>
       {foreach $account.registrants as $registrant}                            
index 69d33e3..5fb67a9 100755 (executable)
     
         </div>
     </div>
-    
+
+    <div class="glm-admin-table-inner glm-admin-table">
+        <h1>Current List of {$terms.reg_term_attendee_plur_cap} for this Request</h1>
+        {assign var="i" value="0"}
+            <table class="glm-admin-table wp-list-table striped glm-nowrap">
+                <tr>
+                    <td style="padding-right: 1em;">Name</td>
+                    <td style="padding-right: 1em;">{$terms.reg_term_event_cap}</td>
+                    <td style="padding-right: 1em;">Level</td>
+                    <td style="padding-right: 1em;">Rate</td>
+                    <td>Attending</td>
+                </tr>
+       {foreach $cart.events as $event}
+        {foreach $event.classes as $class}
+         {foreach $class.rates as $rate}
+          {foreach $rate.registrants as $registrant}                            
+                <tr>
+                    <td>{$registrant.fname} {$registrant.lname}</td>
+                    <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventDashboard&option=registrants&regEventID={$event.reg_event}">{$event.event_name}</a></td>
+                    <td>{$class.class_name}</td>
+                    <td>{$rate.rate_name}</td>
+                    <td>{if $registrant.not_attending.value}No{else}Yes{/if}</td>
+                </tr>
+          {/foreach}
+         {/foreach}
+        {/foreach}                                
+       {/foreach}
+            </table>
+    </div>
+        
     <div class="glm-admin-table-inner glm-admin-table">
     
    {if $cart.request.status.name != 'In Cart'}
index ffe074f..1397f97 100755 (executable)
@@ -98,7 +98,7 @@
             {/if}
 
             <div class="glm-small-12 glm-large-4 glm-columns">
-                <a href="" class="glm-reg-list-add-btn">{$terms.reg_term_register_cap} for this {$terms.reg_term_event_cap}</a>
+                <a href="{$thisUrl}?page=registration&eventRegId={$event.id}" class="glm-reg-list-add-btn">{$terms.reg_term_register_cap} for this {$terms.reg_term_event_cap}</a>
             </div>
 
         </div>