-
Notifications
You must be signed in to change notification settings - Fork 4
/
i3val.php
114 lines (101 loc) · 3.63 KB
/
i3val.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/*-------------------------------------------------------+
| Ilja's Input Validation Extension |
| Amnesty International Vlaanderen |
| Copyright (C) 2019 SYSTOPIA |
| Author: B. Endres (endres@systopia.de) |
| http://www.systopia.de/ |
+--------------------------------------------------------+
| This program is released as free software under the |
| Affero GPL license. You can redistribute it and/or |
| modify it under the terms of this license which you |
| can read by viewing the included agpl.txt or online |
| at www.gnu.org/licenses/agpl.html. Removal of this |
| copyright header is strictly prohibited without |
| written permission from the original author(s). |
+--------------------------------------------------------*/
require_once 'i3val.civix.php';
use \Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Implements hook_civicrm_container()
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_container/
*/
function i3val_civicrm_container(ContainerBuilder $container) {
if (class_exists("Civi\I3val\ContainerSpecs")) {
$container->addCompilerPass(new Civi\I3val\ContainerSpecs());
}
}
/**
* Implements hook_civicrm_buildForm()
* to inject JS code for UI manipulations
*/
function i3val_civicrm_buildForm($formName, &$form) {
if ($formName == 'CRM_Activity_Form_Activity') {
// TODO: Implement
// CRM_I3val_Logic::adjustAcitivityView($form->_activityId, $form->_activityTypeId);
}
}
/**
* Implements hook_civicrm_config().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
*/
function i3val_civicrm_config(&$config) {
_i3val_civix_civicrm_config($config);
}
/**
* Implements hook_civicrm_install().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
*/
function i3val_civicrm_install() {
_i3val_civix_civicrm_install();
}
/**
* Implements hook_civicrm_enable().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
*/
function i3val_civicrm_enable() {
_i3val_civix_civicrm_enable();
// create the session table
$config = CRM_Core_Config::singleton();
$sqlfile = dirname(__FILE__) . '/sql/install.sql';
CRM_Utils_File::sourceSQLFile($config->dsn, $sqlfile, NULL, false);
}
/**
* Implements hook_civicrm_disable().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
*/
function i3val_civicrm_disable() {
// remove the session table
$config = CRM_Core_Config::singleton();
$sqlfile = dirname(__FILE__) . '/sql/uninstall.sql';
CRM_Utils_File::sourceSQLFile($config->dsn, $sqlfile, NULL, false);
}
/**
* Implements hook_civicrm_navigationMenu().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu
*/
function i3val_civicrm_navigationMenu(&$menu) {
_i3val_civix_insert_navigation_menu($menu, 'Contacts', array(
'label' => ts('Process Pending Update Requests', array('domain' => 'be.aivl.i3val')),
'name' => 'i3val_desktop',
'url' => 'civicrm/i3val/desktop?reset=1&restart=1',
'permission' => 'edit all contacts',
'operator' => 'OR',
'separator' => 1,
));
_i3val_civix_insert_navigation_menu($menu, 'Administer/System Settings', array(
'label' => ts('Configure I3Val', array('domain' => 'be.aivl.i3val')),
'name' => 'i3val_config',
'url' => 'civicrm/admin/i3val?reset=1',
'permission' => 'administer CiviCRM',
'operator' => 'OR',
'separator' => 1,
));
_i3val_civix_navigationMenu($menu);
}