CRM-18010: Ensure type of each report filters
[civicrm-core.git] / CRM / Report / Form / Contact / LoggingDetail.php
CommitLineData
6a488035 1<?php
6a488035
TO
2/*
3 +--------------------------------------------------------------------+
7e9e8871 4 | CiviCRM version 4.7 |
6a488035 5 +--------------------------------------------------------------------+
e7112fa7 6 | Copyright CiviCRM LLC (c) 2004-2015 |
6a488035
TO
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
29 *
30 * @package CRM
e7112fa7 31 * @copyright CiviCRM LLC (c) 2004-2015
6a488035
TO
32 * $Id$
33 *
34 */
35class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail {
74cf4551 36 /**
74cf4551 37 */
00be9182 38 public function __construct() {
7c550ca0 39 $logging = new CRM_Logging_Schema();
6a488035 40 $this->tables[] = 'civicrm_contact';
353ffa53 41 $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables()));
6a488035
TO
42 $this->tables[] = 'civicrm_email';
43 $this->tables[] = 'civicrm_phone';
44 $this->tables[] = 'civicrm_im';
45 $this->tables[] = 'civicrm_openid';
46 $this->tables[] = 'civicrm_website';
47 $this->tables[] = 'civicrm_address';
48 $this->tables[] = 'civicrm_note';
49 $this->tables[] = 'civicrm_relationship';
50 $this->tables[] = 'civicrm_activity';
51 $this->tables[] = 'civicrm_case';
52
6b4b11c4
DS
53 // allow tables to be extended by report hook query objects
54 CRM_Report_BAO_Hook::singleton()->alterLogTables($this, $this->tables);
55
6a488035
TO
56 $this->detail = 'logging/contact/detail';
57 $this->summary = 'logging/contact/summary';
58
59 parent::__construct();
60 }
61
00be9182 62 public function buildQuickForm() {
6a488035
TO
63 $layout = CRM_Utils_Request::retrieve('layout', 'String', $this);
64 $this->assign('layout', $layout);
65
66 parent::buildQuickForm();
67
68 if ($this->cid) {
69 // link back to contact summary
70 $this->assign('backURL', CRM_Utils_System::url('civicrm/contact/view', "reset=1&selectedChild=log&cid={$this->cid}", FALSE, NULL, FALSE));
71 $this->assign('revertURL', self::$_template->get_template_vars('revertURL') . "&cid={$this->cid}");
72 }
73 else {
74 // link back to summary report
75 $this->assign('backURL', CRM_Report_Utils_Report::getNextUrl('logging/contact/summary', 'reset=1', FALSE, TRUE));
76 }
77 }
96025800 78
6a488035 79}