From: Chuck Scott Date: Thu, 16 Nov 2017 20:51:18 +0000 (-0500) Subject: Updates to registrations admin. Working on completing various page output. X-Git-Tag: v1.0.0^2~261 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=2ef74309b4c430896f3b0665a7a726a7b62ae767;p=WP-Plugins%2Fglm-member-db-registrations.git Updates to registrations admin. Working on completing various page output. Added better formatted date to getRegistrationCart() data. Staging regRequestEvent.php for deletion. Added admin hook to display a link to an event from registrations. Added links between Events and Registrations on vaious tables and dashboards. Added cart data to admin requests dashboard. Various other minor appearance issues. --- diff --git a/classes/regCartSupport.php b/classes/regCartSupport.php index 84cd3a5..f9ab1f5 100644 --- a/classes/regCartSupport.php +++ b/classes/regCartSupport.php @@ -229,10 +229,12 @@ class GlmRegCartSupport // Get list of registrants requested for this rate $this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'] = $RequestRegistrant->getList("T.reg_request_rate = ".$rate['id']); - // For each rate selected for this class + // For each registrant under this rate if ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants']) { foreach ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'] as $registrantKey => $registrant) { + $this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'][$registrantKey]['timeReformatted'] = date('l m/d/Y g:i A', strtotime($registrant['event_time'])); + // Add registrant account to accounts table $this->addAccountToCart($registrant['account']); diff --git a/css/admin.css b/css/admin.css index 01faa2a..71969c1 100644 --- a/css/admin.css +++ b/css/admin.css @@ -54,3 +54,4 @@ margin-top: 1em; margin-left: 2em; } + diff --git a/models/admin/ajax/account.php b/models/admin/ajax/account.php index 962cff2..faf80a1 100644 --- a/models/admin/ajax/account.php +++ b/models/admin/ajax/account.php @@ -78,7 +78,7 @@ class GlmMembersAdmin_ajax_account extends GlmDataRegistrationsAccount $return = false; $option = filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING ); - trigger_error(print_r($_REQUEST,E_USER_NOTICE)); + // trigger_error(print_r($_REQUEST,E_USER_NOTICE)); switch ( $option ) { case 'register': diff --git a/models/admin/ajax/regFront/DELETE_regRequestEvent.php b/models/admin/ajax/regFront/DELETE_regRequestEvent.php new file mode 100644 index 0000000..ee3579d --- /dev/null +++ b/models/admin/ajax/regFront/DELETE_regRequestEvent.php @@ -0,0 +1,114 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release regRequestEvent.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +// Load Registrations data abstract +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php'; + +class GlmMembersAdmin_registrations_ajax_regClasses extends GlmDataRegistrationsRequestEvent +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /** + * Constructor + * + * This contructor performs the work for this model. This model returns + * an array containing the following. + * + * 'status' + * + * True if successfull and false if there was a fatal failure. + * + * 'view' + * + * A suggested view name that the contoller should use instead of the + * default view for this model or false to indicate that the default view + * should be used. + * + * 'data' + * + * Data that the model is returning for use in merging with the view to + * produce output. + * + * @wpdb object WordPress database object + * + * @return array Array containing status, suggested view, and any data + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + /* + * Run constructor for the REgistrations data class + * + * Note, the third parameter is a flag that indicates to the Contacts + * data class that it should flag a group of fields as 'view_only'. + */ + parent::__construct(false, false, true); + + } + + public function modelAction($modelData) + { + +trigger_error(print_r($modelData,1)); + + // Perform specified action + switch ($modelData['option']) { + + case 'add': + break; + + case 'get': + break; + + case 'update': + break; + + case 'delete': + break; + + default: + die(); // should never get here + break; + + } + + wp_die(); + + + + } + + +} diff --git a/models/admin/ajax/regFront/regRequestEvent.php b/models/admin/ajax/regFront/regRequestEvent.php deleted file mode 100644 index ee3579d..0000000 --- a/models/admin/ajax/regFront/regRequestEvent.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release regRequestEvent.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ - * @link http://dev.gaslightmedia.com/ - */ - -// Load Registrations data abstract -require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php'; - -class GlmMembersAdmin_registrations_ajax_regClasses extends GlmDataRegistrationsRequestEvent -{ - - /** - * WordPress Database Object - * - * @var $wpdb - * @access public - */ - public $wpdb; - /** - * Plugin Configuration Data - * - * @var $config - * @access public - */ - public $config; - - /** - * Constructor - * - * This contructor performs the work for this model. This model returns - * an array containing the following. - * - * 'status' - * - * True if successfull and false if there was a fatal failure. - * - * 'view' - * - * A suggested view name that the contoller should use instead of the - * default view for this model or false to indicate that the default view - * should be used. - * - * 'data' - * - * Data that the model is returning for use in merging with the view to - * produce output. - * - * @wpdb object WordPress database object - * - * @return array Array containing status, suggested view, and any data - */ - public function __construct ($wpdb, $config) - { - - // Save WordPress Database object - $this->wpdb = $wpdb; - - // Save plugin configuration object - $this->config = $config; - - /* - * Run constructor for the REgistrations data class - * - * Note, the third parameter is a flag that indicates to the Contacts - * data class that it should flag a group of fields as 'view_only'. - */ - parent::__construct(false, false, true); - - } - - public function modelAction($modelData) - { - -trigger_error(print_r($modelData,1)); - - // Perform specified action - switch ($modelData['option']) { - - case 'add': - break; - - case 'get': - break; - - case 'update': - break; - - case 'delete': - break; - - default: - die(); // should never get here - break; - - } - - wp_die(); - - - - } - - -} diff --git a/models/admin/ajax/regFront/registrant.php b/models/admin/ajax/regFront/registrant.php index fae4e50..8ce06e3 100644 --- a/models/admin/ajax/regFront/registrant.php +++ b/models/admin/ajax/regFront/registrant.php @@ -82,7 +82,7 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations { $validated = false; - trigger_error(print_r($modelData,1)); + // trigger_error(print_r($modelData,1)); if ( !isset( $modelData['option'] ) ) { $option = null; diff --git a/models/admin/ajax/updateAvailability.php b/models/admin/ajax/updateAvailability.php index e37d121..1447373 100644 --- a/models/admin/ajax/updateAvailability.php +++ b/models/admin/ajax/updateAvailability.php @@ -71,7 +71,6 @@ wp_die(); } -trigger_error("1111",E_USER_NOTICE); // Get the reg_time entry id if (!isset($_REQUEST['reg_time'])) { wp_die(); @@ -81,17 +80,14 @@ trigger_error("1111",E_USER_NOTICE); wp_die(); } -trigger_error("regTimeId = $regTimeId",E_USER_NOTICE); // Try to get the reg_time entry $regTime = $this->getEntry($regTimeId); if (!$regTime) { wp_die(); } -trigger_error("3333",E_USER_NOTICE); // re-calculate the total $avail = $max - $regTime['attendee_count'] - $regTime['attendees_pending']; -trigger_error("max = $max, avail = $avail", E_USER_NOTICE); // Try to update the reg_time entry $this->wpdb->update( $this->table, diff --git a/models/admin/registrations/requests.php b/models/admin/registrations/requests.php index 079d96f..f374468 100644 --- a/models/admin/registrations/requests.php +++ b/models/admin/registrations/requests.php @@ -196,6 +196,8 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ update_option('glmMembersDatabaseRegistrationsRequestID', $requestID); } + // echo "
".print_r($cart,1)."
"; + // Compile template data $templateData = array( 'haveRequests' => $haveRequests, @@ -205,7 +207,8 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ 'cart' => $cart, 'haveCart' => $haveCart, 'errorMsg' => $errorMsg, - 'option' => $option + 'option' => $option, + 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/' ); // Return status, any suggested view, and any data to controller return array( diff --git a/views/admin/registrations/eventDashboard.html b/views/admin/registrations/eventDashboard.html index ff208d2..ae688e8 100644 --- a/views/admin/registrations/eventDashboard.html +++ b/views/admin/registrations/eventDashboard.html @@ -64,6 +64,10 @@ {if apply_filters('glm_members_menu_members', true)}
+ {$r_link = apply_filters('glm_members_add_link_to_registrations_event_list_entry', $regEvent.event)} + {if is_array($r_link)} + Edit {$r_link.title} + {/if} Edit Registration Event
{/if} diff --git a/views/admin/registrations/eventsDashboard.html b/views/admin/registrations/eventsDashboard.html index 654b62f..e0304f6 100644 --- a/views/admin/registrations/eventsDashboard.html +++ b/views/admin/registrations/eventsDashboard.html @@ -41,6 +41,7 @@ ID Event Name +   @@ -56,7 +57,13 @@ {$r.id} - {$r.event_name} + {$r.event_name} + + + {$r_link = apply_filters('glm_members_add_link_to_registrations_event_list_entry', $r.event)} + {if is_array($r_link)} + {$r_link.title} + {/if} {/foreach} diff --git a/views/admin/registrations/requestDashboard.html b/views/admin/registrations/requestDashboard.html index 6fd6326..baaa708 100644 --- a/views/admin/registrations/requestDashboard.html +++ b/views/admin/registrations/requestDashboard.html @@ -7,13 +7,22 @@
Edit Request -

Request

+

Request

+
+
+

Request ID:

+
+
+ {$cart.request.id} +
+
+

Account Submitting Request:

@@ -107,10 +116,12 @@

Checkout Summary:

+ {if $cart.request.summary} View
{$cart.request.summary}
+ {/if}
@@ -140,9 +151,122 @@
-

Request Cart

+

Current Cart Contents

+ +
+ +{if $haveCart && !$cart.request.summary} + + + + + + + + + + + + + + + + + + + + {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 *} +
+
+ - (awaiting page development) +
diff --git a/views/admin/registrations/requestsDashboard.html b/views/admin/registrations/requestsDashboard.html index 98603c6..065e7c2 100644 --- a/views/admin/registrations/requestsDashboard.html +++ b/views/admin/registrations/requestsDashboard.html @@ -19,18 +19,26 @@ Org City State + Country + Phone + E-mail + Status {if $haveRequests} {foreach $requests as $r} - {$r.id}show - {$r.bill_fname} - {$r.bill_lname} - {$r.bill_org} + {$r.id} + {$r.bill_fname} + {$r.bill_lname} + {$r.bill_org} {$r.bill_city} {$r.bill_state} + {$r.bill_country} + {$r.bill_phone} + {$r.bill_email} + {$r.status.name} {/foreach} {else} diff --git a/views/front/registrations/cart.html b/views/front/registrations/cart.html index f23f136..36b29dd 100644 --- a/views/front/registrations/cart.html +++ b/views/front/registrations/cart.html @@ -87,7 +87,7 @@ {else} - {if $acct.addr != '' || $acct.phone != '' || $acct.email != ''} + {if $acct.addr1 != '' || $acct.phone != '' || $acct.email != ''}   diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index b844b9c..a5a83d5 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -13,7 +13,7 @@

<%= event_name %>

<% if ( this.getClassCount() == 0 ) { %> -

Registrations for this event not currently available at this time.

+

Registrations not available at this time.

<% } else { %> <% if ( !time_specific ) { %>

Attend any time during event