Commit 51ccfbbe authored by totten's avatar totten
Browse files

INFRA-132 - CRM/Contact - Misc

parent 28d4d481
......@@ -158,7 +158,8 @@ ON DUPLICATE KEY UPDATE
* @return boolean
* @static
*/
static function hasContactsInCache($type = CRM_Core_Permission::VIEW,
static function hasContactsInCache(
$type = CRM_Core_Permission::VIEW,
$contactID = NULL
) {
if (!$contactID) {
......@@ -324,7 +325,8 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR
AND ( civicrm_relationship.is_active = 1 )
";
}
$params = array(1 => array($contactID, 'Integer'),
$params = array(
1 => array($contactID, 'Integer'),
2 => array($selectedContactID, 'Integer'),
);
return CRM_Core_DAO::singleValueQuery($query, $params);
......
......@@ -220,7 +220,7 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE}
* @param bool $ignoreCache
*
* @return array of all subtypes OR list of subtypes associated to
*a given basic contact type
* a given basic contact type
* @static
*/
public static function subTypes($contactType = NULL, $all = FALSE, $columnName = 'name', $ignoreCache = FALSE) {
......@@ -374,7 +374,8 @@ WHERE type.name IS NOT NULL
*
* @return mixed
*/
static function getSelectElements($all = FALSE,
static function getSelectElements(
$all = FALSE,
$isSeparator = TRUE,
$separator = '__'
) {
......@@ -460,9 +461,9 @@ AND ( p.is_active = 1 OR p.id IS NULL )
/**
* Retrieve the basic contact type associated with given subType.
*
*@param array/string $subType contact subType.
*@return array/string of basicTypes.
*@static
* @param array/string $subType contact subType.
* @return array/string of basicTypes.
* @static
*
*/
public static function getBasicType($subType) {
......@@ -872,7 +873,8 @@ WHERE extends = %1 AND " . implode(" OR ", $subTypeClause);
*
* @return bool
*/
static function deleteCustomSetForSubtypeMigration($contactID,
static function deleteCustomSetForSubtypeMigration(
$contactID,
$contactType,
$oldSubtypeSet = array(),
$newSubtypeSet = array()
......
......@@ -5057,10 +5057,11 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
* @param $fieldTitle
* @param null $options
*/
function numberRangeBuilder(&$values,
$tableName, $fieldName,
$dbFieldName, $fieldTitle,
$options = NULL
function numberRangeBuilder(
&$values,
$tableName, $fieldName,
$dbFieldName, $fieldTitle,
$options = NULL
) {
list($name, $op, $value, $grouping, $wildcard) = $values;
......
......@@ -404,7 +404,8 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
*
* @return array - array reference of all relationship types with context to current contact.
*/
static function getContactRelationshipType($contactId = NULL,
static function getContactRelationshipType(
$contactId = NULL,
$contactSuffix = NULL,
$relationshipId = NULL,
$contactType = NULL,
......@@ -1051,7 +1052,8 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id)
* @return array|int
* @static
*/
static function getRelationship($contactId = NULL,
static function getRelationship(
$contactId = NULL,
$status = 0, $numRelationship = 0,
$count = 0, $relationshipId = 0,
$links = NULL, $permissionMask = NULL,
......
......@@ -65,7 +65,8 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
*
* @static
*/
static function buildQuickForm(&$form,
static function buildQuickForm(
&$form,
$contactId = 0,
$type = self::ALL,
$visibility = FALSE,
......@@ -197,7 +198,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
self::climbtree($form, $varValue['children'], $elements);
}
}
return $elements;
return $elements;
}
/**
......
......@@ -75,7 +75,6 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_
NULL, '', NULL
);
//use simplified formatted groupTree
$groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, 1, $form);
......@@ -131,7 +130,6 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_
$form->addDate('start_date', ts('Activity Date From'), FALSE, array('formatType' => 'custom'));
$form->addDate('end_date', ts('...through'), FALSE, array('formatType' => 'custom'));
// Contact Name field
$form->add('text', 'sort_name', ts('Contact Name'));
......@@ -155,7 +153,8 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_
/**
* Construct the search query
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
......
......@@ -107,7 +107,8 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate implements CRM_Contac
/**
* Construct the search query
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
......
......@@ -121,7 +121,8 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C
*
* @return string
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
......
......@@ -104,7 +104,8 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form
/**
* Construct the search query
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($justIDs) {
......
......@@ -103,7 +103,8 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea
/**
* Construct the search query
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
// SELECT clause must include contact_id as an alias for civicrm_contact.id if you are going to use "tasks" like export etc.
......@@ -271,7 +272,6 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea
on (civicrm_entity_financial_trxn.entity_id = civicrm_participant_payment.contribution_id and civicrm_entity_financial_trxn.entity_table='civicrm_contribution')";
}
$where = $this->where();
$sql = "
......
......@@ -75,7 +75,8 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear
*
* @return string
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($justIDs) {
......@@ -83,7 +84,7 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear
$sort = 'contact_a.id';
}
else {
$selectClause = "
$selectClause = "
DISTINCT contact_a.id as contact_id ,
contact_a.contact_type as contact_type,
contact_a.sort_name as sort_name,
......
......@@ -276,7 +276,8 @@ AND p.entity_id = e.id
*
* @return string
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($justIDs) {
......@@ -340,7 +341,8 @@ INNER JOIN {$this->_tableName} tempTable ON ( tempTable.contact_id = contact_a.i
/**
* @param $row
*/
public function alterRow(&$row) {}
public function alterRow(&$row) {
}
/**
* @param $title
......
......@@ -170,7 +170,8 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C
*
* @return string
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($justIDs) {
......@@ -287,7 +288,8 @@ AND cgc.group_id = {$this->_group}
/**
* @param $row
*/
public function alterRow(&$row) {}
public function alterRow(&$row) {
}
/**
* @param $title
......
......@@ -131,7 +131,8 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear
*
* @return string
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($justIDs) {
......
......@@ -106,7 +106,8 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust
*
* @return string
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($justIDs) {
......
......@@ -71,7 +71,6 @@ class CRM_Contact_Form_Search_Custom_TagContributions implements CRM_Contact_For
* Define the search form fields here
*/
$form->addDate('start_date', ts('Contribution Date From'), FALSE, array('formatType' => 'custom'));
$form->addDate('end_date', ts('...through'), FALSE, array('formatType' => 'custom'));
$tag = array('' => ts('- any tag -')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', array('onlyActive' => FALSE));
......@@ -94,7 +93,8 @@ class CRM_Contact_Form_Search_Custom_TagContributions implements CRM_Contact_For
/**
* Construct the search query
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $onlyIDs = FALSE
) {
......
......@@ -96,7 +96,8 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc
*
* @return string
*/
function all($offset = 0, $rowcount = 0, $sort = NULL,
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($justIDs) {
......@@ -154,7 +155,8 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND
}
$where = "ROUND(address.postal_code) >= %1 AND ROUND(address.postal_code) <= %2";
$params = array(1 => array(trim($low), 'Integer'),
$params = array(
1 => array(trim($low), 'Integer'),
2 => array(trim($high), 'Integer'),
);
......
......@@ -699,12 +699,14 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
);
//set respective mapper params to array.
foreach (array_keys($mapperParams) as $mapperParam) { $$mapperParam = array();
foreach (array_keys($mapperParams) as $mapperParam) {
$$mapperParam = array();
}
for ($i = 0; $i < $this->_columnCount; $i++) {
//set respective mapper value to null
foreach (array_values($mapperParams) as $mapperParam) { $$mapperParam = NULL;
foreach (array_values($mapperParams) as $mapperParam) {
$$mapperParam = NULL;
}
$fldName = CRM_Utils_Array::value(0, $mapperKeys[$i]);
......
......@@ -118,7 +118,8 @@ class CRM_Contact_Import_ImportJob {
'mapperRelatedContactImProvider',
'mapperRelatedContactWebsiteType',
);
foreach ($properties as $property) { $this->{"_$property"} = array();
foreach ($properties as $property) {
$this->{"_$property"} = array();
}
}
......@@ -191,7 +192,8 @@ class CRM_Contact_Import_ImportJob {
foreach ($mapper as $key => $value) {
//set respective mapper value to null.
foreach (array_values($mapperPeroperties) as $perpertyVal) { $$perpertyVal = NULL;
foreach (array_values($mapperPeroperties) as $perpertyVal) {
$$perpertyVal = NULL;
}
$fldName = CRM_Utils_Array::value(0, $mapper[$key]);
......@@ -346,7 +348,8 @@ class CRM_Contact_Import_ImportJob {
*
* @return array|bool
*/
private function _addImportedContactsToNewGroup($contactIds,
private function _addImportedContactsToNewGroup(
$contactIds,
$newGroupName, $newGroupDesc
) {
......@@ -399,7 +402,8 @@ class CRM_Contact_Import_ImportJob {
*
* @return array|bool
*/
private function _tagImportedContactsWithNewTag($contactIds,
private function _tagImportedContactsWithNewTag(
$contactIds,
$newTagName, $newTagDesc
) {
......
......@@ -103,7 +103,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
*
* @return mixed
*/
function run($tableName,
function run(
$tableName,
&$mapper,
$mode = self::MODE_PREVIEW,
$contactType = self::CONTACT_INDIVIDUAL,
......@@ -647,7 +648,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
* @param string $dataPattern
* @param bool $hasLocationType
*/
function addField($name, $title, $type = CRM_Utils_Type::T_INT,
function addField(
$name, $title, $type = CRM_Utils_Type::T_INT,
$headerPattern = '//', $dataPattern = '//',
$hasLocationType = FALSE
) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment