Adding option to export the Attendees to html (print) or csv.
return false;
}
+ $customFieldsPluginActive = apply_filters( 'glm-members-customfields-plugin-active', false );
+
// For each registrant
foreach ($registrants as $registrantKey=>$registrantVal) {
}
// Try to get any per Event custom field data
+ if ( $customFieldsPluginActive ) {
+ $custom_data = array();
+ // Check if there's custom field data for this record
+ $fid = 'glm_reg_customfields_reg_event_attendee_' . $eventId;
+ $recordId = $registrantVal['id'];
+ $customData = apply_filters( 'glm-members-customfields-form-data-recall', '', $fid, $recordId, false );
+ // echo '<pre>$customData: ' . print_r( $customData, true ) . '</pre>';
+ if ( isset( $customData ) && is_array( $customData ) && !empty( $customData ) ) {
+ $fields = $customData['form'];
+ foreach ( $fields as $cField ) {
+ $custom_data[] = array(
+ $cField['field_name'] => $cField['stored']
+ );
+ }
+ $registrants[$registrantKey]['custom_data'] = $custom_data;
+ }
+ }
// Try to get any per
}
return $listResult;
-
-
-
-
-
-
-
-
-
-
}
}
-
-?>
'exportEmail' => $this->checkFlag('exportEmail'),
'exportPhone' => $this->checkFlag('exportPhone'),
'exportCounty' => $this->checkFlag('exportCounty'),
+ 'exportLevel' => $this->checkFlag('exportLevel'),
+ 'exportTime' => $this->checkFlag('exportTime'),
+ 'exportRate' => $this->checkFlag('exportRate'),
+ 'exportStatus' => $this->checkFlag('exportStatus'),
);
// Get registration event ID if supplied
// $list = $this->getList($where, "lname");
$listResult = $this->getFullRegistrantsData($regEventID, $where, 1, false);
$list = $listResult['list'];
+ // echo '<pre>$list: ' . print_r( $list, true ) . '</pre>';
+ // exit;
// If we have list entries - even if it's an empty list
$success = true;
// Compile template data
$templateData = array(
- 'category_data' => $category_data,
'select' => $select,
'haveRegistrants' => $haveRegistrants,
'registrants' => $list,
'registrantCount' => $registrantCount,
'categories' => $categories,
'haveFilter' => $haveFilter,
- 'filterArchived' => $filterArchived,
- 'filterFeatured' => $filterFeatured,
- 'filterPending' => $filterPending,
'numbDisplayed' => $numbDisplayed,
'lastDisplayed' => $lastDisplayed,
'paging' => $paging,
}
}
+ $customFieldsPluginActive = apply_filters( 'glm-members-customfields-plugin-active', false );
+
$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'];;
{if $select.exportCity}<th align="left">City</th>{/if}
{if $select.exportState}<th align="left">State</th>{/if}
{if $select.exportZip}<th align="left">ZIP</th>{/if}
- {if $select.exportCounty}<th align="left">County</th>{/if}
{if $select.exportEmail}<th align="left">Email</th>{/if}
{if $select.exportPhone}<th align="left">Phone</th>{/if}
+
+ {if $select.exportLevel}<th align="left">Level</th>{/if}
+ {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}
</tr>
</thead>
<tbody>
{if $select.exportCity}<td>{$m.account.city}</td>{/if}
{if $select.exportState}<td>{if $m.account.state}{$m.account.state.value}{/if}</td>{/if}
{if $select.exportZip}<td>{$m.account.zip}</td>{/if}
- {if $select.exportCounty}<td>{if $m.account.county}{$m.account.county.value}{/if}</td>{/if}
{if $select.exportEmail}<td>{$m.account.email}</td>{/if}
{if $select.exportPhone}<td>{$m.account.phone}</td>{/if}
+ {if $select.exportLevel}<td>{$m.class_name}</td>{/if}
+ {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}
+
</tr>
{/foreach}
{else}
{if $select.exportCity}"City",{/if}
{if $select.exportState}"State",{/if}
{if $select.exportZip}"ZIP/Postal",{/if}
-{if $select.exportCounty}"County",{/if}
-{if $select.exportRegion}"Region",{/if}
{if $select.exportEmail}"Email",{/if}
-{if $select.exportPhone}"Phone"{/if}
+{if $select.exportPhone}"Phone",{/if}
+{if $select.exportLevel}"Level",{/if}
+{if $select.exportTime}"Date/Time",{/if}
+{if $select.exportRate}"Rate",{/if}
+{if $select.exportStatus}"Status"{/if}
{foreach $registrants as $m}
{if $select.exportId}"{$m.id}",{/if}
-{if $select.exportRegistrant}"{$m.registrant}",{/if}
+{if $select.exportRegistrant}"{$m.fname} {$m.lname}",{/if}
{if $select.exportAddr1}"{$m.account.addr1}",{/if}
{if $select.exportAddr2}"{$m.account.addr2}",{/if}
{if $select.exportCity}"{$m.account.city}",{/if}
{if $select.exportState}"{if $m.account.state}{$m.account.state.value}{/if}",{/if}
{if $select.exportZip}"{$m.account.zip}",{/if}
-{if $select.exportCounty}"{if $m.account.county}{$m.county.account.value}{/if}",{/if}
{if $select.exportEmail}"{$m.account.email}",{/if}
-{if $select.exportPhone}"{$m.account.phone}"{/if}
-
+{if $select.exportPhone}"{$m.account.phone}",{/if}
+{if $select.exportLevel}"{$m.class_name}",{/if}
+{if $select.exportTime}"{$m.event_time_reformatted}",{/if}
+{if $select.exportRate}"{$m.rate_name}",{/if}
+{if $select.exportStatus}"{$m.request_status_name}"{/if}
{/foreach}
{else}No {$terms.reg_term_attendee_plur_cap} Selected{/if}
<input type="checkbox" name="exportCity" checked> City<br>
<input type="checkbox" name="exportState" checked> State<br>
<input type="checkbox" name="exportZip" checked> ZIP/Postal Code<br>
+ </td>
+ <td class="exportFieldsTd">
<input type="checkbox" name="exportEmail" checked> Email <br>
<input type="checkbox" name="exportPhone" checked> Phone <br>
<input type="checkbox" name="exportCounty" checked> County <br>
+ <input type="checkbox" name="exportLevel" checked> Level <br>
+ <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>
+
</td>
</tr>
</table>
<script>
jQuery(document).ready(function($){
+
+ // Setup the Export Registrant Dialog
var dialog = $('#exportRegistrantsDialog').dialog({
autoOpen: false,
minWidth: 500,
dialogClass: 'glm-dialog-no-close',
});
+ // Setup the Export Registrant Button
$('#exportRegistrantsButton').click(function(){
$('#exportRegistrantsDialog').dialog('open');
});
+
+ // Setup the Export Registrant Cancel Button
$('#exportRegistrantsCancel').click(function(){
$('#exportRegistrantsDialog').dialog('close');
});
+
+ // Setup the select and unselect all
+ $('#selectAllExportFields').click(function(){
+ $('.exportFieldsTd input[type="checkbox"]').each(function(){
+ $(this).prop('checked', true);
+ });
+ });
+ $('#unselectAllExportFields').click(function(){
+ $('.exportFieldsTd input[type="checkbox"]').each(function(){
+ $(this).prop('checked', false);
+ });
+ });
+
});
</script>