Field testing on event registration edit form
authorLaury GvR <laury@gaslightmedia.com>
Fri, 19 May 2017 20:49:10 +0000 (16:49 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 19 May 2017 20:49:10 +0000 (16:49 -0400)
models/admin/registrations/events.php
views/admin/registrations/editEvent.html

index eaeb69f..d5b6972 100644 (file)
@@ -102,14 +102,29 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
 
         /////////////////////////////////////
 
-        $haveRegistrations   = false;
-        $registrations       = false;
-        $haveRegistration    = false;
-        $registrationId      = false;
-        $registrationCart    = false;
-        $option         = 'list';
-        $errorMsg       = false;
-        $view               = "events";
+        $option                  = 'list';
+        $numbRegistrations       = 0;
+        $hasRegistrations        = false;
+        $paging                  = true;
+        $prevStart               = false;
+        $nextStart               = false;
+        $start                   = 1;
+        $limit                   = 20;        // Set to the number of listings per page
+        $fromDate                = false;
+        $toDate                  = false;
+        $filterArchived          = false;
+        $filterPending           = false;
+        $registrations           = false;
+        $view                    = 'events';
+        $registration            = false;
+        $haveRegistration        = false;
+        $registrationUpdated     = false;
+        $registrationUpdateError = false;
+        $registrationAdded       = false;
+        $registrationAddError    = false;
+        $namesList               = false;
+        $numbDisplayed           = false;
+        $lastDisplayed           = false;
 
         // Load registrations support class
         require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/registrationsSupport.php';
@@ -154,7 +169,7 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
                 $registration = $this->editEntry( $this->registrationID );
                 //echo '<pre>$registration: ' . print_r( $registration, true ) . '</pre>';
                 if ( $registration['status'] ) {
-                    $haveAccount = true;
+                    $haveRegistration = true;
                 }
                 //echo '<pre>$registration: ' . print_r( $registration, true ) . '</pre>';
 
@@ -171,7 +186,7 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
                     // Retrieve the Edit Entry again
                     $registration = $this->editEntry( $this->registrationID );
                     if ( $registration['status'] ) {
-                        $haveAccount = true;
+                        $haveRegistration = true;
                     }
                 } else {
                     $registrationUpdateError = true;
@@ -180,7 +195,7 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
                 break;
 
             case 'delete':
-                $oldAccount = $this->deleteEntry( $this->registrationID, true );
+                $oldRegistration = $this->deleteEntry( $this->registrationID, true );
                 $view   = 'registration';
 
             // Check registration and update holds
@@ -236,16 +251,34 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
                 break;
 
         }
-//        echo "<pre>". print_r($registrations, true) . "</pre>";
+        //echo "<pre>". print_r($registration, true) . "</pre>";
+
 
 
         // Compile template data
         $templateData = array(
-            'haveRegistrations' => $haveRegistrations,
-            'registrations'     => $registrations,
-            'haveRegistration'  => $haveRegistration,
-            'errorMsg'          => $errorMsg,
-            'option'            => $option
+            'hasRegistrations'        => $hasRegistrations,
+            'numRegistrations'        => ($registrations) ? count($registrations) : 0,
+            'registrations'           => $registrations,
+            'registration'            => $registration,
+            'limit'                   => $limit,
+            'prevStart'               => $prevStart,
+            'nextStart'               => $nextStart,
+            'paging'                  => $paging,
+            'fromDate'                => $fromDate,
+            'toDate'                  => $toDate,
+            'filterArchived'          => $filterArchived,
+            'filterPending'           => $filterPending,
+            'registrationID'          => $this->registrationID,
+            'haveRegistration'        => $haveRegistration,
+            'registrationUpdated'     => $registrationUpdated,
+            'registrationUpdateError' => $registrationUpdateError,
+            'option'                  => $option,
+            'registrationAdded'       => $registrationAdded,
+            'registrationAddError'    => $registrationAddError,
+            'namesList'               => $namesList,
+            'numbDisplayed'           => $numbDisplayed,
+            'lastDisplayed'           => $lastDisplayed,
         );
 
         /////////////////////////////////////
index a94ec88..517ebf2 100644 (file)
@@ -9,16 +9,16 @@ Here
 
   {if $option == 'edit' || $option == 'update'}
 *** Edit or Update ***<!--
-    <a id="deleteAccountButton" class="button button-secondary glm-button glm-right">Delete this Account</a>
-    <div id="deleteAccountDialog" class="glm-dialog-box" title="Delete Account">
+    <a id="deleteRegistrationButton" class="button button-secondary glm-button glm-right">Delete this Registration</a>
+    <div id="deleteRegistrationDialog" class="glm-dialog-box" title="Delete Registration">
         <center>
-            <p><a id="deleteAccountCancel" class="button button-primary">Cancel</a></p>
-            <p><input id="deleteAccountSubmit" type="submit" value="Delete this contact"></p>
+            <p><a id="deleteRegistrationCancel" class="button button-primary">Cancel</a></p>
+            <p><input id="deleteRegistrationSubmit" type="submit" value="Delete this contact"></p>
         </center>
         <div class="glm-item-container">
             <p><center><span class="glm-error">WARNING:</span></center></p>
             <p>
-                <span class="glm-warning">Clicking the "Delete this Account" button above will
+                <span class="glm-warning">Clicking the "Delete this Registration" button above will
                 delete all of the data and images associated with this contact.
                 </span>
             </p>
@@ -27,23 +27,57 @@ Here
             </p>
         </div>
     </div>
-    <h2>Edit Account
+    <h2>Edit Registration
 -->
+    <h2>Edit an event registration
   {else}
   *** Add new one***
+    <h2>Add a new event registration
+  {/if}
+         &nbsp;&nbsp;&nbsp;
+        {if $registrationUpdated}<span class="glm-notice glm-flash-updated">Registration Updated</span>{/if}
+        {if $registrationUpdateError}<span class="glm-error glm-flash-updated">Registration Update Error</span>{/if}
+        {if $registrationAdded}<span class="glm-notice glm-flash-updated">Registration Added</span>{/if}
+        {if $registrationAddError}<span class="glm-error glm-flash-updated">Registration Add Error</span>{/if}
+    </h2>
+
+
+    <form action="{$thisUrl}?page={$thisPage}" method="post" id="searchForm">
+        <input type="hidden" name="glm_action" value="registrations">
+    {if $haveRegistration}
+        <input type="hidden" name="option" value="update">
+        <input type="hidden" name="registration" value="{$registrationID}">
+    {else}
+        <input type="hidden" name="option" value="insert">
+    {/if}
+        <input type="hidden" name="contact_id" value="0">
+        <table id="glm-table-registration" class="glm-admin-table glm-registration-table">
+
+
+            <tr>
+                <th {if $registration.fieldRequired.event_name} class="glm-required"}{/if}>Event Name</th>
+                <td {if $registration.fieldFail.event_name}class="glm-form-bad-input" data-tabid="glm-event_name"{/if}>
+                    <input type="text" name="fname" value="{$registration.fieldData.event_name}" class="glm-form-text-input-medium">
+                {if $registration.fieldFail.event_name}<p>{$registration.fieldFail.event_name}</p>{/if}<br>
+                </td>
+            </tr>
+
+        </table>
+    </form>
+
 <!--    {$req = $cart.request}
 
     <table class="glm-admin-table">
         <tr>
             <td>
-                <table class="glm-admin-table glm-account-table glm-admin-table-close-spaced">
+                <table class="glm-admin-table glm-registration-table glm-admin-table-close-spaced">
                     <tr><th>Request ID: </th><td>{$req.id}</td></tr>
                     <tr><th>Date Submitted: </th><td>{$req.date_submitted.datetime}</td></tr>
                     <tr><th>Status: </th><td>{$req.status.name}</td></tr>
                 </table>
             </td>
             <td>
-                <table id="glm-table-account" class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+                <table id="glm-table-registration" class="glm-admin-table glm-registration-table glm-admin-table-border glm-admin-table-close-spaced">
                     <tr><th><center>Billing Information</center></th></tr>
                     <tr>
                         <td>
@@ -71,14 +105,14 @@ Here
     {if $req.notes}
 
             <td>
-                <table class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+                <table class="glm-admin-table glm-registration-table glm-admin-table-border glm-admin-table-close-spaced">
                     <tr><th><center>Notes</center></th></tr>
                     <tr><td>{$req.notes}</td></tr>
                 </table>
             </td>
     {/if}
         </tr>
-    <table class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+    <table class="glm-admin-table glm-registration-table glm-admin-table-border glm-admin-table-close-spaced">
         <tr><th><center>Registrations Selected</center></th></tr>
         <tr>
             <td>
@@ -110,6 +144,5 @@ Here
         </tr>
     </table>
     -->
-  {/if}
 
 {include file='admin/footer.html'}