function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if ($item->getType() == 'Profile' && $item->getField('interface') != 'helpdesk') {
         return PluginRacksRack::getTypeName(2);
     }
     return '';
 }
Exemple #2
0
function plugin_init_racks()
{
    global $PLUGIN_HOOKS, $CFG_GLPI;
    $PLUGIN_HOOKS['csrf_compliant']['racks'] = true;
    //load changeprofile function
    $PLUGIN_HOOKS['change_profile']['racks'] = array('PluginRacksProfile', 'initProfile');
    $plugin = new Plugin();
    if ($plugin->isInstalled('racks') && $plugin->isActivated('racks')) {
        //Ability to add a rack to a project
        $CFG_GLPI["project_asset_types"][] = 'PluginRacksRack';
        $PLUGIN_HOOKS['assign_to_ticket']['racks'] = true;
        Plugin::registerClass('PluginRacksRack', array('document_types' => true, 'location_types' => true, 'unicity_types' => true, 'linkgroup_tech_types' => true, 'linkuser_tech_types' => true, 'infocom_types' => true, 'ticket_types' => true));
        Plugin::registerClass('PluginRacksProfile', array('addtabon' => 'Profile'));
        $types = array('PluginAppliancesAppliance', 'PluginManufacturersimportsConfig', 'PluginTreeviewConfig', 'PluginPositionsPosition');
        foreach ($types as $itemtype) {
            if (class_exists($itemtype)) {
                $itemtype::registerType('PluginRacksRack');
            }
        }
        //If treeview plugin is installed, add rack as a type of item
        //that can be shown in the tree
        if (class_exists('PluginTreeviewConfig')) {
            $PLUGIN_HOOKS['treeview']['PluginRacksRack'] = '../racks/pics/racks.png';
        }
        if (Session::getLoginUserID()) {
            include_once GLPI_ROOT . "/plugins/racks/inc/rack.class.php";
            if (PluginRacksRack::canView()) {
                //Display menu entry only if user has right to see it !
                $PLUGIN_HOOKS["menu_toadd"]['racks'] = array('assets' => 'PluginRacksMenu');
                $PLUGIN_HOOKS['use_massive_action']['racks'] = 1;
            }
            if (PluginRacksRack::canCreate() || Config::canUpdate()) {
                $PLUGIN_HOOKS['config_page']['racks'] = 'front/config.form.php';
            }
            $PLUGIN_HOOKS['add_css']['racks'] = "racks.css";
            $PLUGIN_HOOKS['post_init']['racks'] = 'plugin_racks_postinit';
            $PLUGIN_HOOKS['reports']['racks'] = array('front/report.php' => __("Report - Bays management", "racks"));
        }
    }
}
 static function getMenuContent()
 {
     global $CFG_GLPI;
     $menu = array();
     //Menu entry in tools
     $menu['title'] = self::getMenuName(2);
     $menu['page'] = PluginRacksRack::getSearchURL(false);
     $menu['links']['search'] = PluginRacksRack::getSearchURL(false);
     $menu['options']['racks']['links']['search'] = PluginRacksRack::getSearchURL(false);
     $menu['options']['racks']['links']['config'] = PluginRacksConfig::getFormURL(false);
     $menu['options']['config']['title'] = __('Setup');
     $menu['options']['config']['page'] = PluginRacksConfig::getSearchURL(false);
     $menu['options']['specifications']['title'] = __('Specifications', 'racks');
     $menu['options']['specifications']['page'] = PluginRacksItemSpecification::getSearchURL(false);
     $menu['options']['specifications']['links']['search'] = PluginRacksItemSpecification::getSearchURL(false);
     if (PluginRacksRack::canCreate()) {
         $menu['options']['racks']['links']['add'] = PluginRacksRack::getFormURL(false);
     }
     if (PluginRacksRackModel::canView()) {
         $menu['options']['racks']['links']['template'] = '/plugins/racks/front/setup.templates.php?add=0';
         $menu['options']['racks']['links']["<img  src='" . $CFG_GLPI["root_doc"] . "/pics/menu_showall.png' title=\"" . __('Equipments models specifications', 'racks') . "\" alt=\"" . __('Equipments models specifications', 'racks') . "\">"] = PluginRacksItemSpecification::getSearchURL(false);
     }
     return $menu;
 }
https://forge.indepnet.net/projects/racks
-------------------------------------------------------------------------

LICENSE
               
This file is part of Racks.

Racks is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Racks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginRacksRack::getTypeName(2), '', "assets", "pluginracksmenu", "racks");
$PluginRacksRack = new PluginRacksRack();
if ($PluginRacksRack->canView() || Config::canCreate()) {
    Search::show("PluginRacksRack");
} else {
    Html::displayRightError();
}
Html::footer();
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$PluginRacksRack = new PluginRacksRack();
$PluginRacksOther = new PluginRacksOther();
$PluginRacksRack_Item = new PluginRacksRack_Item();
if (isset($_POST["add"])) {
    $PluginRacksRack->check(-1, CREATE, $_POST);
    $PluginRacksRack->add($_POST);
    Html::back();
} elseif (isset($_POST["delete"])) {
    $PluginRacksRack->check($_POST['id'], DELETE);
    $PluginRacksRack->delete($_POST);
    $PluginRacksRack->redirectToList();
} elseif (isset($_POST["restore"])) {
    $PluginRacksRack->check($_POST['id'], PURGE);
    $PluginRacksRack->restore($_POST);
    $PluginRacksRack->redirectToList();
} else {
Exemple #6
0
Racks is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Racks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginRacksRack::getTypeName(2), '', "assets", "pluginracksmenu", "specifications");
$central = new PluginRacksItemSpecificationCentral();
$central->display();
Html::footer();
//$itemSpecificationCentral->checkGlobal(READ);
/*
if (!isset($_SESSION['glpi_plugin_racks_tab'])) {
   $_SESSION['glpi_plugin_racks_tab'] = 'ComputerModel';
}
if (isset($_GET['onglet'])) {
  $_SESSION['glpi_plugin_racks_tab'] = $_GET['onglet'];
}

$tabs['ComputerModel'] = array('title'  => __('Servers', 'racks'),
                               'url'    => $CFG_GLPI['root_doc']."/plugins/racks/ajax/itemspecification.tabs.php",
                               'params' => "target=".$_SERVER['PHP_SELF']."&id=-1&plugin_racks_tab=".'ComputerModel');
 /**
  * Show rack associated to an item
  *
  * @since version 0.84
  *
  * @param $item            CommonDBTM object for which associated rack must be displayed
  * @param $withtemplate    (default '')
  **/
 static function showForItem(CommonDBTM $item, $withtemplate = '')
 {
     global $DB, $CFG_GLPI;
     $ID = $item->getField('id');
     if ($item->isNewID($ID) || !self::canView() || !$item->can($item->fields['id'], READ)) {
         return false;
     }
     if (empty($withtemplate)) {
         $withtemplate = 0;
     }
     $canedit = $item->canadditem('PluginRacksRack');
     $rand = mt_rand();
     $is_recursive = $item->isRecursive();
     $itemtype = $item->getType() . "Model";
     $query = "SELECT `glpi_plugin_racks_racks_items`.`id` AS assocID,\n                       `glpi_plugin_racks_racks_items`.`faces_id`,\n                       `glpi_plugin_racks_racks_items`.`position`,\n                       `glpi_entities`.`id` AS entity,\n                       `glpi_plugin_racks_racks`.`name` AS assocName,\n                       `glpi_plugin_racks_racks`.*\n                FROM `glpi_plugin_racks_racks_items`\n                LEFT JOIN `glpi_plugin_racks_racks`\n                 ON (`glpi_plugin_racks_racks_items`.`plugin_racks_racks_id`=`glpi_plugin_racks_racks`.`id`)\n                LEFT JOIN `glpi_entities` ON (`glpi_plugin_racks_racks`.`entities_id`=`glpi_entities`.`id`)\n                WHERE `glpi_plugin_racks_racks_items`.`items_id` = '{$ID}'\n                      AND `glpi_plugin_racks_racks_items`.`itemtype` = '" . $itemtype . "' ";
     $query .= getEntitiesRestrictRequest(" AND", "glpi_plugin_racks_racks", '', '', true);
     $query .= " ORDER BY `assocName`";
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     $i = 0;
     $racks = array();
     $rack = new PluginRacksRack();
     $used = array();
     if ($numrows = $DB->numrows($result)) {
         while ($data = $DB->fetch_assoc($result)) {
             $racks[$data['assocID']] = $data;
             $used[$data['id']] = $data['id'];
         }
     }
     echo "<div class='spaced'>";
     if ($canedit && $number && $withtemplate < 2) {
         Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
         $massiveactionparams = array('num_displayed' => $number);
         Html::showMassiveActions($massiveactionparams);
     }
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr>";
     if ($canedit && $number && $withtemplate < 2) {
         echo "<th width='10'>" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand) . "</th>";
     }
     echo "<th>" . __('Name') . "</th>";
     if (Session::isMultiEntitiesMode()) {
         echo "<th>" . __('Entity') . "</th>";
     }
     echo "<th>" . __('Disposition', 'racks') . "</th>";
     echo "<th>" . __('Position', 'racks') . "</th>";
     echo "<th>" . __('Location') . "</th>";
     echo "<th>" . __('Place', 'racks') . "</th>";
     echo "<th>" . __('Manufacturer') . "</th>";
     echo "</tr>";
     $used = array();
     if ($number) {
         Session::initNavigateListItems('PluginRacksRack', sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
         foreach ($racks as $data) {
             $rackID = $data["id"];
             $link = NOT_AVAILABLE;
             if ($rack->getFromDB($rackID)) {
                 $link = $rack->getLink();
             }
             Session::addToNavigateListItems('PluginRacksRack', $rackID);
             $used[$rackID] = $rackID;
             $assocID = $data["assocID"];
             echo "<tr class='tab_bg_1" . ($data["is_deleted"] ? "_2" : "") . "'>";
             if ($canedit && $withtemplate < 2) {
                 echo "<td width='10'>";
                 Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]);
                 echo "</td>";
             }
             echo "<td class='center'>{$link}</td>";
             if (Session::isMultiEntitiesMode()) {
                 echo "<td class='center'>" . Dropdown::getDropdownName("glpi_entities", $data['entities_id']) . "</td>";
             }
             if ($data["faces_id"] == PluginRacksRack::FRONT_FACE) {
                 $faces_id = __('Front', 'racks');
             } else {
                 $faces_id = _x('Rack enclosure', 'Back', 'racks');
             }
             echo "<td class='center'>" . $faces_id . "</td>";
             echo "<td class='center'>" . $data["position"] . "</td>";
             echo "<td>" . Dropdown::getDropdownName("glpi_locations", $data["locations_id"]) . "</td>";
             echo "<td class='center'>" . Dropdown::getDropdownName("glpi_plugin_racks_roomlocations", $data["plugin_racks_roomlocations_id"], 0) . "</td>";
             echo "<td>" . Dropdown::getDropdownName("glpi_manufacturers", $data["manufacturers_id"]) . "</td>";
             echo "</tr>";
             $i++;
         }
     }
     echo "</table>";
     if ($canedit && $number && $withtemplate < 2) {
         $massiveactionparams['ontop'] = false;
         Html::showMassiveActions($massiveactionparams);
         Html::closeForm();
     }
     echo "</div>";
 }
Exemple #8
0
(at your option) any later version.

Racks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Session::checkRight("config", "w");
$plugin = new Plugin();
if ($plugin->isActivated("racks")) {
    $PluginRacksConfig = new PluginRacksConfig();
    if (isset($_POST["update"])) {
        Session::checkRight("config", "w");
        $PluginRacksConfig->update($_POST);
        Html::back();
    } else {
        Html::header(PluginRacksRack::getTypeName(2), '', "plugins", "racks");
        $PluginRacksConfig->showForm($CFG_GLPI["root_doc"] . "/plugins/racks/front/config.form.php");
        Html::footer();
    }
} else {
    Html::header(__('Setup'), '', "config", "plugins");
    echo "<div align='center'><br><br>";
    echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\" alt=\"warning\"><br><br>";
    echo "<b>" . __('Please activate the plugin', 'racks') . "</b></div>";
}
}
$where = "WHERE 1=1";
if ($item->maybeDeleted()) {
    $where .= " AND `is_deleted` = '0' ";
}
if ($item->maybeTemplate()) {
    $where .= " AND `is_template` = '0' ";
}
$NBMAX = $CFG_GLPI["dropdown_max"];
$LIMIT = "LIMIT 0,{$NBMAX}";
if ($_REQUEST['searchText'] == $CFG_GLPI["ajax_wildcard"]) {
    $LIMIT = "";
}
//why ?
$PluginRacksRack_Item = new PluginRacksRack_Item();
if (in_array(get_class($item), PluginRacksRack::getTypes())) {
    if (isset($_REQUEST['value'])) {
        $where .= "AND `" . $table . "`.`id` <> '" . $_REQUEST['value'] . "' ";
    }
    if ($item->isEntityAssign()) {
        $multi = $item->maybeRecursive();
        $field = "entities_id";
        $add_order = " entities_id, ";
        if (isset($_REQUEST["entity_restrict"]) && !($_REQUEST["entity_restrict"] < 0)) {
            $where .= getEntitiesRestrictRequest(" AND ", $table, $field, $_REQUEST["entity_restrict"]);
            if (is_array($_REQUEST["entity_restrict"]) && count($_REQUEST["entity_restrict"]) > 1) {
                $multi = true;
            }
        } else {
            $where .= getEntitiesRestrictRequest(" AND ", $table, $field);
            if (count($_SESSION['glpiactiveentities']) > 1) {
Exemple #10
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$PluginRacksRack = new PluginRacksRack();
$PluginRacksOther = new PluginRacksOther();
$PluginRacksRack_Item = new PluginRacksRack_Item();
if (isset($_POST["add"])) {
    $PluginRacksRack->check(-1, CREATE, $_POST);
    $newID = $PluginRacksRack->add($_POST);
    if ($_SESSION['glpibackcreated']) {
        Html::redirect($PluginRacksRack->getFormURL() . "?id=" . $newID);
    }
    Html::back();
} elseif (isset($_POST["delete"])) {
    $PluginRacksRack->check($_POST['id'], DELETE);
    $PluginRacksRack->delete($_POST);
    $PluginRacksRack->redirectToList();
} elseif (isset($_POST["restore"])) {
    $PluginRacksRack->check($_POST['id'], PURGE);
Exemple #11
0
function plugin_racks_getAddSearchOptions($itemtype)
{
    $sopt = array();
    if (in_array($itemtype, PluginRacksRack::getTypes(true))) {
        if (PluginRacksRack::canView()) {
            $sopt[4460]['table'] = 'glpi_plugin_racks_racks';
            $sopt[4460]['field'] = 'name';
            $sopt[4460]['name'] = _n('Rack enclosure', 'Rack enclosures', 2, 'racks') . " - " . __('Name');
            $sopt[4460]['forcegroupby'] = '1';
            $sopt[4460]['datatype'] = 'itemlink';
            $sopt[4460]['itemlink_type'] = 'PluginRacksRack';
            $sopt[4460]['massiveaction'] = false;
        }
    }
    return $sopt;
}
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Racks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Session::checkRight("config", UPDATE);
$plugin = new Plugin();
if ($plugin->isActivated("racks")) {
    $config = new PluginRacksConfig();
    if (isset($_POST["update"])) {
        $config->update($_POST);
        Html::back();
    } else {
        Html::header(PluginRacksRack::getTypeName(2), '', "assets", "pluginracksmenu", "config");
        $config->showForm();
        Html::footer();
    }
} else {
    Html::header(__('Setup'), '', "config", "plugins");
    echo "<div align='center'><br><br>";
    echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\" alt=\"warning\"><br><br>";
    echo "<b>" . __('Please activate the plugin', 'racks') . "</b></div>";
}
Exemple #13
0
 public function execQuery($post)
 {
     global $DB;
     $pRackItem = new PluginRacksRack_Item();
     $pRack = new PluginRacksRack();
     $query = "";
     $face = -1;
     if (isset($post['select_front_rear']) && $post['select_front_rear'] != 0) {
         $face = $post['select_front_rear'];
     }
     if (isset($post['plugin_racks_racks_id']) && $post['plugin_racks_racks_id'] != 0) {
         $restrictRackId = "   AND `" . $pRack->getTable() . "`.`id` = '" . $post['plugin_racks_racks_id'] . "'";
         $restrictRackId .= "   AND `" . $pRack->getTable() . "`.`id` = `" . $pRackItem->getTable() . "`.`plugin_racks_racks_id`";
         $leftjoin = ", `glpi_plugin_racks_racks_items` WHERE (1) " . $restrictRackId;
     } else {
         $restrictRackId = "";
         $leftjoin = "LEFT JOIN `glpi_plugin_racks_racks_items` ON (`glpi_plugin_racks_racks_items`.`plugin_racks_racks_id` = `glpi_plugin_racks_racks`.`id`)";
         $restrictRackId = "AND `glpi_plugin_racks_racks_items`.`plugin_racks_racks_id` = `glpi_plugin_racks_racks`.`id`";
     }
     switch ($face) {
         case PluginRacksRack::FRONT_FACE:
             $query = "SELECT `" . $pRackItem->getTable() . "`.* , `" . $pRack->getTable() . "`.*\r\n              FROM `" . $pRackItem->getTable() . "`,`glpi_plugin_racks_itemspecifications` , `" . $pRack->getTable() . "`\r\n              WHERE `" . $pRackItem->getTable() . "`.`plugin_racks_itemspecifications_id` = `glpi_plugin_racks_itemspecifications`.`id` " . $restrictRackId . " \r\n              AND (`" . $pRackItem->getTable() . "`.`faces_id` = '" . PluginRacksRack::FRONT_FACE . "' ) AND NOT `" . $pRack->getTable() . "`.`is_deleted`\r\n              ORDER BY `" . $pRack->getTable() . "`.`name` ASC, `" . $pRackItem->getTable() . "`.`faces_id` ASC, `" . $pRackItem->getTable() . "`.`position` DESC";
             break;
         case PluginRacksRack::BACK_FACE:
             $query = "SELECT `" . $pRackItem->getTable() . "`.* , `" . $pRack->getTable() . "`.*\r\n              FROM `" . $pRackItem->getTable() . "`,`glpi_plugin_racks_itemspecifications` , `" . $pRack->getTable() . "`\r\n              WHERE `" . $pRackItem->getTable() . "`.`plugin_racks_itemspecifications_id` = `glpi_plugin_racks_itemspecifications`.`id` " . $restrictRackId . " \r\n              AND (`" . $pRackItem->getTable() . "`.`faces_id` = '" . PluginRacksRack::BACK_FACE . "' ) AND NOT `" . $pRack->getTable() . "`.`is_deleted`\r\n              ORDER BY `" . $pRack->getTable() . "`.`name` ASC, `" . $pRackItem->getTable() . "`.`faces_id` ASC, `" . $pRackItem->getTable() . "`.`position` DESC";
             break;
         default:
             $query = "SELECT `" . $pRackItem->getTable() . "`.* , `" . $pRack->getTable() . "`.*\r\n              FROM  `" . $pRack->getTable() . "`\r\n              {$leftjoin}\r\n              AND NOT `" . $pRack->getTable() . "`.`is_deleted`\r\n              ORDER BY `" . $pRack->getTable() . "`.`name` ASC, `" . $pRackItem->getTable() . "`.`faces_id` ASC, `" . $pRackItem->getTable() . "`.`position` DESC";
             break;
     }
     $ret = array("query" => $query, "query_result" => $DB->query($query));
     return $ret;
 }
Racks plugin for GLPI
Copyright (C) 2003-2011 by the Racks Development Team.

https://forge.indepnet.net/projects/racks
-------------------------------------------------------------------------

LICENSE
		
This file is part of Racks.

Racks is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Racks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginRacksRack::getTypeName(2), '', "plugins", "racks");
$PluginRacksRack = new PluginRacksRack();
if ($PluginRacksRack->canView() || Session::haveRight("config", "w")) {
    PluginRacksRack::listTemplates('PluginRacksRack', $CFG_GLPI["root_doc"] . "/plugins/racks/front/rack.form.php", $_GET["add"]);
}
Html::footer();
Exemple #15
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$PluginRacksRack = new PluginRacksRack();
$PluginRacksOther = new PluginRacksOther();
$PluginRacksRack_Item = new PluginRacksRack_Item();
if (isset($_POST["add"])) {
    $PluginRacksRack->check(-1, 'w', $_POST);
    $newID = $PluginRacksRack->add($_POST);
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $PluginRacksRack->check($_POST['id'], 'w');
        $PluginRacksRack->delete($_POST);
        $PluginRacksRack->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $PluginRacksRack->check($_POST['id'], 'w');
            $PluginRacksRack->restore($_POST);
-------------------------------------------------------------------------
Racks plugin for GLPI
Copyright (C) 2003-2011 by the Racks Development Team.

https://forge.indepnet.net/projects/racks
-------------------------------------------------------------------------

LICENSE
		
This file is part of Racks.

Racks is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Racks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Racks. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginRacksRack::getTypeName(2), '', "assets", "pluginracksmenu", "racks");
if (PluginRacksRack::canView() || Config::canCreate()) {
    PluginRacksRack::listTemplates('PluginRacksRack', PluginRacksRack::getFormURL(true), $_GET["add"]);
}
Html::footer();