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
17 class CRM_Admin_Page_ParticipantStatusType
extends CRM_Core_Page_Basic
{
19 public $useLivePageJS = TRUE;
26 public function getBAOName() {
27 return 'CRM_Event_BAO_ParticipantStatusType';
33 public function &links() {
35 if ($links === NULL) {
37 CRM_Core_Action
::UPDATE
=> [
39 'url' => 'civicrm/admin/participant_status',
40 'qs' => 'action=update&id=%%id%%&reset=1',
41 'title' => ts('Edit Status'),
43 CRM_Core_Action
::DELETE
=> [
44 'name' => ts('Delete'),
45 'url' => 'civicrm/admin/participant_status',
46 'qs' => 'action=delete&id=%%id%%',
47 'title' => ts('Delete Status'),
49 CRM_Core_Action
::DISABLE
=> [
50 'name' => ts('Disable'),
51 'ref' => 'crm-enable-disable',
52 'title' => ts('Disable Status'),
54 CRM_Core_Action
::ENABLE
=> [
55 'name' => ts('Enable'),
56 'ref' => 'crm-enable-disable',
57 'title' => ts('Enable Status'),
64 public function browse() {
67 $dao = new CRM_Event_DAO_ParticipantStatusType();
68 $dao->orderBy('weight');
71 $visibilities = CRM_Core_PseudoConstant
::visibility();
73 // these statuses are reserved, but disabled by default - so should be disablable after being enabled
77 'Pending from waitlist',
78 'Pending from approval',
82 while ($dao->fetch()) {
83 CRM_Core_DAO
::storeValues($dao, $statusTypes[$dao->id
]);
84 $action = array_sum(array_keys($this->links()));
85 if ($dao->is_reserved
) {
86 $action -= CRM_Core_Action
::DELETE
;
87 if (!in_array($dao->name
, $disablable)) {
88 $action -= CRM_Core_Action
::DISABLE
;
91 $action -= $dao->is_active ? CRM_Core_Action
::ENABLE
: CRM_Core_Action
::DISABLE
;
92 $statusTypes[$dao->id
]['action'] = CRM_Core_Action
::formLink(
98 'participantStatusType.manage.action',
99 'ParticipantStatusType',
102 $statusTypes[$dao->id
]['visibility'] = $visibilities[$dao->visibility_id
];
104 $this->assign('rows', $statusTypes);
110 public function editForm() {
111 return 'CRM_Admin_Form_ParticipantStatusType';
117 public function editName() {
118 return 'Participant Status';
126 public function userContext($mode = NULL) {
127 return 'civicrm/admin/participant_status';