-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatisticscalc.php
62 lines (56 loc) · 2 KB
/
statisticscalc.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
<?php
/*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
require_once 'statisticscalc.civix.php';
use CRM_Statisticscalc_ExtensionUtil as E;
/**
* Implements hook_civicrm_config().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
*/
function statisticscalc_civicrm_config(&$config) {
if (isset(Civi::$statics[__FUNCTION__])) {
return;
}
Civi::$statics[__FUNCTION__] = 1;
Civi::dispatcher()->addListener('hook_civicrm_postCommit', 'CRM_Statistics_ActivityNumericalScores::callbackPostCalculateActivityScores');
Civi::dispatcher()->addListener('hook_civicrm_caseChange', 'CRM_Statistics_CaseStatistics::hookCaseChangeCalculateScores');
_statisticscalc_civix_civicrm_config($config);
}
/**
* Implements hook_civicrm_install().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
*/
function statisticscalc_civicrm_install() {
_statisticscalc_civix_civicrm_install();
}
/**
* Implements hook_civicrm_enable().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
*/
function statisticscalc_civicrm_enable() {
_statisticscalc_civix_civicrm_enable();
}
/**
* Implements hook_civicrm_alterLogTables().
*
* Exclude firewall tables from logging tables since they hold mostly temp data.
*/
function statisticscalc_civicrm_alterLogTables(&$logTableSpec) {
$tablePrefix = 'civicrm_statistics_';
$len = strlen($tablePrefix);
foreach ($logTableSpec as $key => $val) {
if (substr($key, 0, $len) === $tablePrefix) {
unset($logTableSpec[$key]);
}
}
}