function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if ($item->getType() == 'Profile' && $item->getField('interface') != 'helpdesk') { return PluginRacksRack::getTypeName(2); } return ''; }
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if (!$withtemplate) { if ($item->getType() == 'PluginRacksRack' && count(PluginRacksRack::getTypes(false))) { $ong = array(); if ($_SESSION['glpishow_count_on_tabs']) { $ong[1] = self::createTabEntry(__('Front', 'racks'), self::countForRack($item, PluginRacksRack::FRONT_FACE)); } else { $ong[1] = __('Front', 'racks'); } if ($_SESSION['glpishow_count_on_tabs']) { $ong[2] = self::createTabEntry(_x('Rack enclosure', 'Back', 'racks'), self::countForRack($item, PluginRacksRack::BACK_FACE)); } else { $ong[2] = _x('Rack enclosure', 'Back', 'racks'); } return $ong; } elseif (in_array($item->getType(), PluginRacksRack::getTypes(true)) && $this->canView()) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(PluginRacksRack::getTypeName(2), self::countForItem($item)); } return PluginRacksRack::getTypeName(2); } } return ''; }
https://forge.indepnet.net/projects/racks ------------------------------------------------------------------------- LICENSE This file is part of Racks. Racks is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Racks 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. You should have received a copy of the GNU General Public License along with Racks. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include '../../../inc/includes.php'; Html::header(PluginRacksRack::getTypeName(2), '', "assets", "pluginracksmenu", "racks"); $PluginRacksRack = new PluginRacksRack(); if ($PluginRacksRack->canView() || Config::canCreate()) { Search::show("PluginRacksRack"); } else { Html::displayRightError(); } Html::footer();
Racks is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Racks 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. You should have received a copy of the GNU General Public License along with Racks. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include '../../../inc/includes.php'; Html::header(PluginRacksRack::getTypeName(2), '', "assets", "pluginracksmenu", "specifications"); $central = new PluginRacksItemSpecificationCentral(); $central->display(); Html::footer(); //$itemSpecificationCentral->checkGlobal(READ); /* if (!isset($_SESSION['glpi_plugin_racks_tab'])) { $_SESSION['glpi_plugin_racks_tab'] = 'ComputerModel'; } if (isset($_GET['onglet'])) { $_SESSION['glpi_plugin_racks_tab'] = $_GET['onglet']; } $tabs['ComputerModel'] = array('title' => __('Servers', 'racks'), 'url' => $CFG_GLPI['root_doc']."/plugins/racks/ajax/itemspecification.tabs.php", 'params' => "target=".$_SERVER['PHP_SELF']."&id=-1&plugin_racks_tab=".'ComputerModel');
(at your option) any later version. Racks 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. You should have received a copy of the GNU General Public License along with Racks. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include '../../../inc/includes.php'; Session::checkRight("config", "w"); $plugin = new Plugin(); if ($plugin->isActivated("racks")) { $PluginRacksConfig = new PluginRacksConfig(); if (isset($_POST["update"])) { Session::checkRight("config", "w"); $PluginRacksConfig->update($_POST); Html::back(); } else { Html::header(PluginRacksRack::getTypeName(2), '', "plugins", "racks"); $PluginRacksConfig->showForm($CFG_GLPI["root_doc"] . "/plugins/racks/front/config.form.php"); Html::footer(); } } else { Html::header(__('Setup'), '', "config", "plugins"); echo "<div align='center'><br><br>"; echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\" alt=\"warning\"><br><br>"; echo "<b>" . __('Please activate the plugin', 'racks') . "</b></div>"; }
function plugin_racks_AssignToTicket($types) { if (Session::haveRight("plugin_racks_open_ticket", "1")) { $types['PluginRacksRack'] = PluginRacksRack::getTypeName(2); } return $types; }