Main Koha release repository https://koha-community.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.5 KiB

  1. #!/usr/bin/perl
  2. # Copyright 2017 Koha Development team
  3. #
  4. # This file is part of Koha.
  5. #
  6. # Koha is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # Koha is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Koha; if not, see <http://www.gnu.org/licenses>.
  18. use Modern::Perl;
  19. use CGI qw ( -utf8 );
  20. use C4::Auth;
  21. use C4::Context;
  22. use Koha::Manual;
  23. my $query = CGI->new;
  24. # We need to call get_template_and_user to let it does the job correctly
  25. # for the language
  26. my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
  27. {
  28. template_name => "intranet-main.tt", # Just a valid template path
  29. query => $query,
  30. type => "intranet",
  31. authnotrequired => 1,
  32. }
  33. );
  34. # find the script that called the online help using the CGI referer()
  35. our $refer = $query->param('url');
  36. $refer = $query->referer() if !$refer || $refer eq 'undefined';
  37. my $language = C4::Languages::getlanguage( $query );
  38. my $manual_url = Koha::Manual::get_url($refer, $language);
  39. print $query->redirect($manual_url);