Bug 19817: Remove local help files + edit help feature
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 14 Dec 2017 18:11:36 +0000 (15:11 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 6 Sep 2018 17:32:27 +0000 (17:32 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Makefile.PL
edithelp.pl [deleted file]
koha-tmpl/intranet-tmpl/prog/css/help.css [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/audio_alerts.tt [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/automatic_item_modification_by_age.tt [deleted file]
t/db_dependent/00-strict.t

index ada08b9..924782f 100644 (file)
@@ -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 (executable)
index a65a504..0000000
+++ /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 <http://www.gnu.org/licenses>.
-
-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' ? "<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
-       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 (file)
index 62d2ca2..0000000
+++ /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 (file)
index 5b824cf..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-[% INCLUDE 'help-top.inc' %]
-
-<h1>Audio alerts</h1>
-
-<p>This section of Koha lets you specify a given sound to play when a given jQuery selector is matched.</p>
-
-<p><em>Note: Use system preference 'AudioAlerts' to enable/disable sounds.</em><p>
-
-<h2>Adding a new alert</h2>
-
-<p>To add a new alert:</p>
-
-<ul>
-    <li>Locate the "Add new alert" form.</li>
-    <li>
-        Enter a selector in the "selector" input, you can see documentation on jQuery selectors <a href="http://api.jquery.com/category/selectors/">here</a>.
-        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).
-    <li>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.</li>
-    <li>At this point, you can preview your sound by clicking the "Play sound" button</li>
-    <li>Click "Save alert" and your done!</li>
-</ul>
-
-<h2>Sound precedence</h2>
-
-<p>Sounds will be played in order from top to bottom. That is, the first select that finds a match will have its sound played.</p>
-
-<p>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.</o>
-
-<h2>Deleting alerts</h2>
-
-<p>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 (file)
index fc5ab9d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-[% INCLUDE 'help-top.inc' %]
-<h1>Automatic item modifications by age configuration</h1>
-
-<p>This configuration page allows to configure the rules for the automatic item modifications by age cronjob script.</p>
-
-<p>Libraries can manage the 'new_status' field for items. With this script, it will be possible to:<p>
-<ul>
-  <li>know easily what are the new items in the catalogue.</li>
-  <li>display an icon in the search results for new items.</li>
-  <li>configure circulation and fine rules depending the 'new_status' field.</li>
-  <li>get a RSS/Atom feeds on these new items.</li>
-</ul>
-
-<h3>How to work the configuration page?</h3>
-<p>There are 3 values to define:</p>
-<h4>The duration</h4>
-<p>This value corresponds to the duration an item is considered as new.</p>
-<h4>The conditions</h4>
-<p>Conditions should be defined if you want to test some values before to substitute fields in the items.</p>
-<p>They are cumulatives but you can separate with a pipe '|' for a field with several values.</p>
-<h4>The substitutions</h4>
-<p>Substitutions are changes to apply to the matching items.</p>
-<p>At least one substitution must be defined, else there is no sense to launch the script.</p>
-<p>If the value is an empty string, the field will be deleted.</p>
-<h3>Examples</h3>
-<p>You want to remove the items.new_status value for items created 10 days ago:</p>
-<ul>
-  <li>Duration: 10 days</li>
-  <li>No condition</li>
-  <li>Substitution: items.new_status = '' (no value in the input)</li>
-</ul>
-
-<p>You want to change the items.ccode=1 to items.ccode=2 for items created 7 days ago.
-<ul>
-  <li>Duration: 7 days</li>
-  <li>Condition: items.ccode = 1</li>
-  <li>Substitution: items.ccode = 2</li>
-</ul>
-
-<h3>How to execute the cronjob script?</h3>
-<p>The cronjob script is misc/cronjobs/automatic_item_modification_by_age.pl.</p>
-<p>Try the -h parameter in order to see the help.</p>
-<p>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.</p>
-
-[% INCLUDE 'help-bottom.inc' %]
index 052b8a1..c91c601 100755 (executable)
@@ -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',