示例#1
0
 static function getFamilyNameByItemtype($itemtype)
 {
     $types = getAllDatasFromTable("glpi_plugin_genericobject_types", "`itemtype`='{$itemtype}' AND `is_active`='1'");
     if (empty($types)) {
         return false;
     } else {
         $type = array_pop($types);
         if ($type['plugin_genericobject_typefamilies_id'] > 0) {
             $family = new PluginGenericobjectTypeFamily();
             $family->getFromDB($type['plugin_genericobject_typefamilies_id']);
             return $family->getName();
         } else {
             return false;
         }
     }
 }
示例#2
0
 @author    the genericobject plugin team
 @copyright Copyright (c) 2010-2011 Order plugin team
 @license   GPLv2+
            http://www.gnu.org/licenses/gpl.txt
 @link      https://forge.indepnet.net/projects/genericobject
 @link      http://www.glpi-project.org/
 @since     2009
 ---------------------------------------------------------------------- */
include '../../../inc/includes.php';
$family = new PluginGenericobjectTypeFamily();
if (!isset($_GET['id']) || !$family->getFromDB($_GET['id'])) {
    Html::header(__("Objects management", "genericobject"), $_SERVER['PHP_SELF'], "assets", "genericobject");
    echo "<table class='tab_cadre_fixe'>";
    echo "<tr class='tab_bg_2'><th>" . __("Empty family", "genericobject") . "</th></tr>";
    echo "</table>";
} else {
    $family->getFromDB($_GET['id']);
    Html::header(__("Objects management", "genericobject"), $_SERVER['PHP_SELF'], "assets", $family->getName());
    echo "<table class='tab_cadre_fixe'>";
    $types = PluginGenericobjectTypeFamily::getItemtypesByFamily($_GET['id']);
    echo "<tr class='tab_bg_2'><th>" . Dropdown::getDropdownName("glpi_plugin_genericobject_typefamilies", $_GET['id']) . "</th></tr>";
    foreach ($types as $type) {
        $itemtype = $type['itemtype'];
        echo "<tr class='tab_bg_1'><td align='center'>";
        echo "<a href='" . $itemtype::getSearchURL() . "'>";
        echo $itemtype::getTypeName();
        echo "</a></td></tr>";
    }
    echo "</table>";
}
Html::footer();