From 0cf587a7a230bbe5d518af92e820b055a8012f78 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 14:30:24 +1200 Subject: [PATCH] CRM/Event add comments --- CRM/Event/BAO/Event.php | 37 +++++++ CRM/Event/BAO/Participant.php | 24 +++++ CRM/Event/BAO/ParticipantStatusType.php | 32 ++++++ CRM/Event/BAO/Query.php | 33 ++++++ CRM/Event/Badge.php | 20 ++++ CRM/Event/Badge/Logo.php | 10 ++ CRM/Event/Badge/Logo5395.php | 10 ++ CRM/Event/Badge/NameTent.php | 9 ++ CRM/Event/Badge/Simple.php | 3 + CRM/Event/Cart/BAO/Cart.php | 98 +++++++++++++++++ CRM/Event/Cart/BAO/Conference.php | 4 + CRM/Event/Cart/BAO/EventInCart.php | 100 ++++++++++++++++++ CRM/Event/Cart/BAO/MerParticipant.php | 50 +++++++++ CRM/Event/Cart/Controller/Checkout.php | 9 ++ CRM/Event/Cart/Form/Cart.php | 31 ++++++ .../Cart/Form/Checkout/ConferenceEvents.php | 4 + .../Form/Checkout/ParticipantsAndPrices.php | 20 ++++ CRM/Event/Cart/Form/Checkout/Payment.php | 53 ++++++++++ CRM/Event/Cart/Form/Checkout/ThankYou.php | 4 + CRM/Event/Cart/Form/MerParticipant.php | 44 ++++++++ CRM/Event/Cart/Page/AddToCart.php | 4 + CRM/Event/Cart/Page/CheckoutAJAX.php | 4 + CRM/Event/Cart/Page/RemoveFromCart.php | 4 + CRM/Event/Cart/Page/ViewCart.php | 7 ++ CRM/Event/Cart/StateMachine/Checkout.php | 8 ++ CRM/Event/Form/ManageEvent.php | 3 + CRM/Event/Form/ManageEvent/EventInfo.php | 5 + CRM/Event/Form/ManageEvent/Registration.php | 3 + CRM/Event/Form/ManageEvent/TabHeader.php | 21 +++- CRM/Event/Form/ParticipantFeeSelection.php | 12 +++ CRM/Event/Form/Registration.php | 38 +++++++ .../Registration/AdditionalParticipant.php | 15 +++ CRM/Event/Form/Registration/Confirm.php | 3 + CRM/Event/Form/Registration/Register.php | 7 ++ CRM/Event/Form/Search.php | 3 + CRM/Event/Form/SearchEvent.php | 3 + CRM/Event/Form/Task.php | 4 + CRM/Event/Form/Task/Batch.php | 6 ++ CRM/Event/Import/Field.php | 15 +++ CRM/Event/Import/Parser.php | 19 ++++ CRM/Event/Info.php | 27 +++++ CRM/Event/Page/EventInfo.php | 5 +- CRM/Event/Page/ManageEvent.php | 15 +++ .../ParticipantListing/NameStatusAndDate.php | 11 ++ CRM/Event/Page/ParticipantListing/Simple.php | 11 ++ CRM/Event/Selector/Search.php | 6 ++ 46 files changed, 852 insertions(+), 2 deletions(-) diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 99128fa82f..c7261128ec 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1772,6 +1772,9 @@ WHERE id = $cfID * * @return array $events array of all events. */ + /** + * @return array + */ static function getLocationEvents() { $events = array(); @@ -1792,6 +1795,11 @@ ORDER BY sp.name, ca.city, ca.street_address ASC return $events; } + /** + * @param $locBlockId + * + * @return int|null|string + */ static function countEventsUsingLocBlockId($locBlockId) { if (!$locBlockId) { return 0; @@ -1822,6 +1830,11 @@ WHERE ce.loc_block_id = $locBlockId"; 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)); @@ -1848,6 +1861,11 @@ WHERE ce.loc_block_id = $locBlockId"; * @return boolean true if allow registration otherwise false * @access public */ + /** + * @param $values + * + * @return bool + */ static function showHideRegistrationLink($values) { $session = CRM_Core_Session::singleton(); @@ -1880,6 +1898,11 @@ WHERE ce.loc_block_id = $locBlockId"; * @return boolean $alreadyRegistered true/false * @access public */ + /** + * @param $params + * + * @return bool + */ static function checkRegistration($params) { $alreadyRegistered = FALSE; if (empty($params['contact_id'])) { @@ -2056,6 +2079,11 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field * * @return $defaults an array of custom data defaults. */ + /** + * @param $templateId + * + * @return array + */ static function getTemplateDefaultValues($templateId) { $defaults = array(); if (!$templateId) { @@ -2077,6 +2105,11 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field return $defaults; } + /** + * @param $event_id + * + * @return object + */ static function get_sub_events($event_id) { $params = array('parent_event_id' => $event_id); $defaults = array(); @@ -2090,6 +2123,10 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field * @params int $eventCampaignID campaign id of that event * */ + /** + * @param $eventID + * @param $eventCampaignID + */ static function updateParticipantCampaignID($eventID, $eventCampaignID) { $params = array(); $params[1] = array($eventID, 'Integer'); diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 9ae755a99e..1348cb0bc5 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -66,6 +66,10 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { 'Awaiting approval' => array('Cancelled', 'Pending from approval'), 'Pending from approval' => array('Registered', 'Cancelled'), ); + + /** + * + */ function __construct() { parent::__construct(); } @@ -1811,6 +1815,15 @@ WHERE cpf.price_set_id = %1 AND cpfv.label LIKE %2"; } } + /** + * @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); @@ -1945,6 +1958,11 @@ WHERE (li.entity_table = 'civicrm_participant' AND li.entity_id = {$participantI 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'); @@ -1996,6 +2014,12 @@ WHERE (li.entity_table = 'civicrm_participant' AND li.entity_id = {$participantI } } + /** + * @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'); diff --git a/CRM/Event/BAO/ParticipantStatusType.php b/CRM/Event/BAO/ParticipantStatusType.php index 3d15d36677..599150ec99 100644 --- a/CRM/Event/BAO/ParticipantStatusType.php +++ b/CRM/Event/BAO/ParticipantStatusType.php @@ -33,6 +33,11 @@ * */ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatusType { + /** + * @param $params + * + * @return $this|null + */ static function add(&$params) { if (empty($params)) { return NULL; @@ -42,6 +47,11 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu return $dao->save(); } + /** + * @param $params + * + * @return $this|null + */ static function &create(&$params) { $transaction = new CRM_Core_Transaction(); $statusType = self::add($params); @@ -53,6 +63,11 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu 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; @@ -70,6 +85,12 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu return TRUE; } + /** + * @param $params + * @param $defaults + * + * @return CRM_Event_DAO_ParticipantStatusType|null + */ static function retrieve(&$params, &$defaults) { $result = NULL; @@ -83,10 +104,21 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu 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(); diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index af63922018..707e535b79 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -35,6 +35,9 @@ */ class CRM_Event_BAO_Query { + /** + * @return array + */ static function &getFields() { $fields = array(); $fields = array_merge($fields, CRM_Event_DAO_Event::import()); @@ -44,6 +47,9 @@ class CRM_Event_BAO_Query { return $fields; } + /** + * @return array + */ static function &getParticipantFields() { $fields = CRM_Event_BAO_Participant::importableFields('Individual', TRUE, TRUE); return $fields; @@ -201,6 +207,9 @@ class CRM_Event_BAO_Query { } } + /** + * @param $query + */ static function where(&$query) { $grouping = NULL; foreach (array_keys($query->_params) as $id) { @@ -219,6 +228,10 @@ class CRM_Event_BAO_Query { } } + /** + * @param $values + * @param $query + */ static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; switch ($name) { @@ -445,6 +458,13 @@ class CRM_Event_BAO_Query { } } + /** + * @param $name + * @param $mode + * @param $side + * + * @return null|string + */ static function from($name, $mode, $side) { $from = NULL; switch ($name) { @@ -494,6 +514,12 @@ class CRM_Event_BAO_Query { return (isset($this->_qill)) ? $this->_qill : ""; } + /** + * @param $mode + * @param bool $includeCustomFields + * + * @return array|null + */ static function defaultReturnProperties($mode, $includeCustomFields = TRUE ) { @@ -610,8 +636,15 @@ class CRM_Event_BAO_Query { $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'])) { diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php index 0f75239f05..104bcff174 100644 --- a/CRM/Event/Badge.php +++ b/CRM/Event/Badge.php @@ -43,6 +43,9 @@ * */ 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'; @@ -52,6 +55,9 @@ class CRM_Event_Badge { $this->setDebug(FALSE); } + /** + * @param bool $debug + */ function setDebug($debug = TRUE) { if (!$debug) { $this->debug = FALSE; @@ -82,6 +88,11 @@ class CRM_Event_Badge { 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)) { @@ -90,6 +101,12 @@ class CRM_Event_Badge { return NULL; } + /** + * @param $eventID + * @param bool $img + * + * @return string + */ function getImageFileName($eventID, $img = FALSE) { global $civicrm_root; $path = "CRM/Event/Badge"; @@ -119,6 +136,9 @@ class CRM_Event_Badge { return $imgFile; } + /** + * @param bool $img + */ function printBackground($img = FALSE) { $x = $this->pdf->GetAbsX(); $y = $this->pdf->GetY(); diff --git a/CRM/Event/Badge/Logo.php b/CRM/Event/Badge/Logo.php index 4e101ad6ad..92e6bd12b5 100644 --- a/CRM/Event/Badge/Logo.php +++ b/CRM/Event/Badge/Logo.php @@ -1,5 +1,12 @@ setDebug (); } + /** + * @param $participant + */ public function generateLabel($participant) { $x = $this->pdf->GetAbsX(); $y = $this->pdf->GetY(); diff --git a/CRM/Event/Badge/Logo5395.php b/CRM/Event/Badge/Logo5395.php index ebf43edb6e..6d7352edf0 100644 --- a/CRM/Event/Badge/Logo5395.php +++ b/CRM/Event/Badge/Logo5395.php @@ -1,5 +1,12 @@ setDebug (); } + /** + * @param $participant + */ public function generateLabel($participant) { $x = $this->pdf->GetAbsX(); $y = $this->pdf->GetY(); diff --git a/CRM/Event/Badge/NameTent.php b/CRM/Event/Badge/NameTent.php index d99801e170..0fad78bce7 100644 --- a/CRM/Event/Badge/NameTent.php +++ b/CRM/Event/Badge/NameTent.php @@ -38,6 +38,9 @@ * */ class CRM_Event_Badge_NameTent extends CRM_Event_Badge { + /** + * + */ function __construct() { parent::__construct(); // A4 @@ -59,6 +62,9 @@ class CRM_Event_Badge_NameTent extends CRM_Event_Badge { $this->pdf->setPageFormat('A4', 'L'); } + /** + * @param $participant + */ protected function writeOneSide(&$participant) { $this->pdf->SetXY(0, $this->pdf->height / 2); $this->printBackground(TRUE); @@ -71,6 +77,9 @@ class CRM_Event_Badge_NameTent extends CRM_Event_Badge { $this->pdf->Write(0, $participant['current_employer'], NULL, NULL, 'C'); } + /** + * @param $participant + */ public function generateLabel($participant) { $this->writeOneSide($participant); $this->pdf->StartTransform(); diff --git a/CRM/Event/Badge/Simple.php b/CRM/Event/Badge/Simple.php index e9223174a6..73d4adc970 100644 --- a/CRM/Event/Badge/Simple.php +++ b/CRM/Event/Badge/Simple.php @@ -39,6 +39,9 @@ */ 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); diff --git a/CRM/Event/Cart/BAO/Cart.php b/CRM/Event/Cart/BAO/Cart.php index e719ced0e5..6241ee2a8d 100644 --- a/CRM/Event/Cart/BAO/Cart.php +++ b/CRM/Event/Cart/BAO/Cart.php @@ -1,10 +1,19 @@ $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); @@ -12,6 +21,11 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { 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); @@ -29,6 +43,9 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { 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) { @@ -38,6 +55,12 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { $event_in_cart->save(); } + /** + * @param $params + * + * @return $this + * @throws Exception + */ public static function create($params) { $transaction = new CRM_Core_Transaction(); @@ -53,10 +76,20 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { 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); @@ -68,6 +101,9 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { } } + /** + * @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'); @@ -105,14 +141,27 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { 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(); @@ -124,6 +173,11 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { 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) { @@ -138,6 +192,12 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { 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); @@ -150,6 +210,11 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { 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) { @@ -165,10 +230,20 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_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) { @@ -178,6 +253,9 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { return NULL; } + /** + * @return array + */ public function get_main_event_participants() { $participants = array(); foreach ($this->get_main_events_in_carts() as $event_in_cart) { @@ -198,6 +276,11 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_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) { @@ -211,6 +294,11 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_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; @@ -224,6 +312,13 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { 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) { @@ -234,6 +329,9 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { } + /** + * @param $from_cart_id + */ public function adopt_participants($from_cart_id) { $params = array( 1 => array($this->id, 'Integer'), diff --git a/CRM/Event/Cart/BAO/Conference.php b/CRM/Event/Cart/BAO/Conference.php index 71f9ad7f82..6b4f7a44b8 100644 --- a/CRM/Event/Cart/BAO/Conference.php +++ b/CRM/Event/Cart/BAO/Conference.php @@ -1,4 +1,8 @@ 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(); @@ -31,6 +47,9 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl return $event_in_cart; } + /** + * @param bool $useWhere + */ function delete($useWhere = false) { $this->load_associations(); $contacts_to_delete = array(); @@ -50,10 +69,20 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl 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); @@ -66,10 +95,20 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl 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); @@ -81,6 +120,9 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl } } + /** + * @param $contact_id + */ public function remove_participant_by_contact_id($contact_id) { $to_remove = array(); foreach ($this->participants as $participant) { @@ -92,19 +134,35 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl $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; @@ -136,6 +194,9 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl } } + /** + * @return array + */ public function not_waiting_participants() { $result = array(); foreach ($this->participants as $participant) { @@ -146,19 +207,35 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl 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(); @@ -173,10 +250,20 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl 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) { @@ -187,6 +274,11 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl 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(); @@ -208,10 +300,18 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl } } + /** + * @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; diff --git a/CRM/Event/Cart/BAO/MerParticipant.php b/CRM/Event/Cart/BAO/MerParticipant.php index adb259fc43..3ab862bef1 100644 --- a/CRM/Event/Cart/BAO/MerParticipant.php +++ b/CRM/Event/Cart/BAO/MerParticipant.php @@ -25,12 +25,18 @@ +--------------------------------------------------------------------+ */ +/** + * 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; @@ -39,6 +45,12 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_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), @@ -63,18 +75,29 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { 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; @@ -82,6 +105,12 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { 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; @@ -89,6 +118,11 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { 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); @@ -101,6 +135,11 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { 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); @@ -111,6 +150,9 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { $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); @@ -120,6 +162,11 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { return $index + 1; } + /** + * @param $contact + * + * @return null + */ static function billing_address_from_contact($contact) { foreach ($contact->address as $loc) { if ($loc['is_billing']) { @@ -134,6 +181,9 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { return NULL; } + /** + * @return CRM_Event_Cart_Form_MerParticipant + */ function get_form() { return new CRM_Event_Cart_Form_MerParticipant($this); } diff --git a/CRM/Event/Cart/Controller/Checkout.php b/CRM/Event/Cart/Controller/Checkout.php index 66d1c6d23e..fe861bbab7 100644 --- a/CRM/Event/Cart/Controller/Checkout.php +++ b/CRM/Event/Cart/Controller/Checkout.php @@ -1,5 +1,14 @@ 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; @@ -119,6 +139,12 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { 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); @@ -140,6 +166,11 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { return $contact_id; } + /** + * @param $page_name + * + * @return mixed + */ function getValuesForPage($page_name) { $container = $this->controller->container(); return $container['values'][$page_name]; diff --git a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php index d96b08be7c..c165c99a9d 100644 --- a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php +++ b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php @@ -1,4 +1,8 @@ email as $email) { if ($email['is_primary']) { @@ -56,6 +65,11 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ return NULL; } + /** + * @param $event + * + * @return array + */ function build_price_options($event) { $price_fields_for_event = array(); $base_field_name = "event_{$event->id}_amount"; @@ -74,6 +88,9 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ return $price_fields_for_event; } + /** + * @return bool + */ function validate() { parent::validate(); if ($this->_errors) { @@ -135,6 +152,9 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ return empty($this->_errors); } + /** + * @return array + */ public function setDefaultValues() { $this->loadCart(); diff --git a/CRM/Event/Cart/Form/Checkout/Payment.php b/CRM/Event/Cart/Form/Checkout/Payment.php index 8f601bd1e0..decef950de 100644 --- a/CRM/Event/Cart/Form/Checkout/Payment.php +++ b/CRM/Event/Cart/Form/Checkout/Payment.php @@ -1,4 +1,8 @@ event_id); @@ -254,6 +269,10 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { $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; @@ -285,11 +304,18 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { $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(); @@ -356,6 +382,13 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { 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(); @@ -374,6 +407,9 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { return empty($errors) ? TRUE : $errors; } + /** + * @return bool + */ function validate() { if ($this->is_pay_later) { $this->_fields['credit_card_number']['is_required'] = FALSE; @@ -524,6 +560,12 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { $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}"]) { @@ -558,6 +600,14 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { 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']; @@ -623,6 +673,9 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { $this->set('total', $this->total); } + /** + * @return array + */ function setDefaultValues() { $defaults = parent::setDefaultValues(); diff --git a/CRM/Event/Cart/Form/Checkout/ThankYou.php b/CRM/Event/Cart/Form/Checkout/ThankYou.php index f653d3e3b9..63fe344aae 100644 --- a/CRM/Event/Cart/Form/Checkout/ThankYou.php +++ b/CRM/Event/Cart/Form/Checkout/ThankYou.php @@ -1,4 +1,8 @@ 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); @@ -31,6 +41,11 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { ))); } + /** + * @param $event_id + * + * @return array + */ function get_profile_groups($event_id) { $ufJoinParams = array( 'entity_table' => 'civicrm_event', @@ -41,6 +56,9 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { 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); @@ -55,27 +73,53 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { 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, diff --git a/CRM/Event/Cart/Page/AddToCart.php b/CRM/Event/Cart/Page/AddToCart.php index f22f3fd480..8218a2b2f2 100644 --- a/CRM/Event/Cart/Page/AddToCart.php +++ b/CRM/Event/Cart/Page/AddToCart.php @@ -1,4 +1,8 @@ controller->getPrint() || $this->getVar('_id') <= 0 || $this->_action & CRM_Core_Action::DELETE) { return parent::getTemplateFileName(); diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php index ab4b017397..cc998e868c 100644 --- a/CRM/Event/Form/ManageEvent/EventInfo.php +++ b/CRM/Event/Form/ManageEvent/EventInfo.php @@ -357,6 +357,11 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { * @return $defaults an array of custom data defaults. */ + /** + * @param $templateId + * + * @return array + */ public function templateCustomDataValues($templateId) { $defaults = array(); if (!$templateId) { diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 245055e7ce..5a1ef70c4b 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -437,6 +437,9 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent $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; diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index a22c87ae4d..3bf3823b77 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -38,6 +38,11 @@ */ class CRM_Event_Form_ManageEvent_TabHeader { + /** + * @param $form + * + * @return array + */ static function build(&$form) { $tabs = $form->get('tabHeader'); if (!$tabs || empty($_GET['reset'])) { @@ -62,6 +67,12 @@ class CRM_Event_Form_ManageEvent_TabHeader { return $tabs; } + /** + * @param $form + * + * @return array + * @throws Exception + */ static function process(&$form) { if ($form->getVar('_id') <= 0) { return NULL; @@ -98,7 +109,7 @@ class CRM_Event_Form_ManageEvent_TabHeader { $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 @@ -187,11 +198,19 @@ WHERE e.id = %1 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; diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php index 1573307296..7ff20fb1ac 100644 --- a/CRM/Event/Form/ParticipantFeeSelection.php +++ b/CRM/Event/Form/ParticipantFeeSelection.php @@ -213,6 +213,13 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form { $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; @@ -256,6 +263,11 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form { } } + /** + * @param $params + * + * @return mixed + */ function emailReceipt(&$params) { $updatedLineItem = CRM_Price_BAO_LineItem::getLineItems($this->_participantId, 'participant', NULL, FALSE); $lineItem = array(); diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 1072a9efec..37a9074bb8 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -678,6 +678,12 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { } } + /** + * @param $form + * @param $eventID + * + * @throws Exception + */ static function initEventFee(&$form, $eventID) { // get price info @@ -940,6 +946,13 @@ WHERE v.option_group_id = g.id * @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)) { @@ -1032,6 +1045,12 @@ WHERE v.option_group_id = g.id * @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; @@ -1076,6 +1095,11 @@ WHERE v.option_group_id = g.id * @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'); @@ -1141,6 +1165,11 @@ WHERE v.option_group_id = g.id return $optionsCount; } + /** + * @param string $suffix + * + * @return null|string + */ function checkTemplateFileExists($suffix = '') { if ($this->_eventId) { $templateName = $this->_name; @@ -1157,11 +1186,17 @@ WHERE v.option_group_id = g.id 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(); @@ -1307,6 +1342,9 @@ WHERE v.option_group_id = g.id } // set the first participant ID if not set, CRM-10032 + /** + * @param $participantID + */ function processFirstParticipant($participantID) { $this->_participantId = $participantID; $this->set('participantId', $this->_participantId); diff --git a/CRM/Event/Form/Registration/AdditionalParticipant.php b/CRM/Event/Form/Registration/AdditionalParticipant.php index 68dab3a399..bc4a6148c8 100644 --- a/CRM/Event/Form/Registration/AdditionalParticipant.php +++ b/CRM/Event/Form/Registration/AdditionalParticipant.php @@ -513,6 +513,12 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R return $errors; } + /** + * @param $self + * @param $fields + * + * @return bool + */ function validatePaymentValues($self, $fields) { if (!empty($self->_params[0]['bypass_payment']) || @@ -725,6 +731,11 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R } } + /** + * @param $additionalParticipant + * + * @return array + */ public static function &getPages($additionalParticipant) { $details = array(); for ($i = 1; $i <= $additionalParticipant; $i++) { @@ -812,6 +823,10 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R } } + /** + * @param $elementName + * @param array $optionIds + */ function resetSubmittedValue($elementName, $optionIds = array( )) { if (empty($elementName) || diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 4905bc8f1a..f5946e31e3 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -1086,6 +1086,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { return $contactID; } + /** + * @param $form + */ public static function assignProfiles(&$form) { $addParticipantProfile = $form->get('addParticipantProfile'); $primaryParticipantProfile = $form->get('primaryParticipantProfile'); diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index a0285f00e8..8b0f44eb3b 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -692,6 +692,9 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } } + /** + * @param $form + */ public static function formatFieldsForOptionFull(&$form) { $priceSet = $form->get('priceSet'); $priceSetId = $form->get('priceSetId'); @@ -1205,6 +1208,10 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * access public * */ + /** + * @param $params + * @param null $contactID + */ public function processRegistration($params, $contactID = NULL) { $session = CRM_Core_Session::singleton(); $this->_participantInfo = array(); diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index e4be22736d..6c66f3673b 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -528,6 +528,9 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { } } + /** + * @return null + */ function getFormValues() { return NULL; } diff --git a/CRM/Event/Form/SearchEvent.php b/CRM/Event/Form/SearchEvent.php index 4df0277619..af55dc0f18 100644 --- a/CRM/Event/Form/SearchEvent.php +++ b/CRM/Event/Form/SearchEvent.php @@ -34,6 +34,9 @@ */ class CRM_Event_Form_SearchEvent extends CRM_Core_Form { + /** + * @return array + */ function setDefaultValues() { $defaults = array(); $defaults['eventsByDates'] = 0; diff --git a/CRM/Event/Form/Task.php b/CRM/Event/Form/Task.php index f32c5091fc..efde2567ba 100644 --- a/CRM/Event/Form/Task.php +++ b/CRM/Event/Form/Task.php @@ -79,6 +79,10 @@ class CRM_Event_Form_Task extends CRM_Core_Form { self::preProcessCommon($this); } + /** + * @param $form + * @param bool $useTable + */ static function preProcessCommon(&$form, $useTable = FALSE) { $form->_participantIds = array(); diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index b3f02b96b7..e0078ef21c 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -339,6 +339,12 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { } //end of function + /** + * @param $participantId + * @param $statusId + * + * @return Ambigous|void + */ static function updatePendingOnlineContribution($participantId, $statusId) { if (!$participantId || !$statusId) { return; diff --git a/CRM/Event/Import/Field.php b/CRM/Event/Import/Field.php index 3befefa849..d3195467bb 100644 --- a/CRM/Event/Import/Field.php +++ b/CRM/Event/Import/Field.php @@ -24,6 +24,10 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ */ + +/** + * Class CRM_Event_Import_Field + */ class CRM_Event_Import_Field { /**#@+ @@ -64,6 +68,14 @@ 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; @@ -86,6 +98,9 @@ class CRM_Event_Import_Field { $this->_value = $value; } + /** + * @return bool + */ function validate() { if (CRM_Utils_System::isNull($this->_value)) { return TRUE; diff --git a/CRM/Event/Import/Parser.php b/CRM/Event/Import/Parser.php index 904ed039d5..24c9629add 100644 --- a/CRM/Event/Import/Parser.php +++ b/CRM/Event/Import/Parser.php @@ -65,6 +65,18 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { */ 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, @@ -317,6 +329,13 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { 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); diff --git a/CRM/Event/Info.php b/CRM/Event/Info.php index ac38639c02..1d6d2d0f05 100644 --- a/CRM/Event/Info.php +++ b/CRM/Event/Info.php @@ -41,6 +41,9 @@ class CRM_Event_Info extends CRM_Core_Component_Info { protected $keyword = 'event'; // docs inherited from interface + /** + * @return array + */ public function getInfo() { return array( 'name' => 'CiviEvent', @@ -52,6 +55,11 @@ class CRM_Event_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * @param bool $getAllUnconditionally + * + * @return array + */ public function getPermissions($getAllUnconditionally = FALSE) { return array( 'access CiviEvent', @@ -64,6 +72,9 @@ class CRM_Event_Info extends CRM_Core_Component_Info { ); } + /** + * @return array + */ public function getAnonymousPermissionWarnings() { return array( 'access CiviEvent', @@ -71,6 +82,9 @@ class CRM_Event_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * @return array + */ public function getUserDashboardElement() { return array('name' => ts('Events'), 'title' => ts('Your Event(s)'), @@ -80,6 +94,9 @@ class CRM_Event_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * @return array + */ public function registerTab() { return array('title' => ts('Events'), 'id' => 'participant', @@ -89,6 +106,9 @@ class CRM_Event_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * @return array + */ public function registerAdvancedSearchPane() { return array('title' => ts('Events'), 'weight' => 40, @@ -96,6 +116,9 @@ class CRM_Event_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * @return array + */ public function getActivityTypes() { $types = array(); $types['Event'] = array('title' => ts('Event'), @@ -105,6 +128,10 @@ class CRM_Event_Info extends CRM_Core_Component_Info { } // 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') diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php index 1e9723564e..e5011dcc8a 100644 --- a/CRM/Event/Page/EventInfo.php +++ b/CRM/Event/Page/EventInfo.php @@ -122,7 +122,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { // 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) { @@ -335,6 +335,9 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { return parent::run(); } + /** + * @return string + */ function getTemplateFileName() { if ($this->_id) { $templateFile = "CRM/Event/Page/{$this->_id}/EventInfo.tpl"; diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 85b2ab12f7..3183936fed 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -416,6 +416,13 @@ ORDER BY start_date desc $form->run(); } + /** + * @param $params + * @param bool $sortBy + * @param $force + * + * @return string + */ function whereClause(&$params, $sortBy = TRUE, $force) { $values = array(); $clauses = array(); @@ -504,6 +511,10 @@ ORDER BY start_date desc return !empty($clauses) ? implode(' AND ', $clauses) : '(1)'; } + /** + * @param $whereClause + * @param $whereParams + */ function pager($whereClause, $whereParams) { $params['status'] = ts('Event %%StatusMessage%%'); @@ -526,6 +537,10 @@ SELECT count(id) $this->assign_by_ref('pager', $this->_pager); } + /** + * @param $whereClause + * @param $whereParams + */ function pagerAtoZ($whereClause, $whereParams) { $query = " diff --git a/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php b/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php index 81b7b753b6..eb498070c8 100644 --- a/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php +++ b/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php @@ -65,6 +65,9 @@ class CRM_Event_Page_ParticipantListing_NameStatusAndDate extends CRM_Core_Page $this->assign('displayRecent', FALSE); } + /** + * @return string + */ function run() { $this->preProcess(); @@ -117,6 +120,11 @@ LIMIT $offset, $rowCount"; return parent::run(); } + /** + * @param $fromClause + * @param $whereClause + * @param $whereParams + */ function pager($fromClause, $whereClause, $whereParams) { $params = array(); @@ -140,6 +148,9 @@ SELECT count( civicrm_contact.id ) $this->assign_by_ref('pager', $this->_pager); } + /** + * @return string + */ function orderBy() { static $headers = NULL; if (!$headers) { diff --git a/CRM/Event/Page/ParticipantListing/Simple.php b/CRM/Event/Page/ParticipantListing/Simple.php index 08ca678269..67a0aefa5f 100644 --- a/CRM/Event/Page/ParticipantListing/Simple.php +++ b/CRM/Event/Page/ParticipantListing/Simple.php @@ -56,6 +56,9 @@ class CRM_Event_Page_ParticipantListing_Simple extends CRM_Core_Page { $this->assign('displayRecent', FALSE); } + /** + * @return string + */ function run() { $this->preProcess(); @@ -104,6 +107,11 @@ LIMIT $offset, $rowCount"; return parent::run(); } + /** + * @param $fromClause + * @param $whereClause + * @param $whereParams + */ function pager($fromClause, $whereClause, $whereParams) { $params = array(); @@ -128,6 +136,9 @@ SELECT count( civicrm_contact.id ) $this->assign_by_ref('pager', $this->_pager); } + /** + * @return string + */ function orderBy() { static $headers = NULL; if (!$headers) { diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php index e3634558cc..c81664a558 100644 --- a/CRM/Event/Selector/Search.php +++ b/CRM/Event/Selector/Search.php @@ -510,10 +510,16 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co return self::$_columnHeaders; } + /** + * @return mixed + */ function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } + /** + * @return string + */ function &getQuery() { return $this->_query; } -- 2.25.1