* ID of the case.
*
* @param int $contactID
+ * @param int $startArrayAt This is to support legacy calls to Case.Get API which may rely on the first array index being set to 1
*
* @return array
*/
- public static function retrieveContactIdsByCaseId($caseId, $contactID = NULL) {
+ public static function retrieveContactIdsByCaseId($caseId, $contactID = NULL, $startArrayAt = 0) {
$caseContact = new CRM_Case_DAO_CaseContact();
$caseContact->case_id = $caseId;
$caseContact->find();
$contactArray = array();
- // FIXME: Why does this return a 1-based array?
- $count = 1;
+ $count = $startArrayAt;
while ($caseContact->fetch()) {
if ($contactID != $caseContact->contact_id) {
$contactArray[$count] = $caseContact->contact_id;
$contactViewUrl = CRM_Utils_System::url("civicrm/contact/view", "reset=1&cid=", FALSE, NULL, FALSE);
$hasViewContact = CRM_Core_Permission::giveMeAllACLs();
- $clientIds = self::retrieveContactIdsByCaseId($caseID);
if (!$userID) {
$session = CRM_Core_Session::singleton();
//allow edit operation.
$allowEditNames = array('Open Case');
+ if (CRM_Core_Permission::check('edit inbound email basic information') ||
+ CRM_Core_Permission::check('edit inbound email basic information and content')
+ ) {
+ $allowEditNames[] = 'Inbound Email';
+ }
+
// do not allow File on Case
$doNotFileNames = array(
'Open Case',