Exemplo n.º 1
0
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     global $CFG_GLPI;
     if (PluginSimcardSimcard::canView()) {
         switch ($item->getType()) {
             case 'PluginSimcardSimcard':
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     return self::createTabEntry(_n('Associated item', 'Associated items', 2), self::countForSimcard($item));
                 }
                 return _n('Associated item', 'Associated items', 2);
             default:
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     return self::createTabEntry(PluginSimcardSimcard::getTypeName(2), self::countForItemByItemtype($item));
                 }
                 return _n('SIM card', 'SIM cards', 2);
         }
     }
     return '';
 }
Exemplo n.º 2
0
                Event::log($_POST["id"], "computers", 4, "inventory", sprintf(__('%s restores the item'), $_SESSION["glpiname"]));
            }
            html::redirect(getItemTypeSearchURL('PluginSimcardSimcard'));
        } else {
            if (isset($_REQUEST["purge"])) {
                $simcard->check($_REQUEST['id'], 'd');
                if ($simcard->delete($_REQUEST, 1)) {
                }
                Html::redirect(getItemTypeSearchURL('PluginSimcardSimcard'));
                //update a computer
            } else {
                if (isset($_POST["update"])) {
                    $simcard->check($_POST['id'], 'w');
                    $simcard->update($_POST);
                    Html::back();
                } else {
                    if (isset($_GET["unglobalize"])) {
                        $simcard->check($_GET["id"], 'w');
                        Html::redirect(getItemTypeFormURL('PluginSimcardSimcard') . "?id=" . $_GET["id"]);
                    } else {
                        //print computer information
                        Html::header(PluginSimcardSimcard::getTypeName(2), $_SERVER['PHP_SELF'], "plugins", "simcard", "simcard");
                        //show computer form to add
                        $simcard->showForm($_GET["id"], $_GET);
                        html::footer();
                    }
                }
            }
        }
    }
}
Exemplo n.º 3
0
            if (isset($_REQUEST["purge"])) {
                $simcard->check($_REQUEST['id'], PURGE);
                if ($simcard->delete($_REQUEST, 1)) {
                    Event::log($_POST["id"], "simcard", 4, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
                }
                $simcard->redirectToList();
                //update a simcard
            } else {
                if (isset($_POST["update"])) {
                    $simcard->check($_POST['id'], UPDATE);
                    $simcard->update($_POST);
                    Event::log($_POST["id"], "simcard", 4, "inventory", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
                    Html::back();
                } else {
                    if (isset($_GET["unglobalize"])) {
                        $simcard->check($_GET["id"], UPDATE);
                        //TODO There is probably a bug here...
                        Html::redirect(Toolbox::getItemTypeFormURL('PluginSimcardSimcard') . "?id=" . $_GET["id"]);
                    } else {
                        //print simcard information
                        // Affichage du fil d'Ariane
                        Html::header(PluginSimcardSimcard::getTypeName(2), '', "assets", "pluginsimcardsimcard", "simcard");
                        //show simcard form to add
                        $simcard->display(array('id' => $_GET["id"], 'withtemplate' => $_GET["withtemplate"]));
                        html::footer();
                    }
                }
            }
        }
    }
}
Exemplo n.º 4
0
 function getAllRights()
 {
     $rights = array(array('itemtype' => 'PluginSimcardSimcard', 'label' => PluginSimcardSimcard::getTypeName(2), 'field' => 'simcard:simcard'));
     return $rights;
 }