Bug 17600: Standardize our EXPORT_OK
[srvgit] / catalogue / search-history.pl
index 20e3b82..42bef7c 100755 (executable)
 # <http://www.gnu.org/licenses>
 
 use Modern::Perl;
-use CGI;
+use CGI qw ( -utf8 );
 
-use C4::Auth;
+use C4::Auth qw( get_template_and_user );
 use C4::Search::History;
-use C4::Output;
+use C4::Output qw( output_html_with_http_headers );
 
-my $cgi = new CGI;
+my $cgi = CGI->new;
 
 my ($template, $loggedinuser, $cookie) = get_template_and_user({
     template_name   => 'catalogue/search-history.tt',
     query           => $cgi,
     type            => "intranet",
-    authnotrequired => 0,
     flagsrequired   => {catalogue => 1},
 });
 
@@ -47,14 +46,11 @@ if ( $action eq 'delete' ) {
     C4::Search::History::delete(
         {
             userid => $loggedinuser,
-            sessionid => $sessionid,
-            type => $type,
-            previous => $previous
+            id     => [ $cgi->param('id') ],
         }
     );
     # Redirecting to this same url so the user won't see the search history link in the header
-    my $uri = $cgi->url();
-    print $cgi->redirect($uri);
+    print $cgi->redirect('/cgi-bin/koha/catalogue/search-history.pl');
 
 # Showing search history
 } else {