From: Chuck Scott Date: Tue, 5 Feb 2019 17:39:25 +0000 (-0500) Subject: Fixed issues with registration by Event Code and other matters X-Git-Tag: v1.3.0^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=c919e6cb0ec619d482daffa8b398bdbb0387b67a;p=WP-Plugins%2Fglm-member-db-registrations.git Fixed issues with registration by Event Code and other matters Added more fields to registration events dashboard list. Added active flag status to specific reg evnet dashboard. Remvoed local function that is now in main plugin. Fixed some minor issues with checks as to why a reg event might not show in list. --- diff --git a/classes/data/dataRegEvent.php b/classes/data/dataRegEvent.php index b4f5d75..e0ce220 100755 --- a/classes/data/dataRegEvent.php +++ b/classes/data/dataRegEvent.php @@ -924,6 +924,8 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract $this->fields = array( 'id' => $fSave['id'], 'event' => $fSave['event'], + 'active' => $fSave['active'], + 'event_code' => $fSave['event_code'], 'event_name' => $fSave['event_name'], 'time_specific' => $fSave['time_specific'], 'first_datetime' => $fSave['first_datetime'], diff --git a/models/admin/registrations/events_dashboard.php b/models/admin/registrations/events_dashboard.php index 5601a7c..e0d4778 100755 --- a/models/admin/registrations/events_dashboard.php +++ b/models/admin/registrations/events_dashboard.php @@ -127,51 +127,6 @@ if (isset($_REQUEST['request_status_select'])) { $statusSelected = $_REQUEST['request_status_select']; } -/** - * ******* TEMPORARY - USE SAME FUNCTION IN MAIN PLUGIN WHEN THAT'S UPDATED (less the number 2 at the end) ************* - */ -// require_once GLM_MEMBERS_REGISTRATIONS_MAIN_PLUGIN_PATH.'/classes/glmPluginSupport.php'; -function glmMembersConfigArraySetup2( $configTable, $configNumbTable = false, $configSelectedArray = false) -{ - - // Check if config table array exits - if (!is_array($configTable) || count($configTable) == 0) { - return false; - } - - // Build base array - $conf = array(); - foreach ($configTable as $key=>$descr) { - $conf[$key] = array( - 'id' => $key, - 'descr' => $descr, - 'name' => false, - 'selected' => false - ); - } - - // If name->number array add that data - if (is_array($configNumbTable) && count($configNumbTable) > 0) { - foreach ($configNumbTable as $name=>$key) { - if (isset($conf[$key])) { - $conf[$key]['name'] = $name; - } - } - } - - // If a selected array is provided, add that data - if (is_array($configSelectedArray) && count($configSelectedArray) > 0) { - foreach ($configSelectedArray as $key) { - if (isset($conf[$key])) { - $conf[$key]['selected'] = true; - } - } - } - - return $conf; - -} - // Check for an update to the status of a request if (isset($_REQUEST['option2']) && $_REQUEST['option2'] == 'updateStatus' && isset($_REQUEST['requestId']) && isset($_REQUEST['status'])) { diff --git a/models/admin/registrations/events_eventDashboard.php b/models/admin/registrations/events_eventDashboard.php index 6046fd6..9cc16f3 100755 --- a/models/admin/registrations/events_eventDashboard.php +++ b/models/admin/registrations/events_eventDashboard.php @@ -170,8 +170,8 @@ if ($regEvent !== false) { if ($time['active']['value']) { $haveActiveFutureTimes = true; - // If this is a time specific time entry and there's availability - if ($haveTimeSpecificEvent && $time['attendees_available'] > 0) { + // If this is a time specific time entry and there's availability or unlimited + if ($haveTimeSpecificEvent && ($time['attendees_available'] > 0 || $time['attendee_max'] == 0)) { $haveActiveFutureAvailability = true; } diff --git a/models/admin/registrations/events_registrants.php b/models/admin/registrations/events_registrants.php index f2edc97..e8149ee 100644 --- a/models/admin/registrations/events_registrants.php +++ b/models/admin/registrations/events_registrants.php @@ -92,53 +92,8 @@ if (isset($_REQUEST['status']) && is_array($_REQUEST['status']) && count($_REQUE // Build data for picklist output $status = $this->config['submission_status']; - -/** - * ******* TEMPORARY - USE SAME FUNCTION IN MAIN PLUGIN WHEN THAT'S UPDATED (less the number 2 at the end) ************* - */ -function glmMembersConfigArraySetup2( $configTable, $configNumbTable = false, $configSelectedArray) -{ - - // Check if config table array exits - if (!is_array($configTable) || count($configTable) == 0) { - return false; - } - - // Build base array - $conf = array(); - foreach ($configTable as $key=>$descr) { - $conf[$key] = array( - 'id' => $key, - 'descr' => $descr, - 'name' => false, - 'selected' => false - ); - } - - // If name->number array add that data - if (is_array($configNumbTable) && count($configNumbTable) > 0) { - foreach ($configNumbTable as $name=>$key) { - if (isset($conf[$key])) { - $conf[$key]['name'] = $name; - } - } - } - - // If a selected array is provided, add that data - if (is_array($configSelectedArray) && count($configSelectedArray) > 0) { - foreach ($configSelectedArray as $key) { - if (isset($conf[$key])) { - $conf[$key]['selected'] = true; - } - } - } - - return $conf; - -} - // Build array of status options for view -$statusOptions = glmMembersConfigArraySetup2($this->config['submission_status'], $this->config['submission_status_numb'], $statusSelected); +$statusOptions = glmMembersConfigArraySetup($this->config['submission_status'], $this->config['submission_status_numb'], $statusSelected); // Build where clause for status and add to where parts diff --git a/models/admin/registrations/requests.php b/models/admin/registrations/requests.php index 47681cb..f66d5de 100755 --- a/models/admin/registrations/requests.php +++ b/models/admin/registrations/requests.php @@ -259,54 +259,8 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRegRequ // Build data for picklist output $status = $this->config['submission_status']; - - /** - * ******* TEMPORARY - USE SAME FUNCTION IN MAIN PLUGIN WHEN THAT'S UPDATED (less the number 2 at the end) ************* - */ - function glmMembersConfigArraySetup2( $configTable, $configNumbTable = false, $configSelectedArray) - { - - // Check if config table array exits - if (!is_array($configTable) || count($configTable) == 0) { - return false; - } - - // Build base array - $conf = array(); - foreach ($configTable as $key=>$descr) { - $conf[$key] = array( - 'id' => $key, - 'descr' => $descr, - 'name' => false, - 'selected' => false - ); - } - - // If name->number array add that data - if (is_array($configNumbTable) && count($configNumbTable) > 0) { - foreach ($configNumbTable as $name=>$key) { - if (isset($conf[$key])) { - $conf[$key]['name'] = $name; - } - } - } - - // If a selected array is provided, add that data - if (is_array($configSelectedArray) && count($configSelectedArray) > 0) { - foreach ($configSelectedArray as $key) { - if (isset($conf[$key])) { - $conf[$key]['selected'] = true; - } - } - } - - return $conf; - - } - // Build array of status options for view - $statusOptions = glmMembersConfigArraySetup2($this->config['submission_status'], $this->config['submission_status_numb'], $statusSelected); - + $statusOptions = glmMembersConfigArraySetup($this->config['submission_status'], $this->config['submission_status_numb'], $statusSelected); // Build where clause for status and add to where parts $statusWhere = "(".implode(',', $statusSelected).")"; diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index b0fa57e..75c533d 100755 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -103,7 +103,6 @@ // Otherwise it should be an event code } else { - if ($action) // Try to get reg event ID $regEventID = $this->wpdb->get_var(" SELECT id diff --git a/views/admin/registrations/eventDashboard.html b/views/admin/registrations/eventDashboard.html index 3399e68..0f1cbc6 100755 --- a/views/admin/registrations/eventDashboard.html +++ b/views/admin/registrations/eventDashboard.html @@ -7,6 +7,14 @@
+
+
+

{$terms.reg_term_event_cap} Active:

+
+
+ {$regEvent.active.name} +
+

{$terms.reg_term_event_cap} Code:

@@ -36,10 +44,6 @@

This {$terms.reg_term_event_cap} is Not Displayed in Lists

-
- This {$terms.reg_term_event} is not displayed to users in lists of available - {$terms.reg_term_registration_plur} {$terms.reg_term_event_plur}. -
{/if}
diff --git a/views/admin/registrations/eventEdit.html b/views/admin/registrations/eventEdit.html index a868f9b..c927fc7 100644 --- a/views/admin/registrations/eventEdit.html +++ b/views/admin/registrations/eventEdit.html @@ -179,7 +179,22 @@

{$terms.reg_term_event_cap} Location{if $regEvent.fieldData.event} - Using location from {$terms.reg_term_event}{/if}

- {if !$regEvent.fieldData.event} + {if $regEvent.fieldData.event} + {* If this data is coming from a linked event, supply blank input for these fields. *} + + + + + + + + + + + + + + {else} Hide Location Address: diff --git a/views/admin/registrations/eventsDashboard.html b/views/admin/registrations/eventsDashboard.html index 5fe637c..ef5e8f5 100755 --- a/views/admin/registrations/eventsDashboard.html +++ b/views/admin/registrations/eventsDashboard.html @@ -57,7 +57,9 @@ ID {$terms.reg_term_event_cap} Name - Date Specific? + Code + Active + Date
Specific? Maximum
{$terms.reg_term_attendee_plur_cap} {$terms.reg_term_registered_cap} Cart
Hold @@ -79,6 +81,8 @@ {/if} {$r.id} {$r.event_name} + {$r.event_code} + {if $r.active.value}Yes{/if} {if $r.time_specific.value}Yes{/if} {$r.total} {$r.registered} diff --git a/views/front/registrations/list.html b/views/front/registrations/list.html index eebc54d..bea3d9d 100755 --- a/views/front/registrations/list.html +++ b/views/front/registrations/list.html @@ -11,14 +11,14 @@
{if $haveMessages} -
- Please Note: -
    -{foreach $messages as $m} -
  • {$m}
  • -{/foreach} -
-
+
+ Please Note: +
    + {foreach $messages as $m} +
  • {$m}
  • + {/foreach} +
+
{/if} @@ -30,9 +30,17 @@
{/if} {if $settings.reg_show_select_by_code} -
- -
+ +
+ +
+ If you have an {$terms.reg_term_event} code, enter it here. + + +
+
+ + {/if} {if $haveRegEvents} {foreach $regEvents as $event} @@ -110,7 +118,15 @@ {/foreach} {else} -

Sorry, no {$terms.reg_term_event_plur} listed for {$terms.reg_term_registration} at this time.

+
+

+ Sorry, no {$terms.reg_term_event_plur} listed for {$terms.reg_term_registration} at this time. + {if $settings.reg_show_select_by_code} +
If you have an {$terms.reg_term_event} code you may enter that above. + {/if} + +

+
{/if}