}
// check 'view event info' permission
+ //@todo - per CRM-14626 we have resolved that 'view event info' means 'view ALL event info'
+ // and passing in the specific permission here will short-circuit the evaluation of permission to
+ // see specific events (doesn't seem relevant to this call
+ // however, since this function is accessed only by a convoluted call from a joomla block function
+ // it seems safer not to touch here. Suggestion is that CRM_Core_Permission::check(array or relevant permissions) would
+ // be clearer & safer here
$permissions = CRM_Core_Permission::event(CRM_Core_Permission::VIEW);
// check if we're in shopping cart mode for events
*
* @return array $events array of all events.
*/
+ /**
+ * @return array
+ */
static function getLocationEvents() {
$events = array();
return $events;
}
+ /**
+ * @param $locBlockId
+ *
+ * @return int|null|string
+ */
static function countEventsUsingLocBlockId($locBlockId) {
if (!$locBlockId) {
return 0;
return CRM_Core_DAO::singleValueQuery($query);
}
- static function validRegistrationRequest($values, $contactID) {
+ /**
+ * Check if event registration is valid according to permissions AND Dates
+ *
+ * @param array $values
+ * @param integer $eventID
+ * @return boolean
+ */
+ static function validRegistrationRequest($values, $eventID) {
// check that the user has permission to register for this event
$hasPermission = CRM_Core_Permission::event(CRM_Core_Permission::EDIT,
- $contactID
+ $eventID, 'register for events'
);
return $hasPermission && self::validRegistrationDate($values);
}
+ /**
+ * @param $values
+ *
+ * @return bool
+ */
static function validRegistrationDate(&$values) {
// make sure that we are between registration start date and registration end date
$startDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_start_date', $values));
* @return boolean true if allow registration otherwise false
* @access public
*/
+ /**
+ * @param $values
+ *
+ * @return bool
+ */
static function showHideRegistrationLink($values) {
$session = CRM_Core_Session::singleton();
* @return boolean $alreadyRegistered true/false
* @access public
*/
+ /**
+ * @param $params
+ *
+ * @return bool
+ */
static function checkRegistration($params) {
$alreadyRegistered = FALSE;
if (empty($params['contact_id'])) {
*
* @return $defaults an array of custom data defaults.
*/
+ /**
+ * @param $templateId
+ *
+ * @return array
+ */
static function getTemplateDefaultValues($templateId) {
$defaults = array();
if (!$templateId) {
return $defaults;
}
+ /**
+ * @param $event_id
+ *
+ * @return object
+ */
static function get_sub_events($event_id) {
$params = array('parent_event_id' => $event_id);
$defaults = array();
* @params int $eventCampaignID campaign id of that event
*
*/
+ /**
+ * @param $eventID
+ * @param $eventCampaignID
+ */
static function updateParticipantCampaignID($eventID, $eventCampaignID) {
$params = array();
$params[1] = array($eventID, 'Integer');