/**
* Function to delete the event
*
- * @param int $id event id
+ * @param int $id event id
*
+ * @return mixed|null
* @access public
* @static
*
* Function to delete the location block associated with an event,
* if not being used by any other event.
*
- * @param int $loc_block_id location block id to be deleted
- * @param int $eventid event id with which loc block is associated
+ * @param $locBlockId
+ * @param null $eventId
+ *
+ * @internal param int $loc_block_id location block id to be deleted
+ * @internal param int $eventid event id with which loc block is associated
*
* @access public
* @static
- *
*/
static function deleteEventLocBlock($locBlockId, $eventId = NULL) {
$query = "SELECT count(ce.id) FROM civicrm_event ce WHERE ce.loc_block_id = $locBlockId";
* @param $all int 0 returns current and future events
* 1 if events all are required
* 2 returns events since 3 months ago
- * @param $id int id of a specific event to return
+ * @param bool|int $id int id of a specific event to return
* @param $isActive boolean true if you need only active events
* @param $checkPermission boolean true if you need to check permission else false
*
+ * @return array
* @static
*/
static function getEvents($all = 0,
/**
* Function to get participant count
*
+ * @param $eventId
* @param boolean $considerStatus consider status for participant count.
- * @param boolean $status consider counted participant.
- * @param boolean $considerRole consider role for participant count.
- * @param boolean $role consider counted( is filter role) participant.
- * @param array $eventIds consider participants from given events.
- * @param boolean $countWithStatus retrieve participant count w/ each participant status.
+ * @param boolean $status consider counted participant.
+ * @param boolean $considerRole consider role for participant count.
+ * @param boolean $role consider counted( is filter role) participant.
+ *
+ * @internal param array $eventIds consider participants from given events.
+ * @internal param bool $countWithStatus retrieve participant count w/ each participant status.
*
* @access public
*
/**
* function to get the information to map a event
*
- * @param array $ids the list of ids for which we want map info
+ * @param $id
+ *
+ * @internal param array $ids the list of ids for which we want map info
*
* @return null|string title of the event
* @static
}
// 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
* This function is to make a copy of a Event, including
* all the fields in the event Wizard
*
- * @param int $id the event id to copy
+ * @param int $id the event id to copy
* obj $newEvent object of CRM_Event_DAO_Event
* boolean $afterCreate call to copy after the create function
+ * @param null $newEvent
+ * @param bool $afterCreate
+ *
* @return void
* @access public
*/
/**
* Process that send e-mails
*
+ * @param $contactID
+ * @param $values
+ * @param $participantId
+ * @param bool $isTest
+ * @param bool $returnMessageText
+ *
* @return void
* @access public
*/
* Function to add the custom fields OR array of participant's
* profile info
*
+ * @param $id
+ * @param $name
+ * @param $cid
+ * @param $template
+ * @param $participantId
+ * @param $isTest
+ * @param bool $isCustomProfile
+ * @param array $participantParams
+ *
* @return void
* @access public
*/
* @param array $groupTitle Profile Group Title.
* @param array $values formatted array of key value
*
+ * @param array $profileFields
+ *
* @return void
* @access public
* @static
/**
* Function to build the array for Additional participant's information array of priamry and additional Ids
*
- *@param int $participantId id of Primary participant
- *@param array $values key/value event info
- *@param int $contactId contact id of Primary participant
- *@param boolean $isTest whether test or live transaction
- *@param boolean $isIdsArray to return an array of Ids
+ * @param int $participantId id of Primary participant
+ * @param array $values key/value event info
+ * @param int $contactId contact id of Primary participant
+ * @param boolean $isTest whether test or live transaction
+ * @param boolean $isIdsArray to return an array of Ids
*
- *@return array $customProfile array of Additional participant's info OR array of Ids.
- *@access public
+ * @param bool $skipCancel
+ *
+ * @return array $customProfile array of Additional participant's info OR array of Ids.
+ * @access public
*/
static function buildCustomProfile($participantId,
$values,
*
* @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'])) {
/**
* make sure that the user has permission to access this event
*
- * @param int $id the id of the event
- * @param int $name the name or title of the event
+ * @param null $eventId
+ * @param int $type
+ *
+ * @internal param int $id the id of the event
+ * @internal param int $name the name or title of the event
*
* @return string the permission that the user has (or null)
* @access public
*
* @return $defaults an array of custom data defaults.
*/
- public function getTemplateDefaultValues($templateId) {
+ /**
+ * @param $templateId
+ *
+ * @return array
+ */
+ static function getTemplateDefaultValues($templateId) {
$defaults = array();
if (!$templateId) {
return $defaults;
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');