Add items to recents items
authorNiels Heinemann <heinemann@kompetenzz.de>
Wed, 28 Mar 2018 12:49:06 +0000 (14:49 +0200)
committerNiels Heinemann <heinemann@kompetenzz.de>
Wed, 28 Mar 2018 12:49:06 +0000 (14:49 +0200)
CRM/Activity/Form/Activity.php
CRM/Activity/Form/ActivityView.php

index 113247adfebd7869e4127b8ea2ad6c4ee0848080..5b8fe0b6760645425e8f35f3ad7af1d472968f2e 100644 (file)
@@ -522,6 +522,17 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
     if ($this->_action & CRM_Core_Action::UPDATE) {
       CRM_Core_Form_RecurringEntity::preProcess('civicrm_activity');
     }
+
+    if ($this->_action & CRM_Core_Action::VIEW) {
+      $url = CRM_Utils_System::url(implode("/", $this->urlPath), "reset=1&id={$this->_activityId}&action=view&cid={$this->_values['source_contact_id']}");
+      CRM_Utils_Recent::add($this->_values['subject'],
+        $url,
+        $this->_values['id'],
+        'Activity',
+        $this->_values['source_contact_id'],
+        $this->_values['source_contact']
+      );
+    }
   }
 
   /**
index 98e987266905b6d3b832a4924fa439e6e3332d7f..a1dac67084e621887378f624f9553444dd132c77 100644 (file)
@@ -108,6 +108,15 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form {
 
     $values['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_activity', $activityId);
     $this->assign('values', $values);
+
+    $url = CRM_Utils_System::url(implode("/", $this->urlPath), "reset=1&id={$activityId}&action=view&cid={$values['source_contact_id']}");
+    CRM_Utils_Recent::add($this->_values['subject'],
+      $url,
+      $values['id'],
+      'Activity',
+      $values['source_contact_id'],
+      $values['source_contact']
+    );
   }
 
   /**