Merge pull request #17799 from civicrm/5.28
[civicrm-core.git] / CRM / Report / Form / Contact / LoggingDetail.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 * $Id$
17 *
18 */
19 class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail {
20
21 /**
22 */
23 public function __construct() {
24 $this->log_conn_id = CRM_Utils_Request::retrieve('log_conn_id', 'String');
25 $this->log_date = CRM_Utils_Request::retrieve('log_date', 'String');
26 $this->setTablesToContactRelatedTables();
27 $this->calculateContactDiffs();
28 $this->detail = 'logging/contact/detail';
29 $this->summary = 'logging/contact/summary';
30
31 parent::__construct();
32 }
33
34 public function buildQuickForm() {
35 $layout = CRM_Utils_Request::retrieve('layout', 'String', $this);
36 $this->assign('layout', $layout);
37
38 parent::buildQuickForm();
39
40 if ($this->cid) {
41 // link back to contact summary
42 $this->assign('backURL', CRM_Utils_System::url('civicrm/contact/view', "reset=1&selectedChild=log&cid={$this->cid}", FALSE, NULL, FALSE));
43 $this->assign('revertURL', self::$_template->get_template_vars('revertURL') . "&cid={$this->cid}");
44 }
45 else {
46 // link back to summary report
47 $this->assign('backURL', CRM_Report_Utils_Report::getNextUrl('logging/contact/summary', 'reset=1', FALSE, TRUE));
48 }
49 }
50
51 }