Example #1
0
 static function showSummary()
 {
     echo "<div class='center'><table class='tab_cadre' cellpadding='5' width='50%'>";
     echo "<tr><th>" . __('Summary') . "</th></tr>";
     if (countElementsInTable('glpi_plugin_archires_views', "`entities_id`='" . $_SESSION["glpiactive_entity"] . "'") > 0) {
         echo "<tr class='tab_bg_1'><td>";
         echo "<a href='view.php'>" . PluginArchiresView::getTypeName(2) . "</a>";
         echo "</td></tr>";
         echo "<tr class='tab_bg_1'><td>";
         echo "<a href='locationquery.php'>" . sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginArchiresLocationQuery::getTypeName(1)) . "</a>";
         echo "</td></tr>";
         echo "<tr class='tab_bg_1'><td>";
         echo "<a href='networkequipmentquery.php'>" . sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginArchiresNetworkEquipmentQuery::getTypeName(1)) . "</a>";
         echo "</td></tr>";
         $plugin = new Plugin();
         if ($plugin->isActivated("appliances")) {
             echo "<tr class='tab_bg_1'><td>";
             echo "<a href='appliancequery.php'>" . sprintf(__('%1$s - %2$s'), self::getTypeName(1), PluginAppliancesAppliance::getTypeName(1)) . "</a>";
             echo "</td></tr>";
         }
     } else {
         echo "<tr class='tab_bg_1'><td>";
         echo "<a href='view.form.php?new=1'>" . __('Add view', 'archires') . "</a>";
         echo "</td></tr>";
     }
     echo "</table></div>";
 }
Example #2
0
 https://forge.indepnet.net/projects/archires
 -------------------------------------------------------------------------

 LICENSE

 This file is part of archires.

 Archires 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.

 Archires 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 Archires. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Html::header(PluginArchiresView::getTypeName(), '', "plugins", "archires", "view");
$PluginArchiresView = new PluginArchiresView();
if ($PluginArchiresView->canView() || Session::haveRight("config", "w")) {
    Search::show("PluginArchiresView");
} else {
    Html::displayRightError();
}
Html::footer();
 function showForm($ID, $options = array())
 {
     $this->initForm($ID, $options);
     $this->showTabs($options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name");
     echo "</td>";
     echo "<td>" . __('State') . "</td><td>";
     State::dropdown(array('name' => "states_id", 'value' => $this->fields["states_id"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Location') . "</td><td>";
     $this->dropdownLocation($this, $ID);
     echo "</td>";
     echo "<td>" . __('Group') . "</td><td>";
     Group::dropdown(array('name' => "groups_id", 'value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Childs', 'archires') . "</td>";
     echo "<td>";
     Dropdown::showYesNo("child", $this->fields["child"]);
     echo "</td>";
     echo "<td>" . __('VLAN') . "</td><td>";
     Vlan::dropdown(array('name' => "vlans_id", 'value' => $this->fields["vlans_id"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Network') . "</td><td>";
     Network::dropdown(array('name' => "networks_id", 'value' => $this->fields["networks_id"]));
     echo "</td>";
     echo "<td>" . PluginArchiresView::getTypeName(1) . "</td><td>";
     //View
     Dropdown::show('PluginArchiresView', array('name' => "plugin_archires_views_id", 'value' => $this->fields["plugin_archires_views_id"]));
     echo "</td></tr>";
     $this->showFormButtons($options);
     $this->addDivForTabs();
     return true;
 }
Example #4
0
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     switch ($item->getType()) {
         case 'PluginArchiresApplianceQuery':
         case 'PluginArchiresLocationQuery':
         case 'PluginArchiresNetworkEquipmentQuery':
             switch ($tabnum) {
                 case 1:
                     self::test($item);
                     break;
                 case 2:
                     $plugin_archires_views_id = $item->fields["plugin_archires_views_id"];
                     self::displayGraph($item, $plugin_archires_views_id);
                     PluginArchiresView::linkToAllViews($item);
                     break;
             }
             break;
     }
     return true;
 }
Example #5
0
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Archires. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (isset($_GET["start"])) {
    $start = $_GET["start"];
} else {
    $start = 0;
}
$PluginArchiresView = new PluginArchiresView();
if (isset($_POST["add"])) {
    $PluginArchiresView->check(-1, 'w', $_POST);
    $PluginArchiresView->add($_POST);
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $PluginArchiresView->check($_POST['id'], 'w');
        $PluginArchiresView->delete($_POST);
        Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresView'));
    } else {
        if (isset($_POST["restore"])) {
            $PluginArchiresView->check($_POST['id'], 'w');
            $PluginArchiresView->restore($_POST);
            Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresView'));
        } else {