Details
-
Type: Bug
-
Status: Won't Do
-
Priority: Trivial
-
Resolution: Won't Do
-
Affects Version/s: 4.7.23
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
-
Verified?:No
Description
This is just me testing the Markdown Here Firefox extension as a way to input rich text in JIRA tickets...
hook_civicrm_merge
Summary
This hook allows modification of the data used to perform merging of
duplicates. It can be useful if your custom module has added its own
tables related to CiviCRM contacts.
Availability
This hook was first available in CiviCRM 3.2.3.
Definition
hook_civicrm_merge($type, &$data, $mainId = NULL, $otherId = NULL, $tables = NULL)
Parameters
- string $type - the type of data being passed
(cidRefs, eidRefs, relTables, or sqls) - array $data - the data, which depends on the value of $type (see Details)
- int $mainId - ID of the contact that survives the merge (only
when $type is sqls) - int $otherId - ID of the contact that will be absorbed and
deleted (only when $type is sqls) - array $tables - when $type is sqls, an array of tables as it may have
been handed to the calling function
Details
The contents of $data will vary based on the $type of data being
passed:
- relTables:
an array of tables used for asking user which elements to merge,
as used at civicrm/contact/merge. Each table in the array has
this format:
{{'rel_table_UNIQUE-TABLE-NICKNAME' => array( 'title' => ts('TITLE'), 'tables' => array('TABLE-NAME' [, ...]), 'url' => CRM_Utils_System::url(PATH, QUERY),
),}} - sqls:
a one-dimensional array of SQL statements to be run in the final
merge operation. These SQL statements are run within a single transaction.
- cidRefs:
an array of tables and their fields referencing
civicrm_contact.contact_id explicitly. Each table in the array has this format:
'TABLE-NAME' => array('COLUMN-NAME' [, ...]) - eidRefs:
an array of tables and their fields referencing
civicrm_contact.contact_id with entity_id. Each table in the array has this format:
'TABLE-NAME' => array('entity_table-COLUMN-NAME' => 'entity_id-COLUMN-NAME')
Code | Result | Extension required |
---|---|---|
italics | italics | |
*bold* | bold | |
**bold and italic** | bold and italic | |
{{`monospace` }} | monospace | |
~strikethrough~ | Tilde | |
==highlight== | ==highlight== | Mark |
{{/**
* Truncate $string; if $string exceeds $maxLen, place "..." at the end
*
* @param string $string
* @param int $maxLen
*
* @return string
*/public static function ellipsify($string, $maxLen) { $len = strlen($string); if ($len <= $maxLen) { return $string;
} else { $end = $maxLen - 3; while (strlen($string) > $maxLen - 3) { $string = mb_substr($string, 0, $end, 'UTF-8'); $end = $end - 1;
} return $string . '...';
}
}}}