From c47ab74413b9c91d61fd29f14080949473ba2094 Mon Sep 17 00:00:00 2001 From: Camilo Rodriguez Date: Tue, 5 Dec 2017 17:31:30 +0000 Subject: [PATCH] CRM-21520: Remove Add Contact to Case From Detail View Part of the functionality included corresponded to the ability to add a contact to a case from within the Contact's detail view, via an action. This functionality is outside of the scope of the current ticket, and thus is removed. --- CRM/Case/Form/AddContact.php | 32 -------------------------- CRM/Contact/BAO/Contact.php | 8 ------- templates/CRM/Case/Form/AddContact.tpl | 1 - 3 files changed, 41 deletions(-) delete mode 100644 CRM/Case/Form/AddContact.php delete mode 100644 templates/CRM/Case/Form/AddContact.tpl diff --git a/CRM/Case/Form/AddContact.php b/CRM/Case/Form/AddContact.php deleted file mode 100644 index da93aabb6d..0000000000 --- a/CRM/Case/Form/AddContact.php +++ /dev/null @@ -1,32 +0,0 @@ -build(); - } - - public function postProcess() { - $values = $this->controller->exportValues(); - - $caseId = (int) $values['assign_to']; - $roleTypeId = (int) $values['role_type']; - $contacts = array((int) CRM_Utils_Request::retrieve('cid', 'Positive')); - - $clients = CRM_Case_BAO_Case::getCaseClients($caseId); - - $params = array( - 'contact_id_a' => $clients[0], - 'contact_id_b' => $contacts, - 'case_id' => $caseId, - 'relationship_type_id' => $roleTypeId, - ); - - CRM_Contact_BAO_Relationship::createMultiple($params, 'a'); - - CRM_Core_Session::setStatus(ts('Contact has been added to case.'), 'Information', 'success'); - } - -} diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index de5dbc6376..39de40240b 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -3105,14 +3105,6 @@ AND civicrm_openid.is_primary = 1"; ); } - $menu['add-to-case-as-role'] = array( - 'title' => 'Add to case as role', - 'href' => CRM_Utils_System::url('civicrm/case/add-contact', 'reset=1'), - 'weight' => 100, - 'ref' => 'add-to-case-as-role', - 'key' => 'add-to-case-as-role', - ); - CRM_Utils_Hook::summaryActions($menu, $contactId); //1. check for component is active. //2. check for user permissions. diff --git a/templates/CRM/Case/Form/AddContact.tpl b/templates/CRM/Case/Form/AddContact.tpl deleted file mode 100644 index 39d32412ef..0000000000 --- a/templates/CRM/Case/Form/AddContact.tpl +++ /dev/null @@ -1 +0,0 @@ -{include file="CRM/Caseroles/Form/AddToCaseAsRole.tpl"} -- 2.25.1