* @access public
*/
public $fields = false;
+ /**
+ * Flag to post process results and add current Event data to each result
+ *
+ * @var $postProcAddedEventData
+ * @access public
+ */
+ public $postProcAddedEventData = false;
+
/**
* Constructor
'use' => 'a'
),
- // Bitmap of restricted (admin use only) payment methods for this event - see payment_method
+ // Bitmap of restricted (admin use only) payment methods for this event - see paymenttrue_method
'restricted_payment_methods' => array (
'field' => 'restricted_payment_methods',
'type' => 'bitmap',
}
+ /**
+ * Entry Post Processing Call-Back Method
+ *
+ * Perform post-processing for all result entries.
+ *
+ * @param array $r Array of field result data for a single entry
+ * @param string $a Action being performed (l, i, g, ...)
+ *
+ * @return object Class object
+ *
+ */
+ public function entryPostProcessing( $result_data, $action )
+ {
+
+ // If $postProcAddedEventData option set
+ if ($this->postProcAddedEventData) {
+
+ // If doing the following actions
+ if (in_array($action, array('l'))) {
+
+ // Use hook to Events to get current data for this event
+ $eventData = apply_filters('glm-member-db-events-get-event', $result_data['event']);
+
+ // Add to the registration event arraytrue
+ $result_data['intro'] = $eventData['intro'];
+ $result_data['descr'] = $eventData['descr'];
+ $result_data['image'] = $eventData['image'];
+ $result_data['contact_name'] = $eventData['contact_name'];
+ $result_data['contact_email'] = $eventData['contact_email'];
+ $result_data['contact_phone'] = $eventData['contact_phone'];
+ $result_data['url'] = $eventData['url'];
+
+ }
+
+ }
+
+ return $result_data;
+ }
+
/*
* Get Alpha list of first characters in event name
*
/*
* Get a simple reg event list - Event Name and ID only
*
+ * @param string $where Where clause
+ * @param string $order Fields to order results by
+ * @param boolean $fieldVals Include all optional values for use with input selection
+ * @param string $idField ID field to use
+ * @param integer $start Starting at result #
+ * @param integer $limit Limit results to this number
+ * @param boolean $extended Add current base data for returned events
+ *
* @return array Array of Name and ID for all reg events
* @access public
*/
- public function getSimpleRegEventsList($where = '', $order = '', $fieldVals = true, $idField = 'id', $start = false, $limit = false)
+ public function getSimpleRegEventsList($where = '', $order = '', $fieldVals = true, $idField = 'id', $start = false, $limit = false, $extended = false)
{
+
+ // Save status of extended data flag
+ $saveExtended = $this->postProcAddedEventData;
+
+ // If extended data is requested, then set flag for post processing
+ if ($extended) {
+ $this->postProcAddedEventData = true;
+ }
// Save the current fields array and make a copy
$fSave = $this->fields;
// Remove what we don't want from the copy and get the list
$this->fields = array(
'id' => $fSave['id'],
+ 'event' => $fSave['event'],
'event_name' => $fSave['event_name']
);
// Restore the fields list
$this->fields = $fSave;
+ // Restore status of extended data flag
+ $this->postProcAddedEventData = $saveExtended;
+
+
return $regEventsList;
}