Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
aba1cd8b EM |
3 | /** |
4 | * Class test_extension_manager_reporttest | |
5 | */ | |
6a488035 | 6 | class test_extension_manager_reporttest extends CRM_Core_Report { |
aba1cd8b | 7 | /** |
aba1cd8b | 8 | */ |
28a04ea9 | 9 | public function __construct() { |
10 | $logging = new CRM_Logging_Schema(); | |
6a488035 TO |
11 | $this->tables[] = 'civicrm_contact'; |
12 | $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables())); | |
13 | $this->tables[] = 'civicrm_email'; | |
14 | $this->tables[] = 'civicrm_phone'; | |
15 | $this->tables[] = 'civicrm_im'; | |
16 | $this->tables[] = 'civicrm_openid'; | |
17 | $this->tables[] = 'civicrm_website'; | |
18 | $this->tables[] = 'civicrm_address'; | |
19 | $this->tables[] = 'civicrm_note'; | |
20 | $this->tables[] = 'civicrm_relationship'; | |
21 | ||
22 | $this->detail = 'logging/contact/detail'; | |
23 | $this->summary = 'logging/contact/summary'; | |
24 | ||
25 | parent::__construct(); | |
26 | } | |
27 | ||
28a04ea9 | 28 | public function buildQuickForm() { |
6a488035 TO |
29 | $layout = CRM_Utils_Request::retrieve('layout', 'String', $this); |
30 | $this->assign('layout', $layout); | |
31 | ||
32 | parent::buildQuickForm(); | |
33 | ||
34 | if ($this->cid) { | |
35 | // link back to contact summary | |
36 | $this->assign('backURL', CRM_Utils_System::url('civicrm/contact/view', "reset=1&selectedChild=log&cid={$this->cid}", FALSE, NULL, FALSE)); | |
37 | $this->assign('revertURL', self::$_template->get_template_vars('revertURL') . "&cid={$this->cid}"); | |
38 | } | |
39 | else { | |
40 | // link back to summary report | |
41 | $this->assign('backURL', CRM_Report_Utils_Report::getNextUrl('logging/contact/summary', 'reset=1', FALSE, TRUE)); | |
42 | } | |
43 | } | |
44 | ||
4cbe18b8 EM |
45 | /** |
46 | * @return string | |
47 | */ | |
6a488035 TO |
48 | protected function whoWhomWhenSql() { |
49 | return " | |
50 | SELECT who.id who_id, who.display_name who_name, whom.id whom_id, whom.display_name whom_name, l.is_deleted | |
51 | FROM `{$this->db}`.log_civicrm_contact l | |
52 | JOIN civicrm_contact who ON (l.log_user_id = who.id) | |
53 | JOIN civicrm_contact whom ON (l.id = whom.id) | |
54 | WHERE log_action = 'Update' AND log_conn_id = %1 AND log_date = %2 ORDER BY log_date DESC LIMIT 1 | |
55 | "; | |
56 | } | |
96025800 | 57 | |
6a488035 | 58 | } |