From ffd932138afb0b5d5bb60dabe047641009cea4ef Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 13:41:54 +1200 Subject: [PATCH] CRM add missing comment blocks --- CRM/Activity/BAO/Activity.php | 34 ++++++++ CRM/Activity/BAO/ActivityContact.php | 19 +++++ CRM/Activity/BAO/ICalendar.php | 3 + CRM/Activity/BAO/Query.php | 29 ++++++- CRM/Activity/Controller/Search.php | 3 + CRM/Activity/Form/ActivityFilter.php | 21 +++++ CRM/Activity/Form/ActivityLinks.php | 3 + CRM/Activity/Form/Search.php | 3 + CRM/Activity/Form/Task.php | 4 + CRM/Activity/Form/Task/AddToTag.php | 6 ++ CRM/Activity/Form/Task/RemoveFromTag.php | 6 ++ CRM/Activity/Import/Field.php | 11 +++ CRM/Activity/Import/Parser.php | 18 +++++ CRM/Activity/Page/AJAX.php | 7 +- CRM/Activity/Selector/Search.php | 6 ++ CRM/Activity/StateMachine/Search.php | 12 +++ CRM/Core/BAO/CustomField.php | 5 ++ .../BAO/QueryBuilder/IndividualSupervised.php | 3 + CRM/Event/Cart/BAO/Conference.php | 5 ++ CRM/Mailing/BAO/Mailing.php | 3 + CRM/Pledge/BAO/Pledge.php | 5 ++ CRM/Pledge/BAO/PledgePayment.php | 13 +++ CRM/Pledge/BAO/Query.php | 27 +++++++ CRM/Pledge/Form/Search.php | 3 + CRM/Pledge/Form/Task.php | 4 + CRM/Pledge/Info.php | 79 ++++++++++++++++++- CRM/Pledge/Selector/Search.php | 3 + CRM/Price/BAO/LineItem.php | 12 +++ CRM/Price/BAO/PriceField.php | 9 +++ CRM/Price/BAO/PriceSet.php | 28 +++++++ CRM/Profile/Form.php | 31 ++++++++ CRM/Profile/Page/Dynamic.php | 24 ++++++ CRM/Profile/Page/Listings.php | 24 ++++++ CRM/Profile/Page/View.php | 24 ++++++ 34 files changed, 482 insertions(+), 5 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 141f98940f..5c55b21957 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -630,6 +630,12 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { return $result; } + /** + * @param $activity + * @param null $logMessage + * + * @return bool + */ public static function logActivityAction($activity, $logMessage = NULL) { $session = CRM_Core_Session::singleton(); $id = $session->get('userID'); @@ -1349,6 +1355,16 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND return array($sent, $activity->id); } + /** + * @param $contactDetails + * @param $activityParams + * @param array $smsParams + * @param $contactIds + * @param null $userID + * + * @return array + * @throws CRM_Core_Exception + */ static function sendSMS(&$contactDetails, &$activityParams, &$smsParams = array(), @@ -2587,6 +2603,9 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n * Used to copy custom fields and attachments from an existing activity to another. * see CRM_Case_Page_AJAX::_convertToCaseActivity() for example */ + /** + * @param $params + */ static function copyExtendedActivityData($params) { // attach custom data to the new activity $customParams = $htmlType = array(); @@ -2624,6 +2643,13 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n CRM_Core_BAO_File::copyEntityFile('civicrm_activity', $params['activityID'], 'civicrm_activity', $params['mainActivityId']); } + /** + * @param $activityId + * @param null $recordTypeID + * @param string $column + * + * @return null + */ public static function getActivityContact($activityId, $recordTypeID = NULL, $column = 'contact_id') { $activityContact = new CRM_Activity_BAO_ActivityContact(); $activityContact->activity_id = $activityId; @@ -2636,6 +2662,11 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n return NULL; } + /** + * @param $activityId + * + * @return null + */ public static function getSourceContactID($activityId) { static $sourceID = NULL; if (!$sourceID) { @@ -2646,6 +2677,9 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n return self::getActivityContact($activityId, $sourceID); } + /** + * @param $params + */ function setApiFilter(&$params) { if (CRM_Utils_Array::value('target_contact_id', $params)) { $this->selectAdd(); diff --git a/CRM/Activity/BAO/ActivityContact.php b/CRM/Activity/BAO/ActivityContact.php index 1a21e3d273..0ea9940f50 100644 --- a/CRM/Activity/BAO/ActivityContact.php +++ b/CRM/Activity/BAO/ActivityContact.php @@ -147,6 +147,25 @@ AND civicrm_contact.is_deleted = 0 return $activityContact; } + /** + * Get the links associate array as defined by the links.ini file. + * + * + * Experimental... - + * Should look a bit like + * [local_col_name] => "related_tablename:related_col_name" + * + * + * @return array|null + * array = if there are links defined for this table. + * empty array - if there is a links.ini file, but no links on this table + * null - if no links.ini exists for this database (hence try auto_links). + * @access public + * @see DB_DataObject::getLinks(), DB_DataObject::getLink() + */ + /** + * @return array|null + */ function links() { $link = array('activity_id' => 'civicrm_activity:id'); return $link; diff --git a/CRM/Activity/BAO/ICalendar.php b/CRM/Activity/BAO/ICalendar.php index dc90a1c831..3c5ea3cb8e 100644 --- a/CRM/Activity/BAO/ICalendar.php +++ b/CRM/Activity/BAO/ICalendar.php @@ -109,6 +109,9 @@ class CRM_Activity_BAO_ICalendar { } // TODO: Is there a better way to do this? + /** + * @return string + */ private function getPrimaryEmail() { $session = &CRM_Core_Session::singleton(); $uid = $session->get('userID'); diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index bc01a3140b..5a53b144c7 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -152,7 +152,7 @@ class CRM_Activity_BAO_Query { $query->_element['result'] = 1; $query->_tables['civicrm_activity'] = $query->_whereTables['civicrm_activity'] = 1; } - + if (CRM_Utils_Array::value('parent_id', $query->_returnProperties)) { $query->_tables['parent_id'] = 1; $query->_whereTables['parent_id'] = 1; @@ -380,7 +380,7 @@ class CRM_Activity_BAO_Query { $query->_qill[$grouping][] = ts('Activities without Followup Activities'); } break; - + case 'followup_parent_id': if ($value == 1) { $query->_where[$grouping][] = "civicrm_activity.parent_id IS NOT NULL"; @@ -394,6 +394,13 @@ class CRM_Activity_BAO_Query { } } + /** + * @param $name + * @param $mode + * @param $side + * + * @return null|string + */ static function from($name, $mode, $side) { $from = NULL; switch ($name) { @@ -435,7 +442,7 @@ class CRM_Activity_BAO_Query { ON ( ac.activity_id = civicrm_activity_contact.activity_id AND ac.record_type_id = {$sourceID}) INNER JOIN civicrm_contact source_contact ON (ac.contact_id = source_contact.id)"; break; - + case 'parent_id': $from = "$side JOIN civicrm_activity AS parent_id ON civicrm_activity.id = parent_id.parent_id"; break; @@ -572,6 +579,12 @@ class CRM_Activity_BAO_Query { $form->setDefaults(array('activity_test' => 0)); } + /** + * @param $mode + * @param bool $includeCustomFields + * + * @return array|null + */ static function defaultReturnProperties($mode, $includeCustomFields = TRUE) { $properties = NULL; if ($mode & CRM_Contact_BAO_Query::MODE_ACTIVITY) { @@ -612,6 +625,16 @@ class CRM_Activity_BAO_Query { return $properties; } + /** + * @param $query + * @param $value + * @param $pseudoconstantType + * @param $op + * @param $grouping + * @param $params + * + * @return array + */ static function buildWhereAndQill(&$query, $value, $pseudoconstantType, $op, $grouping, $params) { $matches = $val = $clause = array(); diff --git a/CRM/Activity/Controller/Search.php b/CRM/Activity/Controller/Search.php index 22e1469c08..d0a9129661 100644 --- a/CRM/Activity/Controller/Search.php +++ b/CRM/Activity/Controller/Search.php @@ -61,6 +61,9 @@ class CRM_Activity_Controller_Search extends CRM_Core_Controller { $this->addActions(); } + /** + * @return mixed + */ public function selectorName() { return $this->get('selectorName'); } diff --git a/CRM/Activity/Form/ActivityFilter.php b/CRM/Activity/Form/ActivityFilter.php index f31df8d87c..94abc595a4 100644 --- a/CRM/Activity/Form/ActivityFilter.php +++ b/CRM/Activity/Form/ActivityFilter.php @@ -48,6 +48,27 @@ class CRM_Activity_Form_ActivityFilter extends CRM_Core_Form { $this->assign('suppressForm', TRUE); } + /** + * 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 + * + */ + /** + * 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() { // CRM-11761 retrieve user's activity filter preferences $defaults = array(); diff --git a/CRM/Activity/Form/ActivityLinks.php b/CRM/Activity/Form/ActivityLinks.php index 9628fa25ff..67a132a245 100644 --- a/CRM/Activity/Form/ActivityLinks.php +++ b/CRM/Activity/Form/ActivityLinks.php @@ -42,6 +42,9 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form { self::commonBuildQuickForm($this); } + /** + * @param $self + */ static function commonBuildQuickForm($self) { $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $self); if (!$contactId) { diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index 444b4ec397..9126675ad8 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -472,6 +472,9 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { } } + /** + * @return null + */ function getFormValues() { return NULL; } diff --git a/CRM/Activity/Form/Task.php b/CRM/Activity/Form/Task.php index f973bc43bb..8403d1db27 100644 --- a/CRM/Activity/Form/Task.php +++ b/CRM/Activity/Form/Task.php @@ -86,6 +86,10 @@ class CRM_Activity_Form_Task extends CRM_Core_Form { self::preProcessCommon($this); } + /** + * @param $form + * @param bool $useTable + */ static function preProcessCommon(&$form, $useTable = FALSE) { $form->_activityHolderIds = array(); diff --git a/CRM/Activity/Form/Task/AddToTag.php b/CRM/Activity/Form/Task/AddToTag.php index 12981b05f0..10cd4cfcfe 100644 --- a/CRM/Activity/Form/Task/AddToTag.php +++ b/CRM/Activity/Form/Task/AddToTag.php @@ -80,6 +80,12 @@ class CRM_Activity_Form_Task_AddToTag extends CRM_Activity_Form_Task { $this->addFormRule(array('CRM_Activity_Form_Task_AddToTag', 'formRule')); } + /** + * @param $form + * @param $rule + * + * @return array + */ static function formRule($form, $rule) { $errors = array(); if (empty($form['tag']) && empty($form['activity_taglist'])) { diff --git a/CRM/Activity/Form/Task/RemoveFromTag.php b/CRM/Activity/Form/Task/RemoveFromTag.php index 49133f69c3..00d46cec13 100644 --- a/CRM/Activity/Form/Task/RemoveFromTag.php +++ b/CRM/Activity/Form/Task/RemoveFromTag.php @@ -76,6 +76,12 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task { $this->addFormRule(array('CRM_Activity_Form_Task_RemoveFromTag', 'formRule')); } + /** + * @param $form + * @param $rule + * + * @return array + */ static function formRule($form, $rule) { $errors = array(); if (empty($form['tag']) && empty($form['activity_taglist'])) { diff --git a/CRM/Activity/Import/Field.php b/CRM/Activity/Import/Field.php index b800841ee7..6ee8a03e83 100644 --- a/CRM/Activity/Import/Field.php +++ b/CRM/Activity/Import/Field.php @@ -84,6 +84,14 @@ class CRM_Activity_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; @@ -106,6 +114,9 @@ class CRM_Activity_Import_Field { $this->_value = $value; } + /** + * @return bool + */ function validate() { if (CRM_Utils_System::isNull($this->_value)) { diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php index d4278fd640..7e87ff4918 100644 --- a/CRM/Activity/Import/Parser.php +++ b/CRM/Activity/Import/Parser.php @@ -65,6 +65,17 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { */ protected $_haveColumnHeader; + /** + * @param $fileName + * @param string $seperator + * @param $mapper + * @param bool $skipColumnHeader + * @param int $mode + * @param int $onDuplicate + * + * @return mixed + * @throws Exception + */ function run($fileName, $seperator = ',', &$mapper, @@ -304,6 +315,13 @@ abstract class CRM_Activity_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_Activity_Import_Field($name, $title, $type, $headerPattern, $dataPattern); diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index df6a9ccd75..2f8faaca95 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -289,7 +289,7 @@ class CRM_Activity_Page_AJAX { } $iFilteredTotal = $iTotal = $params['total'] = count($allCaseRelationships); $selectorElements = array('relation', 'name', 'phone', 'email', 'actions'); - + echo CRM_Utils_JSON::encodeDataTableSelector($caseRelationships, $sEcho, $iTotal, $iFilteredTotal, $selectorElements); CRM_Utils_System::civiExit(); } @@ -306,6 +306,11 @@ class CRM_Activity_Page_AJAX { CRM_Utils_System::civiExit(); } + /** + * @param $params + * + * @return array + */ static function _convertToCaseActivity($params) { if (!$params['activityID'] || !$params['caseID']) { return (array('error_msg' => 'required params missing.')); diff --git a/CRM/Activity/Selector/Search.php b/CRM/Activity/Selector/Search.php index 76cf226902..910ff50537 100644 --- a/CRM/Activity/Selector/Search.php +++ b/CRM/Activity/Selector/Search.php @@ -407,10 +407,16 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM return self::$_columnHeaders; } + /** + * @return mixed + */ function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } + /** + * @return string + */ function &getQuery() { return $this->_query; } diff --git a/CRM/Activity/StateMachine/Search.php b/CRM/Activity/StateMachine/Search.php index 75b987ffe1..ad14391ecd 100644 --- a/CRM/Activity/StateMachine/Search.php +++ b/CRM/Activity/StateMachine/Search.php @@ -97,6 +97,18 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine { return CRM_Utils_String::getClassName($this->_task); } + /** + * Should the controller reset the session + * In some cases, specifically search we want to remember + * state across various actions and want to go back to the + * beginning from the final state, but retain the same session + * values + * + * @return boolean + */ + /** + * @return bool + */ function shouldReset() { return FALSE; } diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 546559e23e..8911e952a0 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -2454,6 +2454,11 @@ WHERE f.id IN ($ids)"; return $errors; } + /** + * @param $customId + * + * @return bool + */ static function isMultiRecordField($customId) { $isMultipleWithGid = FALSE; if (!is_numeric($customId)) { diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php index 777279d3eb..4608dee84f 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php @@ -1,6 +1,9 @@ delete(); } + /** + * @return array + */ function getReturnProperties() { $tokens = &$this->getTokens(); diff --git a/CRM/Pledge/BAO/Pledge.php b/CRM/Pledge/BAO/Pledge.php index 0ee929177f..f4c92d8478 100644 --- a/CRM/Pledge/BAO/Pledge.php +++ b/CRM/Pledge/BAO/Pledge.php @@ -799,6 +799,11 @@ GROUP BY currency return CRM_Core_DAO::singleValueQuery($query); } + /** + * @param $params + * + * @return array + */ public static function updatePledgeStatus($params) { $returnMessages = array(); diff --git a/CRM/Pledge/BAO/PledgePayment.php b/CRM/Pledge/BAO/PledgePayment.php index 2dfe2dfecd..53a8064313 100644 --- a/CRM/Pledge/BAO/PledgePayment.php +++ b/CRM/Pledge/BAO/PledgePayment.php @@ -92,6 +92,11 @@ WHERE pledge_id = %1 return $paymentDetails; } + /** + * @param $params + * + * @return pledge + */ static function create($params) { $transaction = new CRM_Core_Transaction(); $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -715,6 +720,14 @@ LIMIT 0, %2 return end($paymentDetails); } + /** + * @param $pledgeID + * @param $actualAmount + * @param $pledgeScheduledAmount + * @param null $paymentContributionId + * @param null $pPaymentId + * @param null $paymentStatusID + */ static function adjustPledgePayment($pledgeID, $actualAmount, $pledgeScheduledAmount, $paymentContributionId = NULL, $pPaymentId = NULL, $paymentStatusID = NULL) { $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); if ($paymentStatusID == array_search('Cancelled', $allStatus) || $paymentStatusID == array_search('Refunded', $allStatus)) { diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 2ac269866b..d6375ecf22 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -34,6 +34,9 @@ * */ class CRM_Pledge_BAO_Query { + /** + * @return array + */ static function &getFields() { $fields = CRM_Pledge_BAO_Pledge::exportableFields(); return $fields; @@ -198,6 +201,9 @@ class CRM_Pledge_BAO_Query { } } + /** + * @param $query + */ static function where(&$query) { $grouping = NULL; foreach (array_keys($query->_params) as $id) { @@ -214,6 +220,10 @@ class CRM_Pledge_BAO_Query { } } + /** + * @param $values + * @param $query + */ static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; @@ -404,6 +414,13 @@ class CRM_Pledge_BAO_Query { } } + /** + * @param $name + * @param $mode + * @param $side + * + * @return null|string + */ static function from($name, $mode, $side) { $from = NULL; @@ -513,6 +530,9 @@ class CRM_Pledge_BAO_Query { return $properties; } + /** + * @param $form + */ static function buildSearchForm(&$form) { // pledge related dates CRM_Core_Form_Date::buildDateRange($form, 'pledge_start_date', 1, '_low', '_high', ts('From'), FALSE); @@ -598,8 +618,15 @@ class CRM_Pledge_BAO_Query { $form->setDefaults(array('pledge_test' => 0)); } + /** + * @param $row + * @param $id + */ static function searchAction(&$row, $id) {} + /** + * @param $tables + */ static function tableNames(&$tables) { //add status table if (!empty($tables['pledge_status']) || !empty($tables['civicrm_pledge_payment'])) { diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index f080b20b60..ac202912cf 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -492,6 +492,9 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { } } + /** + * @return null + */ function getFormValues() { return NULL; } diff --git a/CRM/Pledge/Form/Task.php b/CRM/Pledge/Form/Task.php index e6409af0fe..92b618690e 100644 --- a/CRM/Pledge/Form/Task.php +++ b/CRM/Pledge/Form/Task.php @@ -79,6 +79,10 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form { self::preProcessCommon($this); } + /** + * @param $form + * @param bool $useTable + */ static function preProcessCommon(&$form, $useTable = FALSE) { $form->_pledgeIds = array(); diff --git a/CRM/Pledge/Info.php b/CRM/Pledge/Info.php index 3f0e20f3b8..822f2e7a37 100644 --- a/CRM/Pledge/Info.php +++ b/CRM/Pledge/Info.php @@ -40,7 +40,14 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { // docs inherited from interface protected $keyword = 'pledge'; - // 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 + */ public function getInfo() { return array( 'name' => 'CiviPledge', @@ -53,6 +60,24 @@ class CRM_Pledge_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 CiviPledge', @@ -62,6 +87,18 @@ class CRM_Pledge_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('Pledges'), 'title' => ts('Your Pledge(s)'), @@ -72,6 +109,18 @@ class CRM_Pledge_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('Pledges'), 'url' => 'pledge', @@ -80,6 +129,18 @@ class CRM_Pledge_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('Pledges'), 'weight' => 25, @@ -87,11 +148,27 @@ class CRM_Pledge_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 + */ public function creatNewShortcut(&$shortCuts) { if (CRM_Core_Permission::check('access CiviPledge') && CRM_Core_Permission::check('edit pledges') diff --git a/CRM/Pledge/Selector/Search.php b/CRM/Pledge/Selector/Search.php index 99e0b3f760..9fd91973a4 100644 --- a/CRM/Pledge/Selector/Search.php +++ b/CRM/Pledge/Selector/Search.php @@ -452,6 +452,9 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { return self::$_columnHeaders; } + /** + * @return string + */ function &getQuery() { return $this->_query; } diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 575e19927e..12190098a5 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -92,6 +92,12 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { return NULL; } + /** + * @param $entityId + * @param $entityTable + * + * @return null|string + */ static function getLineTotal($entityId, $entityTable) { $sqlLineItemTotal = "SELECT SUM(li.line_total) FROM civicrm_line_item li @@ -334,6 +340,12 @@ AND li.entity_id = {$entityId} } } + /** + * @param $entityId + * @param string $entityTable + * @param $amount + * @param null $otherParams + */ public static function syncLineItems($entityId, $entityTable = 'civicrm_contribution', $amount, $otherParams = NULL) { if (!$entityId || CRM_Utils_System::isNull($amount)) return; diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index a029dd1494..f65dcd1ac9 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -511,6 +511,12 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { return $options[$fieldId]; } + /** + * @param $optionLabel + * @param $fid + * + * @return mixed + */ public static function getOptionId($optionLabel, $fid) { if (!$optionLabel || !$fid) { return; @@ -567,6 +573,9 @@ WHERE return NULL; } + /** + * @return array + */ static function &htmlTypes() { static $htmlTypes = NULL; if (!$htmlTypes) { diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 3457fc57da..2f069a1072 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -559,6 +559,15 @@ WHERE id = %1"; return $setTree; } + /** + * @param $form + * @param $id + * @param string $entityTable + * @param bool $validOnly + * @param null $priceSetId + * + * @return bool|false|int|null + */ static function initSet(&$form, $id, $entityTable = 'civicrm_event', $validOnly = FALSE, $priceSetId = NULL) { if (!$priceSetId) { $priceSetId = self::getFor($entityTable, $id); @@ -651,6 +660,12 @@ WHERE id = %1"; return FALSE; } + /** + * @param $fields + * @param $params + * @param $lineItem + * @param string $component + */ static function processAmount(&$fields, &$params, &$lineItem, $component = '') { // using price set $totalPrice = 0; @@ -1062,6 +1077,11 @@ INNER JOIN civicrm_price_set pset ON ( pset.id = field.price_set_id ) return $pricesetFieldCount[$sid]; } + /** + * @param $ids + * + * @return array + */ public static function getMembershipCount($ids) { $queryString = " SELECT count( pfv.id ) AS count, pfv.id AS id @@ -1149,6 +1169,9 @@ GROUP BY mt.member_of_contact_id"; return array($dao->duration_interval, $dao->duration_unit); } + /** + * @return object + */ static function eventPriceSetDomainID() { return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'event_price_set_domain_id', @@ -1219,6 +1242,11 @@ WHERE ps.id = %1 * @params int $newId newly created event/contribution page id * */ + /** + * @param $baoName + * @param $id + * @param $newId + */ static function copyPriceSet($baoName, $id, $newId) { $priceSetId = CRM_Price_BAO_PriceSet::getFor($baoName, $id); if ($priceSetId) { diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index f5a346eaff..e64b39ae77 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -865,6 +865,13 @@ class CRM_Profile_Form extends CRM_Core_Form { * * @return Array $errors Errors ( if any ). */ + /** + * @param $activityId + * @param $contactId + * @param $gid + * + * @return array + */ static function validateContactActivityProfile($activityId, $contactId, $gid) { $errors = array(); if (!$activityId) { @@ -1341,6 +1348,11 @@ class CRM_Profile_Form extends CRM_Core_Form { $transaction->commit(); } + /** + * @param null $suffix + * + * @return null|string + */ function checkTemplateFileExists($suffix = NULL) { if ($this->_gid) { $templateFile = "CRM/Profile/Form/{$this->_gid}/{$this->_name}.{$suffix}tpl"; @@ -1361,11 +1373,30 @@ class CRM_Profile_Form 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/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index c5a5c71eb0..f37b42731a 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -387,6 +387,11 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { return trim($template->fetch($this->getHookedTemplateFileName())); } + /** + * @param string $suffix + * + * @return null|string + */ function checkTemplateFileExists($suffix = '') { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/Dynamic.{$suffix}tpl"; @@ -407,11 +412,30 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { 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/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php index 32b537741a..a505ec9b22 100644 --- a/CRM/Profile/Page/Listings.php +++ b/CRM/Profile/Page/Listings.php @@ -459,6 +459,11 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { return $contactIds; } + /** + * @param string $suffix + * + * @return null|string + */ function checkTemplateFileExists($suffix = '') { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/Listings.{$suffix}tpl"; @@ -479,11 +484,30 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { 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/Profile/Page/View.php b/CRM/Profile/Page/View.php index 39ff03348d..6762cc0df4 100644 --- a/CRM/Profile/Page/View.php +++ b/CRM/Profile/Page/View.php @@ -175,6 +175,11 @@ class CRM_Profile_Page_View extends CRM_Core_Page { return parent::run(); } + /** + * @param string $suffix + * + * @return null|string + */ function checkTemplateFileExists($suffix = '') { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/View.{$suffix}tpl"; @@ -195,11 +200,30 @@ class CRM_Profile_Page_View extends CRM_Core_Page { 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(); -- 2.25.1