From 186c9c17160934d9fec4bb0e3fae444100de2634 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 19 May 2014 15:18:27 +1200 Subject: [PATCH] autogenerate missing comments --- CRM/Contribute/BAO/Contribution.php | 85 +++++++++++++++ CRM/Contribute/BAO/Contribution/Utils.php | 29 +++++ CRM/Contribute/BAO/ContributionPage.php | 11 ++ CRM/Contribute/BAO/ContributionRecur.php | 12 ++ CRM/Contribute/BAO/ContributionSoft.php | 18 +++ CRM/Contribute/BAO/Query.php | 43 ++++++++ CRM/Contribute/Form/AbstractEditPayment.php | 28 +++++ CRM/Contribute/Form/AdditionalPayment.php | 27 +++++ CRM/Contribute/Form/Contribution/Main.php | 15 +++ CRM/Contribute/Form/ContributionBase.php | 19 ++++ CRM/Contribute/Form/ContributionPage.php | 9 ++ .../Form/ContributionPage/TabHeader.php | 18 +++ .../Form/ContributionPage/Widget.php | 11 ++ CRM/Contribute/Form/Task.php | 4 + CRM/Contribute/Form/Task/PDFLetter.php | 12 ++ CRM/Contribute/Form/Task/Status.php | 5 + CRM/Contribute/Form/UpdateBilling.php | 12 ++ CRM/Contribute/Import/Field.php | 11 ++ CRM/Contribute/Import/Parser.php | 49 +++++++++ CRM/Contribute/Info.php | 92 ++++++++++++++++ CRM/Contribute/Page/ContributionPage.php | 19 ++++ CRM/Contribute/Page/PaymentInfo.php | 12 +- CRM/Contribute/Selector/Search.php | 9 ++ api/v3/FinancialTrxn.php | 103 ++++++++++++++++++ 24 files changed, 652 insertions(+), 1 deletion(-) create mode 100644 api/v3/FinancialTrxn.php diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 19cf4f3f9b..e92faa48a4 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -69,6 +69,15 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { /* * construct method */ + /** + * class constructor + * + * @access public + * @return \CRM_Contribute_DAO_Contribution + */ + /** + * + */ function __construct() { parent::__construct(); } @@ -561,6 +570,9 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { return self::$_importableFields; } + /** + * @return array + */ static function &exportableFields() { if (!self::$_exportableFields) { if (!self::$_exportableFields) { @@ -642,6 +654,13 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { return self::$_exportableFields; } + /** + * @param null $status + * @param null $startDate + * @param null $endDate + * + * @return array|null + */ static function getTotalAmountAndCount($status = NULL, $startDate = NULL, $endDate = NULL) { $where = array(); switch ($status) { @@ -905,6 +924,11 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta return $extraFields; } + /** + * @param $pageID + * + * @return array + */ static function getCurrentandGoalAmount($pageID) { $query = " SELECT p.goal_amount as goal, sum( c.total_amount ) as total @@ -987,6 +1011,11 @@ WHERE civicrm_contribution.contact_id = civicrm_contact.id return CRM_Core_DAO::singleValueQuery($query, CRM_Core_DAO::$_nullArray); } + /** + * @param $contactID + * + * @return array + */ static function annual($contactID) { if (is_array($contactID)) { $contactIDs = implode(',', $contactID); @@ -1687,6 +1716,12 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ return $componentDetails; } + /** + * @param $contactId + * @param bool $includeSoftCredit + * + * @return null|string + */ static function contributionCount($contactId, $includeSoftCredit = TRUE) { if (!$contactId) { return 0; @@ -1834,6 +1869,15 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * @param boolean $loadAll - load all related objects - even where id not passed in? (allows API to call this) * Note that the unit test for the BaseIPN class tests this function */ + /** + * @param $input + * @param $ids + * @param bool $required + * @param bool $loadAll + * + * @return bool + * @throws Exception + */ function loadRelatedObjects(&$input, &$ids, $required = FALSE, $loadAll = false) { if($loadAll){ $ids = array_merge($this->getComponentDetails($this->id),$ids); @@ -2006,6 +2050,15 @@ WHERE contribution_id = %1 "; * function doing emails / pdfs with it * @return array $messageArray - messages */ + /** + * @param $input + * @param $ids + * @param $values + * @param bool $recur + * @param bool $returnMessageText + * + * @throws Exception + */ function composeMessageArray(&$input, &$ids, &$values, $recur = FALSE, $returnMessageText = TRUE) { if (empty($this->_relatedObjects)) { $this->loadRelatedObjects($input, $ids); @@ -2135,6 +2188,13 @@ WHERE contribution_id = %1 "; * * NB don't add direct calls to the function as we intend to change the signature */ + /** + * @param $input + * @param $values + * @param array $ids + * + * @return mixed + */ function _gatherMessageValues($input, &$values, $ids = array()) { // set display address of contributor if ($this->address_id) { @@ -3012,6 +3072,14 @@ WHERE contribution_id = %1 "; * @param array $trxnData : to take user provided input of transaction details. * @param string $paymentType 'owed' for purpose of recording partial payments, 'refund' for purpose of recording refund payments */ + /** + * @param $contributionId + * @param $trxnsData + * @param string $paymentType + * @param null $participantId + * + * @return null|object + */ static function recordAdditionalPayment($contributionId, $trxnsData, $paymentType = 'owed', $participantId = NULL) { $statusId = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name'); $getInfoOf['id'] = $contributionId; @@ -3152,6 +3220,15 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) return $financialTrxn; } + /** + * @param $entityObj + * @param $trxnObj + * @param $activityType + * @param $component + * @param $contributionId + * + * @throws CRM_Core_Exception + */ static function addActivityForPayment($entityObj, $trxnObj, $activityType, $component, $contributionId) { if ($component == 'event') { $date = CRM_Utils_Date::isoToMysql($trxnObj->trxn_date); @@ -3190,6 +3267,14 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) CRM_Activity_BAO_Activity::create($activityParams); } + /** + * @param $id + * @param $component + * @param bool $getTrxnInfo + * @param bool $usingLineTotal + * + * @return mixed + */ static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $usingLineTotal = FALSE) { if ($component == 'event') { $entity = 'participant'; diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 9439d93d9f..b9c0864327 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -428,6 +428,11 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) return $params; } + /** + * @param $params + * @param $contactID + * @param $mail + */ static function createCMSUser(&$params, $contactID, $mail) { // lets ensure we only create one CMS user static $created = FALSE; @@ -445,6 +450,12 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) } } + /** + * @param $params + * @param string $type + * + * @return bool + */ static function _fillCommonParams(&$params, $type = 'paypal') { if (array_key_exists('transaction', $params)) { $transaction = &$params['transaction']; @@ -509,6 +520,14 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) return TRUE; } + /** + * @param $apiParams + * @param $mapper + * @param string $type + * @param bool $category + * + * @return array + */ static function formatAPIParams($apiParams, $mapper, $type = 'paypal', $category = TRUE) { $type = strtolower($type); @@ -702,6 +721,11 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) } } + /** + * @param $params + * + * @return bool + */ static function processAPIContribution($params) { if (empty($params) || array_key_exists('error', $params)) { return FALSE; @@ -780,6 +804,11 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) return TRUE; } + /** + * @param $contactID + * + * @return mixed + */ static function getFirstLastDetails($contactID) { static $_cache; diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 893ae5dc4e..aa284dc44e 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -74,6 +74,10 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio return CRM_Core_DAO::setFieldValue('CRM_Contribute_DAO_ContributionPage', $id, 'is_active', $is_active); } + /** + * @param $id + * @param $values + */ static function setValues($id, &$values) { $params = array( 'id' => $id, @@ -414,6 +418,13 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio * Construct the message to be sent by the send function * */ + /** + * @param $tplParams + * @param $contactID + * @param $isTest + * + * @return array + */ function composeMessage($tplParams, $contactID, $isTest) { $sendTemplateParams = array( 'groupName' => $tplParams['membershipID'] ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution', diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index d60afb5e0c..2f36c94cd9 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -154,6 +154,12 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi return $result; } + /** + * @param $id + * @param $mode + * + * @return array|null + */ static function getPaymentProcessor($id, $mode) { //FIX ME: $sql = " @@ -371,6 +377,12 @@ SELECT r.payment_processor_id return FALSE; } + /** + * @param $entityID + * @param string $entity + * + * @return null|Object + */ static function getSubscriptionDetails($entityID, $entity = 'recur') { $sql = " SELECT rec.id as recur_id, diff --git a/CRM/Contribute/BAO/ContributionSoft.php b/CRM/Contribute/BAO/ContributionSoft.php index 72ee3e7651..4aa0fe76a9 100644 --- a/CRM/Contribute/BAO/ContributionSoft.php +++ b/CRM/Contribute/BAO/ContributionSoft.php @@ -103,6 +103,12 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio $contributionSoft->delete(); } + /** + * @param $contact_id + * @param int $isTest + * + * @return array + */ static function getSoftContributionTotals($contact_id, $isTest = 0) { $query = ' SELECT SUM(amount) as amount, AVG(total_amount) as average, cc.currency @@ -197,6 +203,12 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio return $softContribution; } + /** + * @param $contributionID + * @param bool $isPCP + * + * @return array + */ static function getSoftCreditIds($contributionID , $isPCP = FALSE) { $query = " SELECT id @@ -306,6 +318,12 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @static */ + /** + * @param $form + * @param $params + * @param $honoreeprofileId + * @param null $honorId + */ static function formatHonoreeProfileFields($form, $params, $honoreeprofileId, $honorId = NULL) { $profileContactType = CRM_Core_BAO_UFGroup::getContactType($honoreeprofileId); $profileFields = CRM_Core_BAO_UFGroup::getFields($honoreeprofileId); diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 922622b72e..30d92de62f 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -204,6 +204,9 @@ class CRM_Contribute_BAO_Query { // LCD 716 END } + /** + * @param $query + */ static function where(&$query) { $grouping = NULL; @@ -235,6 +238,10 @@ class CRM_Contribute_BAO_Query { } } + /** + * @param $values + * @param $query + */ static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; @@ -659,6 +666,13 @@ class CRM_Contribute_BAO_Query { } } + /** + * @param $name + * @param $mode + * @param $side + * + * @return null|string + */ static function from($name, $mode, $side) { $from = NULL; switch ($name) { @@ -782,6 +796,9 @@ class CRM_Contribute_BAO_Query { return $from; } + /** + * @param $query + */ static function initializeAnySoftCreditClause(&$query) { if (self::isSoftCreditOptionEnabled($query->_params)) { if ($query->_mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) { @@ -792,6 +809,11 @@ class CRM_Contribute_BAO_Query { } } + /** + * @param array $queryParams + * + * @return bool + */ static function isSoftCreditOptionEnabled($queryParams = array()) { static $tempTableFilled = FALSE; if (!empty($queryParams)) { @@ -826,6 +848,11 @@ class CRM_Contribute_BAO_Query { return FALSE; } + /** + * @param bool $isExportMode + * + * @return array + */ static function softCreditReturnProperties($isExportMode = False) { $properties = array( 'contribution_soft_credit_name' => 1, @@ -838,6 +865,12 @@ class CRM_Contribute_BAO_Query { return $properties; } + /** + * @param $mode + * @param bool $includeCustomFields + * + * @return array|null + */ static function defaultReturnProperties($mode, $includeCustomFields = TRUE) { $properties = NULL; if ($mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) { @@ -1049,9 +1082,16 @@ class CRM_Contribute_BAO_Query { $form->setDefaults(array('contribution_test' => 0)); } + /** + * @param $row + * @param $id + */ static function searchAction(&$row, $id) { } + /** + * @param $tables + */ static function tableNames(&$tables) { // Add contribution table if (!empty($tables['civicrm_product'])) { @@ -1088,6 +1128,9 @@ class CRM_Contribute_BAO_Query { return TRUE; } + /** + * @return array + */ static function getRecurringFields() { return array( 'contribution_recur_start_date' => ts('Recurring Contribution Start Date'), diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 0bd7a97ae3..f9b9b054df 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -160,6 +160,9 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Core_Form { protected $_formType; protected $_cdType; + /** + * @param $id + */ public function showRecordLinkMesssage($id) { $statusId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $id, 'contribution_status_id'); if (CRM_Contribute_PseudoConstant::contributionStatus($statusId, 'name') == 'Partially paid') { @@ -172,6 +175,10 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Core_Form { } } + /** + * @param $id + * @param $values + */ public function buildValuesAndAssignOnline_Note_Type($id, &$values) { $ids = array(); $params = array('id' => $id); @@ -403,6 +410,11 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co $this->assign('hidePayPalExpress', TRUE); } + /** + * @param $submittedValues + * + * @return mixed + */ public function getCurrency($submittedValues) { // get current currency from DB or use default currency $config = CRM_Core_Config::singleton(); @@ -419,6 +431,11 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co return $result; } + /** + * @param $financialTypeId + * + * @return array + */ public function getFinancialAccounts($financialTypeId) { $financialAccounts = array(); CRM_Core_PseudoConstant::populate($financialAccounts, @@ -430,6 +447,12 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co return $financialAccounts; } + /** + * @param $financialTypeId + * @param $relationTypeId + * + * @return mixed + */ public function getFinancialAccount($financialTypeId, $relationTypeId) { $financialAccounts = $this->getFinancialAccounts($financialTypeId); return CRM_Utils_Array::value($relationTypeId, $financialAccounts); @@ -511,6 +534,11 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co } } + /** + * @param $submittedValues + * + * @return mixed + */ public function unsetCreditCardFields($submittedValues) { //Offline Contribution. $unsetParams = array( diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index f54af2d560..04f9fdcf28 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -158,6 +158,18 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract } } + /** + * This virtual function is used to set the default values of + * various form elements + * + * access public + * + * @return array reference to the array of default values + * + */ + /** + * @return array + */ public function setDefaultValues() { if ($this->_view == 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) { return; @@ -351,6 +363,13 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract $this->addFormRule(array('CRM_Contribute_Form_AdditionalPayment', 'formRule'), $this); } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = array(); if ($self->_paymentType == 'owed' && $fields['total_amount'] > $self->_owed) { @@ -407,6 +426,9 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract } } + /** + * @param $submittedValues + */ public function processCreditCard($submittedValues) { $config = CRM_Core_Config::singleton(); $session = CRM_Core_Session::singleton(); @@ -627,6 +649,11 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract } } + /** + * @param $params + * + * @return mixed + */ function emailReceipt(&$params) { // email receipt sending // send message template diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 38fe6df3bd..24dbec05ad 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -170,6 +170,15 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } } + /** + * set the default values + * + * @return void + * @access public + */ + /** + * + */ function setDefaultValues() { // check if the user is registered and we have a contact ID $contactID = $this->getContactID(); @@ -1027,6 +1036,12 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu return empty($errors) ? TRUE : $errors; } + /** + * @param $params + * @param $form + * + * @return int|mixed|null|string + */ public static function computeAmount(&$params, &$form) { $amount = NULL; diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 4d953bc1b8..ef6fcae79a 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -829,11 +829,30 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { return NULL; } + /** + * Use the form name to create the tpl file name + * + * @return string + * @access public + */ + /** + * @return string + */ function getTemplateFileName() { $fileName = $this->checkTemplateFileExists(); return $fileName ? $fileName : parent::getTemplateFileName(); } + /** + * Default extra tpl file basically just replaces .tpl with .extra.tpl + * i.e. we dont override + * + * @return string + * @access public + */ + /** + * @return string + */ function overrideExtraTemplateFileName() { $fileName = $this->checkTemplateFileExists('extra.'); return $fileName ? $fileName : parent::overrideExtraTemplateFileName(); diff --git a/CRM/Contribute/Form/ContributionPage.php b/CRM/Contribute/Form/ContributionPage.php index 0ed5432cd6..0b3fdd6329 100644 --- a/CRM/Contribute/Form/ContributionPage.php +++ b/CRM/Contribute/Form/ContributionPage.php @@ -435,6 +435,15 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form { } } + /** + * Use the form name to create the tpl file name + * + * @return string + * @access public + */ + /** + * @return string + */ function getTemplateFileName() { if ($this->controller->getPrint() || $this->getVar('_id') <= 0 || ($this->_action & CRM_Core_Action::DELETE) || diff --git a/CRM/Contribute/Form/ContributionPage/TabHeader.php b/CRM/Contribute/Form/ContributionPage/TabHeader.php index 4d47a1055e..8aa89253dc 100644 --- a/CRM/Contribute/Form/ContributionPage/TabHeader.php +++ b/CRM/Contribute/Form/ContributionPage/TabHeader.php @@ -37,6 +37,11 @@ * Helper class to build navigation links */ class CRM_Contribute_Form_ContributionPage_TabHeader { + /** + * @param $form + * + * @return array + */ static function build(&$form) { $tabs = $form->get('tabHeader'); if (!$tabs || empty($_GET['reset'])) { @@ -52,6 +57,11 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { return $tabs; } + /** + * @param $form + * + * @return array + */ static function process(&$form) { if ($form->getVar('_id') <= 0) { return NULL; @@ -169,11 +179,19 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { 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/Contribute/Form/ContributionPage/Widget.php b/CRM/Contribute/Form/ContributionPage/Widget.php index f4dc41545c..887858a754 100644 --- a/CRM/Contribute/Form/ContributionPage/Widget.php +++ b/CRM/Contribute/Form/ContributionPage/Widget.php @@ -128,6 +128,17 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co ); } + /** + * This function sets the default values for the form. Note that in edit/view mode + * the default values are retrieved from the database + * + * @access public + * + * @return void + */ + /** + * + */ function setDefaultValues() { $defaults = array(); // check if there is a widget already created diff --git a/CRM/Contribute/Form/Task.php b/CRM/Contribute/Form/Task.php index 66cbd3c0d1..4e8b1278f4 100644 --- a/CRM/Contribute/Form/Task.php +++ b/CRM/Contribute/Form/Task.php @@ -100,6 +100,10 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form { self::preProcessCommon($this); } + /** + * @param $form + * @param bool $useTable + */ static function preProcessCommon(&$form, $useTable = FALSE) { $form->_contributionIds = array(); diff --git a/CRM/Contribute/Form/Task/PDFLetter.php b/CRM/Contribute/Form/Task/PDFLetter.php index dbb546e405..86ace17144 100644 --- a/CRM/Contribute/Form/Task/PDFLetter.php +++ b/CRM/Contribute/Form/Task/PDFLetter.php @@ -78,6 +78,18 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task { $this->assign('single', $this->_single); } + /** + * This virtual function is used to set the default values of + * various form elements + * + * access public + * + * @return array reference to the array of default values + * + */ + /** + * @return array + */ function setDefaultValues() { $defaults = array(); if (isset($this->_activityId)) { diff --git a/CRM/Contribute/Form/Task/Status.php b/CRM/Contribute/Form/Task/Status.php index 8dc47e31e3..152564908c 100644 --- a/CRM/Contribute/Form/Task/Status.php +++ b/CRM/Contribute/Form/Task/Status.php @@ -301,6 +301,11 @@ AND co.id IN ( $contribIDs )"; CRM_Core_Session::setStatus(ts('Contribution status has been updated for selected record(s).'), ts('Status Updated'), 'success'); } + /** + * @param $contributionIDs + * + * @return array + */ static function &getDetails($contributionIDs) { $query = " SELECT c.id as contribution_id, diff --git a/CRM/Contribute/Form/UpdateBilling.php b/CRM/Contribute/Form/UpdateBilling.php index 486552a0e7..bc0d9e48c0 100644 --- a/CRM/Contribute/Form/UpdateBilling.php +++ b/CRM/Contribute/Form/UpdateBilling.php @@ -126,6 +126,18 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { CRM_Contribute_BAO_ContributionRecur::setSubscriptionContext(); } + /** + * This virtual function is used to set the default values of + * various form elements + * + * access public + * + * @return array reference to the array of default values + * + */ + /** + * @return array + */ function setDefaultValues() { $this->_defaults = array(); diff --git a/CRM/Contribute/Import/Field.php b/CRM/Contribute/Import/Field.php index afbce66776..718cc60745 100644 --- a/CRM/Contribute/Import/Field.php +++ b/CRM/Contribute/Import/Field.php @@ -91,6 +91,14 @@ class CRM_Contribute_Import_Field { */ public $_softCreditField; + /** + * @param $name + * @param $title + * @param int $type + * @param string $headerPattern + * @param string $dataPattern + * @param null $softCreditField + */ function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//', $softCreditField = NULL) { $this->_name = $name; $this->_title = $title; @@ -113,6 +121,9 @@ class CRM_Contribute_Import_Field { $this->_value = $value; } + /** + * @return bool + */ function validate() { if (CRM_Utils_System::isNull($this->_value)) { diff --git a/CRM/Contribute/Import/Parser.php b/CRM/Contribute/Import/Parser.php index 3aa687323f..a0ede60f23 100644 --- a/CRM/Contribute/Import/Parser.php +++ b/CRM/Contribute/Import/Parser.php @@ -115,6 +115,18 @@ abstract class CRM_Contribute_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, @@ -414,12 +426,18 @@ pppp * @return void } } + /** + * @param $elements + */ function setActiveFieldSoftCredit($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_softCreditField = $elements[$i]; } } + /** + * @param $elements + */ function setActiveFieldSoftCreditType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_softCreditType = $elements[$i]; @@ -455,6 +473,13 @@ pppp * @return void 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_Contribute_Import_Field($name, $title, $type, $headerPattern, $dataPattern); @@ -583,6 +608,18 @@ pppp * @return void fclose($fd); } + /** + * Determines the file extension based on error code + * + * @var $type error code constant + * @return string + * @static + */ + /** + * @param error $type + * + * @return string + */ static function errorFileName($type) { $fileName = NULL; if (empty($type)) { @@ -609,6 +646,18 @@ pppp * @return void return $fileName; } + /** + * Determines the file name based on error code + * + * @var $type error code constant + * @return string + * @static + */ + /** + * @param error $type + * + * @return string + */ static function saveFileName($type) { $fileName = NULL; if (empty($type)) { diff --git a/CRM/Contribute/Info.php b/CRM/Contribute/Info.php index f2b2cf6e64..8c95978dc9 100644 --- a/CRM/Contribute/Info.php +++ b/CRM/Contribute/Info.php @@ -42,6 +42,18 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { protected $keyword = 'contribute'; // docs inherited from interface + /** + * Provides base information about the component. + * Needs to be implemented in component's information + * class. + * + * @return array collection of required component settings + * @access public + * + */ + /** + * @return array + */ public function getInfo() { return array( 'name' => 'CiviContribute', @@ -53,6 +65,24 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * Provides permissions that are used by component. + * Needs to be implemented in component's information + * class. + * + * NOTE: if using conditionally permission return, + * implementation of $getAllUnconditionally is required. + * + * @param bool $getAllUnconditionally + * + * @return array|null collection of permissions, null if none + * @access public + */ + /** + * @param bool $getAllUnconditionally + * + * @return array|null + */ public function getPermissions($getAllUnconditionally = FALSE) { return array( 'access CiviContribute', @@ -62,6 +92,15 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { ); } + /** + * Provides permissions that are unwise for Anonymous Roles to have + * + * @return array list of permissions + * @see CRM_Component_Info::getPermissions + */ + /** + * @return array + */ public function getAnonymousPermissionWarnings() { return array( 'access CiviContribute', @@ -69,6 +108,18 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * Provides information about user dashboard element + * offered by this component. + * + * @return array|null collection of required dashboard settings, + * null if no element offered + * @access public + * + */ + /** + * @return array|null + */ public function getUserDashboardElement() { return array('name' => ts('Contributions'), 'title' => ts('Your Contribution(s)'), @@ -78,6 +129,18 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * Provides information about user dashboard element + * offered by this component. + * + * @return array|null collection of required dashboard settings, + * null if no element offered + * @access public + * + */ + /** + * @return array|null + */ public function registerTab() { return array('title' => ts('Contributions'), 'url' => 'contribution', @@ -86,6 +149,18 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * Provides information about advanced search pane + * offered by this component. + * + * @return array|null collection of required pane settings, + * null if no element offered + * @access public + * + */ + /** + * @return array|null + */ public function registerAdvancedSearchPane() { return array( 'title' => ts('Contributions'), @@ -94,11 +169,28 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { } // docs inherited from interface + /** + * Provides potential activity types that this + * component might want to register in activity history. + * Needs to be implemented in component's information + * class. + * + * @return array|null collection of activity types + * @access public + * + */ + /** + * @return array|null + */ public function getActivityTypes() { return NULL; } // add shortcut to Create New + /** + * @param $shortCuts + * @param $newCredit + */ public function creatNewShortcut(&$shortCuts, $newCredit) { if (CRM_Core_Permission::check('access CiviContribute') && CRM_Core_Permission::check('edit contributions') diff --git a/CRM/Contribute/Page/ContributionPage.php b/CRM/Contribute/Page/ContributionPage.php index 029f090315..f0c2417699 100644 --- a/CRM/Contribute/Page/ContributionPage.php +++ b/CRM/Contribute/Page/ContributionPage.php @@ -554,6 +554,12 @@ ORDER BY title asc $form->run(); } + /** + * @param $params + * @param bool $sortBy + * + * @return int|string + */ function whereClause(&$params, $sortBy = TRUE) { $values = $clauses = array(); $title = $this->get('title'); @@ -614,6 +620,10 @@ ORDER BY title asc return implode(' AND ', $clauses); } + /** + * @param $whereClause + * @param $whereParams + */ function pager($whereClause, $whereParams) { $params['status'] = ts('Contribution %%StatusMessage%%'); @@ -636,6 +646,10 @@ SELECT count(id) $this->assign_by_ref('pager', $this->_pager); } + /** + * @param $whereClause + * @param $whereParams + */ function pagerAtoZ($whereClause, $whereParams) { $query = " @@ -650,6 +664,11 @@ SELECT count(id) $this->assign('aToZ', $aToZBar); } + /** + * @param $sectionsInfo + * + * @return array + */ function formatConfigureLinks($sectionsInfo) { //build the formatted configure links. $formattedConfLinks = self::configureActionLinks(); diff --git a/CRM/Contribute/Page/PaymentInfo.php b/CRM/Contribute/Page/PaymentInfo.php index 478ea69729..eaf5e2badb 100644 --- a/CRM/Contribute/Page/PaymentInfo.php +++ b/CRM/Contribute/Page/PaymentInfo.php @@ -54,6 +54,16 @@ class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page { } } + /** + * This function takes care of all the things common to all + * pages. This typically involves assigning the appropriate + * smarty variable :) + * + * @return string The content generated by running this page + */ + /** + * @return string + */ function run() { $this->preProcess(); if ($this->_action) { @@ -62,4 +72,4 @@ class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page { return parent::run(); } -} \ No newline at end of file +} diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index 95adc2f4ea..7166d025e4 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -545,10 +545,16 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C return self::$_columnHeaders; } + /** + * @return mixed + */ function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } + /** + * @return string + */ function &getQuery() { return $this->_query; } @@ -564,6 +570,9 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C return ts('CiviCRM Contribution Search'); } + /** + * @return mixed + */ function getSummary() { return $this->_query->summaryContribution($this->_context); } diff --git a/api/v3/FinancialTrxn.php b/api/v3/FinancialTrxn.php new file mode 100644 index 0000000000..f20f9815fb --- /dev/null +++ b/api/v3/FinancialTrxn.php @@ -0,0 +1,103 @@ + 'Optional over-ride for status id'); + $params['participant_status_id'] = array('title' => 'Optional Over-ride for participant id'); + $params['send_receipt'] = array('title' => 'Send a receipt using built in template (possible future would be to specify the template)'); +} + + +/** + * Deletes an existing FinancialTransation + * + * @param array $params + * + * @example FinancialTransationDelete.php Standard Delete Example + * + * @return boolean | error true if successfull, error otherwise + * {@getfields financial_transaction_delete} + * @access public + */ +function civicrm_api3_financial_transaction_delete($params) { + //return 'go away - you can't delete transactions'; +} + +/** + * Retrieve one or more financial_transactions + * + * @param array input parameters + * + * + * @example FinancialTransationGet.php Standard Get Example + * + * @param array $params an associative array of name/value pairs. + * + * @return array api result array + * {@getfields financial_transaction_get} + * @access public + */ +function civicrm_api3_financial_transaction_get($params) { + + return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); +} + -- 2.25.1