*
* @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 $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');
'Awaiting approval' => array('Cancelled', 'Pending from approval'),
'Pending from approval' => array('Registered', 'Cancelled'),
);
+
+ /**
+ *
+ */
function __construct() {
parent::__construct();
}
}
}
+ /**
+ * @param $params
+ * @param $participantId
+ * @param $contributionId
+ * @param $feeBlock
+ * @param $lineItems
+ * @param $paidAmount
+ * @param $priceSetId
+ */
static function changeFeeSelections($params, $participantId, $contributionId, $feeBlock, $lineItems, $paidAmount, $priceSetId) {
$contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
$partiallyPaidStatusId = array_search('Partially paid', $contributionStatuses);
self::addActivityForSelection($participantId, 'Change Registration');
}
+ /**
+ * @param $updatedAmount
+ * @param $paidAmount
+ * @param $contributionId
+ */
static function recordAdjustedAmt($updatedAmount, $paidAmount, $contributionId) {
$balanceAmt = $updatedAmount - $paidAmount;
$contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
}
}
+ /**
+ * @param $participantId
+ * @param $activityType
+ *
+ * @throws CRM_Core_Exception
+ */
static function addActivityForSelection($participantId, $activityType) {
$eventId = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_Participant', $participantId, 'event_id');
$contactId = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_Participant', $participantId, 'contact_id');
*
*/
class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatusType {
+ /**
+ * @param $params
+ *
+ * @return $this|null
+ */
static function add(&$params) {
if (empty($params)) {
return NULL;
return $dao->save();
}
+ /**
+ * @param $params
+ *
+ * @return $this|null
+ */
static function &create(&$params) {
$transaction = new CRM_Core_Transaction();
$statusType = self::add($params);
return $statusType;
}
+ /**
+ * @param $id
+ *
+ * @return bool
+ */
static function deleteParticipantStatusType($id) {
// return early if there are participants with this status
$participant = new CRM_Event_DAO_Participant;
return TRUE;
}
+ /**
+ * @param $params
+ * @param $defaults
+ *
+ * @return CRM_Event_DAO_ParticipantStatusType|null
+ */
static function retrieve(&$params, &$defaults) {
$result = NULL;
return $result;
}
+ /**
+ * @param $id
+ * @param $isActive
+ *
+ * @return bool
+ */
static function setIsActive($id, $isActive) {
return CRM_Core_DAO::setFieldValue('CRM_Event_BAO_ParticipantStatusType', $id, 'is_active', $isActive);
}
+ /**
+ * @param $params
+ *
+ * @return array
+ */
public function process($params) {
$returnMessages = array();
*/
class CRM_Event_BAO_Query {
+ /**
+ * @return array
+ */
static function &getFields() {
$fields = array();
$fields = array_merge($fields, CRM_Event_DAO_Event::import());
return $fields;
}
+ /**
+ * @return array
+ */
static function &getParticipantFields() {
$fields = CRM_Event_BAO_Participant::importableFields('Individual', TRUE, TRUE);
return $fields;
}
}
+ /**
+ * @param $query
+ */
static function where(&$query) {
$grouping = NULL;
foreach (array_keys($query->_params) as $id) {
}
}
+ /**
+ * @param $values
+ * @param $query
+ */
static function whereClauseSingle(&$values, &$query) {
list($name, $op, $value, $grouping, $wildcard) = $values;
switch ($name) {
}
}
+ /**
+ * @param $name
+ * @param $mode
+ * @param $side
+ *
+ * @return null|string
+ */
static function from($name, $mode, $side) {
$from = NULL;
switch ($name) {
return (isset($this->_qill)) ? $this->_qill : "";
}
+ /**
+ * @param $mode
+ * @param bool $includeCustomFields
+ *
+ * @return array|null
+ */
static function defaultReturnProperties($mode,
$includeCustomFields = TRUE
) {
$form->setDefaults(array('participant_test' => 0));
}
+ /**
+ * @param $row
+ * @param $id
+ */
static function searchAction(&$row, $id) {}
+ /**
+ * @param $tables
+ */
static function tableNames(&$tables) {
//add participant table
if (!empty($tables['civicrm_event'])) {
*
*/
class CRM_Event_Badge {
+ /**
+ *
+ */
function __construct() {
$this->style = array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200));
$this->format = '5160';
$this->setDebug(FALSE);
}
+ /**
+ * @param bool $debug
+ */
function setDebug($debug = TRUE) {
if (!$debug) {
$this->debug = FALSE;
CRM_Utils_System::civiExit(1);
}
+ /**
+ * @param $eventID
+ *
+ * @return CRM_Event_BAO_Event|null
+ */
protected function retrieveEvent($eventID) {
$bao = new CRM_Event_BAO_Event();
if ($bao->get('id', $eventID)) {
return NULL;
}
+ /**
+ * @param $eventID
+ * @param bool $img
+ *
+ * @return string
+ */
function getImageFileName($eventID, $img = FALSE) {
global $civicrm_root;
$path = "CRM/Event/Badge";
return $imgFile;
}
+ /**
+ * @param bool $img
+ */
function printBackground($img = FALSE) {
$x = $this->pdf->GetAbsX();
$y = $this->pdf->GetY();
<?php
+
+/**
+ * Class CRM_Event_Badge_Logo
+ */
class CRM_Event_Badge_Logo extends CRM_Event_Badge {
+ /**
+ *
+ */
function __construct() {
parent::__construct();
// A4
// $this->setDebug ();
}
+ /**
+ * @param $participant
+ */
public function generateLabel($participant) {
$x = $this->pdf->GetAbsX();
$y = $this->pdf->GetY();
<?php
+
+/**
+ * Class CRM_Event_Badge_Logo5395
+ */
class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge {
+ /**
+ *
+ */
function __construct() {
parent::__construct();
// A4
// $this->setDebug ();
}
+ /**
+ * @param $participant
+ */
public function generateLabel($participant) {
$x = $this->pdf->GetAbsX();
$y = $this->pdf->GetY();
*
*/
class CRM_Event_Badge_NameTent extends CRM_Event_Badge {
+ /**
+ *
+ */
function __construct() {
parent::__construct();
// A4
$this->pdf->setPageFormat('A4', 'L');
}
+ /**
+ * @param $participant
+ */
protected function writeOneSide(&$participant) {
$this->pdf->SetXY(0, $this->pdf->height / 2);
$this->printBackground(TRUE);
$this->pdf->Write(0, $participant['current_employer'], NULL, NULL, 'C');
}
+ /**
+ * @param $participant
+ */
public function generateLabel($participant) {
$this->writeOneSide($participant);
$this->pdf->StartTransform();
*/
class CRM_Event_Badge_Simple extends CRM_Event_Badge {
+ /**
+ * @param $participant
+ */
public function generateLabel($participant) {
$date = CRM_Utils_Date::customFormat($participant['event_start_date'], "%e %b");
$this->pdf->SetFontSize(8);
<?php
+
+/**
+ * Class CRM_Event_Cart_BAO_Cart
+ */
class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart {
public $associations_loaded = FALSE;
/* event_in_cart_id => $event_in_cart */
public $events_in_carts = array(
);
+ /**
+ * @param $params
+ *
+ * @return $this
+ */
public static function add(&$params) {
$cart = new CRM_Event_Cart_BAO_Cart();
$cart->copyValues($params);
return $result;
}
+ /**
+ * @param $event_id
+ *
+ * @return mixed
+ */
public function add_event($event_id) {
$this->load_associations();
$event_in_cart = $this->get_event_in_cart_by_event_id($event_id);
return $this->events_in_carts[$event_in_cart->event_id];
}
+ /**
+ * @param $participant
+ */
function add_participant_to_cart($participant) {
$event_in_cart = $this->get_event_in_cart_by_event_id($participant->event_id);
if (!$event_in_cart) {
$event_in_cart->save();
}
+ /**
+ * @param $params
+ *
+ * @return $this
+ * @throws Exception
+ */
public static function create($params) {
$transaction = new CRM_Core_Transaction();
return $cart;
}
+ /**
+ * @param $id
+ *
+ * @return bool|CRM_Event_Cart_BAO_Cart
+ */
public static function find_by_id($id) {
return self::find_by_params(array('id' => $id));
}
+ /**
+ * @param $params
+ *
+ * @return bool|CRM_Event_Cart_BAO_Cart
+ */
public static function find_by_params($params) {
$cart = new CRM_Event_Cart_BAO_Cart();
$cart->copyValues($params);
}
}
+ /**
+ * @return $this|bool|CRM_Event_Cart_BAO_Cart
+ */
public static function find_or_create_for_current_session() {
$session = CRM_Core_Session::singleton();
$event_cart_id = $session->get('event_cart_id');
return $cart;
}
+ /**
+ * @param $id
+ *
+ * @return bool|CRM_Event_Cart_BAO_Cart
+ */
public static function find_uncompleted_by_id($id) {
return self::find_by_params(array('id' => $id, 'completed' => 0));
}
+ /**
+ * @param $user_id
+ *
+ * @return bool|CRM_Event_Cart_BAO_Cart
+ */
public static function find_uncompleted_by_user_id($user_id) {
return self::find_by_params(array('user_id' => $user_id, 'completed' => 0));
}
+ /**
+ * @return array
+ */
public function get_main_events_in_carts() {
//return CRM_Event_Cart_BAO_EventInCart::find_all_by_params( array('main_conference_event_id'
$all = array();
return $all;
}
+ /**
+ * @param $main_conference_event_id
+ *
+ * @return array
+ */
public function get_events_in_carts_by_main_event_id($main_conference_event_id) {
$all = array();
if (!$main_conference_event_id) {
return $all;
}
+ /**
+ * @param $event_in_cart_1
+ * @param $event_in_cart_2
+ *
+ * @return int
+ */
static function compare_event_dates($event_in_cart_1, $event_in_cart_2) {
$date_1 = CRM_Utils_Date::unixTime($event_in_cart_1->event->start_date);
$date_2 = CRM_Utils_Date::unixTime($event_in_cart_2->event->start_date);
return ($date_1 < $date_2) ? -1 : 1;
}
+ /**
+ * @param $main_participant
+ *
+ * @return array
+ */
public function get_subparticipants($main_participant) {
$subparticipants = array();
foreach ($this->events_in_carts as $event_in_cart) {
return $subparticipants;
}
+ /**
+ * @param $event_id
+ *
+ * @return mixed
+ */
public function get_event_in_cart_by_event_id($event_id) {
return CRM_Utils_Array::value($event_id, $this->events_in_carts);
}
+ /**
+ * @param $event_in_cart_id
+ *
+ * @return null
+ */
public function &get_event_in_cart_by_id($event_in_cart_id) {
foreach ($this->events_in_carts as $event_in_cart) {
if ($event_in_cart->id == $event_in_cart_id) {
return NULL;
}
+ /**
+ * @return array
+ */
public function get_main_event_participants() {
$participants = array();
foreach ($this->get_main_events_in_carts() as $event_in_cart) {
$this->save();
}
+ /**
+ * @param $event_in_cart_id
+ *
+ * @return bool|CRM_Event_Cart_BAO_EventInCart
+ */
public function remove_event_in_cart($event_in_cart_id) {
$event_in_cart = CRM_Event_Cart_BAO_EventInCart::find_by_id($event_in_cart_id);
if ($event_in_cart) {
return $event_in_cart;
}
+ /**
+ * @param $participant_id
+ *
+ * @return int
+ */
function get_participant_index_from_id($participant_id) {
foreach ($this->events_in_carts as $event_in_cart) {
$index = 0;
return - 1;
}
+ /**
+ * @param $params
+ * @param $values
+ *
+ * @return mixed
+ * @throws Exception
+ */
public static function retrieve(&$params, &$values) {
$cart = self::find_by_params($params);
if ($cart === FALSE) {
}
+ /**
+ * @param $from_cart_id
+ */
public function adopt_participants($from_cart_id) {
$params = array(
1 => array($this->id, 'Integer'),
<?php
+
+/**
+ * Class CRM_Event_Cart_BAO_Conference
+ */
class CRM_Event_Cart_BAO_Conference {
//XXX assumes we don't allow a contact to register for the same conference more than once
//XXX flattens the object tree for convenient templating
<?php
+
+/**
+ * Class CRM_Event_Cart_BAO_EventInCart
+ */
class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart implements ArrayAccess {
public $assocations_loaded = FALSE;
public $event;
public $participants = array(
);
+ /**
+ *
+ */
function __construct() {
parent::__construct();
}
+ /**
+ * @param $participant
+ */
public function add_participant($participant) {
$this->participants[$participant->id] = $participant;
}
+ /**
+ * @param $params
+ *
+ * @return $this|CRM_Event_Cart_BAO_EventInCart
+ * @throws Exception
+ */
public static function create(&$params) {
$transaction = new CRM_Core_Transaction();
$event_in_cart = new CRM_Event_Cart_BAO_EventInCart();
return $event_in_cart;
}
+ /**
+ * @param bool $useWhere
+ */
function delete($useWhere = false) {
$this->load_associations();
$contacts_to_delete = array();
parent::delete();
}
+ /**
+ * @param $event_cart_id
+ *
+ * @return array
+ */
public static function find_all_by_event_cart_id($event_cart_id) {
return self::find_all_by_params(array('event_cart_id' => $event_cart_id));
}
+ /**
+ * @param $params
+ *
+ * @return array
+ */
public static function find_all_by_params($params) {
$event_in_cart = new CRM_Event_Cart_BAO_EventInCart();
$event_in_cart->copyValues($params);
return $result;
}
+ /**
+ * @param $id
+ *
+ * @return bool|CRM_Event_Cart_BAO_EventInCart
+ */
public static function find_by_id($id) {
return self::find_by_params(array('id' => $id));
}
+ /**
+ * @param $params
+ *
+ * @return bool|CRM_Event_Cart_BAO_EventInCart
+ */
public static function find_by_params($params) {
$event_in_cart = new CRM_Event_Cart_BAO_EventInCart();
$event_in_cart->copyValues($params);
}
}
+ /**
+ * @param $contact_id
+ */
public function remove_participant_by_contact_id($contact_id) {
$to_remove = array();
foreach ($this->participants as $participant) {
$this->participants = array_diff_key($this->participants, $to_remove);
}
+ /**
+ * @param $participant_id
+ *
+ * @return mixed
+ */
public function get_participant_by_id($participant_id) {
return $this->participants[$participant_id];
}
+ /**
+ * @param $participant_id
+ */
public function remove_participant_by_id($participant_id) {
$this->get_participant_by_id($participant_id)->delete();
unset($this->participants[$participant_id]);
}
+ /**
+ * @param $participant
+ *
+ * @return mixed
+ */
static function part_key($participant) {
return $participant->id;
}
+ /**
+ * @param null $event_cart
+ */
public function load_associations($event_cart = NULL) {
if ($this->assocations_loaded) {
return;
}
}
+ /**
+ * @return array
+ */
public function not_waiting_participants() {
$result = array();
foreach ($this->participants as $participant) {
return $result;
}
+ /**
+ * @return int
+ */
public function num_not_waiting_participants() {
return count($this->not_waiting_participants());
}
+ /**
+ * @return int
+ */
public function num_waiting_participants() {
return count($this->waiting_participants());
}
+ /**
+ * @param mixed $offset
+ *
+ * @return bool
+ */
public function offsetExists($offset) {
return array_key_exists(array_merge($this->fields(), array('main_conference_event_id')), $offset);
}
+ /**
+ * @param mixed $offset
+ *
+ * @return int
+ */
public function offsetGet($offset) {
if ($offset == 'event') {
return $this->event->toArray();
return $fields[$offset];
}
+ /**
+ * @param mixed $offset
+ * @param mixed $value
+ */
public function offsetSet($offset, $value) {}
+ /**
+ * @param mixed $offset
+ */
public function offsetUnset($offset) {}
+ /**
+ * @return array
+ */
public function waiting_participants() {
$result = array();
foreach ($this->participants as $participant) {
return $result;
}
+ /**
+ * @param $event_id
+ *
+ * @return array
+ */
static function get_registration_link($event_id) {
$cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
$cart->load_associations();
}
}
+ /**
+ * @return bool
+ */
function is_parent_event() {
return (NULL !== (CRM_Event_BAO_Event::get_sub_events($this->event_id)));
}
+ /**
+ * @param null $parent_event_id
+ *
+ * @return bool
+ */
function is_child_event($parent_event_id = NULL) {
if ($parent_event_id == NULL) {
return $this->event->parent_event_id;
+--------------------------------------------------------------------+
*/
+/**
+ * Class CRM_Event_Cart_BAO_MerParticipant
+ */
class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant {
public $email = NULL;
public $contribution_id = NULL;
public $cart = NULL;
//XXX
+ /**
+ * @param null $participant
+ */
function __construct($participant = NULL) {
parent::__construct();
$a = (array)$participant;
$this->email = CRM_Utils_Array::value('email', $participant);
}
+ /**
+ * @param array $params
+ *
+ * @return CRM_Event_Cart_BAO_MerParticipant
+ * @throws Exception
+ */
public static function &create($params) {
$participantParams = array(
'id' => CRM_Utils_Array::value('id', $params),
return $mer_participant;
}
+ /**
+ * @return mixed
+ */
static function get_attendee_role_id() {
$roles = CRM_Event_PseudoConstant::participantRole(NULL, "v.label='Attendee'");
$role_names = array_keys($roles);
return end($role_names);
}
+ /**
+ * @return mixed
+ */
static function get_pending_in_cart_status_id() {
$status_types = CRM_Event_PseudoConstant::participantStatus(NULL, "name='Pending in cart'");
$status_names = array_keys($status_types);
return end($status_names);
}
+ /**
+ * @param $event_cart_id
+ *
+ * @return array|null
+ */
public static function find_all_by_cart_id($event_cart_id) {
if ($event_cart_id == NULL) {
return NULL;
return self::find_all_by_params(array('cart_id' => $event_cart_id));
}
+ /**
+ * @param $event_id
+ * @param $event_cart_id
+ *
+ * @return array|null
+ */
public static function find_all_by_event_and_cart_id($event_id, $event_cart_id) {
if ($event_cart_id == NULL) {
return NULL;
return self::find_all_by_params(array('event_id' => $event_id, 'cart_id' => $event_cart_id));
}
+ /**
+ * @param $params
+ *
+ * @return array
+ */
public static function find_all_by_params($params) {
$participant = new CRM_Event_BAO_Participant();
$participant->copyValues($params);
return $result;
}
+ /**
+ * @param $id
+ *
+ * @return mixed
+ */
public static function get_by_id($id) {
$results = self::find_all_by_params(array('id' => $id));
return array_pop($results);
$this->email = $contact_details[1];
}
+ /**
+ * @return int
+ */
function get_participant_index() {
if (!$this->cart) {
$this->cart = CRM_Event_Cart_BAO_Cart::find_by_id($this->cart_id);
return $index + 1;
}
+ /**
+ * @param $contact
+ *
+ * @return null
+ */
static function billing_address_from_contact($contact) {
foreach ($contact->address as $loc) {
if ($loc['is_billing']) {
return NULL;
}
+ /**
+ * @return CRM_Event_Cart_Form_MerParticipant
+ */
function get_form() {
return new CRM_Event_Cart_Form_MerParticipant($this);
}
<?php
+
+/**
+ * Class CRM_Event_Cart_Controller_Checkout
+ */
class CRM_Event_Cart_Controller_Checkout extends CRM_Core_Controller {
+ /**
+ * @param null $title
+ * @param bool|int $action
+ * @param bool $modal
+ */
function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
parent::__construct($title, $modal);
<?php
+
+/**
+ * Class CRM_Event_Cart_Form_Cart
+ */
class CRM_Event_Cart_Form_Cart extends CRM_Core_Form {
public $cart;
}
}
+ /**
+ * @param $event_id
+ *
+ * @return bool|int|null|string
+ */
function checkEventCapacity($event_id) {
$empty_seats = CRM_Event_BAO_Participant::eventFull($event_id, TRUE);
if (is_numeric($empty_seats)) {
}
}
+ /**
+ * @return bool
+ */
static function is_administrator() {
global $user;
return CRM_Core_Permission::check('administer CiviCRM');
}
+ /**
+ * @return mixed
+ */
function getContactID() {
//XXX when do we query 'cid' ?
$tempID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
return $session->get('userID');
}
+ /**
+ * @param $fields
+ *
+ * @return mixed|null
+ */
static function find_contact($fields) {
$dedupe_params = CRM_Dedupe_Finder::formatParams($fields, 'Individual');
$dedupe_params['check_permission'] = FALSE;
else return NULL;
}
+ /**
+ * @param null $registeringContactID
+ * @param array $fields
+ *
+ * @return int|mixed|null
+ */
static function find_or_create_contact($registeringContactID = NULL, $fields = array(
)) {
$contact_id = self::find_contact($fields);
return $contact_id;
}
+ /**
+ * @param $page_name
+ *
+ * @return mixed
+ */
function getValuesForPage($page_name) {
$container = $this->controller->container();
return $container['values'][$page_name];
<?php
+
+/**
+ * Class CRM_Event_Cart_Form_Checkout_ConferenceEvents
+ */
class CRM_Event_Cart_Form_Checkout_ConferenceEvents extends CRM_Event_Cart_Form_Cart {
public $conference_event = NULL;
public $events_by_slot = array();
<?php
+
+/**
+ * Class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices
+ */
class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_Form_Cart {
public $price_fields_for_event;
public $_values = NULL;
}
}
+ /**
+ * @param $contact
+ *
+ * @return null
+ */
static function primary_email_from_contact($contact) {
foreach ($contact->email as $email) {
if ($email['is_primary']) {
return NULL;
}
+ /**
+ * @param $event
+ *
+ * @return array
+ */
function build_price_options($event) {
$price_fields_for_event = array();
$base_field_name = "event_{$event->id}_amount";
return $price_fields_for_event;
}
+ /**
+ * @return bool
+ */
function validate() {
parent::validate();
if ($this->_errors) {
return empty($this->_errors);
}
+ /**
+ * @return array
+ */
public function setDefaultValues() {
$this->loadCart();
<?php
+
+/**
+ * Class CRM_Event_Cart_Form_Checkout_Payment
+ */
class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
public $all_participants;
public $financial_type_id;
public $is_pay_later = FALSE;
public $pay_later_receipt;
+ /**
+ * @param $params
+ * @param $participant
+ * @param $event
+ *
+ * @return mixed
+ */
function registerParticipant($params, &$participant, $event) {
$transaction = new CRM_Core_Transaction();
}
}
+ /**
+ * @param $event_in_cart
+ * @param null $class
+ */
function process_event_line_item(&$event_in_cart, $class = NULL) {
$cost = 0;
$price_set_id = CRM_Price_BAO_PriceSet::getFor("civicrm_event", $event_in_cart->event_id);
$this->add_line_item($event_in_cart, $class);
}
+ /**
+ * @param $event_in_cart
+ * @param null $class
+ */
function add_line_item($event_in_cart, $class = NULL) {
$amount = 0;
$cost = 0;
$this->sub_total += $amount;
}
+ /**
+ * @return mixed
+ */
function getDefaultFrom() {
$values = CRM_Core_OptionGroup::values('from_email_address');
return $values[1];
}
+ /**
+ * @param $events_in_cart
+ * @param $params
+ */
function emailReceipt($events_in_cart, $params) {
$contact_details = CRM_Contact_BAO_Contact::getContactDetails($this->payer_contact_id);
$state_province = new CRM_Core_DAO_StateProvince();
CRM_Core_BAO_MessageTemplate::sendTemplate($send_template_params);
}
+ /**
+ * @param $fields
+ * @param $files
+ * @param $self
+ *
+ * @return array|bool
+ */
static function formRule($fields, $files, $self) {
$errors = array();
return empty($errors) ? TRUE : $errors;
}
+ /**
+ * @return bool
+ */
function validate() {
if ($this->is_pay_later) {
$this->_fields['credit_card_number']['is_required'] = FALSE;
$transaction->commit();
}
+ /**
+ * @param $params
+ *
+ * @return array
+ * @throws Exception
+ */
function make_payment(&$params) {
$config = CRM_Core_Config::singleton();
if (isset($params["billing_state_province_id-{$this->_bltID}"]) && $params["billing_state_province_id-{$this->_bltID}"]) {
return $trxnDetails;
}
+ /**
+ * @param $mer_participant
+ * @param $params
+ * @param $event
+ *
+ * @return object
+ * @throws Exception
+ */
function record_contribution(&$mer_participant, &$params, $event) {
if (self::is_administrator() && !empty($params['payment_type'])) {
$params['payment_instrument_id'] = $params['payment_type'];
$this->set('total', $this->total);
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
$defaults = parent::setDefaultValues();
<?php
+
+/**
+ * Class CRM_Event_Cart_Form_Checkout_ThankYou
+ */
class CRM_Event_Cart_Form_Checkout_ThankYou extends CRM_Event_Cart_Form_Cart {
public $line_items = NULL;
public $sub_total = 0;
<?php
+
+/**
+ * Class CRM_Event_Cart_Form_MerParticipant
+ */
class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form {
public $participant = NULL;
+ /**
+ * @param null|object $participant
+ */
function __construct($participant) {
parent::__construct();
//XXX
$this->participant = $participant;
}
+ /**
+ * @param $form
+ */
function appendQuickForm(&$form) {
$textarea_size = array('size' => 30, 'maxlength' => 60);
$form->add('text', $this->email_field_name(), ts('Email Address'), $textarea_size, TRUE);
)));
}
+ /**
+ * @param $event_id
+ *
+ * @return array
+ */
function get_profile_groups($event_id) {
$ufJoinParams = array(
'entity_table' => 'civicrm_event',
return $group_ids;
}
+ /**
+ * @return array
+ */
function get_participant_custom_data_fields() {
list($custom_pre_id, $custom_post_id) = self::get_profile_groups($this->participant->event_id);
return array($pre_fields, $post_fields);
}
+ /**
+ * @return string
+ */
function email_field_name() {
return $this->html_field_name("email");
}
+ /**
+ * @param $event_id
+ * @param $participant_id
+ * @param $field_name
+ *
+ * @return string
+ */
static function full_field_name($event_id, $participant_id, $field_name) {
return "event[$event_id][participant][$participant_id][$field_name]";
}
+ /**
+ * @param $field_name
+ *
+ * @return string
+ */
function html_field_name($field_name) {
return self::full_field_name($this->participant->event_id, $this->participant->id, $field_name);
}
+ /**
+ * @return string
+ */
function name() {
return "Participant {$this->participant->get_participant_index()}";
}
//XXX poor name
+ /**
+ * @param $participant
+ *
+ * @return CRM_Event_Cart_Form_MerParticipant
+ */
static public function get_form($participant) {
return new CRM_Event_Cart_Form_MerParticipant($participant);
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
$defaults = array(
$this->html_field_name('email') => $this->participant->email,
<?php
+
+/**
+ * Class CRM_Event_Cart_Page_AddToCart
+ */
class CRM_Event_Cart_Page_AddToCart extends CRM_Core_Page {
function run() {
$transaction = new CRM_Core_Transaction();
<?php
+
+/**
+ * Class CRM_Event_Cart_Page_CheckoutAJAX
+ */
class CRM_Event_Cart_Page_CheckoutAJAX {
function add_participant_to_cart() {
require 'CRM/Core/Transaction.php';
<?php
+
+/**
+ * Class CRM_Event_Cart_Page_RemoveFromCart
+ */
class CRM_Event_Cart_Page_RemoveFromCart extends CRM_Core_Page {
function run() {
$transaction = new CRM_Core_Transaction();
<?php
+
+/**
+ * Class CRM_Event_Cart_Page_ViewCart
+ */
class CRM_Event_Cart_Page_ViewCart extends CRM_Core_Page {
+ /**
+ * @return string
+ */
function run() {
$transaction = new CRM_Core_Transaction();
<?php
+
+/**
+ * Class CRM_Event_Cart_StateMachine_Checkout
+ */
class CRM_Event_Cart_StateMachine_Checkout extends CRM_Core_StateMachine {
+ /**
+ * @param object $controller
+ * @param const|int $action
+ */
function __construct($controller, $action = CRM_Core_Action::NONE) {
parent::__construct($controller, $action);
}
}
+ /**
+ * @return string
+ */
function getTemplateFileName() {
if ($this->controller->getPrint() || $this->getVar('_id') <= 0 || $this->_action & CRM_Core_Action::DELETE) {
return parent::getTemplateFileName();
* @return $defaults an array of custom data defaults.
*/
+ /**
+ * @param $templateId
+ *
+ * @return array
+ */
public function templateCustomDataValues($templateId) {
$defaults = array();
if (!$templateId) {
$form->addRule('confirm_from_email', ts('Email is not valid.'), 'email');
}
+ /**
+ * @param $form
+ */
function buildThankYouBlock(&$form) {
$attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event');
$attributes['thankyou_text']['click_wysiwyg'] = true;
*/
class CRM_Event_Form_ManageEvent_TabHeader {
+ /**
+ * @param $form
+ *
+ * @return array
+ */
static function build(&$form) {
$tabs = $form->get('tabHeader');
if (!$tabs || empty($_GET['reset'])) {
return $tabs;
}
+ /**
+ * @param $form
+ *
+ * @return array
+ * @throws Exception
+ */
static function process(&$form) {
if ($form->getVar('_id') <= 0) {
return NULL;
$eventID = $form->getVar('_id');
if ($eventID) {
- // disable tabs based on their configuration status
+ // disable tabs based on their configuration status
$sql = "
SELECT e.loc_block_id as is_location, e.is_online_registration, e.is_monetary, taf.is_active, pcp.is_active as is_pcp, sch.id as is_reminder
FROM civicrm_event e
return $tabs;
}
+ /**
+ * @param $form
+ */
static function reset(&$form) {
$tabs = self::process($form);
$form->set('tabHeader', $tabs);
}
+ /**
+ * @param $tabs
+ *
+ * @return int|string
+ */
static function getCurrentTab($tabs) {
static $current = FALSE;
$this->addFormRule(array('CRM_Event_Form_ParticipantFeeSelection', 'formRule'), $this);
}
+ /**
+ * @param $fields
+ * @param $files
+ * @param $self
+ *
+ * @return array
+ */
static function formRule($fields, $files, $self) {
$errors = array();
return $errors;
}
}
+ /**
+ * @param $params
+ *
+ * @return mixed
+ */
function emailReceipt(&$params) {
$updatedLineItem = CRM_Price_BAO_LineItem::getLineItems($this->_participantId, 'participant', NULL, FALSE);
$lineItem = array();
}
}
+ /**
+ * @param $form
+ * @param $eventID
+ *
+ * @throws Exception
+ */
static function initEventFee(&$form, $eventID) {
// get price info
* @return $totalCount total participant count.
* @access public
*/
+ /**
+ * @param $form
+ * @param $params
+ * @param bool $skipCurrent
+ *
+ * @return int|string
+ */
public static function getParticipantCount(&$form, $params, $skipCurrent = FALSE) {
$totalCount = 0;
if (!is_array($params) || empty($params)) {
* @return array $formatted, formatted price set params.
* @access public
*/
+ /**
+ * @param $form
+ * @param $params
+ *
+ * @return mixed
+ */
public static function formatPriceSetParams(&$form, $params) {
if (!is_array($params) || empty($params)) {
return $params;
* @return array $optionsCount, array of each option w/ count total.
* @access public
*/
+ /**
+ * @param $form
+ *
+ * @return array
+ */
public static function getPriceSetOptionCount(&$form) {
$params = $form->get('params');
$priceSet = $form->get('priceSet');
return $optionsCount;
}
+ /**
+ * @param string $suffix
+ *
+ * @return null|string
+ */
function checkTemplateFileExists($suffix = '') {
if ($this->_eventId) {
$templateName = $this->_name;
return NULL;
}
+ /**
+ * @return null|string
+ */
function getTemplateFileName() {
$fileName = $this->checkTemplateFileExists();
return $fileName ? $fileName : parent::getTemplateFileName();
}
+ /**
+ * @return null|string
+ */
function overrideExtraTemplateFileName() {
$fileName = $this->checkTemplateFileExists('extra.');
return $fileName ? $fileName : parent::overrideExtraTemplateFileName();
}
// set the first participant ID if not set, CRM-10032
+ /**
+ * @param $participantID
+ */
function processFirstParticipant($participantID) {
$this->_participantId = $participantID;
$this->set('participantId', $this->_participantId);
return $errors;
}
+ /**
+ * @param $self
+ * @param $fields
+ *
+ * @return bool
+ */
function validatePaymentValues($self, $fields) {
if (!empty($self->_params[0]['bypass_payment']) ||
}
}
+ /**
+ * @param $additionalParticipant
+ *
+ * @return array
+ */
public static function &getPages($additionalParticipant) {
$details = array();
for ($i = 1; $i <= $additionalParticipant; $i++) {
}
}
+ /**
+ * @param $elementName
+ * @param array $optionIds
+ */
function resetSubmittedValue($elementName, $optionIds = array(
)) {
if (empty($elementName) ||
return $contactID;
}
+ /**
+ * @param $form
+ */
public static function assignProfiles(&$form) {
$addParticipantProfile = $form->get('addParticipantProfile');
$primaryParticipantProfile = $form->get('primaryParticipantProfile');
}
}
+ /**
+ * @param $form
+ */
public static function formatFieldsForOptionFull(&$form) {
$priceSet = $form->get('priceSet');
$priceSetId = $form->get('priceSetId');
* access public
*
*/
+ /**
+ * @param $params
+ * @param null $contactID
+ */
public function processRegistration($params, $contactID = NULL) {
$session = CRM_Core_Session::singleton();
$this->_participantInfo = array();
}
}
+ /**
+ * @return null
+ */
function getFormValues() {
return NULL;
}
*/
class CRM_Event_Form_SearchEvent extends CRM_Core_Form {
+ /**
+ * @return array
+ */
function setDefaultValues() {
$defaults = array();
$defaults['eventsByDates'] = 0;
self::preProcessCommon($this);
}
+ /**
+ * @param $form
+ * @param bool $useTable
+ */
static function preProcessCommon(&$form, $useTable = FALSE) {
$form->_participantIds = array();
}
//end of function
+ /**
+ * @param $participantId
+ * @param $statusId
+ *
+ * @return Ambigous|void
+ */
static function updatePendingOnlineContribution($participantId, $statusId) {
if (!$participantId || !$statusId) {
return;
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
+
+/**
+ * Class CRM_Event_Import_Field
+ */
class CRM_Event_Import_Field {
/**#@+
* @var object
*/
public $_value;
+
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ */
function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') {
$this->_name = $name;
$this->_title = $title;
$this->_value = $value;
}
+ /**
+ * @return bool
+ */
function validate() {
if (CRM_Utils_System::isNull($this->_value)) {
return TRUE;
*/
protected $_haveColumnHeader;
+ /**
+ * @param $fileName
+ * @param string $seperator
+ * @param $mapper
+ * @param bool $skipColumnHeader
+ * @param int $mode
+ * @param int $contactType
+ * @param int $onDuplicate
+ *
+ * @return mixed
+ * @throws Exception
+ */
function run($fileName,
$seperator = ',',
&$mapper,
return $params;
}
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ */
function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') {
if (empty($name)) {
$this->_fields['doNotImport'] = new CRM_Event_Import_Field($name, $title, $type, $headerPattern, $dataPattern);
protected $keyword = 'event';
// docs inherited from interface
+ /**
+ * @return array
+ */
public function getInfo() {
return array(
'name' => 'CiviEvent',
}
// docs inherited from interface
+ /**
+ * @param bool $getAllUnconditionally
+ *
+ * @return array
+ */
public function getPermissions($getAllUnconditionally = FALSE) {
return array(
'access CiviEvent',
);
}
+ /**
+ * @return array
+ */
public function getAnonymousPermissionWarnings() {
return array(
'access CiviEvent',
}
// docs inherited from interface
+ /**
+ * @return array
+ */
public function getUserDashboardElement() {
return array('name' => ts('Events'),
'title' => ts('Your Event(s)'),
}
// docs inherited from interface
+ /**
+ * @return array
+ */
public function registerTab() {
return array('title' => ts('Events'),
'id' => 'participant',
}
// docs inherited from interface
+ /**
+ * @return array
+ */
public function registerAdvancedSearchPane() {
return array('title' => ts('Events'),
'weight' => 40,
}
// docs inherited from interface
+ /**
+ * @return array
+ */
public function getActivityTypes() {
$types = array();
$types['Event'] = array('title' => ts('Event'),
}
// add shortcut to Create New
+ /**
+ * @param $shortCuts
+ * @param $newCredit
+ */
public function creatNewShortcut(&$shortCuts, $newCredit) {
if (CRM_Core_Permission::check('access CiviEvent') &&
CRM_Core_Permission::check('edit event participants')
// 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;
+ $adminFieldVisible = true;
}
foreach ($priceSetFields as $fid => $fieldValues) {
return parent::run();
}
+ /**
+ * @return string
+ */
function getTemplateFileName() {
if ($this->_id) {
$templateFile = "CRM/Event/Page/{$this->_id}/EventInfo.tpl";
$form->run();
}
+ /**
+ * @param $params
+ * @param bool $sortBy
+ * @param $force
+ *
+ * @return string
+ */
function whereClause(&$params, $sortBy = TRUE, $force) {
$values = array();
$clauses = array();
return !empty($clauses) ? implode(' AND ', $clauses) : '(1)';
}
+ /**
+ * @param $whereClause
+ * @param $whereParams
+ */
function pager($whereClause, $whereParams) {
$params['status'] = ts('Event %%StatusMessage%%');
$this->assign_by_ref('pager', $this->_pager);
}
+ /**
+ * @param $whereClause
+ * @param $whereParams
+ */
function pagerAtoZ($whereClause, $whereParams) {
$query = "
$this->assign('displayRecent', FALSE);
}
+ /**
+ * @return string
+ */
function run() {
$this->preProcess();
return parent::run();
}
+ /**
+ * @param $fromClause
+ * @param $whereClause
+ * @param $whereParams
+ */
function pager($fromClause, $whereClause, $whereParams) {
$params = array();
$this->assign_by_ref('pager', $this->_pager);
}
+ /**
+ * @return string
+ */
function orderBy() {
static $headers = NULL;
if (!$headers) {
$this->assign('displayRecent', FALSE);
}
+ /**
+ * @return string
+ */
function run() {
$this->preProcess();
return parent::run();
}
+ /**
+ * @param $fromClause
+ * @param $whereClause
+ * @param $whereParams
+ */
function pager($fromClause, $whereClause, $whereParams) {
$params = array();
$this->assign_by_ref('pager', $this->_pager);
}
+ /**
+ * @return string
+ */
function orderBy() {
static $headers = NULL;
if (!$headers) {
return self::$_columnHeaders;
}
+ /**
+ * @return mixed
+ */
function alphabetQuery() {
return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE);
}
+ /**
+ * @return string
+ */
function &getQuery() {
return $this->_query;
}