glpi-plugin-auf : ajout rapport parc physique
[auf-serveur.git] / glpi-plugin-auf / plugin / setup.php
1 <?php
2 /*
3 AUF plugin for GLPI
4 Copyright (C) 2014 AUF -- www.auf.org
5 */
6
7 // Init the hooks of the plugins -Needed
8 function plugin_init_auf() {
9 global $PLUGIN_HOOKS;
10
11 $PLUGIN_HOOKS['csrf_compliant']['auf'] = TRUE;
12
13 $Plugin = new Plugin();
14 if ($Plugin->isActivated('auf')) { // check if plugin is active
15 if (Session::getLoginUserID()) {
16 $PLUGIN_HOOKS['add_css']['auf'] = "auf.css";
17 }
18 if (isset($_SESSION["glpiname"])) {
19 $report_list = array();
20 if (Session::haveRight("computer", "r")) {
21 $report_list["report.operatingsystems.php"] = "Systèmes d'exploitation par implantation";
22 $report_list["report.computers.php"] = "Ordinateurs par implantation";
23 // $report_list["report.wip.php"] = 'WIP (rapport en cours de développement)';
24 }
25 $PLUGIN_HOOKS['reports']['auf'] = $report_list;
26 }
27 }
28 }
29
30 // Get the name and the version of the plugin - Needed
31 function plugin_version_auf() {
32 return array(
33 'name' => 'AUF',
34 'version' => '0.2.0',
35 'author' => 'Jean Christophe André',
36 'license' => 'GPLv2+',
37 'homepage' => 'http://git.auf.org/?p=glpi',
38 'minGlpiVersion' => '0.84');// For compatibility / no install in version < 0.80
39 }
40
41 // Optional : check prerequisites before install : may print errors or add to message after redirect
42 function plugin_auf_check_prerequisites() {
43 if (version_compare(GLPI_VERSION,'0.84','lt') || version_compare(GLPI_VERSION,'0.85','ge')) {
44 _e('This plugin requires GLPI >= 0.84', 'auf');
45 return FALSE;
46 }
47 return TRUE;
48 }
49
50 // Uninstall process for plugin : need to return true if succeeded : may display messages or add to message after redirect
51 function plugin_auf_check_config() {
52 return TRUE;
53 }
54
55 function plugin_auf_haveRight($module,$right) {
56 return TRUE;
57 }
58 ?>