if ( isset( $customData ) && is_array( $customData ) && !empty( $customData ) ) {
$fields = $customData['form'];
foreach ( $fields as $cField ) {
- $custom_data[] = array(
- $cField['field_name'] => $cField['stored']
- );
+ $custom_data[$cField['field_name']] = $cField['stored'];
}
$registrants[$registrantKey]['custom_data'] = $custom_data;
}
// render the view
render: function(){
- // console.log( 'regReguestRegistrantView.render called' );
-
this.$el.html( this.template( this.model.toJSON() ) );
this.$emailInput = this.$('.editEmail');
this.$('.reg-edit-form').hide();
+ // setup the state and country select
+ this.$('.reg_state').val(this.model.get('state'));
+ this.$('.reg_country').val(this.model.get('country'));
// Call the custom fields ajax
app.setCustomFieldsForm(this.model.get('reg_event'), this.model.id, '.attendee-cf-' + this.model.id);
- // console.log('call setCustomFieldsForm' );
- // if ( this.customFieldFormData ) {
- // this.$('.attendee-cf-' + this.model.get('id')).html( this.customFieldFormData );
- // }
return this;
},
// They should not be able to edit the record.
this.$('.add_reg_fname').val(account.fname);
this.$('.add_reg_lname').val(account.lname);
+ this.$('.add_reg_addr1').val(account.addr1);
+ this.$('.add_reg_addr2').val(account.addr2);
+ this.$('.add_reg_city').val(account.city);
+ this.$('.add_reg_state').val(account.state);
+ this.$('.add_reg_zip').val(account.zip);
+ this.$('.add_reg_country').val(account.country);
// lock the form
// this.lockForm();
// render the view
render: function(){
- // console.log( 'regReguestRegistrantView.render called' );
-
this.$el.html( this.template( this.model.toJSON() ) );
this.$emailInput = this.$('.editEmail');
this.$('.reg-edit-form').hide();
+ // setup the state and country select
+ this.$('.reg_state').val(this.model.get('state'));
+ this.$('.reg_country').val(this.model.get('country'));
// Call the custom fields ajax
app.setCustomFieldsForm(this.model.get('reg_event'), this.model.id, '.attendee-cf-' + this.model.id);
- // console.log('call setCustomFieldsForm' );
- // if ( this.customFieldFormData ) {
- // this.$('.attendee-cf-' + this.model.get('id')).html( this.customFieldFormData );
- // }
return this;
},
// They should not be able to edit the record.
this.$('.add_reg_fname').val(account.fname);
this.$('.add_reg_lname').val(account.lname);
+ this.$('.add_reg_addr1').val(account.addr1);
+ this.$('.add_reg_addr2').val(account.addr2);
+ this.$('.add_reg_city').val(account.city);
+ this.$('.add_reg_state').val(account.state);
+ this.$('.add_reg_zip').val(account.zip);
+ this.$('.add_reg_country').val(account.country);
// lock the form
// this.lockForm();
if ( $email = filter_var( $_REQUEST['email'], FILTER_VALIDATE_EMAIL ) ) {
$accountData = $this->wpdb->get_row(
$this->wpdb->prepare(
- "SELECT id,fname,lname,validated
+ "SELECT id,fname,lname,addr1,addr2,city,state,zip,country,validated
FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "account
WHERE email = %s",
$email
'email' => $email,
'fname' => $accountData['fname'],
'lname' => $accountData['lname'],
+ 'addr1' => $accountData['addr1'],
+ 'addr2' => $accountData['addr2'],
+ 'city' => $accountData['city'],
+ 'state' => $accountData['state'],
+ 'zip' => $accountData['zip'],
+ 'country' => $accountData['country'],
'validated' => $accountData['validated'],
);
} else {
// When processing registrant info records, also get primary contact data
$this->postProcessPrimaryContact = true;
- $where = ' true ';
- $categories = false;
- $haveRegistrants = false;
- $list = false;
- $success = false;
- $filterPending = false;
- $filterArchived = false;
- $haveFilter = false;
- $numbDisplayed = false;
- $lastDisplayed = false;
- $paging = true;
- $prevStart = false;
- $nextStart = false;
- $start = 1;
- $limit = 20; // Set to the number of listings per page
- $namesList = false;
+ $where = ' true ';
+ $categories = false;
+ $haveRegistrants = false;
+ $list = false;
+ $success = false;
+ $filterPending = false;
+ $filterArchived = false;
+ $haveFilter = false;
+ $numbDisplayed = false;
+ $lastDisplayed = false;
+ $paging = true;
+ $prevStart = false;
+ $nextStart = false;
+ $start = 1;
+ $limit = 20; // Set to the number of listings per page
+ $namesList = false;
+ $customFieldHeaders = false;
// Check selected fields
$select = array(
'exportTime' => $this->checkFlag('exportTime'),
'exportRate' => $this->checkFlag('exportRate'),
'exportStatus' => $this->checkFlag('exportStatus'),
+ 'exportCustom' => $this->checkFlag('exportCustom'),
);
// Get registration event ID if supplied
$where = implode( ' AND ', $whereParts );
// $list = $this->getList($where, "lname");
- $listResult = $this->getFullRegistrantsData($regEventID, $where, 1, false);
+ $listResult = $this->getFullRegistrantsData($regEventID, $where, false, false);
$list = $listResult['list'];
+ $customFieldsPluginActive = apply_filters( 'glm-members-customfields-plugin-active', false );
+ $customFieldHeaders = false;
+ // Go through the $listResult to pull out the custom fields if available and if plugin is on
+ if ( $customFieldsPluginActive && $listResult['list'] ) {
+ $index = 1;
+ foreach ( $list as $attendee ) {
+ if ( $attendee['custom_data'] ) {
+ if ( $index === 1 ) {
+ $customFieldHeaders = array_keys( $attendee['custom_data'] );
+ }
+ }
+ break;
+ }
+ }
+ // echo '<pre>$customFieldHeaders: ' . print_r( $customFieldHeaders, true ) . '</pre>';
// echo '<pre>$list: ' . print_r( $list, true ) . '</pre>';
// exit;
// Compile template data
$templateData = array(
- 'select' => $select,
- 'haveRegistrants' => $haveRegistrants,
- 'registrants' => $list,
- 'registrantCount' => $registrantCount,
- 'categories' => $categories,
- 'haveFilter' => $haveFilter,
- 'numbDisplayed' => $numbDisplayed,
- 'lastDisplayed' => $lastDisplayed,
- 'paging' => $paging,
- 'prevStart' => $prevStart,
- 'nextStart' => $nextStart,
- 'start' => $start,
- 'limit' => $limit,
- 'namesList' => $namesList
+ 'select' => $select,
+ 'haveRegistrants' => $haveRegistrants,
+ 'registrants' => $list,
+ 'registrantCount' => $registrantCount,
+ 'categories' => $categories,
+ 'haveFilter' => $haveFilter,
+ 'numbDisplayed' => $numbDisplayed,
+ 'lastDisplayed' => $lastDisplayed,
+ 'paging' => $paging,
+ 'prevStart' => $prevStart,
+ 'nextStart' => $nextStart,
+ 'start' => $start,
+ 'limit' => $limit,
+ 'namesList' => $namesList,
+ 'customFieldHeaders' => $customFieldHeaders,
);
$view = 'admin/ajax/registrantsListExport.html';
$listResult = $Registrants->getFullRegistrantsData($regEventID, $where, $start, $limit);
// echo '<pre>$listResult: ' . print_r( $listResult['list'], true ) . '</pre>';
- $customFields = false;
- // Go through the $listResult to pull out the custom fields if available and if plugin is on
- if ( $customFieldsPluginActive && $listResult['list'] ) {
- foreach ( $listResult['list'] as $row ) {
- if ( $row['custom_data'] ) {
- foreach ( $row['custom_data'] as $cFields ) {
- $customFields[] = array_keys( $cFields );
- }
- }
- break;
- }
- }
- // echo '<pre>$customFields: ' . print_r( $customFields, true ) . '</pre>';
-
-
// Get count of registrants listed
- $registrantCount = $listResult['totalCount'];;
+ $registrantCount = $listResult['totalCount'];
// If the number of registrants is less than a page, don't do paging
if ($registrantCount <= $limit) {
} // - End loop through events.
}
+
// Compile template data
$templateData = array(
'customfieldActive' => apply_filters( 'glm-members-customfields-plugin-active', false ),
'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/',
'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false,
'assetUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL,
- 'reg_bulletin' => $misc['reg_bulletin']
+ 'reg_bulletin' => $misc['reg_bulletin'],
+ 'states_list' => $this->config['states'],
+ 'country_list' => $this->config['countries'],
);
// echo "<pre>".print_r($templateData,1)."</pre>";
{if $select.exportTime}<th align="left">Date/Time</th>{/if}
{if $select.exportRate}<th align="left">Rate</th>{/if}
{if $select.exportStatus}<th align="left">Status</th>{/if}
+ {if $select.exportCustom && $customFieldHeaders}
+ {foreach $customFieldHeaders as $header}
+ <th align="left">{$header}</th>
+ {/foreach}
+ {/if}
</tr>
</thead>
<tbody>
{if $select.exportTime}<td>{$m.event_time_reformatted}</td>{/if}
{if $select.exportRate}<td>{$m.rate_name}</td>{/if}
{if $select.exportStatus}<td>{$m.request_status_name}</td>{/if}
+ {if $select.exportCustom && $customFieldHeaders}
+ {foreach $m.custom_data as $cData}
+ <td>{$cData}</td>
+ {/foreach}
+ {/if}
</tr>
{/foreach}
{if $select.exportTime}"Date/Time",{/if}
{if $select.exportRate}"Rate",{/if}
{if $select.exportStatus}"Status"{/if}
+{if $select.exportCustom && $customFieldHeaders}{foreach $customFieldHeaders as $header},"{$header}"{/foreach}{/if}
{foreach $registrants as $m}
{if $select.exportId}"{$m.id}",{/if}
{if $select.exportTime}"{$m.event_time_reformatted}",{/if}
{if $select.exportRate}"{$m.rate_name}",{/if}
{if $select.exportStatus}"{$m.request_status_name}"{/if}
+{if $select.exportCustom && $customFieldHeaders}{foreach $m.custom_data as $cData},"{$cData}"{/foreach}{/if}
{/foreach}
{else}No {$terms.reg_term_attendee_plur_cap} Selected{/if}
<input type="checkbox" name="exportTime" checked> Date/Time <br>
<input type="checkbox" name="exportRate" checked> Rate <br>
<input type="checkbox" name="exportStatus" checked> Status <br>
+ {if apply_filters('glm-members-customfields-plugin-active', false)}
+ <input type="checkbox" name="exportCustom" checked> Custom Fields <br>
+ {/if}
</td>
</tr>
{/if}
- {if $regEvent.locations.name || $regEvent.locations.address}
+ {if isset( $regEvent.locations ) && ( $regEvent.locations.name || $regEvent.locations.address )}
<div class="small-12 columns glm-reg-event-profile-details glm-reg-location glm-reg-has-icon">
<a href="https://maps.google.com/maps?daddr={$regEvent.locations.name|escape}%40{$regEvent.locations.lat},{$regEvent.locations.lon}" target="_blank">{$regEvent.locations.name}</a>
{if $regEvent.locations.address}
{if $regEvent.contact_email}<div class="small-12 columns glm-reg-event-profile-details glm-reg-contact-email glm-reg-contact-details"> Email: {$regEvent.contact_email}</div>{/if}
</div>
{/if}
- {if $regEvent.locations.lat && $regEvent.locations.lon}
+ {if isset( $regEvent.locations ) && ( $regEvent.locations.lat && $regEvent.locations.lon )}
<div class="small-12 columns glm-reg-event-profile-map-container">
<div id="glm-reg-map-container">
<div id="glm-reg-map" class="glm-reg-map">(map loads here)</div>
<h4> Event Description </h4>
<div id="glm-reg-event-descr" class="glm-reg-event-descr">
{$regEvent.eventDescr}
- </div>
+ </div>
{if $regEvent.eventDescr|count_characters:true > 280}
<div data-descr="glm-reg-event-descr" class="glm-reg-read-more small-12 columns">Read More</div>
{/if}
</div>
-
+
{/if}
{if $regEvent.descr}
<div class="small-12 columns glm-reg-event-profile-details glm-reg-event-descr-container">
<h4> Registration Details </h4>
<div id="glm-reg-descr" class="glm-reg-event-descr">
{$regEvent.descr}
- </div>
+ </div>
{if $regEvent.descr|count_characters:true > 280}
<div data-descr="glm-reg-descr" class="glm-reg-read-more small-12 columns">Read More</div>
{/if}
</div>
-
+
{/if}
{if $regEvent.terms}
<div class="small-12 columns glm-reg-event-profile-details glm-reg-event-descr-container">
<h4> Terms & Condtions </h4>
<div id="glm-reg-event-terms" class="glm-reg-event-descr">
{$regEvent.terms}
- </div>
+ </div>
{if $regEvent.terms|count_characters:true > 280}
<div data-descr="glm-reg-event-terms" class="glm-reg-read-more small-12 columns">Read More </div>
{/if}
</div>
-
+
{/if}
</div>
{literal}
</div>
<div class="row ereg-addr">
<div class="columns large-4 small-12 text-right">State</div>
- <div class="columns large-8 small-12"><input class="add_reg_state" value="<%- state %>"></div>
+ <div class="columns large-8 small-12">
+ <select class="add_reg_state">
+ <option value=""></option>
+ {/literal}
+ {foreach $states_list as $stateAbbr => $stateName}
+ <option value="{$stateAbbr}">{$stateName}</option>
+ {/foreach}
+ {literal}
+ </select>
+ </div>
</div>
<div class="row ereg-addr">
<div class="columns large-4 small-12 text-right">Zip/Postal Code</div>
</div>
<div class="row ereg-addr">
<div class="columns large-4 small-12 text-right">Country</div>
- <div class="columns large-8 small-12"><input class="add_reg_country" value="<%- country %>"></div>
+ <div class="columns large-8 small-12">
+ <select class="add_reg_country">
+ <option value=""></option>
+ {/literal}
+ {foreach $country_list as $countryKey => $countryValue}
+ <option value="{$countryKey}">{$countryValue}</option>
+ {/foreach}
+ {literal}
+ </select>
+ </div>
</div>
{/literal}{if $regEvent.time_specific.value}
<input type="hidden" id="add_reg-select-time">
</div>
<div class="row ereg-addr">
<div class="columns large-4 small-12 text-right">State</div>
- <div class="columns large-8 small-12"><input class="reg_state" value="<%- state %>"></div>
+ <div class="columns large-8 small-12">
+ <select class="reg_state">
+ <option value=""></option>
+ {/literal}
+ {foreach $states_list as $stateAbbr => $stateName}
+ <option value="{$stateAbbr}">{$stateName}</option>
+ {/foreach}
+ {literal}
+ </select>
+ </div>
</div>
<div class="row ereg-addr">
<div class="columns large-4 small-12 text-right">Zip/Postal Code</div>
</div>
<div class="row ereg-addr">
<div class="columns large-4 small-12 text-right">Country</div>
- <div class="columns large-8 small-12"><input class="reg_country" value="<%- country %>"></div>
+ <div class="columns large-8 small-12">
+ <select class="reg_country">
+ <option value=""></option>
+ {/literal}
+ {foreach $country_list as $countryKey => $countryValue}
+ <option value="{$countryKey}">{$countryValue}</option>
+ {/foreach}
+ {literal}
+ </select>
+ </div>
</div>
</div>
{/literal}{if $regEvent.time_specific.value}
regEvent.setClassRegistrants( {$regJSON} );
var glmApp = new app.Views.Front.App();
- $("#glm-reg-detail-map-button").click(function() {
- var map_container = "#glm-reg-map-container";
- var map = "#glm-reg-map";
- var mapNewH = 0;
- var mapOverflow = 'hidden';
- var mapBtnTxt = 'view map';
+ {if $regEvent.locations}
+ $("#glm-reg-detail-map-button").click(function() {
+ var map_container = "#glm-reg-map-container";
+ var map = "#glm-reg-map";
+ var mapNewH = 0;
+ var mapOverflow = 'hidden';
+ var mapBtnTxt = 'view map';
- if ($(map_container).height() == 0) {
- mapNewH = 250;
- mapV = 'visible';
- mapBtnTxt = 'hide map'
- }
- $(map_container).animate({
- overflow: mapOverflow,
- height: mapNewH
- }, 250, "swing", function() {
+ if ($(map_container).height() == 0) {
+ mapNewH = 250;
+ mapV = 'visible';
+ mapBtnTxt = 'hide map'
+ }
+ $(map_container).animate({
+ overflow: mapOverflow,
+ height: mapNewH
+ }, 250, "swing", function() {
+ });
+ $(this).html(mapBtnTxt);
});
- $(this).html(mapBtnTxt);
- });
- {if $regEvent.locations.lat !=0 && $regEvent.locations.lon != 0}
- var eventlocation = new google.maps.LatLng({$regEvent.locations.lat}, {$regEvent.locations.lon});
- {else}
- var eventlocation = new google.maps.LatLng({$settings.maps_default_lat}, {$settings.maps_default_lon});
- {/if}
- function initMap() {
- // Set default - Need to make this configurable
- var map = new google.maps.Map(document.getElementById('glm-reg-map'), {
- zoom: {$settings.maps_default_zoom},
- center: eventlocation,
- disableDefaultUI: false,
- mapTypeId: google.maps.MapTypeId.MAP,
- });
-
- // Create a marker for this event
{if $regEvent.locations.lat !=0 && $regEvent.locations.lon != 0}
- var marker = new google.maps.Marker({
- map: map,
- position: new google.maps.LatLng({$regEvent.locations.lat}, {$regEvent.locations.lon}),
- draggable: false,
- animation: google.maps.Animation.DROP,
- title: ''
- });
- {/if}
+ var eventlocation = new google.maps.LatLng({$regEvent.locations.lat}, {$regEvent.locations.lon});
+ {else}
+ var eventlocation = new google.maps.LatLng({$settings.maps_default_lat}, {$settings.maps_default_lon});
+ {/if}
+ function initMap() {
+ // Set default - Need to make this configurable
+ var map = new google.maps.Map(document.getElementById('glm-reg-map'), {
+ zoom: {$settings.maps_default_zoom},
+ center: eventlocation,
+ disableDefaultUI: false,
+ mapTypeId: google.maps.MapTypeId.MAP,
+ });
+
+ // Create a marker for this event
+ {if $regEvent.locations.lat !=0 && $regEvent.locations.lon != 0}
+ var marker = new google.maps.Marker({
+ map: map,
+ position: new google.maps.LatLng({$regEvent.locations.lat}, {$regEvent.locations.lon}),
+ draggable: false,
+ animation: google.maps.Animation.DROP,
+ title: ''
+ });
+ {/if}
- }
- google.maps.event.addDomListener(window, 'load', initMap);
+ }
+ google.maps.event.addDomListener(window, 'load', initMap);
+ {/if}
jQuery("#MemberDrivingDirectionsForm").submit(function(){
var place = jQuery("#MemberLocation").val().replace( new RegExp( " ", "g" ), '+' );
var lat = jQuery("#MemberLat").val();
$(descr).css("overflow", "hidden");
})
}
-
+
});
});
</script>