Пример #1
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(PluginArchiresArchires::getTypeName() . " " . PluginArchiresNetworkEquipmentQuery::getTypeName(), '', "plugins", "archires", "networkequipment");
$PluginArchiresNetworkEquipmentQuery = new PluginArchiresNetworkEquipmentQuery();
if ($PluginArchiresNetworkEquipmentQuery->canView() || Session::haveRight("config", "w")) {
    Search::show("PluginArchiresNetworkEquipmentQuery");
} else {
    Html::displayRightError();
}
Html::footer();
Пример #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(PluginArchiresArchires::getTypeName() . " " . PluginArchiresLocationQuery::getTypeName(), '', "plugins", "archires", "location");
$PluginArchiresLocationQuery = new PluginArchiresLocationQuery();
if ($PluginArchiresLocationQuery->canView() || Session::haveRight("config", "w")) {
    Search::show("PluginArchiresLocationQuery");
} else {
    Html::displayRightError();
}
Html::footer();
Пример #3
0
 static function showTypes($item)
 {
     global $DB;
     $type = $item->getType();
     $ID = $item->getID();
     if ($type == 'PluginArchiresLocationQuery') {
         $page = "locationquery";
     } else {
         if ($type == 'PluginArchiresNetworkEquipmentQuery') {
             $page = "networkequipmentquery";
         } else {
             if ($type == 'PluginArchiresApplianceQuery') {
                 $page = "appliancequery";
             }
         }
     }
     $PluginArchiresArchires = new PluginArchiresArchires();
     if (plugin_archires_haveRight('archires', 'w')) {
         echo "<form method='post'  action=\"./" . $page . ".form.php\">";
         echo "<table class='tab_cadre' cellpadding='5' width='34%'><tr><th colspan='2'>";
         echo __('Display types of items', 'archires') . "</th></tr>";
         echo "<tr class='tab_bg_1'><td>";
         $PluginArchiresArchires->showAllItems("type", 0, 0, $_SESSION["glpiactive_entity"]);
         echo "</td>";
         echo "<td>";
         echo "<input type='hidden' name='query' value='{$ID}'>";
         echo "<input type='submit' name='addtype' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
         echo "</td></tr>";
         echo "</table>";
         Html::closeForm();
     }
     $query = "SELECT *\n                FROM `glpi_plugin_archires_querytypes`\n                WHERE `plugin_archires_queries_id` = '{$ID}'\n                      AND `querytype` = '{$type}'\n                ORDER BY `itemtype`, `type` ASC";
     $i = 0;
     $rand = mt_rand();
     if ($result = $DB->query($query)) {
         $number = $DB->numrows($result);
         if ($number != 0) {
             echo "<form method='post' name='massiveaction_form{$rand}' id='massiveaction_form{$rand}' " . "action=\"./" . $page . ".form.php\">";
             echo "<div id='liste'>";
             echo "<table class='tab_cadre' cellpadding='5'>";
             echo "<tr>";
             echo "<th class='left'>" . __('Item') . "</th>";
             echo "<th class='left'>" . __('Item type') . "</th><th></th>";
             if ($number > 1) {
                 echo "<th class='left'>" . __('Item') . "</th>";
                 echo "<th class='left'>" . __('Item type') . "</th><th></th>";
             }
             echo "</tr>";
             while ($ligne = $DB->fetch_assoc($result)) {
                 $ID = $ligne["id"];
                 if ($i % 2 == 0 && $number > 1) {
                     echo "<tr class='tab_bg_1'>";
                 }
                 if ($number == 1) {
                     echo "<tr class='tab_bg_1'>";
                 }
                 $item = new $ligne["itemtype"]();
                 echo "<td>" . $item->getTypeName() . "</td>";
                 $class = $ligne["itemtype"] . "Type";
                 $typeclass = new $class();
                 $typeclass->getFromDB($ligne["type"]);
                 echo "<td>" . $typeclass->fields["name"] . "</td>";
                 echo "<td>";
                 echo "<input type='hidden' name='id' value='{$ID}'>";
                 echo "<input type='checkbox' name='item[{$ID}]' value='1'>";
                 echo "</td>";
                 $i++;
                 if ($i == $number && $number % 2 != 0 && $number > 1) {
                     echo "<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
                 }
             }
             if (plugin_archires_haveRight('archires', 'w')) {
                 echo "<tr class='tab_bg_1'>";
                 if ($number > 1) {
                     echo "<td colspan='6' class='center'>";
                 } else {
                     echo "<td colspan='3' class='center'>";
                 }
                 echo "<a onclick= \"if (markCheckboxes('massiveaction_form{$rand}')) return false;\"\n                     href='#'>" . __('Select all') . "</a>";
                 echo " - <a onclick= \"if (unMarkCheckboxes('massiveaction_form{$rand}')) return false;\"\n                     href='#'>" . __('Deselect all') . "</a> ";
                 Html::closeArrowMassives(array('deletetype' => _sx('button', 'Delete permanently')));
             } else {
                 echo "</table>";
             }
             echo "</div>";
             Html::closeForm();
         }
     }
 }
Пример #4
0
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if ($item->getType() == 'Profile') {
         if ($item->getField('id') && $item->getField('interface') != 'helpdesk') {
             return PluginArchiresArchires::getTypeName(2);
         }
     }
     return '';
 }
Пример #5
0
                                if ($PluginArchiresVlanColor->canCreate()) {
                                    $PluginArchiresVlanColor->addVlanColor($_POST['vlans_id'], $_POST['color']);
                                }
                                Html::back();
                            } else {
                                if (isset($_POST["delete_color_vlan"])) {
                                    Session::checkRight("config", "w");
                                    $PluginArchiresVlanColor->getFromDB($_POST["id"], -1);
                                    foreach ($_POST["item_color"] as $key => $val) {
                                        if ($val == 1) {
                                            $PluginArchiresVlanColor->delete(array('id' => $key));
                                        }
                                    }
                                    Html::back();
                                } else {
                                    Html::header(PluginArchiresArchires::getTypeName(), '', "plugins", "archires", "summary");
                                    $PluginArchiresImageItem->showConfigForm();
                                    $PluginArchiresNetworkInterfaceColor->showConfigForm(true);
                                    $PluginArchiresVlanColor->showConfigForm(true);
                                    $PluginArchiresStateColor->showConfigForm(true);
                                    Html::footer();
                                }
                            }
                        }
                    }
                }
            }
        }
    }
} else {
    Html::header(__('Setup'), '', "config", "plugins");
Пример #6
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(PluginArchiresArchires::getTypeName(), '', "plugins", "archires", "summary");
$PluginArchiresArchires = new PluginArchiresArchires();
if ($PluginArchiresArchires->canView() || Session::haveRight("config", "w")) {
    PluginArchiresArchires::showSummary();
} else {
    Html::displayRightError();
}
Html::footer();
Пример #7
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(PluginArchiresArchires::getTypeName() . " " . PluginAppliancesAppliance::getTypeName(), '', "plugins", "archires", "appliance");
$PluginArchiresApplianceQuery = new PluginArchiresApplianceQuery();
if ($PluginArchiresApplianceQuery->canView() || Session::haveRight("config", "w")) {
    Search::show("PluginArchiresApplianceQuery");
} else {
    Html::displayRightError();
}
Html::footer();