-
Notifications
You must be signed in to change notification settings - Fork 0
/
membershipchurnchart.php
74 lines (66 loc) · 2.88 KB
/
membershipchurnchart.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
<?php
require_once 'membershipchurnchart.civix.php';
use CRM_Membershipchurnchart_ExtensionUtil as E;
/**
* Implements hook_civicrm_config().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
*/
function membershipchurnchart_civicrm_config(&$config) {
_membershipchurnchart_civix_civicrm_config($config);
}
/**
* Implements hook_civicrm_install().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
*/
function membershipchurnchart_civicrm_install() {
_membershipchurnchart_civix_civicrm_install();
}
/**
* Implements hook_civicrm_enable().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
*/
function membershipchurnchart_civicrm_enable() {
_membershipchurnchart_civix_civicrm_enable();
}
/**
* Implements hook_civicrm_alterLogTables().
*
* Exclude tables from logging tables since they hold data that can be regenerated automatically.
*/
function membershipchurnchart_civicrm_alterLogTables(&$logTableSpec) {
unset($logTableSpec['civicrm_membership_churn_table']);
unset($logTableSpec['civicrm_membership_churn_monthly_table']);
}
/**
* Adds a navigation menu item under report.
*/
function membershipchurnchart_civicrm_navigationMenu(&$menu) {
_membershipchurnchart_civix_insert_navigation_menu($menu, 'Memberships', [
'label' => E::ts('Membership Churn Chart'),
'name' => 'membershipchurnchart',
'url' => 'civicrm/membership/membershipchurnchart',
'permission' => 'access CiviReport',
'operator' => NULL,
'separator' => FALSE,
]);
_membershipchurnchart_civix_navigationMenu($menu);
}
function membershipchurnchart_civicrm_pageRun(&$page) {
$sPageName = $page->getVar('_name');
if ($sPageName == "CRM_Membershipchurnchart_Page_MembershipChurnChart") {
CRM_Core_Resources::singleton()
->addScriptFile('uk.co.vedaconsulting.membershipchurnchart', 'js/d3.v3.js', 110, 'html-header', FALSE)
->addScriptFile('uk.co.vedaconsulting.membershipchurnchart', 'js/dc/dc.js', 110, 'html-header', FALSE)
->addScriptFile('uk.co.vedaconsulting.membershipchurnchart', 'js/dc/crossfilter.js', 110, 'html-header', FALSE)
->addScriptFile('uk.co.vedaconsulting.membershipchurnchart', 'js/bootstrap.min.js', 110, 'html-header', FALSE)
->addScriptFile('uk.co.vedaconsulting.membershipchurnchart', 'js/bootstrap-dialog.min.js', 110, 'html-header', FALSE)
->addStyleFile('uk.co.vedaconsulting.membershipchurnchart', 'js/dc/dc.css')
->addStyleFile('uk.co.vedaconsulting.membershipchurnchart', 'css/ChurnCharts.css', 110, 'page-header')
->addStyleFile('uk.co.vedaconsulting.membershipchurnchart', 'css/bootstrap.css', 110, 'page-header')
->addStyleFile('uk.co.vedaconsulting.membershipchurnchart', 'css/sb-admin.css', 110, 'page-header')
->addStyleFile('uk.co.vedaconsulting.membershipchurnchart', 'css/font-awesome/css/font-awesome.css', 110, 'page-header');
}
}