static function getMenuContent()
 {
     global $CFG_GLPI;
     $menu = array();
     $menu['title'] = self::getMenuName();
     $menu['page'] = "/plugins/addressing/front/addressing.php";
     $menu['title'] = PluginAddressingAddressing::getTypeName(2);
     $menu['page'] = PluginAddressingAddressing::getSearchURL(false);
     $menu['links']['search'] = PluginAddressingAddressing::getSearchURL(false);
     if (Session::haveRight('plugin_addressing', UPDATE)) {
         $menu['links']['add'] = PluginAddressingAddressing::getFormURL(false);
     }
     return $menu;
 }
Пример #2
0
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if ($item->getType() == 'Profile') {
         if ($item->getField('id') && $item->getField('interface') != 'helpdesk') {
             return array(1 => PluginAddressingAddressing::getTypeName(2));
         }
     }
     return '';
 }
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Addressing. 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;
}
$addressing = new PluginAddressingAddressing();
if (isset($_POST["add"])) {
    $addressing->check(-1, CREATE, $_POST);
    if (!empty($_POST["name"]) && !empty($_POST["begin_ip"]) && !empty($_POST["end_ip"])) {
        $newID = $addressing->add($_POST);
    } else {
        Session::addMessageAfterRedirect(__('Problem when adding, required fields are not here', 'addressing'), false, ERROR);
    }
    if ($_SESSION['glpibackcreated']) {
        Html::redirect($addressing->getFormURL() . "?id=" . $newID);
    }
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $addressing->check($_POST['id'], DELETE);
        $addressing->delete($_POST);
Пример #4
0
This file is part of addressing.

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

Addressing 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 Addressing. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
//Options for GLPI 0.71 and newer : need slave db to access the report
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 0;
include '../../../inc/includes.php';
Html::header(PluginAddressingAddressing::getTypeName(2), '', "plugins", "addressing");
if (!isset($_GET["start"])) {
    $_GET["start"] = 0;
}
if (!isset($_GET["export"])) {
    $_GET["export"] = false;
}
$PluginAddressingAddressing = new PluginAddressingAddressing();
$PluginAddressingAddressing->showReport($_GET);
Html::footer();
https://forge.indepnet.net/projects/addressing
-------------------------------------------------------------------------

LICENSE

This file is part of addressing.

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

Addressing 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 Addressing. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginAddressingAddressing::getTypeName(2), '', "tools", "pluginaddressingmenu");
$PluginAddressingAddressing = new PluginAddressingAddressing();
if ($PluginAddressingAddressing->canView() || Session::haveRight("config", UPDATE)) {
    Search::show("PluginAddressingAddressing");
} else {
    Html::displayRightError();
}
Html::footer();
Пример #6
0
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Addressing 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 Addressing. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
$plugin = new Plugin();
if ($plugin->isActivated("addressing")) {
    $PluginAddressingConfig = new PluginAddressingConfig();
    Session::checkRight("config", "w");
    if (isset($_POST["update"])) {
        $PluginAddressingConfig->update($_POST);
        Html::back();
    } else {
        Html::header(PluginAddressingAddressing::getTypeName(2), '', "plugins", "addressing");
        $PluginAddressingConfig->showForm();
        Html::footer();
    }
} else {
    Html::header(__('Setup'), '', "config", "plugins");
    echo "<div class='center'><br><br>" . "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\" alt='warning'><br><br>";
    echo "<b>" . __('Please activate the plugin', 'addressing') . "</b></div>";
    Html::footer();
}
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Addressing 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 Addressing. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
$plugin = new Plugin();
if ($plugin->isActivated("addressing")) {
    $PluginAddressingConfig = new PluginAddressingConfig();
    Session::checkRight("config", UPDATE);
    if (isset($_POST["update"])) {
        $PluginAddressingConfig->update($_POST);
        Html::back();
    } else {
        Html::header(PluginAddressingAddressing::getTypeName(2), '', "tools", "pluginaddressingmenu", "addressing");
        $PluginAddressingConfig->showForm();
        Html::footer();
    }
} else {
    Html::header(__('Setup'), '', "config", "plugins");
    echo "<div class='center'><br><br>" . "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\" alt='warning'><br><br>";
    echo "<b>" . __('Please activate the plugin', 'addressing') . "</b></div>";
    Html::footer();
}
Пример #8
0
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Addressing. 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;
}
$PluginAddressingAddressing = new PluginAddressingAddressing();
if (isset($_POST["add"])) {
    $PluginAddressingAddressing->check(-1, 'w', $_POST);
    if (!empty($_POST["name"]) && !empty($_POST["begin_ip"]) && !empty($_POST["end_ip"])) {
        $newID = $PluginAddressingAddressing->add($_POST);
    } else {
        Session::addMessageAfterRedirect(__('Problem when adding, required fields are not here', 'addressing'), false, ERROR);
    }
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $PluginAddressingAddressing->check($_POST['id'], 'w');
        $PluginAddressingAddressing->delete($_POST);
        $PluginAddressingAddressing->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
Пример #9
0
function plugin_addressing_dynamicReport($parm)
{
    $PluginAddressingAddressing = new PluginAddressingAddressing();
    $PluginAddressingReport = new PluginAddressingReport();
    if ($parm["item_type"] == 'PluginAddressingReport' && isset($parm["id"]) && isset($parm["display_type"]) && $PluginAddressingAddressing->getFromDB($parm["id"])) {
        $result = $PluginAddressingAddressing->compute($parm["start"]);
        $PluginAddressingReport->display($result, $PluginAddressingAddressing);
        return true;
    }
    // Return false if no specific display is done, then use standard display
    return false;
}
This file is part of addressing.

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

Addressing 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 Addressing. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
//Options for GLPI 0.71 and newer : need slave db to access the report
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 0;
include '../../../inc/includes.php';
Html::header(PluginAddressingAddressing::getTypeName(2), '', "tools", "pluginaddressingmenu");
if (!isset($_GET["start"])) {
    $_GET["start"] = 0;
}
if (!isset($_GET["export"])) {
    $_GET["export"] = false;
}
$addressing = new PluginAddressingAddressing();
$addressing->showReport($_GET);
Html::footer();