| 1 | <?php |
| 2 | /* |
| 3 | +--------------------------------------------------------------------+ |
| 4 | | CiviCRM version 4.7 | |
| 5 | +--------------------------------------------------------------------+ |
| 6 | | Copyright CiviCRM LLC (c) 2004-2015 | |
| 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 | +--------------------------------------------------------------------+ |
| 26 | */ |
| 27 | |
| 28 | /** |
| 29 | * |
| 30 | * @package CRM |
| 31 | * @copyright CiviCRM LLC (c) 2004-2015 |
| 32 | * $Id$ |
| 33 | * |
| 34 | */ |
| 35 | class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail { |
| 36 | /** |
| 37 | */ |
| 38 | public function __construct() { |
| 39 | $logging = new CRM_Logging_Schema(); |
| 40 | $this->tables[] = 'civicrm_contact'; |
| 41 | $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables())); |
| 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 | |
| 53 | // allow tables to be extended by report hook query objects |
| 54 | CRM_Report_BAO_Hook::singleton()->alterLogTables($this, $this->tables); |
| 55 | |
| 56 | $this->detail = 'logging/contact/detail'; |
| 57 | $this->summary = 'logging/contact/summary'; |
| 58 | |
| 59 | parent::__construct(); |
| 60 | } |
| 61 | |
| 62 | public function buildQuickForm() { |
| 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 | } |
| 78 | |
| 79 | } |