From c47c871293f748c489263e1e9c4cd9a9531aaeb9 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 17 Oct 2017 15:40:52 -0400 Subject: [PATCH] Fix for the registrants output in account dashboard. Setup event data so we can output the event name. event_name field was removed from the immediate table. --- models/admin/registrations/accounts.php | 12 ++++++++++-- views/admin/registrations/accountDashboard.html | 14 ++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/models/admin/registrations/accounts.php b/models/admin/registrations/accounts.php index 29d5958..17cb1af 100644 --- a/models/admin/registrations/accounts.php +++ b/models/admin/registrations/accounts.php @@ -196,6 +196,8 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount $RegRequest = new GlmDataRegistrationsRegRequest($this->wpdb, $this->config); require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php'; $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 $account = $this->getEntry($accountID); @@ -213,6 +215,12 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount $registered = $RegRequestRegistrant->getList("T.account = $accountID"); if (is_array($registered) && count($registered) > 0) { $haveRegistered = true; + + // Loop through the registered array and get event names. + foreach ( $registered as $key => $reg ) { + $registered[$key]['eventData'] = $RegRequestEvent->getEntry( $reg['reg_request_event'] ); + } + echo '
$registered: ' . print_r( $registered, true ) . '
'; } } @@ -263,10 +271,10 @@ class GlmMembersAdmin_registrations_accounts extends GlmDataRegistrationsAccount } $accountsResult = $this->getList( $where, 'lname', true, 'id', $start, $limit ); - //echo '
$accountsResult: ' . print_r( $accountsResult, true ) . '
'; + // echo '
$accountsResult: ' . print_r( $accountsResult, true ) . '
'; //$accounts = $this->getList( $where ); - //echo '
$where: ' . print_r( $where, true ) . '
'; + // echo '
$where: ' . print_r( $where, true ) . '
'; // Get paging results $numbDisplayed = $accountsResult['returned']; diff --git a/views/admin/registrations/accountDashboard.html b/views/admin/registrations/accountDashboard.html index fa8e85b..643ba03 100644 --- a/views/admin/registrations/accountDashboard.html +++ b/views/admin/registrations/accountDashboard.html @@ -3,10 +3,10 @@

Selected Account Dashboard

- + Edit Account

Account

- +
@@ -93,7 +93,7 @@ {/foreach} - +
@@ -114,14 +114,16 @@ {/if} - - {$reg.event_name} + + {$reg.eventData.event_name} + + {$reg.event_datetime.datetime} {/foreach} -
+
{include file='admin/footer.html'} -- 2.17.1