Bugzilla – Attachment 5472 Details for
Bug 6649
Error when editing the help screens.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 6649 Allow help screens editing
SIGNED-OFF-Bug-6649-Allow-help-screens-editing.patch (text/plain), 6.22 KB, created by
Katrin Fischer
on 2011-09-20 06:40:58 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 6649 Allow help screens editing
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-09-20 06:40:58 UTC
Size:
6.22 KB
patch
obsolete
>From 535677be4d3c836b60cb5890134b53cd841b6f8d Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Sat, 17 Sep 2011 09:09:23 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 6649 Allow help screens editing >Content-Type: text/plain; charset="utf-8" > >edithelp.pl hadn't been updated to allow help screen editing. > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> > >Only a note: Apparently you need to be 'superlibrarian' permission >to edit help pages. >--- > edithelp.pl | 31 +++++++++--------- > help.pl | 4 ++- > .../prog/en/modules/help/circ/circulation-home.tt | 34 ++++++++++--------- > 3 files changed, 37 insertions(+), 32 deletions(-) > >diff --git a/edithelp.pl b/edithelp.pl >index d1975ba..4d7e0c0 100755 >--- a/edithelp.pl >+++ b/edithelp.pl >@@ -41,7 +41,7 @@ my $error; > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >- template_name => "help/edithelp.tmpl", >+ template_name => "help/edithelp.tt", > query => $input, > type => "intranet", > authnotrequired => 0, >@@ -63,29 +63,30 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > > sub _get_filepath ($;$) { > my $referer = shift; >- $referer =~ /.*koha\/(.+)\.pl.*/; >- my $from = "help/$1.tmpl"; >+ $referer =~ /koha\/(.*)\.pl/; >+ my $from = "help/$1.tt"; > my $htdocs = C4::Context->config('intrahtdocs'); > my ($theme, $lang) = themelanguage( $htdocs, $from, "intranet", $input ); > $debug and print STDERR "help filepath: $htdocs/$theme/$lang/modules/$from"; > return "$htdocs/$theme/$lang/modules/$from"; > } > >-if ( $type eq 'addnew' ) { >- $type = 'create'; >-} >-elsif ( $type eq 'create' || $type eq 'save' ) { >+$type = 'create' if $type eq 'addnew'; >+if ( $type eq 'create' || $type eq 'save' ) { > my $file = _get_filepath($referer); >- unless (open (OUTFILE, ">$file")) {$error = "Cannot write file: '$file'";} else { >- #open (OUTFILE, ">$file") or die "Cannot write file: '$file'"; # unlikely death, since we just checked >+ open my $fh, ">", $file; >+ if ( $fh ) { > # file is open write to it >- print OUTFILE "<!-- TMPL_INCLUDE NAME=\"help-top.inc\" -->\n"; >- print OUTFILE ($type eq 'create') ? "<div class=\"main\">\n$help\n</div>" : $help; >- print OUTFILE "\n<!-- TMPL_INCLUDE NAME=\"help-bottom.inc\" -->\n"; >- close OUTFILE; >+ print $fh >+ " [% INCLUDE 'help-top.inc' %]\n", >+ $type eq 'create' ? "<div class=\"main\">\n$help\n</div>" : $help, >+ "\n[% INCLUDE 'help-bottom.inc' %]\n"; >+ close $fh; > print $input->redirect("/cgi-bin/koha/help.pl?url=$oldreferer"); > } >- >+ else { >+ $error = "Cannot write file: '$file'"; >+ } > } > elsif ( $type eq 'modify' ) { > # open file load data, kill include calls, pass data to the template >@@ -98,7 +99,7 @@ elsif ( $type eq 'modify' ) { > open (INFILE, $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked > my $help = ''; > while ( my $inp = <INFILE> ) { >- unless ( $inp =~ /TMPL\_INCLUDE/ ) { >+ unless ( $inp =~ /INCLUDE/ ) { > $help .= $inp; > } > } >diff --git a/help.pl b/help.pl >index 58354b0..7208a8a 100755 >--- a/help.pl >+++ b/help.pl >@@ -28,7 +28,8 @@ use CGI; > my $query = new CGI; > > # find the script that called the online help using the CGI referer() >-our $refer = $query->referer(); >+our $refer = $query->param('url'); >+$refer = $query->referer() if !$refer || $refer eq 'undefined'; > > $refer =~ /koha\/(.*)\.pl/; > my $from = "modules/help/$1.tt"; >@@ -40,6 +41,7 @@ unless ( -e "$htdocs/$theme/$lang/$from" ) { > ( $theme, $lang ) = themelanguage( $htdocs, $from, "intranet", $query ); > } > my $template = C4::Templates->new('intranet', "$htdocs/$theme/$lang/$from"); >+$template->param( referer => $refer ); > > output_html_with_http_headers $query, "", $template->output; > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt >index 2bae339..1f069b7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt >@@ -1,23 +1,25 @@ >-[% INCLUDE 'help-top.inc' %] >- >+ [% INCLUDE 'help-top.inc' %] > <h1>Circulation</h1> >- >-<p>Circulation functions can be accessed in several different ways. On the main page of the staff client there are some quick links in the center of the page to check items out, in or transfer them. For a complete listing of Circulation functions you can visit the Circulation page which is linked from the top left of every page or from the center of the main page.</p> >- >-<p>Before circulating your collection you will want to set your Global System Preferences, Basic Parameters and Patrons & Circulation Rules.</p> >- >-<p>While in Circulation you can jump between the tabs on the quick search box at the top of the screen by using the following hot keys:</p> >- >+<p> >+Circulation functions can be accessed in several different ways. On the main page of the staff client there are some quick links in the center of the page to check items out, in or transfer them. For a complete listing of Circulation functions you can visit the Circulation page which is linked from the top left of every page or from the center of the main page. >+</p> >+<p> >+Before circulating your collection you will want to set your Global System Preferences, Basic Parameters and Patrons & Circulation Rules. >+</p> >+<p> >+While in Circulation you can jump between the tabs on the quick search box at the top of the screen by using the following hot keys: >+</p> > <ul> > <li>jump to the catalog search with Alt+Q</li> > <li>jump to the checkout with Alt+U >-<ul> >- <li>this will not work for Mac user</li> >-</ul> >-</li> >+ <ul> >+ <li>this will not work for Mac user</li> >+ </ul> >+ </li> > <li>jump to the checkin with Alt+R</li> > </ul> >+<p style="background-color: #ffe599"> >+Tip: Mac users use the OPTION button in place of ALT >+</p> > >-<p style="background-color: #ffe599">Tip: Mac users use the OPTION button in place of ALT</p> >- >-[% INCLUDE 'help-bottom.inc' %] >\ No newline at end of file >+[% INCLUDE 'help-bottom.inc' %] >-- >1.7.4.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6649
:
5447
|
5448
|
5449
| 5472