3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 class CRM_Contact_Page_View_Log
extends CRM_Core_Page
{
20 * Called when action is browse.
24 public function browse() {
25 $loggingReport = CRM_Core_BAO_Log
::useLoggingReport();
26 $this->assign('useLogging', $loggingReport);
29 $this->assign('instanceUrl',
30 CRM_Utils_System
::url("civicrm/report/instance/{$loggingReport}",
31 "reset=1&force=1&snippet=4§ion=2&altered_contact_id_op=eq&altered_contact_id_value={$this->_contactId}&cid={$this->_contactId}", FALSE, NULL, FALSE));
35 $log = new CRM_Core_DAO_Log();
37 $log->entity_table
= 'civicrm_contact';
38 $log->entity_id
= $this->_contactId
;
39 $log->orderBy('modified_date desc');
43 while ($log->fetch()) {
44 list($displayName, $contactImage) = CRM_Contact_BAO_Contact
::getDisplayAndImage($log->modified_id
);
46 'id' => $log->modified_id
,
47 'name' => $displayName,
48 'image' => $contactImage,
49 'date' => $log->modified_date
,
53 $this->assign('logCount', count($logEntries));
54 $this->ajaxResponse
['tabCount'] = count($logEntries);
55 $this->ajaxResponse +
= CRM_Contact_Form_Inline
::renderFooter($this->_contactId
, FALSE);
56 $this->assign_by_ref('log', $logEntries);
59 public function preProcess() {
60 $this->_contactId
= CRM_Utils_Request
::retrieve('cid', 'Positive', $this, TRUE);
61 $this->assign('contactId', $this->_contactId
);
63 $displayName = CRM_Contact_BAO_Contact
::displayName($this->_contactId
);
64 $this->assign('displayName', $displayName);
66 // check logged in url permission
67 CRM_Contact_Page_View
::checkUserPermission($this);
69 $this->_action
= CRM_Utils_Request
::retrieve('action', 'String', $this, FALSE, 'browse');
70 $this->assign('action', $this->_action
);
74 * the main function that is called when the page loads, it decides the which action has to be taken for the page.
78 public function run() {