<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
/**
// 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);
$this->assign('isTemplate', $this->_isTemplate);
+ // Set "Manage Event" Title
+ $title = NULL;
if ($this->_id) {
if ($this->_isTemplate) {
- $title = CRM_Utils_Array::value('template_title', $eventInfo);
- CRM_Utils_System::setTitle(ts('Edit Event Template') . " - $title");
+ $title = ts('Edit Event Template') . ' - ' . CRM_Utils_Array::value('template_title', $eventInfo);
}
else {
- $configureText = ts('Configure Event');
- $title = CRM_Utils_Array::value('title', $eventInfo);
- //If it is a repeating event change title
- if ($this->_isRepeatingEvent) {
- $configureText = 'Configure Repeating Event';
- }
- CRM_Utils_System::setTitle($configureText . " - $title");
+ $configureText = $this->_isRepeatingEvent ? ts('Configure Repeating Event') : ts('Configure Event');
+ $title = $configureText . ' - ' . CRM_Utils_Array::value('title', $eventInfo);
}
- $this->assign('title', $title);
}
elseif ($this->_action & CRM_Core_Action::ADD) {
- if ($this->_isTemplate) {
- $title = ts('New Event Template');
- CRM_Utils_System::setTitle($title);
- }
- else {
- $title = ts('New Event');
- CRM_Utils_System::setTitle($title);
- }
- $this->assign('title', $title);
+ $title = $this->_isTemplate ? ts('New Event Template') : ts('New Event');
}
+ $this->setTitle($title);
if (CRM_Core_Permission::check('view event participants') &&
CRM_Core_Permission::check('view all contacts')
$defaults['is_template'] = $this->_isTemplate;
$defaults['template_id'] = $defaults['id'];
unset($defaults['id']);
+ unset($defaults['start_date']);
+ unset($defaults['end_date']);
}
else {
$defaults['is_active'] = 1;
CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
[1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className)]
- ), ts('Saved'), 'success');
+ ), $this->getTitle(), 'success');
$config = CRM_Core_Config::singleton();
if (in_array('CiviCampaign', $config->enableComponents)) {