| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* Finally it calls the parent's run method.
*
* @return void
- *
*/
public function run() {
//get the event id.
$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();
}
);
//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);
}
$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;
}
$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);
$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'];
}
}
- $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);
$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']),
);
}
return parent::getTemplateFileName();
}
+
}