diff --git a/doc/en/configuration_guide/commands.rst b/doc/en/configuration_guide/commands.rst index 64f72254759..840036e50a0 100644 --- a/doc/en/configuration_guide/commands.rst +++ b/doc/en/configuration_guide/commands.rst @@ -20,6 +20,8 @@ All the commands can be configured in the menu: **Configuration > Commands**. .. image :: /images/user/configuration/04commandlist.png :align: center +.. note:: + By default, locked commands are hidden. Check the "Display locked" box to list all commands. **************** Adding a command @@ -48,11 +50,12 @@ Configuration fields * The **Command Type** field allows us to choose the type of command. * The **Command Line** field indicates the application or the script use with the command. * The **Enable shell** box allows us to enable functions that are specific to a shell such as the pipe, etc. -* The **Argument Example** and **$HOSTADDRESS$** fields define examples of arguments (each argument starts with a ”!”) and a test IP address respectively. +* The **Argument Example** and **$HOSTADDRESS$** fields define examples of arguments (each argument starts with a ”!”) and a test IP address respectively. These fields serve to execute the command line defined above via the web interface by clicking on the blue arrow : |bluearrow|. * The **Describe arguments** button serves to add a description to arguments of the “$ARGn$” type. This description will be visible when using the command in a host or service form. * The **Clear arguments** button deletes the description of arguments defined * The **Describe macros** button serves to add a description to all macros. This description will be visible when using the command in a host or service form. + * The **Connectors** field serves to link a Connector to the command. For more information on Connectors refer to the chapter entitled: `Perl Connector's documentation `_ and `SSH Connector's documentation `_. * The **Graph template** field serves to link the command to a graphic model. * The **Comment** field can be used to make a comment on the command. diff --git a/doc/en/configuration_guide/models.rst b/doc/en/configuration_guide/models.rst index 64c2931553c..f655091082e 100644 --- a/doc/en/configuration_guide/models.rst +++ b/doc/en/configuration_guide/models.rst @@ -69,6 +69,9 @@ To add a host template: .. note:: Refer to the chapter covering configuration of :ref:`hosts` to configure a template because the form is identical. +.. note:: + By default, locked host templates are hidden. Check the "Display locked" box to list all templates. + ****************** Services Templates ****************** @@ -93,6 +96,9 @@ To add a Service Template: .. note:: Refer to the chapter covering configuration of :ref:`services` to configure a template because the form is identical. +.. note:: + By default, locked service templates are hidden. Check the "Display locked" box to list all templates. + ************* Best practice ************* diff --git a/doc/en/images/user/configuration/04commandlist.png b/doc/en/images/user/configuration/04commandlist.png index e8caa7bcd98..21901fd7ef5 100644 Binary files a/doc/en/images/user/configuration/04commandlist.png and b/doc/en/images/user/configuration/04commandlist.png differ diff --git a/doc/fr/configuration_guide/commands.rst b/doc/fr/configuration_guide/commands.rst index d5054647f06..82ef2517501 100644 --- a/doc/fr/configuration_guide/commands.rst +++ b/doc/fr/configuration_guide/commands.rst @@ -11,14 +11,20 @@ Il est possible d'exécuter cette commande en précisant des arguments. Il existe trois types de commandes : -* Les commandes de **vérification** sont utilisées par les ordonnanceurs afin de vérifier le statut d'un hôte ou d'un service. +* Les commandes de **vérification** sont utilisées par les ordonnanceurs afin de vérifier le statut d'un hôte ou d'un + service. * Les commandes de **notification** sont utilisées par les ordonnanceurs pour alerter les contacts (via mail, SMS...). -* Des commandes **diverses** sont utilisées par les modules complémentaires (pour effectuer certaines actions), par l'ordonnanceur pour le traitement des données... +* Les commandes de **découverte** sont utilisées par les règles de découverte de services. +* Des commandes **diverses** sont utilisées par les modules complémentaires (pour effectuer certaines actions), par + l'ordonnanceur pour le traitement des données... Toutes les commandes peuvent être configurées au sein du menu **Configuration > Commandes**. .. image :: /images/guide_utilisateur/configuration/04commandlist.png - :align: center + :align: center + +.. note:: + Par défaut, les commandes verrouillées sont masquées. Cocher la case "Afficher verrouillé" pour les afficher toutes. ******************** Ajouter une commande diff --git a/doc/fr/configuration_guide/models.rst b/doc/fr/configuration_guide/models.rst index 8d3d85670ac..1167c83b13a 100644 --- a/doc/fr/configuration_guide/models.rst +++ b/doc/fr/configuration_guide/models.rst @@ -71,6 +71,9 @@ Pour ajouter un modèle d'hôtes : .. note:: Se rapporter au chapitre de configuration des :ref:`hôtes` pour configurer un modèle car le formulaire est identique. +.. note:: + Par défaut, les modèles d'hôte verrouillés sont masqués. Cocher la case "Afficher verrouillé" pour les afficher tous. + *********************** Les modèles de services *********************** @@ -128,6 +131,9 @@ Configuration La liaison des modèles de services avec les modèles d'hôtes a lieu dans l'onglet **Relations** des modèles de services ou des modèles d'hôtes. +.. note:: + Par défaut, les modèles de service verrouillés sont masqués. Cocher la case "Afficher verrouillé" pour les afficher tous. + *********************** Les modèles de contacts *********************** diff --git a/doc/fr/images/guide_utilisateur/configuration/04commandlist.png b/doc/fr/images/guide_utilisateur/configuration/04commandlist.png index e8caa7bcd98..21901fd7ef5 100644 Binary files a/doc/fr/images/guide_utilisateur/configuration/04commandlist.png and b/doc/fr/images/guide_utilisateur/configuration/04commandlist.png differ diff --git a/lang/fr_FR.UTF-8/LC_MESSAGES/messages.po b/lang/fr_FR.UTF-8/LC_MESSAGES/messages.po index 1f5943aab8e..55c3e3d2a59 100644 --- a/lang/fr_FR.UTF-8/LC_MESSAGES/messages.po +++ b/lang/fr_FR.UTF-8/LC_MESSAGES/messages.po @@ -14798,3 +14798,6 @@ msgstr "Filtrer par groupe de services" msgid "Chart" msgstr "Graphiques" + +msgid "Display locked" +msgstr "Afficher verrouillé" diff --git a/www/include/configuration/configObject/command/listCommand.ihtml b/www/include/configuration/configObject/command/listCommand.ihtml index 48191d90273..5880c0b1f88 100644 --- a/www/include/configuration/configObject/command/listCommand.ihtml +++ b/www/include/configuration/configObject/command/listCommand.ihtml @@ -10,7 +10,8 @@ - {$form.Search.html} +

{$displayLocked}

+ diff --git a/www/include/configuration/configObject/command/listCommand.php b/www/include/configuration/configObject/command/listCommand.php index 5acf94f9475..fc4606a96d5 100755 --- a/www/include/configuration/configObject/command/listCommand.php +++ b/www/include/configuration/configObject/command/listCommand.php @@ -71,9 +71,20 @@ // the four pages have the same $url, so we need to distinguish each page using its $type, // and to save the four search filters. $centreon->historySearch[$url]['search' . $type] = $search; + isset($_POST["displayLocked"]) ? $displayLocked = 1 : $displayLocked = 0; + $centreon->historySearch[$url]["displayLocked" . $type] = $displayLocked; } else { //restoring user's search field value $search = $centreon->historySearch[$url]['search' . $type] ?? null; + $displayLocked = $centreon->historySearch[$url]["displayLocked" . $type] ?? 0; +} + +// Locked Filter +$displayLockedChecked = ""; +$sqlFilter = "AND command_locked = '0'"; +if ($displayLocked == 1) { + $displayLockedChecked = "checked"; + $sqlFilter = ""; } @@ -84,11 +95,11 @@ if (isset($search) && $search) { $rq = "SELECT SQL_CALC_FOUND_ROWS `command_id`, `command_name`, `command_line`, `command_type`, " . "`command_activate` FROM `command` WHERE `command_name` LIKE '%" . $search . "%' " . - $type_str . " ORDER BY `command_name` LIMIT " . $num * $limit . ", " . $limit; + $type_str . " " . $sqlFilter . " ORDER BY `command_name` LIMIT " . $num * $limit . ", " . $limit; } elseif ($type) { $rq = "SELECT SQL_CALC_FOUND_ROWS `command_id`, `command_name`, `command_line`, `command_type`, " . - "`command_activate` FROM `command` WHERE `command_type` = '" . $type . - "' ORDER BY command_name LIMIT " . $num * $limit . ", " . $limit; + "`command_activate` FROM `command` WHERE `command_type` = '" . $type . "' " . $sqlFilter . + " ORDER BY command_name LIMIT " . $num * $limit . ", " . $limit; } else { $rq = "SELECT SQL_CALC_FOUND_ROWS `command_id`, `command_name`, `command_line`, `command_type`, " . "`command_activate` FROM `command` ORDER BY `command_name` LIMIT " . $num * $limit . ", " . $limit; @@ -253,5 +264,7 @@ function setO(_i) { $tpl->assign('limit', $limit); $tpl->assign('type', $type); $tpl->assign('searchC', $search); +$tpl->assign("displayLockedChecked", $displayLockedChecked); +$tpl->assign('displayLocked', _("Display locked")); $tpl->display("listCommand.ihtml"); diff --git a/www/include/configuration/configObject/host_template_model/listHostTemplateModel.ihtml b/www/include/configuration/configObject/host_template_model/listHostTemplateModel.ihtml index efc021eb510..27e0b7c4fbf 100644 --- a/www/include/configuration/configObject/host_template_model/listHostTemplateModel.ihtml +++ b/www/include/configuration/configObject/host_template_model/listHostTemplateModel.ihtml @@ -12,7 +12,8 @@ - {$form.Search.html} +

{$displayLocked}

+ diff --git a/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php b/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php index 2ca9fa979ca..b6b158ea33a 100755 --- a/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php +++ b/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php @@ -62,16 +62,27 @@ //saving filters values $centreon->historySearch[$url] = array(); $centreon->historySearch[$url]['search'] = $search; + isset($_POST["displayLocked"]) ? $displayLocked = 1 : $displayLocked = 0; + $centreon->historySearch[$url]["displayLocked"] = $displayLocked; } else { //restoring saved values $search = $centreon->historySearch[$url]['search'] ?? null; + $displayLocked = $centreon->historySearch[$url]["displayLocked"] ?? 0; +} + +// Locked Filter +$displayLockedChecked = ""; +$sqlFilter = "AND host_locked = '0'"; +if ($displayLocked == 1) { + $displayLockedChecked = "checked"; + $sqlFilter = ""; } // Host Template list $rq = "SELECT SQL_CALC_FOUND_ROWS host_id, host_name, host_alias, host_activate, host_template_model_htm_id " . "FROM host" . - " WHERE host_register = '0' "; + " WHERE host_register = '0' " . $sqlFilter . " "; if ($search) { $rq .= "AND (host_name LIKE '%" . CentreonDB::escape($search) . "%' OR host_alias LIKE '%" . CentreonDB::escape($search) . "%')"; @@ -252,4 +263,6 @@ function setO(_i) { $form->accept($renderer); $tpl->assign('form', $renderer->toArray()); $tpl->assign('searchHT', $search); +$tpl->assign("displayLockedChecked", $displayLockedChecked); +$tpl->assign('displayLocked', _("Display locked")); $tpl->display("listHostTemplateModel.ihtml"); diff --git a/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.ihtml b/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.ihtml index 97a6dcfe888..eedd8a504f5 100644 --- a/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.ihtml +++ b/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.ihtml @@ -11,7 +11,9 @@ - {$form.Search.html} +

+ {$displayLocked}

+ diff --git a/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.php b/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.php index ed6e38c93fe..3cb32076942 100644 --- a/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.php +++ b/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.php @@ -57,9 +57,20 @@ //saving filters values $centreon->historySearch[$url] = array(); $centreon->historySearch[$url]["search"] = $search; + isset($_POST["displayLocked"]) ? $displayLocked = 1 : $displayLocked = 0; + $centreon->historySearch[$url]["displayLocked"] = $displayLocked; } else { //restoring saved values $search = $centreon->historySearch[$url]["search"] ?? null; + $displayLocked = $centreon->historySearch[$url]["displayLocked"] ?? 0; +} + +// Locked Filter +$displayLockedChecked = ""; +$sqlFilter = "AND sv.service_locked = '0'"; +if ($displayLocked == 1) { + $displayLockedChecked = "checked"; + $sqlFilter = ""; } //Service Template Model list @@ -68,7 +79,7 @@ "sv.service_activate, sv.service_template_model_stm_id " . "FROM service sv " . "WHERE (sv.service_description LIKE '%" . $search . "%' OR sv.service_alias LIKE '%" . $search . "%') " . - "AND sv.service_register = '0' " . + "AND sv.service_register = '0' " . $sqlFilter . " " . "ORDER BY service_description LIMIT " . $num * $limit . ", " . $limit; } else { $query = "SELECT SQL_CALC_FOUND_ROWS sv.service_id, sv.service_description, sv.service_alias, " . @@ -319,6 +330,8 @@ function setO(_i) { $tpl->assign('limit', $limit); $tpl->assign('searchST', $search); +$tpl->assign("displayLockedChecked", $displayLockedChecked); +$tpl->assign('displayLocked', _("Display locked")); // Apply a template definition $renderer = new HTML_QuickForm_Renderer_ArraySmarty($tpl);