Example #1
0
 /**
  * Combine all the exportable fields from the lower level objects.
  *
  * @param bool $checkPermission
  *
  * @return array
  *   array of exportable Fields
  */
 public static function &exportableFields($checkPermission = TRUE)
 {
     if (!self::$_exportableFields) {
         if (!self::$_exportableFields) {
             self::$_exportableFields = array();
         }
         $participantFields = CRM_Event_DAO_Participant::export();
         $eventFields = CRM_Event_DAO_Event::export();
         $noteField = array('participant_note' => array('title' => 'Participant Note', 'name' => 'participant_note', 'type' => CRM_Utils_Type::T_STRING));
         $participantStatus = array('participant_status' => array('title' => 'Participant Status', 'name' => 'participant_status', 'type' => CRM_Utils_Type::T_STRING));
         $participantRole = array('participant_role' => array('title' => 'Participant Role', 'name' => 'participant_role', 'type' => CRM_Utils_Type::T_STRING));
         $discountFields = CRM_Core_DAO_Discount::export();
         $fields = array_merge($participantFields, $participantStatus, $participantRole, $eventFields, $noteField, $discountFields);
         // add custom data
         $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Participant', FALSE, FALSE, FALSE, $checkPermission));
         self::$_exportableFields = $fields;
     }
     return self::$_exportableFields;
 }
 /**
  * combine all the exportable fields from the lower levels object
  *
  * @return array array of exportable Fields
  * @access public
  * @static
  */
 static function &exportableFields()
 {
     if (!self::$_exportableFields) {
         if (!self::$_exportableFields) {
             self::$_exportableFields = array();
         }
         $fields = array();
         $participantFields = CRM_Event_DAO_Participant::export();
         $noteField = array('participant_note' => array('title' => 'Participant Note', 'name' => 'participant_note'));
         $participantStatus = array('participant_status' => array('title' => 'Participant Status', 'name' => 'participant_status'));
         $participantRole = array('participant_role' => array('title' => 'Participant Role', 'name' => 'participant_role'));
         //campaign fields.
         if (isset($participantFields['participant_campaign_id'])) {
             $participantFields['participant_campaign'] = array('title' => ts('Campaign Title'));
         }
         $discountFields = CRM_Core_DAO_Discount::export();
         $fields = array_merge($participantFields, $participantStatus, $participantRole, $noteField, $discountFields);
         // add custom data
         $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Participant'));
         self::$_exportableFields = $fields;
     }
     return self::$_exportableFields;
 }
 /**
  * combine all the exportable fields from the lower levels object
  *
  * @return array array of exportable Fields
  * @access public
  */
 function &exportableFields()
 {
     if (!self::$_exportableFields) {
         if (!self::$_exportableFields) {
             self::$_exportableFields = array();
         }
         $fields = array();
         require_once 'CRM/Core/DAO/Note.php';
         $participantFields = CRM_Event_DAO_Participant::export();
         $noteField = array('participant_note' => array('title' => 'Participant Note', 'name' => 'participant_note'));
         $participantStatus = array('participant_status' => array('title' => 'Participant Status', 'name' => 'participant_status'));
         $participantRole = array('participant_role' => array('title' => 'Participant Role', 'name' => 'participant_role'));
         require_once 'CRM/Core/DAO/Discount.php';
         $discountFields = CRM_Core_DAO_Discount::export();
         $fields = array_merge($participantFields, $participantStatus, $participantRole, $noteField, $discountFields);
         // add custom data
         $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Participant'));
         self::$_exportableFields = $fields;
     }
     return self::$_exportableFields;
 }
 /**
  * combine all the exportable fields from the lower levels object
  *
  * @return array array of exportable Fields
  * @access public
  * @static
  */
 static function &exportableFields()
 {
     if (!self::$_exportableFields) {
         if (!self::$_exportableFields) {
             self::$_exportableFields = array();
         }
         $fields = array();
         $participantFields = CRM_Event_DAO_Participant::export();
         $noteField = array('participant_note' => array('title' => 'Participant Note', 'name' => 'participant_note'));
         $participantStatus = array('participant_status' => array('title' => 'Participant Status', 'name' => 'participant_status'));
         $participantRole = array('participant_role' => array('title' => 'Participant Role', 'name' => 'participant_role'));
         //CRM-13595 add event id to participant export
         $eventid = array('event_id' => array('title' => 'Event ID', 'name' => 'event_id'));
         $eventtitle = array('event_title' => array('title' => 'Event Title', 'name' => 'event_title'));
         $discountFields = CRM_Core_DAO_Discount::export();
         $fields = array_merge($participantFields, $participantStatus, $participantRole, $eventid, $eventtitle, $noteField, $discountFields);
         // add custom data
         $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Participant'));
         self::$_exportableFields = $fields;
     }
     return self::$_exportableFields;
 }