From b8db092a0acf0c34cd78e35332f73636cdff6e22 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 27 Mar 2015 10:03:32 +0100 Subject: [PATCH] Bug 6911: Remember search terms in the log viewer tool MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The modules and actions selected by the user are now selected when a log search is done. Note that this patch also add the multiple attribute to the actions select in order to add the ability to select several actions. The code to do that already existed. Test plan: 1/ Go on the log viewer tool (tools/viewlog.pl) 2/ Launch a search with modules and actions selected. 3/ Confirm that the values you have selected is still selected after the search. Patch works as expected. Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/tools/viewlog.tt | 53 ++++++++++++------- tools/viewlog.pl | 16 +++--- 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index 96cac2d1e3..634092fbef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -67,24 +67,41 @@ -
  • - - -
  • -
  • - - -
  • +
  • + + +
  • +
  • + + +
  • diff --git a/tools/viewlog.pl b/tools/viewlog.pl index 6f5ea03325..9b81d509d3 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -47,7 +47,7 @@ $debug or $debug = $cgi_debug; my $do_it = $input->param('do_it'); my @modules = $input->param("modules"); my $user = $input->param("user"); -my @action = $input->param("action"); +my @actions = $input->param("actions"); my $object = $input->param("object"); my $info = $input->param("info"); my $datefrom = $input->param("from"); @@ -126,10 +126,10 @@ $template->param( if ($do_it) { my @data; - my ( $results, $modules, $action ); - if ( $action[0] ne '' ) { $action = \@action; } # match All means no limit + my ( $results, $modules, $actions ); + if ( $actions[0] ne '' ) { $actions = \@actions; } # match All means no limit if ( $modules[0] ne '' ) { $modules = \@modules; } # match All means no limit - $results = GetLogs( $datefrom, $dateto, $user, $modules, $action, $object, $info ); + $results = GetLogs( $datefrom, $dateto, $user, $modules, $actions, $object, $info ); @data = @$results; foreach my $result (@data) { @@ -188,16 +188,12 @@ if ($do_it) { dateto => $dateto, user => $user, object => $object, - action => \@action, info => $info, src => $src, + modules => \@modules, + actions => \@actions, ); - # Used modules - foreach my $module (@modules) { - $template->param( $module => 1 ); - } - output_html_with_http_headers $input, $cookie, $template->output; } else { -- 2.39.2