-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogexport.php
84 lines (75 loc) · 2.32 KB
/
logexport.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
require_once 'logexport.civix.php';
use CRM_Logexport_ExtensionUtil as E;
/**
* Implements hook_civicrm_config().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
*/
function logexport_civicrm_config(&$config) {
_logexport_civix_civicrm_config($config);
}
/**
* Implements hook_civicrm_install().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
*/
function logexport_civicrm_install() {
_logexport_civix_civicrm_install();
}
/**
* Implements hook_civicrm_enable().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
*/
function logexport_civicrm_enable() {
_logexport_civix_civicrm_enable();
}
/**
* Implements hook_civicrm_export().
*
* Declare entity types provided by this module.
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_export/
*/
function logexport_civicrm_export(&$exportTempTable, &$headerRows, &$sqlColumns, &$exportMode, &$componentTable, &$ids) {
$form = new CRM_Core_Form();
$fileName = CRM_Core_Error::createDebugLogger('Export_Log');
$exportTypes = [
1 => 'Contact',
2 => 'Contribute',
3 => 'Membership',
4 => 'Event',
5 => 'Pledge',
6 => 'Case',
7 => 'Grant',
8 => 'Activity',
];
$printExportMode = $exportTypes[$exportMode];
$printHeaderRows = json_encode($headerRows);
$printIds = json_encode($ids);
$fileName->log("User {$form->getLoggedInUserContactID()} Just did an export of type {$printExportMode} with the following Header Rows {$printHeaderRows} involving the following IDs {$printIds}");
}
// --- Functions below this ship commented out. Uncomment as required. ---
/**
* Implements hook_civicrm_preProcess().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_preProcess
*
// */
/**
* Implements hook_civicrm_navigationMenu().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu
*
function logexport_civicrm_navigationMenu(&$menu) {
_logexport_civix_insert_navigation_menu($menu, 'Mailings', array(
'label' => E::ts('New subliminal message'),
'name' => 'mailing_subliminal_message',
'url' => 'civicrm/mailing/subliminal',
'permission' => 'access CiviMail',
'operator' => 'OR',
'separator' => 0,
));
_logexport_civix_navigationMenu($menu);
} // */