From: Chuck Scott
Date: Thu, 27 Sep 2018 14:01:48 +0000 (-0400)
Subject: Added email address to editing attnedee in admin and fixed event date/time in registr...
X-Git-Tag: v1.0.22^2~4
X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=bff8cdc4d0777200ac116e889dcef3492d6b08b1;p=WP-Plugins%2Fglm-member-db-registrations.git
Added email address to editing attnedee in admin and fixed event date/time in registration list on front-end.
---
diff --git a/classes/data/dataRegRequestRegistrant.php b/classes/data/dataRegRequestRegistrant.php
old mode 100644
new mode 100755
index 36c0d85..7f0c1f0
--- a/classes/data/dataRegRequestRegistrant.php
+++ b/classes/data/dataRegRequestRegistrant.php
@@ -124,6 +124,17 @@ class GlmDataRegistrationsRequestRegistrant extends GlmDataAbstract
'use' => 'lgneud'
),
+ // Account E-Mail
+ 'email' => array (
+ 'field' => 'account',
+ 'as' => 'email',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account',
+ 'p_field' => 'email',
+ 'p_static' => true,
+ 'use' => 'lg'
+ ),
+
// Pointer to reg_event entry
'reg_event' => array (
'field' => 'reg_event',
@@ -321,14 +332,21 @@ class GlmDataRegistrationsRequestRegistrant extends GlmDataAbstract
// If doing the following actions
if (in_array($action, array('l','g'))) {
- // Get the registration request status name
- $r['request_status_name'] = $this->config['submission_status'][$r['request_status']];
+ if (isset($this->fields['request_status'])) {
- // Add a reformatted date/time
- $r['event_time_reformatted'] = '';
- $t = strtotime($r['event_time']);
- if ($t > 0) {
- $r['event_time_reformatted'] = date('m/d/Y h:i A', strtotime($r['event_time']));
+ // Get the registration request status name
+ $r['request_status_name'] = $this->config['submission_status'][$r['request_status']];
+
+ }
+
+ if (isset($this->fields['event_time'])) {
+
+ // Add a reformatted date/time
+ $r['event_time_reformatted'] = '';
+ $t = strtotime($r['event_time']);
+ if ($t > 0) {
+ $r['event_time_reformatted'] = date('m/d/Y h:i A', strtotime($r['event_time']));
+ }
}
}
diff --git a/models/admin/ajax/regAdmin/attendee.php b/models/admin/ajax/regAdmin/attendee.php
old mode 100644
new mode 100755
index 8f587c4..f22c737
--- a/models/admin/ajax/regAdmin/attendee.php
+++ b/models/admin/ajax/regAdmin/attendee.php
@@ -88,20 +88,23 @@ class GlmMembersAdmin_registrations_ajax_attendee extends GlmDataRegistrationsRe
// Get certain registrant data
$savedFields = $this->fields;
- $this->fields = array();
- $this->fields['id'] = $savedFields['id'];
- $this->fields['not_attending'] = $savedFields['not_attending'];
- $this->fields['reg_time'] = $savedFields['reg_time'];
- $this->fields['reg_time_avail'] = array (
- 'field' => 'reg_time',
- 'as' => 'reg_time_avail',
- 'type' => 'pointer',
- 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_time',
- 'p_field' => 'attendees_available',
- 'p_static' => true,
- 'use' => 'g'
- );
+ $this->fields = array(
+ 'id' => $savedFields['id'],
+ 'account' => $savedFields['account'],
+ 'email' => $savedFields['email'],
+ 'not_attending' => $savedFields['not_attending'],
+ 'reg_time' => $savedFields['reg_time'],
+ 'reg_time_avail' => array (
+ 'field' => 'reg_time',
+ 'as' => 'reg_time_avail',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_time',
+ 'p_field' => 'attendees_available',
+ 'p_static' => true,
+ 'use' => 'g'
+ ),
+ );
$registrantData = $this->getEntry($modelData['reg_id']);
$this->fields = $savedFields;
@@ -134,6 +137,7 @@ class GlmMembersAdmin_registrations_ajax_attendee extends GlmDataRegistrationsRe
}
}
+ // Update registrant entry
$this->wpdb->update(
GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_registrant',
array(
@@ -150,8 +154,29 @@ class GlmMembersAdmin_registrations_ajax_attendee extends GlmDataRegistrationsRe
array( '%d' )
);
+ // If the submitted E-Mail is different than what's stored in the account
+ if (trim($registrantData['email']) != trim($modelData['email'])) {
+
+ // Update the E-Mail address in the account and reset validated flag
+ $this->wpdb->update(
+ GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account',
+ array(
+ 'email' => $modelData['email'],
+ 'validated' => false
+ ),
+ array( 'id' => $registrantData['account'] ),
+ array(
+ '%s',
+ '%d'
+ ),
+ array( '%d' )
+ );
+
+ }
+
$registrant = array(
'id' => $modelData['reg_id'],
+ 'email' => $modelData['email'],
'fname' => $modelData['fname'],
'lname' => $modelData['lname'],
'notAttending' => $notAttending,
diff --git a/views/admin/registrations/eventRegistrants.html b/views/admin/registrations/eventRegistrants.html
index b0f43fa..59753d1 100755
--- a/views/admin/registrations/eventRegistrants.html
+++ b/views/admin/registrations/eventRegistrants.html
@@ -125,8 +125,10 @@
If checked this inventory will be returned to permit another {$terms.reg_term_attendee} to {$terms.reg_term_register}.
If you un-check this it will check to see if inventory is available and if not will not change this to {$terms.reg_term_attending}.
+ E-Mail Address
+
First Name
-
+
Last Name
@@ -407,6 +409,7 @@ jQuery(document).ready(function($){
var notAttending = $('#glmRegNotAttending_' + refId).prop('checked');
+ var accountEmail = $('#glm-attendee-' + refId + ' input[name=email]').val().trim();
var accountFname = $('#glm-attendee-' + refId + ' input[name=fname]').val().trim();
var accountLname = $('#glm-attendee-' + refId + ' input[name=lname]').val().trim();
@@ -419,6 +422,7 @@ jQuery(document).ready(function($){
collection: 'attendee',
option: 'update',
reg_id: refId,
+ email: accountEmail,
fname: accountFname,
lname: accountLname,
not_attending: notAttending,
@@ -440,6 +444,7 @@ jQuery(document).ready(function($){
$('#glmRegAttedeeLine_' + refId).removeClass('glm-reg-gray');
$('#glmRegNotAttendingText_' + refId).html('');
}
+ $('#glm-attendee-form-' + account.id + ' input[name=email]').val( account.email );
$('#glm-attendee-form-' + account.id + ' input[name=fname]').val( account.fname );
$('#glm-attendee-form-' + account.id + ' input[name=lname]').val( account.lname );
$('.glm-edit-form-' + $(this).data('registrant')).hide();
diff --git a/views/front/registrations/list.html b/views/front/registrations/list.html
index 54fdc46..9598703 100755
--- a/views/front/registrations/list.html
+++ b/views/front/registrations/list.html
@@ -41,91 +41,37 @@
-
-
+
- {$lastDate = ''}
- {foreach $event.recurrences as $rec}
-
- {$eDate = $rec.from_date.timestamp|date_format:"%B %e"}
-
- {if $eDate != $lastDate}
- {$lastDate = $eDate}
-
-
-
-
- {if $rec.from_date.timestamp|date_format:"%Y" != $rec.to_date.timestamp|date_format:"%Y"}
- {$eDate}, {$rec.from_date.timestamp|date_format:"%Y"}
- {else}
- {$eDate}
- {/if}
-
- {if $rec.from_date.date != $rec.to_date.date}
- {if $rec.from_date.timestamp|date_format:"%Y" != $rec.to_date.timestamp|date_format:"%Y"}
- - {$rec.to_date.timestamp|date_format:"%B %e, %Y"}
- {else}
- - {$rec.to_date.timestamp|date_format:"%B %e, %Y"}
- {/if}
- {else if $rec.specific_dates}
- {if $rec.from_date.timestamp|date_format:"%Y" != $rec.specific_dates|@end|date_format:"%Y"}
- - {$rec.specific_dates|@end|date_format:"%B %e, %Y"},
- {else}
- - {$rec.specific_dates|@end|date_format:"%B %e, %Y"}
- {/if}
-
- {/if}
-
-
- {/if}
- {if isset($rec.all_day) && !$rec.all_day.value}
-
- {if $rec.start_time.time == $rec.end_time.time || $rec.start_time_only.value}
- {$rec.start_time.time|strtotime|date_format:"%l:%M %P"}
- {else}
- {$rec.start_time.time|strtotime|date_format:"%l:%M %P"} - {$rec.end_time.time|strtotime|date_format:"%l:%M %P"}
- {/if}
- {if $rec.name && $rec.name != 'Imported' && $rec.name != 'Imported Event Schedule' }
- {$rec.name}
- {/if}
-
- {else}
-
- {if $rec.name && $rec.name != 'Imported' && $rec.name != 'Imported Event Schedule' }
- {$rec.name}
- {/if}
-
- {/if}
- {/foreach}
-
- {if $event.eventCost}
+ {* If there's a starting timestamp for this event. Why wouldn't there be? *}
+ {if $event.first_datetime.timestamp}
+
+
{$event.first_datetime.timestamp|date_format:"%A, %B %e, %Y"}
+
{$event.first_datetime.timestamp|date_format:"%l:%M %p"}
+
+ {* If the first and last timestamp are NOT the same, then there's other dates and times Should be selectable below. *}
+ {if $event.first_date.timestamp != $regEvent.last_date.timestamp}
+
(see other dates and times below)
+ {/if}
+
+ {/if}
+
+
+ {if $event.eventCost}
{$event.eventCost}
- {/if}
- {if $event.hide_address.name == 'No'}
- {if !$event.use_member_location.value && isset($event.locations) && ($event.locations.name || $event.locations.address)}
+ {/if}
+ {if $event.hide_address.name == 'No'}
+ {if !$event.use_member_location.value && isset($event.locations) && ($event.locations.name || $event.locations.address)}
- {if $event.locations.name}{$event.locations.name} {/if}
-
- {/if}
- {/if}
+ {if $event.locations.name}{$event.locations.name}
{/if}
+
+ {/if}
+ {/if}