. * * ------------------------------------------------------------------------ * * This file is used to manage the modules of agents * * ------------------------------------------------------------------------ * * @package FusionInventory * @author David Durieux * @copyright Copyright (c) 2010-2016 FusionInventory team * @license AGPL License 3.0 or (at your option) any later version * http://www.gnu.org/licenses/agpl-3.0-standalone.html * @link http://www.fusioninventory.org/ * @link https://github.com/fusioninventory/fusioninventory-for-glpi * */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Manage (enable or not) the modules in the agent. */ class PluginFusioninventoryAgentmodule extends CommonDBTM { /** * The right name for this class * * @var string */ static $rightname = "plugin_fusioninventory_agent"; /** * Get the tab name used for item * * @param object $item the item object * @param integer $withtemplate 1 if is a template form * @return string name of the tab */ function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if ($item->getType()=='PluginFusioninventoryConfig') { return __('Agents modules', 'fusioninventory'); } else if ($item->getType()=='PluginFusioninventoryAgent') { return __('Agents modules', 'fusioninventory'); } return ''; } /** * Display the content of the tab * * @param object $item * @param integer $tabnum number of the tab to display * @param integer $withtemplate 1 if is a template form * @return boolean */ static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { if ($item->getType()=='PluginFusioninventoryConfig') { $pfAgentmodule = new self(); $pfAgentmodule->showForm(); return true; } else if ($item->getType()=='PluginFusioninventoryAgent') { $pfAgentmodule = new self(); $pfAgentmodule->showFormAgentException($item->fields['id']); return true; } return false; } /** * Display form to configure modules in agents * * @return boolean true if no problem */ function showForm() { $pfAgent = new PluginFusioninventoryAgent(); $a_modules = $this->find(); foreach ($a_modules as $data) { echo "