From 69078420f066e5d038b91372e9a19eb77073121b Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 11 Apr 2019 07:11:37 +1000 Subject: [PATCH] (NFC) Update CRM/Contact to match new coder style --- CRM/Contact/ActionMapping.php | 4 +- CRM/Contact/BAO/Contact.php | 59 +++++++------- CRM/Contact/BAO/Contact/Permission.php | 5 +- CRM/Contact/BAO/Group.php | 8 +- CRM/Contact/BAO/GroupContact.php | 2 +- CRM/Contact/BAO/GroupContactCache.php | 2 +- CRM/Contact/BAO/GroupNestingCache.php | 2 +- CRM/Contact/BAO/ProximityQuery.php | 3 + CRM/Contact/BAO/Query.php | 76 ++++++++++--------- CRM/Contact/BAO/Relationship.php | 4 +- CRM/Contact/BAO/SubscriptionHistory.php | 1 + CRM/Contact/Form/Contact.php | 40 +++++----- CRM/Contact/Form/CustomData.php | 54 +++++++------ CRM/Contact/Form/DedupeFind.php | 28 +++---- CRM/Contact/Form/DedupeRules.php | 16 ++-- CRM/Contact/Form/Edit/Address.php | 31 ++++---- .../Form/Edit/CommunicationPreferences.php | 2 +- CRM/Contact/Form/Edit/Phone.php | 8 +- CRM/Contact/Form/GroupContact.php | 13 ++-- CRM/Contact/Form/Inline.php | 3 + CRM/Contact/Form/Inline/Address.php | 5 ++ CRM/Contact/Form/Inline/CustomData.php | 2 +- CRM/Contact/Form/Inline/Email.php | 2 + CRM/Contact/Form/Inline/IM.php | 2 + CRM/Contact/Form/Inline/OpenID.php | 2 + CRM/Contact/Form/Inline/Phone.php | 2 + CRM/Contact/Form/Inline/Website.php | 2 + CRM/Contact/Form/Merge.php | 26 ++++--- CRM/Contact/Form/RelatedContact.php | 8 +- CRM/Contact/Form/Relationship.php | 28 ++++--- CRM/Contact/Form/Search.php | 31 ++++---- CRM/Contact/Form/Search/Advanced.php | 17 +++-- CRM/Contact/Form/Search/Basic.php | 23 +++--- CRM/Contact/Form/Search/Builder.php | 18 ++--- CRM/Contact/Form/Search/Criteria.php | 4 +- CRM/Contact/Form/Search/Custom.php | 1 + CRM/Contact/Form/Search/Custom/Basic.php | 13 ++-- CRM/Contact/Form/Search/Custom/DateAdded.php | 4 +- .../Form/Search/Custom/EventAggregate.php | 16 ++-- CRM/Contact/Form/Search/Custom/FullText.php | 9 ++- .../Custom/FullText/AbstractPartialQuery.php | 10 ++- .../Search/Custom/FullText/Contribution.php | 3 +- .../Form/Search/Custom/PostalMailing.php | 1 + CRM/Contact/Form/Search/Custom/Proximity.php | 1 + .../Form/Search/Custom/RandomSegment.php | 1 + CRM/Contact/Form/Search/Custom/Sample.php | 1 + .../Form/Search/Custom/TagContributions.php | 2 +- .../Form/Search/Custom/ZipCodeRange.php | 1 + CRM/Contact/Form/Task.php | 28 +++---- CRM/Contact/Form/Task/AddToGroup.php | 18 ++--- CRM/Contact/Form/Task/AddToParentClass.php | 22 +++--- CRM/Contact/Form/Task/AddToTag.php | 6 +- CRM/Contact/Form/Task/Batch.php | 31 ++++---- CRM/Contact/Form/Task/Delete.php | 37 ++++----- CRM/Contact/Form/Task/EmailCommon.php | 12 +-- CRM/Contact/Form/Task/LabelCommon.php | 1 - CRM/Contact/Form/Task/Map.php | 13 ++-- CRM/Contact/Form/Task/PickProfile.php | 9 ++- CRM/Contact/Form/Task/Print.php | 23 +++--- CRM/Contact/Form/Task/ProximityCommon.php | 6 +- CRM/Contact/Form/Task/RemoveFromGroup.php | 12 +-- CRM/Contact/Form/Task/RemoveFromTag.php | 12 +-- CRM/Contact/Form/Task/Result.php | 13 ++-- CRM/Contact/Form/Task/SMSCommon.php | 19 +++-- CRM/Contact/Form/Task/Unhold.php | 10 +-- CRM/Contact/Import/Field.php | 5 +- CRM/Contact/Import/Form/DataSource.php | 29 ++++--- CRM/Contact/Import/Form/MapField.php | 10 +-- CRM/Contact/Import/Form/Preview.php | 6 +- CRM/Contact/Import/Importer.php | 1 + CRM/Contact/Import/Parser.php | 44 +++++------ CRM/Contact/Import/Parser/Contact.php | 33 ++++---- CRM/Contact/Page/AJAX.php | 32 ++++---- CRM/Contact/Page/CustomSearch.php | 2 +- CRM/Contact/Page/DedupeException.php | 1 + CRM/Contact/Page/DedupeMerge.php | 4 +- CRM/Contact/Page/DedupeRules.php | 2 +- CRM/Contact/Page/SavedSearch.php | 2 +- CRM/Contact/Page/View.php | 14 ++-- CRM/Contact/Page/View/CustomData.php | 2 +- CRM/Contact/Page/View/Note.php | 4 +- CRM/Contact/Page/View/Relationship.php | 2 +- CRM/Contact/Page/View/Summary.php | 2 +- CRM/Contact/Page/View/UserDashBoard.php | 2 +- CRM/Contact/Selector.php | 6 +- CRM/Contact/Selector/Controller.php | 1 + CRM/Contact/Selector/Custom.php | 7 +- CRM/Contact/Task.php | 11 ++- 88 files changed, 573 insertions(+), 517 deletions(-) diff --git a/CRM/Contact/ActionMapping.php b/CRM/Contact/ActionMapping.php index 90cae0a3a8..2f5f7b28d7 100644 --- a/CRM/Contact/ActionMapping.php +++ b/CRM/Contact/ActionMapping.php @@ -25,7 +25,6 @@ +--------------------------------------------------------------------+ */ -use Civi\ActionSchedule\RecipientBuilder; /** * Class CRM_Contact_ActionMapping @@ -142,7 +141,8 @@ class CRM_Contact_ActionMapping extends \Civi\ActionSchedule\Mapping { 'casEntityIdField' => 'e.id', 'casContactTableAlias' => NULL, ]); - $query->where('1'); // possible to have no "where" in this case + // possible to have no "where" in this case + $query->where('1'); } $query['casDateField'] = 'e.' . $dateDBField; diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 4a8d50a519..f1fb6929d8 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -62,7 +62,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * * @var array */ - static $_commPrefs = array( + public static $_commPrefs = array( 'do_not_phone', 'do_not_email', 'do_not_mail', @@ -75,7 +75,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * * @var array */ - static $_greetingTypes = array( + public static $_greetingTypes = array( 'addressee', 'email_greeting', 'postal_greeting', @@ -86,14 +86,14 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * * @var array */ - static $_importableFields = array(); + public static $_importableFields = array(); /** * Static field for all the contact information that we can potentially export. * * @var array */ - static $_exportableFields = NULL; + public static $_exportableFields = NULL; /** * Class constructor. @@ -462,7 +462,8 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { if (!empty($params['contact_id']) && !empty($missingGreetingParams)) { $savedGreetings = civicrm_api3('Contact', 'getsingle', array( 'id' => $params['contact_id'], - 'return' => array_keys($missingGreetingParams)) + 'return' => array_keys($missingGreetingParams), + ) ); foreach (array_keys($missingGreetingParams) as $missingGreetingParam) { @@ -1489,7 +1490,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); * True when used during search, might conflict with export param?. * * @param bool $withMultiRecord - * + * @param bool $checkPermissions * @return array * array of exportable Fields */ @@ -1524,8 +1525,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); 'Household', 'Organization', 'All', - ) - )) { + ))) { $fields = array_merge($fields, CRM_Core_OptionValue::getFields('', $contactType)); } // add current employer for individuals @@ -1591,10 +1591,10 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); } else { foreach (array( - 'Individual', - 'Household', - 'Organization', - ) as $type) { + 'Individual', + 'Household', + 'Organization', + ) as $type) { $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport($type, FALSE, FALSE, $search, $checkPermissions, $withMultiRecord) ); @@ -2387,23 +2387,21 @@ ORDER BY civicrm_email.is_primary DESC"; } } } - elseif (in_array($key, - array( - 'nick_name', - 'job_title', - 'middle_name', - 'birth_date', - 'gender_id', - 'current_employer', - 'prefix_id', - 'suffix_id', - )) && - ($value == '' || !isset($value)) && - ($session->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0 || - ($key == 'current_employer' && empty($params['current_employer']))) { - // CRM-10128: if auth source is not checksum / login && $value is blank, do not fill $data with empty value - // to avoid update with empty values - continue; + elseif (in_array($key, array( + 'nick_name', + 'job_title', + 'middle_name', + 'birth_date', + 'gender_id', + 'current_employer', + 'prefix_id', + 'suffix_id', + )) && ($value == '' || !isset($value)) && + ($session->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0 || + ($key == 'current_employer' && empty($params['current_employer']))) { + // CRM-10128: if auth source is not checksum / login && $value is blank, do not fill $data with empty value + // to avoid update with empty values + continue; } else { $data[$key] = $value; @@ -3416,8 +3414,7 @@ LEFT JOIN civicrm_address ON ( civicrm_address.contact_id = civicrm_contact.id ) array('table' => 'civicrm_im', 'column' => 'contact_id'), array('table' => 'civicrm_phone', 'column' => 'contact_id'), array('table' => 'civicrm_website', 'column' => 'contact_id'), - ) - ) + )) ->alterTriggerInfo($info, $tableName); // Update phone table to populate phone_numeric field diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index 3ab63c8290..731958c98a 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -47,7 +47,7 @@ class CRM_Contact_BAO_Contact_Permission { * @see CRM_Contact_BAO_Contact_Permission::allow * * @return array - * list of contact IDs the logged in user has the given permission for + * list of contact IDs the logged in user has the given permission for */ public static function allowList($contact_ids, $type = CRM_Core_Permission::VIEW) { $result_set = []; @@ -114,7 +114,7 @@ WHERE contact_id IN ({$contact_id_list}) // if some have been rejected, double check for permissions inherited by relationship if (count($result_set) < count($contact_ids)) { - $rejected_contacts = array_diff_key($contact_ids, $result_set); + $rejected_contacts = array_diff_key($contact_ids, $result_set); // @todo consider storing these to the acl cache for next time, since we have fetched. $allowed_by_relationship = self::relationshipList($rejected_contacts, $type); foreach ($allowed_by_relationship as $contact_id) { @@ -427,7 +427,6 @@ SELECT second_degree_relationship.contact_id_{$second_direction['to']} AS contac return array_keys($result_set); } - /** * @param int $contactID * @param CRM_Core_Form $form diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 3ac9d27470..94d8852e9a 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -751,7 +751,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @todo there seems little reason for the small number of functions that call this to pass in * params that then need to be translated in this function since they are coding them when calling */ - static public function getGroupListSelector(&$params) { + public static function getGroupListSelector(&$params) { // format the params $params['offset'] = ($params['page'] - 1) * $params['rp']; $params['rowCount'] = $params['rp']; @@ -999,11 +999,13 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { $values[$object->id]['org_info'] = "{$object->org_name}"; } else { - $values[$object->id]['org_info'] = ''; // Empty cell + // Empty cell + $values[$object->id]['org_info'] = ''; } } else { - $values[$object->id]['org_info'] = NULL; // Collapsed column if all cells are NULL + // Collapsed column if all cells are NULL + $values[$object->id]['org_info'] = NULL; } if ($object->created_id) { $contactUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$object->created_id}"); diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 688fb63f02..c4540d79d5 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -318,7 +318,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { * @param bool $includeSmartGroups * Include or Exclude Smart Group(s) * - * @return array|int $values + * @return array|int * the relevant data object values for the contact or the total count when $count is TRUE */ public static function getContactGroup( diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index e05bd90938..a54dcdeb43 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -32,7 +32,7 @@ */ class CRM_Contact_BAO_GroupContactCache extends CRM_Contact_DAO_GroupContactCache { - static $_alreadyLoaded = []; + public static $_alreadyLoaded = []; /** * Get a list of caching modes. diff --git a/CRM/Contact/BAO/GroupNestingCache.php b/CRM/Contact/BAO/GroupNestingCache.php index 74d7d6f1fe..e48d988b90 100644 --- a/CRM/Contact/BAO/GroupNestingCache.php +++ b/CRM/Contact/BAO/GroupNestingCache.php @@ -37,7 +37,7 @@ class CRM_Contact_BAO_GroupNestingCache { * * @throws \Exception */ - static public function update() { + public static function update() { // lets build the tree in memory first $sql = " diff --git a/CRM/Contact/BAO/ProximityQuery.php b/CRM/Contact/BAO/ProximityQuery.php index 2815979a17..c1e72783b8 100644 --- a/CRM/Contact/BAO/ProximityQuery.php +++ b/CRM/Contact/BAO/ProximityQuery.php @@ -50,6 +50,9 @@ class CRM_Contact_BAO_ProximityQuery { * This version has been taken from Drupal's location module: http://drupal.org/project/location */ + /** + * @var string + */ static protected $_earthFlattening; static protected $_earthRadiusSemiMinor; static protected $_earthRadiusSemiMajor; diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index bc0450975b..e5f9b4c604 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -80,14 +80,14 @@ class CRM_Contact_BAO_Query { * * @var array */ - static $_defaultReturnProperties = NULL; + public static $_defaultReturnProperties = NULL; /** * The default set of hier return properties. * * @var array */ - static $_defaultHierReturnProperties; + public static $_defaultHierReturnProperties; /** * The set of input params. @@ -292,6 +292,7 @@ class CRM_Contact_BAO_Query { /** * Should we just display one contact record + * @var bool */ public $_useGroupBy = FALSE; @@ -300,14 +301,14 @@ class CRM_Contact_BAO_Query { * * @var array */ - static $_relType; + public static $_relType; /** * The activity role * * @var array */ - static $_activityRole; + public static $_activityRole; /** * Consider the component activity type @@ -315,7 +316,7 @@ class CRM_Contact_BAO_Query { * * @var array */ - static $_considerCompActivities; + public static $_considerCompActivities; /** * Consider with contact activities only, @@ -323,7 +324,7 @@ class CRM_Contact_BAO_Query { * * @var array */ - static $_withContactActivitiesOnly; + public static $_withContactActivitiesOnly; /** * Use distinct component clause for component searches @@ -359,7 +360,7 @@ class CRM_Contact_BAO_Query { * * @var array */ - static $_dependencies = [ + public static $_dependencies = [ 'civicrm_state_province' => 1, 'civicrm_country' => 1, 'civicrm_county' => 1, @@ -369,8 +370,9 @@ class CRM_Contact_BAO_Query { /** * List of location specific fields. + * @var array */ - static $_locationSpecificFields = [ + public static $_locationSpecificFields = [ 'street_address', 'street_number', 'street_name', @@ -396,6 +398,7 @@ class CRM_Contact_BAO_Query { /** * Remember if we handle either end of a number or date range * so we can skip the other + * @var array */ protected $_rangeCache = []; /** @@ -408,7 +411,7 @@ class CRM_Contact_BAO_Query { * Set to the name of the temp table if one has been created * @var String */ - static $_relationshipTempTable = NULL; + public static $_relationshipTempTable = NULL; public $_pseudoConstantsSelect = []; @@ -2049,7 +2052,7 @@ class CRM_Contact_BAO_Query { $this->_qill[0][] = ts("%1 %2 %3", [ 1 => $field['title'], 2 => $qillop, - 3 => $qillVal + 3 => $qillVal, ]); } else { @@ -2326,7 +2329,8 @@ class CRM_Contact_BAO_Query { $this->_qill[$grouping][] = ts("%1 %2 %3", [ 1 => $field['title'], 2 => $qillop, - 3 => (strpos($op, 'NULL') !== FALSE || strpos($op, 'EMPTY') !== FALSE) ? $qillVal : "'$qillVal'"]); + 3 => (strpos($op, 'NULL') !== FALSE || strpos($op, 'EMPTY') !== FALSE) ? $qillVal : "'$qillVal'", + ]); if (is_array($value)) { // traditionally an array being passed has been a fatal error. We can take advantage of this to add support @@ -2573,9 +2577,7 @@ class CRM_Contact_BAO_Query { } if ((!empty($tables['civicrm_state_province']) || !empty($tables['civicrm_country']) || - CRM_Utils_Array::value('civicrm_county', $tables) - ) && empty($tables['civicrm_address']) - ) { + CRM_Utils_Array::value('civicrm_county', $tables)) && empty($tables['civicrm_address'])) { $tables = array_merge(['civicrm_address' => 1], $tables ); @@ -2584,9 +2586,9 @@ class CRM_Contact_BAO_Query { // add group_contact and group table is subscription history is present if (!empty($tables['civicrm_subscription_history']) && empty($tables['civicrm_group'])) { $tables = array_merge([ - 'civicrm_group' => 1, - 'civicrm_group_contact' => 1, - ], + 'civicrm_group' => 1, + 'civicrm_group_contact' => 1, + ], $tables ); } @@ -4816,7 +4818,8 @@ civicrm_relationship.start_date > {$today} public static function getGroupByFromOrderBy(&$groupBy, $orderBys) { if (!CRM_Utils_SQL::disableFullGroupByMode()) { foreach ($orderBys as $orderBy) { - $orderBy = str_ireplace([' DESC', ' ASC', '`'], '', $orderBy); // remove sort syntax from ORDER BY clauses if present + // remove sort syntax from ORDER BY clauses if present + $orderBy = str_ireplace([' DESC', ' ASC', '`'], '', $orderBy); // if ORDER BY column is not present in GROUP BY then append it to end if (preg_match('/(MAX|MIN)\(/i', trim($orderBy)) !== 1 && !strstr($groupBy, $orderBy)) { $groupBy .= ", {$orderBy}"; @@ -5417,7 +5420,6 @@ civicrm_relationship.start_date > {$today} } } - /** * @param $values * @param string $tableName @@ -5435,7 +5437,8 @@ civicrm_relationship.start_date > {$today} list($name, $op, $value, $grouping, $wildcard) = $values; $asofDateValues = $this->getWhereValues("{$fieldName}_asof_date", $grouping); - $asofDate = NULL; // will be treated as current day + // will be treated as current day + $asofDate = NULL; if ($asofDateValues) { $asofDate = CRM_Utils_Date::processDate($asofDateValues[2]); $asofDateFormat = CRM_Utils_Date::customFormat(substr($asofDate, 0, 8)); @@ -5768,8 +5771,7 @@ AND displayRelType.is_active = 1 * @return bool */ public static function caseImportant($op) { - return - in_array($op, ['LIKE', 'IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY']) ? FALSE : TRUE; + return in_array($op, ['LIKE', 'IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY']) ? FALSE : TRUE; } /** @@ -5883,7 +5885,7 @@ AND displayRelType.is_active = 1 public static function parseSearchBuilderString($string, $dataType = 'Integer') { $string = trim($string); if (substr($string, 0, 1) != '(' || substr($string, -1, 1) != ')') { - Return FALSE; + return FALSE; } $string = substr($string, 1, -1); @@ -6022,11 +6024,11 @@ AND displayRelType.is_active = 1 } if (!$usedForAPI) { foreach ([ - 'gender_id' => 'gender', - 'prefix_id' => 'individual_prefix', - 'suffix_id' => 'individual_suffix', - 'communication_style_id' => 'communication_style', - ] as $realField => $labelField) { + 'gender_id' => 'gender', + 'prefix_id' => 'individual_prefix', + 'suffix_id' => 'individual_suffix', + 'communication_style_id' => 'communication_style', + ] as $realField => $labelField) { // This is a temporary routine for handling these fields while // we figure out how to handled them based on metadata in /// export and search builder. CRM-19815, CRM-19830. @@ -6703,7 +6705,7 @@ AND displayRelType.is_active = 1 '=', '1', '0', - '0' + '0', ], $this->_params); // if we’re explicitly looking for a certain contact’s contribs, events, etc. @@ -6926,25 +6928,25 @@ AND displayRelType.is_active = 1 $this->_where[$grouping][] = $fieldSpec['where'] . " <= '{$dates[1]}'"; $this->_qill[$grouping][] = ts('%1 is ', [$fieldSpec['title']]) . $filters[$value] . ' (' . ts("to %1", [ - CRM_Utils_Date::customFormat($dates[1]), - ]) . ')'; + CRM_Utils_Date::customFormat($dates[1]), + ]) . ')'; } elseif (empty($dates[1])) { // ie. no end date we only have start date $this->_where[$grouping][] = $fieldSpec['where'] . " >= '{$dates[1]}'"; $this->_qill[$grouping][] = ts('%1 is ', [$fieldSpec['title']]) . $filters[$value] . ' (' . ts("from %1", [ - CRM_Utils_Date::customFormat($dates[0]), - ]) . ')'; + CRM_Utils_Date::customFormat($dates[0]), + ]) . ')'; } else { // we have start and end dates. $this->_where[$grouping][] = $fieldSpec['where'] . " BETWEEN '{$dates[0]}' AND '{$dates[1]}'"; $this->_qill[$grouping][] = ts('%1 is ', [$fieldSpec['title']]) . $filters[$value] . ' (' . ts("between %1 and %2", [ - CRM_Utils_Date::customFormat($dates[0]), - CRM_Utils_Date::customFormat($dates[1]), - ]) . ')'; + CRM_Utils_Date::customFormat($dates[0]), + CRM_Utils_Date::customFormat($dates[1]), + ]) . ')'; } } @@ -6968,7 +6970,7 @@ AND displayRelType.is_active = 1 return [ $aName, - $addressJoin + $addressJoin, ]; } diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 8f2157f474..d5c76f345e 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -485,7 +485,6 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { ); } - /** * Check if there is data to create the object. * @@ -1465,7 +1464,7 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) * @return array * array reference of all relationship types with context to current contact type . */ - static public function getRelationType($targetContactType) { + public static function getRelationType($targetContactType) { $relationshipType = array(); $allRelationshipType = CRM_Core_PseudoConstant::relationshipType(); @@ -2038,7 +2037,6 @@ AND cc.sort_name LIKE '%$name%'"; } } - /** * Wrapper for contact relationship selector. * diff --git a/CRM/Contact/BAO/SubscriptionHistory.php b/CRM/Contact/BAO/SubscriptionHistory.php index 34064dddf4..ec1a44d189 100644 --- a/CRM/Contact/BAO/SubscriptionHistory.php +++ b/CRM/Contact/BAO/SubscriptionHistory.php @@ -35,6 +35,7 @@ * BAO object for crm_email table. */ class CRM_Contact_BAO_SubscriptionHistory extends CRM_Contact_DAO_SubscriptionHistory { + /** * Class constructor. */ diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 5f3ce8babc..f275cfa377 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -110,11 +110,13 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { /** * Do we want to parse street address. + * @var bool */ public $_parseStreetAddress; /** * Check contact has a subtype or not. + * @var bool */ public $_isContactSubType; @@ -122,6 +124,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * Lets keep a cache of all the values that we retrieved. * THis is an attempt to avoid the number of update statements * during the write phase + * @var array */ public $_preEditValues; @@ -586,6 +589,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * List of errors to be posted back to the form. * @param int $contactId * Contact id if doing update. + * @param string $contactType * * @return bool * email/openId @@ -1161,20 +1165,20 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $duplicateContactsLinks = '
'; $duplicateContactsLinks .= ts('One matching contact was found. ', [ - 'count' => count($contactLinks['rows']), - 'plural' => '%count matching contacts were found.
', - ]); + 'count' => count($contactLinks['rows']), + 'plural' => '%count matching contacts were found.
', + ]); if ($contactLinks['msg'] == 'view') { $duplicateContactsLinks .= ts('You can View the existing contact', [ - 'count' => count($contactLinks['rows']), - 'plural' => 'You can View the existing contacts', - ]); + 'count' => count($contactLinks['rows']), + 'plural' => 'You can View the existing contacts', + ]); } else { $duplicateContactsLinks .= ts('You can View or Edit the existing contact', [ - 'count' => count($contactLinks['rows']), - 'plural' => 'You can View or Edit the existing contacts', - ]); + 'count' => count($contactLinks['rows']), + 'plural' => 'You can View or Edit the existing contacts', + ]); } if ($contactLinks['msg'] == 'merge') { // We should also get a merge link if this is for an existing contact @@ -1256,10 +1260,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $buildStreetAddress = FALSE; $parseFieldName = 'street_address'; foreach ([ - 'street_number', - 'street_name', - 'street_unit', - ] as $fld) { + 'street_number', + 'street_name', + 'street_unit', + ] as $fld) { if (!empty($address[$fld])) { $parseFieldName = 'street_number'; $buildStreetAddress = TRUE; @@ -1288,11 +1292,11 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $streetAddress = NULL; foreach ([ - 'street_number', - 'street_number_suffix', - 'street_name', - 'street_unit', - ] as $fld) { + 'street_number', + 'street_number_suffix', + 'street_name', + 'street_unit', + ] as $fld) { if (in_array($fld, [ 'street_name', 'street_unit', diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php index dadbeb75e7..ddd06219bb 100644 --- a/CRM/Contact/Form/CustomData.php +++ b/CRM/Contact/Form/CustomData.php @@ -92,7 +92,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { /** * Custom group id * - * @int + * @var int */ public $_groupID; @@ -178,22 +178,21 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { $this->assign('multiRecordDisplay', $this->_multiRecordDisplay); $saveButtonName = $this->_copyValueId ? ts('Save a Copy') : ts('Save'); $this->addButtons([ - [ - 'type' => 'upload', - 'name' => $saveButtonName, - 'isDefault' => TRUE, - ], - [ - 'type' => 'upload', - 'name' => ts('Save and New'), - 'subName' => 'new', - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'upload', + 'name' => $saveButtonName, + 'isDefault' => TRUE, + ], + [ + 'type' => 'upload', + 'name' => ts('Save and New'), + 'subName' => 'new', + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } } return CRM_Custom_Form_CustomData::buildQuickForm($this); @@ -206,17 +205,16 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { // make this form an upload since we dont know if the custom data injected dynamically // is of type file etc $this->addButtons([ - [ - 'type' => 'upload', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'upload', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Contact/Form/DedupeFind.php b/CRM/Contact/Form/DedupeFind.php index 69e62a70c6..7f9ebaec24 100644 --- a/CRM/Contact/Form/DedupeFind.php +++ b/CRM/Contact/Form/DedupeFind.php @@ -38,6 +38,7 @@ class CRM_Contact_Form_DedupeFind extends CRM_Admin_Form { /** * Indicate if this form should warn users of unsaved changes + * @var bool */ protected $unsavedChangesWarn = FALSE; @@ -60,20 +61,19 @@ class CRM_Contact_Form_DedupeFind extends CRM_Admin_Form { $this->add('text', 'limit', ts('No of contacts to find matches for ')); } $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Continue'), - 'isDefault' => TRUE, - ], - //hack to support cancel button functionality - [ - 'type' => 'submit', - 'class' => 'cancel', - 'icon' => 'fa-times', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Continue'), + 'isDefault' => TRUE, + ], + //hack to support cancel button functionality + [ + 'type' => 'submit', + 'class' => 'cancel', + 'icon' => 'fa-times', + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 4a8294f44e..82bd6ef93f 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -186,6 +186,7 @@ class CRM_Contact_Form_DedupeRules extends CRM_Admin_Form { * * @return array */ + /** * @return array */ @@ -289,14 +290,13 @@ UPDATE civicrm_dedupe_rule_group if ($dao->fetch()) { // set the length to null for all the fields where prefix length is not supported. eg. int,tinyint,date,enum etc dataTypes. if ($dao->COLUMN_NAME == $field && !in_array($dao->DATA_TYPE, [ - 'char', - 'varchar', - 'binary', - 'varbinary', - 'text', - 'blob', - ]) - ) { + 'char', + 'varchar', + 'binary', + 'varbinary', + 'text', + 'blob', + ])) { $length = NULL; } elseif ($dao->COLUMN_NAME == $field && !empty($dao->CHARACTER_MAXIMUM_LENGTH) && ($length > $dao->CHARACTER_MAXIMUM_LENGTH)) { diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index 2420f8bdda..8cc795e56a 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -73,7 +73,8 @@ class CRM_Contact_Form_Edit_Address { "address[$blockId][is_primary]", [ 'entity' => 'address', 'label' => ts('Primary location for this contact'), - 'text' => ts('Primary location for this contact')] + $js); + 'text' => ts('Primary location for this contact'), + ] + $js); if (!$inlineEdit) { $js = ['id' => 'Address_' . $blockId . '_IsBilling', 'onClick' => 'singleSelect( this.id );']; @@ -83,7 +84,8 @@ class CRM_Contact_Form_Edit_Address { "address[$blockId][is_billing]", [ 'entity' => 'address', 'label' => ts('Billing location for this contact'), - 'text' => ts('Billing location for this contact')] + $js); + 'text' => ts('Billing location for this contact'), + ] + $js); // hidden element to store master address id $form->addField("address[$blockId][master_id]", ['entity' => 'address', 'type' => 'hidden']); @@ -118,11 +120,10 @@ class CRM_Contact_Form_Edit_Address { $continue = TRUE; //Don't skip street parsed fields when parsing is enabled. if (in_array($nameWithoutID, [ - 'street_number', - 'street_name', - 'street_unit', - ]) && !empty($addressOptions['street_address_parsing']) - ) { + 'street_number', + 'street_name', + 'street_unit', + ]) && !empty($addressOptions['street_address_parsing'])) { $continue = FALSE; } if ($continue) { @@ -259,9 +260,9 @@ class CRM_Contact_Form_Edit_Address { 'address' => $addressValue['display'], 'name' => $shareAddressContactNames[$addressValue['master_id']]['name'], 'options' => CRM_Core_BAO_Address::getValues([ - 'entity_id' => $master_cid, - 'contact_id' => $master_cid, - ]), + 'entity_id' => $master_cid, + 'contact_id' => $master_cid, + ]), 'master_id' => $addressValue['master_id'], ]; $defaults['address'][$key]['master_contact_id'] = $master_cid; @@ -285,11 +286,11 @@ class CRM_Contact_Form_Edit_Address { foreach ($defaults['address'] as $cnt => & $address) { $streetAddress = NULL; foreach ([ - 'street_number', - 'street_number_suffix', - 'street_name', - 'street_unit', - ] as $fld) { + 'street_number', + 'street_number_suffix', + 'street_name', + 'street_unit', + ] as $fld) { if (in_array($fld, [ 'street_name', 'street_unit', diff --git a/CRM/Contact/Form/Edit/CommunicationPreferences.php b/CRM/Contact/Form/Edit/CommunicationPreferences.php index dddb5d58d3..91d125fa1e 100644 --- a/CRM/Contact/Form/Edit/CommunicationPreferences.php +++ b/CRM/Contact/Form/Edit/CommunicationPreferences.php @@ -41,7 +41,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { * * @var array */ - static $greetings = []; + public static $greetings = []; /** * Build the form object elements for Communication Preferences object. diff --git a/CRM/Contact/Form/Edit/Phone.php b/CRM/Contact/Form/Edit/Phone.php index 0a881f3f95..79538fbaf9 100644 --- a/CRM/Contact/Form/Edit/Phone.php +++ b/CRM/Contact/Form/Edit/Phone.php @@ -70,10 +70,10 @@ class CRM_Contact_Form_Edit_Phone { //Block type select $form->addField("phone[$blockId][location_type_id]", [ 'entity' => 'phone', - 'class' => 'eight', - 'placeholder' => NULL, - 'option_url' => NULL, - ]); + 'class' => 'eight', + 'placeholder' => NULL, + 'option_url' => NULL, + ]); //is_Primary radio $js = ['id' => 'Phone_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );', 'aria-label' => ts('Phone %1 is primary?', [1 => $blockId])]; diff --git a/CRM/Contact/Form/GroupContact.php b/CRM/Contact/Form/GroupContact.php index 5221210918..da68e58b77 100644 --- a/CRM/Contact/Form/GroupContact.php +++ b/CRM/Contact/Form/GroupContact.php @@ -126,13 +126,12 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form { $this->addField('group_id', ['class' => 'crm-action-menu fa-plus', 'placeholder' => $msg, 'options' => $groupSelect]); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Add'), - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Add'), + 'isDefault' => TRUE, + ], + ]); } } diff --git a/CRM/Contact/Form/Inline.php b/CRM/Contact/Form/Inline.php index 541cf814c6..0a03b0475e 100644 --- a/CRM/Contact/Form/Inline.php +++ b/CRM/Contact/Form/Inline.php @@ -38,16 +38,19 @@ abstract class CRM_Contact_Form_Inline extends CRM_Core_Form { /** * Id of the contact that is being edited + * @var int */ public $_contactId; /** * Type of contact being edited + * @var string */ public $_contactType; /** * Sub type of contact being edited + * @var string */ public $_contactSubType; diff --git a/CRM/Contact/Form/Inline/Address.php b/CRM/Contact/Form/Inline/Address.php index 3bbd2d28a9..eda850c7d3 100644 --- a/CRM/Contact/Form/Inline/Address.php +++ b/CRM/Contact/Form/Inline/Address.php @@ -38,26 +38,31 @@ class CRM_Contact_Form_Inline_Address extends CRM_Contact_Form_Inline { /** * Location block no + * @var int */ private $_locBlockNo; /** * Do we want to parse street address. + * @var bool */ public $_parseStreetAddress; /** * Store address values + * @var array */ public $_values; /** * Form action + * @var string */ public $_action; /** * Address id + * @var int */ public $_addressId; diff --git a/CRM/Contact/Form/Inline/CustomData.php b/CRM/Contact/Form/Inline/CustomData.php index 62ae8adc16..046ff6e4cb 100644 --- a/CRM/Contact/Form/Inline/CustomData.php +++ b/CRM/Contact/Form/Inline/CustomData.php @@ -39,7 +39,7 @@ class CRM_Contact_Form_Inline_CustomData extends CRM_Contact_Form_Inline { /** * Custom group id. * - * @int + * @var int */ public $_groupID; diff --git a/CRM/Contact/Form/Inline/Email.php b/CRM/Contact/Form/Inline/Email.php index f7595e051c..322633df4e 100644 --- a/CRM/Contact/Form/Inline/Email.php +++ b/CRM/Contact/Form/Inline/Email.php @@ -38,11 +38,13 @@ class CRM_Contact_Form_Inline_Email extends CRM_Contact_Form_Inline { /** * Email addresses of the contact that is been viewed. + * @var array */ private $_emails = []; /** * No of email blocks for inline edit. + * @var int */ private $_blockCount = 6; diff --git a/CRM/Contact/Form/Inline/IM.php b/CRM/Contact/Form/Inline/IM.php index a44fbb3c45..89658d42bc 100644 --- a/CRM/Contact/Form/Inline/IM.php +++ b/CRM/Contact/Form/Inline/IM.php @@ -38,11 +38,13 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline { /** * Ims of the contact that is been viewed. + * @var array */ private $_ims = []; /** * No of im blocks for inline edit. + * @var int */ private $_blockCount = 6; diff --git a/CRM/Contact/Form/Inline/OpenID.php b/CRM/Contact/Form/Inline/OpenID.php index 55b9f1b227..399279fd98 100644 --- a/CRM/Contact/Form/Inline/OpenID.php +++ b/CRM/Contact/Form/Inline/OpenID.php @@ -38,11 +38,13 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline { /** * Ims of the contact that is been viewed. + * @var array */ private $_openids = []; /** * No of openid blocks for inline edit. + * @var int */ private $_blockCount = 6; diff --git a/CRM/Contact/Form/Inline/Phone.php b/CRM/Contact/Form/Inline/Phone.php index 1ee20388ab..8cd7b6f729 100644 --- a/CRM/Contact/Form/Inline/Phone.php +++ b/CRM/Contact/Form/Inline/Phone.php @@ -38,11 +38,13 @@ class CRM_Contact_Form_Inline_Phone extends CRM_Contact_Form_Inline { /** * Phones of the contact that is been viewed + * @var array */ private $_phones = []; /** * No of phone blocks for inline edit + * @var int */ private $_blockCount = 6; diff --git a/CRM/Contact/Form/Inline/Website.php b/CRM/Contact/Form/Inline/Website.php index 0491e745ce..a90ae37734 100644 --- a/CRM/Contact/Form/Inline/Website.php +++ b/CRM/Contact/Form/Inline/Website.php @@ -38,11 +38,13 @@ class CRM_Contact_Form_Inline_Website extends CRM_Contact_Form_Inline { /** * Websitess of the contact that is been viewed. + * @var array */ private $_websites = []; /** * No of website blocks for inline edit. + * @var int */ private $_blockCount = 6; diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index 6dc3475ef0..1434c173f6 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -36,13 +36,19 @@ */ class CRM_Contact_Form_Merge extends CRM_Core_Form { // The id of the contact that there's a duplicate for; this one will - // possibly inherit some of $_oid's properties and remain in the system. - var $_cid = NULL; + /** + * possibly inherit some of $_oid's properties and remain in the system. + * @var int + */ + public $_cid = NULL; - // The id of the other contact - the duplicate one that will get deleted. - var $_oid = NULL; + /** + * The id of the other contact - the duplicate one that will get deleted. + * @var int + */ + public $_oid = NULL; - var $_contactType = NULL; + public $_contactType = NULL; /** * @var array @@ -54,7 +60,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { * * @var int */ - var $limit; + public $limit; /** * String for quickform bug handling. @@ -66,7 +72,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { * * @var string */ - var $_qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9'; + public $_qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9'; public function preProcess() { try { @@ -137,9 +143,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { $this->prev = $this->next = NULL; foreach ([ - 'prev', - 'next', - ] as $position) { + 'prev', + 'next', + ] as $position) { if (!empty($pos[$position])) { if ($pos[$position]['id1'] && $pos[$position]['id2']) { $rowParams = array_merge($urlParams, [ diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index ad21672bee..2795870041 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -154,10 +154,10 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { $locType = CRM_Core_BAO_LocationType::getDefault(); foreach ([ - 'phone', - 'email', - 'address', - ] as $locFld) { + 'phone', + 'email', + 'address', + ] as $locFld) { if (!empty($this->_defaults[$locFld]) && $this->_defaults[$locFld][1]['location_type_id']) { $params[$locFld][1]['is_primary'] = $this->_defaults[$locFld][1]['is_primary']; $params[$locFld][1]['location_type_id'] = $this->_defaults[$locFld][1]['location_type_id']; diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 686a371c2b..1516238bbf 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -46,21 +46,25 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { /** * This is a string which is either a_b or b_a used to determine the relationship between to contacts + * @var string */ public $_rtype; /** * This is a string which is used to determine the relationship between to contacts + * @var string */ public $_rtypeId; /** * Display name of contact a + * @var string */ public $_display_name_a; /** * Display name of contact b + * @var string */ public $_display_name_b; @@ -95,11 +99,13 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { /** * The relationship values if Updating relationship + * @var array */ public $_values; /** * Case id if it called from case context + * @var int */ public $_caseId; @@ -277,17 +283,16 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { public function buildQuickForm() { if ($this->_action & CRM_Core_Action::DELETE) { $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Delete'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); return; } @@ -568,7 +573,6 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { return [$params, $relationshipIds]; } - /** * Prepares parameters to be used for create/update actions * diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 4671db0ec8..297b0f3fac 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -42,14 +42,14 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * * @var array */ - static $_validContext = NULL; + public static $_validContext = NULL; /** * List of values used when we want to display other objects. * * @var array */ - static $_modeValues = NULL; + public static $_modeValues = NULL; /** * The contextMenu. @@ -129,7 +129,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * * @var array */ - static $csv = ['contact_type', 'group', 'tag']; + public static $csv = ['contact_type', 'group', 'tag']; /** * @var string how to display the results. Should we display as @@ -153,8 +153,9 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { /** * Name of the selector to use. + * @var string */ - static $_selectorName = 'CRM_Contact_Selector'; + public static $_selectorName = 'CRM_Contact_Selector'; protected $_customSearchID = NULL; protected $_customSearchClass = NULL; @@ -638,17 +639,17 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { // FIXME: we should generalise in a way that components could inject url-filters // just like they build their own form elements foreach ([ - 'mailing_id', - 'mailing_delivery_status', - 'mailing_open_status', - 'mailing_click_status', - 'mailing_reply_status', - 'mailing_optout', - 'mailing_forward', - 'mailing_unsubscribe', - 'mailing_date_low', - 'mailing_date_high', - ] as $mailingFilter) { + 'mailing_id', + 'mailing_delivery_status', + 'mailing_open_status', + 'mailing_click_status', + 'mailing_reply_status', + 'mailing_optout', + 'mailing_forward', + 'mailing_unsubscribe', + 'mailing_date_low', + 'mailing_date_high', + ] as $mailingFilter) { $type = 'String'; if ($mailingFilter == 'mailing_id' && $filterVal = CRM_Utils_Request::retrieve('mailing_id', 'Positive', $this) diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index 6c40a36ed7..0656d737d6 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -168,6 +168,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { * * @return string */ + /** * @return string */ @@ -236,9 +237,9 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { // FIXME: so leaving this as a dependency for now if (array_key_exists('contribution_amount_low', $this->_formValues)) { foreach (array( - 'contribution_amount_low', - 'contribution_amount_high', - ) as $f) { + 'contribution_amount_low', + 'contribution_amount_high', + ) as $f) { $this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]); } } @@ -269,11 +270,11 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { !$this->_force ) { foreach (array( - 'case_type_id', - 'case_status_id', - 'case_deleted', - 'case_tags', - ) as $caseCriteria) { + 'case_type_id', + 'case_status_id', + 'case_deleted', + 'case_tags', + ) as $caseCriteria) { if (!empty($this->_formValues[$caseCriteria])) { $allCases = TRUE; $this->_formValues['case_owner'] = 1; diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index cdfc0c71ba..9a3386836d 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -41,7 +41,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * * @var array */ - static $csv = ['contact_type', 'group', 'tag']; + public static $csv = ['contact_type', 'group', 'tag']; /** * Build the form object. @@ -68,21 +68,21 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($this->_group, NULL, '  ', TRUE); if (!empty($searchOptions['groups'])) { $this->addField('group', [ - 'entity' => 'group_contact', - 'label' => ts('in'), - 'placeholder' => ts('- any group -'), - 'options' => $groupHierarchy, - ]); + 'entity' => 'group_contact', + 'label' => ts('in'), + 'placeholder' => ts('- any group -'), + 'options' => $groupHierarchy, + ]); } if (!empty($searchOptions['tags'])) { // tag criteria if (!empty($this->_tag)) { $this->addField('tag', [ - 'entity' => 'entity_tag', - 'label' => ts('with'), - 'placeholder' => ts('- any tag -'), - ]); + 'entity' => 'entity_tag', + 'label' => ts('with'), + 'placeholder' => ts('- any tag -'), + ]); } } @@ -197,6 +197,8 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * If Go is pressed then we must select some checkboxes and an action. * * @param array $fields + * @param array $files + * @param object $form * * @return array|bool */ @@ -232,6 +234,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * * @return string */ + /** * @return string */ diff --git a/CRM/Contact/Form/Search/Builder.php b/CRM/Contact/Form/Search/Builder.php index a1322ee1b8..2a73f11a25 100644 --- a/CRM/Contact/Form/Search/Builder.php +++ b/CRM/Contact/Form/Search/Builder.php @@ -161,13 +161,11 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { $v[2] = self::checkArrayKeyEmpty($v[2]); if (in_array($v[1], [ - 'IS NULL', - 'IS NOT NULL', - 'IS EMPTY', - 'IS NOT EMPTY', - ]) && - !empty($v[2]) - ) { + 'IS NULL', + 'IS NOT NULL', + 'IS EMPTY', + 'IS NOT EMPTY', + ]) && !empty($v[2])) { $errorMsg["value[$v[3]][$v[4]]"] = ts('Please clear your value if you want to use %1 operator.', [1 => $v[1]]); } elseif (substr($v[0], 0, 7) === 'do_not_' or substr($v[0], 0, 3) === 'is_') { @@ -479,9 +477,9 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { } } elseif (in_array(substr($field, 0, 3), [ - 'is_', - 'do_', - ]) || CRM_Utils_Array::value('data_type', $info) == 'Boolean' + 'is_', + 'do_', + ]) || CRM_Utils_Array::value('data_type', $info) == 'Boolean' ) { $options[$field] = 'yesno'; if ($entity != 'contact') { diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 10e61cb3a8..a22d9a95ec 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -31,6 +31,7 @@ * @copyright CiviCRM LLC (c) 2004-2019 */ class CRM_Contact_Form_Search_Criteria { + /** * @param CRM_Core_Form $form */ @@ -283,7 +284,7 @@ class CRM_Contact_Form_Search_Criteria { 'all_tag_types' => [ 'name' => 'all_tag_types', 'class' => 'search-field__span-3 search-field__checkbox', - 'help' => ['id' => 'id-all-tag-types'] + 'help' => ['id' => 'id-all-tag-types'], ], 'phone_numeric' => [ 'name' => 'phone_numeric', @@ -321,7 +322,6 @@ class CRM_Contact_Form_Search_Criteria { ]); } - /** * @param CRM_Core_Form $form */ diff --git a/CRM/Contact/Form/Search/Custom.php b/CRM/Contact/Form/Search/Custom.php index 3cb4ca2bd4..fad711ba90 100644 --- a/CRM/Contact/Form/Search/Custom.php +++ b/CRM/Contact/Form/Search/Custom.php @@ -136,6 +136,7 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { * * @return string */ + /** * @return string */ diff --git a/CRM/Contact/Form/Search/Custom/Basic.php b/CRM/Contact/Form/Search/Custom/Basic.php index 9968ce95c8..63a55860c0 100644 --- a/CRM/Contact/Form/Search/Custom/Basic.php +++ b/CRM/Contact/Form/Search/Custom/Basic.php @@ -66,13 +66,12 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo foreach ($this->_columns as $name => $field) { if (in_array($field, [ - 'street_address', - 'city', - 'state_province', - 'postal_code', - 'country', - ]) && empty($addressOptions[$field]) - ) { + 'street_address', + 'city', + 'state_province', + 'postal_code', + 'country', + ]) && empty($addressOptions[$field])) { unset($this->_columns[$name]); continue; } diff --git a/CRM/Contact/Form/Search/Custom/DateAdded.php b/CRM/Contact/Form/Search/Custom/DateAdded.php index 14916ac877..27c9546412 100644 --- a/CRM/Contact/Form/Search/Custom/DateAdded.php +++ b/CRM/Contact/Form/Search/Custom/DateAdded.php @@ -35,7 +35,9 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C protected $_aclFrom = NULL; protected $_aclWhere = NULL; - protected $_datesTable = NULL, $_xgTable = NULL, $_igTable = NULL; + protected $_datesTable = NULL; + protected $_xgTable = NULL; + protected $_igTable = NULL; /** * Class constructor. diff --git a/CRM/Contact/Form/Search/Custom/EventAggregate.php b/CRM/Contact/Form/Search/Custom/EventAggregate.php index 004e080c28..441688dab6 100644 --- a/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php @@ -93,13 +93,13 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea * for the search form. */ $form->assign('elements', [ - 'paid_online', - 'start_date', - 'end_date', - 'show_payees', - 'event_type_id', - 'event_id', - ]); + 'paid_online', + 'start_date', + 'end_date', + 'show_payees', + 'event_type_id', + 'event_id', + ]); } /** @@ -276,8 +276,8 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea return implode(' AND ', $clauses); } - /* This function does a query to get totals for some of the search result columns and returns a totals array. */ + /** * @return array */ diff --git a/CRM/Contact/Form/Search/Custom/FullText.php b/CRM/Contact/Form/Search/Custom/FullText.php index 43dad2e26e..e8868722cb 100644 --- a/CRM/Contact/Form/Search/Custom/FullText.php +++ b/CRM/Contact/Form/Search/Custom/FullText.php @@ -69,7 +69,11 @@ class CRM_Contact_Form_Search_Custom_FullText extends CRM_Contact_Form_Search_Cu protected $_limitDetailClause = NULL; protected $_limitNumber = 10; - protected $_limitNumberPlus1 = 11; // this should be one more than self::LIMIT + /** + * this should be one more than self::LIMIT + * @var int + */ + protected $_limitNumberPlus1 = 11; protected $_foundRows = []; @@ -196,7 +200,8 @@ class CRM_Contact_Form_Search_Custom_FullText extends CRM_Contact_Form_Search_Cu 'membership_status' => 'varchar(255)', // We may have multiple files to list on one record. // The temporary-table approach can't store full details for all of them - 'file_ids' => 'varchar(255)', // comma-separate id listing + // comma-separate id listing + 'file_ids' => 'varchar(255)', ]; $sql = " diff --git a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php index 2e3c9ade0c..fc4dc667fc 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php +++ b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php @@ -93,7 +93,7 @@ abstract class CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery { * keys: match-descriptor * - count: int */ - public abstract function fillTempTable($queryText, $entityIDTableName, $detailTable, $queryLimit, $detailLimit); + abstract public function fillTempTable($queryText, $entityIDTableName, $detailTable, $queryLimit, $detailLimit); /** * @return bool @@ -177,7 +177,7 @@ $sqlStatement $query = $tableValues + [ 'text' => CRM_Utils_QueryFormatter::singleton() - ->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR), + ->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR), ]; list($intLimit, $intOffset) = $this->parseLimitOffset($limit); $files = $searcher->search($query, $intLimit, $intOffset); @@ -191,8 +191,10 @@ $sqlStatement } } else { - $fullTextFields = []; // array (string $sqlColumnName) - $clauses = []; // array (string $sqlExpression) + // array (string $sqlColumnName) + $fullTextFields = []; + // array (string $sqlExpression) + $clauses = []; foreach ($tableValues['fields'] as $fieldName => $fieldType) { if ($fieldType == 'Int') { diff --git a/CRM/Contact/Form/Search/Custom/FullText/Contribution.php b/CRM/Contact/Form/Search/Custom/FullText/Contribution.php index 758dcedfc3..293b728a61 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Contribution.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Contribution.php @@ -89,7 +89,8 @@ WHERE ({$this->matchText('civicrm_contact c', ['sort_name', 'display_name', 'amount_level' => NULL, 'trxn_Id' => NULL, 'invoice_id' => NULL, - 'check_number' => 'Int', // Odd: This is really a VARCHAR, so why are we searching like an INT? + // Odd: This is really a VARCHAR, so why are we searching like an INT? + 'check_number' => 'Int', 'total_amount' => 'Int', ], ], diff --git a/CRM/Contact/Form/Search/Custom/PostalMailing.php b/CRM/Contact/Form/Search/Custom/PostalMailing.php index 865740f7de..fc6998dbe7 100644 --- a/CRM/Contact/Form/Search/Custom/PostalMailing.php +++ b/CRM/Contact/Form/Search/Custom/PostalMailing.php @@ -33,6 +33,7 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface { protected $_aclFrom = NULL; protected $_aclWhere = NULL; + /** * Class constructor. * diff --git a/CRM/Contact/Form/Search/Custom/Proximity.php b/CRM/Contact/Form/Search/Custom/Proximity.php index 4d382d46fa..dc517d92c8 100644 --- a/CRM/Contact/Form/Search/Custom/Proximity.php +++ b/CRM/Contact/Form/Search/Custom/Proximity.php @@ -248,6 +248,7 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C //unused return ''; } + /** * @param bool $includeContactIDs * diff --git a/CRM/Contact/Form/Search/Custom/RandomSegment.php b/CRM/Contact/Form/Search/Custom/RandomSegment.php index 57e45eb016..36addc77c6 100644 --- a/CRM/Contact/Form/Search/Custom/RandomSegment.php +++ b/CRM/Contact/Form/Search/Custom/RandomSegment.php @@ -372,6 +372,7 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear /** * @return mixed */ + /** * @return mixed */ diff --git a/CRM/Contact/Form/Search/Custom/Sample.php b/CRM/Contact/Form/Search/Custom/Sample.php index 197985fd94..a148f5ca3d 100644 --- a/CRM/Contact/Form/Search/Custom/Sample.php +++ b/CRM/Contact/Form/Search/Custom/Sample.php @@ -33,6 +33,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface { protected $_aclFrom = NULL; protected $_aclWhere = NULL; + /** * Class constructor. * diff --git a/CRM/Contact/Form/Search/Custom/TagContributions.php b/CRM/Contact/Form/Search/Custom/TagContributions.php index 123de6f387..df0e60488f 100644 --- a/CRM/Contact/Form/Search/Custom/TagContributions.php +++ b/CRM/Contact/Form/Search/Custom/TagContributions.php @@ -169,6 +169,7 @@ WHERE $where * WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values * */ + /** * @param bool $includeContactIDs * @@ -218,7 +219,6 @@ WHERE $where return implode(' AND ', $clauses); } - /* * Functions below generally don't need to be modified */ diff --git a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php index 0ffa0ee4f0..3b341bcb28 100644 --- a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php +++ b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php @@ -33,6 +33,7 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface { protected $_aclFrom = NULL; protected $_aclWhere = NULL; + /** * Class constructor. * diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 76a875ee38..9448c3b59c 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -80,6 +80,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form_Task { /** * This includes the submitted values of the search form + * @var array */ static protected $_searchFormValues; @@ -332,7 +333,6 @@ class CRM_Contact_Form_Task extends CRM_Core_Form_Task { return $contactIds; } - /** * Set default values for the form. Relationship that in edit/view action. * @@ -378,18 +378,17 @@ class CRM_Contact_Form_Task extends CRM_Core_Form_Task { */ public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons([ - [ - 'type' => $nextType, - 'name' => $title, - 'isDefault' => TRUE, - ], - [ - 'type' => $backType, - 'name' => ts('Cancel'), - 'icon' => 'fa-times', - ], - ] - ); + [ + 'type' => $nextType, + 'name' => $title, + 'isDefault' => TRUE, + ], + [ + 'type' => $backType, + 'name' => ts('Cancel'), + 'icon' => 'fa-times', + ], + ]); } /** @@ -507,7 +506,8 @@ class CRM_Contact_Form_Task extends CRM_Core_Form_Task { $searchParams = $this->controller->exportValues(); if ($searchParams['radio_ts'] == 'ts_sel') { // Create a static group. - $randID = md5(time() . rand(1, 1000)); // groups require a unique name + // groups require a unique name + $randID = md5(time() . rand(1, 1000)); $grpTitle = "Hidden Group {$randID}"; $grpID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $grpTitle, 'id', 'title'); diff --git a/CRM/Contact/Form/Task/AddToGroup.php b/CRM/Contact/Form/Task/AddToGroup.php index c14badd652..2958f6e98e 100644 --- a/CRM/Contact/Form/Task/AddToGroup.php +++ b/CRM/Contact/Form/Task/AddToGroup.php @@ -221,22 +221,22 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task { $status = [ ts('%count contact added to group', [ - 'count' => $added, - 'plural' => '%count contacts added to group', + 'count' => $added, + 'plural' => '%count contacts added to group', ]), ]; if ($notAdded) { $status[] = ts('%count contact was already in group', [ - 'count' => $notAdded, - 'plural' => '%count contacts were already in group', - ]); + 'count' => $notAdded, + 'plural' => '%count contacts were already in group', + ]); } $status = ''; CRM_Core_Session::setStatus($status, ts('Added Contact to %1', [ - 1 => $groupName, - 'count' => $added, - 'plural' => 'Added Contacts to %1', - ]), 'success', ['expires' => 0]); + 1 => $groupName, + 'count' => $added, + 'plural' => 'Added Contacts to %1', + ]), 'success', ['expires' => 0]); if ($this->_context === 'amtg') { CRM_Core_Session::singleton() diff --git a/CRM/Contact/Form/Task/AddToParentClass.php b/CRM/Contact/Form/Task/AddToParentClass.php index 729b86838f..3a1231f5b3 100644 --- a/CRM/Contact/Form/Task/AddToParentClass.php +++ b/CRM/Contact/Form/Task/AddToParentClass.php @@ -84,18 +84,18 @@ class CRM_Contact_Form_Task_AddToParentClass extends CRM_Contact_Form_Task { $this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), ['class' => 'crm-form-submit']); $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), ['class' => 'crm-form-submit']); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Add to %1', [1 => $contactType]), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Add to %1', [1 => $contactType]), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } + /** * Add relationships from form. */ diff --git a/CRM/Contact/Form/Task/AddToTag.php b/CRM/Contact/Form/Task/AddToTag.php index c296641ac6..db80cfc119 100644 --- a/CRM/Contact/Form/Task/AddToTag.php +++ b/CRM/Contact/Form/Task/AddToTag.php @@ -142,9 +142,9 @@ class CRM_Contact_Form_Task_AddToTag extends CRM_Contact_Form_Task { $status = [ts('%count contact tagged', ['count' => $added, 'plural' => '%count contacts tagged'])]; if ($notAdded) { $status[] = ts('%count contact already had this tag', [ - 'count' => $notAdded, - 'plural' => '%count contacts already had this tag', - ]); + 'count' => $notAdded, + 'plural' => '%count contacts already had this tag', + ]); } $status = ''; CRM_Core_Session::setStatus($status, ts("Added Tag %1", [1 => $this->_tags[$key]]), 'success', ['expires' => 0]); diff --git a/CRM/Contact/Form/Task/Batch.php b/CRM/Contact/Form/Task/Batch.php index cea1787a06..d0bc8ac477 100644 --- a/CRM/Contact/Form/Task/Batch.php +++ b/CRM/Contact/Form/Task/Batch.php @@ -45,21 +45,25 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task { /** * Maximum contacts that should be allowed to update. + * @var int */ protected $_maxContacts = 100; /** * Maximum profile fields that will be displayed. + * @var int */ protected $_maxFields = 9; /** * Variable to store redirect path. + * @var string */ protected $_userContext; /** * When not to reset sort_name. + * @var bool */ protected $_preserveDefault = TRUE; @@ -102,17 +106,16 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task { //$this->_fields = array_slice($this->_fields, 0, $this->_maxFields); $this->addButtons([ - [ - 'type' => 'submit', - 'name' => ts('Update Contact(s)'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'submit', + 'name' => ts('Update Contact(s)'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); $this->assign('profileTitle', $this->_title); $this->assign('componentIds', $this->_contactIds); @@ -249,9 +252,9 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task { CRM_Core_Session::setStatus('', ts("Updates Saved"), 'success'); if ($inValidSubtypeCnt) { CRM_Core_Session::setStatus(ts('Contact Subtype field of 1 contact has not been updated.', [ - 'plural' => 'Contact Subtype field of %count contacts has not been updated.', - 'count' => $inValidSubtypeCnt, - ]), ts('Invalid Subtype')); + 'plural' => 'Contact Subtype field of %count contacts has not been updated.', + 'count' => $inValidSubtypeCnt, + ]), ts('Invalid Subtype')); } } diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php index 1c0b5c71e5..3411f67d05 100644 --- a/CRM/Contact/Form/Task/Delete.php +++ b/CRM/Contact/Form/Task/Delete.php @@ -48,6 +48,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task { /** * Cache shared address message so we don't query twice + * @var string */ protected $_sharedAddressMessage = NULL; @@ -123,16 +124,16 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task { if (count($this->_contactIds) > 1) { // more than one contact deleted $message = ts('One of the selected contacts has an address record that is shared with 1 other contact.', [ - 'plural' => 'One or more selected contacts have address records which are shared with %count other contacts.', - 'count' => $sharedAddressCount, - ]); + 'plural' => 'One or more selected contacts have address records which are shared with %count other contacts.', + 'count' => $sharedAddressCount, + ]); } else { // only one contact deleted $message = ts('This contact has an address record which is shared with 1 other contact.', [ - 'plural' => 'This contact has an address record which is shared with %count other contacts.', - 'count' => $sharedAddressCount, - ]); + 'plural' => 'This contact has an address record which is shared with %count other contacts.', + 'count' => $sharedAddressCount, + ]); } CRM_Core_Session::setStatus($message . ' ' . ts('Shared addresses will not be removed or altered but will no longer be shared.'), ts('Shared Addesses Owner')); } @@ -246,24 +247,24 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task { if ($this->_restore) { $title = ts('Restored'); $status = ts('%1 has been restored from the trash.', [ - 1 => $name, - 'plural' => '%count contacts restored from trash.', - 'count' => $deleted, - ]); + 1 => $name, + 'plural' => '%count contacts restored from trash.', + 'count' => $deleted, + ]); } elseif ($this->_skipUndelete) { $status = ts('%1 has been permanently deleted.', [ - 1 => $name, - 'plural' => '%count contacts permanently deleted.', - 'count' => $deleted, - ]); + 1 => $name, + 'plural' => '%count contacts permanently deleted.', + 'count' => $deleted, + ]); } else { $status = ts('%1 has been moved to the trash.', [ - 1 => $name, - 'plural' => '%count contacts moved to trash.', - 'count' => $deleted, - ]); + 1 => $name, + 'plural' => '%count contacts moved to trash.', + 'count' => $deleted, + ]); } $session->setStatus($status, $title, 'success'); } diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 60d7f653c5..5006f9d532 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -526,9 +526,9 @@ class CRM_Contact_Form_Task_EmailCommon { $count_success = count($form->_toContactDetails); CRM_Core_Session::setStatus(ts('One message was sent successfully. ', array( - 'plural' => '%count messages were sent successfully. ', - 'count' => $count_success, - )) . $followupStatus, ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $count_success)), 'success'); + 'plural' => '%count messages were sent successfully. ', + 'count' => $count_success, + )) . $followupStatus, ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $count_success)), 'success'); } // Display the name and number of contacts for those email is not sent. @@ -547,9 +547,9 @@ class CRM_Contact_Form_Task_EmailCommon { } $status = '(' . ts('because no email address on file or communication preferences specify DO NOT EMAIL or Contact is deceased or Primary email address is On Hold') . ')'; CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array( - 'count' => count($emailsNotSent), - 'plural' => '%count Messages Not Sent', - )), 'info'); + 'count' => count($emailsNotSent), + 'plural' => '%count Messages Not Sent', + )), 'info'); } if (isset($form->_caseId)) { diff --git a/CRM/Contact/Form/Task/LabelCommon.php b/CRM/Contact/Form/Task/LabelCommon.php index d9cb705283..74bdc83cb1 100644 --- a/CRM/Contact/Form/Task/LabelCommon.php +++ b/CRM/Contact/Form/Task/LabelCommon.php @@ -64,7 +64,6 @@ class CRM_Contact_Form_Task_LabelCommon { $pdf->Output($fileName, 'D'); } - /** * Get the rows for the labels. * diff --git a/CRM/Contact/Form/Task/Map.php b/CRM/Contact/Form/Task/Map.php index f22d59d122..82e1af323e 100644 --- a/CRM/Contact/Form/Task/Map.php +++ b/CRM/Contact/Form/Task/Map.php @@ -114,13 +114,12 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task { */ public function buildQuickForm() { $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'done', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ], + ]); } /** diff --git a/CRM/Contact/Form/Task/PickProfile.php b/CRM/Contact/Form/Task/PickProfile.php index 875d3ae1d4..a3a061b8dd 100644 --- a/CRM/Contact/Form/Task/PickProfile.php +++ b/CRM/Contact/Form/Task/PickProfile.php @@ -45,16 +45,19 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task { /** * Maximum contacts that should be allowed to update + * @var int */ protected $_maxContacts = 100; /** * Maximum profile fields that will be displayed + * @var int */ protected $_maxFields = 9; /** * Variable to store redirect path + * @var string */ protected $_userContext; @@ -72,9 +75,9 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task { //validations if (count($this->_contactIds) > $this->_maxContacts) { CRM_Core_Session::setStatus(ts("The maximum number of contacts you can select for Update multiple contacts is %1. You have selected %2. Please select fewer contacts from your search results and try again.", [ - 1 => $this->_maxContacts, - 2 => count($this->_contactIds), - ]), ts('Maximum Exceeded'), 'error'); + 1 => $this->_maxContacts, + 2 => count($this->_contactIds), + ]), ts('Maximum Exceeded'), 'error'); $validate = TRUE; } diff --git a/CRM/Contact/Form/Task/Print.php b/CRM/Contact/Form/Task/Print.php index 8040df3e5d..911af3dd82 100644 --- a/CRM/Contact/Form/Task/Print.php +++ b/CRM/Contact/Form/Task/Print.php @@ -113,18 +113,17 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task { // just need to add a javacript to popup the window for printing // $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Print Contact List'), - 'js' => ['onclick' => 'window.print()'], - 'isDefault' => TRUE, - ], - [ - 'type' => 'back', - 'name' => ts('Done'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Print Contact List'), + 'js' => ['onclick' => 'window.print()'], + 'isDefault' => TRUE, + ], + [ + 'type' => 'back', + 'name' => ts('Done'), + ], + ]); } /** diff --git a/CRM/Contact/Form/Task/ProximityCommon.php b/CRM/Contact/Form/Task/ProximityCommon.php index 19d2bd37f0..6f632cb9de 100644 --- a/CRM/Contact/Form/Task/ProximityCommon.php +++ b/CRM/Contact/Form/Task/ProximityCommon.php @@ -63,7 +63,7 @@ class CRM_Contact_Form_Task_ProximityCommon { * @param CRM_Core_Form $form * @param int $proxSearch */ - static public function buildQuickForm($form, $proxSearch) { + public static function buildQuickForm($form, $proxSearch) { // is proximity search required (2) or optional (1)? $proxRequired = ($proxSearch == 2 ? TRUE : FALSE); $form->assign('proximity_search', TRUE); @@ -107,7 +107,7 @@ class CRM_Contact_Form_Task_ProximityCommon { if (empty($fields['prox_state_province_id']) || empty($fields['prox_country_id'])) { $errors["prox_state_province_id"] = ts("Country AND State/Province are required to search by distance."); } - if (!CRM_Utils_Array::value('prox_postal_code', $fields) AND + if (!CRM_Utils_Array::value('prox_postal_code', $fields) and !CRM_Utils_Array::value('prox_city', $fields) ) { $errors["prox_distance"] = ts("City OR Postal Code are required to search by distance."); @@ -125,7 +125,7 @@ class CRM_Contact_Form_Task_ProximityCommon { * @return array * the default array reference */ - static public function setDefaultValues($form) { + public static function setDefaultValues($form) { $defaults = []; $config = CRM_Core_Config::singleton(); $countryDefault = $config->defaultContactCountry; diff --git a/CRM/Contact/Form/Task/RemoveFromGroup.php b/CRM/Contact/Form/Task/RemoveFromGroup.php index 5df58cc48f..d803f436e7 100644 --- a/CRM/Contact/Form/Task/RemoveFromGroup.php +++ b/CRM/Contact/Form/Task/RemoveFromGroup.php @@ -84,15 +84,15 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task { ]; if ($notRemoved) { $status[] = ts('1 contact was already not in this group', [ - 'count' => $notRemoved, - 'plural' => '%count contacts were already not in this group', - ]); + 'count' => $notRemoved, + 'plural' => '%count contacts were already not in this group', + ]); } $status = ''; CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", [ - 'plural' => "Removed Contacts From Group", - 'count' => $removed, - ]), 'success', ['expires' => 0]); + 'plural' => "Removed Contacts From Group", + 'count' => $removed, + ]), 'success', ['expires' => 0]); } } diff --git a/CRM/Contact/Form/Task/RemoveFromTag.php b/CRM/Contact/Form/Task/RemoveFromTag.php index d88a15b59f..3c18e5b3e2 100644 --- a/CRM/Contact/Form/Task/RemoveFromTag.php +++ b/CRM/Contact/Form/Task/RemoveFromTag.php @@ -129,15 +129,15 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task { $status = [ ts('%count contact un-tagged', [ - 'count' => $removed, - 'plural' => '%count contacts un-tagged', - ]), + 'count' => $removed, + 'plural' => '%count contacts un-tagged', + ]), ]; if ($notRemoved) { $status[] = ts('1 contact already did not have this tag', [ - 'count' => $notRemoved, - 'plural' => '%count contacts already did not have this tag', - ]); + 'count' => $notRemoved, + 'plural' => '%count contacts already did not have this tag', + ]); } $status = ''; CRM_Core_Session::setStatus($status, ts("Removed Tag %1", [1 => $this->_tags[$key]]), 'success', ['expires' => 0]); diff --git a/CRM/Contact/Form/Task/Result.php b/CRM/Contact/Form/Task/Result.php index 3222cf410a..22c8bea273 100644 --- a/CRM/Contact/Form/Task/Result.php +++ b/CRM/Contact/Form/Task/Result.php @@ -95,13 +95,12 @@ class CRM_Contact_Form_Task_Result extends CRM_Contact_Form_Task { */ public function buildQuickForm() { $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'done', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ], + ]); } } diff --git a/CRM/Contact/Form/Task/SMSCommon.php b/CRM/Contact/Form/Task/SMSCommon.php index d6802158a1..eba06f8006 100644 --- a/CRM/Contact/Form/Task/SMSCommon.php +++ b/CRM/Contact/Form/Task/SMSCommon.php @@ -43,7 +43,6 @@ class CRM_Contact_Form_Task_SMSCommon { public $_toContactPhone = []; - /** * Pre process the provider. * @@ -401,9 +400,9 @@ class CRM_Contact_Form_Task_SMSCommon { if ($countSuccess > 0) { CRM_Core_Session::setStatus(ts('One message was sent successfully.', [ - 'plural' => '%count messages were sent successfully.', - 'count' => $countSuccess, - ]), ts('Message Sent', ['plural' => 'Messages Sent', 'count' => $countSuccess]), 'success'); + 'plural' => '%count messages were sent successfully.', + 'count' => $countSuccess, + ]), ts('Message Sent', ['plural' => 'Messages Sent', 'count' => $countSuccess]), 'success'); } if (is_array($sent)) { @@ -415,9 +414,9 @@ class CRM_Contact_Form_Task_SMSCommon { } $status .= ''; CRM_Core_Session::setStatus($status, ts('One Message Not Sent', [ - 'count' => count($sent), - 'plural' => '%count Messages Not Sent', - ]), 'info'); + 'count' => count($sent), + 'plural' => '%count Messages Not Sent', + ]), 'info'); } else { //Display the name and number of contacts for those sms is not sent. @@ -437,9 +436,9 @@ class CRM_Contact_Form_Task_SMSCommon { } $status .= ')'; CRM_Core_Session::setStatus($status, ts('One Message Not Sent', [ - 'count' => count($smsNotSent), - 'plural' => '%count Messages Not Sent', - ]), 'info'); + 'count' => count($smsNotSent), + 'plural' => '%count Messages Not Sent', + ]), 'info'); } } } diff --git a/CRM/Contact/Form/Task/Unhold.php b/CRM/Contact/Form/Task/Unhold.php index 0f51395bc2..add2891764 100644 --- a/CRM/Contact/Form/Task/Unhold.php +++ b/CRM/Contact/Form/Task/Unhold.php @@ -28,14 +28,14 @@ WHERE on_hold = 1 AND hold_date is not null AND contact_id in (" . implode(",", if ($rowCount) { CRM_Core_Session::setStatus(ts('%count email was found on hold and updated.', [ - 'count' => $rowCount, - 'plural' => '%count emails were found on hold and updated.', - ]), ts('Emails Restored'), 'success'); + 'count' => $rowCount, + 'plural' => '%count emails were found on hold and updated.', + ]), ts('Emails Restored'), 'success'); } else { CRM_Core_Session::setStatus(ts('The selected contact does not have an email on hold.', [ - 'plural' => 'None of the selected contacts have an email on hold.', - ]), ts('No Emails to Restore'), 'info'); + 'plural' => 'None of the selected contacts have an email on hold.', + ]), ts('No Emails to Restore'), 'info'); } } else { diff --git a/CRM/Contact/Import/Field.php b/CRM/Contact/Import/Field.php index 84679aaf6e..a1abc02343 100644 --- a/CRM/Contact/Import/Field.php +++ b/CRM/Contact/Import/Field.php @@ -30,17 +30,20 @@ */ class CRM_Contact_Import_Field { - /**#@+ + /** + * #@+ * @var string */ /** * Name of the field + * @var string */ public $_name; /** * Title of the field to be used in display + * @var string */ public $_title; diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 0c8f1061bc..2a7b1839e6 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -82,9 +82,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { closedir($handler); if (!empty($results)) { CRM_Core_Error::fatal(ts('%1 file(s) in %2 directory are not writable. Listed file(s) might be used during the import to log the errors occurred during Import process. Contact your site administrator for assistance.', [ - 1 => implode(', ', $results), - 2 => $config->uploadDir, - ])); + 1 => implode(', ', $results), + 2 => $config->uploadDir, + ])); } $this->_dataSourceIsValid = FALSE; @@ -216,18 +216,17 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { } $this->addButtons([ - [ - 'type' => 'upload', - 'name' => ts('Continue'), - 'spacing' => '          ', - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'upload', + 'name' => ts('Continue'), + 'spacing' => '          ', + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index 185ddfff40..fa24b12165 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -130,10 +130,10 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { if ($this->_onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK) { //Mark Dedupe Rule Fields as required, since it's used in matching contact foreach (array( - 'Individual', - 'Household', - 'Organization', - ) as $cType) { + 'Individual', + 'Household', + 'Organization', + ) as $cType) { $ruleParams = array( 'contact_type' => $cType, 'used' => 'Unsupervised', @@ -608,7 +608,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { 'type' => 'cancel', 'name' => ts('Cancel'), ), - ) + ) ); } diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index e132ea7db4..e47a5a1047 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -151,9 +151,9 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview { if (!empty($groups)) { $this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, array( - 'multiple' => "multiple", - 'class' => 'crm-select2', - )); + 'multiple' => "multiple", + 'class' => 'crm-select2', + )); } //display new tag diff --git a/CRM/Contact/Import/Importer.php b/CRM/Contact/Import/Importer.php index 6162b7090d..779d994b6e 100644 --- a/CRM/Contact/Import/Importer.php +++ b/CRM/Contact/Import/Importer.php @@ -36,6 +36,7 @@ * via a form post) and asynchronously (i.e. by the workflow system) */ class CRM_Contact_Import_Importer { + /** */ public function __construct() { diff --git a/CRM/Contact/Import/Parser.php b/CRM/Contact/Import/Parser.php index 114986d8e7..8979fb64f6 100644 --- a/CRM/Contact/Import/Parser.php +++ b/CRM/Contact/Import/Parser.php @@ -43,16 +43,19 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * Running total number of un-matched Contacts. + * @var int */ protected $_unMatchCount; /** * Array of unmatched lines + * @var array */ protected $_unMatch; /** * Total number of contacts with unparsed addresses + * @var int */ protected $_unparsedAddressCount; @@ -294,53 +297,43 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { if ($this->_invalidRowCount) { // removed view url for invlaid contacts $headers = array_merge([ - ts('Line Number'), - ts('Reason'), - ], - $customHeaders - ); + ts('Line Number'), + ts('Reason'), + ], $customHeaders); $this->_errorFileName = self::errorFileName(self::ERROR); self::exportCSV($this->_errorFileName, $headers, $this->_errors); } if ($this->_conflictCount) { $headers = array_merge([ - ts('Line Number'), - ts('Reason'), - ], - $customHeaders - ); + ts('Line Number'), + ts('Reason'), + ], $customHeaders); $this->_conflictFileName = self::errorFileName(self::CONFLICT); self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts); } if ($this->_duplicateCount) { $headers = array_merge([ - ts('Line Number'), - ts('View Contact URL'), - ], - $customHeaders - ); + ts('Line Number'), + ts('View Contact URL'), + ], $customHeaders); $this->_duplicateFileName = self::errorFileName(self::DUPLICATE); self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates); } if ($this->_unMatchCount) { $headers = array_merge([ - ts('Line Number'), - ts('Reason'), - ], - $customHeaders - ); + ts('Line Number'), + ts('Reason'), + ], $customHeaders); $this->_misMatchFilemName = self::errorFileName(self::NO_MATCH); self::exportCSV($this->_misMatchFilemName, $headers, $this->_unMatch); } if ($this->_unparsedAddressCount) { $headers = array_merge([ - ts('Line Number'), - ts('Contact Edit URL'), - ], - $customHeaders - ); + ts('Line Number'), + ts('Contact Edit URL'), + ], $customHeaders); $this->_errorFileName = self::errorFileName(self::UNPARSED_ADDRESS_WARNING); self::exportCSV($this->_errorFileName, $headers, $this->_unparsedAddresses); } @@ -380,6 +373,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ + /** * @param $elements */ diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 08bc64789f..663aa55101 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -80,7 +80,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { /** * Array of successfully imported contact id's * - * @array + * @var array */ protected $_newContacts; @@ -94,7 +94,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { /** * Array of successfully imported related contact id's * - * @array + * @var array */ protected $_newRelatedContacts; @@ -251,10 +251,9 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $this->_updateWithId = FALSE; if (in_array('id', $this->_mapperKeys) || ($this->_externalIdentifierIndex >= 0 && in_array($this->_onDuplicate, [ - CRM_Import_Parser::DUPLICATE_UPDATE, - CRM_Import_Parser::DUPLICATE_FILL, - ])) - ) { + CRM_Import_Parser::DUPLICATE_UPDATE, + CRM_Import_Parser::DUPLICATE_FILL, + ]))) { $this->_updateWithId = TRUE; } @@ -513,10 +512,9 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { //check if external identifier exists in database if (!empty($params['external_identifier']) && (!empty($params['id']) || in_array($onDuplicate, [ - CRM_Import_Parser::DUPLICATE_SKIP, - CRM_Import_Parser::DUPLICATE_NOCHECK, - ])) - ) { + CRM_Import_Parser::DUPLICATE_SKIP, + CRM_Import_Parser::DUPLICATE_NOCHECK, + ]))) { $extIDResult = civicrm_api3('Contact', 'get', [ 'external_identifier' => $params['external_identifier'], @@ -833,10 +831,9 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { } // check for valid related contact id in update/fill mode, CRM-4424 if (in_array($onDuplicate, [ - CRM_Import_Parser::DUPLICATE_UPDATE, - CRM_Import_Parser::DUPLICATE_FILL, - ]) && !empty($params[$key]['id']) - ) { + CRM_Import_Parser::DUPLICATE_UPDATE, + CRM_Import_Parser::DUPLICATE_FILL, + ]) && !empty($params[$key]['id'])) { $relatedContactType = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $params[$key]['id'], 'contact_type'); if (!$relatedContactType) { $errorMessage = ts("No contact found for this related contact ID: %1", [1 => $params[$key]['id']]); @@ -1316,10 +1313,10 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $error = TRUE; foreach ([ - $countryNames, - $countryIsoCodes, - $limitCodes, - ] as $values) { + $countryNames, + $countryIsoCodes, + $limitCodes, + ] as $values) { if (in_array(trim($countryValue), $values)) { $error = FALSE; break; diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index db7dca4ab7..f354d12bea 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -41,9 +41,11 @@ class CRM_Contact_Page_AJAX { * is the time window in which they can check usernames * (without reloading the overall form). */ - const CHECK_USERNAME_TTL = 10800; // 3hr; 3*60*60 + // 3hr; 3*60*60 + const CHECK_USERNAME_TTL = 10800; - const AUTOCOMPLETE_TTL = 21600; // 6hr; 6*60*60 + // 6hr; 6*60*60 + const AUTOCOMPLETE_TTL = 21600; /** * Ajax callback for custom fields of type ContactReference @@ -320,7 +322,7 @@ class CRM_Contact_Page_AJAX { /** * check the CMS username. */ - static public function checkUserName() { + public static function checkUserName() { $signer = new CRM_Utils_Signer(CRM_Core_Key::privateKey(), ['for', 'ts']); $sig = CRM_Utils_Request::retrieve('sig', 'String'); $for = CRM_Utils_Request::retrieve('for', 'String'); @@ -530,7 +532,6 @@ LIMIT {$offset}, {$rowCount} CRM_Utils_System::civiExit(); } - public static function buildSubTypes() { $parent = CRM_Utils_Request::retrieve('parentId', 'Positive'); @@ -662,7 +663,7 @@ LIMIT {$offset}, {$rowCount} $whereClause = $orderByClause = ''; $cacheKeyString = CRM_Dedupe_Merger::getMergeCacheKeyString($rgid, $gid, json_decode($criteria, TRUE)); - $searchRows = []; + $searchRows = []; $searchParams = self::getSearchOptionsFromRequest(); $queryParams = []; @@ -695,11 +696,11 @@ LIMIT {$offset}, {$rowCount} } if ($isOrQuery) { - $whereClause = ' ( ' . implode(' OR ', $where) . ' ) '; + $whereClause = ' ( ' . implode(' OR ', $where) . ' ) '; } else { if (!empty($where)) { - $whereClause = implode(' AND ', $where); + $whereClause = implode(' AND ', $where); } } $whereClause .= $whereClause ? ' AND de.id IS NULL' : ' de.id IS NULL'; @@ -819,13 +820,13 @@ LIMIT {$offset}, {$rowCount} if (!empty($pairInfo['data']['canMerge'])) { $mergeParams = [ 'reset' => 1, - 'cid' => $pairInfo['entity_id1'], - 'oid' => $pairInfo['entity_id2'], - 'action' => 'update', - 'rgid' => $rgid, - 'criteria' => $criteria, - 'limit' => CRM_Utils_Request::retrieve('limit', 'Integer'), - ]; + 'cid' => $pairInfo['entity_id1'], + 'oid' => $pairInfo['entity_id2'], + 'action' => 'update', + 'rgid' => $rgid, + 'criteria' => $criteria, + 'limit' => CRM_Utils_Request::retrieve('limit', 'Integer'), + ]; if ($gid) { $mergeParams['gid'] = $gid; } @@ -1026,7 +1027,8 @@ LIMIT {$offset}, {$rowCount} $params = [ 1 => [$isSelected, 'Boolean'], - 3 => ["$cacheKeyString%", 'String'], // using % to address rows with conflicts as well + // using % to address rows with conflicts as well + 3 => ["$cacheKeyString%", 'String'], ]; //check pnid is_array or integer diff --git a/CRM/Contact/Page/CustomSearch.php b/CRM/Contact/Page/CustomSearch.php index e1f4749c25..15b313f231 100644 --- a/CRM/Contact/Page/CustomSearch.php +++ b/CRM/Contact/Page/CustomSearch.php @@ -41,7 +41,7 @@ class CRM_Contact_Page_CustomSearch extends CRM_Core_Page { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * @return array diff --git a/CRM/Contact/Page/DedupeException.php b/CRM/Contact/Page/DedupeException.php index ea612da891..cb73cb3c20 100644 --- a/CRM/Contact/Page/DedupeException.php +++ b/CRM/Contact/Page/DedupeException.php @@ -35,6 +35,7 @@ * Main page for viewing contact. */ class CRM_Contact_Page_DedupeException extends CRM_Core_Page { + /** * the main function that is called when the page loads, * it decides the which action has to be taken for the page. diff --git a/CRM/Contact/Page/DedupeMerge.php b/CRM/Contact/Page/DedupeMerge.php index 45064446bb..1dddf56194 100644 --- a/CRM/Contact/Page/DedupeMerge.php +++ b/CRM/Contact/Page/DedupeMerge.php @@ -86,7 +86,7 @@ class CRM_Contact_Page_DedupeMerge extends CRM_Core_Page { $where = NULL; $onlyProcessSelected = ($action == CRM_Core_Action::MAP) ? 1 : 0; - $total = CRM_Core_BAO_PrevNextCache::getCount($cacheKeyString, NULL, ($onlyProcessSelected ? "pn.is_selected = 1" : NULL)); + $total = CRM_Core_BAO_PrevNextCache::getCount($cacheKeyString, NULL, ($onlyProcessSelected ? "pn.is_selected = 1" : NULL)); if ($total <= 0) { // Nothing to do. CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlQry)); @@ -96,7 +96,7 @@ class CRM_Contact_Page_DedupeMerge extends CRM_Core_Page { CRM_Dedupe_Merger::resetMergeStats($cacheKeyString); for ($i = 1; $i <= ceil($total / self::BATCHLIMIT); $i++) { - $task = new CRM_Queue_Task( + $task = new CRM_Queue_Task( ['CRM_Contact_Page_DedupeMerge', 'callBatchMerge'], [$rgid, $gid, $mode, self::BATCHLIMIT, $onlyProcessSelected, $criteria], "Processed " . $i * self::BATCHLIMIT . " pair of duplicates out of " . $total diff --git a/CRM/Contact/Page/DedupeRules.php b/CRM/Contact/Page/DedupeRules.php index 73573cd384..aa5fcfb117 100644 --- a/CRM/Contact/Page/DedupeRules.php +++ b/CRM/Contact/Page/DedupeRules.php @@ -37,7 +37,7 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Get BAO Name. diff --git a/CRM/Contact/Page/SavedSearch.php b/CRM/Contact/Page/SavedSearch.php index 128b22239e..a101e86283 100644 --- a/CRM/Contact/Page/SavedSearch.php +++ b/CRM/Contact/Page/SavedSearch.php @@ -41,7 +41,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Delete a saved search. diff --git a/CRM/Contact/Page/View.php b/CRM/Contact/Page/View.php index ca01608a90..8f7a78f214 100644 --- a/CRM/Contact/Page/View.php +++ b/CRM/Contact/Page/View.php @@ -39,28 +39,28 @@ class CRM_Contact_Page_View extends CRM_Core_Page { /** * The id of the object being viewed (note/relationship etc) * - * @int + * @var int */ protected $_id; /** * The contact id of the contact being viewed * - * @int + * @var int */ protected $_contactId; /** * The action that we are performing * - * @string + * @var string */ protected $_action; /** * The permission we have on this contact * - * @string + * @var string */ protected $_permission; @@ -332,9 +332,9 @@ class CRM_Contact_Page_View extends CRM_Core_Page { $mergedToContactID = $mergedTo['id']; $mergedToDisplayName = $mergedTo['values'][$mergedToContactID]['api.Contact.get']['values'][0]['display_name']; $title .= ' ' . ts('(This contact has been merged to %2)', [ - 1 => CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'cid' => $mergedToContactID]), - 2 => $mergedToDisplayName, - ]); + 1 => CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'cid' => $mergedToContactID]), + 2 => $mergedToDisplayName, + ]); } } diff --git a/CRM/Contact/Page/View/CustomData.php b/CRM/Contact/Page/View/CustomData.php index 37983dab96..73d9753382 100644 --- a/CRM/Contact/Page/View/CustomData.php +++ b/CRM/Contact/Page/View/CustomData.php @@ -39,7 +39,7 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page { /** * The id of the object being viewed (note/relationship etc). * - * @int + * @var int */ public $_groupId; diff --git a/CRM/Contact/Page/View/Note.php b/CRM/Contact/Page/View/Note.php index e118762fd8..2930341be7 100644 --- a/CRM/Contact/Page/View/Note.php +++ b/CRM/Contact/Page/View/Note.php @@ -41,14 +41,14 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * The action links for comments that we need to display for the browse screen * * @var array */ - static $_commentLinks = NULL; + public static $_commentLinks = NULL; /** * View details of a note. diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php index 12239acc3c..8e7006369a 100644 --- a/CRM/Contact/Page/View/Relationship.php +++ b/CRM/Contact/Page/View/Relationship.php @@ -37,7 +37,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Casid set if called from case context. diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index f91a87480b..39594e4073 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -316,7 +316,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { 'url' => '#contact-summary', 'title' => ts('Summary'), 'weight' => 0, - 'icon' => 'crm-i fa-address-card-o' + 'icon' => 'crm-i fa-address-card-o', ], [ 'id' => 'activity', diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php index af3e6e0d6b..c3eb11af2d 100644 --- a/CRM/Contact/Page/View/UserDashBoard.php +++ b/CRM/Contact/Page/View/UserDashBoard.php @@ -50,7 +50,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * @throws Exception diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 385958764e..a560a9adf3 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -45,20 +45,20 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * We use desc to remind us what that column is, name is used in the tpl * * @var array */ - static $_columnHeaders; + public static $_columnHeaders; /** * Properties of contact we're interested in displaying * @var array */ - static $_properties = [ + public static $_properties = [ 'contact_id', 'contact_type', 'contact_sub_type', diff --git a/CRM/Contact/Selector/Controller.php b/CRM/Contact/Selector/Controller.php index 12f64b2dc8..27dc70f753 100644 --- a/CRM/Contact/Selector/Controller.php +++ b/CRM/Contact/Selector/Controller.php @@ -31,6 +31,7 @@ * @copyright CiviCRM LLC (c) 2004-2019 */ class CRM_Contact_Selector_Controller extends CRM_Core_Selector_Controller { + /** * Default function for qill. * diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php index fa9d7ac463..109246f5ce 100644 --- a/CRM/Contact/Selector/Custom.php +++ b/CRM/Contact/Selector/Custom.php @@ -44,20 +44,20 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * We use desc to remind us what that column is, name is used in the tpl * * @var array */ - static $_columnHeaders; + public static $_columnHeaders; /** * Properties of contact we're interested in displaying * @var array */ - static $_properties = ['contact_id', 'contact_type', 'display_name']; + public static $_properties = ['contact_id', 'contact_type', 'display_name']; /** * FormValues is the array returned by exportValues called on @@ -92,6 +92,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { /** * The object that implements the search interface + * @var object */ protected $_search; diff --git a/CRM/Contact/Task.php b/CRM/Contact/Task.php index 03257dc91f..97c62e6b17 100644 --- a/CRM/Contact/Task.php +++ b/CRM/Contact/Task.php @@ -36,8 +36,10 @@ */ class CRM_Contact_Task extends CRM_Core_Task { + /** + * Contact tasks + */ const - // Contact tasks HOUSEHOLD_CONTACTS = 101, ORGANIZATION_CONTACTS = 102, RECORD_CONTACTS = 103, @@ -50,7 +52,10 @@ class CRM_Contact_Task extends CRM_Core_Task { INDIVIDUAL_CONTACTS = 110, ADD_TO_CASE = 111; - static $objectType = 'contact'; + /** + * @var string + */ + public static $objectType = 'contact'; public static function tasks() { if (!self::$_tasks) { @@ -300,7 +305,7 @@ class CRM_Contact_Task extends CRM_Core_Task { foreach ([ self::MAP_CONTACTS, self::CREATE_MAILING, - self::TASK_SMS + self::TASK_SMS, ] as $task) { if (isset(self::$_tasks[$task]) && !empty(self::$_tasks[$task]['title']) -- 2.25.1