Пример #1
0
along with reports. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
$USEDBREPLICATE = 1;
$DBCONNECTION_REQUIRED = 0;
// Not really a big SQL request
include "../../../../inc/includes.php";
includeLocales("equipmentbygroups");
//TRANS: The name of the report = List all devices of a group, ordered by users
Html::header(__('equipmentbygroups_report_title', 'reports'), $_SERVER['PHP_SELF'], "utils", "report");
Report::title();
if (isset($_GET["reset_search"])) {
    resetSearch();
}
$_GET = getValues($_GET, $_POST);
displaySearchForm();
$sql = "SELECT `id` AS group_id,\n               `name` AS group_name\n        FROM `glpi_groups`\n        WHERE `entities_id` = " . $_SESSION["glpiactive_entity"] . (isset($_GET["groups_id"]) && $_GET["groups_id"] ? " AND `glpi_groups`.`id` = " . $_GET["groups_id"] : "") . "\n        ORDER BY `name`";
$result = $DB->query($sql);
$last_group_id = -1;
while ($datas = $DB->fetch_array($result)) {
    if ($last_group_id != $datas["group_id"]) {
        echo "<table class='tab_cadre' cellpadding='5'>";
        echo "<tr><th>" . sprintf(__('%1$s: %2$s'), __('Group'), $datas['group_name']) . "</th></th></tr>";
        $last_group_id = $datas["group_id"];
        echo "</table>";
    }
    getObjectsByGroupAndEntity($datas["group_id"], $_SESSION["glpiactive_entity"]);
}
Html::footer();
/**
 * Display group form
Пример #2
0
//Main form logic: When the user first enters the page, display form defaulted to
//show the search results with default object selected on a previous page, otherwise
// just display the blank form.
if (isset($_POST['searchSubmit']) && isset($searchRequest)) {
    require_once 'header.php';
    displaySearchForm($searchRequest);
    print updateUrlScript($searchRequest);
    $searchTimeStart = microtime(true);
    $records = search($searchRequest);
    $searchTimeEnd = microtime(true);
    $searchTimeElapsed = $searchTimeEnd - $searchTimeStart;
    displaySearchResult($records, $searchTimeElapsed);
    include_once 'footer.php';
} else {
    require_once 'header.php';
    displaySearchForm($searchRequest);
    include_once 'footer.php';
}
//Show the main SOSL search form with default search or last submitted search and export action (screen or CSV)
function displaySearchForm($searchRequest)
{
    registerShortcut("Ctrl+Alt+W", "addReturningObjectRow(document.getElementById('numReturningObjects').value++);" . "toggleFieldDisabled();");
    print "<script>\n";
    print "var searchable_objects = new Array();\n";
    foreach (describeGlobal("searchable") as $obj) {
        print "searchable_objects[\"{$obj}\"]=\"{$obj}\";\n";
    }
    print "</script>\n";
    print "<script src='" . getPathToStaticResource('/script/search.js') . "' type='text/javascript'></script>\n";
    print "<form method='POST' name='search_form' action='search.php'>\n";
    print "<input type='hidden' id='numReturningObjects' name='numReturningObjects' value='" . count($searchRequest->getReturningObjects()) . "' />";
Пример #3
0
/**
 * Prints the top header
 *
 * @since 1.0
 * @package facileManager
 */
function getTopHeader($help)
{
    global $fm_login, $__FM_CONFIG;
    include ABSPATH . 'fm-modules' . DIRECTORY_SEPARATOR . 'facileManager' . DIRECTORY_SEPARATOR . 'variables.inc.php';
    include ABSPATH . 'fm-includes' . DIRECTORY_SEPARATOR . 'version.php';
    $module_toolbar = $fm_new_version_available = $account_menu = $user_account_menu = $module_menu = null;
    if (!$help) {
        $auth_method = getOption('auth_method');
        if ($auth_method) {
            if ($_SESSION['user']['account_id'] != 1) {
                $account = getNameFromID($_SESSION['user']['account_id'], 'fm_accounts', 'account_', 'account_id', 'account_name');
                $account_menu = <<<HTML
\t\t<div id="topheadpart">
\t\t\t<span style="line-height: 18pt;">Account:&nbsp;&nbsp; {$account}</span>
\t\t</div>
HTML;
            }
            $star = currentUserCan('do_everything') ? $__FM_CONFIG['icons']['star'] . ' ' : null;
            $change_pwd_link = $auth_method ? sprintf('<li><a class="account_settings" id="%s" href="#"><span>%s</span></a></li>' . "\n", $_SESSION['user']['id'], _('Edit Profile')) : null;
            $logout = _('Logout');
            $user_account_menu = <<<HTML
\t\t<div id="topheadpartright" style="padding: 0 1px 0 0;">
\t\t\t<div id="cssmenu">
\t\t\t<ul>
\t\t\t\t<li class="has-sub has-image"><a href="#"><span>{$__FM_CONFIG['icons']['account']}</span></a>
\t\t\t\t\t<ul class="sub-right">
\t\t\t\t\t\t<li class="text-only"><span>{$star}{$_SESSION['user']['name']}</span></li>
\t\t\t\t\t\t{$change_pwd_link}
\t\t\t\t\t\t<li class="last"><a href="{$GLOBALS['RELPATH']}?logout"><span>{$logout}</span></a></li>
\t\t\t\t\t</ul>
\t\t\t\t</li>
\t\t\t</ul>
\t\t\t</div>
\t\t</div>
HTML;
        }
        /** Build app dropdown menu */
        $modules = getAvailableModules();
        $avail_modules = null;
        if (count($modules)) {
            foreach ($modules as $module_name) {
                if ($module_name == $_SESSION['module']) {
                    continue;
                }
                if (in_array($module_name, getActiveModules(true))) {
                    $avail_modules .= "<li class='last'><a href='{$GLOBALS['RELPATH']}?module={$module_name}'><span>{$module_name}</span></a></li>\n";
                }
            }
            if ($avail_modules) {
                $module_menu = <<<HTML
\t\t<div id="topheadpartright" style="padding: 0;">
\t\t\t<div id="cssmenu">
\t\t\t<ul>
\t\t\t\t<li class="has-sub last"><a href="#"><span>{$_SESSION['module']}</span></a>
\t\t\t\t\t<ul>
\t\t\t\t\t{$avail_modules}
\t\t\t\t\t</ul>
\t\t\t\t</li>
\t\t\t</ul>
\t\t\t</div>
\t\t</div>
HTML;
            }
            /** Include module toolbar items */
            if (function_exists('buildModuleToolbar')) {
                list($module_toolbar_left, $module_toolbar_right) = @buildModuleToolbar();
            }
        } else {
            $module_menu = null;
            $fm_name = isset($_SESSION['module']) ? $_SESSION['module'] : $fm_name;
        }
        $help_file = buildHelpFile();
        $help_text = _('Help');
        $process_all_text = _('Process all available updates now');
        $process_all = <<<HTML
\t\t<div id="topheadpartright" style="display: none;">
\t\t\t<a class="single_line process_all_updates" href="#" title="{$process_all_text}"><i class="fa fa-refresh fa-lg"></i></a>
\t\t\t<span class="update_count"></span>
\t\t</div>
HTML;
        if (FM_INCLUDE_SEARCH === true) {
            $search = '<div id="topheadpartright">
			<a class="single_line search" href="#" title="' . _('Search this page') . '"><i class="fa fa-search fa-lg"></i></a>' . displaySearchForm() . '</div>';
        } else {
            $search = null;
        }
        $return = <<<HTML
\t<div id="tophead">
\t\t<div id="topheadpart">
\t\t\t<img src="fm-modules/{$fm_name}/images/fm.png" alt="{$fm_name}" title="{$fm_name}" />
\t\t\t{$fm_name}<br />
\t\t\tv{$fm_version}
\t\t</div>
{$account_menu}
{$module_toolbar_left}
{$user_account_menu}
\t\t<div id="topheadpartright">
\t\t\t<a class="single_line help_link" href="#">{$help_text}</a>
\t\t</div>
{$module_menu}
{$module_toolbar_right}
{$search}
{$process_all}
\t</div>
\t<div id="help">
\t\t<div id="help_topbar">
\t\t\t<p class="title">fmHelp</p>
\t\t\t<p id="help_buttons">{$__FM_CONFIG['icons']['popout']} {$__FM_CONFIG['icons']['close']}</p>
\t\t</div>
\t\t<div id="help_file_container">
\t\t{$help_file}
\t\t</div>
\t</div>

HTML;
    } else {
        $return = <<<HTML
\t<div id="tophead">
\t\t<div id="topheadpart">
\t\t\tfmHelp<br />
\t\t\tv{$fm_version}
\t\t</div>
\t</div>

HTML;
    }
    return $return;
}
commonHeader($LANG['plugin_fusioninventory']["title"][0], $_SERVER['PHP_SELF'], "utils", "report");
if (isset($_GET["reset_search"])) {
    resetSearch();
}
if (!isset($_GET["start"])) {
    $_GET["start"] = 0;
}
$_GET = getValues($_GET, $_POST);
$FK_port = "";
if (isset($_GET["FK_networking_ports"])) {
    $FK_port = $_GET["FK_networking_ports"];
}
if (isset($_GET["contains"][0])) {
    $FK_port = $_GET["contains"][0];
}
displaySearchForm($FK_port);
manageGetValuesInSearch(PLUGIN_FUSIONINVENTORY_SNMP_HISTORY);
if (isset($_GET["FK_networking_ports"])) {
    $_GET["field"][0] = 2;
    $_GET["contains"][0] = $_GET["FK_networking_ports"];
    $_GET["field"][1] = 3;
    if (isset($_GET["Field"]) and !empty($_GET["Field"])) {
        $_GET["contains"][1] = $_GET["Field"];
        $_GET["link"][1] = "AND";
    } else {
        $_GET["contains"][1] = "";
        $_GET["link"][1] = "AND";
    }
    if ($_GET["FK_networking_ports"] == '-----') {
        $_GET["contains"][0] = '*';
    }