From 63065ea46387faba1f62044973c03d0f19411425 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 10 Jul 2018 13:02:19 -0400 Subject: [PATCH] Added checkboxes for all possible status values in event attendees export dialog box. Also update the name of one status value. --- config/plugin.ini | 2 +- models/admin/ajax/registrantsListExport.php | 29 +++---- models/admin/registrations/events.php | 5 +- .../admin/registrations/eventRegistrants.html | 77 ++++++++++++++----- 4 files changed, 75 insertions(+), 38 deletions(-) diff --git a/config/plugin.ini b/config/plugin.ini index c73bb20..4d786a2 100644 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -204,7 +204,7 @@ submission_status[20] = 'Unpaid' submission_status[30] = 'Card Pending' submission_status[40] = 'Card Declined' submission_status[50] = 'Payment Pending' -submission_status[60] = 'On Arrival' +submission_status[60] = 'Pay On Arrival' submission_status[70] = 'Administrative Hold' submission_status[80] = 'Failed Submission' submission_status[99] = 'Canceled' diff --git a/models/admin/ajax/registrantsListExport.php b/models/admin/ajax/registrantsListExport.php index b09f954..94194ba 100644 --- a/models/admin/ajax/registrantsListExport.php +++ b/models/admin/ajax/registrantsListExport.php @@ -137,30 +137,31 @@ class GlmMembersAdmin_ajax_registrantsListExport extends GlmDataRegistrationsReq // Only return information records that are active $whereParts = array(); + // Filter for complete if given - if ( isset( $_REQUEST['complete'] ) && filter_var( $_REQUEST['complete'], FILTER_VALIDATE_BOOLEAN) ) { - $completed = true; - // $whereParts[] = "T.reg_request in ( - // SELECT id - // FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request - // WHERE status = {$this->config['submission_status_numb']['COMPLETE']})"; - - $whereParts[] = " T.not_attending <> true "; + if ( isset($_REQUEST['status']) && is_array($_REQUEST['status']) && count($_REQUEST['status']) > 0 ) { + + // Collect all checked status values + $statusSelected = array(); + foreach ($_REQUEST['status'] as $statusValue => $statusName) { + $statusSelected[] = $statusValue; + } + $statusList = implode(',', $statusSelected); + $whereParts[] = " ( SELECT count(id) FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request WHERE id = T.reg_request - AND status NOT IN - ( - {$this->config['submission_status_numb']['CART']}, - {$this->config['submission_status_numb']['FAILED']}, - {$this->config['submission_status_numb']['CANCELED']} - ) + AND status IN ($statusList) ) > 0 "; + } else { + die('ERROR: No status selected'); } + $whereParts[] = "T.not_attending <> true"; + // Check for a text search if (isset($_REQUEST['text_search']) && trim($_REQUEST['text_search'] != '')) { $textSearch = trim($_REQUEST['text_search']); diff --git a/models/admin/registrations/events.php b/models/admin/registrations/events.php index eeb7bef..ace9d88 100644 --- a/models/admin/registrations/events.php +++ b/models/admin/registrations/events.php @@ -244,10 +244,11 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent 'haveTimes' => $haveTimes, 'times' => $times, 'selectedTime' => $selectedTime, - 'notifications' => $notifications + 'notifications' => $notifications, + 'submitStatus' => $this->config['submission_status'] ); - // echo "
".print_r($templateData,1)."
"; + // echo "
".print_r($this->config['submission_status'],1)."
"; // Return status, any suggested view, and any data to controller return array( diff --git a/views/admin/registrations/eventRegistrants.html b/views/admin/registrations/eventRegistrants.html index d8324a8..8ca322a 100644 --- a/views/admin/registrations/eventRegistrants.html +++ b/views/admin/registrations/eventRegistrants.html @@ -177,38 +177,53 @@ - + + + + +
Name Search:
Request Status: + + + + +
+ Check All Uncheck All Please select at least one.
+ {foreach from=$submitStatus key=status_id item=status_name} + {$status_name}
+ {/foreach} +
+
Fields to export: - + @@ -224,17 +239,25 @@
Check All / Uncheck AllCheck All Uncheck All
- {$terms.reg_term_attendee_cap} ID
- {$terms.reg_term_attendee_cap} Name
- Address Line #1
- Address Line #2
- City
- State
- ZIP/Postal Code
+ {$terms.reg_term_attendee_cap} ID
+ {$terms.reg_term_attendee_cap} Name
+ Address Line #1
+ Address Line #2
+ City
+ State
+ ZIP/Postal Code
- Email
- Phone
- County
- Level
- Date/Time
- Rate
- Status
+ Email
+ Phone
+ County
+ Level
+ Date/Time
+ Rate
+ Status
{if apply_filters('glm-members-customfields-plugin-active', false)} - Custom Fields
+ Custom Fields
{/if}
Cancel - +