From b3871d8cb1394cf8852e12791e5b3d0df8a17514 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 12 Dec 2017 11:11:26 -0500 Subject: [PATCH] More cleanup for admin request dashboard and fix duplicate regTimes for registration page in front-end. 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 | 78 ++++++++ models/front/registrations/registration.php | 7 +- .../admin/registrations/requestDashboard.html | 169 ++---------------- 3 files changed, 93 insertions(+), 161 deletions(-) diff --git a/css/admin.css b/css/admin.css index 71969c1..c55028f 100644 --- a/css/admin.css +++ b/css/admin.css @@ -54,4 +54,82 @@ 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; +} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 65f6ada..59aafd8 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -159,7 +159,6 @@ $this->postProcAddedEventData = true; $regEvent = $this->getEventForRegistration($eventRegID); - // echo '
$regEvent: ' . print_r( $regEvent, true ) . '
'; $regEventId = $regEvent['id']; // Create an $event array with the event data. @@ -217,11 +216,12 @@ $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']; @@ -240,7 +240,6 @@ $regClassJSON = '[' . implode( ',', $jsonClasses ) . ']'; $regCartJSON = json_encode( $cart ); $regTimesJSON = '[' . implode( ',', $regTimes ) . ']'; - // echo '
$regTimes: ' . print_r( $regTimesJSON, true ) . '
'; // Get terms into JSON $termsJSON = json_encode( $this->config['terms'] ); diff --git a/views/admin/registrations/requestDashboard.html b/views/admin/registrations/requestDashboard.html index 36f75dd..dff8cc0 100644 --- a/views/admin/registrations/requestDashboard.html +++ b/views/admin/registrations/requestDashboard.html @@ -62,42 +62,6 @@ -
-
-

Payment Information

-
- {if $cart.request.status.value} -
- Method: {$cart.request.pay_method.name} -
-
- Total: {$cart.request.total} -
-
- Name on Card: {$cart.request.cc_name} -
-
- Card Type: {$cart.request.cc_type.name} -
-
- Card Number: {$cart.request.cc_numb} -
-
- Expiration: {$cart.request.cc_exp} -
-
- Confirmation: {$cart.request.cc_conf} -
-
- Card Process Msg: {$cart.request.cc_proc_mesg} -
- {else} -
- (not available) -
- {/if} -
-
@@ -126,25 +90,9 @@ {if $cart.request.validated.value}Yes{else}{if $cart.request.validation_message}{$cart.request.validation_message}{else}(not yet validated){/if}{/if}
-
-
-

Checkout Summary:

-
-
- {if $cart.request.summary} - View -
- {$cart.request.summary} -
- {else} - (not available) - {/if} -
-
-
@@ -154,9 +102,13 @@

Notes:

+ {if $cart.request.notes != ''}
{$cart.request.notes}
+ {else} + (no notes entered) + {/if}
@@ -172,113 +124,16 @@
-{if $haveCart && !$cart.request.summary} +{if $cart.request.summary} + {$cart.request.summary} +{else} - -
- Show Front-End Cart Page -
- - - - - - - - - - - - + {if $haveCart} + {assign var="summaryType" value="adminRequest"} + {include file='front/registrations/cartSummary.html'} + {/if} {* / if have cart *} - - - - {foreach $cart.events as $event} - - - - {foreach $event.classes as $class} - - - - {foreach $class.rates as $rate} - {if $rate.base_rate || $rate.registrant_credits} - - - - - {/if} - {foreach $rate.registrants as $registrant} - - - - - - - - {assign var="acct" value=$cart.accounts.{$registrant.account}} - {if $acct.validated.value} - - - - - {else} - {if $acct.addr1 != '' || $acct.phone != '' || $acct.email != ''} - - - - - {/if} - {/if} - {/foreach} - {/foreach} - {/foreach} - {/foreach} - - - - - - - -
RegisteringRegistrantDate/TimeDiscountRate
Event: {$event.event_name}
    {$class.class_name}
-         {$rate.rate_name} - - Base Rate ({$rate.registrant_credits} registrants included) - - {if $rate.base_rate}{$rate.base_rate_money}{/if} -
 {$registrant.fname} {$registrant.lname}{$registrant.timeReformatted} - {if $registrant.registrantDiscounts > 0} - {$registrant.registrantDiscounts|number_format:2} - {else} -   - {/if} - - {if $registrant.registrantRate > 0} - {$registrant.registrantRate|number_format:2} - {else} - (included) - {/if} -
  - {if $acct.email != ''}E-Mail: {$acct.email}
{/if} - (Account information is restricted) -
  - {if $acct.org != ''} {$acct.title}, {$acct.org}
{/if} - {if $acct.addr1 != ''} {$acct.addr1}
{/if} - {if $acct.addr2 != ''} {$acct.addr2}
{/if} - {if $acct.city != ''} {$acct.city}, {$acct.state.value} {$acct.zip}
{/if} - {if $acct.country.name != ''} {$acct.country.name}
{/if} - {if $acct.phone != ''} Phone: {$acct.phone}
{/if} - {if $acct.fax != ''} Fax: {$acct.fax}
{/if} - {if $acct.email != ''} E-Mail: {$acct.email} {/if} -
 Total registrants: {$cart.totalRegistrants} - {if $cart.totalDiscounts > 0} - ${$cart.totalDiscounts|number_format:2} - {else} -   - {/if} - ${$cart.totalCharges|number_format:2}
-{/if} {* / if have cart *} +{/if}
-- 2.17.1