<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
CRM_Core_Error::fatal(ts('The page you requested is currently unavailable.'));
}
+ // Add Event Type to $values in case folks want to display it
+ $values['event']['event_type'] = CRM_Utils_Array::value($values['event']['event_type_id'], CRM_Event_PseudoConstant::eventType());
+
$this->assign('isShowLocation', CRM_Utils_Array::value('is_show_location', $values['event']));
// show event fees.
- if ($this->_id && CRM_Utils_Array::value('is_monetary', $values['event'])) {
+ if ($this->_id && !empty($values['event']['is_monetary'])) {
//CRM-6907
$config = CRM_Core_Config::singleton();
$config->defaultCurrency = CRM_Utils_Array::value('currency',
$fieldCnt = 1;
$visibility = CRM_Core_PseudoConstant::visibility('name');
+ // CRM-14492 Admin price fields should show up on event registration if user has 'administer CiviCRM' permissions
+ $adminFieldVisible = false;
+ if (CRM_Core_Permission::check('administer CiviCRM')) {
+ $adminFieldVisible = true;
+ }
+
foreach ($priceSetFields as $fid => $fieldValues) {
if (!is_array($fieldValues['options']) ||
empty($fieldValues['options']) ||
- CRM_Utils_Array::value('visibility_id', $fieldValues) != array_search('public', $visibility)
+ (CRM_Utils_Array::value('visibility_id', $fieldValues) != array_search('public', $visibility) && $adminFieldVisible == false)
) {
continue;
}
$this->assign('action', CRM_Core_Action::VIEW);
//To show the event location on maps directly on event info page
$locations = CRM_Event_BAO_Event::getMapInfo($this->_id);
- if (!empty($locations) && CRM_Utils_Array::value('is_map', $values['event'])) {
+ if (!empty($locations) && !empty($values['event']['is_map'])) {
$this->assign('locations', $locations);
$this->assign('mapProvider', $config->mapProvider);
$this->assign('mapKey', $config->mapAPIKey);
);
$allowRegistration = FALSE;
- if (CRM_Utils_Array::value('is_online_registration', $values['event'])) {
+ if (!empty($values['event']['is_online_registration'])) {
if (CRM_Event_BAO_Event::validRegistrationRequest($values['event'], $this->_id)) {
// we always generate urls for the front end in joomla
$action_query = $action === CRM_Core_Action::PREVIEW ? "&action=$action" : '';
);
if (!$eventFullMessage || $hasWaitingList) {
$registerText = ts('Register Now');
- if (CRM_Utils_Array::value('registration_link_text', $values['event'])) {
+ if (!empty($values['event']['registration_link_text'])) {
$registerText = $values['event']['registration_link_text'];
}