view.form.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /*
  3. * @version $Id: view.form.php 234 2019-12-12 14:34:31Z yllen $
  4. -------------------------------------------------------------------------
  5. LICENSE
  6. This file is part of Archires plugin for GLPI.
  7. Archires is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU Affero General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11. Archires is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU Affero General Public License for more details.
  15. You should have received a copy of the GNU Affero General Public License
  16. along with Archires. If not, see <http://www.gnu.org/licenses/>.
  17. @package archires
  18. @author Nelly Mahu-Lasson, Xavier Caillaud
  19. @copyright Copyright (c) 2016-2021 Archires plugin team
  20. @license AGPL License 3.0 or (at your option) any later version
  21. http://www.gnu.org/licenses/agpl-3.0-standalone.html
  22. @link https://forge.glpi-project.org/projects/archires
  23. @since version 2.2
  24. --------------------------------------------------------------------------
  25. */
  26. include ("../../../inc/includes.php");
  27. if (!isset($_GET["id"])) {
  28. $_GET["id"] = "";
  29. }
  30. if (isset($_GET["start"])) {
  31. $start = $_GET["start"];
  32. } else {
  33. $start = 0;
  34. }
  35. $PluginArchiresView = new PluginArchiresView();
  36. if (isset($_POST["add"])) {
  37. $PluginArchiresView->check(-1, CREATE,$_POST);
  38. $PluginArchiresView->add($_POST);
  39. Html::back();
  40. } else if (isset($_POST["delete"])) {
  41. $PluginArchiresView->check($_POST['id'],DELETE);
  42. $PluginArchiresView->delete($_POST);
  43. Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresView'));
  44. } else if (isset($_POST["restore"])) {
  45. $PluginArchiresView->check($_POST['id'],PURGE);
  46. $PluginArchiresView->restore($_POST);
  47. Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresView'));
  48. } else if (isset($_POST["purge"])) {
  49. $PluginArchiresView->check($_POST['id'],PURGE);
  50. $PluginArchiresView->delete($_POST,1);
  51. Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresView'));
  52. } else if (isset($_POST["update"])) {
  53. $PluginArchiresView->check($_POST['id'],UPDATE);
  54. $PluginArchiresView->update($_POST);
  55. Html::back();
  56. } else if (isset($_POST["duplicate"])) {
  57. $PluginArchiresView->check($_POST['id'],CREATE);
  58. unset($_POST['id']);
  59. $PluginArchiresView->add($_POST);
  60. Html::back();
  61. } else {
  62. $PluginArchiresView->checkGlobal(READ);
  63. Html::header(PluginArchiresView::getTypeName(),'',"tools","pluginarchiresmenu","view");
  64. $PluginArchiresView->display($_GET);
  65. Html::footer();
  66. }