. @package archires @author Nelly Mahu-Lasson, Xavier Caillaud @copyright Copyright (c) 2016-2021 Archires plugin team @license AGPL License 3.0 or (at your option) any later version http://www.gnu.org/licenses/agpl-3.0-standalone.html @link https://forge.glpi-project.org/projects/archires @since version 2.2 -------------------------------------------------------------------------- */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class PluginArchiresArchires extends CommonDBTM { static $rightname = "plugin_archires"; protected $usenotepad = true; static function getTypeName($nb=0) { return _n('Network Architecture', 'Network Architectures', $nb, 'archires'); } static function showSummary() { $dbu = new DbUtils(); echo "
"; echo ""; if ($dbu->countElementsInTable('glpi_plugin_archires_views', ['entities_id' => $_SESSION["glpiactive_entity"]]) > 0) { echo ""; echo ""; echo ""; $plugin = new Plugin(); if ($plugin->isActivated("appliances")) { echo ""; } } else { echo ""; } echo "
".__('Summary')."
"; echo "".PluginArchiresView::getTypeName(2).""; echo "
"; echo "". sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginArchiresLocationQuery::getTypeName(1)).""; echo "
"; echo "". sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginArchiresNetworkEquipmentQuery::getTypeName(1)).""; echo "
"; echo "". sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginAppliancesAppliance::getTypeName(1)).""; echo "
"; echo "".__('Add view', 'archires').""; echo "
"; } function showAllItems($myname, $value_type=0, $value=0, $entity_restrict=-1) { global $DB,$CFG_GLPI; $types = ['Computer','NetworkEquipment','Peripheral','Phone','Printer']; $rand = mt_rand(); foreach ($types as $label) { $item = new $label(); $params[$label] = $item->getTypeName(); } Dropdown::showFromArray('_itemtype', $params, ['width' => '80%', 'rand' => $rand, 'display_emptychoice' => true]); $field_id = Html::cleanId("dropdown__itemtype$rand"); $params = ['itemtype' => '__VALUE__', 'value' => $value, 'myname' => $myname, 'entity' => $entity_restrict]; echo " \n"; Ajax::updateItemOnSelectEvent($field_id, "show_$myname$rand", Plugin::getWebDir('archires')."/ajax/dropdownAllItems.php", $params); return $rand; } }