*/
public function buildQuickForm() {
if (!$this->_profileId) {
- CRM_Core_Error::fatal(ts('Profile for bulk data entry is missing.'));
+ CRM_Core_Error::statusBounce(ts('Profile for bulk data entry is missing.'));
}
$this->addElement('hidden', 'batch_id', $this->_batchId);
$offset = 50;
if ((count($this->_elementIndex) + $offset) > ini_get("max_input_vars")) {
// Avoiding 'ts' for obscure messages.
- CRM_Core_Error::fatal('Batch size is too large. Increase value of php.ini setting "max_input_vars" (current val = ' . ini_get("max_input_vars") . ')');
+ CRM_Core_Error::statusBounce('Batch size is too large. Increase value of php.ini setting "max_input_vars" (current val = ' . ini_get("max_input_vars") . ')');
}
$this->assign('fields', $this->_fields);
$surveyId = key(CRM_Campaign_BAO_Survey::getSurveys(TRUE, TRUE));
}
if (!$surveyId) {
- CRM_Core_Error::fatal('Could not find valid Survey Id.');
+ CRM_Core_Error::statusBounce('Could not find valid Survey Id.');
}
$this->_formValues['campaign_survey_id'] = $this->_formValues['campaign_survey_id'] = $surveyId;
if (!$this->_caseId ||
(!$this->_activityId && !$this->_activityTypeId)
) {
- CRM_Core_Error::fatal('required params missing.');
+ CRM_Core_Error::statusBounce('required params missing.');
}
//check for case activity access.
if (!CRM_Case_BAO_Case::accessCiviCase()) {
- CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You are not authorized to access this page.'));
}
//validate case id.
if ($this->_caseId &&
$params = ['type' => 'any'];
$allCases = CRM_Case_BAO_Case::getCases(TRUE, $params);
if (count(array_intersect($this->_caseId, array_keys($allCases))) == 0) {
- CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You are not authorized to access this page.'));
}
}
$this->_activityTypeId
);
if (!$valid) {
- CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You are not authorized to access this page.'));
}
}
//CRM-4418
if (!CRM_Core_Permission::checkActionPermission('CiviCase', $this->_action)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
if ($this->_action & CRM_Core_Action::DELETE || $this->_action & CRM_Core_Action::RENEW) {
foreach ($caseAttributes as $key => $label) {
if (!CRM_Case_BAO_Case::buildOptions($key, 'create')) {
- CRM_Core_Error::fatal(ts('You do not have any active %1', [1 => $label]));
+ CRM_Core_Error::statusBounce(ts('You do not have any active %1', [1 => $label]));
}
}
}
if ($this->_action & CRM_Core_Action::ADD) {
$this->_activityTypeId = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Open Case');
if (!$this->_activityTypeId) {
- CRM_Core_Error::fatal(ts('The Open Case activity type is missing or disabled. Please have your site administrator check Administer > Option Lists > Activity Types for the CiviCase component.'));
+ CRM_Core_Error::statusBounce(ts('The Open Case activity type is missing or disabled. Please have your site administrator check Administer > Option Lists > Activity Types for the CiviCase component.'));
}
}
//check for case permissions.
if (!CRM_Case_BAO_Case::accessCiviCase()) {
- CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You are not authorized to access this page.'));
}
if (($this->_action & CRM_Core_Action::ADD) &&
(!CRM_Core_Permission::check('access all cases and activities') &&
!CRM_Core_Permission::check('add cases')
)
) {
- CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You are not authorized to access this page.'));
}
if ($this->_activityTypeFile = CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId,
$this->assign('canDelete', TRUE);
}
if (!CRM_Core_Permission::check('view contributions of type ' . $financialTypeID)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
}
elseif ($this->_action & CRM_Core_Action::VIEW) {
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
if (!CRM_Core_Permission::event(CRM_Core_Permission::VIEW, $this->_id, 'register for events')) {
- CRM_Core_Error::fatal(ts('You do not have permission to register for this event'));
+ CRM_Core_Error::statusBounce(ts('You do not have permission to register for this event'));
}
$cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
// its an update mode, do a permission check
if (!CRM_Event_BAO_Event::checkPermission($this->_id, CRM_Core_Permission::EDIT)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
$participantListingID = CRM_Utils_Array::value('participant_listing_id', $eventInfo);
// check for edit permission
if (!CRM_Core_Permission::checkActionPermission('CiviEvent', $this->_action)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
if ($this->_action & CRM_Core_Action::DELETE) {
// check delete permission for contribution
if ($this->_id && $this->_paymentId && !CRM_Core_Permission::checkActionPermission('CiviContribute', $this->_action)) {
- CRM_Core_Error::fatal(ts("This Participant is linked to a contribution. You must have 'delete in CiviContribute' permission in order to delete this record."));
+ CRM_Core_Error::statusBounce(ts("This Participant is linked to a contribution. You must have 'delete in CiviContribute' permission in order to delete this record."));
}
return;
}
if ($this->_mode) {
if (!$this->_isPaidEvent) {
- CRM_Core_Error::fatal(ts('Selected Event is not Paid Event '));
+ CRM_Core_Error::statusBounce(ts('Selected Event is not Paid Event '));
}
$eventTitle
CRM_Event_BAO_Event::retrieve($params, $values['event']);
if (!$values['event']['is_active']) {
- // form is inactive, die a fatal death
CRM_Utils_System::setUFMessage(ts('The event you requested is currently unavailable (contact the site administrator for assistance).'));
return CRM_Utils_System::permissionDenied();
}
if (!empty($values['event']['is_template'])) {
// form is an Event Template
- CRM_Core_Error::fatal(ts('The page you requested is currently unavailable.'));
+ CRM_Core_Error::statusBounce(ts('The page you requested is currently unavailable.'));
}
// Add Event Type to $values in case folks want to display it
/**
* Set variables up before form is built.
+ *
+ * @throws \CRM_Core_Exception
*/
public function preProcess() {
if ($this->_action & CRM_Core_Action::DELETE) {
//check permission for action.
if (!CRM_Core_Permission::checkActionPermission('CiviEvent', $this->_action)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+ CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
// CRM-16784: If there is no ID then this can't be an 'edit'
else {
- CRM_Core_Error::fatal(ts('No user/contact ID was specified, so the Profile cannot be used in edit mode.'));
+ CRM_Core_Error::statusBounce(ts('No user/contact ID was specified, so the Profile cannot be used in edit mode.'));
}
}
//Remove need for Profile module type when using reserved profiles [CRM-14488]
if (!$dao->N || (!$isProfile && !($dao->is_reserved && $canAdd))) {
- CRM_Core_Error::fatal(ts('The requested Profile (gid=%1) is not configured to be used for \'Profile\' edit and view forms in its Settings. Contact the site administrator if you need assistance.',
+ CRM_Core_Error::statusBounce(ts('The requested Profile (gid=%1) is not configured to be used for \'Profile\' edit and view forms in its Settings. Contact the site administrator if you need assistance.',
[1 => $this->_gid]
));
}
*/
public function buildQuickForm() {
if (empty($this->_ufGroup['id'])) {
- CRM_Core_Error::fatal();
+ CRM_Core_Error::statusBounce(ts('Invalid'));
}
// set the title