|
| 1 | +<?php |
| 2 | +/* |
| 3 | + ------------------------------------------------------------------------- |
| 4 | + autoexportsearches plugin for GLPI |
| 5 | + Copyright (C) 2020-2025 by the autoexportsearches Development Team. |
| 6 | +
|
| 7 | + https://github.com/InfotelGLPI/autoexportsearches |
| 8 | + ------------------------------------------------------------------------- |
| 9 | +
|
| 10 | + LICENSE |
| 11 | +
|
| 12 | + This file is part of autoexportsearches. |
| 13 | +
|
| 14 | + autoexportsearches is free software; you can redistribute it and/or modify |
| 15 | + it under the terms of the GNU General Public License as published by |
| 16 | + the Free Software Foundation; either version 2 of the License, or |
| 17 | + (at your option) any later version. |
| 18 | +
|
| 19 | + autoexportsearches is distributed in the hope that it will be useful, |
| 20 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | + GNU General Public License for more details. |
| 23 | +
|
| 24 | + You should have received a copy of the GNU General Public License |
| 25 | + along with autoexportsearches. If not, see <http://www.gnu.org/licenses/>. |
| 26 | + -------------------------------------------------------------------------- |
| 27 | + */ |
| 28 | + |
| 29 | +namespace GlpiPlugin\Autoexportsearches; |
| 30 | + |
| 31 | +use CommonDBTM; |
| 32 | +use Html; |
| 33 | +use Toolbox; |
| 34 | + |
| 35 | +if (!defined('GLPI_ROOT')) { |
| 36 | + die("Sorry. You can't access directly to this file"); |
| 37 | +} |
| 38 | + |
| 39 | +class Config extends CommonDBTM |
| 40 | +{ |
| 41 | + |
| 42 | + static $rightname = 'plugin_autoexportsearches_configs'; |
| 43 | + |
| 44 | + /** |
| 45 | + * Show form |
| 46 | + * |
| 47 | + * @return boolean |
| 48 | + */ |
| 49 | + function showConfigForm() |
| 50 | + { |
| 51 | + |
| 52 | + if (!$this->canView() && !$this->canUpdate()) { |
| 53 | + return false; |
| 54 | + } |
| 55 | + |
| 56 | + if (! $this->getFromDB(1)) { |
| 57 | + $this->getEmpty(); |
| 58 | + } |
| 59 | + |
| 60 | + echo "<form name='form' method='post' action='" . Toolbox::getItemTypeFormURL(Config::class) . "'>"; |
| 61 | + echo "<div class='center'><table class='tab_cadre_fixe'>"; |
| 62 | + echo "<tr><th colspan='2'>" . __('Setup') . "</th></tr>"; |
| 63 | + |
| 64 | + echo "<tr class='tab_bg_1'>"; |
| 65 | + echo "<td>" . __('Number of months before purge files', 'autoexportsearches') . "</td>"; |
| 66 | + echo "<td>"; |
| 67 | + echo Html::input('monthBeforePurge', ['value' => $this->fields['monthBeforePurge'], 'size' => 6]); |
| 68 | + echo "</td>"; |
| 69 | + echo "</tr>"; |
| 70 | + |
| 71 | + echo "<tr><td class='tab_bg_2 center' colspan='2'>"; |
| 72 | + echo Html::submit(_sx('button', 'Save'), ['name' => 'update', 'class' => 'btn btn-primary']); |
| 73 | + echo "</td></tr>"; |
| 74 | + |
| 75 | + echo "</table></div>"; |
| 76 | + Html::closeForm(); |
| 77 | + |
| 78 | + return true; |
| 79 | + } |
| 80 | +} |
0 commit comments