From 206ba82a46eff0d3b29ae6ed65bd3f3b0ef8bbde Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 14 Dec 2017 15:11:36 -0300 Subject: [PATCH] Bug 19817: Remove local help files + edit help feature Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- Makefile.PL | 1 - edithelp.pl | 116 -------------------- koha-tmpl/intranet-tmpl/prog/css/help.css | 5 - .../prog/en/modules/help/admin/audio_alerts.tt | 33 ------ .../tools/automatic_item_modification_by_age.tt | 45 -------- t/db_dependent/00-strict.t | 3 +- 6 files changed, 1 insertions(+), 202 deletions(-) delete mode 100755 edithelp.pl delete mode 100644 koha-tmpl/intranet-tmpl/prog/css/help.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/audio_alerts.tt delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/automatic_item_modification_by_age.tt diff --git a/Makefile.PL b/Makefile.PL index ada08b9..924782f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -306,7 +306,6 @@ my $target_map = { './course_reserves' => 'INTRANET_CGI_DIR', './docs/history.txt' => { target => 'DOC_DIR', trimdir => -1 }, './offline_circ' => 'INTRANET_CGI_DIR', - './edithelp.pl' => 'INTRANET_CGI_DIR', './etc' => { target => 'KOHA_CONF_DIR', trimdir => -1 }, './etc/zebradb' => { target => 'ZEBRA_CONF_DIR', trimdir => -1 }, './etc/pazpar2' => { target => 'PAZPAR2_CONF_DIR', trimdir => -1 }, diff --git a/edithelp.pl b/edithelp.pl deleted file mode 100755 index a65a504..0000000 --- a/edithelp.pl +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/perl - -# Copyright 2007 Liblime Ltd -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -use Modern::Perl; -use C4::Output; -use C4::Templates; -use C4::Auth; -use CGI qw ( -utf8 ); - -use vars qw($debug); - -BEGIN { - $debug = $ENV{DEBUG} || 0; -} - -our $input = new CGI; - -my $type = $input->param('type') || ''; -my $referer = $input->param('referer') || ''; -my $oldreferer = $referer; -my $help = $input->param('help') || ''; -# strip any DOS-newlines that TinyMCE may have sneaked in -$help =~ s/\r//g; -my $error; - -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "help/edithelp.tt", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => { - catalogue => 1, - circulate => 1, - parameters => 1, - borrowers => 'edit_borrowers', - permissions => 1, - reserveforothers => 1, - reserveforself => 1, - editcatalogue => 1, - updatecharges => 1, - }, - debug => 1, - } -); - -sub _get_filepath ($;$) { - my $referer = shift; - $referer =~ /koha\/(.*)\.pl/; - my $file = $1; - $file =~ s/[^0-9a-zA-Z_\-\/]*//g; - my $from = "help/$file.tt"; - my $htdocs = C4::Context->config('intrahtdocs'); - my ($theme, $lang, $availablethemes) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $input ); - $debug and print STDERR "help filepath: $htdocs/$theme/$lang/modules/$from"; - return "$htdocs/$theme/$lang/modules/$from"; -} - -$type = 'create' if $type eq 'addnew'; -if ( $type eq 'create' || $type eq 'save' ) { - my $file = _get_filepath($referer); - open my $fh, ">:encoding(utf-8)", $file; - if ( $fh ) { - # file is open write to it - print $fh - " [% INCLUDE 'help-top.inc' %]\n", - $type eq 'create' ? "
\n$help\n
" : $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 - my $file = _get_filepath($referer, 1); # 2nd argument triggers themelanguage call - if (! -r $file) { - $error = "Cannot read file: '$file'."; - } else { - (-w $file) or $error = - "WARNING: You will not be able to save, because your webserver cannot write to '$file'. Contact your admin about help file permissions."; - open (my $fh, '<:encoding(utf-8)', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked - my $help = ''; - while ( <$fh> ) { - $help .= /\[% INCLUDE .* %\](.*)$/ ? $1 : $_; - } - close $fh; - $template->param( 'help' => $help ); - $type = 'save'; - } -} - -$template->param( - 'referer' => $referer, - 'type' => $type, -); -($error) and $template->param('error' => $error); -output_html_with_http_headers $input, "", $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/css/help.css b/koha-tmpl/intranet-tmpl/prog/css/help.css deleted file mode 100644 index 62d2ca2..0000000 --- a/koha-tmpl/intranet-tmpl/prog/css/help.css +++ /dev/null @@ -1,5 +0,0 @@ -/* help.css For inclusion on help pages */ - -body#help { - padding : 1em; -} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/audio_alerts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/audio_alerts.tt deleted file mode 100644 index 5b824cf..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/audio_alerts.tt +++ /dev/null @@ -1,33 +0,0 @@ -[% INCLUDE 'help-top.inc' %] - -

Audio alerts

- -

This section of Koha lets you specify a given sound to play when a given jQuery selector is matched.

- -

Note: Use system preference 'AudioAlerts' to enable/disable sounds.

- -

Adding a new alert

- -

To add a new alert:

- -
    -
  • Locate the "Add new alert" form.
  • -
  • - Enter a selector in the "selector" input, you can see documentation on jQuery selectors here. - For example, if you use the selector "#circ_impossible" your selected sound will be triggered when a checkout for a patron is not possible (such as the barcode not being found). -
  • Enter a sound to be played, you can either select a built-in Koha sound using the pulldown selector, or you can enter a full URL to a sound file on another server.
  • -
  • At this point, you can preview your sound by clicking the "Play sound" button
  • -
  • Click "Save alert" and your done!
  • -
- -

Sound precedence

- -

Sounds will be played in order from top to bottom. That is, the first select that finds a match will have its sound played.

- -

To change the precedence of a given alert, use the four arrows to move it up, down, or to the top or bottom of the list. - -

Deleting alerts

- -

To delete one or more alerts, check the checkboxes for those alerts you wish to delete, then click the "Delete selected alerts" button and confirm you want to delete those alerts. - -[% INCLUDE 'help-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/automatic_item_modification_by_age.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/automatic_item_modification_by_age.tt deleted file mode 100644 index fc5ab9d..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/automatic_item_modification_by_age.tt +++ /dev/null @@ -1,45 +0,0 @@ -[% INCLUDE 'help-top.inc' %] -

Automatic item modifications by age configuration

- -

This configuration page allows to configure the rules for the automatic item modifications by age cronjob script.

- -

Libraries can manage the 'new_status' field for items. With this script, it will be possible to:

-

    -
  • know easily what are the new items in the catalogue.
  • -
  • display an icon in the search results for new items.
  • -
  • configure circulation and fine rules depending the 'new_status' field.
  • -
  • get a RSS/Atom feeds on these new items.
  • -
- -

How to work the configuration page?

-

There are 3 values to define:

-

The duration

-

This value corresponds to the duration an item is considered as new.

-

The conditions

-

Conditions should be defined if you want to test some values before to substitute fields in the items.

-

They are cumulatives but you can separate with a pipe '|' for a field with several values.

-

The substitutions

-

Substitutions are changes to apply to the matching items.

-

At least one substitution must be defined, else there is no sense to launch the script.

-

If the value is an empty string, the field will be deleted.

-

Examples

-

You want to remove the items.new_status value for items created 10 days ago:

-
    -
  • Duration: 10 days
  • -
  • No condition
  • -
  • Substitution: items.new_status = '' (no value in the input)
  • -
- -

You want to change the items.ccode=1 to items.ccode=2 for items created 7 days ago. -

    -
  • Duration: 7 days
  • -
  • Condition: items.ccode = 1
  • -
  • Substitution: items.ccode = 2
  • -
- -

How to execute the cronjob script?

-

The cronjob script is misc/cronjobs/automatic_item_modification_by_age.pl.

-

Try the -h parameter in order to see the help.

-

Without any parameter, the script will be launched in a dry-run mode. If the -c (or --confirm) flag is given, the script will apply the changes.

- -[% INCLUDE 'help-bottom.inc' %] diff --git a/t/db_dependent/00-strict.t b/t/db_dependent/00-strict.t index 052b8a1..c91c601 100755 --- a/t/db_dependent/00-strict.t +++ b/t/db_dependent/00-strict.t @@ -19,8 +19,7 @@ my @dirs = ( 'catalogue', 'cataloguing', 'changelanguage.pl', 'circ', 'debian', 'docs', - 'edithelp.pl', 'errors', - 'fix-perl-path.PL', 'help.pl', + 'errors', 'fix-perl-path.PL', 'help.pl', 'installer', 'koha_perl_deps.pl', 'kohaversion.pl', 'labels', 'mainpage.pl', 'Makefile.PL', -- 1.7.2.5