autogenerate missing comments
authorEileen McNaughton <eileen@fuzion.co.nz>
Mon, 19 May 2014 03:18:27 +0000 (15:18 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Mon, 19 May 2014 03:18:27 +0000 (15:18 +1200)
24 files changed:
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/BAO/ContributionRecur.php
CRM/Contribute/BAO/ContributionSoft.php
CRM/Contribute/BAO/Query.php
CRM/Contribute/Form/AbstractEditPayment.php
CRM/Contribute/Form/AdditionalPayment.php
CRM/Contribute/Form/Contribution/Main.php
CRM/Contribute/Form/ContributionBase.php
CRM/Contribute/Form/ContributionPage.php
CRM/Contribute/Form/ContributionPage/TabHeader.php
CRM/Contribute/Form/ContributionPage/Widget.php
CRM/Contribute/Form/Task.php
CRM/Contribute/Form/Task/PDFLetter.php
CRM/Contribute/Form/Task/Status.php
CRM/Contribute/Form/UpdateBilling.php
CRM/Contribute/Import/Field.php
CRM/Contribute/Import/Parser.php
CRM/Contribute/Info.php
CRM/Contribute/Page/ContributionPage.php
CRM/Contribute/Page/PaymentInfo.php
CRM/Contribute/Selector/Search.php
api/v3/FinancialTrxn.php [new file with mode: 0644]

index 19cf4f3f9b0c57f7d659869d4c81bda2e339b0ee..e92faa48a49bb6e3c21198610002c377bdd066ef 100644 (file)
@@ -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';
index 9439d93d9f8244053be1c52c58cb318bb980c99c..b9c0864327e249e2ee759599fd755c107cbd8503 100644 (file)
@@ -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;
 
index 893ae5dc4e30ae039a8a39ea3e9106cb5c82eacb..aa284dc44eb4fefe4baec639439eec92566501e0 100644 (file)
@@ -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',
index d60afb5e0cef6e7540f2f7e33240abbdd5f2131a..2f36c94cd95c32aa734213c578f9a462f3d206bf 100644 (file)
@@ -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,
index 72ee3e765177d9858481598647acdfda108c6e2e..4aa0fe76a95b88e9263019d749bda7a9ea0ab09c 100644 (file)
@@ -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);
index 922622b72e1cb62998d434211b79b773560810f0..30d92de62f44d4ef1957b5f7d5228c40483f9ed1 100644 (file)
@@ -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'),
index 0bd7a97ae3d558cefbcb10b77ae4076385b37747..f9b9b054df8ef1e2fe878d4f1d58b47817aa674d 100644 (file)
@@ -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(
index f54af2d56076fcab8b2abf503fa1be162c342633..04f9fdcf28770680c7655c0f38c7577cc0ff4313 100644 (file)
@@ -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
index 38fe6df3bd553a33999b1f89e2179491215f4ec9..24dbec05ad6f2f7b1c5ddc0852112a61475e3b24 100644 (file)
@@ -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;
 
index 4d953bc1b8059c28ef73a6d4436a4af2cfaa7677..ef6fcae79aaa02a4d1d46db2e22629ee3f76fca8 100644 (file)
@@ -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();
index 0ed5432cd61c38ad7f80496a62329ad1bc6c3b98..0b3fdd6329f9e4d55b654d569b5f4bd3e0c9cf30 100644 (file)
@@ -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) ||
index 4d47a1055e1bc2d8be96c7e46b31d0919fe4fa97..8aa89253dc605ea0b22e92016a983012f8913d2f 100644 (file)
  * 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;
 
index f4dc41545ca450fb736db385f52284153bd13239..887858a75454e395458ca3a6469def624b57bd89 100644 (file)
@@ -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
index 66cbd3c0d1d42ce214dbef906c85a511001e419d..4e8b1278f4660240a2276f27628760bf81e683db 100644 (file)
@@ -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();
 
index dbb546e405c79fe77b88031774fee4a7a4478ab6..86ace17144d0eaf7eb25486aaa6087f0865b50e1 100644 (file)
@@ -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)) {
index 8dc47e31e3fecfb1e48857eb5e5040ca32979ed5..152564908ca79d9aa15af48203c26801e675cb52 100644 (file)
@@ -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,
index 486552a0e7f898aa0c4fbd474b31705c9d59f917..bc0d9e48c02fc72179b1c0f2be2fc4d9fc3aebae 100644 (file)
@@ -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();
 
index afbce66776fc34ed1a15a228d3641c829fac5186..718cc60745350d3549e86929dce65f519b0b3e34 100644 (file)
@@ -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)) {
index 3aa687323fe498d33a06d7249c6c2ac4df242f75..a0ede60f2375607d537ad63b7e5bc330c84890c7 100644 (file)
@@ -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)) {
index f2b2cf6e640e1c99d6918f116b35b6de406d78c8..8c95978dc9f43cd0dc27eebaf438e5dbae71f0a5 100644 (file)
@@ -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')
index 029f090315ed4adbe5779161065ffbb64cbdffc5..f0c2417699440eb482f58a492a82775537d73bb2 100644 (file)
@@ -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();
index 478ea697292f390dd852e80bbf956db9b45b91eb..eaf5e2badbd3b13820b7876cde33260f6aca281f 100644 (file)
@@ -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
+}
index 95adc2f4ea95dcab39a2a1561f566606377f2835..7166d025e448b9dcde094008517e0dce02065db1 100644 (file)
@@ -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 (file)
index 0000000..f20f981
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.4                                                |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2013                                |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM.                                    |
+ |                                                                    |
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License           |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ |                                                                    |
+ | CiviCRM is distributed in the hope that it will be useful, but     |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of         |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
+ | See the GNU Affero General Public License for more details.        |
+ |                                                                    |
+ | You should have received a copy of the GNU Affero General Public   |
+ | License and the CiviCRM Licensing Exception along                  |
+ | with this program; if not, contact CiviCRM LLC                     |
+ | at info[AT]civicrm[DOT]org. If you have questions about the        |
+ | GNU Affero General Public License or the licensing of CiviCRM,     |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ +--------------------------------------------------------------------+
+*/
+
+/**
+ * File for the CiviCRM APIv3 financial_transaction functions
+ *
+ * @package CiviCRM_APIv3
+ * @subpackage API_FinancialTransation
+ *
+ * @copyright CiviCRM LLC (c) 2004-2013
+ * @version $Id: FinancialTransation.php 2011-02-16 ErikHommel $
+ */
+
+/**
+ * Add an FinancialTransation for a contact
+ *
+ * Allowed @params array keys are:
+ *
+ * @example FinancialTransationCreate.php Standard Create Example
+ *
+ * @return array API result array
+ * {@getfields financial_transaction_create}
+ * @access public
+ */
+function civicrm_api3_financial_transaction_create($params) {
+  return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
+
+
+/**
+ * @param $params
+ */
+function _civicrm_api3_financial_transaction_create_spec(&$params) {
+  $params['trxn_date']['api.default'] = 'now';
+  $params['payment_instrument_id']['api.required'] = TRUE;
+  $params['total_amount']['api.required'] = TRUE;
+  $params['contribution_id']['api.required'] = TRUE;
+  $params['created_id']['api.default'] = 'user_contact_id';
+  $params['contribution_status_id'] = array('title' => '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);
+}
+