X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FHook.php;h=bf0b47f4b7297e2b2d57e77fe0758d3e00785da2;hb=5dc8d80defb19ece6aed1a0b1a56dac949573ba2;hp=f1a431c6f05ace032e3e04efec2a38249497b798;hpb=fd901044c9a37663407171df0818f507e1dfc856;p=civicrm-core.git diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index f1a431c6f0..bf0b47f4b7 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -1622,7 +1622,7 @@ abstract class CRM_Utils_Hook { * @return void */ static function pre_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) { - return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, 'civicrm_pre_case_merge'); + return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_pre_case_merge'); } /** @@ -1637,7 +1637,7 @@ abstract class CRM_Utils_Hook { * @return void */ static function post_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) { - return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, 'civicrm_post_case_merge'); + return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_post_case_merge'); } /** @@ -1680,4 +1680,52 @@ abstract class CRM_Utils_Hook { ); } + /** + * This hook fires whenever a record in a case changes. + * + * @param \Civi\CCase\Analyzer $analyzer + */ + static function caseChange(\Civi\CCase\Analyzer $analyzer) { + $event = new \Civi\CCase\Event\CaseChangeEvent($analyzer); + \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_caseChange", $event); + + return self::singleton()->invoke(1, $angularModules, + self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_caseChange' + ); + } + + /** + * Generate a default CRUD URL for an entity + * + * @param array $spec with keys: + * - action: int, eg CRM_Core_Action::VIEW or CRM_Core_Action::UPDATE + * - entity_table: string + * - entity_id: int + * @param CRM_Core_DAO $bao + * @param array $link to define the link, add these keys to $link: + * - title: string + * - path: string + * - query: array + * - url: string (used in lieu of "path"/"query") + * Note: if making "url" CRM_Utils_System::url(), set $htmlize=false + * @return mixed + */ + static function crudLink($spec, $bao, &$link) { + return self::singleton()->invoke(3, $spec, $bao, $link, + self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_crudLink' + ); + } + + /** + * @param array $fileSearches + * @return mixed + */ + static function fileSearches(&$fileSearches) { + return self::singleton()->invoke(1, $fileSearches, + self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_fileSearches' + ); + } }