From 90b461f1623e75e94e0f472a3c6bf23e01defbc1 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 10 Apr 2019 12:49:09 +1000 Subject: [PATCH] (NFC) Update CRM/Event folder for the new coder style --- CRM/Event/BAO/Event.php | 12 ++-- CRM/Event/BAO/Participant.php | 16 ++--- CRM/Event/BAO/ParticipantPayment.php | 16 ++--- CRM/Event/BAO/ParticipantStatusType.php | 1 + CRM/Event/BAO/Query.php | 40 +++++------ CRM/Event/Badge.php | 17 ++--- CRM/Event/Badge/Logo.php | 13 ++-- CRM/Event/Badge/Logo5395.php | 13 ++-- CRM/Event/Badge/NameTent.php | 1 + CRM/Event/Cart/BAO/Cart.php | 6 +- CRM/Event/Cart/BAO/Conference.php | 1 + CRM/Event/Cart/BAO/EventInCart.php | 1 - CRM/Event/Cart/Controller/Checkout.php | 1 + .../Form/Checkout/ParticipantsAndPrices.php | 8 +-- CRM/Event/Cart/Form/MerParticipant.php | 2 +- CRM/Event/Cart/Page/AddToCart.php | 7 +- CRM/Event/Cart/Page/CheckoutAJAX.php | 1 + CRM/Event/Cart/Page/RemoveFromCart.php | 1 + CRM/Event/Cart/Page/ViewCart.php | 1 + CRM/Event/Cart/StateMachine/Checkout.php | 1 + CRM/Event/Form/EventFees.php | 12 ++-- CRM/Event/Form/ManageEvent.php | 2 + CRM/Event/Form/ManageEvent/Conference.php | 10 +-- CRM/Event/Form/ManageEvent/EventInfo.php | 1 + CRM/Event/Form/ManageEvent/Fee.php | 2 + CRM/Event/Form/ManageEvent/Location.php | 9 +-- CRM/Event/Form/ManageEvent/Registration.php | 9 +-- CRM/Event/Form/ManageEvent/Repeat.php | 7 +- CRM/Event/Form/Participant.php | 67 ++++++++++------- CRM/Event/Form/ParticipantView.php | 15 ++-- CRM/Event/Form/Registration.php | 16 +++-- .../Registration/AdditionalParticipant.php | 72 +++++++++---------- CRM/Event/Form/Registration/Confirm.php | 30 ++++---- .../Form/Registration/ParticipantConfirm.php | 13 ++-- CRM/Event/Form/Registration/Register.php | 25 ++++--- CRM/Event/Form/Search.php | 1 + CRM/Event/Form/SelfSvcTransfer.php | 12 ++-- CRM/Event/Form/SelfSvcUpdate.php | 4 +- CRM/Event/Form/Task.php | 21 +++--- CRM/Event/Form/Task/AddToGroup.php | 18 ++--- CRM/Event/Form/Task/Badge.php | 1 + CRM/Event/Form/Task/Batch.php | 34 ++++----- CRM/Event/Form/Task/Cancel.php | 1 + CRM/Event/Form/Task/ParticipantStatus.php | 1 + CRM/Event/Form/Task/PickProfile.php | 2 + CRM/Event/Form/Task/Print.php | 23 +++--- CRM/Event/Form/Task/SearchTaskHookSample.php | 13 ++-- CRM/Event/Import/Field.php | 5 +- CRM/Event/Import/Form/MapField.php | 36 +++++----- CRM/Event/Import/Parser.php | 30 ++++---- CRM/Event/Import/Parser/Participant.php | 2 +- CRM/Event/Info.php | 1 + CRM/Event/Page/ManageEvent.php | 8 +-- CRM/Event/Page/ParticipantListing/Name.php | 1 + .../Page/ParticipantListing/NameAndEmail.php | 1 + CRM/Event/Selector/Search.php | 6 +- CRM/Event/Task.php | 20 ++++-- CRM/Event/Tokens.php | 6 +- 58 files changed, 374 insertions(+), 322 deletions(-) diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 5a18b77c77..518bc9bd0b 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -920,7 +920,7 @@ WHERE civicrm_event.is_active = 1 * @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 */ @@ -1183,10 +1183,10 @@ WHERE civicrm_event.is_active = 1 '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))), ]); @@ -1587,13 +1587,13 @@ WHERE civicrm_event.is_active = 1 } $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(); @@ -1976,6 +1976,7 @@ WHERE ce.loc_block_id = $locBlockId"; * @return boolean * true if allow registration otherwise false */ + /** * @param $values * @@ -2013,6 +2014,7 @@ WHERE ce.loc_block_id = $locBlockId"; * Key/value participant info. * @return boolean */ + /** * @param array $params * diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index bb6f75f06d..db4bf4f7c2 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -37,21 +37,21 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { * * @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'], @@ -238,9 +238,9 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { $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; @@ -1669,8 +1669,8 @@ UPDATE civicrm_participant 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, - ]) . '
'; + 1 => $maxParticipants, + ]) . '
'; } $hasWaiting = FALSE; diff --git a/CRM/Event/BAO/ParticipantPayment.php b/CRM/Event/BAO/ParticipantPayment.php index a3383bfcad..cb12a2ddc1 100644 --- a/CRM/Event/BAO/ParticipantPayment.php +++ b/CRM/Event/BAO/ParticipantPayment.php @@ -80,19 +80,19 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment //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; diff --git a/CRM/Event/BAO/ParticipantStatusType.php b/CRM/Event/BAO/ParticipantStatusType.php index b04b0fa1f8..a897d21cc3 100644 --- a/CRM/Event/BAO/ParticipantStatusType.php +++ b/CRM/Event/BAO/ParticipantStatusType.php @@ -33,6 +33,7 @@ * */ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatusType { + /** * @param array $params * diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 5f7a1ecf78..5f8e8bf000 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -226,7 +226,6 @@ class CRM_Event_BAO_Query extends CRM_Core_BAO_Query { } } - /** * @param $query */ @@ -384,8 +383,7 @@ class CRM_Event_BAO_Query extends CRM_Core_BAO_Query { 'participant_is_pay_later', 'participant_campaign_id', 'participant_registered_by_id', - ]) - ) { + ])) { $name = str_replace('participant_', '', $name); if ($name == 'is_pay_later') { $qillName = $name; @@ -449,12 +447,10 @@ class CRM_Event_BAO_Query extends CRM_Core_BAO_Query { 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'; @@ -590,21 +586,19 @@ class CRM_Event_BAO_Query extends CRM_Core_BAO_Query { $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'), diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php index b485fe2872..953c61b5fd 100644 --- a/CRM/Event/Badge.php +++ b/CRM/Event/Badge.php @@ -43,6 +43,7 @@ * */ class CRM_Event_Badge { + /** */ public function __construct() { @@ -148,14 +149,14 @@ class CRM_Event_Badge { $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) { diff --git a/CRM/Event/Badge/Logo.php b/CRM/Event/Badge/Logo.php index a397f838ab..4ac357ec25 100644 --- a/CRM/Event/Badge/Logo.php +++ b/CRM/Event/Badge/Logo.php @@ -4,6 +4,7 @@ * Class CRM_Event_Badge_Logo */ class CRM_Event_Badge_Logo extends CRM_Event_Badge { + /** */ public function __construct() { @@ -40,12 +41,12 @@ class CRM_Event_Badge_Logo extends CRM_Event_Badge { $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); diff --git a/CRM/Event/Badge/Logo5395.php b/CRM/Event/Badge/Logo5395.php index 460b465c70..2343909174 100644 --- a/CRM/Event/Badge/Logo5395.php +++ b/CRM/Event/Badge/Logo5395.php @@ -4,6 +4,7 @@ * Class CRM_Event_Badge_Logo5395 */ class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge { + /** */ public function __construct() { @@ -40,12 +41,12 @@ class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge { $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); diff --git a/CRM/Event/Badge/NameTent.php b/CRM/Event/Badge/NameTent.php index 33df180f6e..f2d4990bc3 100644 --- a/CRM/Event/Badge/NameTent.php +++ b/CRM/Event/Badge/NameTent.php @@ -38,6 +38,7 @@ * */ class CRM_Event_Badge_NameTent extends CRM_Event_Badge { + /** */ public function __construct() { diff --git a/CRM/Event/Cart/BAO/Cart.php b/CRM/Event/Cart/BAO/Cart.php index e56a43ae95..ac4090363f 100644 --- a/CRM/Event/Cart/BAO/Cart.php +++ b/CRM/Event/Cart/BAO/Cart.php @@ -5,7 +5,10 @@ */ 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 = []; /** @@ -327,7 +330,6 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { return $values; } - /** * @param int $from_cart_id */ diff --git a/CRM/Event/Cart/BAO/Conference.php b/CRM/Event/Cart/BAO/Conference.php index a9d9b38941..fd2c3f49df 100644 --- a/CRM/Event/Cart/BAO/Conference.php +++ b/CRM/Event/Cart/BAO/Conference.php @@ -4,6 +4,7 @@ * 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 diff --git a/CRM/Event/Cart/BAO/EventInCart.php b/CRM/Event/Cart/BAO/EventInCart.php index aa33705627..7dd79ec725 100644 --- a/CRM/Event/Cart/BAO/EventInCart.php +++ b/CRM/Event/Cart/BAO/EventInCart.php @@ -224,7 +224,6 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl return count($this->waiting_participants()); } - /** * @param mixed $offset * diff --git a/CRM/Event/Cart/Controller/Checkout.php b/CRM/Event/Cart/Controller/Checkout.php index 84ed049823..a00044bdda 100644 --- a/CRM/Event/Cart/Controller/Checkout.php +++ b/CRM/Event/Cart/Controller/Checkout.php @@ -4,6 +4,7 @@ * Class CRM_Event_Cart_Controller_Checkout */ class CRM_Event_Cart_Controller_Checkout extends CRM_Core_Controller { + /** * @param null $title * @param bool|int $action diff --git a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php index 35722587e9..a78d34f026 100644 --- a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php +++ b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php @@ -166,10 +166,10 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ 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, + ]); } } } diff --git a/CRM/Event/Cart/Form/MerParticipant.php b/CRM/Event/Cart/Form/MerParticipant.php index b8340e44f5..ef45df9b54 100644 --- a/CRM/Event/Cart/Form/MerParticipant.php +++ b/CRM/Event/Cart/Form/MerParticipant.php @@ -113,7 +113,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { * * @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); } diff --git a/CRM/Event/Cart/Page/AddToCart.php b/CRM/Event/Cart/Page/AddToCart.php index 9b3d61554f..494a594e6e 100644 --- a/CRM/Event/Cart/Page/AddToCart.php +++ b/CRM/Event/Cart/Page/AddToCart.php @@ -4,6 +4,7 @@ * 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. * @@ -22,9 +23,9 @@ class CRM_Event_Cart_Page_AddToCart extends CRM_Core_Page { $url = CRM_Utils_System::url('civicrm/event/view_cart'); CRM_Utils_System::setUFMessage(ts("%1 has been added to your cart. View your cart.", [ - 1 => $event_in_cart->event->title, - 2 => $url, - ])); + 1 => $event_in_cart->event->title, + 2 => $url, + ])); $transaction->commit(); diff --git a/CRM/Event/Cart/Page/CheckoutAJAX.php b/CRM/Event/Cart/Page/CheckoutAJAX.php index fa12bcbc46..19c7b8559b 100644 --- a/CRM/Event/Cart/Page/CheckoutAJAX.php +++ b/CRM/Event/Cart/Page/CheckoutAJAX.php @@ -4,6 +4,7 @@ * 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'); diff --git a/CRM/Event/Cart/Page/RemoveFromCart.php b/CRM/Event/Cart/Page/RemoveFromCart.php index e25ebbd26b..90f6554f90 100644 --- a/CRM/Event/Cart/Page/RemoveFromCart.php +++ b/CRM/Event/Cart/Page/RemoveFromCart.php @@ -4,6 +4,7 @@ * 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. * diff --git a/CRM/Event/Cart/Page/ViewCart.php b/CRM/Event/Cart/Page/ViewCart.php index 84e20dd64e..b2a0a7ce0b 100644 --- a/CRM/Event/Cart/Page/ViewCart.php +++ b/CRM/Event/Cart/Page/ViewCart.php @@ -4,6 +4,7 @@ * Class CRM_Event_Cart_Page_ViewCart */ class CRM_Event_Cart_Page_ViewCart extends CRM_Core_Page { + /** * @return string */ diff --git a/CRM/Event/Cart/StateMachine/Checkout.php b/CRM/Event/Cart/StateMachine/Checkout.php index 8ba98dc22d..3ca2285281 100644 --- a/CRM/Event/Cart/StateMachine/Checkout.php +++ b/CRM/Event/Cart/StateMachine/Checkout.php @@ -4,6 +4,7 @@ * Class CRM_Event_Cart_StateMachine_Checkout */ class CRM_Event_Cart_StateMachine_Checkout extends CRM_Core_StateMachine { + /** * @param object $controller * @param const|int $action diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php index 655a7b93b2..f5972943bf 100644 --- a/CRM/Event/Form/EventFees.php +++ b/CRM/Event/Form/EventFees.php @@ -225,12 +225,12 @@ class CRM_Event_Form_EventFees { $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; } } diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index 08dedbe509..cd013d81cc 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -75,11 +75,13 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { /** * 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; diff --git a/CRM/Event/Form/ManageEvent/Conference.php b/CRM/Event/Form/ManageEvent/Conference.php index e03b13a756..2a47fa85c9 100644 --- a/CRM/Event/Form/ManageEvent/Conference.php +++ b/CRM/Event/Form/ManageEvent/Conference.php @@ -38,6 +38,7 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent { /** * Page action. + * @var int */ public $_action; @@ -57,11 +58,10 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent { ); $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(); } diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php index c51030db06..31317c09aa 100644 --- a/CRM/Event/Form/ManageEvent/EventInfo.php +++ b/CRM/Event/Form/ManageEvent/EventInfo.php @@ -37,6 +37,7 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { /** * Event type. + * @var int */ protected $_eventType = NULL; diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index 7c79b05846..3a02919e22 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -47,11 +47,13 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { /** * Page action. + * @var int */ public $_action; /** * In Date. + * @var string */ private $_inDate; diff --git a/CRM/Event/Form/ManageEvent/Location.php b/CRM/Event/Form/ManageEvent/Location.php index e51f1a3f45..b33eafe0a4 100644 --- a/CRM/Event/Form/ManageEvent/Location.php +++ b/CRM/Event/Form/ManageEvent/Location.php @@ -64,6 +64,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { /** * Get the db values for this form. + * @var array */ public $_values = []; @@ -242,10 +243,10 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { $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; } diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index a3441f82a7..0c62605713 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -356,9 +356,9 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent ]; $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'; @@ -794,7 +794,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent // 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); diff --git a/CRM/Event/Form/ManageEvent/Repeat.php b/CRM/Event/Form/ManageEvent/Repeat.php index 58ef8f6e20..f02716591d 100644 --- a/CRM/Event/Form/ManageEvent/Repeat.php +++ b/CRM/Event/Form/ManageEvent/Repeat.php @@ -14,15 +14,16 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent { /** * 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'); @@ -168,7 +169,7 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent { * * @return array */ - static public function getParticipantCountforEvent($listOfRelatedEntities = []) { + public static function getParticipantCountforEvent($listOfRelatedEntities = []) { $participantDetails = []; if (!empty($listOfRelatedEntities)) { $implodeRelatedEntities = implode(',', array_map(function ($entity) { @@ -195,7 +196,7 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent { * 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 */ diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 70b2a84c07..0b0b31e0dc 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -85,13 +85,13 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment protected $_noteId = NULL; /** - * @deprecated * * Use parent $this->contactID * * The id of the contact associated with this participation. * * @var int + * @deprecated */ public $_contactId; @@ -112,52 +112,61 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment /** * 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'; @@ -166,32 +175,37 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment /** * 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; @@ -612,26 +626,25 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } } $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 = [ @@ -726,9 +739,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } $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); @@ -1127,9 +1140,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment // 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']; @@ -1360,9 +1373,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment 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']; diff --git a/CRM/Event/Form/ParticipantView.php b/CRM/Event/Form/ParticipantView.php index ddafbc9226..8b51c85465 100644 --- a/CRM/Event/Form/ParticipantView.php +++ b/CRM/Event/Form/ParticipantView.php @@ -255,14 +255,13 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form { */ public function buildQuickForm() { $this->addButtons([ - [ - 'type' => 'cancel', - 'name' => ts('Done'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'cancel', + 'name' => ts('Done'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ], + ]); } } diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index c104fa1755..2e60b956e4 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -154,11 +154,14 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { public $_pcpId; - /* Is event already full. + /** + * Is event already full. * * @var boolean + * */ + public $_isEventFull; public $_lineItem; @@ -168,9 +171,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { public $_forcePayement; /** + * @var bool * @deprecated - * - * @var */ public $_isBillingAddressRequiredForPayLater; @@ -1255,10 +1257,10 @@ WHERE v.option_group_id = g.id return; } foreach (array( - 'constantValues', - 'submitValues', - 'defaultValues', - ) as $val) { + 'constantValues', + 'submitValues', + 'defaultValues', + ) as $val) { $values = $form->{"_$val"}; if (!is_array($values) || empty($values)) { continue; diff --git a/CRM/Event/Form/Registration/AdditionalParticipant.php b/CRM/Event/Form/Registration/AdditionalParticipant.php index 0d3fd08099..afaaf1a4d4 100644 --- a/CRM/Event/Form/Registration/AdditionalParticipant.php +++ b/CRM/Event/Form/Registration/AdditionalParticipant.php @@ -39,6 +39,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R /** * Pre-registered additional participant id. + * @var int */ public $additionalParticipantId = NULL; @@ -182,17 +183,17 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R $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)) ) { @@ -263,22 +264,22 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R $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'); @@ -355,25 +356,23 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R //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); @@ -493,9 +492,9 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R $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, + ]); } } } @@ -739,7 +738,8 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R // 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() diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index cdff40124f..7ba4fdb95a 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -55,6 +55,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { * 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']; @@ -224,9 +225,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { 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]) ) { @@ -315,18 +316,17 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $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 = []; diff --git a/CRM/Event/Form/Registration/ParticipantConfirm.php b/CRM/Event/Form/Registration/ParticipantConfirm.php index d672a1e956..e64d4e9e34 100644 --- a/CRM/Event/Form/Registration/ParticipantConfirm.php +++ b/CRM/Event/Form/Registration/ParticipantConfirm.php @@ -40,7 +40,10 @@ */ 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; /** @@ -120,13 +123,13 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi else { if ($this->_cc == 'fail') { $statusMsg = '
' . ts('Your Credit Card transaction was not successful. No money has yet been charged to your card.') . '

' . 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'], - ]) . '
'; + 1 => $values['title'], + ]) . ''; } else { $statusMsg = '
' . ts('Confirm your registration for %1.', [ - 1 => $values['title'], - ]) . '

' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '
'; + 1 => $values['title'], + ]) . '

' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '
'; } $buttons = array_merge($buttons, [ [ diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 98f2e6ddd4..fd5a218f3e 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -37,11 +37,13 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { /** * The fields involved in this page. + * @var array */ public $_fields; /** * The status message that user view. + * @var sting */ protected $_waitlistMsg = NULL; protected $_requireApprovalMsg = NULL; @@ -58,6 +60,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * * This can be set using hook_civicrm_buildForm() to override the registration dupe check. * CRM-7604 + * @var bool */ public $_skipDupeRegistrationCheck = FALSE; @@ -478,15 +481,14 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } $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); @@ -508,7 +510,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * @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) { @@ -1162,7 +1164,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { 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); } diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index d6c28eac5b..71e58e1f3f 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -63,6 +63,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { /** * Prefix for the controller. + * @var string */ protected $_prefix = "event_"; diff --git a/CRM/Event/Form/SelfSvcTransfer.php b/CRM/Event/Form/SelfSvcTransfer.php index 57821565f1..c3af950956 100644 --- a/CRM/Event/Form/SelfSvcTransfer.php +++ b/CRM/Event/Form/SelfSvcTransfer.php @@ -113,32 +113,32 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form { /** * 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; @@ -315,7 +315,7 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form { $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) { diff --git a/CRM/Event/Form/SelfSvcUpdate.php b/CRM/Event/Form/SelfSvcUpdate.php index 189cc5b88f..de7e8090fc 100644 --- a/CRM/Event/Form/SelfSvcUpdate.php +++ b/CRM/Event/Form/SelfSvcUpdate.php @@ -110,9 +110,10 @@ class CRM_Event_Form_SelfSvcUpdate extends CRM_Core_Form { /** * Is backoffice form? * - * @array bool + * @var bool */ protected $isBackoffice = FALSE; + /** * Set variables up before form is built based on participant ID from URL * @@ -206,6 +207,7 @@ class CRM_Event_Form_SelfSvcUpdate extends CRM_Core_Form { // 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 diff --git a/CRM/Event/Form/Task.php b/CRM/Event/Form/Task.php index 038e8276d2..87e0a07a0c 100644 --- a/CRM/Event/Form/Task.php +++ b/CRM/Event/Form/Task.php @@ -149,17 +149,16 @@ class CRM_Event_Form_Task extends CRM_Core_Form_Task { */ 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'), + ], + ]); } } diff --git a/CRM/Event/Form/Task/AddToGroup.php b/CRM/Event/Form/Task/AddToGroup.php index 79f3d5dce6..42c63d4aa0 100644 --- a/CRM/Event/Form/Task/AddToGroup.php +++ b/CRM/Event/Form/Task/AddToGroup.php @@ -235,22 +235,22 @@ class CRM_Event_Form_Task_AddToGroup extends CRM_Event_Form_Task { $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 = ''; 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]); } } diff --git a/CRM/Event/Form/Task/Badge.php b/CRM/Event/Form/Task/Badge.php index 836e9364b8..3f7d87586d 100644 --- a/CRM/Event/Form/Task/Badge.php +++ b/CRM/Event/Form/Task/Badge.php @@ -46,6 +46,7 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task { /** * Component clause. + * @var string */ public $_componentClause; diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index ce01d3ab39..e57358f331 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -45,16 +45,19 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { /** * 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; @@ -128,17 +131,16 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { $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); @@ -278,7 +280,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { * @param int $participantId * @param int $statusId * - * @return Ambigous|void + * @return mixed */ public static function updatePendingOnlineContribution($participantId, $statusId) { if (!$participantId || !$statusId) { @@ -417,10 +419,10 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { //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; } diff --git a/CRM/Event/Form/Task/Cancel.php b/CRM/Event/Form/Task/Cancel.php index 3dd82dbcb8..2fc163490d 100644 --- a/CRM/Event/Form/Task/Cancel.php +++ b/CRM/Event/Form/Task/Cancel.php @@ -40,6 +40,7 @@ class CRM_Event_Form_Task_Cancel extends CRM_Event_Form_Task { /** * Variable to store redirect path. + * @var string */ protected $_userContext; diff --git a/CRM/Event/Form/Task/ParticipantStatus.php b/CRM/Event/Form/Task/ParticipantStatus.php index aafe0bfceb..64414a8fc7 100644 --- a/CRM/Event/Form/Task/ParticipantStatus.php +++ b/CRM/Event/Form/Task/ParticipantStatus.php @@ -33,6 +33,7 @@ * */ 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 diff --git a/CRM/Event/Form/Task/PickProfile.php b/CRM/Event/Form/Task/PickProfile.php index 0bb08aca8b..8d916b2275 100644 --- a/CRM/Event/Form/Task/PickProfile.php +++ b/CRM/Event/Form/Task/PickProfile.php @@ -47,11 +47,13 @@ class CRM_Event_Form_Task_PickProfile extends CRM_Event_Form_Task { /** * Maximum event participations that should be allowed to update. + * @var int */ protected $_maxParticipations = 100; /** * Variable to store redirect path. + * @var string */ protected $_userContext; diff --git a/CRM/Event/Form/Task/Print.php b/CRM/Event/Form/Task/Print.php index 9cc1d1992b..828e572ded 100644 --- a/CRM/Event/Form/Task/Print.php +++ b/CRM/Event/Form/Task/Print.php @@ -78,18 +78,17 @@ class CRM_Event_Form_Task_Print extends CRM_Event_Form_Task { // 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'), + ], + ]); } /** diff --git a/CRM/Event/Form/Task/SearchTaskHookSample.php b/CRM/Event/Form/Task/SearchTaskHookSample.php index e0bf5f5531..3e143e1154 100644 --- a/CRM/Event/Form/Task/SearchTaskHookSample.php +++ b/CRM/Event/Form/Task/SearchTaskHookSample.php @@ -78,13 +78,12 @@ class CRM_Event_Form_Task_SearchTaskHookSample extends CRM_Event_Form_Task { */ public function buildQuickForm() { $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'done', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ], + ]); } } diff --git a/CRM/Event/Import/Field.php b/CRM/Event/Import/Field.php index 57b92f75bd..773a066c63 100644 --- a/CRM/Event/Import/Field.php +++ b/CRM/Event/Import/Field.php @@ -30,17 +30,20 @@ */ 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; diff --git a/CRM/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php index 2013c17bad..161ee1f843 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -38,7 +38,6 @@ */ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { - /** * Set variables up before form is built. * @@ -263,22 +262,21 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { $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'), + ), + )); } /** @@ -343,8 +341,8 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { } 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.') . '
'; + 1 => $threshold, + )) . ' ' . ts('Or Provide Contact ID or External ID.') . '
'; } } elseif (!in_array('event_title', $importKeys)) { diff --git a/CRM/Event/Import/Parser.php b/CRM/Event/Import/Parser.php index 000d96db6b..ba14c1bc2d 100644 --- a/CRM/Event/Import/Parser.php +++ b/CRM/Event/Import/Parser.php @@ -36,22 +36,26 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { 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; @@ -254,31 +258,25 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { 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); diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index 3c328d7e08..7c41ed110a 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -50,7 +50,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { /** * Array of successfully imported participants id's * - * @array + * @var array */ protected $_newParticipants; diff --git a/CRM/Event/Info.php b/CRM/Event/Info.php index 098d6351a8..8e3e5338ca 100644 --- a/CRM/Event/Info.php +++ b/CRM/Event/Info.php @@ -38,6 +38,7 @@ class CRM_Event_Info extends CRM_Core_Component_Info { /** + * @var string * @inheritDoc */ protected $keyword = 'event'; diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 03dfcebc0b..afc523e034 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -43,17 +43,17 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * * @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; diff --git a/CRM/Event/Page/ParticipantListing/Name.php b/CRM/Event/Page/ParticipantListing/Name.php index 39d3fc6cc9..d21bcddaef 100644 --- a/CRM/Event/Page/ParticipantListing/Name.php +++ b/CRM/Event/Page/ParticipantListing/Name.php @@ -33,6 +33,7 @@ * */ class CRM_Event_Page_ParticipantListing_Name extends CRM_Event_Page_ParticipantListing_Simple { + public function preProcess() { $this->_participantListingType = 'Name'; diff --git a/CRM/Event/Page/ParticipantListing/NameAndEmail.php b/CRM/Event/Page/ParticipantListing/NameAndEmail.php index ae48218975..0b4c586936 100644 --- a/CRM/Event/Page/ParticipantListing/NameAndEmail.php +++ b/CRM/Event/Page/ParticipantListing/NameAndEmail.php @@ -33,6 +33,7 @@ * */ class CRM_Event_Page_ParticipantListing_NameAndEmail extends CRM_Event_Page_ParticipantListing_Simple { + public function preProcess() { $this->_participantListingType = 'Name and Email'; diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php index 2e6532adcb..fb79e008db 100644 --- a/CRM/Event/Selector/Search.php +++ b/CRM/Event/Selector/Search.php @@ -46,20 +46,20 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * * @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', diff --git a/CRM/Event/Task.php b/CRM/Event/Task.php index 9e8542e103..82afc91947 100644 --- a/CRM/Event/Task.php +++ b/CRM/Event/Task.php @@ -38,22 +38,28 @@ */ 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) { diff --git a/CRM/Event/Tokens.php b/CRM/Event/Tokens.php index fa26f56b61..1f1b1f716e 100644 --- a/CRM/Event/Tokens.php +++ b/CRM/Event/Tokens.php @@ -70,8 +70,7 @@ class CRM_Event_Tokens extends \Civi\Token\AbstractTokenSubscriber { */ 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'; } @@ -85,7 +84,8 @@ class CRM_Event_Tokens extends \Civi\Token\AbstractTokenSubscriber { 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 -- 2.25.1