<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
$caseStatuses = CRM_Case_PseudoConstant::caseStatus();
$cs = $caseStatuses[$dao->status_id];
$caseDetails = "<table><tr><td>" . ts('Case Subject') . "</td><td>{$dao->subject}</td></tr>
- <tr><td>" . ts('Case Type') . "</td><td>{$caseType}</td></tr>
+ <tr><td>" . ts('Case Type') . "</td><td>{$caseType}</td></tr>
<tr><td>" . ts('Case Status') . "</td><td>{$cs}</td></tr>
<tr><td>" . ts('Case Start Date') . "</td><td>" . CRM_Utils_Date::customFormat($dao->start_date) . "</td></tr>
<tr><td>" . ts('Case End Date') . "</td><td></td></tr>" . CRM_Utils_Date::customFormat($dao->end_date) . "</table>";
echo json_encode(TRUE);
CRM_Utils_System::civiExit();
}
+
+ /**
+ * Function to delete relationships specific to case and relationship type
+ */
+ static function deleteCaseRoles() {
+ $caseId = CRM_Utils_Type::escape($_POST['case_id'], 'Integer');
+ $relType = CRM_Utils_Type::escape($_POST['rel_type'], 'Integer');
+
+ $sql = "DELETE FROM civicrm_relationship WHERE case_id={$caseId} AND relationship_type_id={$relType}";
+ CRM_Core_DAO::executeQuery($sql);
+
+ CRM_Utils_System::civiExit();
+ }
}