<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
/**
$attachmentUrl = CRM_Core_BAO_File::attachmentInfo('civicrm_activity', $activityID);
if ($attachmentUrl) {
- $report['fields'][] = array(
+ $report['fields'][] = [
'label' => 'Attachment(s)',
'value' => $attachmentUrl,
'type' => 'Link',
- );
+ ];
}
$tags = CRM_Core_BAO_EntityTag::getTag($activityID, 'civicrm_activity');
if (!empty($tags)) {
- $allTag = CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', array('onlyActive' => FALSE));
+ $allTag = CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', ['onlyActive' => FALSE]);
foreach ($tags as $tid) {
$tags[$tid] = $allTag[$tid];
}
- $report['fields'][] = array(
+ $report['fields'][] = [
'label' => 'Tags',
'value' => implode('<br />', $tags),
'type' => 'String',
- );
+ ];
}
$this->assign('report', $report);
$latestRevisionID = CRM_Activity_BAO_Activity::getLatestActivityId($activityID);
- $viewPriorActivities = array();
+ $viewPriorActivities = [];
$priorActivities = CRM_Activity_BAO_Activity::getPriorAcitivities($activityID);
foreach ($priorActivities as $activityId => $activityValues) {
if (CRM_Case_BAO_Case::checkPermission($activityId, 'view', NULL, $contactID)) {
$title = $title . $recentContactDisplay . ' (' . $activityTypes[$activityTypeID] . ')';
- $recentOther = array();
+ $recentOther = [];
if (CRM_Case_BAO_Case::checkPermission($activityID, 'edit')) {
$recentOther['editUrl'] = CRM_Utils_System::url('civicrm/case/activity',
"reset=1&action=update&id={$activityID}&cid={$recentContactId}&caseid={$caseID}&context=home"
$recentContactDisplay,
$recentOther
);
+
+ // Set breadcrumb to take the user back to the case being viewed
+ $caseTypeId = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $caseID, 'case_type_id');
+ $caseType = CRM_Core_PseudoConstant::getLabel('CRM_Case_BAO_Case', 'case_type_id', $caseTypeId);
+ $caseContact = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseContact', $caseID, 'contact_id', 'case_id');
+
+ CRM_Utils_System::resetBreadCrumb();
+ $breadcrumb = [
+ [
+ 'title' => ts('Home'),
+ 'url' => CRM_Utils_System::url(),
+ ],
+ [
+ 'title' => ts('CiviCRM'),
+ 'url' => CRM_Utils_System::url('civicrm', 'reset=1'),
+ ],
+ [
+ 'title' => ts('CiviCase Dashboard'),
+ 'url' => CRM_Utils_System::url('civicrm/case', 'reset=1'),
+ ],
+ [
+ 'title' => $caseType,
+ 'url' => CRM_Utils_System::url('civicrm/contact/view/case', [
+ 'reset' => 1,
+ 'id' => $caseID,
+ 'context' => 'case',
+ 'action' => 'view',
+ 'cid' => $caseContact,
+ ]),
+ ],
+ ];
+ CRM_Utils_System::appendBreadCrumb($breadcrumb);
+
+ $this->addButtons([
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Done'),
+ ],
+ ]);
+ // Add additional action links
+ $activityDeleted = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $activityID, 'is_deleted');
+ $actionLinks = CRM_Case_Selector_Search::permissionedActionLinks($caseID, $contactID, CRM_Core_Session::getLoggedInContactID(), NULL, $activityTypeID, $activityDeleted, $activityID, FALSE);
+ $this->assign('actionLinks', $actionLinks);
}
}