-
Notifications
You must be signed in to change notification settings - Fork 4
/
hook.php
130 lines (106 loc) · 3.63 KB
/
hook.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
/*
-------------------------------------------------------------------------
DPO Register plugin for GLPI
Copyright (C) 2018 by the DPO Register Development Team.
https://github.com/karhel/glpi-dporegister
-------------------------------------------------------------------------
LICENSE
This file is part of DPO Register.
DPO Register is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DPO Register is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DPO Register. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package dporegister
@author Karhel Tmarr
@copyright Copyright (c) 2010-2013 Uninstall plugin team
@license GPLv3+
http://www.gnu.org/licenses/gpl.txt
@link https://github.com/karhel/glpi-dporegister
@since 2018
--------------------------------------------------------------------------
*/
function plugin_dporegister_classes()
{
return [
'Profile',
'Processing',
'Processing_Software',
'PersonalDataCategory',
'Processing_PersonalDataCategory',
'IndividualsCategory',
'Processing_IndividualsCategory',
'SecurityMesure',
'Processing_SecurityMesure',
'Representative',
'LawfulBasisModel',
'CommonProcessingActor',
'Processing_User',
'Processing_Supplier'
];
}
/**
* Plugin install process
*
* @return boolean
*/
function plugin_dporegister_install()
{
$migration = new Migration(PLUGIN_DPOREGISTER_VERSION);
$classesToInstall = plugin_dporegister_classes();
foreach ($classesToInstall as $className) {
require_once('inc/' . strtolower($className) . '.class.php');
$fullclassname = 'PluginDporegister' . $className;
$fullclassname::install($migration, PLUGIN_DPOREGISTER_VERSION);
}
return true;
}
/**
* Plugin uninstall process
*
* @return boolean
*/
function plugin_dporegister_uninstall()
{
$classesToUninstall = plugin_dporegister_classes();
foreach ($classesToUninstall as $className) {
require_once('inc/' . strtolower($className) . '.class.php');
$fullclassname = 'PluginDporegister' . $className;
$fullclassname::uninstall();
}
return true;
}
/**
* Define Dropdown tables to be manage in GLPI
*
* @return array
*/
function plugin_dporegister_getDropdown()
{
// Table => Name
return [
PluginDporegisterLawfulBasisModel::class => PluginDporegisterLawfulBasisModel::getTypeName(2),
PluginDporegisterPersonalDataCategory::class => PluginDporegisterPersonalDataCategory::getTypeName(2),
PluginDporegisterIndividualsCategory::class => PluginDporegisterIndividualsCategory::getTypeName(2),
PluginDporegisterSecurityMesure::class => PluginDporegisterSecurityMesure::getTypeName(2)
];
}
/**
* Define Additionnal search options for types (other than the plugin ones)
*/
function plugin_dporegister_getAddSearchOptions($itemtype)
{
$options = [];
if ($itemtype == 'Entity') {
// Get the search options from representative class
$options = PluginDporegisterRepresentative::getSearchOptionsRepresentatives();
}
return $options;
}