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 '';
 }
        $addressing->delete($_POST);
        $addressing->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $addressing->check($_POST['id'], PURGE);
            $addressing->restore($_POST);
            $addressing->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $addressing->check($_POST['id'], PURGE);
                $addressing->delete($_POST, 1);
                $addressing->redirectToList();
            } else {
                if (isset($_POST["update"])) {
                    $addressing->check($_POST['id'], UPDATE);
                    if (!empty($_POST["name"]) && !empty($_POST["begin_ip"]) && !empty($_POST["end_ip"])) {
                        $addressing->update($_POST);
                    } else {
                        Session::addMessageAfterRedirect(__('Problem when adding, required fields are not here', 'addressing'), false, ERROR);
                    }
                    Html::back();
                } else {
                    $addressing->checkGlobal(READ);
                    Html::header(PluginAddressingAddressing::getTypeName(2), '', "tools", "pluginaddressingmenu");
                    $addressing->display($_GET);
                    Html::footer();
                }
            }
        }
    }
}
Пример #4
0
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), '', "plugins", "addressing");
$PluginAddressingAddressing = new PluginAddressingAddressing();
if ($PluginAddressingAddressing->canView() || Session::haveRight("config", "w")) {
    Search::show("PluginAddressingAddressing");
} else {
    Html::displayRightError();
}
Html::footer();
Пример #5
0
function plugin_addressing_MassiveActions($type)
{
    switch ($type) {
        case 'Profile':
            return array("plugin_addressing_allow" => PluginAddressingAddressing::getTypeName(2) . " - " . __('Generate reports', 'addressing'));
    }
    return array();
}