* @param int $id
* The event id to copy.
* boolean $afterCreate call to copy after the create function
- *
+ * @param array $params
* @return CRM_Event_DAO_Event
* @throws \CRM_Core_Exception
*/
'participantID' => $participantId,
'conference_sessions' => $sessions,
'credit_card_number' =>
- CRM_Utils_System::mungeCreditCard(
+ CRM_Utils_System::mungeCreditCard(
CRM_Utils_Array::value('credit_card_number', $participantParams)),
'credit_card_exp_date' =>
- CRM_Utils_Date::mysqlToIso(
+ CRM_Utils_Date::mysqlToIso(
CRM_Utils_Date::format(
CRM_Utils_Array::value('credit_card_exp_date', $participantParams))),
]);
}
$values[$index] = implode(', ', $title);
}
- elseif ('participant_role_id' == $name OR
+ elseif ('participant_role_id' == $name or
'participant_role' == $name
) {
$roles = CRM_Event_PseudoConstant::participantRole();
$values[$index] = $roles[$params[$name]];
}
- elseif ('participant_status_id' == $name OR
+ elseif ('participant_status_id' == $name or
'participant_status' == $name
) {
$status = CRM_Event_PseudoConstant::participantStatus();
* @return boolean
* true if allow registration otherwise false
*/
+
/**
* @param $values
*
* Key/value participant info.
* @return boolean
*/
+
/**
* @param array $params
*
*
* @var array
*/
- static $_importableFields = NULL;
+ public static $_importableFields = NULL;
/**
* Static field for all the participant information that we can potentially export.
*
* @var array
*/
- static $_exportableFields = NULL;
+ public static $_exportableFields = NULL;
/**
* Static array for valid status transitions rules.
*
* @var array
*/
- static $_statusTransitionsRules = [
+ public static $_statusTransitionsRules = [
'Pending from pay later' => ['Registered', 'Cancelled'],
'Pending from incomplete transaction' => ['Registered', 'Cancelled'],
'On waitlist' => ['Cancelled', 'Pending from waitlist'],
$noteValue = NULL;
$hasNoteField = FALSE;
foreach ([
- 'note',
- 'participant_note',
- ] as $noteFld) {
+ 'note',
+ 'participant_note',
+ ] as $noteFld) {
if (array_key_exists($noteFld, $params)) {
$noteValue = $params[$noteFld];
$hasNoteField = TRUE;
if (is_string($emptySeats) && $emptySeats !== NULL) {
$maxParticipants = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $eventId, 'max_participants');
$eventfullMsg = ts("This event currently has the maximum number of participants registered (%1). However, you can still override this limit and register additional participants using this form.", [
- 1 => $maxParticipants,
- ]) . '<br />';
+ 1 => $maxParticipants,
+ ]) . '<br />';
}
$hasWaiting = FALSE;
//generally if people are creating participant_payments via the api they won't be setting the line item correctly - we can't help them if they are doing complex transactions
// but if they have a single line item for the contribution we can assume it should refer to the participant line
$lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", [
- 1 => [
- $participantPayment->contribution_id,
- 'Integer',
- ],
- ]);
+ 1 => [
+ $participantPayment->contribution_id,
+ 'Integer',
+ ],
+ ]);
if ($lineItemCount == 1) {
$sql = "UPDATE civicrm_line_item li
SET entity_table = 'civicrm_participant', entity_id = %1
WHERE contribution_id = %2 AND entity_table = 'civicrm_contribution'";
CRM_Core_DAO::executeQuery($sql, [
- 1 => [$participantPayment->participant_id, 'Integer'],
- 2 => [$participantPayment->contribution_id, 'Integer'],
- ]);
+ 1 => [$participantPayment->participant_id, 'Integer'],
+ 2 => [$participantPayment->contribution_id, 'Integer'],
+ ]);
}
return $participantPayment;
*
*/
class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatusType {
+
/**
* @param array $params
*
}
}
-
/**
* @param $query
*/
'participant_is_pay_later',
'participant_campaign_id',
'participant_registered_by_id',
- ])
- ) {
+ ])) {
$name = str_replace('participant_', '', $name);
if ($name == 'is_pay_later') {
$qillName = $name;
case 'event_title':
$qillName = $name;
if (in_array($name, [
- 'event_id',
- 'event_title',
- 'event_is_public',
- ]
- )
- ) {
+ 'event_id',
+ 'event_title',
+ 'event_is_public',
+ ])) {
$name = str_replace('event_', '', $name);
}
$dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type::typeToString($fields[$qillName]['type']) : 'String';
$form->assign('dataURLEventFee', $dataURLEventFee);
$form->addEntityRef('event_id', ts('Event Name'), [
- 'entity' => 'Event',
- 'placeholder' => ts('- any -'),
- 'multiple' => 1,
- 'select' => ['minimumInputLength' => 0],
- ]
- );
+ 'entity' => 'Event',
+ 'placeholder' => ts('- any -'),
+ 'multiple' => 1,
+ 'select' => ['minimumInputLength' => 0],
+ ]);
$form->addEntityRef('event_type_id', ts('Event Type'), [
- 'entity' => 'OptionValue',
- 'placeholder' => ts('- any -'),
- 'select' => ['minimumInputLength' => 0],
- 'api' => [
- 'params' => ['option_group_id' => 'event_type'],
- ],
- ]
- );
+ 'entity' => 'OptionValue',
+ 'placeholder' => ts('- any -'),
+ 'select' => ['minimumInputLength' => 0],
+ 'api' => [
+ 'params' => ['option_group_id' => 'event_type'],
+ ],
+ ]);
$obj = new CRM_Report_Form_Event_ParticipantListing();
$form->add('select', 'participant_fee_id',
ts('Fee Level'),
*
*/
class CRM_Event_Badge {
+
/**
*/
public function __construct() {
$y = $this->pdf->GetY();
if ($this->debug) {
$this->pdf->Rect($x, $y, $this->pdf->width, $this->pdf->height, 'D', [
- 'all' => [
- 'width' => 1,
- 'cap' => 'round',
- 'join' => 'round',
- 'dash' => '2,10',
- 'color' => [255, 0, 0],
- ],
- ]);
+ 'all' => [
+ 'width' => 1,
+ 'cap' => 'round',
+ 'join' => 'round',
+ 'dash' => '2,10',
+ 'color' => [255, 0, 0],
+ ],
+ ]);
}
$img = $this->getImageFileName($this->event->id, $img);
if ($img) {
* Class CRM_Event_Badge_Logo
*/
class CRM_Event_Badge_Logo extends CRM_Event_Badge {
+
/**
*/
public function __construct() {
$y = $this->pdf->GetY();
$this->printBackground(TRUE);
$this->pdf->SetLineStyle([
- 'width' => 0.1,
- 'cap' => 'round',
- 'join' => 'round',
- 'dash' => '2,2',
- 'color' => [0, 0, 200],
- ]);
+ 'width' => 0.1,
+ 'cap' => 'round',
+ 'join' => 'round',
+ 'dash' => '2,2',
+ 'color' => [0, 0, 200],
+ ]);
$this->pdf->SetFontSize(8);
$this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y);
* Class CRM_Event_Badge_Logo5395
*/
class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge {
+
/**
*/
public function __construct() {
$y = $this->pdf->GetY();
$this->printBackground(TRUE);
$this->pdf->SetLineStyle([
- 'width' => 0.1,
- 'cap' => 'round',
- 'join' => 'round',
- 'dash' => '2,2',
- 'color' => [0, 0, 200],
- ]);
+ 'width' => 0.1,
+ 'cap' => 'round',
+ 'join' => 'round',
+ 'dash' => '2,2',
+ 'color' => [0, 0, 200],
+ ]);
$this->pdf->SetFontSize(9);
$this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y);
*
*/
class CRM_Event_Badge_NameTent extends CRM_Event_Badge {
+
/**
*/
public function __construct() {
*/
class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart {
public $associations_loaded = FALSE;
- /* event_in_cart_id => $event_in_cart */
+ /**
+ * event_in_cart_id => $event_in_cart
+ * @var array
+ */
public $events_in_carts = [];
/**
return $values;
}
-
/**
* @param int $from_cart_id
*/
* 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
return count($this->waiting_participants());
}
-
/**
* @param mixed $offset
*
* Class CRM_Event_Cart_Controller_Checkout
*/
class CRM_Event_Cart_Controller_Checkout extends CRM_Core_Controller {
+
/**
* @param null $title
* @param bool|int $action
if (array_key_exists($participant->status_id, $statusTypes)) {
$form = $mer_participant->get_form();
$this->_errors[$form->html_field_name('email')] = ts("The participant %1 is already registered for %2 (%3).", [
- 1 => $participant_fields['email'],
- 2 => $event_in_cart->event->title,
- 3 => $event_in_cart->event->start_date,
- ]);
+ 1 => $participant_fields['email'],
+ 2 => $event_in_cart->event->title,
+ 3 => $event_in_cart->event->start_date,
+ ]);
}
}
}
*
* @return CRM_Event_Cart_Form_MerParticipant
*/
- static public function get_form($participant) {
+ public static function get_form($participant) {
return new CRM_Event_Cart_Form_MerParticipant($participant);
}
* Class CRM_Event_Cart_Page_AddToCart
*/
class CRM_Event_Cart_Page_AddToCart extends CRM_Core_Page {
+
/**
* This function takes care of all the things common to all pages.
*
$url = CRM_Utils_System::url('civicrm/event/view_cart');
CRM_Utils_System::setUFMessage(ts("<b>%1</b> has been added to your cart. <a href='%2'>View your cart.</a>", [
- 1 => $event_in_cart->event->title,
- 2 => $url,
- ]));
+ 1 => $event_in_cart->event->title,
+ 2 => $url,
+ ]));
$transaction->commit();
* Class CRM_Event_Cart_Page_CheckoutAJAX
*/
class CRM_Event_Cart_Page_CheckoutAJAX {
+
public function add_participant_to_cart() {
$transaction = new CRM_Core_Transaction();
$cart_id = CRM_Utils_Request::retrieve('cart_id', 'Integer');
* Class CRM_Event_Cart_Page_RemoveFromCart
*/
class CRM_Event_Cart_Page_RemoveFromCart extends CRM_Core_Page {
+
/**
* This function takes care of all the things common to all pages.
*
* Class CRM_Event_Cart_Page_ViewCart
*/
class CRM_Event_Cart_Page_ViewCart extends CRM_Core_Page {
+
/**
* @return string
*/
* Class CRM_Event_Cart_StateMachine_Checkout
*/
class CRM_Event_Cart_StateMachine_Checkout extends CRM_Core_StateMachine {
+
/**
* @param object $controller
* @param const|int $action
$contribution->id = $contriId;
$contribution->find(TRUE);
foreach ([
- 'financial_type_id',
- 'payment_instrument_id',
- 'contribution_status_id',
- 'receive_date',
- 'total_amount',
- ] as $f) {
+ 'financial_type_id',
+ 'payment_instrument_id',
+ 'contribution_status_id',
+ 'receive_date',
+ 'total_amount',
+ ] as $f) {
$defaults[$form->_pId][$f] = $contribution->$f;
}
}
/**
* The campaign id of the existing event, we use this to know if we need to update
* the participant records
+ * @var int
*/
protected $_campaignID = NULL;
/**
* Check if repeating event.
+ * @var bool
*/
public $_isRepeatingEvent;
/**
* Page action.
+ * @var int
*/
public $_action;
);
$this->addEntityRef('parent_event_id', ts('Parent Event'), [
- 'entity' => 'Event',
- 'placeholder' => ts('- any -'),
- 'select' => ['minimumInputLength' => 0],
- ]
- );
+ 'entity' => 'Event',
+ 'placeholder' => ts('- any -'),
+ 'select' => ['minimumInputLength' => 0],
+ ]);
parent::buildQuickForm();
}
/**
* Event type.
+ * @var int
*/
protected $_eventType = NULL;
/**
* Page action.
+ * @var int
*/
public $_action;
/**
* In Date.
+ * @var string
*/
private $_inDate;
/**
* Get the db values for this form.
+ * @var array
*/
public $_values = [];
$defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
foreach ([
- 'address',
- 'phone',
- 'email',
- ] as $block) {
+ 'address',
+ 'phone',
+ 'email',
+ ] as $block) {
if (empty($params[$block]) || !is_array($params[$block])) {
continue;
}
];
$configs['allowCoreTypes'] = array_merge([
- 'Contact',
- 'Individual',
- ], CRM_Contact_BAO_ContactType::subTypes('Individual'));
+ 'Contact',
+ 'Individual',
+ ], CRM_Contact_BAO_ContactType::subTypes('Individual'));
$configs['allowCoreTypes'][] = 'Participant';
if (CRM_Core_Permission::check('manage event profiles') && !CRM_Core_Permission::check('administer CiviCRM')) {
$configs['usedFor'][] = 'CiviEvent';
// format params
$params['is_online_registration'] = CRM_Utils_Array::value('is_online_registration', $params, FALSE);
- $params['is_confirm_enabled'] = CRM_Utils_Array::value('is_confirm_enabled', $params, FALSE); // CRM-11182
+ // CRM-11182
+ $params['is_confirm_enabled'] = CRM_Utils_Array::value('is_confirm_enabled', $params, FALSE);
$params['is_multiple_registrations'] = CRM_Utils_Array::value('is_multiple_registrations', $params, FALSE);
$params['allow_same_participant_emails'] = CRM_Utils_Array::value('allow_same_participant_emails', $params, FALSE);
$params['requires_approval'] = CRM_Utils_Array::value('requires_approval', $params, FALSE);
/**
* Parent Event Start Date.
+ * @var string
*/
protected $_parentEventStartDate = NULL;
/**
* Parent Event End Date.
+ * @var string
*/
protected $_parentEventEndDate = NULL;
-
public function preProcess() {
parent::preProcess();
$this->assign('selectedChild', 'repeat');
*
* @return array
*/
- static public function getParticipantCountforEvent($listOfRelatedEntities = []) {
+ public static function getParticipantCountforEvent($listOfRelatedEntities = []) {
$participantDetails = [];
if (!empty($listOfRelatedEntities)) {
$implodeRelatedEntities = implode(',', array_map(function ($entity) {
* This function checks if there was any registration for related event ids,
* and returns array of ids with no registrations
*
- * @param string or int or object... $eventID
+ * @param mixed $eventID string, int or object
*
* @return array
*/
protected $_noteId = NULL;
/**
- * @deprecated
*
* Use parent $this->contactID
*
* The id of the contact associated with this participation.
*
* @var int
+ * @deprecated
*/
public $_contactId;
/**
* If event is paid or unpaid.
+ * @var bool
*/
public $_isPaidEvent;
/**
* Page action.
+ * @var int
*/
public $_action;
/**
* Role Id.
+ * @var int
*/
protected $_roleId = NULL;
/**
* Event Type Id.
+ * @var int
*/
protected $_eventTypeId = NULL;
/**
* Participant status Id.
+ * @var int
*/
protected $_statusId = NULL;
/**
* Cache all the participant statuses.
+ * @var array
*/
protected $_participantStatuses;
/**
* Participant mode.
+ * @var string
*/
public $_mode = NULL;
/**
* Event ID preselect.
+ * @var int
*/
public $_eID = NULL;
/**
* Line Item for Price Set.
+ * @var array
*/
public $_lineItem = NULL;
/**
* Contribution mode for event registration for offline mode.
- *
+ * @var string
* @deprecated
*/
public $_contributeMode = 'direct';
/**
* Store id of role custom data type ( option value )
+ * @var int
*/
protected $_roleCustomDataTypeID;
/**
* Store id of event Name custom data type ( option value)
+ * @var int
*/
protected $_eventNameCustomDataTypeID;
/**
* Selected discount id.
+ * @var int
*/
public $_originalDiscountId = NULL;
/**
* Event id.
+ * @var int
*/
public $_eventId = NULL;
/**
* Id of payment, if any
+ * @var int
*/
public $_paymentId = NULL;
/**
- * @todo add explanatory note about this
* @var null
+ * @todo add explanatory note about this
*/
public $_onlinePendingContributionId = NULL;
}
}
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => ts('Delete'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Delete'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
return;
}
if ($this->_single && $this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), [
- 'create' => TRUE,
- 'api' => ['extra' => ['email']],
- ], TRUE);
+ 'create' => TRUE,
+ 'api' => ['extra' => ['email']],
+ ], TRUE);
}
$eventFieldParams = [
}
$this->addSelect('status_id', $checkCancelledJs + [
- 'options' => $statusOptions,
- 'option_url' => 'civicrm/admin/participant_status',
- ], TRUE);
+ 'options' => $statusOptions,
+ 'option_url' => 'civicrm/admin/participant_status',
+ ], TRUE);
$this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL);
// set source if not set
if (empty($params['source'])) {
$this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', [
- 1 => $userName,
- 2 => $eventTitle,
- ]);
+ 1 => $userName,
+ 2 => $eventTitle,
+ ]);
}
else {
$this->_params['participant_source'] = $params['source'];
if (!$this->_onlinePendingContributionId) {
if (empty($params['source'])) {
$contributionParams['source'] = ts('%1 : Offline registration (by %2)', [
- 1 => $eventTitle,
- 2 => $userName,
- ]);
+ 1 => $eventTitle,
+ 2 => $userName,
+ ]);
}
else {
$contributionParams['source'] = $params['source'];
*/
public function buildQuickForm() {
$this->addButtons([
- [
- 'type' => 'cancel',
- 'name' => ts('Done'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ],
- ]
- );
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Done'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ],
+ ]);
}
}
public $_pcpId;
- /* Is event already full.
+ /**
+ * Is event already full.
*
* @var boolean
+ *
*/
+
public $_isEventFull;
public $_lineItem;
public $_forcePayement;
/**
+ * @var bool
* @deprecated
- *
- * @var
*/
public $_isBillingAddressRequiredForPayLater;
return;
}
foreach (array(
- 'constantValues',
- 'submitValues',
- 'defaultValues',
- ) as $val) {
+ 'constantValues',
+ 'submitValues',
+ 'defaultValues',
+ ) as $val) {
$values = $form->{"_$val"};
if (!is_array($values) || empty($values)) {
continue;
/**
* Pre-registered additional participant id.
+ * @var int
*/
public $additionalParticipantId = NULL;
$first_name = $last_name = NULL;
$pre = $post = [];
foreach ([
- 'pre',
- 'post',
- ] as $keys) {
+ 'pre',
+ 'post',
+ ] as $keys) {
if (isset($this->_values['additional_custom_' . $keys . '_id'])) {
$this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys));
$$keys = CRM_Core_BAO_UFGroup::getFields($this->_values['additional_custom_' . $keys . '_id']);
}
foreach ([
- 'first_name',
- 'last_name',
- ] as $name) {
+ 'first_name',
+ 'last_name',
+ ] as $name) {
if (array_key_exists($name, $$keys) &&
CRM_Utils_Array::value('is_required', CRM_Utils_Array::value($name, $$keys))
) {
$this->set('allowWaitlist', $this->_allowWaitlist);
if ($this->_requireApproval) {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Registration for this event requires approval. You will receive an email once your registration has been reviewed.", [
- 1 => ++$processedCnt,
- 2 => $spaces,
- ]);
+ 1 => ++$processedCnt,
+ 2 => $spaces,
+ ]);
}
else {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed).", [
- 1 => ++$processedCnt,
- 2 => $spaces,
- ]);
+ 1 => ++$processedCnt,
+ 2 => $spaces,
+ ]);
}
}
else {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Please go back to the main registration page and reduce the number of additional people. You will also need to complete payment information.", [
- 1 => ++$processedCnt,
- 2 => $spaces,
- ]);
+ 1 => ++$processedCnt,
+ 2 => $spaces,
+ ]);
$allowToProceed = FALSE;
}
CRM_Core_Session::setStatus($statusMessage, ts('Registration Error'), 'error');
//CRM-4320
if ($allowToProceed) {
$buttons = array_merge($buttons, [
- [
- 'type' => 'upload',
- 'name' => ts('Continue'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- 'js' => $js,
- ],
- ]
- );
+ [
+ 'type' => 'upload',
+ 'name' => ts('Continue'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ 'js' => $js,
+ ],
+ ]);
if ($includeSkipButton) {
$buttons = array_merge($buttons, [
- [
- 'type' => 'next',
- 'name' => ts('Skip Participant'),
- 'subName' => 'skip',
- 'icon' => 'fa-fast-forward',
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Skip Participant'),
+ 'subName' => 'skip',
+ 'icon' => 'fa-fast-forward',
+ ],
+ ]);
}
}
$this->addButtons($buttons);
$totalParticipants > $self->_availableRegistrations
) {
$errors['_qf_default'] = ts('Sorry, it looks like this event only has %2 spaces available, and you are trying to register %1 participants. Please change your selections accordingly.', [
- 1 => $totalParticipants,
- 2 => $self->_availableRegistrations,
- ]);
+ 1 => $totalParticipants,
+ 2 => $self->_availableRegistrations,
+ ]);
}
}
}
// Check whether to process the registration now, calling processRegistration()
if (
- !$this->_values['event']['is_confirm_enabled'] // CRM-11182 - Optional confirmation screen
+ // CRM-11182 - Optional confirmation screen
+ !$this->_values['event']['is_confirm_enabled']
&& !$this->_values['event']['is_monetary']
&& CRM_Utils_Array::value('additional_participants', $this->_params[0])
&& $this->isLastParticipant()
* These should get a standardised format in the beginPostProcess function.
*
* These fields are common to many forms. Some may override this.
+ * @var array
*/
protected $submittableMoneyFields = ['total_amount', 'net_amount', 'non_deductible_amount', 'fee_amount', 'tax_amount', 'amount'];
if (is_array($v)) {
$this->cleanMoneyFields($v);
foreach ([
- 'first_name',
- 'last_name',
- ] as $name) {
+ 'first_name',
+ 'last_name',
+ ] as $name) {
if (isset($v['billing_' . $name]) &&
!isset($v[$name])
) {
$contribButton = ts('Continue');
$this->addButtons([
- [
- 'type' => 'back',
- 'name' => ts('Go Back'),
- ],
- [
- 'type' => 'next',
- 'name' => $contribButton,
- 'isDefault' => TRUE,
- 'js' => ['onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');"],
- ],
- ]
- );
+ [
+ 'type' => 'back',
+ 'name' => ts('Go Back'),
+ ],
+ [
+ 'type' => 'next',
+ 'name' => $contribButton,
+ 'isDefault' => TRUE,
+ 'js' => ['onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');"],
+ ],
+ ]);
$defaults = [];
$fields = [];
*/
class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Registration {
// optional credit card return status code
- // CRM-6060
+ /**
+ * CRM-6060
+ * @var string
+ */
protected $_cc = NULL;
/**
else {
if ($this->_cc == 'fail') {
$statusMsg = '<div class="bold">' . ts('Your Credit Card transaction was not successful. No money has yet been charged to your card.') . '</div><div><br />' . ts('Click the "Confirm Registration" button to complete your registration in %1, or click "Cancel Registration" if you are no longer interested in attending this event.', [
- 1 => $values['title'],
- ]) . '</div>';
+ 1 => $values['title'],
+ ]) . '</div>';
}
else {
$statusMsg = '<div class="bold">' . ts('Confirm your registration for %1.', [
- 1 => $values['title'],
- ]) . '</div><div><br />' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '</div>';
+ 1 => $values['title'],
+ ]) . '</div><div><br />' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '</div>';
}
$buttons = array_merge($buttons, [
[
/**
* The fields involved in this page.
+ * @var array
*/
public $_fields;
/**
* The status message that user view.
+ * @var sting
*/
protected $_waitlistMsg = NULL;
protected $_requireApprovalMsg = NULL;
*
* This can be set using hook_civicrm_buildForm() to override the registration dupe check.
* CRM-7604
+ * @var bool
*/
public $_skipDupeRegistrationCheck = FALSE;
}
$this->addButtons([
- [
- 'type' => 'upload',
- 'name' => $buttonLabel,
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- 'js' => $js,
- ],
- ]
- );
+ [
+ 'type' => 'upload',
+ 'name' => $buttonLabel,
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ 'js' => $js,
+ ],
+ ]);
}
$this->addFormRule(['CRM_Event_Form_Registration_Register', 'formRule'], $this);
* @param int $discountId
* Discount id for the event.
*/
- static public function buildAmount(&$form, $required = TRUE, $discountId = NULL) {
+ public static function buildAmount(&$form, $required = TRUE, $discountId = NULL) {
// build amount only when needed, skip incase of event full and waitlisting is enabled
// and few other conditions check preProcess()
if (property_exists($form, '_noFees') && $form->_noFees) {
if (
empty($params['additional_participants'])
- && !$this->_values['event']['is_confirm_enabled'] // CRM-11182 - Optional confirmation screen
+ // CRM-11182 - Optional confirmation screen
+ && !$this->_values['event']['is_confirm_enabled']
) {
$this->processRegistration($this->_params);
}
/**
* Prefix for the controller.
+ * @var string
*/
protected $_prefix = "event_";
/**
* particpant values
*
- * @array string
+ * @var string
*/
protected $_part_values;
/**
* details
*
- * @array string
+ * @var array
*/
protected $_details = [];
/**
* line items
*
- * @array string
+ * @var array
*/
protected $_line_items = [];
/**
* contact_id
*
- * @array string
+ * @var int
*/
protected $contact_id;
/**
* Is backoffice form?
*
- * @array bool
+ * @var bool
*/
protected $isBackoffice = FALSE;
$query = "select event_id from civicrm_participant where contact_id = " . $contact_id;
$dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
- $to_event_id[] = $dao->event_id;
+ $to_event_id[] = $dao->event_id;
}
if (!empty($to_event_id)) {
foreach ($to_event_id as $id) {
/**
* Is backoffice form?
*
- * @array bool
+ * @var bool
*/
protected $isBackoffice = FALSE;
+
/**
* Set variables up before form is built based on participant ID from URL
*
// for self update (event.start_date > today, event can be 'self_updated'
// retrieve contact name and email, and let user verify his/her identity
}
+
/**
* buildQuickForm -populate input variables for source Event
* to cancel or transfer to another person
*/
public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
$this->addButtons([
- [
- 'type' => $nextType,
- 'name' => $title,
- 'isDefault' => TRUE,
- ],
- [
- 'type' => $backType,
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => $nextType,
+ 'name' => $title,
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => $backType,
+ 'name' => ts('Cancel'),
+ ],
+ ]);
}
}
$status = [
ts('%count contact added to group', [
- 'count' => $added,
- 'plural' => '%count contacts added to group',
+ 'count' => $added,
+ 'plural' => '%count contacts added to group',
]),
];
if ($notAdded) {
$status[] = ts('%count contact was already in group', [
- 'count' => $notAdded,
- 'plural' => '%count contacts were already in group',
- ]);
+ 'count' => $notAdded,
+ 'plural' => '%count contacts were already in group',
+ ]);
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts('Added Contact to %1', [
- 1 => $groupName,
- 'count' => $added,
- 'plural' => 'Added Contacts to %1',
- ]), 'success', ['expires' => 0]);
+ 1 => $groupName,
+ 'count' => $added,
+ 'plural' => 'Added Contacts to %1',
+ ]), 'success', ['expires' => 0]);
}
}
/**
* Component clause.
+ * @var string
*/
public $_componentClause;
/**
* Maximum profile fields that will be displayed.
+ * @var int
*/
protected $_maxFields = 9;
/**
* Variable to store redirect path.
+ * @var string
*/
protected $_userContext;
/**
* Variable to store previous status id.
+ * @var array
*/
protected $_fromStatusIds;
$this->_fields = array_slice($this->_fields, 0, $this->_maxFields);
$this->addButtons([
- [
- 'type' => 'submit',
- 'name' => ts('Update Participant(s)'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'submit',
+ 'name' => ts('Update Participant(s)'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
$this->assign('profileTitle', $this->_title);
$this->assign('componentIds', $this->_participantIds);
* @param int $participantId
* @param int $statusId
*
- * @return Ambigous|void
+ * @return mixed
*/
public static function updatePendingOnlineContribution($participantId, $statusId) {
if (!$participantId || !$statusId) {
//set values for ipn code.
foreach ([
- 'fee_amount',
- 'check_number',
- 'payment_instrument_id',
- ] as $field) {
+ 'fee_amount',
+ 'check_number',
+ 'payment_instrument_id',
+ ] as $field) {
if (!$input[$field] = CRM_Utils_Array::value($field, $params)) {
$input[$field] = $contribution->$field;
}
/**
* Variable to store redirect path.
+ * @var string
*/
protected $_userContext;
*
*/
class CRM_Event_Form_Task_ParticipantStatus extends CRM_Event_Form_Task_Batch {
+
public function buildQuickForm() {
// CRM_Event_Form_Task_Batch::buildQuickForm() gets ufGroupId
// from the form, so set it here to the id of the reserved profile
/**
* Maximum event participations that should be allowed to update.
+ * @var int
*/
protected $_maxParticipations = 100;
/**
* Variable to store redirect path.
+ * @var string
*/
protected $_userContext;
// just need to add a javacript to popup the window for printing
//
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => ts('Print Participant List'),
- 'js' => ['onclick' => 'window.print()'],
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'back',
- 'name' => ts('Done'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Print Participant List'),
+ 'js' => ['onclick' => 'window.print()'],
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'back',
+ 'name' => ts('Done'),
+ ],
+ ]);
}
/**
*/
public function buildQuickForm() {
$this->addButtons([
- [
- 'type' => 'done',
- 'name' => ts('Done'),
- 'isDefault' => TRUE,
- ],
- ]
- );
+ [
+ 'type' => 'done',
+ 'name' => ts('Done'),
+ 'isDefault' => TRUE,
+ ],
+ ]);
}
}
*/
class CRM_Event_Import_Field {
- /**#@+
+ /**
+ * #@+
* @var string
*/
/**
* Name of the field
+ * @var string
*/
public $_name;
/**
* Title of the field to be used in display
+ * @var string
*/
public $_title;
*/
class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
-
/**
* Set variables up before form is built.
*
$this->setDefaults($defaults);
$this->addButtons(array(
- array(
- 'type' => 'back',
- 'name' => ts('Previous'),
- ),
- array(
- 'type' => 'next',
- 'name' => ts('Continue'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'back',
+ 'name' => ts('Previous'),
+ ),
+ array(
+ 'type' => 'next',
+ 'name' => ts('Continue'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
/**
}
else {
$errors['_qf_default'] .= ts('Missing required contact matching fields.') . " $fieldMessage " . ts('(Sum of all weights should be greater than or equal to threshold: %1).', array(
- 1 => $threshold,
- )) . ' ' . ts('Or Provide Contact ID or External ID.') . '<br />';
+ 1 => $threshold,
+ )) . ' ' . ts('Or Provide Contact ID or External ID.') . '<br />';
}
}
elseif (!in_array('event_title', $importKeys)) {
protected $_fileName;
- /**#@+
+ /**
+ * #@+
* @var integer
*/
/**
* Imported file size
+ * @var int
*/
protected $_fileSize;
/**
* Seperator being used
+ * @var string
*/
protected $_seperator;
/**
* Total number of lines in file
+ * @var int
*/
protected $_lineCount;
if ($this->_invalidRowCount) {
// removed view url for invlaid contacts
$headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ],
- $customHeaders
- );
+ ts('Line Number'),
+ ts('Reason'),
+ ], $customHeaders);
$this->_errorFileName = self::errorFileName(self::ERROR);
self::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
if ($this->_conflictCount) {
$headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ],
- $customHeaders
- );
+ ts('Line Number'),
+ ts('Reason'),
+ ], $customHeaders);
$this->_conflictFileName = self::errorFileName(self::CONFLICT);
self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
}
if ($this->_duplicateCount) {
$headers = array_merge([
- ts('Line Number'),
- ts('View Participant URL'),
- ],
- $customHeaders
- );
+ ts('Line Number'),
+ ts('View Participant URL'),
+ ], $customHeaders);
$this->_duplicateFileName = self::errorFileName(self::DUPLICATE);
self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates);
/**
* Array of successfully imported participants id's
*
- * @array
+ * @var array
*/
protected $_newParticipants;
class CRM_Event_Info extends CRM_Core_Component_Info {
/**
+ * @var string
* @inheritDoc
*/
protected $keyword = 'event';
*
* @var array
*/
- static $_actionLinks = NULL;
+ public static $_actionLinks = NULL;
/**
* The event links to display for the browse screen.
* @var array
*/
- static $_eventLinks = NULL;
+ public static $_eventLinks = NULL;
- static $_links = NULL;
+ public static $_links = NULL;
- static $_tabLinks = NULL;
+ public static $_tabLinks = NULL;
protected $_pager = NULL;
*
*/
class CRM_Event_Page_ParticipantListing_Name extends CRM_Event_Page_ParticipantListing_Simple {
+
public function preProcess() {
$this->_participantListingType = 'Name';
*
*/
class CRM_Event_Page_ParticipantListing_NameAndEmail extends CRM_Event_Page_ParticipantListing_Simple {
+
public function preProcess() {
$this->_participantListingType = 'Name and Email';
*
* @var array
*/
- static $_links = NULL;
+ public static $_links = NULL;
/**
* We use desc to remind us what that column is, name is used in the tpl
*
* @var array
*/
- static $_columnHeaders;
+ public static $_columnHeaders;
/**
* Properties of contact we're interested in displaying
* @var array
*/
- static $_properties = [
+ public static $_properties = [
'contact_id',
'contact_type',
'sort_name',
*/
class CRM_Event_Task extends CRM_Core_Task {
+ /**
+ * Event tasks
+ */
const
- // Event tasks
CANCEL_REGISTRATION = 301,
PARTICIPANT_STATUS = 302;
- static $objectType = 'event';
+ /**
+ * @var string
+ */
+ public static $objectType = 'event';
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
- * @return array The set of tasks for a group of contacts
- * [ 'title' => The Task title,
- * 'class' => The Task Form class name,
- * 'result => Boolean. FIXME: Not sure what this is for
- * ]
+ * @return array
+ * The set of tasks for a group of contacts
+ * [ 'title' => The Task title,
+ * 'class' => The Task Form class name,
+ * 'result => Boolean. FIXME: Not sure what this is for
+ * ]
*/
public static function tasks() {
if (!self::$_tasks) {
*/
public function checkActive(\Civi\Token\TokenProcessor $processor) {
// Extracted from scheduled-reminders code. See the class description.
- return
- !empty($processor->context['actionMapping'])
+ return !empty($processor->context['actionMapping'])
&& $processor->context['actionMapping']->getEntity() === 'civicrm_participant';
}
return;
}
- $e->query->select('e.*'); // FIXME: seems too broad.
+ // FIXME: seems too broad.
+ $e->query->select('e.*');
$e->query->select('ov.label as event_type, ev.title, ev.id as event_id, ev.start_date, ev.end_date, ev.summary, ev.description, address.street_address, address.city, address.state_province_id, address.postal_code, email.email as contact_email, phone.phone as contact_phone');
$e->query->join('participant_stuff', "
!casMailingJoinType civicrm_event ev ON e.event_id = ev.id