function __construct()
 {
     // don’t display the ‘Add these Contacts to Group’ button
     $this->_add2groupSupported = FALSE;
     $dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN);
     $this->db = $dsn['database'];
     $this->log_conn_id = CRM_Utils_Request::retrieve('log_conn_id', 'Integer', CRM_Core_DAO::$_nullObject);
     $this->log_date = CRM_Utils_Request::retrieve('log_date', 'String', CRM_Core_DAO::$_nullObject);
     $this->cid = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
     $this->raw = CRM_Utils_Request::retrieve('raw', 'Boolean', CRM_Core_DAO::$_nullObject);
     parent::__construct();
     CRM_Utils_System::resetBreadCrumb();
     $breadcrumb = array(array('title' => ts('Home'), 'url' => CRM_Utils_System::url()), array('title' => ts('CiviCRM'), 'url' => CRM_Utils_System::url('civicrm', 'reset=1')), array('title' => ts('View Contact'), 'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}")), array('title' => ts('Search Results'), 'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1")));
     CRM_Utils_System::appendBreadCrumb($breadcrumb);
     if (CRM_Utils_Request::retrieve('revert', 'Boolean', CRM_Core_DAO::$_nullObject)) {
         $reverter = new CRM_Logging_Reverter($this->log_conn_id, $this->log_date);
         $reverter->revert($this->tables);
         CRM_Core_Session::setStatus(ts('The changes have been reverted.'));
         if ($this->cid) {
             CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view', "reset=1&selectedChild=log&cid={$this->cid}", FALSE, NULL, FALSE));
         } else {
             CRM_Utils_System::redirect(CRM_Report_Utils_Report::getNextUrl($this->summary, 'reset=1', FALSE, TRUE));
         }
     }
     // make sure the report works even without the params
     if (!$this->log_conn_id or !$this->log_date) {
         $dao = new CRM_Core_DAO();
         $dao->query("SELECT log_conn_id, log_date FROM `{$this->db}`.log_{$this->tables[0]} WHERE log_action = 'Update' ORDER BY log_date DESC LIMIT 1");
         $dao->fetch();
         $this->log_conn_id = $dao->log_conn_id;
         $this->log_date = $dao->log_date;
     }
     $this->_columnHeaders = array('field' => array('title' => ts('Field')), 'from' => array('title' => ts('Changed From')), 'to' => array('title' => ts('Changed To')));
 }
Example #2
0
 /**
  * Class constructor.
  */
 public function __construct()
 {
     $this->storeDB();
     $this->parsePropertiesFromUrl();
     parent::__construct();
     CRM_Utils_System::resetBreadCrumb();
     $breadcrumb = array(array('title' => ts('Home'), 'url' => CRM_Utils_System::url()), array('title' => ts('CiviCRM'), 'url' => CRM_Utils_System::url('civicrm', 'reset=1')), array('title' => ts('View Contact'), 'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}")), array('title' => ts('Search Results'), 'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1")));
     CRM_Utils_System::appendBreadCrumb($breadcrumb);
     if (CRM_Utils_Request::retrieve('revert', 'Boolean')) {
         $this->revert();
     }
     $this->_columnHeaders = array('field' => array('title' => ts('Field')), 'from' => array('title' => ts('Changed From')), 'to' => array('title' => ts('Changed To')));
 }