From 3feb6b2250c7df4fdc36bf680eac79ffba3a9543 Mon Sep 17 00:00:00 2001 From: Guillaume Bougard Date: Wed, 18 Oct 2023 18:50:35 +0200 Subject: [PATCH] fix: [toolbox] Replace 'Cancel' button by 'Go back to list' to clarify its real purpose --- lib/GLPI/Agent/HTTP/Server/ToolBox/Credentials.pm | 6 ++---- lib/GLPI/Agent/HTTP/Server/ToolBox/Inventory.pm | 4 ++-- lib/GLPI/Agent/HTTP/Server/ToolBox/IpRange.pm | 4 ++-- lib/GLPI/Agent/HTTP/Server/ToolBox/MibSupport.pm | 10 +++++----- lib/GLPI/Agent/HTTP/Server/ToolBox/Remotes.pm | 4 ++-- lib/GLPI/Agent/HTTP/Server/ToolBox/Scheduling.pm | 4 ++-- share/html/toolbox/common-language-en.txt | 1 + share/html/toolbox/common-language-fr.txt | 1 + share/html/toolbox/credentials-edit.tpl | 2 +- share/html/toolbox/inventory-edit.tpl | 2 +- share/html/toolbox/ip_range-edit.tpl | 2 +- share/html/toolbox/mibsupport-edit.tpl | 2 +- share/html/toolbox/remotes-edit.tpl | 2 +- share/html/toolbox/scheduling-edit.tpl | 2 +- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/GLPI/Agent/HTTP/Server/ToolBox/Credentials.pm b/lib/GLPI/Agent/HTTP/Server/ToolBox/Credentials.pm index 7415e31b1..4b3fd1311 100644 --- a/lib/GLPI/Agent/HTTP/Server/ToolBox/Credentials.pm +++ b/lib/GLPI/Agent/HTTP/Server/ToolBox/Credentials.pm @@ -417,12 +417,10 @@ sub _used_credentials { return join(",", sort values(%used)); } -sub _submit_cancel { +sub _submit_back_to_list { my ($self, $form) = @_; $self->reset_edit(); delete $form->{empty}; - # Select snmp version list from current selected snmp version - $form->{snmpversion} = delete $form->{'input/snmpversion'}; } my %handlers = ( @@ -434,7 +432,7 @@ my %handlers = ( 'submit/delete-v1-v2c' => \&_submit_delete_v1_v2c, 'submit/delete-v3' => \&_submit_delete_v3, 'submit/delete-remote' => \&_submit_delete_remotes, - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, ); sub handle_form { diff --git a/lib/GLPI/Agent/HTTP/Server/ToolBox/Inventory.pm b/lib/GLPI/Agent/HTTP/Server/ToolBox/Inventory.pm index e349a9c4f..46c7871da 100644 --- a/lib/GLPI/Agent/HTTP/Server/ToolBox/Inventory.pm +++ b/lib/GLPI/Agent/HTTP/Server/ToolBox/Inventory.pm @@ -249,7 +249,7 @@ sub update_template_hash { my %handlers = ( 'submit/add' => \&_submit_add, - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, 'submit/update' => \&_submit_update, 'submit/delete' => \&_submit_delete, 'submit/add-iprange' => \&_submit_addiprange, @@ -281,7 +281,7 @@ sub _submit_newtag { $self->need_save(jobs); } -sub _submit_cancel { +sub _submit_back_to_list { my ($self, $form) = @_; return unless $form; diff --git a/lib/GLPI/Agent/HTTP/Server/ToolBox/IpRange.pm b/lib/GLPI/Agent/HTTP/Server/ToolBox/IpRange.pm index 5998b68ec..b05d178de 100644 --- a/lib/GLPI/Agent/HTTP/Server/ToolBox/IpRange.pm +++ b/lib/GLPI/Agent/HTTP/Server/ToolBox/IpRange.pm @@ -405,7 +405,7 @@ sub _submit_rmcredential { } } -sub _submit_cancel { +sub _submit_back_to_list { my ($self, $form) = @_; $self->reset_edit(); delete $form->{empty}; @@ -417,7 +417,7 @@ my %handlers = ( 'submit/delete' => \&_submit_delete, 'submit/addcredential' => \&_submit_addcredential, 'submit/rmcredential' => \&_submit_rmcredential, - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, ); sub handle_form { diff --git a/lib/GLPI/Agent/HTTP/Server/ToolBox/MibSupport.pm b/lib/GLPI/Agent/HTTP/Server/ToolBox/MibSupport.pm index a194db5d0..3bf7207be 100644 --- a/lib/GLPI/Agent/HTTP/Server/ToolBox/MibSupport.pm +++ b/lib/GLPI/Agent/HTTP/Server/ToolBox/MibSupport.pm @@ -129,13 +129,13 @@ sub update_template_hash { my %handlers = ( aliases => { - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, 'submit/add/alias' => \&_submit_add_alias, 'submit/update/alias' => \&_submit_update_alias, 'submit/delete' => \&_submit_delete, }, sysobjectid => { - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, 'submit/add/sysobjectid' => \&_submit_add_sysobjectid, 'submit/update/sysobjectid' => \&_submit_update_sysobjectid, 'submit/delete' => \&_submit_delete, @@ -143,7 +143,7 @@ my %handlers = ( 'submit/del/rule' => \&_submit_del_rule_in_ruleset, }, sysorid => { - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, 'submit/add/sysorid' => \&_submit_add_sysorid, 'submit/update/sysorid' => \&_submit_update_sysorid, 'submit/delete' => \&_submit_delete, @@ -151,7 +151,7 @@ my %handlers = ( 'submit/del/rule' => \&_submit_del_rule_in_ruleset, }, rules => { - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, 'submit/add/rule' => \&_submit_add_rule, 'submit/update/rule' => \&_submit_update_rule, 'submit/delete' => \&_submit_delete, @@ -186,7 +186,7 @@ sub handle_form { } } -sub _submit_cancel { +sub _submit_back_to_list { my ($self) = @_; $self->reset_edit(); } diff --git a/lib/GLPI/Agent/HTTP/Server/ToolBox/Remotes.pm b/lib/GLPI/Agent/HTTP/Server/ToolBox/Remotes.pm index 89c25b03b..560d160c0 100644 --- a/lib/GLPI/Agent/HTTP/Server/ToolBox/Remotes.pm +++ b/lib/GLPI/Agent/HTTP/Server/ToolBox/Remotes.pm @@ -381,7 +381,7 @@ sub _submit_start { $agent->fork_exit(); } -sub _submit_cancel { +sub _submit_back_to_list { my ($self, $form) = @_; delete $form->{empty}; $self->reset_edit(); @@ -391,7 +391,7 @@ my %admin_handlers = ( 'submit/add-remote' => \&_submit_add, 'submit/update-remote' => \&_submit_update, 'submit/delete-remote' => \&_submit_delete, - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, ); my %handlers = ( diff --git a/lib/GLPI/Agent/HTTP/Server/ToolBox/Scheduling.pm b/lib/GLPI/Agent/HTTP/Server/ToolBox/Scheduling.pm index 25dddd1f7..eba89a792 100644 --- a/lib/GLPI/Agent/HTTP/Server/ToolBox/Scheduling.pm +++ b/lib/GLPI/Agent/HTTP/Server/ToolBox/Scheduling.pm @@ -326,7 +326,7 @@ sub _submit_delete { } } -sub _submit_cancel { +sub _submit_back_to_list { my ($self, $form) = @_; $self->reset_edit(); delete $form->{empty}; @@ -336,7 +336,7 @@ my %handlers = ( 'submit/add' => \&_submit_add, 'submit/update' => \&_submit_update, 'submit/delete' => \&_submit_delete, - 'submit/cancel' => \&_submit_cancel, + 'submit/back-to-list' => \&_submit_back_to_list, ); sub handle_form { diff --git a/share/html/toolbox/common-language-en.txt b/share/html/toolbox/common-language-en.txt index e4745b262..a0b14a6c7 100644 --- a/share/html/toolbox/common-language-en.txt +++ b/share/html/toolbox/common-language-en.txt @@ -37,6 +37,7 @@ Add: Name: Description: Cancel: +Go back to list: Reset: Reverse selection: diff --git a/share/html/toolbox/common-language-fr.txt b/share/html/toolbox/common-language-fr.txt index b7321af8e..abe02a860 100644 --- a/share/html/toolbox/common-language-fr.txt +++ b/share/html/toolbox/common-language-fr.txt @@ -37,6 +37,7 @@ Add: Ajouter Name: Nom Cancel: Annuler +Go back to list: Retourner à la liste Reset: Vider Reverse selection: Inverser la sélection diff --git a/share/html/toolbox/credentials-edit.tpl b/share/html/toolbox/credentials-edit.tpl index 88d5e1bc3..7ffaaf5e7 100644 --- a/share/html/toolbox/credentials-edit.tpl +++ b/share/html/toolbox/credentials-edit.tpl @@ -164,7 +164,7 @@ $credentials{$edit} ? "update' alt='"._("Update") : "add' alt='"._("Create Credential")}' value='1'>{ $credentials{$edit} ? _("Update") : _("Create Credential") } - +