3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 class CRM_Event_Page_ParticipantListing
extends CRM_Core_Page
{
23 protected $_participantListingID;
25 protected $_eventTitle;
29 public function preProcess() {
30 $this->_id
= CRM_Utils_Request
::retrieve('id', 'Integer', $this, TRUE);
32 // ensure that there is a particpant type for this
33 $this->_participantListingID
= CRM_Core_DAO
::getFieldValue('CRM_Event_DAO_Event',
35 'participant_listing_id'
37 if (!$this->_participantListingID
) {
38 CRM_Core_Error
::statusBounce(ts('The Participant Listing feature is not currently enabled for this event.'));
41 // retrieve Event Title and include it in page title
42 $this->_eventTitle
= CRM_Core_DAO
::getFieldValue('CRM_Event_DAO_Event',
46 CRM_Utils_System
::setTitle(ts('%1 - Participants', array(1 => $this->_eventTitle
)));
48 // we do not want to display recently viewed contacts since this is potentially a public page
49 $this->assign('displayRecent', FALSE);
57 public function run() {
60 // get the class name from the participantListingID
61 $className = CRM_Utils_Array
::value($this->_participantListingID
,
62 CRM_Core_PseudoConstant
::get(
63 'CRM_Event_BAO_Event',
64 'participant_listing_id',
65 ['keyColumn' => 'value', 'labelColumn' => 'description']
68 if ($className == 'CRM_Event_Page_ParticipantListing') {
69 CRM_Core_Error
::statusBounce(ts("Participant listing code file cannot be '%1'",
70 array(1 => $className)
74 $classFile = str_replace('_',
78 $error = include_once $classFile;
79 if ($error == FALSE) {
80 CRM_Core_Error
::statusBounce('Participant listing code file: ' . $classFile . ' does not exist. Please verify your custom particpant listing settings in CiviCRM administrative panel.');
83 $participantListingClass = new $className();
85 $participantListingClass->preProcess();
86 $participantListingClass->run();