From 8653830813ff31dbbee902883745bb3e4bd3aa51 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 13:27:01 +1200 Subject: [PATCH] CRM/Contact add comment blocks --- CRM/Contact/BAO/Contact.php | 20 +++ CRM/Contact/BAO/Contact/Optimizer.php | 12 ++ CRM/Contact/BAO/Contact/Permission.php | 24 ++++ CRM/Contact/BAO/Contact/Utils.php | 5 + CRM/Contact/BAO/ContactType.php | 22 +++ CRM/Contact/BAO/Group.php | 14 ++ CRM/Contact/BAO/GroupContact.php | 6 + CRM/Contact/BAO/GroupContactCache.php | 10 ++ CRM/Contact/BAO/GroupNesting.php | 40 ++++++ CRM/Contact/BAO/GroupNestingCache.php | 32 +++++ CRM/Contact/BAO/GroupOrganization.php | 4 + CRM/Contact/BAO/ProximityQuery.php | 17 +++ CRM/Contact/BAO/Query.php | 134 +++++++++++++++++- CRM/Contact/BAO/Query/Hook.php | 35 +++++ CRM/Contact/BAO/Query/Interface.php | 42 +++++- CRM/Contact/BAO/Relationship.php | 6 + CRM/Contact/BAO/SavedSearch.php | 15 ++ CRM/Contact/BAO/SearchCustom.php | 32 +++++ CRM/Contact/BAO/SubscriptionHistory.php | 9 ++ CRM/Contact/Controller/Search.php | 3 + CRM/Contact/DAO/Factory.php | 8 ++ CRM/Contact/Form/Contact.php | 9 ++ CRM/Contact/Form/DedupeRules.php | 11 ++ CRM/Contact/Form/Domain.php | 12 ++ CRM/Contact/Form/Edit/Address.php | 12 ++ CRM/Contact/Form/Edit/Organization.php | 7 + CRM/Contact/Form/Merge.php | 23 +++ CRM/Contact/Form/ProfileContact.php | 3 + CRM/Contact/Form/Search.php | 19 +++ CRM/Contact/Form/Search/Advanced.php | 13 +- CRM/Contact/Form/Search/Basic.php | 12 ++ CRM/Contact/Form/Search/Builder.php | 11 ++ CRM/Contact/Form/Search/Criteria.php | 24 ++++ CRM/Contact/Form/Search/Custom.php | 35 +++++ .../Form/Search/Custom/ActivitySearch.php | 36 +++++ CRM/Contact/Form/Search/Custom/Base.php | 55 +++++++ CRM/Contact/Form/Search/Custom/Basic.php | 35 +++++ .../Form/Search/Custom/ContribSYBNT.php | 50 +++++++ .../Search/Custom/ContributionAggregate.php | 35 +++++ CRM/Contact/Form/Search/Custom/DateAdded.php | 32 +++++ .../Form/Search/Custom/EmployerListing.php | 38 +++++ .../Form/Search/Custom/EventAggregate.php | 30 ++++ CRM/Contact/Form/Search/Custom/FullText.php | 59 ++++++++ CRM/Contact/Form/Search/Custom/Group.php | 53 +++++++ .../Form/Search/Custom/MultipleValues.php | 38 +++++ .../Form/Search/Custom/PostalMailing.php | 26 ++++ CRM/Contact/Form/Search/Custom/PriceSet.php | 45 ++++++ CRM/Contact/Form/Search/Custom/Proximity.php | 37 +++++ .../Form/Search/Custom/RandomSegment.php | 32 +++++ CRM/Contact/Form/Search/Custom/Sample.php | 38 +++++ .../Form/Search/Custom/TagContributions.php | 30 ++++ .../Form/Search/Custom/ZipCodeRange.php | 35 +++++ CRM/Contact/Form/Task.php | 4 + CRM/Contact/Form/Task/AddToTag.php | 6 + CRM/Contact/Form/Task/AlterPreferences.php | 6 + CRM/Contact/Form/Task/EmailCommon.php | 3 + CRM/Contact/Form/Task/Label.php | 3 + CRM/Contact/Form/Task/LabelCommon.php | 5 + CRM/Contact/Form/Task/Map/Event.php | 9 ++ CRM/Contact/Form/Task/PDF.php | 11 ++ CRM/Contact/Form/Task/PDFLetterCommon.php | 14 ++ CRM/Contact/Form/Task/RemoveFromTag.php | 6 + CRM/Contact/Form/Task/SMSCommon.php | 3 + CRM/Contact/Form/Task/Unhold.php | 4 + CRM/Contact/Import/Field.php | 21 +++ CRM/Contact/Import/Form/DataSource.php | 16 +++ CRM/Contact/Import/ImportJob.php | 43 ++++++ CRM/Contact/Import/Importer.php | 6 + CRM/Contact/Import/Parser.php | 58 ++++++++ CRM/Contact/Import/Parser/Contact.php | 6 + CRM/Contact/Selector.php | 37 +++++ CRM/Contact/Selector/Controller.php | 10 ++ CRM/Contact/Selector/Custom.php | 21 +++ CRM/Contact/Task.php | 5 + 74 files changed, 1678 insertions(+), 4 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 4c8ffd72b1..54fb90afb5 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -88,6 +88,16 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * @static */ static $_exportableFields = NULL; + + /** + * class constructor + * + * @access public + * @return \CRM_Contact_DAO_Contact + */ + /** + * + */ function __construct() { parent::__construct(); } @@ -1845,6 +1855,16 @@ ORDER BY civicrm_email.is_primary DESC"; return $contactID; } + /** + * @param $params + * @param $fields + * @param null $contactID + * @param null $ufGroupId + * @param null $ctype + * @param bool $skipCustom + * + * @return array + */ static function formatProfileContactParams( &$params, &$fields, diff --git a/CRM/Contact/BAO/Contact/Optimizer.php b/CRM/Contact/BAO/Contact/Optimizer.php index e118efb770..a05a0c17f8 100644 --- a/CRM/Contact/BAO/Contact/Optimizer.php +++ b/CRM/Contact/BAO/Contact/Optimizer.php @@ -33,6 +33,10 @@ * */ class CRM_Contact_BAO_Contact_Optimizer { + /** + * @param $newValues + * @param $oldValues + */ static function edit( &$newValues, &$oldValues ) { // still need to do more work on this // CRM-10192 @@ -41,6 +45,10 @@ class CRM_Contact_BAO_Contact_Optimizer { self::website( $newValues, $oldValues ); } + /** + * @param $newValues + * @param $oldValues + */ static function website( &$newValues, &$oldValues ) { $oldWebsiteValues = CRM_Utils_Array::value( 'website', $oldValues ); $newWebsiteValues = CRM_Utils_Array::value( 'website', $newValues ); @@ -100,6 +108,10 @@ class CRM_Contact_BAO_Contact_Optimizer { unset( $newValues['website'] ); } + /** + * @param $newValues + * @param $oldValues + */ static function email( &$newValues, &$oldValues ) { $oldEmailValues = CRM_Utils_Array::value( 'email', $oldValues ); $newEmailValues = CRM_Utils_Array::value( 'email', $newValues ); diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index 420ef95fa4..d93dea976a 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -189,6 +189,12 @@ AND $operationClause LIMIT 1"; return (bool) CRM_Core_DAO::singleValueQuery($sql, $params); } + /** + * @param string $contactAlias + * @param null $contactID + * + * @return array + */ static function cacheClause($contactAlias = 'contact_a', $contactID = NULL) { if (CRM_Core_Permission::check('view all contacts') || CRM_Core_Permission::check('edit all contacts') @@ -328,6 +334,13 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR } + /** + * @param $contactID + * @param $form + * @param bool $redirect + * + * @return bool + */ static function validateOnlyChecksum($contactID, &$form, $redirect = TRUE) { // check if this is of the format cs=XXX if (!CRM_Contact_BAO_Contact_Utils::validChecksum($contactID, @@ -359,6 +372,10 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR return TRUE; } + /** + * @param bool $checkSumValidationResult + * @param null $form + */ static function initChecksumAuthSrc($checkSumValidationResult = FALSE, $form = NULL) { $session = CRM_Core_Session::singleton(); if ($checkSumValidationResult && $form && CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE)) { @@ -371,6 +388,13 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR } } + /** + * @param $contactID + * @param $form + * @param bool $redirect + * + * @return bool + */ static function validateChecksumContact($contactID, &$form, $redirect = TRUE) { if (!self::allow($contactID, CRM_Core_Permission::EDIT)) { // check if this is of the format cs=XXX diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 0961a02580..fa288fce41 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -888,6 +888,11 @@ Group By componentId"; CRM_Contact_BAO_GroupContactCache::remove(); } + /** + * @param $params + * + * @throws Exception + */ public static function updateGreeting($params) { $contactType = $params['ct']; $greeting = $params['gt']; diff --git a/CRM/Contact/BAO/ContactType.php b/CRM/Contact/BAO/ContactType.php index ffcfcb752b..584ba9373e 100644 --- a/CRM/Contact/BAO/ContactType.php +++ b/CRM/Contact/BAO/ContactType.php @@ -58,6 +58,11 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType { return NULL; } + /** + * @param $contactType + * + * @return bool + */ static function isActive($contactType) { $contact = self::contactTypeInfo(FALSE); $active = array_key_exists($contactType, $contact) ? TRUE : FALSE; @@ -124,6 +129,12 @@ WHERE parent_id IS NULL return array_keys(self::basicTypeInfo($all)); } + /** + * @param bool $all + * @param string $key + * + * @return array + */ static function basicTypePairs($all = FALSE, $key = 'name') { $subtypes = self::basicTypeInfo($all); @@ -708,6 +719,11 @@ WHERE name = %1"; ); } + /** + * @param $typeName + * + * @return mixed + */ static function getLabel($typeName) { $types = self::contactTypeInfo(TRUE); @@ -748,6 +764,12 @@ WHERE name = %1"; return TRUE; } + /** + * @param $contactType + * @param null $contactId + * + * @return bool + */ static function hasCustomData($contactType, $contactId = NULL) { $subTypeClause = ''; diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 18c848ada4..cc484a2527 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -637,6 +637,9 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { return $clause; } + /** + * @return string + */ public function __toString() { return $this->title; } @@ -1099,6 +1102,11 @@ WHERE id IN $groupIdString return $groupsReturn; } + /** + * @param $params + * + * @return null|string + */ static function getGroupCount(&$params) { $whereClause = self::whereClause($params, FALSE); $query = "SELECT COUNT(*) FROM civicrm_group groups"; @@ -1246,6 +1254,12 @@ WHERE {$whereClause}"; return $links; } + /** + * @param $whereClause + * @param $whereParams + * + * @return string + */ function pagerAtoZ($whereClause, $whereParams) { $query = " SELECT DISTINCT UPPER(LEFT(groups.title, 1)) as sort_name diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 5b579a14ab..28aefe2244 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -558,6 +558,12 @@ SELECT * } } + /** + * @param $contactID + * @param $groupID + * + * @return bool + */ static function isContactInGroup($contactID, $groupID) { if (!CRM_Utils_Rule::positiveInteger($contactID) || !CRM_Utils_Rule::positiveInteger($groupID) diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 9a82607c45..e69b6815c6 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -190,6 +190,9 @@ AND g.refresh_date IS NULL } } + /** + * @param $groupID + */ static function add($groupID) { // first delete the current cache self::remove($groupID); @@ -205,6 +208,10 @@ AND g.refresh_date IS NULL } } + /** + * @param $groupID + * @param $values + */ static function store(&$groupID, &$values) { $processed = FALSE; @@ -533,6 +540,9 @@ AND civicrm_group_contact.group_id = $groupID "; $lock->release(); } + /** + * @return int + */ static function smartGroupCacheTimeout() { $config = CRM_Core_Config::singleton(); diff --git a/CRM/Contact/BAO/GroupNesting.php b/CRM/Contact/BAO/GroupNesting.php index b8e4cb18f0..dc656cd9d7 100644 --- a/CRM/Contact/BAO/GroupNesting.php +++ b/CRM/Contact/BAO/GroupNesting.php @@ -58,6 +58,9 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen $this->_styleIndent = $styleIndent; } + /** + * @param $sortOrder + */ function setSortOrder($sortOrder) { switch ($sortOrder) { case 'ASC': @@ -73,10 +76,16 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen } } + /** + * @return string + */ function getSortOrder() { return self::$_sortOrder; } + /** + * @return int + */ function getCurrentNestingLevel() { return count($this->_parentStack); } @@ -115,6 +124,9 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen return $this->_current; } + /** + * @return string + */ function key() { $group = &$this->_current; $ids = array(); @@ -129,6 +141,9 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen return $key; } + /** + * @return CRM_Contact_BAO_Group|null + */ function next() { $currentGroup = &$this->_current; $childGroup = $this->_getNextChildGroup($currentGroup); @@ -160,6 +175,9 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen return $nextGroup; } + /** + * @return bool + */ function valid() { if ($this->_current) { return TRUE; @@ -169,6 +187,11 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen } } + /** + * @param null $group + * + * @return CRM_Contact_BAO_Group|null + */ function _getNextParentlessGroup(&$group = NULL) { $lastParentlessGroup = $this->_lastParentlessGroup; $nextGroup = new CRM_Contact_BAO_Group(); @@ -191,6 +214,12 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen return NULL; } + /** + * @param $parentGroup + * @param null $group + * + * @return CRM_Contact_BAO_Group|null + */ function _getNextChildGroup(&$parentGroup, &$group = NULL) { $children = self::getChildGroupIds($parentGroup->id); if (count($children) > 0) { @@ -217,6 +246,11 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen return NULL; } + /** + * @param $group + * + * @return CRM_Contact_BAO_Group|null + */ function _getNextSiblingGroup(&$group) { $parentGroup = end($this->_parentStack); if ($parentGroup) { @@ -664,6 +698,12 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen return $potentialChildGroupIds; } + /** + * @param $contactId + * @param $parentGroupId + * + * @return array + */ static function getContainingGroups($contactId, $parentGroupId) { $groups = CRM_Contact_BAO_Group::getGroups(); $containingGroups = array(); diff --git a/CRM/Contact/BAO/GroupNestingCache.php b/CRM/Contact/BAO/GroupNestingCache.php index ff95b8e39e..6fa5bc88b0 100644 --- a/CRM/Contact/BAO/GroupNestingCache.php +++ b/CRM/Contact/BAO/GroupNestingCache.php @@ -97,6 +97,11 @@ WHERE id = $id CRM_Core_BAO_Cache::setItem($tree, 'contact groups', 'nestable tree hierarchy'); } + /** + * @param $tree + * + * @return bool + */ static function checkCyclicGraph(&$tree) { // lets keep this simple, we should probably use a graph algoritm here at some stage @@ -111,6 +116,12 @@ WHERE id = $id return FALSE; } + /** + * @param $tree + * @param $id + * + * @return bool + */ static function isCyclic(&$tree, $id) { $parents = $children = array(); self::getAll($parent, $tree, $id, 'parents'); @@ -129,6 +140,12 @@ WHERE id = $id return FALSE; } + /** + * @param $id + * @param $groups + * + * @return array + */ static function getPotentialCandidates($id, &$groups) { $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy'); @@ -148,6 +165,12 @@ WHERE id = $id return array_keys($potential); } + /** + * @param $potential + * @param $tree + * @param $id + * @param $token + */ static function invalidate(&$potential, &$tree, $id, $token) { unset($potential[$id]); @@ -162,6 +185,12 @@ WHERE id = $id } } + /** + * @param $all + * @param $tree + * @param $id + * @param $token + */ static function getAll(&$all, &$tree, $id, $token) { // if seen before, dont do anything if (isset($all[$id])) { @@ -180,6 +209,9 @@ WHERE id = $id } } + /** + * @return string + */ static function json() { $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy'); diff --git a/CRM/Contact/BAO/GroupOrganization.php b/CRM/Contact/BAO/GroupOrganization.php index 93f7480645..c5db6ed18b 100644 --- a/CRM/Contact/BAO/GroupOrganization.php +++ b/CRM/Contact/BAO/GroupOrganization.php @@ -107,6 +107,10 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio return FALSE; } + /** + * @param $groupID + * @param $defaults + */ static function retrieve($groupID, &$defaults) { $dao = new CRM_Contact_DAO_GroupOrganization(); $dao->group_id = $groupID; diff --git a/CRM/Contact/BAO/ProximityQuery.php b/CRM/Contact/BAO/ProximityQuery.php index 6b58e8fc9f..b88a412044 100644 --- a/CRM/Contact/BAO/ProximityQuery.php +++ b/CRM/Contact/BAO/ProximityQuery.php @@ -185,6 +185,14 @@ class CRM_Contact_BAO_ProximityQuery { ); } + /** + * @param $latitude + * @param $longitude + * @param $distance + * @param string $tablePrefix + * + * @return string + */ static function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') { self::initialize(); @@ -233,6 +241,12 @@ ACOS( return $where; } + /** + * @param $query + * @param $values + * + * @throws Exception + */ static function process(&$query, &$values) { list($name, $op, $distance, $grouping, $wildcard) = $values; @@ -337,6 +351,9 @@ ACOS( return; } + /** + * @param $input + */ static function fixInputParams(&$input) { foreach ($input as $param) { if (CRM_Utils_Array::value('0', $param) == 'prox_distance') { diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index a0a0478e96..c388494e28 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -618,7 +618,7 @@ class CRM_Contact_BAO_Query { // redirect to activity select clause if ( - (substr($name, 0, 9) == 'activity_') || + (substr($name, 0, 9) == 'activity_') || ($name == 'parent_id') ) { CRM_Activity_BAO_Query::select($this); @@ -1355,6 +1355,12 @@ class CRM_Contact_BAO_Query { return array($select, $from, $where, $having); } + /** + * @param $name + * @param $grouping + * + * @return null + */ function &getWhereValues($name, $grouping) { $result = NULL; foreach ($this->_params as $values) { @@ -1366,12 +1372,24 @@ class CRM_Contact_BAO_Query { return $result; } + /** + * @param $relative + * @param $from + * @param $to + */ static function fixDateValues($relative, &$from, &$to) { if ($relative) { list($from, $to) = CRM_Utils_Date::getFromTo($relative, $from, $to); } } + /** + * @param $formValues + * @param int $wildcard + * @param bool $useEquals + * + * @return array + */ static function convertFormValues(&$formValues, $wildcard = 0, $useEquals = FALSE) { $params = array(); if (empty($formValues)) { @@ -1434,6 +1452,14 @@ class CRM_Contact_BAO_Query { return $params; } + /** + * @param $id + * @param $values + * @param int $wildcard + * @param bool $useEquals + * + * @return array|null + */ static function &fixWhereValues($id, &$values, $wildcard = 0, $useEquals = FALSE) { // skip a few search variables static $skipWhere = NULL; @@ -1515,6 +1541,9 @@ class CRM_Contact_BAO_Query { return $result; } + /** + * @param $values + */ function whereClauseSingle(&$values) { // do not process custom fields or prefixed contact ids or component params if (CRM_Core_BAO_CustomField::getKeyID($values[0]) || @@ -1826,6 +1855,11 @@ class CRM_Contact_BAO_Query { return implode(' AND ', $andClauses); } + /** + * @param $values + * + * @throws Exception + */ function restWhere(&$values) { $name = CRM_Utils_Array::value(0, $values); $op = CRM_Utils_Array::value(1, $values); @@ -2135,6 +2169,13 @@ class CRM_Contact_BAO_Query { } + /** + * @param $where + * @param $locType + * + * @return array + * @throws Exception + */ static function getLocationTableName(&$where, &$locType) { if (isset($locType[1]) && is_numeric($locType[1])) { list($tbName, $fldName) = explode(".", $where); @@ -2232,6 +2273,9 @@ class CRM_Contact_BAO_Query { return $this->_tables; } + /** + * @return array + */ function whereTables() { return $this->_whereTables; } @@ -2591,6 +2635,10 @@ class CRM_Contact_BAO_Query { $this->includeContactSubTypes($value, $grouping); } + /** + * @param $value + * @param $grouping + */ function includeContactSubTypes($value, $grouping) { $clause = array(); @@ -2713,6 +2761,11 @@ class CRM_Contact_BAO_Query { /* * Function translates selection of group type into a list of groups */ + /** + * @param $value + * + * @return array + */ function getGroupsFromTypeCriteria($value){ $groupIds = array(); foreach ($value as $groupTypeValue) { @@ -3015,6 +3068,13 @@ WHERE id IN ( $groupIDs ) $this->_qill[$grouping][] = $label . " $op - '$n'"; } + /** + * @param $name + * @param $op + * @param $grouping + * + * @return bool + */ function nameNullOrEmptyOp($name, $op, $grouping) { switch ( $op ) { case 'IS NULL': @@ -3466,6 +3526,12 @@ WHERE id IN ( $groupIDs ) } } + /** + * @param $values + * @param bool $fromStateProvince + * + * @return array + */ function country(&$values, $fromStateProvince = TRUE) { list($name, $op, $value, $grouping, $wildcard) = $values; @@ -3735,6 +3801,9 @@ WHERE id IN ( $groupIDs ) $this->_qill[$grouping][] = ts('Modified by') . ": $name"; } + /** + * @param $values + */ function modifiedDates($values) { $this->_useDistinct = TRUE; @@ -3756,6 +3825,9 @@ WHERE id IN ( $groupIDs ) self::$_openedPanes[ts('Change Log')] = TRUE; } + /** + * @param $values + */ function demographics(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; @@ -3775,6 +3847,9 @@ WHERE id IN ( $groupIDs ) self::$_openedPanes[ts('Demographics')] = TRUE; } + /** + * @param $values + */ function privacy(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; //fixed for profile search listing CRM-4633 @@ -3791,6 +3866,9 @@ WHERE id IN ( $groupIDs ) $this->_qill[$grouping][] = "$title $op $value"; } + /** + * @param $values + */ function privacyOptions($values) { list($name, $op, $value, $grouping, $wildcard) = $values; @@ -3828,6 +3906,9 @@ WHERE id IN ( $groupIDs ) $this->_qill[$grouping][] = implode($operator, $qill); } + /** + * @param $values + */ function preferredCommunication(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; @@ -4573,10 +4654,18 @@ civicrm_relationship.is_permission_a_b = 0 } } + /** + * @param $val + */ function setSkipPermission($val) { $this->_skipPermission = $val; } + /** + * @param null $context + * + * @return array + */ function &summaryContribution($context = NULL) { list($innerselect, $from, $where, $having) = $this->query(TRUE); @@ -4799,6 +4888,14 @@ SELECT COUNT( conts.total_amount ) as cancel_count, return self::$_defaultHierReturnProperties; } + /** + * @param $values + * @param $tableName + * @param $fieldName + * @param $dbFieldName + * @param $fieldTitle + * @param bool $appendTimeStamp + */ function dateQueryBuilder( &$values, $tableName, $fieldName, $dbFieldName, $fieldTitle, @@ -4904,6 +5001,14 @@ SELECT COUNT( conts.total_amount ) as cancel_count, } } + /** + * @param $values + * @param $tableName + * @param $fieldName + * @param $dbFieldName + * @param $fieldTitle + * @param null $options + */ function numberRangeBuilder(&$values, $tableName, $fieldName, $dbFieldName, $fieldTitle, @@ -5043,6 +5148,11 @@ SELECT COUNT( conts.total_amount ) as cancel_count, } } + /** + * @param bool $reset + * + * @return array + */ function openedSearchPanes($reset = FALSE) { if (!$reset || empty($this->_whereTables)) { return self::$_openedPanes; @@ -5074,6 +5184,9 @@ SELECT COUNT( conts.total_amount ) as cancel_count, return self::$_openedPanes; } + /** + * @param $operator + */ function setOperator($operator) { $validOperators = array('AND', 'OR'); if (!in_array($operator, $validOperators)) { @@ -5082,10 +5195,18 @@ SELECT COUNT( conts.total_amount ) as cancel_count, $this->_operator = $operator; } + /** + * @return string + */ function getOperator() { return $this->_operator; } + /** + * @param $from + * @param $where + * @param $having + */ function filterRelatedContacts(&$from, &$where, &$having) { static $_rTypeProcessed = NULL; static $_rTypeFrom = NULL; @@ -5157,11 +5278,22 @@ AND displayRelType.is_active = 1 $having = NULL; } + /** + * @param $op + * + * @return bool + */ static function caseImportant( $op ) { return in_array($op, array('LIKE', 'IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY')) ? FALSE : TRUE; } + /** + * @param $returnProperties + * @param $prefix + * + * @return bool + */ static function componentPresent( &$returnProperties, $prefix ) { foreach ($returnProperties as $name => $dontCare ) { if (substr($name, 0, strlen($prefix)) == $prefix) { diff --git a/CRM/Contact/BAO/Query/Hook.php b/CRM/Contact/BAO/Query/Hook.php index 733b6becc4..234d584fe6 100644 --- a/CRM/Contact/BAO/Query/Hook.php +++ b/CRM/Contact/BAO/Query/Hook.php @@ -71,6 +71,9 @@ class CRM_Contact_BAO_Query_Hook { return $this->_queryObjects; } + /** + * @return array + */ public function &getFields() { $extFields = array(); foreach (self::getSearchQueryObjects() as $obj) { @@ -80,18 +83,33 @@ class CRM_Contact_BAO_Query_Hook { return $extFields; } + /** + * @param $apiEntities + * @param $fieldOptions + */ public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) { foreach (self::getSearchQueryObjects() as $obj) { $obj->alterSearchBuilderOptions($apiEntities, $fieldOptions); } } + /** + * @param $query + * @param $fnName + */ public function alterSearchQuery(&$query, $fnName) { foreach (self::getSearchQueryObjects() as $obj) { $obj->$fnName($query); } } + /** + * @param $fieldName + * @param $mode + * @param $side + * + * @return string + */ public function buildSearchfrom($fieldName, $mode, $side) { $from = ''; foreach (self::getSearchQueryObjects() as $obj) { @@ -100,30 +118,47 @@ class CRM_Contact_BAO_Query_Hook { return $from; } + /** + * @param $tables + */ public function setTableDependency(&$tables) { foreach (self::getSearchQueryObjects() as $obj) { $obj->setTableDependency($tables); } } + /** + * @param $panes + */ public function registerAdvancedSearchPane(&$panes) { foreach (self::getSearchQueryObjects() as $obj) { $obj->registerAdvancedSearchPane($panes); } } + /** + * @param $panes + */ public function getPanesMapper(&$panes) { foreach (self::getSearchQueryObjects() as $obj) { $obj->getPanesMapper($panes); } } + /** + * @param $form + * @param $type + */ public function buildAdvancedSearchPaneForm(&$form, $type) { foreach (self::getSearchQueryObjects() as $obj) { $obj->buildAdvancedSearchPaneForm($form, $type); } } + /** + * @param $paneTemplatePathArray + * @param $type + */ public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) { foreach (self::getSearchQueryObjects() as $obj) { $obj->setAdvancedSearchPaneTemplatePath($paneTemplatePathArray, $type); diff --git a/CRM/Contact/BAO/Query/Interface.php b/CRM/Contact/BAO/Query/Interface.php index 328483c270..26e6303e2b 100644 --- a/CRM/Contact/BAO/Query/Interface.php +++ b/CRM/Contact/BAO/Query/Interface.php @@ -39,28 +39,68 @@ abstract class CRM_Contact_BAO_Query_Interface { abstract public function &getFields(); + + /** + * @param $fieldName + * @param $mode + * @param $side + * + * @return mixed + */ abstract public function from($fieldName, $mode, $side); + /** + * @param $query + * + * @return null + */ public function select(&$query) { return NULL; } + /** + * @param $query + * + * @return null + */ public function where(&$query) { return NULL; } + /** + * @param $tables + * + * @return null + */ public function setTableDependency(&$tables) { return NULL; } + /** + * @param $panes + * + * @return null + */ public function registerAdvancedSearchPane(&$panes) { return NULL; } + /** + * @param $form + * @param $type + * + * @return null + */ public function buildAdvancedSearchPaneForm(&$form, $type) { return NULL; } + /** + * @param $paneTemplatePathArray + * @param $type + * + * @return null + */ public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) { return NULL; } @@ -80,4 +120,4 @@ abstract class CRM_Contact_BAO_Query_Interface { */ public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) { } -} \ No newline at end of file +} diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 616e93b6f1..dc0c90821c 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -423,6 +423,12 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { return $relationshipType; } + /** + * @param $id + * @param $action + * + * @return CRM_Contact_DAO_Relationship + */ static function clearCurrentEmployer($id, $action) { $relationship = new CRM_Contact_DAO_Relationship(); $relationship->id = $id; diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index 95c4691608..c9fe096769 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -130,6 +130,11 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { return $result; } + /** + * @param $id + * + * @return array + */ static function getSearchParams($id) { $fv = self::getFormValues($id); //check if the saved seach has mapping id @@ -167,6 +172,11 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { return NULL; } + /** + * @param $id + * + * @return string + */ static function contactIDsSQL($id) { $params = self::getSearchParams($id); if ($params && !empty($params['customSearchID'])) { @@ -186,6 +196,11 @@ WHERE $where"; } } + /** + * @param $id + * + * @return array + */ static function fromWhereEmail($id) { $params = self::getSearchParams($id); diff --git a/CRM/Contact/BAO/SearchCustom.php b/CRM/Contact/BAO/SearchCustom.php index 4af8f5b423..7d720f3a2a 100644 --- a/CRM/Contact/BAO/SearchCustom.php +++ b/CRM/Contact/BAO/SearchCustom.php @@ -34,6 +34,14 @@ */ class CRM_Contact_BAO_SearchCustom { + /** + * @param $csID + * @param null $ssID + * @param null $gID + * + * @return array + * @throws Exception + */ static function details($csID, $ssID = NULL, $gID = NULL) { $error = array(NULL, NULL, NULL); @@ -91,6 +99,13 @@ class CRM_Contact_BAO_SearchCustom { return array($customSearchID, $customSearchClass, $formValues); } + /** + * @param $csID + * @param $ssID + * + * @return mixed + * @throws Exception + */ static function customClass($csID, $ssID) { list($customSearchID, $customSearchClass, $formValues) = self::details($csID, $ssID); @@ -104,11 +119,22 @@ class CRM_Contact_BAO_SearchCustom { return $customClass; } + /** + * @param $csID + * @param $ssID + * + * @return mixed + */ static function contactIDSQL($csID, $ssID) { $customClass = self::customClass($csID, $ssID); return $customClass->contactIDs(); } + /** + * @param $args + * + * @return array + */ static function &buildFormValues($args) { $args = trim($args); @@ -123,6 +149,12 @@ class CRM_Contact_BAO_SearchCustom { return $formValues; } + /** + * @param $csID + * @param $ssID + * + * @return array + */ static function fromWhereEmail($csID, $ssID) { $customClass = self::customClass($csID, $ssID); diff --git a/CRM/Contact/BAO/SubscriptionHistory.php b/CRM/Contact/BAO/SubscriptionHistory.php index 11d643c148..09fe3ec06c 100644 --- a/CRM/Contact/BAO/SubscriptionHistory.php +++ b/CRM/Contact/BAO/SubscriptionHistory.php @@ -37,6 +37,15 @@ * BAO object for crm_email table */ class CRM_Contact_BAO_SubscriptionHistory extends CRM_Contact_DAO_SubscriptionHistory { + /** + * class constructor + * + * @access public + * @return \CRM_Contact_DAO_SubscriptionHistory + */ + /** + * + */ function __construct() { parent::__construct(); } diff --git a/CRM/Contact/Controller/Search.php b/CRM/Contact/Controller/Search.php index 542fb26840..a56bbbb788 100644 --- a/CRM/Contact/Controller/Search.php +++ b/CRM/Contact/Controller/Search.php @@ -61,6 +61,9 @@ class CRM_Contact_Controller_Search extends CRM_Core_Controller { $this->addActions(); } + /** + * @return mixed + */ public function selectorName() { return $this->get('selectorName'); } diff --git a/CRM/Contact/DAO/Factory.php b/CRM/Contact/DAO/Factory.php index 419885a19d..27d264fb2e 100644 --- a/CRM/Contact/DAO/Factory.php +++ b/CRM/Contact/DAO/Factory.php @@ -1,5 +1,8 @@ _contactSubType) { $templateFile = "CRM/Contact/Form/Edit/SubType/{$this->_contactSubType}.tpl"; diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 0a6c4665d8..faa8c5bc93 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -174,6 +174,17 @@ class CRM_Contact_Form_DedupeRules extends CRM_Admin_Form { return empty($errors) ? TRUE : $errors; } + /** + * This function sets the default values for the form. MobileProvider that in edit/view mode + * the default values are retrieved from the database + * + * @access public + * + * @return array + */ + /** + * @return array + */ function setDefaultValues() { return $this->_defaults; } diff --git a/CRM/Contact/Form/Domain.php b/CRM/Contact/Form/Domain.php index 1ca1d0ee75..b958f8fd27 100644 --- a/CRM/Contact/Form/Domain.php +++ b/CRM/Contact/Form/Domain.php @@ -97,6 +97,18 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form { * @access public * @return void */ + /** + * 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(); $params = array(); diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index c786bfaab4..d76a4379a6 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -397,6 +397,14 @@ class CRM_Contact_Form_Edit_Address { return empty($errors) ? TRUE : $errors; } + /** + * @param $form + * @param $countryElementName + * @param $stateElementName + * @param $countyElementName + * @param $countryDefaultValue + * @param null $stateDefaultValue + */ static function fixStateSelect(&$form, $countryElementName, $stateElementName, @@ -570,6 +578,10 @@ class CRM_Contact_Form_Edit_Address { } + /** + * @param $form + * @param $groupTree + */ static function storeRequiredCustomDataInfo(&$form, $groupTree) { if (CRM_Utils_System::getClassName($form) == 'CRM_Contact_Form_Contact') { $requireOmission = NULL; diff --git a/CRM/Contact/Form/Edit/Organization.php b/CRM/Contact/Form/Edit/Organization.php index d86b0a8a2c..57465feaf0 100644 --- a/CRM/Contact/Form/Edit/Organization.php +++ b/CRM/Contact/Form/Edit/Organization.php @@ -86,6 +86,13 @@ class CRM_Contact_Form_Edit_Organization { } } + /** + * @param $fields + * @param $files + * @param null $contactID + * + * @return array|bool + */ static function formRule($fields, $files, $contactID = NULL) { $errors = array(); $primaryID = CRM_Contact_Form_Contact::formRule($fields, $errors, $contactID); diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index 61cbf0df79..d818628bc1 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -34,6 +34,10 @@ */ require_once 'api/api.php'; + +/** + * Class CRM_Contact_Form_Merge + */ class CRM_Contact_Form_Merge extends CRM_Core_Form { // the id of the contact that tere's a duplicate for; this one will // possibly inherit some of $_oid's properties and remain in the system @@ -244,6 +248,18 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { $this->assign('userContextURL', $session->readUserContext()); } + /** + * 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() { return array('deleteOther' => 1); } @@ -296,6 +312,13 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { $this->addFormRule(array('CRM_Contact_Form_Merge', 'formRule'), $this); } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = array(); $link = CRM_Utils_System::href(ts('Flip between the original and duplicate contacts.'), diff --git a/CRM/Contact/Form/ProfileContact.php b/CRM/Contact/Form/ProfileContact.php index c8bd5eac4e..b6f12cbf57 100644 --- a/CRM/Contact/Form/ProfileContact.php +++ b/CRM/Contact/Form/ProfileContact.php @@ -111,6 +111,9 @@ class CRM_Contact_Form_ProfileContact { } } + /** + * @param $form + */ static function postProcess($form) { $params = $form->_params; if (!empty($form->_honor_block_is_active) && !empty($params['soft_credit_type_id'])) { diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 1f963e3b74..2fb29196fc 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -245,6 +245,11 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { return self::$_validContext; } + /** + * @param $context + * + * @return bool + */ static function isSearchContext($context) { $searchContext = CRM_Utils_Array::value($context, self::validContext()); return $searchContext ? TRUE : FALSE; @@ -329,6 +334,11 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { } } + /** + * @param int $mode + * + * @return mixed + */ static function getModeValue($mode = 1) { self::setModeValues(); @@ -339,6 +349,9 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { return self::$_modeValues[$mode]; } + /** + * @return array + */ static function getModeSelect() { self::setModeValues(); @@ -795,6 +808,9 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { $controller->moveFromSessionToTemplate(); } + /** + * @return array + */ function &getFormValues() { return $this->_formValues; } @@ -931,6 +947,9 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { } } + /** + * @return null + */ function &returnProperties() { return CRM_Core_DAO::$_nullObject; } diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index 02a768d359..ee086eb766 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -177,6 +177,15 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { } } + /** + * Use the form name to create the tpl file name + * + * @return string + * @access public + */ + /** + * @return string + */ function getTemplateFileName() { if (!$this->_searchPane) { return parent::getTemplateFileName(); @@ -350,7 +359,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { $this->_formValues['contact_tags'][$value] = 1; } } - + // CRM-13848 $financialType = CRM_Utils_Array::value('financial_type_id', $this->_formValues); if ($financialType && is_array($financialType)) { @@ -359,7 +368,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { $this->_formValues['financial_type_id'][$typeID] = 1; } } - + $taglist = CRM_Utils_Array::value('contact_taglist', $this->_formValues); if ($taglist && is_array($taglist)) { diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index f14088f771..cbeca69e38 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -158,6 +158,9 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { parent::preProcess(); } + /** + * @return array + */ function &getFormValues() { return $this->_formValues; } @@ -276,6 +279,15 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { return TRUE; } + /** + * Return a descriptive name for the page, used in wizard header + * + * @return string + * @access public + */ + /** + * @return string + */ function getTitle() { return ts('Find Contacts'); } diff --git a/CRM/Contact/Form/Search/Builder.php b/CRM/Contact/Form/Search/Builder.php index 656db4ff78..9a4b31bed9 100644 --- a/CRM/Contact/Form/Search/Builder.php +++ b/CRM/Contact/Form/Search/Builder.php @@ -302,10 +302,18 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { public function normalizeFormValues() {} + /** + * @param $formValues + * + * @return array + */ public function &convertFormValues(&$formValues) { return CRM_Core_BAO_Mapping::formattedFields($formValues); } + /** + * @return array + */ public function &returnProperties() { return CRM_Core_BAO_Mapping::returnProperties($this->_formValues); } @@ -398,6 +406,9 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { parent::postProcess(); } + /** + * @return array + */ static function fields() { $fields = array_merge( CRM_Contact_BAO_Contact::exportableFields('All', FALSE, TRUE), diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index b9cff19e73..1aee74b744 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -270,6 +270,9 @@ class CRM_Contact_Form_Search_Criteria { } + /** + * @param $form + */ static function location(&$form) { // Build location criteria based on _submitValues if // available; otherwise, use $form->_formValues. @@ -409,11 +412,17 @@ class CRM_Contact_Form_Search_Criteria { } } + /** + * @param $form + */ static function activity(&$form) { $form->add('hidden', 'hidden_activity', 1); CRM_Activity_BAO_Query::buildSearchForm($form); } + /** + * @param $form + */ static function changeLog(&$form) { $form->add('hidden', 'hidden_changeLog', 1); @@ -426,10 +435,16 @@ class CRM_Contact_Form_Search_Criteria { CRM_Core_Form_Date::buildDateRange($form, 'log_date', 1, '_low', '_high', ts('From'), FALSE, FALSE); } + /** + * @param $form + */ static function task(&$form) { $form->add('hidden', 'hidden_task', 1); } + /** + * @param $form + */ static function relationship(&$form) { $form->add('hidden', 'hidden_relationship', 1); @@ -477,6 +492,9 @@ class CRM_Contact_Form_Search_Criteria { } } + /** + * @param $form + */ static function demographics(&$form) { $form->add('hidden', 'hidden_demographics', 1); // radio button for gender @@ -499,6 +517,9 @@ class CRM_Contact_Form_Search_Criteria { $form->addYesNo( 'is_deceased', ts('Deceased'), TRUE); } + /** + * @param $form + */ static function notes(&$form) { $form->add('hidden', 'hidden_notes', 1); @@ -555,6 +576,9 @@ class CRM_Contact_Form_Search_Criteria { //TODO: validate for only one state if prox_distance isset } + /** + * @param $form + */ static function CiviCase(&$form) { //Looks like obsolete code, since CiviCase is a component, but might be used by HRD $form->add('hidden', 'hidden_CiviCase', 1); diff --git a/CRM/Contact/Form/Search/Custom.php b/CRM/Contact/Form/Search/Custom.php index 5fb1158ca3..eabfe7dce8 100644 --- a/CRM/Contact/Form/Search/Custom.php +++ b/CRM/Contact/Form/Search/Custom.php @@ -89,6 +89,18 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { } } + /** + * 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() { if (method_exists($this->_customSearchClass, 'setDefaultValues')) { return $this->_customClass->setDefaultValues(); @@ -102,6 +114,15 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { parent::buildQuickForm(); } + /** + * Use the form name to create the tpl file name + * + * @return string + * @access public + */ + /** + * @return string + */ function getTemplateFileName() { $ext = CRM_Extension_System::singleton()->getMapper(); @@ -135,10 +156,24 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { parent::postProcess(); } + /** + * Return a descriptive name for the page, used in wizard header + * + * @return string + * @access public + */ + /** + * @return string + */ public function getTitle() { return ts('Custom Search'); } + /** + * @param $components + * + * @return bool + */ function isPermissioned($components) { if (empty($components)) { return TRUE; diff --git a/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/CRM/Contact/Form/Search/Custom/ActivitySearch.php index 2e08a2561c..03cacff34f 100644 --- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@ -36,6 +36,12 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ protected $_formValues; + /** + * @param $formValues + */ + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_formValues = $formValues; @@ -83,6 +89,9 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ //end custom fields } + /** + * @param $form + */ function buildForm(&$form) { /** @@ -223,11 +232,17 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ // Alters the date display in the Activity Date Column. We do this after we already have // the result so that sorting on the date column stays pertinent to the numeric date value + /** + * @param $row + */ function alterRow(&$row) { $row['activity_date'] = CRM_Utils_Date::customFormat($row['activity_date'], '%B %E%f, %Y %l:%M %P'); } // Regular JOIN statements here to limit results to contacts who have activities. + /** + * @return string + */ function from() { $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); @@ -260,6 +275,11 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ * WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values * */ + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $clauses = array(); @@ -342,14 +362,27 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ return $dao->N; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * + * @return string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } + /** + * @return array + */ function &columns() { return $this->_columns; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); @@ -359,6 +392,9 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ } } + /** + * @return null + */ function summary() { return NULL; } diff --git a/CRM/Contact/Form/Search/Custom/Base.php b/CRM/Contact/Form/Search/Custom/Base.php index e9767667d9..5ef3c868e1 100644 --- a/CRM/Contact/Form/Search/Custom/Base.php +++ b/CRM/Contact/Form/Search/Custom/Base.php @@ -40,18 +40,35 @@ class CRM_Contact_Form_Search_Custom_Base { protected $_stateID; + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_formValues = &$formValues; } + /** + * @return null|string + */ function count() { return CRM_Core_DAO::singleValueQuery($this->sql('count(distinct contact_a.id) as total')); } + /** + * @return null + */ function summary() { return NULL; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $returnSQL + * + * @return string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { $sql = $this->sql( 'contact_a.id as contact_id', @@ -68,6 +85,16 @@ class CRM_Contact_Form_Search_Custom_Base { return CRM_Core_DAO::composeQuery($sql, CRM_Core_DAO::$_nullArray); } + /** + * @param $selectClause + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param null $groupBy + * + * @return string + */ function sql( $selectClause, $offset = 0, @@ -97,6 +124,9 @@ class CRM_Contact_Form_Search_Custom_Base { return $sql; } + /** + * @return null + */ function templateFile() { return NULL; } @@ -105,6 +135,10 @@ class CRM_Contact_Form_Search_Custom_Base { return $this->_columns; } + /** + * @param $sql + * @param $formValues + */ static function includeContactIDs(&$sql, &$formValues) { $contactIDs = array(); foreach ($formValues as $id => $value) { @@ -121,6 +155,12 @@ class CRM_Contact_Form_Search_Custom_Base { } } + /** + * @param $sql + * @param $offset + * @param $rowcount + * @param $sort + */ function addSortOffset(&$sql, $offset, $rowcount, $sort) { if (!empty($sort)) { if (is_string($sort)) { @@ -140,6 +180,12 @@ class CRM_Contact_Form_Search_Custom_Base { } } + /** + * @param $sql + * @param bool $onlyWhere + * + * @throws Exception + */ function validateUserSQL(&$sql, $onlyWhere = FALSE) { $includeStrings = array('contact_a'); $excludeStrings = array('insert', 'delete', 'update'); @@ -165,12 +211,21 @@ class CRM_Contact_Form_Search_Custom_Base { } } + /** + * @param $where + * @param $params + * + * @return string + */ function whereClause(&$where, &$params) { return CRM_Core_DAO::composeQuery($where, $params, TRUE); } // override this method to define the contact query object // used for creating $sql + /** + * @return null + */ function getQueryObj() { return NULL; } diff --git a/CRM/Contact/Form/Search/Custom/Basic.php b/CRM/Contact/Form/Search/Custom/Basic.php index 9be5725abc..97ab38508b 100644 --- a/CRM/Contact/Form/Search/Custom/Basic.php +++ b/CRM/Contact/Form/Search/Custom/Basic.php @@ -36,6 +36,12 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo protected $_query; + /** + * @param $formValues + */ + /** + * @param $formValues + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -104,6 +110,9 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo return; } + /** + * @param $form + */ function buildForm(&$form) { //@todo FIXME - using the CRM_Core_DAO::VALUE_SEPARATOR creates invalid html - if you can find the form // this is loaded onto then replace with something like '__' & test @@ -125,10 +134,22 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo $form->assign('elements', array('sort_name', 'contact_type', 'group', 'tag')); } + /** + * @return CRM_Contact_DAO_Contact + */ function count() { return $this->_query->searchQuery(0, 0, NULL, TRUE); } + /** + * @param int $offset + * @param int $rowCount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return CRM_Contact_DAO_Contact + */ function all( $offset = 0, $rowCount = 0, @@ -148,10 +169,18 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo ); } + /** + * @return string + */ function from() { return $this->_query->_fromClause; } + /** + * @param bool $includeContactIDs + * + * @return string|void + */ function where($includeContactIDs = FALSE) { if ($whereClause = $this->_query->whereClause()) { return $whereClause; @@ -159,10 +188,16 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo return ' (1) '; } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Basic.tpl'; } + /** + * @return CRM_Contact_BAO_Query + */ function getQueryObj() { return $this->_query; } diff --git a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php index c2d69cf109..a07b5c3f60 100644 --- a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@ -37,6 +37,9 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se protected $_formValues; public $_permissionedComponent; + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_formValues = $formValues; $this->_permissionedComponent = 'CiviContribute'; @@ -81,6 +84,9 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se } } + /** + * @param $form + */ function buildForm(&$form) { foreach ($this->_amounts as $name => $title) { @@ -113,10 +119,26 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se return $dao->N; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * + * @return string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all( $offset = 0, $rowcount = 0, @@ -167,6 +189,9 @@ ORDER BY donation_amount desc return $sql; } + /** + * @return string + */ function select() { if ($this->start_date_2 || $this->end_date_2) { return " @@ -182,6 +207,9 @@ count(contrib_1.id) AS donation_count } } + /** + * @return null|string + */ function from() { $from = NULL; if ($this->start_date_2 || $this->end_date_2) { @@ -198,6 +226,11 @@ count(contrib_1.id) AS donation_count return $from; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $clauses = array(); @@ -296,6 +329,11 @@ AND c.receive_date < {$this->start_date_1} return implode(' AND ', $clauses); } + /** + * @param bool $includeContactIDs + * + * @return string + */ function having($includeContactIDs = FALSE) { $clauses = array(); $min = CRM_Utils_Array::value('min_amount', $this->_formValues); @@ -311,18 +349,30 @@ AND c.receive_date < {$this->start_date_1} return implode(' AND ', $clauses); } + /** + * @return array + */ function &columns() { return $this->_columns; } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom/ContribSYBNT.tpl'; } + /** + * @return null + */ function summary() { return NULL; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php index c00b6fbed9..3cab0ced25 100644 --- a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php +++ b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php @@ -37,6 +37,9 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate implements CRM_Contac protected $_formValues; public $_permissionedComponent; + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_formValues = $formValues; /** @@ -54,6 +57,9 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate implements CRM_Contac $this->_permissionedComponent = 'CiviContribute'; } + /** + * @param $form + */ function buildForm(&$form) { /** @@ -158,6 +164,9 @@ $having return $sql; } + /** + * @return string + */ function from() { return " civicrm_contribution AS contrib, @@ -169,6 +178,11 @@ civicrm_contact AS contact_a * WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values * */ + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $clauses = array(); @@ -209,6 +223,11 @@ civicrm_contact AS contact_a return implode(' AND ', $clauses); } + /** + * @param bool $includeContactIDs + * + * @return string + */ function having($includeContactIDs = FALSE) { $clauses = array(); $min = CRM_Utils_Array::value('min_amount', $this->_formValues); @@ -238,14 +257,27 @@ civicrm_contact AS contact_a return $dao->N; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * + * @return string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } + /** + * @return array + */ function &columns() { return $this->_columns; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); @@ -255,6 +287,9 @@ civicrm_contact AS contact_a } } + /** + * @return null + */ function summary() { return NULL; } diff --git a/CRM/Contact/Form/Search/Custom/DateAdded.php b/CRM/Contact/Form/Search/Custom/DateAdded.php index fedac0742b..1511d59440 100644 --- a/CRM/Contact/Form/Search/Custom/DateAdded.php +++ b/CRM/Contact/Form/Search/Custom/DateAdded.php @@ -36,6 +36,9 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C protected $_debug = 0; + /** + * @param $formValues + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -50,6 +53,9 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C ); } + /** + * @param $form + */ function buildForm(&$form) { $form->addDate('start_date', ts('Start Date'), FALSE, array('formatType' => 'custom')); $form->addDate('end_date', ts('End Date'), FALSE, array('formatType' => 'custom')); @@ -96,10 +102,22 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C $form->assign('elements', array('start_date', 'end_date', 'includeGroups', 'excludeGroups')); } + /** + * @return null + */ function summary() { return NULL; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -138,6 +156,9 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C ); } + /** + * @return string + */ function from() { //define table name $randomNum = md5(uniqid()); @@ -354,14 +375,25 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C return $from; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { return '(1)'; } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Search/Custom/EmployerListing.php b/CRM/Contact/Form/Search/Custom/EmployerListing.php index 7c23899537..ca42ad05a2 100644 --- a/CRM/Contact/Form/Search/Custom/EmployerListing.php +++ b/CRM/Contact/Form/Search/Custom/EmployerListing.php @@ -36,6 +36,9 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form protected $_formValues; + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_formValues = $formValues; @@ -51,6 +54,9 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form ); } + /** + * @param $form + */ function buildForm(&$form) { /** @@ -79,6 +85,9 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form /* * Set search form field defaults here. */ + /** + * @return array + */ function setDefaultValues() { // Setting default search state to California return array( @@ -153,6 +162,9 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form return $sql; } + /** + * @return string + */ function from() { return " civicrm_relationship cR, @@ -171,6 +183,11 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form * WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values * */ + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $clauses = array(); @@ -218,6 +235,11 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form return implode(' AND ', $clauses); } + /** + * @param bool $includeContactIDs + * + * @return string + */ function having($includeContactIDs = FALSE) { $clauses = array(); return implode(' AND ', $clauses); @@ -235,14 +257,27 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form return $dao->N; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * + * @return string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort); } + /** + * @return array + */ function &columns() { return $this->_columns; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); @@ -252,6 +287,9 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form } } + /** + * @return null + */ function summary() { return NULL; } diff --git a/CRM/Contact/Form/Search/Custom/EventAggregate.php b/CRM/Contact/Form/Search/Custom/EventAggregate.php index d86a00248e..f250e223dc 100644 --- a/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php @@ -37,6 +37,9 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea protected $_formValues; public $_permissionedComponent; + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_formValues = $formValues; $this->_permissionedComponent = array('CiviContribute', 'CiviEvent'); @@ -55,6 +58,9 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea ); } + /** + * @param $form + */ function buildForm(&$form) { /** @@ -171,6 +177,9 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea return $sql; } + /** + * @return string + */ function from() { return " civicrm_participant_payment @@ -191,6 +200,11 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea * WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values * */ + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $clauses = array(); @@ -242,6 +256,9 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea /* This function does a query to get totals for some of the search result columns and returns a totals array. */ + /** + * @return array + */ function summary() { $totalSelect = " SUM(civicrm_contribution.total_amount) as payment_amount,COUNT(civicrm_participant.id) as participant_count, @@ -294,14 +311,27 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea return $dao->N; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * + * @return string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort); } + /** + * @return array + */ function &columns() { return $this->_columns; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Search/Custom/FullText.php b/CRM/Contact/Form/Search/Custom/FullText.php index 08f54f7cd7..16c8a8d06a 100644 --- a/CRM/Contact/Form/Search/Custom/FullText.php +++ b/CRM/Contact/Form/Search/Custom/FullText.php @@ -63,6 +63,9 @@ class CRM_Contact_Form_Search_Custom_FullText implements CRM_Contact_Form_Search protected $_foundRows = array(); + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_text = CRM_Utils_Array::value('text', $formValues); $this->_table = CRM_Utils_Array::value('table', $formValues); @@ -302,6 +305,10 @@ WHERE t.table_name = 'Activity' AND CRM_Core_DAO::executeQuery($sql, $params); } + /** + * @param $tables + * @param $extends + */ function fillCustomInfo(&$tables, $extends) { $sql = " SELECT cg.table_name, cf.column_name @@ -326,6 +333,9 @@ AND cf.html_type IN ( 'Text', 'TextArea', 'RichTextEditor' ) } } + /** + * @param $tables + */ function runQueries(&$tables) { $sql = "TRUNCATE {$this->_entityIDTableName}"; CRM_Core_DAO::executeQuery($sql); @@ -701,6 +711,9 @@ WHERE (c.sort_name LIKE {$this->_text} OR c.display_name LIKE {$this->_text $this->runQueries($tables); } + /** + * @param $form + */ function buildForm(&$form) { $config = CRM_Core_Config::singleton(); @@ -761,6 +774,9 @@ WHERE (c.sort_name LIKE {$this->_text} OR c.display_name LIKE {$this->_text $this->setTitle(ts('Full-text Search')); } + /** + * @return array + */ function &columns() { $this->_columns = array( ts('Contact Id') => 'contact_id', @@ -770,6 +786,9 @@ WHERE (c.sort_name LIKE {$this->_text} OR c.display_name LIKE {$this->_text return $this->_columns; } + /** + * @return array + */ function summary() { $this->initialize(); @@ -827,6 +846,9 @@ WHERE (c.sort_name LIKE {$this->_text} OR c.display_name LIKE {$this->_text return $summary; } + /** + * @return null|string + */ function count() { $this->initialize(); @@ -838,6 +860,14 @@ WHERE (c.sort_name LIKE {$this->_text} OR c.display_name LIKE {$this->_text } } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $returnSQL + * + * @return null|string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { $this->initialize(); @@ -850,6 +880,15 @@ WHERE (c.sort_name LIKE {$this->_text} OR c.display_name LIKE {$this->_text } } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) { $this->initialize(); @@ -871,25 +910,45 @@ FROM {$this->_tableName} contact_a return $sql; } + /** + * @return null + */ function from() { return NULL; } + /** + * @param bool $includeContactIDs + * + * @return null + */ function where($includeContactIDs = FALSE) { return NULL; } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom/FullText.tpl'; } + /** + * @return array + */ function setDefaultValues() { return array(); } + /** + * @param $row + */ function alterRow(&$row) { } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php index 3b7f0a4a4d..2343c2d897 100644 --- a/CRM/Contact/Form/Search/Custom/Group.php +++ b/CRM/Contact/Form/Search/Custom/Group.php @@ -45,6 +45,9 @@ class CRM_Contact_Form_Search_Custom_Group protected $_aclFrom = NULL; protected $_aclWhere = NULL; + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_formValues = $formValues; $this->_columns = array( @@ -87,6 +90,9 @@ class CRM_Contact_Form_Search_Custom_Group // in other parts after the object is destroyed } + /** + * @param $form + */ function buildForm(&$form) { $this->setTitle(ts('Include / Exclude Search')); @@ -164,6 +170,9 @@ class CRM_Contact_Form_Search_Custom_Group /* * Set search form field defaults here. */ + /** + * @return array + */ function setDefaultValues() { $defaults = array( 'andOr' => '1' ); @@ -177,6 +186,15 @@ class CRM_Contact_Form_Search_Custom_Group return $defaults; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE @@ -249,6 +267,10 @@ class CRM_Contact_Form_Search_Custom_Group return $sql; } + /** + * @return string + * @throws Exception + */ function from() { $iGroups = $xGroups = $iTags = $xTags = 0; @@ -547,6 +569,11 @@ WHERE gcc.group_id = {$ssGroup->id} return $from; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { if ($includeContactIDs) { $contactIDs = array(); @@ -575,6 +602,9 @@ WHERE gcc.group_id = {$ssGroup->id} /* * Functions below generally don't need to be modified */ + /** + * @return mixed + */ function count() { $sql = $this->all(); @@ -582,22 +612,42 @@ WHERE gcc.group_id = {$ssGroup->id} return $dao->N; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $returnSQL + * + * @return string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } + /** + * @return array + */ function &columns() { return $this->_columns; } + /** + * @return null + */ function summary() { return NULL; } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); @@ -607,6 +657,9 @@ WHERE gcc.group_id = {$ssGroup->id} } } + /** + * @param string $tableAlias + */ function buildACLClause($tableAlias = 'contact') { list($this->_aclFrom, $this->_aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause($tableAlias); } diff --git a/CRM/Contact/Form/Search/Custom/MultipleValues.php b/CRM/Contact/Form/Search/Custom/MultipleValues.php index d8908a9bfe..4e9831db0b 100644 --- a/CRM/Contact/Form/Search/Custom/MultipleValues.php +++ b/CRM/Contact/Form/Search/Custom/MultipleValues.php @@ -38,6 +38,9 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea protected $_tables; protected $_options; + /** + * @param $formValues + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -88,6 +91,9 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea } } + /** + * @param $form + */ function buildForm(&$form) { /** @@ -128,10 +134,22 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea } } + /** + * @return null + */ function summary() { return NULL; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) { //redirect if custom group not select in search criteria if (empty($this->_formValues['custom_group'])) { @@ -168,6 +186,9 @@ contact_a.sort_name as sort_name, ); } + /** + * @return string + */ function from() { $from = "FROM civicrm_contact contact_a"; $customFrom = array(); @@ -193,6 +214,11 @@ contact_a.sort_name as sort_name, return $from; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $count = 1; $clause = array(); @@ -238,14 +264,23 @@ contact_a.sort_name as sort_name, return $this->whereClause($where, $params); } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom/MultipleValues.tpl'; } + /** + * @return array + */ function setDefaultValues() { return array(); } + /** + * @param $row + */ function alterRow(&$row) { foreach ($this->_options as $fieldID => $values) { $customVal = $valueSeparatedArray = array(); @@ -297,6 +332,9 @@ contact_a.sort_name as sort_name, } } + /** + * @param $title + */ function setTitle($title) { CRM_Utils_System::setTitle($title); } diff --git a/CRM/Contact/Form/Search/Custom/PostalMailing.php b/CRM/Contact/Form/Search/Custom/PostalMailing.php index e968fb89d5..3318185728 100644 --- a/CRM/Contact/Form/Search/Custom/PostalMailing.php +++ b/CRM/Contact/Form/Search/Custom/PostalMailing.php @@ -33,6 +33,9 @@ * */ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface { + /** + * @param $formValues + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -45,6 +48,9 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear ); } + /** + * @param $form + */ function buildForm(&$form) { $groups = array('' => ts('- select group -')) + CRM_Core_PseudoConstant::allGroup(); $form->addElement('select', 'group_id', ts('Group'), $groups); @@ -56,6 +62,15 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear $form->assign('elements', array('group_id')); } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -78,6 +93,9 @@ state_province.name as state_province ); } + /** + * @return string + */ function from() { return " FROM civicrm_group_contact as cgc, @@ -88,6 +106,11 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address. "; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $params = array(); @@ -114,6 +137,9 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address. return $this->whereClause($where, $params); } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } diff --git a/CRM/Contact/Form/Search/Custom/PriceSet.php b/CRM/Contact/Form/Search/Custom/PriceSet.php index eab0dede74..f648fb3730 100644 --- a/CRM/Contact/Form/Search/Custom/PriceSet.php +++ b/CRM/Contact/Form/Search/Custom/PriceSet.php @@ -39,6 +39,9 @@ class CRM_Contact_Form_Search_Custom_PriceSet extends CRM_Contact_Form_Search_Cu protected $_tableName = NULL; public $_permissionedComponent; + /** + * @param $formValues + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -151,6 +154,11 @@ WHERE participant_id = $participantID; } } + /** + * @param null $eventID + * + * @return Object + */ function priceSetDAO($eventID = NULL) { // get all the events that have a price set associated with it @@ -177,6 +185,11 @@ AND p.entity_id = e.id return $dao; } + /** + * @param $form + * + * @throws Exception + */ function buildForm(&$form) { $dao = $this->priceSetDAO(); @@ -247,10 +260,22 @@ AND p.entity_id = e.id } } + /** + * @return null + */ function summary() { return NULL; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -279,6 +304,9 @@ contact_a.display_name as display_name"; ); } + /** + * @return string + */ function from() { return " FROM civicrm_contact contact_a @@ -286,20 +314,37 @@ INNER JOIN {$this->_tableName} tempTable ON ( tempTable.contact_id = contact_a.i "; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { return ' ( 1 ) '; } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } + /** + * @return array + */ function setDefaultValues() { return array(); } + /** + * @param $row + */ function alterRow(&$row) {} + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Search/Custom/Proximity.php b/CRM/Contact/Form/Search/Custom/Proximity.php index 91bc96bd49..6bf658b34e 100644 --- a/CRM/Contact/Form/Search/Custom/Proximity.php +++ b/CRM/Contact/Form/Search/Custom/Proximity.php @@ -38,6 +38,11 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C protected $_longitude = NULL; protected $_distance = NULL; + /** + * @param $formValues + * + * @throws Exception + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -91,6 +96,9 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C ); } + /** + * @param $form + */ function buildForm(&$form) { $config = CRM_Core_Config::singleton(); @@ -166,6 +174,15 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C )); } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -190,6 +207,9 @@ country.name as country ); } + /** + * @return string + */ function from() { $f = " FROM civicrm_contact contact_a @@ -214,6 +234,11 @@ LEFT JOIN civicrm_group_contact cgc ON ( cgc.contact_id = contact_a.id AND cgc.s return $f; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $params = array(); $clause = array(); @@ -240,10 +265,16 @@ AND cgc.group_id = {$this->_group} return $this->whereClause($where, $params); } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom/Proximity.tpl'; } + /** + * @return array|null + */ function setDefaultValues() { $config = CRM_Core_Config::singleton(); $countryDefault = $config->defaultContactCountry; @@ -266,8 +297,14 @@ AND cgc.group_id = {$this->_group} return NULL; } + /** + * @param $row + */ function alterRow(&$row) {} + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Search/Custom/RandomSegment.php b/CRM/Contact/Form/Search/Custom/RandomSegment.php index b8fe0d9179..88a8508343 100644 --- a/CRM/Contact/Form/Search/Custom/RandomSegment.php +++ b/CRM/Contact/Form/Search/Custom/RandomSegment.php @@ -36,6 +36,9 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear protected $_debug = 0; + /** + * @param $formValues + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -70,6 +73,9 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear } } + /** + * @param $form + */ function buildForm(&$form) { $form->add('text', 'segmentSize', @@ -110,10 +116,22 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear $form->assign('elements', array('segmentSize', 'includeGroups', 'excludeGroups')); } + /** + * @return null + */ function summary() { return NULL; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -133,6 +151,9 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear ); } + /** + * @return string + */ function from() { //define table name $randomNum = md5(uniqid()); @@ -311,14 +332,25 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear return $from; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { return '(1)'; } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Search/Custom/Sample.php b/CRM/Contact/Form/Search/Custom/Sample.php index e4eda144ef..bb8f6af6fc 100644 --- a/CRM/Contact/Form/Search/Custom/Sample.php +++ b/CRM/Contact/Form/Search/Custom/Sample.php @@ -33,6 +33,9 @@ * */ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface { + /** + * @param $formValues + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -53,6 +56,9 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust ); } + /** + * @param $form + */ function buildForm(&$form) { $form->add('text', @@ -76,6 +82,9 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust $form->assign('elements', array('household_name', 'state_province_id')); } + /** + * @return array + */ function summary() { $summary = array( 'summary' => 'This is a summary', @@ -84,6 +93,15 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust return $summary; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -105,6 +123,9 @@ state_province.name as state_province ); } + /** + * @return string + */ function from() { return " FROM civicrm_contact contact_a @@ -116,6 +137,11 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.s "; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $params = array(); $where = "contact_a.contact_type = 'Household'"; @@ -155,20 +181,32 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.s return $this->whereClause($where, $params); } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } + /** + * @return array + */ function setDefaultValues() { return array( 'household_name' => '', ); } + /** + * @param $row + */ function alterRow(&$row) { $row['sort_name'] .= ' ( altered )'; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Search/Custom/TagContributions.php b/CRM/Contact/Form/Search/Custom/TagContributions.php index 5c4d449b2b..2b6f7399c4 100644 --- a/CRM/Contact/Form/Search/Custom/TagContributions.php +++ b/CRM/Contact/Form/Search/Custom/TagContributions.php @@ -37,6 +37,9 @@ class CRM_Contact_Form_Search_Custom_TagContributions implements CRM_Contact_For protected $_formValues; public $_permissionedComponent; + /** + * @param $formValues + */ function __construct(&$formValues) { $this->_formValues = $formValues; $this->_permissionedComponent = 'CiviContribute'; @@ -54,6 +57,9 @@ class CRM_Contact_Form_Search_Custom_TagContributions implements CRM_Contact_For ); } + /** + * @param $form + */ function buildForm(&$form) { /** @@ -136,6 +142,9 @@ WHERE $where return $sql; } + /** + * @return string + */ function from() { return " civicrm_contribution, @@ -150,6 +159,11 @@ WHERE $where * WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values * */ + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $clauses = array(); @@ -206,14 +220,27 @@ WHERE $where return $dao->N; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * + * @return string + */ function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } + /** + * @return array + */ function &columns() { return $this->_columns; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); @@ -223,6 +250,9 @@ WHERE $where } } + /** + * @return null + */ function summary() { return NULL; } diff --git a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php index 312f3b1e93..5f61345b34 100644 --- a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php +++ b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php @@ -33,6 +33,9 @@ * */ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface { + /** + * @param $formValues + */ function __construct(&$formValues) { parent::__construct($formValues); @@ -44,6 +47,9 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc ); } + /** + * @param $form + */ function buildForm(&$form) { $form->add('text', 'postal_code_low', @@ -69,11 +75,23 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc $form->assign('elements', array('postal_code_low', 'postal_code_high')); } + /** + * @return array + */ function summary() { $summary = array(); return $summary; } + /** + * @param int $offset + * @param int $rowcount + * @param null $sort + * @param bool $includeContactIDs + * @param bool $justIDs + * + * @return string + */ function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -94,6 +112,9 @@ address.postal_code as postal_code ); } + /** + * @return string + */ function from() { return " FROM civicrm_contact contact_a @@ -104,6 +125,11 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND "; } + /** + * @param bool $includeContactIDs + * + * @return string + */ function where($includeContactIDs = FALSE) { $params = array(); @@ -130,14 +156,23 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND return $this->whereClause($where, $params); } + /** + * @return array + */ function setDefaultValues() { return array(); } + /** + * @return string + */ function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } + /** + * @param $title + */ function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 64a0104d7f..b9eb35da8e 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -98,6 +98,10 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { self::preProcessCommon($this); } + /** + * @param $form + * @param bool $useTable + */ static function preProcessCommon(&$form, $useTable = FALSE) { $form->_contactIds = array(); diff --git a/CRM/Contact/Form/Task/AddToTag.php b/CRM/Contact/Form/Task/AddToTag.php index 27942090f0..ec56edf08b 100644 --- a/CRM/Contact/Form/Task/AddToTag.php +++ b/CRM/Contact/Form/Task/AddToTag.php @@ -79,6 +79,12 @@ class CRM_Contact_Form_Task_AddToTag extends CRM_Contact_Form_Task { $this->addFormRule(array('CRM_Contact_Form_Task_AddToTag', 'formRule')); } + /** + * @param $form + * @param $rule + * + * @return array + */ static function formRule($form, $rule) { $errors = array(); if (empty($form['tag']) && empty($form['contact_taglist'])) { diff --git a/CRM/Contact/Form/Task/AlterPreferences.php b/CRM/Contact/Form/Task/AlterPreferences.php index e6ec2e8307..41eee10aa2 100644 --- a/CRM/Contact/Form/Task/AlterPreferences.php +++ b/CRM/Contact/Form/Task/AlterPreferences.php @@ -80,6 +80,12 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task { return $defaults; } + /** + * @param $form + * @param $rule + * + * @return array + */ static function formRule($form, $rule) { $errors = array(); if (empty($form['pref']) && empty($form['contact_taglist'])) { diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 279394e501..acd679f655 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -45,6 +45,9 @@ class CRM_Contact_Form_Task_EmailCommon { public $_allContactDetails = array(); public $_toContactEmails = array(); + /** + * @param $form + */ static function preProcessFromAddress(&$form) { $form->_single = FALSE; $className = CRM_Utils_System::getClassName($form); diff --git a/CRM/Contact/Form/Task/Label.php b/CRM/Contact/Form/Task/Label.php index e036741723..5826bcf163 100644 --- a/CRM/Contact/Form/Task/Label.php +++ b/CRM/Contact/Form/Task/Label.php @@ -429,6 +429,9 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { return $returnProperties; } + /** + * @param $rows + */ function mergeSameAddress(&$rows) { $uniqueAddress = array(); foreach (array_keys($rows) as $rowID) { diff --git a/CRM/Contact/Form/Task/LabelCommon.php b/CRM/Contact/Form/Task/LabelCommon.php index de28724799..5e72b24188 100644 --- a/CRM/Contact/Form/Task/LabelCommon.php +++ b/CRM/Contact/Form/Task/LabelCommon.php @@ -389,6 +389,11 @@ class CRM_Contact_Form_Task_LabelCommon { } } + /** + * @param $rows + * + * @return array + */ function mergeSameHousehold(&$rows) { # group selected contacts by type $individuals = array(); diff --git a/CRM/Contact/Form/Task/Map/Event.php b/CRM/Contact/Form/Task/Map/Event.php index 441b461bd8..bca9f0bb75 100644 --- a/CRM/Contact/Form/Task/Map/Event.php +++ b/CRM/Contact/Form/Task/Map/Event.php @@ -59,6 +59,15 @@ class CRM_Contact_Form_Task_Map_Event extends CRM_Contact_Form_Task_Map { $this->assign('skipLocationType', TRUE); } + /** + * Use the form name to create the tpl file name + * + * @return string + * @access public + */ + /** + * @return string + */ function getTemplateFileName() { return 'CRM/Contact/Form/Task/Map.tpl'; } diff --git a/CRM/Contact/Form/Task/PDF.php b/CRM/Contact/Form/Task/PDF.php index 7a8e12c164..9686b0ced6 100644 --- a/CRM/Contact/Form/Task/PDF.php +++ b/CRM/Contact/Form/Task/PDF.php @@ -87,6 +87,17 @@ class CRM_Contact_Form_Task_PDF extends CRM_Contact_Form_Task { $this->assign('single', $this->_single); } + /** + * This function sets the default values for the form. Relationship that in edit/view action + * the default values are retrieved from the database + * + * @access public + * + * @return void + */ + /** + * + */ function setDefaultValues() { $defaults = array(); if (isset($this->_activityId)) { diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index de6b300d5d..5127d365d1 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -63,6 +63,10 @@ class CRM_Contact_Form_Task_PDFLetterCommon { CRM_Utils_System::setTitle('Create Printable Letters (PDF)'); } + /** + * @param $form + * @param $cid + */ static function preProcessSingle(&$form, $cid) { $form->_contactIds = array($cid); // put contact display name in title for single contact mode @@ -382,6 +386,13 @@ class CRM_Contact_Form_Task_PDFLetterCommon { CRM_Utils_System::civiExit(1); } + /** + * @param $form + * @param $html_message + * @param $contactIds + * + * @throws CRM_Core_Exception + */ static function createActivities($form, $html_message, $contactIds) { //Added for CRM-12682: Add activity subject and campaign fields $formValues = $form->controller->exportValues($form->getName()); @@ -430,6 +441,9 @@ class CRM_Contact_Form_Task_PDFLetterCommon { } } + /** + * @param $message + */ static function formatMessage(&$message) { $newLineOperators = array( 'p' => array( diff --git a/CRM/Contact/Form/Task/RemoveFromTag.php b/CRM/Contact/Form/Task/RemoveFromTag.php index 863494c295..6c4f506018 100644 --- a/CRM/Contact/Form/Task/RemoveFromTag.php +++ b/CRM/Contact/Form/Task/RemoveFromTag.php @@ -76,6 +76,12 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task { $this->addFormRule(array('CRM_Contact_Form_Task_RemoveFromTag', 'formRule')); } + /** + * @param $form + * @param $rule + * + * @return array + */ static function formRule($form, $rule) { $errors = array(); if (empty($form['tag']) && empty($form['contact_taglist'])) { diff --git a/CRM/Contact/Form/Task/SMSCommon.php b/CRM/Contact/Form/Task/SMSCommon.php index 8d32a98aab..b632b15669 100644 --- a/CRM/Contact/Form/Task/SMSCommon.php +++ b/CRM/Contact/Form/Task/SMSCommon.php @@ -47,6 +47,9 @@ class CRM_Contact_Form_Task_SMSCommon { public $_toContactPhone = array(); + /** + * @param $form + */ static function preProcessProvider(&$form) { $form->_single = FALSE; $className = CRM_Utils_System::getClassName($form); diff --git a/CRM/Contact/Form/Task/Unhold.php b/CRM/Contact/Form/Task/Unhold.php index c3b4ad1df2..cc98b573af 100644 --- a/CRM/Contact/Form/Task/Unhold.php +++ b/CRM/Contact/Form/Task/Unhold.php @@ -1,4 +1,8 @@ _name = $name; $this->_title = $title; @@ -154,6 +172,9 @@ class CRM_Contact_Import_Field { $this->_value = $value; } + /** + * @return bool + */ function validate() { // echo $this->_value."===========
"; $message = ''; diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index a31e5086ed..93196eb548 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -227,6 +227,18 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { ); } + /** + * 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() { $config = CRM_Core_Config::singleton(); $defaults = array( @@ -244,6 +256,10 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { return $defaults; } + /** + * @return array + * @throws Exception + */ private function _getDataSources() { // Open the data source dir and scan it for class files $config = CRM_Core_Config::singleton(); diff --git a/CRM/Contact/Import/ImportJob.php b/CRM/Contact/Import/ImportJob.php index f633c2c75c..3d45cacd2c 100644 --- a/CRM/Contact/Import/ImportJob.php +++ b/CRM/Contact/Import/ImportJob.php @@ -73,6 +73,13 @@ class CRM_Contact_Import_ImportJob { protected $_parser; + /** + * @param null $tableName + * @param null $createSql + * @param bool $createTable + * + * @throws Exception + */ public function __construct($tableName = NULL, $createSql = NULL, $createTable = FALSE) { $dao = new CRM_Core_DAO(); $db = $dao->getDatabaseConnection(); @@ -114,10 +121,19 @@ class CRM_Contact_Import_ImportJob { foreach ($properties as $property) $this->{"_$property"} = array(); } + /** + * @return null|string + */ public function getTableName() { return $this->_tableName; } + /** + * @param bool $dropIfComplete + * + * @return bool + * @throws Exception + */ public function isComplete($dropIfComplete = TRUE) { if (!$this->_statusFieldName) { CRM_Core_Error::fatal("Could not get name of the import status field"); @@ -135,6 +151,9 @@ class CRM_Contact_Import_ImportJob { return TRUE; } + /** + * @param $params + */ public function setJobParams(&$params) { foreach ($params as $param => $value) { $fldName = "_$param"; @@ -142,6 +161,10 @@ class CRM_Contact_Import_ImportJob { } } + /** + * @param $form + * @param int $timeout + */ public function runImport(&$form, $timeout = 55) { $mapper = $this->_mapper; $mapperFields = array(); @@ -307,10 +330,20 @@ class CRM_Contact_Import_ImportJob { } } + /** + * @param $form + */ public function setFormVariables($form) { $this->_parser->set($form, CRM_Import_Parser::MODE_IMPORT); } + /** + * @param $contactIds + * @param $newGroupName + * @param $newGroupDesc + * + * @return array|bool + */ private function _addImportedContactsToNewGroup($contactIds, $newGroupName, $newGroupDesc ) { @@ -357,6 +390,13 @@ class CRM_Contact_Import_ImportJob { return FALSE; } + /** + * @param $contactIds + * @param $newTagName + * @param $newTagDesc + * + * @return array|bool + */ private function _tagImportedContactsWithNewTag($contactIds, $newTagName, $newTagDesc ) { @@ -406,6 +446,9 @@ class CRM_Contact_Import_ImportJob { return FALSE; } + /** + * @return array + */ public static function getIncompleteImportTables() { $dao = new CRM_Core_DAO(); $database = $dao->database(); diff --git a/CRM/Contact/Import/Importer.php b/CRM/Contact/Import/Importer.php index 72e4bcbda4..32931fd6c4 100644 --- a/CRM/Contact/Import/Importer.php +++ b/CRM/Contact/Import/Importer.php @@ -38,10 +38,16 @@ * via a form post) and asynchronously (i.e. by the workflow system) */ class CRM_Contact_Import_Importer { + /** + * + */ public function __construct() { // may not need this } + /** + * @param int $timeout + */ public function runIncompleteImportJobs($timeout = 55) { $startTime = time(); $incompleteImportTables = CRM_Contact_Import_ImportJob::getIncompleteImportTables(); diff --git a/CRM/Contact/Import/Parser.php b/CRM/Contact/Import/Parser.php index 16de2f4152..9f3b8704f3 100644 --- a/CRM/Contact/Import/Parser.php +++ b/CRM/Contact/Import/Parser.php @@ -87,6 +87,23 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { */ public $_dedupeRuleGroupID = NULL; + /** + * @param $tableName + * @param $mapper + * @param int $mode + * @param int $contactType + * @param string $primaryKeyName + * @param string $statusFieldName + * @param int $onDuplicate + * @param null $statusID + * @param null $totalRowCount + * @param bool $doGeocodeAddress + * @param int $timeout + * @param null $contactSubType + * @param null $dedupeRuleGroupID + * + * @return mixed + */ function run($tableName, &$mapper, $mode = self::MODE_PREVIEW, @@ -403,18 +420,30 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { } } + /** + * @param $elements + */ function setActiveFieldLocationTypes($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_hasLocationType = $elements[$i]; } } + /** + * @param $elements + */ + /** + * @param $elements + */ function setActiveFieldPhoneTypes($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_phoneType = $elements[$i]; } } + /** + * @param $elements + */ function setActiveFieldWebsiteTypes($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_websiteType = $elements[$i]; @@ -435,36 +464,54 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { } } + /** + * @param $elements + */ function setActiveFieldRelated($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_related = $elements[$i]; } } + /** + * @param $elements + */ function setActiveFieldRelatedContactType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactType = $elements[$i]; } } + /** + * @param $elements + */ function setActiveFieldRelatedContactDetails($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactDetails = $elements[$i]; } } + /** + * @param $elements + */ function setActiveFieldRelatedContactLocType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactLocType = $elements[$i]; } } + /** + * @param $elements + */ function setActiveFieldRelatedContactPhoneType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactPhoneType = $elements[$i]; } } + /** + * @param $elements + */ function setActiveFieldRelatedContactWebsiteType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactWebsiteType = $elements[$i]; @@ -585,6 +632,9 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { return $params; } + /** + * @return array + */ function getColumnPatterns() { $values = array(); foreach ($this->_fields as $name => $field) { @@ -593,6 +643,14 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { return $values; } + /** + * @param $name + * @param $title + * @param int $type + * @param string $headerPattern + * @param string $dataPattern + * @param bool $hasLocationType + */ function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//', $hasLocationType = FALSE diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index cf4a173f22..e582fb2190 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -2081,6 +2081,12 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { return $returnCode; } + /** + * @param $relKey + * @param $params + * + * @return bool + */ function checkRelatedContactFields($relKey, $params) { //avoid blank contact creation. $allowToCreate = FALSE; diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index a7e38b0b15..7cda6262c2 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -320,6 +320,12 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se } //end of function + /** + * @param null $action + * @param null $output + * + * @return array + */ function &getColHeads($action = NULL, $output = NULL) { $colHeads = self::_getColumnHeaders(); $colHeads[] = array('desc' => ts('Actions'), 'name' => ts('Action')); @@ -818,6 +824,11 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se return $rows; } + /** + * @param $sort + * + * @return string + */ function buildPrevNextCache($sort) { $cacheKey = 'civicrm search ' . $this->_key; @@ -849,6 +860,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se return $cacheKey; } + /** + * @param $rows + */ function addActions(&$rows) { $config = CRM_Core_Config::singleton(); @@ -941,6 +955,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se } } + /** + * @param $rows + */ function removeActions(&$rows) { foreach ($rows as $rid => & $rValue) { unset($rValue['contact_type']); @@ -1130,14 +1147,29 @@ SELECT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', contact_a.dis return self::$_columnHeaders; } + /** + * @return CRM_Contact_BAO_Query + */ function &getQuery() { return $this->_query; } + /** + * @return CRM_Contact_DAO_Contact + */ function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } + /** + * @param $params + * @param $action + * @param $sortID + * @param null $displayRelationshipType + * @param string $queryOperator + * + * @return CRM_Contact_DAO_Contact + */ function contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { $sortOrder = &$this->getSortOrder($this->_action); $sort = new CRM_Utils_Sort($sortOrder, $sortID); @@ -1170,6 +1202,11 @@ SELECT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', contact_a.dis return $value; } + /** + * @param $returnProperties + * + * @return array + */ function &makeProperties(&$returnProperties) { $properties = array(); foreach ($returnProperties as $name => $value) { diff --git a/CRM/Contact/Selector/Controller.php b/CRM/Contact/Selector/Controller.php index 94a3b9e56c..9e078655e8 100644 --- a/CRM/Contact/Selector/Controller.php +++ b/CRM/Contact/Selector/Controller.php @@ -33,6 +33,16 @@ * */ class CRM_Contact_Selector_Controller extends CRM_Core_Selector_Controller { + /** + * default function for qill, if needed to be implemented, we + * expect the subclass to do it + * + * @return string the status message + * @access public + */ + /** + * @return string + */ function getQill() { return $this->_object->getQILL(); } diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php index 6ddea8213c..d5fc147ba1 100644 --- a/CRM/Contact/Selector/Custom.php +++ b/CRM/Contact/Selector/Custom.php @@ -383,6 +383,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { return NULL; } + /** + * @return mixed + */ public function getSummary() { return $this->_search->summary(); } @@ -398,10 +401,22 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { return ts('CiviCRM Custom Search'); } + /** + * @return null + */ function alphabetQuery() { return NULL; } + /** + * @param $params + * @param $action + * @param $sortID + * @param null $displayRelationshipType + * @param string $queryOperator + * + * @return Object + */ function &contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { $params = array(); $sql = $this->_search->contactIDs($params); @@ -409,6 +424,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { return CRM_Core_DAO::executeQuery($sql, $params); } + /** + * @param $rows + */ function addActions(&$rows) { $links = self::links(); @@ -431,6 +449,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } } + /** + * @param $rows + */ function removeActions(&$rows) { foreach ($rows as $rid => & $rValue) { unset($rValue['action']); diff --git a/CRM/Contact/Task.php b/CRM/Contact/Task.php index 5c7f45be67..85b387e440 100644 --- a/CRM/Contact/Task.php +++ b/CRM/Contact/Task.php @@ -369,6 +369,11 @@ class CRM_Contact_Task { return $tasks; } + /** + * @param $value + * + * @return array + */ static function getTask($value) { self::initTasks(); -- 2.25.1