Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit ef5d4d7bf8caf84c917fdbcd22005767b6f9e960 1 parent f9fdf43
Frédéric Demians authored ranginui committed

Showing 2 changed files with 7 additions and 15 deletions. Show diff stats Hide diff stats

  1. 10  edithelp.pl
  2. 12  help.pl
10  edithelp.pl
@@ -97,14 +97,12 @@ ($;$)
97 97
 	} else {
98 98
 		(-w $file) or $error = 
99 99
 			"WARNING: You will not be able save, because your webserver cannot write to '$file'. Contact your admin about help file permissions.";
100  
-    	open (INFILE, $file) or die "Cannot read file '$file'";		# unlikely death, since we just checked
  100
+    	open (my $fh, '<', $file) or die "Cannot read file '$file'";		# unlikely death, since we just checked
101 101
 		my $help = '';
102  
-		while ( my $inp = <INFILE> ) {
103  
-			unless ( $inp =~ /INCLUDE/ ) {
104  
-				$help .= $inp;
105  
-			}
  102
+        while ( <$fh> ) {
  103
+            $help .= /\[% INCLUDE .* %\](.*)$/ ? $1 : $_;
106 104
 		}
107  
-		close INFILE;
  105
+		close $fh;
108 106
     	$template->param( 'help' => $help );
109 107
 		$type = 'save';
110 108
 	}
12  help.pl
@@ -32,15 +32,9 @@
32 32
 $refer = $query->referer()  if !$refer || $refer eq 'undefined';
33 33
 
34 34
 $refer =~ /koha\/(.*)\.pl/;
35  
-my $from = "modules/help/$1.tt";
36  
-
37  
-my $htdocs = C4::Context->config('intrahtdocs');
38  
-my ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
39  
-unless ( -e "$htdocs/$theme/$lang/$from" ) {
40  
-    $from = "modules/help/nohelp.tt";
41  
-    ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
42  
-}
43  
-my $template = C4::Templates->new('intranet', "$htdocs/$theme/$lang/$from");
  35
+my $from = "help/$1.tt";
  36
+
  37
+my $template = C4::Templates::gettemplate($from, 'intranet', $query);
44 38
 $template->param( referer => $refer );
45 39
 
46 40
 output_html_with_http_headers $query, "", $template->output;

0 notes on commit ef5d4d7

Please sign in to comment.
Something went wrong with that request. Please try again.