-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.php
More file actions
86 lines (74 loc) · 3.1 KB
/
setup.php
File metadata and controls
86 lines (74 loc) · 3.1 KB
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
<?php
/*
* Copyright (C) 2016 Javier Samaniego García <jsamaniegog@gmail.com>
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Init the hooks of the plugins -Needed
* @global array $PLUGIN_HOOKS
* @glpbal array $CFG_GLPI
*/
function plugin_init_linesmanager() {
global $PLUGIN_HOOKS, $CFG_GLPI;
include_once("inc/utilsetup.class.php");
Plugin::registerClass('PluginLinesmanagerConfig', array('addtabon' => 'Config'));
Plugin::registerClass('PluginLinesmanagerEntity', array('addtabon' => array('Entity')));
Plugin::registerClass('PluginLinesmanagerProfile', array('addtabon' => array('Profile')));
Plugin::registerClass('PluginLinesmanagerLine', array('addtabon' => PluginLinesmanagerUtilsetup::getAssets()));
Plugin::registerClass('PluginLinesmanagerAlgorithm');
Plugin::registerClass('PluginLinesmanagerUtilform');
// to update location and state in lines
foreach (PluginLinesmanagerUtilsetup::getAssets() as $asset) {
$PLUGIN_HOOKS['item_update']['linesmanager'][$asset] = 'plugin_post_item_update_linesmanager';
$PLUGIN_HOOKS['item_purge']['linesmanager'][$asset] = 'plugin_post_item_purge_linesmanager';
}
$PLUGIN_HOOKS['item_add']['linesmanager']['PluginLinesmanagerLine'] = 'plugin_post_item_add_linesmanager';
$PLUGIN_HOOKS['csrf_compliant']['linesmanager'] = true;
$PLUGIN_HOOKS['webservices']['linesmanager'] = 'plugin_linesmanager_registerMethods';
}
/**
* Fonction de définition de la version du plugin
* @return type
*/
function plugin_version_linesmanager() {
return array('name' => __('Lines Manager', 'linesmanager'),
'version' => '0.6.0',
'author' => 'Javier Samaniego',
'license' => 'AGPLv3+',
'homepage' => 'https://github.com/jsamaniegog/linesmanager',
'minGlpiVersion' => '10.0');
}
/**
* Fonction de vérification des prérequis
* @return boolean
*/
function plugin_linesmanager_check_prerequisites() {
if (version_compare(GLPI_VERSION, '10.0.0', 'lt')) {
echo __('This plugin requires GLPI >= 10.0.0', 'linesmanager');
return false;
}
return true;
}
/**
* Fonction de vérification de la configuration initiale
* Uninstall process for plugin : need to return true if succeeded
* may display messages or add to message after redirect.
* @param type $verbose
* @return boolean
*/
function plugin_linesmanager_check_config($verbose = false) {
return true;
}
?>