Remove unused enableDisable function/hook
authorColeman Watts <coleman@civicrm.org>
Tue, 10 Feb 2015 02:52:42 +0000 (21:52 -0500)
committerColeman Watts <coleman@civicrm.org>
Tue, 10 Feb 2015 02:52:42 +0000 (21:52 -0500)
CRM/Contact/BAO/Relationship.php
CRM/Contact/Page/AJAX.php
CRM/Core/xml/Menu/Contact.xml
CRM/Utils/Hook.php

index e30675de5d304a0e9d8e51d313963fcc3cc2c0e5..6bae9c63be972a8cdad7b48f5df4603d5b3e2950 100644 (file)
@@ -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;
   }
 
index 81aef571076d655c6493e74f3244b99ebced784c..0ac35bd7a0ad785f67c368d99d93cb69e7f0bcbe 100644 (file)
@@ -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.
    */
index 679f953b431f46788e4924005cdb2ea92134cf0e..1dab01874ec708ac04fa7d371b0391a30264ec19 100644 (file)
      <access_arguments>access CiviCRM</access_arguments>
      <page_type>3</page_type>
 </item>
-<item>
-     <path>civicrm/ajax/ed</path>
-     <page_callback>CRM_Contact_Page_AJAX::enableDisable</page_callback>
-     <access_arguments>access CiviCRM</access_arguments>
-     <page_type>3</page_type>
-</item>
 <item>
      <path>civicrm/ajax/cmsuser</path>
      <page_callback>CRM_Contact_Page_AJAX::checkUserName</page_callback>
index da48a2ca1fd50354e6ada587f9194d07f7053af1..25dec213049ecbb47f03cf847a1cf9247692e185 100644 (file)
@@ -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.
    *