|
1 |
| -<?php |
2 |
| -/* |
3 |
| - This file is part of the genericobject plugin. |
4 |
| -
|
5 |
| - Genericobject plugin is free software; you can redistribute it and/or modify |
6 |
| - it under the terms of the GNU General Public License as published by |
7 |
| - the Free Software Foundation; either version 2 of the License, or |
8 |
| - (at your option) any later version. |
9 |
| -
|
10 |
| - Genericobject plugin is distributed in the hope that it will be useful, |
11 |
| - but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
| - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
| - GNU General Public License for more details. |
14 |
| -
|
15 |
| - You should have received a copy of the GNU General Public License |
16 |
| - along with Genericobject. If not, see <http://www.gnu.org/licenses/>. |
17 |
| - -------------------------------------------------------------------------- |
18 |
| - @package genericobject |
19 |
| - @author the genericobject plugin team |
20 |
| - @copyright Copyright (c) 2010-2011 Order plugin team |
21 |
| - @license GPLv2+ |
22 |
| - http://www.gnu.org/licenses/gpl.txt |
23 |
| - @link https://forge.indepnet.net/projects/genericobject |
24 |
| - @link http://www.glpi-project.org/ |
25 |
| - @since 2009 |
26 |
| - ---------------------------------------------------------------------- */ |
27 |
| - |
28 |
| -include ("../../../inc/includes.php"); |
29 |
| - |
30 |
| -if (isset($_GET['itemtype']) |
31 |
| - && !isset($_GET['search']) |
32 |
| - && !isset($_GET['sort'])) { |
33 |
| - $type = new PluginGenericobjectType(); |
34 |
| - $type->getFromDBByType($_GET['itemtype']); |
35 |
| - Html::redirect(Toolbox::getItemTypeFormURL('PluginGenericobjectType').'?id='.$type->getID()); |
36 |
| - |
37 |
| -} else if (Session::haveRightsOr('plugin_genericobject_types', [READ, CREATE, UPDATE, PURGE])) { |
38 |
| - Html::header(__("Type of objects", "genericobject"), $_SERVER['PHP_SELF'], "config", |
39 |
| - "PluginGenericobjectType"); |
40 |
| - Search::Show('PluginGenericobjectType'); |
41 |
| - Html::footer(); |
42 |
| - |
43 |
| -} else { |
44 |
| - Html::redirect($CFG_GLPI['root_doc']."/front/central.php"); |
45 |
| -} |
| 1 | +<?php |
| 2 | +/* |
| 3 | + This file is part of the genericobject plugin. |
| 4 | +
|
| 5 | + Genericobject plugin is free software; you can redistribute it and/or modify |
| 6 | + it under the terms of the GNU General Public License as published by |
| 7 | + the Free Software Foundation; either version 2 of the License, or |
| 8 | + (at your option) any later version. |
| 9 | +
|
| 10 | + Genericobject plugin is distributed in the hope that it will be useful, |
| 11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + GNU General Public License for more details. |
| 14 | +
|
| 15 | + You should have received a copy of the GNU General Public License |
| 16 | + along with Genericobject. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + -------------------------------------------------------------------------- |
| 18 | + @package genericobject |
| 19 | + @author the genericobject plugin team |
| 20 | + @copyright Copyright (c) 2010-2011 Order plugin team |
| 21 | + @license GPLv2+ |
| 22 | + http://www.gnu.org/licenses/gpl.txt |
| 23 | + @link https://forge.indepnet.net/projects/genericobject |
| 24 | + @link http://www.glpi-project.org/ |
| 25 | + @since 2009 |
| 26 | + ---------------------------------------------------------------------- */ |
| 27 | + |
| 28 | +include ("../../../inc/includes.php"); |
| 29 | + |
| 30 | +if (isset($_GET['itemtype']) |
| 31 | + && !isset($_GET['search']) |
| 32 | + && !isset($_GET['sort'])) { |
| 33 | + $type = new PluginGenericobjectType(); |
| 34 | + $type->getFromDBByType($_GET['itemtype']); |
| 35 | + Html::redirect(Toolbox::getItemTypeFormURL('PluginGenericobjectType').'?id='.$type->getID()); |
| 36 | + |
| 37 | +} else if (Session::haveRightsOr('plugin_genericobject_types', [READ, CREATE, UPDATE, PURGE])) { |
| 38 | + Html::header(__("Type of objects", "genericobject"), $_SERVER['PHP_SELF'], "config", |
| 39 | + "PluginGenericobjectType"); |
| 40 | + Search::Show('PluginGenericobjectType'); |
| 41 | + Html::footer(); |
| 42 | + |
| 43 | +} else { |
| 44 | + Html::redirect($CFG_GLPI['root_doc']."/front/central.php"); |
| 45 | +} |
0 commit comments