From: Chuck Scott Date: Tue, 2 Oct 2018 18:23:02 +0000 (-0400) Subject: Some cleanup after testing with new admin accounts features. X-Git-Tag: v1.1.0^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=3c5d877a80ea8b2324e8940de6a3cdf6e66e523c;p=WP-Plugins%2Fglm-member-db-registrations.git Some cleanup after testing with new admin accounts features. Also used some updated code from this new feature to improve individual account dashboard --- diff --git a/classes/data/dataAccount.php b/classes/data/dataAccount.php index 112c53c..3c0e01f 100755 --- a/classes/data/dataAccount.php +++ b/classes/data/dataAccount.php @@ -660,7 +660,7 @@ class GlmDataRegistrationsAccount extends GlmDataAbstract } // If doing a list operation - if (in_array($action, array('l'))) { + if (in_array($action, array('l', 'g'))) { // If getAccountActivity is set and this is a list request if ($this->getAccountActivity) { diff --git a/models/admin/registrations/accounts.php b/models/admin/registrations/accounts.php index 9cc8029..591febd 100755 --- a/models/admin/registrations/accounts.php +++ b/models/admin/registrations/accounts.php @@ -113,10 +113,10 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount $namesList = false; $numbDisplayed = false; $lastDisplayed = false; - $requests = false; - $haveRequests = false; - $registered = false; - $haveRegistered = false; +// $requests = false; +// $haveRequests = false; +// $registered = false; +// $haveRegistered = false; // Get any provided option if (isset($_REQUEST['option'])) { @@ -193,6 +193,7 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount case 'accountDashboard': +/* // Load registration request and registration registrant data classes require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php'; $RegRequest = new GlmDataRegistrationsRegRequest($this->wpdb, $this->config); @@ -200,13 +201,18 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount $RegRequestRegistrant = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config); require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH . '/data/dataRegRequestEvent.php'; $RegRequestEvent = new GlmDataRegistrationsRequestEvent( $this->wpdb, $this->config ); - - // Get account base data +*/ + // Get account base data along with associated requests and attendee data + $this->getAccountActivity = true; $account = $this->getEntry($accountID); +//echo "
".print_r($account,1)."
"; + + if ($account) { $haveAccount = true; +/* // Get any registrations submitted $requests = $RegRequest->getList("T.account = $accountID"); if (is_array($requests) && count($requests) > 0) { @@ -223,7 +229,7 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount $registered[$key]['eventData'] = $RegRequestEvent->getEntry( $reg['reg_request_event'] ); } } - +*/ } $view = 'accountDashboard'; @@ -319,12 +325,9 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount $where .= " AND active"; } - // Compile input values array - - + // Get accounts list with activity (requests and registrations) data $this->getAccountActivity = true; $accountsResult = $this->getList( $where, 'lname', true, 'id', $start, $limit ); - //echo '
$accountsResult: ' . print_r( $accountsResult, true ) . '
'; //$accounts = $this->getList( $where ); // echo '
$where: ' . print_r( $where, true ) . '
'; @@ -393,10 +396,10 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount 'namesList' => $namesList, 'numbDisplayed' => $numbDisplayed, 'lastDisplayed' => $lastDisplayed, - 'requests' => $requests, - 'haveRequests' => $haveRequests, - 'registered' => $registered, - 'haveRegistered' => $haveRegistered, +// 'requests' => $requests, +// 'haveRequests' => $haveRequests, +// 'registered' => $registered, +// 'haveRegistered' => $haveRegistered, 'reason' => $reason ); // Return status, any suggested view, and any data to controller diff --git a/views/admin/registrations/accountDashboard.html b/views/admin/registrations/accountDashboard.html old mode 100644 new mode 100755 index 299570b..878a866 --- a/views/admin/registrations/accountDashboard.html +++ b/views/admin/registrations/accountDashboard.html @@ -27,10 +27,10 @@ {/if}
- {$account.city}, {$account.state} {$account.zip} + {$account.city}, {$account.state.name} {$account.zip}
- {$account.country} + {$account.country.name}
@@ -61,70 +61,62 @@ -
+
+{if $account.numb_requests} +

{$terms.reg_term_registration_cap} Requests

- {assign var="i" value="0"} - - - - - - - - - - - - {foreach $requests as $req} - {if $i++ is odd by 1} - - {else} - - {/if} - - - - - + {assign var="i" value="0"} +
IDSubmittedPayment ByTotal PaymentStatus
- - {$req.id} - - {$req.date_submitted.datetime}{$req.pay_method.name}{$req.total}{$req.status.name}
+ + + + + + - {/foreach} + {foreach $account.requests as $request} + + + + + + + + {/foreach}
IDDate SubmittedPay MethodStatus{$terms.reg_term_attendee_plur_cap}
{$request.id}{$request.date_submitted.datetime}{$request.pay_method.name}{$request.status.name}{$request.registrants}
-
+
+{/if} -
-

{$terms.reg_term_registered} for {$terms.reg_term_event_plur_cap}

+{if $account.numb_registrants} +
+

{$terms.reg_term_registered_cap} for {$terms.reg_term_event_plur_cap}

{assign var="i" value="0"} - - +
- - + + + + + + + - - - {foreach $registered as $reg} - {if $i++ is odd by 1} + {foreach $account.registrants as $registrant} - {else} - - {/if} - - - + + + + + + + + {/foreach} -
{$terms.reg_term_event_cap} NameDate/TimeIDName{$terms.reg_term_event_cap}LevelRateRequeest StatusAttending
- - {$reg.eventData.event_name} - - - {$reg.event_datetime.datetime}
{$registrant.id}{$registrant.fname} {$registrant.lname}{$registrant.event_name}{$registrant.class_name}{$registrant.rate_name}{$registrant.request_status_name}{if $registrant.not_attending.value}No{else}Yes{/if}
+ +
+{/if}
- {include file='admin/footer.html'} diff --git a/views/admin/registrations/accountsDashboard.html b/views/admin/registrations/accountsDashboard.html index 419c43d..5a92563 100755 --- a/views/admin/registrations/accountsDashboard.html +++ b/views/admin/registrations/accountsDashboard.html @@ -96,8 +96,8 @@ {if $account.state.value != ''}{if $account.city != ''},ddd {/if}{$account.state.name}{/if} {if $account.country.value}{$account.country.name}{/if} {if $account.city || $account.state.value || $account.country.value}
{/if} - {if $account.phone != ''}Phone: {$account.phone}
{/if} - {if $account.email != ''}Email Address: {$account.email}
{/if} + {if $account.phone != ''}{$account.phone}
{/if} + {if $account.email != ''}{$account.email}
{/if}

diff --git a/views/admin/registrations/eventsDashboard.html b/views/admin/registrations/eventsDashboard.html index 9771900..0bad13f 100755 --- a/views/admin/registrations/eventsDashboard.html +++ b/views/admin/registrations/eventsDashboard.html @@ -257,8 +257,13 @@ $('#requestLinks_' + requestHoverId).removeClass('glm-hidden'); }); - // Request Edit Action + // Request Edit Action - Clicking with edit open will close it $('.glm-request-link').on('click', function() { + if (requestEditId) { + $('.glm-request-detail').addClass('glm-hidden'); + requestEditId = false; + return; + } requestEditId = $(this).attr('data-request'); $('#requestEdit_' + requestEditId).removeClass('glm-hidden'); });