From f469db01eebdbb5409c45845a334992411e18679 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 9 Feb 2015 21:52:42 -0500 Subject: [PATCH] Remove unused enableDisable function/hook --- CRM/Contact/BAO/Relationship.php | 3 --- CRM/Contact/Page/AJAX.php | 43 -------------------------------- CRM/Core/xml/Menu/Contact.xml | 6 ----- CRM/Utils/Hook.php | 14 ----------- 4 files changed, 66 deletions(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index e30675de5d..6bae9c63be 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -834,9 +834,6 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result); } - // call (undocumented possibly deprecated) hook - CRM_Utils_Hook::enableDisable('CRM_Contact_BAO_Relationship', $id, $is_active); - return TRUE; } diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index 81aef57107..0ac35bd7a0 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -550,49 +550,6 @@ ORDER BY sort_name "; CRM_Utils_System::civiExit(); } - /** - * Perform enable / disable actions on record. - */ - public static function enableDisable() { - $op = CRM_Utils_Type::escape($_REQUEST['op'], 'String'); - $recordID = CRM_Utils_Type::escape($_REQUEST['recordID'], 'Positive'); - $recordBAO = CRM_Utils_Type::escape($_REQUEST['recordBAO'], 'String'); - - $isActive = NULL; - if ($op == 'disable-enable') { - $isActive = TRUE; - } - elseif ($op == 'enable-disable') { - $isActive = FALSE; - } - $status = array('status' => 'record-updated-fail'); - if (isset($isActive)) { - // first munge and clean the recordBAO and get rid of any non alpha numeric characters - $recordBAO = CRM_Utils_String::munge($recordBAO); - $recordClass = explode('_', $recordBAO); - - // make sure recordClass is namespaced (we cant check CRM since extensions can also use this) - // but it should be at least 3 levels deep - if (count($recordClass) >= 3) { - require_once str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . ".php"; - $method = 'setIsActive'; - - if (method_exists($recordBAO, $method)) { - $updated = call_user_func_array(array($recordBAO, $method), - array($recordID, $isActive) - ); - if ($updated) { - $status = array('status' => 'record-updated-success'); - } - - // call hook enableDisable - CRM_Utils_Hook::enableDisable($recordBAO, $recordID, $isActive); - } - } - CRM_Utils_JSON::output($status); - } - } - /** * check the CMS username. */ diff --git a/CRM/Core/xml/Menu/Contact.xml b/CRM/Core/xml/Menu/Contact.xml index 679f953b43..1dab01874e 100644 --- a/CRM/Core/xml/Menu/Contact.xml +++ b/CRM/Core/xml/Menu/Contact.xml @@ -277,12 +277,6 @@ access CiviCRM 3 - - civicrm/ajax/ed - CRM_Contact_Page_AJAX::enableDisable - access CiviCRM - 3 - civicrm/ajax/cmsuser CRM_Contact_Page_AJAX::checkUserName diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index da48a2ca1f..25dec21304 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -1036,20 +1036,6 @@ abstract class CRM_Utils_Hook { ); } - /** - * @param $recordBAO - * @param int $recordID - * @param $isActive - * - * @return mixed - */ - public static function enableDisable($recordBAO, $recordID, $isActive) { - return self::singleton()->invoke(3, $recordBAO, $recordID, $isActive, - self::$_nullObject, self::$_nullObject, self::$_nullObject, - 'civicrm_enableDisable' - ); - } - /** * This hooks allows to change option values. * -- 2.25.1