3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2015
33 class CRM_Admin_Page_ParticipantStatusType
extends CRM_Core_Page_Basic
{
35 public $useLivePageJS = TRUE;
42 public function getBAOName() {
43 return 'CRM_Event_BAO_ParticipantStatusType';
49 public function &links() {
51 if ($links === NULL) {
53 CRM_Core_Action
::UPDATE
=> array(
55 'url' => 'civicrm/admin/participant_status',
56 'qs' => 'action=update&id=%%id%%&reset=1',
57 'title' => ts('Edit Status'),
59 CRM_Core_Action
::DELETE
=> array(
60 'name' => ts('Delete'),
61 'url' => 'civicrm/admin/participant_status',
62 'qs' => 'action=delete&id=%%id%%',
63 'title' => ts('Delete Status'),
65 CRM_Core_Action
::DISABLE
=> array(
66 'name' => ts('Disable'),
67 'ref' => 'crm-enable-disable',
68 'title' => ts('Disable Status'),
70 CRM_Core_Action
::ENABLE
=> array(
71 'name' => ts('Enable'),
72 'ref' => 'crm-enable-disable',
73 'title' => ts('Enable Status'),
80 public function browse() {
81 $statusTypes = array();
83 $dao = new CRM_Event_DAO_ParticipantStatusType();
84 $dao->orderBy('weight');
87 $visibilities = CRM_Core_PseudoConstant
::visibility();
89 // these statuses are reserved, but disabled by default - so should be disablable after being enabled
93 'Pending from waitlist',
94 'Pending from approval',
98 while ($dao->fetch()) {
99 CRM_Core_DAO
::storeValues($dao, $statusTypes[$dao->id
]);
100 $action = array_sum(array_keys($this->links()));
101 if ($dao->is_reserved
) {
102 $action -= CRM_Core_Action
::DELETE
;
103 if (!in_array($dao->name
, $disablable)) {
104 $action -= CRM_Core_Action
::DISABLE
;
107 $action -= $dao->is_active ? CRM_Core_Action
::ENABLE
: CRM_Core_Action
::DISABLE
;
108 $statusTypes[$dao->id
]['action'] = CRM_Core_Action
::formLink(
111 array('id' => $dao->id
),
114 'participantStatusType.manage.action',
115 'ParticipantStatusType',
118 $statusTypes[$dao->id
]['visibility'] = $visibilities[$dao->visibility_id
];
120 $this->assign('rows', $statusTypes);
126 public function editForm() {
127 return 'CRM_Admin_Form_ParticipantStatusType';
133 public function editName() {
134 return 'Participant Status';
142 public function userContext($mode = NULL) {
143 return 'civicrm/admin/participant_status';