More cleanup for admin request dashboard and fix duplicate regTimes for registration...
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 12 Dec 2017 16:11:26 +0000 (11:11 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 12 Dec 2017 16:11:26 +0000 (11:11 -0500)
Updated css and requestDashboard.html so that either the cart or the checkout summary is displayed at the bottom of the page.
Fixed problem with generation of regTimesJSON that resulted in duplicate times being included.

css/admin.css
models/front/registrations/registration.php
views/admin/registrations/requestDashboard.html

index 71969c1..c55028f 100644 (file)
     margin-top: 1em;
     margin-left: 2em;
 }
+
+
+
+/* Styles for cartSummary.html output */
+.glm-reg-row {
+    clear: both;
+    margin-left: auto;
+    margin-right: auto;
+    width: 100%;
+    min-height: 1.5rem;
+    white-space: nowrap;
+}
+.glm-reg-indent-1 {
+    padding-left: .5rem;
+}
+.glm-reg-indent-2 {
+    padding-left: 1rem;
+}
+.glm-reg-indent-3 {
+    padding-left: 1.5rem;
+}
+.glm-reg-space-left {
+    padding-left: 1.25rem;
+}
+.glm-reg-right {
+    text-align: right;
+}
+.glm-reg-row-bold {
+    font-weight: bold;
+}
+.glm-reg-headder-row {
+    clear: both;
+    background-color: #eee;
+    height: 2rem;
+    padding-top: .2rem;
+}
+.glm-reg-nowrap {
+    white-space: nowrap;
+}
+.glm-reg-required {
+    color: red;
+}
+/*}}} end of tampering */
+
+.glm-reg-cart-container {
+    clear: both;
+    border: solid 1px black;
+    background-color: white;
+    margin-top: 1rem;
+    margin-bottom: 1rem;
+    font-size: 0.875rem;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
index 65f6ada..59aafd8 100644 (file)
             $this->postProcAddedEventData = true;
             $regEvent = $this->getEventForRegistration($eventRegID);
 
-            // echo '<pre>$regEvent: ' . print_r( $regEvent, true ) . '</pre>';
             $regEventId = $regEvent['id'];
 
             // Create an $event array with the event data.
                         $rClass['reg_rate_base_price'] = $time['base_rate'];
                         $rClass['reg_rate_per_reg']    = $time['per_registrant'];
                         $rClass['registrant_credits']  = $time['registrant_credits'];
+
                         if ( $regEvent['time_specific'] ) {
                             $rClass['selectedTime'] = $time['id'];
                         }
-                        if ( empty( $regtimes ) ) {
-                            $regTimes[] = json_encode( $time, JSON_NUMERIC_CHECK );
+                        if ( empty( $regtimes[$time['id']] ) ) {
+                            $regTimes[$time['id']] = json_encode( $time, JSON_NUMERIC_CHECK );
                         }
                     }
                     $rClass['startingTime'] = $classStartingTime['start_datetime']['datetime'];
         $regClassJSON = '[' . implode( ',', $jsonClasses ) . ']';
         $regCartJSON  = json_encode( $cart );
         $regTimesJSON = '[' . implode( ',', $regTimes ) . ']';
-        // echo '<pre>$regTimes: ' . print_r( $regTimesJSON, true ) . '</pre>';
 
         // Get terms into JSON
         $termsJSON = json_encode( $this->config['terms'] );
index 36f75dd..dff8cc0 100644 (file)
                         </div>
                     </div>
                     
-                    <div class="glm-row">
-                        <div class="glm-small-12 glm-column">
-                            <h3>Payment Information</h3>
-                        </div>
-                    {if $cart.request.status.value}
-                        <div class="glm-small-12 glm-column">
-                            <b>Method:</b> {$cart.request.pay_method.name}
-                        </div>
-                        <div class="glm-small-12 glm-column">
-                            <b>Total:</b> {$cart.request.total}
-                        </div>
-                        <div class="glm-small-12 glm-column">
-                            <b>Name on Card:</b> {$cart.request.cc_name}
-                        </div>
-                        <div class="glm-small-12 glm-column">
-                            <b>Card Type:</b> {$cart.request.cc_type.name}
-                        </div>
-                        <div class="glm-small-12 glm-column">
-                            <b>Card Number:</b> {$cart.request.cc_numb}
-                        </div>
-                        <div class="glm-small-12 glm-column">
-                            <b>Expiration:</b> {$cart.request.cc_exp}
-                        </div>
-                        <div class="glm-small-12 glm-column">
-                            <b>Confirmation:</b> {$cart.request.cc_conf}
-                        </div>
-                        <div class="glm-small-12 glm-column">
-                            <b>Card Process Msg:</b> {$cart.request.cc_proc_mesg}
-                        </div>
-                    {else}
-                        <div class="glm-small-12 glm-column">
-                            (not available)
-                        </div>
-                    {/if}
-                    </div>
-
                 </div>
             </div>
             <div class="glm-small-4 glm-left">
                             {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>Checkout Summary:</h3>
-                        </div>
-                        <div class="glm-small-12 glm-column" style="margin-top: .5em;">
-                    {if $cart.request.summary}
-                            <a id="viewSummaryButton" class="button button-secondary glm-button">View</a>
-                            <div id="viewSummaryDialog" class="glm-dialog-box" title="Registration Request Checkout Summary">
-                                {$cart.request.summary}
-                            </div>
-                    {else}
-                            (not available)
-                    {/if}
-                        </div>
-                    </div>
                 </div>
             </div>
         </div>
-        
         <div class="glm-row">
             <div class="glm-small-12 glm-left">
                 <div class="glm-admin-table">
                             <h3>Notes:</h3>
                         </div>
                         <div class="glm-small-12 glm-column">
+    {if $cart.request.notes != ''}                        
                             <div style="background-color: white; border: solid black 1px; padding: .2em; margin-top: .2em;">
                                 {$cart.request.notes}
                             </div>
+    {else}
+                            (no notes entered)
+    {/if}                            
                         </div>
                     </div>
                 </div>
     
     <div>
 
-{if $haveCart && !$cart.request.summary}
+{if $cart.request.summary}
+            {$cart.request.summary}
+{else}
 
-        
-        <div>
-            <a href="{$regUrl}?page=cart&cartId={$cart.request.id}" class="button button-secondary glm-button">Show Front-End Cart Page</a>
-        </div>
-        
-        <table class="glm-admin-table" width="100%" style="background-color: #fff; border: 1px black solid; margin-top: 2rem;">
-      
-            <thead>
-
-                <tr>
-                    <th>Registering</th>
-                    <th>Registrant</th>
-                    <th>Date/Time</th>
-                    <th>Discount</th>
-                    <th>Rate</th>
-                </tr>
+  {if $haveCart}
+    {assign var="summaryType" value="adminRequest"}
+    {include file='front/registrations/cartSummary.html'}
+  {/if} {* / if have cart *}
 
-
-            </thead>
-            <tbody>
-  {foreach $cart.events as $event}
-                <tr>
-                    <th colspan="5">Event: {$event.event_name}</th>
-                </tr>
-    {foreach $event.classes as $class}
-                <tr>
-                    <td colspan="5">&nbsp;&nbsp;&nbsp;&nbsp;{$class.class_name}</td>
-                </tr>
-      {foreach $class.rates as $rate}
-        {if $rate.base_rate || $rate.registrant_credits}
-                <tr>
-                    <td colspan="4">
-                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$rate.rate_name}
-                        - Base Rate ({$rate.registrant_credits} registrants included)
-                    </td>
-                    <td style="text-align: right;">
-                        {if $rate.base_rate}{$rate.base_rate_money}{/if}
-                    </td>
-                </tr>
-        {/if}
-        {foreach $rate.registrants as $registrant}
-                <tr>
-                    <td>&nbsp;</td>
-                    <td>{$registrant.fname} {$registrant.lname}</td>
-                    <td>{$registrant.timeReformatted}</td>
-                    <td style="text-align: right;">
-                        {if $registrant.registrantDiscounts > 0}
-                            {$registrant.registrantDiscounts|number_format:2}
-                        {else}
-                            &nbsp;
-                        {/if}
-                    </td>
-                    <td style="text-align: right;">
-                        {if $registrant.registrantRate > 0}
-                            {$registrant.registrantRate|number_format:2}
-                        {else}
-                            (included)
-                        {/if}
-                    </td>
-                </tr>
-          {assign var="acct" value=$cart.accounts.{$registrant.account}}
-          {if $acct.validated.value}
-                <tr>
-                    <td colspan="2">&nbsp;</td>
-                    <td colspan="3">
-                      {if $acct.email != ''}E-Mail: {$acct.email}<br>{/if}
-                      (Account information is restricted)
-                    </td>
-                </tr>
-          {else}
-            {if $acct.addr1 != '' || $acct.phone != '' || $acct.email != ''}
-                <tr>
-                    <td colspan="2">&nbsp;</td>
-                    <td colspan="3">
-                      {if $acct.org != ''}          {$acct.title}, {$acct.org}<br>                      {/if}
-                      {if $acct.addr1 != ''}        {$acct.addr1}<br>                                   {/if}
-                      {if $acct.addr2 != ''}        {$acct.addr2}<br>                                   {/if}
-                      {if $acct.city != ''}         {$acct.city}, {$acct.state.value} {$acct.zip}<br>   {/if}
-                      {if $acct.country.name != ''} {$acct.country.name}<br>                            {/if}
-                      {if $acct.phone != ''}        Phone: {$acct.phone}<br>                            {/if}
-                      {if $acct.fax != ''}          Fax: {$acct.fax}<br>                                {/if}
-                      {if $acct.email != ''}        E-Mail: {$acct.email}                               {/if}
-                    </td>
-                </tr>
-            {/if}
-          {/if}
-        {/foreach}
-      {/foreach}
-    {/foreach}
-  {/foreach}
-            </tbody>
-            <tfoot>
-                <td colspan="2">&nbsp;</td>
-                <td>Total registrants: {$cart.totalRegistrants}</td>
-                <td style="text-align: right;">
-                    {if $cart.totalDiscounts > 0}
-                        ${$cart.totalDiscounts|number_format:2}
-                    {else}
-                        &nbsp;
-                    {/if}
-                </td>
-                <td style="text-align: right;">${$cart.totalCharges|number_format:2}</td>
-            </tfoot>
-        </table>
-{/if} {* / if have cart *}
+{/if}
     </div>
 </div>