. * ------------------------------------------------------------------------- * @copyright Copyright (C) 2009-2022 by GenericObject plugin team. * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html * @link https://github.com/pluginsGLPI/genericobject * ------------------------------------------------------------------------- */ class PluginGenericobjectProfile extends Profile { /* if profile deleted */ function cleanProfiles($id) { $this->deleteByCriteria(['id' => $id]); } function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { switch ($item->getType()) { case 'Profile': return self::createTabEntry(__('Objects management', 'genericobject')); break; case 'PluginGenericobjectType': return self::createTabEntry(_n('Profile', 'Profiles', 2)); break; } } static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { switch ($item->getType()) { case 'Profile': $profile = new self(); $profile->showForm($item->getID()); break; case 'PluginGenericobjectType': _log($item); self::showForItemtype($item); break; } return true; } static function showForItemtype($type) { global $DB; if (!Session::haveRight("profile", READ)) { return false; } self::installRights(); $canedit = Session::haveRight("profile", UPDATE); echo "