Permalink
Browse files

Bug 7038 Contextual help is always in English

When another language than English is selected in pro interface, the software
strings are in this language, but when clicking ?, on the top right of any
page, the contextual help page which pop-up is always in English.

This patch fixes this bug and another side bug affecting editing contextual
help when not in English. help.pl script were in sync with the recently
patched/improved theme/language/template selection.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Context help now matches the selected template language.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
  • Loading branch information...
1 parent f9fdf43 commit ef5d4d7bf8caf84c917fdbcd22005767b6f9e960 @fredericd fredericd committed with ranginui Oct 16, 2011
Showing with 7 additions and 15 deletions.
  1. +4 −6 edithelp.pl
  2. +3 −9 help.pl
View
@@ -97,14 +97,12 @@ ($;$)
} else {
(-w $file) or $error =
"WARNING: You will not be able save, because your webserver cannot write to '$file'. Contact your admin about help file permissions.";
- open (INFILE, $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked
+ open (my $fh, '<', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked
my $help = '';
- while ( my $inp = <INFILE> ) {
- unless ( $inp =~ /INCLUDE/ ) {
- $help .= $inp;
- }
+ while ( <$fh> ) {
+ $help .= /\[% INCLUDE .* %\](.*)$/ ? $1 : $_;
}
- close INFILE;
+ close $fh;
$template->param( 'help' => $help );
$type = 'save';
}
View
12 help.pl
@@ -32,15 +32,9 @@
$refer = $query->referer() if !$refer || $refer eq 'undefined';
$refer =~ /koha\/(.*)\.pl/;
-my $from = "modules/help/$1.tt";
-
-my $htdocs = C4::Context->config('intrahtdocs');
-my ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
-unless ( -e "$htdocs/$theme/$lang/$from" ) {
- $from = "modules/help/nohelp.tt";
- ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
-}
-my $template = C4::Templates->new('intranet', "$htdocs/$theme/$lang/$from");
+my $from = "help/$1.tt";
+
+my $template = C4::Templates::gettemplate($from, 'intranet', $query);
$template->param( referer => $refer );
output_html_with_http_headers $query, "", $template->output;

0 comments on commit ef5d4d7

Please sign in to comment.