showGenericSearch() static public méthode

Params need to parsed before using Search::manageParams function
static public showGenericSearch ( $itemtype, array $params ) : nothing
$itemtype type to display the form
$params array array of parameters may include sort, is_deleted, criteria, metacriteria
Résultat nothing (displays)
if (isset($_GET['reset'])) {
    unset($_SESSION['glpisearch']['PluginMonitoringService']);
}
if (isset($_GET['glpi_tab'])) {
    unset($_GET['glpi_tab']);
}
//Search::manageGetValues("PluginMonitoringService");
//$_GET = Search::prepareDatasForSearch("PluginMonitoringService", $_GET);
if (isset($_GET['hidesearch'])) {
    echo "<table class='tab_cadre_fixe'>";
    echo "<tr class='tab_bg_1'>";
    echo "<th>";
    echo "<a onClick='\$(\"#searchformservices\").toggle();'>\n      <img src='" . $CFG_GLPI["root_doc"] . "/pics/deplier_down.png' />&nbsp;\n         " . __('Display search form', 'monitoring') . "\n      &nbsp;<img src='" . $CFG_GLPI["root_doc"] . "/pics/deplier_down.png' /></a>";
    echo "</th>";
    echo "</tr>";
    echo "</table>";
    echo "<div style='display: none;' id='searchformservices'>";
}
Search::showGenericSearch("PluginMonitoringService", $params);
if (isset($_GET['hidesearch'])) {
    echo "</div>";
}
$perfdatas = false;
if (isset($_GET['perfdatas'])) {
    $perfdatas = true;
}
$pmDisplay->showResourcesBoard('', $perfdatas, $params);
if (isset($_SESSION['glpisearch']['PluginMonitoringService']['reset'])) {
    unset($_SESSION['glpisearch']['PluginMonitoringService']['reset']);
}
Html::footer();
Exemple #2
0
This file is part of Resources.

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

Resources 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 Resources. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginResourcesResource::getTypeName(2), '', "plugins", "resources", "employment");
$employment = new PluginResourcesEmployment();
if ($employment->canView() || Session::haveRight("config", "w")) {
    Search::manageGetValues("PluginResourcesEmployment");
    if (isset($_GET["plugin_resources_resources_id"]) && !empty($_GET["plugin_resources_resources_id"])) {
        $_GET["field"] = array(0 => "13");
        $_GET["contains"] = array(0 => $_GET["plugin_resources_resources_id"]);
    }
    Search::showGenericSearch("PluginResourcesEmployment", $_GET);
    Search::showList("PluginResourcesEmployment", $_GET);
} else {
    Html::displayRightError();
}
Html::footer();
Exemple #3
0
$pmDisplay->showCounters("Ressources", 1, 0);
// Manage search
if (isset($_SESSION['plugin_monitoring']['service'])) {
    $_GET = $_SESSION['plugin_monitoring']['service'];
}
if (isset($_GET['reset'])) {
    unset($_SESSION['glpisearch']['PluginMonitoringService']);
}
if (isset($_GET['glpi_tab'])) {
    unset($_GET['glpi_tab']);
}
Search::manageGetValues("PluginMonitoringService");
if (isset($_GET['hidesearch'])) {
    echo "<table class='tab_cadre_fixe'>";
    echo "<tr class='tab_bg_1'>";
    echo "<th>";
    echo "<a onClick='Ext.get(\"searchform\").toggle();'>\n      <img src='" . $CFG_GLPI["root_doc"] . "/pics/deplier_down.png' />&nbsp;\n         " . __('Display search form', 'monitoring') . "\n      &nbsp;<img src='" . $CFG_GLPI["root_doc"] . "/pics/deplier_down.png' /></a>";
    echo "</th>";
    echo "</tr>";
    echo "</table>";
    echo "<div style='display: none;' id='searchform'>";
}
Search::showGenericSearch("PluginMonitoringService", $_GET);
if (isset($_GET['hidesearch'])) {
    echo "</div>";
}
$pmDisplay->showBoard(950);
if (isset($_SESSION['glpisearch']['PluginMonitoringService']['reset'])) {
    unset($_SESSION['glpisearch']['PluginMonitoringService']['reset']);
}
Html::footer();
 function addRule()
 {
     // Verified
     global $CFG_GLPI;
     $params = Search::manageParams($_GET['itemtype'], $_GET);
     $params['showbookmark'] = false;
     $params['target'] = $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/displayview_rule.form.php";
     $params['addhidden'] = array();
     $params['addhidden']['plugin_monitoring_displayviews_id'] = $_GET['plugin_monitoring_displayviews_id'];
     $params['addhidden']['name'] = $_GET['name'];
     if (isset($_GET['id'])) {
         $params['addhidden']['id'] = $_GET['id'];
     }
     ob_start();
     Search::showGenericSearch($_GET['itemtype'], $params);
     $form = ob_get_contents();
     ob_end_clean();
     if (isset($_GET['id'])) {
         $table = "<tr class='tab_bg_1'>" . "<td align='center'>" . "<input type='submit' name='updaterule' value=\"Update this rule\" class='submit' >" . "</td>" . "<td align='center'>" . "<input type='submit' name='deleterule' value=\"Delete this rule\" class='submit' >" . "</td>" . "</tr>" . "</table><input";
     } else {
         $table = "<tr class='tab_bg_1'>" . "<td align='center' colspan='2'>" . "<input type='submit' name='addrule' value=\"Add this rule\" class='submit' >" . "</td>" . "</tr>" . "</table><input";
     }
     $form = str_replace("</table>\n<input", $table, $form);
     echo $form;
     echo "<br/>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th>";
     echo __('Preview', 'monitoring');
     echo "</th>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     $pmDisplayview = new PluginMonitoringDisplayview();
     $pmDisplayview->getFromDB($_GET['plugin_monitoring_displayviews_id']);
     $default_entity = 0;
     if (isset($_SESSION['glpiactive_entity'])) {
         $default_entity = $_SESSION['glpiactive_entity'];
     }
     $entities_isrecursive = 0;
     if (isset($_SESSION['glpiactiveentities']) and count($_SESSION['glpiactiveentities']) > 1) {
         $entities_isrecursive = 1;
     }
     Session::changeActiveEntities($pmDisplayview->fields['entities_id'], $pmDisplayview->fields['is_recursive']);
     Search::showList($_GET['itemtype'], $params);
     Session::changeActiveEntities($default_entity, $entities_isrecursive);
     echo "</td>";
     echo "</tr>";
     echo "</table>";
 }
Exemple #5
0
   unset($_SESSION['glpisearch']['PluginMonitoringHost']);
}
if (isset($_GET['glpi_tab'])) {
   unset($_GET['glpi_tab']);
}
if (isset($_GET['hidesearch'])) {
   echo "<table class='tab_cadre_fixe'>";
   echo "<tr class='tab_bg_1'>";
   echo "<th>";
   echo "<a onClick='$(\"#searchformhosts\").toggle();'>
      <img src='".$CFG_GLPI["root_doc"]."/pics/deplier_down.png' />&nbsp;
         ".__('Display search form', 'monitoring')."
      &nbsp;<img src='".$CFG_GLPI["root_doc"]."/pics/deplier_down.png' /></a>";
   echo "</th>";
   echo "</tr>";
   echo "</table>";
   echo "<div style='display: none;' id='searchformhosts'>";
}
Search::showGenericSearch("PluginMonitoringHost", $params);
if (isset($_GET['hidesearch'])) {
   echo "</div>";
}

$pmDisplay->showHostsBoard($params);
if (isset($_SESSION['glpisearch']['PluginMonitoringHost']['reset'])) {
   unset($_SESSION['glpisearch']['PluginMonitoringHost']['reset']);
}

Html::footer();
?>
-------------------------------------------------------------------------

LICENSE

This file is part of Resources.

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

Resources 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 Resources. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginResourcesResource::getTypeName(2), '', "plugins", "resources", "checklist");
$checklistconfig = new PluginResourcesChecklistconfig();
if ($checklistconfig->canView() || Session::haveRight("config", "w")) {
    Search::manageGetValues("PluginResourcesChecklistconfig");
    Search::showGenericSearch("PluginResourcesChecklistconfig", $_GET);
    Search::showList("PluginResourcesChecklistconfig", $_GET);
} else {
    Html::displayRightError();
}
Html::footer();
Exemple #7
0
Resources 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.

Resources 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 Resources. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Html::header(PluginResourcesResource::getTypeName(2), '', "plugins", "resources");
$task = new PluginResourcesTask();
if ($task->canView() || Session::haveRight("config", "w")) {
    Search::manageGetValues("PluginResourcesTask");
    //if $_GET["plugin_resources_resources_id"] exist this show list of tasks from a resource
    //else show all resources
    if (isset($_GET["plugin_resources_resources_id"]) && !empty($_GET["plugin_resources_resources_id"])) {
        $_GET["field"] = array(0 => "13");
        $_GET["contains"] = array(0 => $_GET["plugin_resources_resources_id"]);
    }
    Search::showGenericSearch("PluginResourcesTask", $_GET);
    Search::showList("PluginResourcesTask", $_GET);
} else {
    Html::displayRightError();
}
Html::footer();
Exemple #8
0
Projet 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.

Projet 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 Projet. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
$task = new PluginProjetTask();
Html::header(PluginProjetProjet::getTypeName(2), '', "plugins", "projet");
if ($task->canView() || Session::haveRight("config", "w")) {
    Search::manageGetValues("PluginProjetTask");
    //if $_GET["plugin_projet_projets_id"] exist this show list of tasks from a projet
    //else show all tasks
    if (isset($_GET["plugin_projet_projets_id"]) && !empty($_GET["plugin_projet_projets_id"])) {
        $_GET["field"] = array(0 => "23");
        $_GET["contains"] = array(0 => $_GET["plugin_projet_projets_id"]);
    }
    Search::showGenericSearch("PluginProjetTask", $_GET);
    Search::showList("PluginProjetTask", $_GET);
} else {
    Html::displayRightError();
}
Html::footer();