static function showForConfig($id) { global $CFG_GLPI, $DB; $config = new PluginGeninventorynumberConfig(); $config->getFromDB($id); $target = Toolbox::getItemTypeFormUrl(__CLASS__); echo "<form name='form_core_config' method='post' action=\"{$target}\">"; echo "<div align='center'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='5'>" . __('PerDeviceTypeConfiguration', 'geninventorynumber') . "</th></tr>"; echo "<input type='hidden' name='id' value='{$id}'>"; echo "<input type='hidden' name='entities_id' value='0'>"; echo "<tr><th colspan='2'>" . __('GenerationModel', 'geninventorynumber'); echo "</th><th>" . __('Active') . "</th>"; echo "<th>" . __('UseGlobalIndex', 'geninventorynumber') . "</th>"; echo "<th colspan='2'>" . __('IndexPosition', 'geninventorynumber') . "</th></tr>"; foreach (getAllDatasFromTable(getTableForItemType(__CLASS__)) as $value) { $itemtype = $value['itemtype']; echo "<td class='tab_bg_1' align='center'>" . call_user_func(array($itemtype, 'getTypeName')) . "</td>"; echo "<td class='tab_bg_1'>"; echo "<input type='hidden' name='ids[{$itemtype}][id]' value='" . $value["id"] . "'>"; echo "<input type='hidden' name='ids[{$itemtype}][itemtype]' value='{$itemtype}'>"; echo "<input type='text' name='ids[{$itemtype}][template]' value=\"" . $value["template"] . "\">"; echo "</td>"; echo "<td class='tab_bg_1' align='center'>"; Dropdown::showYesNo("ids[{$itemtype}][is_active]", $value["is_active"]); echo "</td>"; echo "<td class='tab_bg_1' align='center'>"; Dropdown::showYesNo("ids[{$itemtype}][use_index]", $value["use_index"]); echo "</td>"; echo "<td class='tab_bg_1' align='center'>"; if ($value["is_active"] && !$value["use_index"]) { echo "<input type='text' name='ids[{$itemtype}][index]' value='" . $value['index'] . "' size='12'>"; } echo "</td>"; echo "</tr>"; } echo "<tr class='tab_bg_1'><td align='center' colspan='5'>"; echo "<input type='submit' name='update_fields' value=\"" . _sx('button', 'Save') . "\" class='submit'>"; echo "</td></tr>"; echo "</table>"; Html::closeForm(); }
geninventorynumber plugin 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. This file is part of geninventorynumber plugin. You should have received a copy of the GNU General Public License along with GLPI; along with geninventorynumber. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- @package geninventorynumber @author the geninventorynumber plugin team @copyright Copyright (c) 2008-2013 geninventorynumber plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt @link https://forge.indepnet.net/projects/geninventorynumber @link http://www.glpi-project.org/ @since 2008 ---------------------------------------------------------------------- */ include '../../../inc/includes.php'; $config = new PluginGeninventorynumberConfig(); $plugin = new Plugin(); $config->getFromDB(1); if ($plugin->isInstalled("geninventorynumber") && $plugin->isActivated("geninventorynumber")) { Html::header(__('geninventorynumber', 'geninventorynumber'), $_SERVER['PHP_SELF'], "tools", "plugins", "geninventorynumber"); if (isset($_GET['glpi_tab'])) { $_SESSION['glpi_tabs']['plugingeninventorynumberconfig'] = $_GET['glpi_tab']; Html::redirect(Toolbox::getItemTypeFormURL($config->getType())); } $config->addDivForTabs(); Html::footer(); }