X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FPage%2FEventInfo.php;h=548d3855c5f54a85171ec94f31027bba3c350605;hb=709e574bfc8b047d9e9f9a6ad84595bc3f560b54;hp=056d6f4039656df2f37f903c5e1447305586ea80;hpb=e9aca61e8b08d5ae372621c4397108b8f2ec28ba;p=civicrm-core.git diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php index 056d6f4039..548d3855c5 100644 --- a/CRM/Event/Page/EventInfo.php +++ b/CRM/Event/Page/EventInfo.php @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * @@ -46,7 +46,6 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { * Finally it calls the parent's run method. * * @return void - * */ public function run() { //get the event id. @@ -54,8 +53,9 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { $config = CRM_Core_Config::singleton(); // ensure that the user has permission to see this page if (!CRM_Core_Permission::event(CRM_Core_Permission::VIEW, - $this->_id, 'view event info' - )) { + $this->_id, 'view event info' + ) + ) { CRM_Utils_System::setUFMessage(ts('You do not have permission to view this event')); return CRM_Utils_System::permissionDenied(); } @@ -102,10 +102,11 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { ); //CRM-10434 - $discountId= CRM_Core_BAO_Discount::findSet($this->_id, 'civicrm_event'); + $discountId = CRM_Core_BAO_Discount::findSet($this->_id, 'civicrm_event'); if ($discountId) { $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $discountId, 'price_set_id'); - } else { + } + else { $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $this->_id); } @@ -119,15 +120,15 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { $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; + $adminFieldVisible = FALSE; if (CRM_Core_Permission::check('administer CiviCRM')) { - $adminFieldVisible = true; + $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) && $adminFieldVisible == false) + (CRM_Utils_Array::value('visibility_id', $fieldValues) != array_search('public', $visibility) && $adminFieldVisible == FALSE) ) { continue; } @@ -167,7 +168,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { $this->assign('isPriceSet', 1); $this->assign('isQuickConfig', $setDetails[$priceSetId]['is_quick_config']); } - } + } $params = array('entity_id' => $this->_id, 'entity_table' => 'civicrm_event'); $values['location'] = CRM_Core_BAO_Location::getValues($params, TRUE); @@ -194,7 +195,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { $this->assign('mapKey', $config->mapAPIKey); $sumLat = $sumLng = 0; $maxLat = $maxLng = -400; - $minLat = $minLng = + 400; + $minLat = $minLng = 400; foreach ($locations as $location) { $sumLat += $location['lat']; $sumLng += $location['lng']; @@ -214,11 +215,13 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { } } - $center = array('lat' => (float ) $sumLat / count($locations), + $center = array( + 'lat' => (float ) $sumLat / count($locations), 'lng' => (float ) $sumLng / count($locations), ); - $span = array('lat' => (float )($maxLat - $minLat), - 'lng' => (float )($maxLng - $minLng), + $span = array( + 'lat' => (float ) ($maxLat - $minLat), + 'lng' => (float ) ($maxLng - $minLng), ); $this->assign_by_ref('center', $center); $this->assign_by_ref('span', $span); @@ -310,7 +313,8 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { $this->assign('allowRegistration', $allowRegistration); $session = CRM_Core_Session::singleton(); - $params = array('contact_id' => $session->get('userID'), + $params = array( + 'contact_id' => $session->get('userID'), 'event_id' => CRM_Utils_Array::value('id', $values['event']), 'role_id' => CRM_Utils_Array::value('default_role_id', $values['event']), ); @@ -373,4 +377,5 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { } return parent::getTemplateFileName(); } + }