]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 24294: (QA follow-up) Add rollback and 008 default test
Marcel de Rooy [Tue, 25 Feb 2020 13:40:52 +0000 (13:40 +0000)]
Bug 24294: (QA follow-up) Add rollback and 008 default test

Default for 008 was not tested yet.
Only wondering if we should insert default values only when we meet an
undefined value. Or should we also add if we meet an empty string? Is the
latter not more realistic in MARC?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24294: Add default value support for control fields in ACQ framework
Jonathan Druart [Thu, 2 Jan 2020 11:09:27 +0000 (12:09 +0100)]
Bug 24294: Add default value support for control fields in ACQ framework

When trying to add an order using the ACQ framework with a 008@ tag,
Koha explodes:

Control fields (generally, just tags below 010) do not have subfields,
use data() at /home/vagrant/kohaclone/C4/Acquisition.pm line 3272.

Test plan:
Set a default value for a control field in the ACQ framework
Turn on UseACQFrameworkForBiblioRecords
Create a new order from a new record
The default value should be displayed
Save
=> No crash

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24605: (QA follow-up) Fix unencoded series link in staff interface
Katrin Fischer [Sun, 23 Feb 2020 21:25:00 +0000 (21:25 +0000)]
Bug 24605: (QA follow-up) Fix unencoded series link in staff interface

Same change as the first patch, but for the staff detail page.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24605: Fix unencoded series link
Nick Clemens [Thu, 6 Feb 2020 17:45:07 +0000 (17:45 +0000)]
Bug 24605: Fix unencoded series link

To test:
1 - Add an 830 to a record with a volume subfield separated by a semicolon
    830$aThe series ;$vvol 8.
2 - View the record in the opac
3 - Click the series link, no results
4 - View the link url - the semicolon is not encoded
5 - Apply patch
6 - link works
7 - URL is corrrectly encoded

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: (RM follow-up) Correction to copyright statement
Martin Renvoize [Tue, 25 Feb 2020 14:35:04 +0000 (14:35 +0000)]
Bug 23290: (RM follow-up) Correction to copyright statement

We have updated our copyright statements now ;)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24661: (RM follow-up) Check lang is defined
Martin Renvoize [Tue, 25 Feb 2020 14:26:57 +0000 (14:26 +0000)]
Bug 24661: (RM follow-up) Check lang is defined

This adds a check that the lang variable is defined before testing
against it. In normal operation this is likely a no-op, but it is
required for compiling templates during QA.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22522: Fix several REST API tests
Ere Maijala [Fri, 7 Feb 2020 11:49:46 +0000 (13:49 +0200)]
Bug 22522: Fix several REST API tests

Fixes among others the invalid use of json_has() which caused broken tests to pass with older Mojolicious versions.

Signed-off-by: Mason James <mason@kohaaloha.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22522: Fix route typo
Mason James [Tue, 4 Feb 2020 04:20:27 +0000 (17:20 +1300)]
Bug 22522: Fix route typo

Signed-off-by: Mason James <mason@kohaaloha.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22522: Add support for current Mojolicious and related packages
Ere Maijala [Wed, 29 Jan 2020 11:24:15 +0000 (13:24 +0200)]
Bug 22522: Add support for current Mojolicious and related packages

This patch allows tests to succeed with the following versions:
JSON::Validator 3.18
Mojolicious 8.32
Mojolicious::Plugin::OpenAPI 2.21

Also Mojolicious::Plugin::OpenAPI version 1.17 and later 1.x versions now work.

Calling valid_input in under() would cause ' Use of uninitialized value $_[2] ' in more recent OpenAPI plugins, so that was changed too. As far as I can see this does not affect authorization.

Signed-off-by: Mason James <mason@kohaaloha.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: (QA follow-up) Rename option to expand_entities_unsafe
Marcel de Rooy [Mon, 27 Jan 2020 14:06:36 +0000 (14:06 +0000)]
Bug 23290: (QA follow-up) Rename option to expand_entities_unsafe

When you enable options marked as unsafe, we hope that you know what
you are doing. You should, while having access to koha-conf.xml.

Test plan:
Verify that Security.t still passes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: (follow-up) Replace warning_like by warnings_like
Marcel de Rooy [Fri, 17 Jan 2020 10:30:16 +0000 (10:30 +0000)]
Bug 23290: (follow-up) Replace warning_like by warnings_like

Security.t does not pass anymore ;)
Due to bug 23290 the tests now trigger an additional runtime error that
we should also catch to let the tests pass again.

Test plan:
Run t/db_dependent/Koha/XSLT/Security.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: Add test for write_net
David Cook [Tue, 19 Nov 2019 13:56:30 +0000 (13:56 +0000)]
Bug 23290: Add test for write_net

Test plan:
Run t/db_dependent/Koha/XSLT/Security.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: Add test Koha/XSLT/Security.t
Marcel de Rooy [Fri, 15 Nov 2019 13:19:50 +0000 (13:19 +0000)]
Bug 23290: Add test Koha/XSLT/Security.t

Test plan:
Run it!

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: (follow-up) Disable expand_entities unless explicitly enabled
Marcel de Rooy [Fri, 17 Jan 2020 11:01:14 +0000 (11:01 +0000)]
Bug 23290: (follow-up) Disable expand_entities unless explicitly enabled

This follow-up refines the change made in the former patch.

See also
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838097
https://rt.cpan.org/Public/Bug/Display.html?id=118032

We do not want to depend now on the exact LibXML version, so we will
disable expand_entities unless it is explicitly enabled via the config
variable koha_xslt_security. (Allowing us to test if bad things will be
caught.)

The options key is now always added to the Security object.
The return from set_parser_options has been removed to allow disabling when
there is no koha-conf entry (which probably is the normal situation).

Test plan:
[1] Test the first example patch with and without the other patches (excl.
    the second example). Toggle expand_entities in koha-conf. Restart
    Plack and flush the cache each time. Evaluate results with the
    commit message of first example.
[2] Test both example patches with/without other patches.
    Toggle expand_entities. Restart etc. Evaluate results with commit
    message of second example (check tmp/breached.txt).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: Allow enabling expand_entities
Marcel de Rooy [Fri, 15 Nov 2019 12:41:32 +0000 (12:41 +0000)]
Bug 23290: Allow enabling expand_entities

Since libxml2 disables it now by default, we need to enable it for testing.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: Apply the changes in Security to Base now
Marcel de Rooy [Fri, 15 Nov 2019 11:04:53 +0000 (11:04 +0000)]
Bug 23290: Apply the changes in Security to Base now

Until now Base did not yet use Security. The security lines are removed
from Base here by calls to Security.
A new test must be added still.

Test plan:
Ensure that t/db_dependent/XSLT_Handler.t still passes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: Introduce Koha::XSLT::Security
Marcel de Rooy [Fri, 15 Nov 2019 10:59:40 +0000 (10:59 +0000)]
Bug 23290: Introduce Koha::XSLT::Security

Also adds a temporary stub for Koha::XSLT_Handler referring to Base.
This will be removed later.

Test plan:
Run t/db_dependent/XSLT_Handler.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: Rename XSLT_Handler
Marcel de Rooy [Fri, 15 Nov 2019 10:55:50 +0000 (10:55 +0000)]
Bug 23290: Rename XSLT_Handler

This is just a git move. Cannot be tested. (Easier for QA.)
The next patch adjusts paths etc. in the module.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23290: XSLT system preferences allow administrators to exploit XML and XSLT vulne...
David Cook [Thu, 23 May 2019 06:53:57 +0000 (16:53 +1000)]
Bug 23290: XSLT system preferences allow administrators to exploit XML and XSLT vulnerabilities

The problem is that administrators can provide XSLTs that
can read from the server and network and write to the server. The

This patch prevents the Koha::XSLT_Handler from running
XSLT stylesheets that call actions such as read_file, write_file,
read_net, and write_net as documented at
https://metacpan.org/pod/XML::LibXSLT#XML::LibXSLT::Security

(Previous tests suggested issues with XML external entities
causing read file like vulnerabilities but these were not
reproducible)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: (follow-up) Use To.json in results.tt
Jonathan Druart [Tue, 25 Feb 2020 11:00:28 +0000 (12:00 +0100)]
Bug 23777: (follow-up) Use To.json in results.tt

 Wrong copy/paste here!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24545: (follow-up) Fix license statements
Jonathan Druart [Mon, 24 Feb 2020 14:30:12 +0000 (15:30 +0100)]
Bug 24545: (follow-up) Fix license statements

Oops, missing # here!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24545: Fix newly added files
Jonathan Druart [Mon, 24 Feb 2020 13:05:09 +0000 (14:05 +0100)]
Bug 24545: Fix newly added files

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24545: (follow-up) Fix license statements
Jonathan Druart [Mon, 3 Feb 2020 09:46:26 +0000 (10:46 +0100)]
Bug 24545: (follow-up) Fix license statements

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24545: Fix find-license-problems.t to catch future wrong license statements
Jonathan Druart [Fri, 31 Jan 2020 13:43:39 +0000 (14:43 +0100)]
Bug 24545: Fix find-license-problems.t to catch future wrong license statements

File adjust to run tests and be executed on all our codebase.

Test plan:
- Apply this patch without the other one
- run the tests
=> Several failures
- apply the other patch
- run the tests
=> Should pass now

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24545: Fix license statements
Jonathan Druart [Fri, 31 Jan 2020 13:07:20 +0000 (14:07 +0100)]
Bug 24545: Fix license statements

Bug 9978 should have fixed them all, but some were missing.
We want all the license statements part of Koha to be identical, and
using the GPLv3 statement.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: DBRev 19.12.00.030
Martin Renvoize [Mon, 24 Feb 2020 13:30:13 +0000 (13:30 +0000)]
Bug 22880: DBRev 19.12.00.030

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: (QA follow-up) Replace use by require
Marcel de Rooy [Mon, 24 Feb 2020 12:12:58 +0000 (12:12 +0000)]
Bug 22880: (QA follow-up) Replace use by require

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: (QA follow-up) Pass lang instead of news_lang in masthead
Marcel de Rooy [Mon, 24 Feb 2020 12:00:33 +0000 (12:00 +0000)]
Bug 22880: (QA follow-up) Pass lang instead of news_lang in masthead

Might be a rebase problem. Not sure if I look at the third patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: (QA follow-up) Remove opacheader from C4::Auth
Marcel de Rooy [Mon, 24 Feb 2020 11:55:34 +0000 (11:55 +0000)]
Bug 22880: (QA follow-up) Remove opacheader from C4::Auth

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: (QA follow-up) Fix "koha_news_block: not found"
Marcel de Rooy [Fri, 21 Feb 2020 10:05:22 +0000 (10:05 +0000)]
Bug 22880: (QA follow-up) Fix "koha_news_block: not found"

To make qa tools happy again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: (follow-up) Process all installed languages, not just enabled
Owen Leonard [Thu, 12 Dec 2019 13:30:43 +0000 (13:30 +0000)]
Bug 22880: (follow-up) Process all installed languages, not just enabled

This patch changes the database update so that the system preference is
copied to news items in all installed languages, not just those enabled
in the OPAC.

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: Use placeholders
Jonathan Druart [Tue, 11 Jun 2019 14:31:07 +0000 (09:31 -0500)]
Bug 22880: Use placeholders

Always.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: (follow-up) Define OpacHeader variable for conditional
Owen Leonard [Wed, 4 Sep 2019 17:42:02 +0000 (17:42 +0000)]
Bug 22880: (follow-up) Define OpacHeader variable for conditional

This follow-up uses the updates introduced by Bug 23253 as a model for
improving the display of opacheader. Adding the OpacHeader variable
allows the template to check for its existence and display some
container markup around opacheader if it exists. This will help ease the
transition for libraries who depend on the #opacheader id for styling.

To test, apply the patch and test the OPAC with an 'opacheader' item
defined. The content should be displayed on the page inside '<div
id="opacheader"></div>.'

Delete the 'opacheader' news item and reload the OPAC page. There should
no longer be an #opacheader div.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: (follow-up) Loose ends: Better DB update, global inclusion, etc.
Owen Leonard [Wed, 11 Dec 2019 13:42:09 +0000 (13:42 +0000)]
Bug 22880: (follow-up) Loose ends: Better DB update, global inclusion, etc.

This patch makes a number of improvements and ties up some loose ends
where the old system preference usage wasn't getting replaced.

 - Removes news-specific code for defining the language of news
   items queried for the OPAC home page. An identical language variable
   is already defined globally.

   Previous to this patch an 'opacheader' news item would only appear on
   the OPAC home page. Now it should appear on all OPAC pages.

 - Changes the database update so that 'opacheader' news
   items will be inserted with a default title, matching the interface's
   requirement that the title field be populated.

 - The database update will also now insert the old opacheader system
   preference contents into the news item for all active languages as
   defined in the 'opaclanguages' system preference. This helps match
   the previous behavior in which the opacheader contents were the same
   for all languages.

 - Adds support for the new opacheader news item to the self checkout,
   self check-in, and OPAC maintenance pages.

 - Updates sysprefs.t which was using the opacheader preference to test
   on. I've changed it to use URLLinkText instead.

 - Removes the addition of the opacheader system preference from the
   installation SQL file.

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22880: Convert opacheader system preference to news block
Owen Leonard [Thu, 9 May 2019 13:52:30 +0000 (13:52 +0000)]
Bug 22880: Convert opacheader system preference to news block

This patch builds on Bug 22318 to move the opacheader system preference
into the Koha news system, making it possible to have language- and
library-specific content.

It extends the original patch by adding an option to the template plugin
specifying whether the content title should be shown (probably should be
a flag in opac_news). It also adds a wrapper div with the content
location as the ID (e.g. 'opacheader'). This will make it slightly more
backwards-compatible with CSS customizations.

To test you should have some content in the opacheader system
preference. Apply the patch and run the database update process.

 - Go to the OPAC and confirm that the content which was previously in
   the opacheader system preference now displays correctly where it was
   before.
 - In the staff client, go to Tools -> News and verify that the content
   from opacheader is now stored in a news item with the location
   'opacheader_en.'
 - Go to Administration -> System preferences and confirm that the
   opacheader preference has been removed.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24291: Update the item type form text for library limitation field
David Nind [Sat, 25 Jan 2020 11:01:52 +0000 (11:01 +0000)]
Bug 24291: Update the item type form text for library limitation field

Bug 15497 introduced the ability to limit item types by library.
However, the text next to the 'Library limitation' selection field on
the item type form mentions authorized values and is confusing.

The current text reads: "Select 'All libraries' if this authorized value
must be displayed all the time. Otherwise select libraries you want to
associate with this value."

This patch updates the text on the item type add or edit form for the
'Library limitation' field to something more understandable.

To test:
1) Apply the patch
2) Go to Administration > Basic parameters > Item types
3) Click 'Edit' for any item type
4) The text next to the 'Library limitation' field should now show
"Select 'All libraries' if all libraries use this item type. Otherwise,
select the specific libraries that use this item type."
5) Sign off

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24356: Make objects.search prefetch embedded relations
Agustin Moyano [Tue, 21 Jan 2020 15:39:49 +0000 (12:39 -0300)]
Bug 24356: Make objects.search prefetch embedded relations

This patch makes the Koha::Object(s) derived classes expose information
about prefetch-able relations. This is then used by a new helper to
generate the prefetch information for the DBIC query.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object* \
           t/db_dependent/Koha/REST/Plugin/Objects.t \
           t/Koha/REST/Plugin/Query.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24356: prefetch_whitelist tests
Tomas Cohen Arazi [Tue, 21 Jan 2020 18:46:53 +0000 (15:46 -0300)]
Bug 24356: prefetch_whitelist tests

This patch adds tests for the introduced methods.

To test:
1. Run the tests :-D
=> SUCCESS: They pass!
2. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24211: Compress/uncompress translation files
Bernardo Gonzalez Kriegel [Wed, 11 Dec 2019 00:02:41 +0000 (21:02 -0300)]
Bug 24211: Compress/uncompress translation files

This patch adds the ability to compress/uncompress
translations files.

On update/install the files are uncompressed first

The only gain is to use less space.

To test:
1) Apply the patch
2) Go to misc/translator
3) Try it
   $ ./translate compress fr-FR (check po/*.gz)
   $ ./translate uncompress fr-FR ( check normal files)
4) Try again with verbose mode
   $ ./translate compress fr-FR -v (list compressed files)
   $ ./translate uncompress fr-FR -v (list uncompressed files)
5) Try update compressed files
   $ ./translate compress fr-FR
   $ ./translate update fr-FR (result is uncompressed)
6) Try install compressed files
   $ ./translate compress fr-FR
   $ ./translate install fr-FR
7) Try compress all
   $ ./translate compress  (add '-v' for verbose output)
8) Try uncompress all
   $ ./translate uncompress  (add '-v' for verbose output)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24629: SIP patron items contains an array of hashes
Nick Clemens [Fri, 21 Feb 2020 12:28:30 +0000 (12:28 +0000)]
Bug 24629: SIP patron items contains an array of hashes

$patron->{items} contains the borrowers checkouts as an array of hashes
{ barcode => $item->barcode }

When printing to log we assumed these were only barcodes

This patch pushes the current checkout as a hash and maps the values retrieved to a string

To test:
1 - Enable SIP debug mode
2 - Perform multiple checkouts for a patron
3 - Note the messages like:
    koha koha_sip_koha[13575]: ILS::Checkout: patron 123 has checked out HASH(0x55a5b187f858), HASH(0x55a5b1896ad0), HASH(0x55a5b18a6cf0), 7826832
4 - Apply patch
5 - Restart all the things
6 - Do some checkouts via SIP
6 - Messages should now have barcodes

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24629: SIP log - Display barcode instead of hash
Jonathan Druart [Wed, 12 Feb 2020 09:22:29 +0000 (10:22 +0100)]
Bug 24629: SIP log - Display barcode instead of hash

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24693: Move GD from recommends to requires in cpanfile
Julian Maurice [Thu, 20 Feb 2020 07:29:37 +0000 (08:29 +0100)]
Bug 24693: Move GD from recommends to requires in cpanfile

Without it, catalogue/detail.pl dies (and probably other scripts too)

Test plan:
1. Uninstall GD, reload starman
2. Go to catalogue/detail.pl. Confirm that it dies
3. Reinstall GD, reload starman
4. Go to catalogue/detail.pl. Confirm that it work normally

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24114: (QA follow-up) Fix counts for lock, anonymize and delete
Marcel de Rooy [Fri, 29 Nov 2019 09:45:48 +0000 (09:45 +0000)]
Bug 24114: (QA follow-up) Fix counts for lock, anonymize and delete

Since these operations impact on the resultset, the counts should be
saved before.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24114: (follow-up) Resolve warning on non-numeric subtraction
Marcel de Rooy [Fri, 29 Nov 2019 09:17:19 +0000 (09:17 +0000)]
Bug 24114: (follow-up) Resolve warning on non-numeric subtraction

Argument "" isn't numeric in subtraction (-) at /usr/share/koha/Koha/Patrons.pm line 290.

Coming from an empty or undefined FailedLoginAttempts.

Test plan:
Verify that Koha/Patrons.t still passes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24114: Remove warn statements from Koha::Patrons
Jonathan Druart [Tue, 26 Nov 2019 10:11:35 +0000 (11:11 +0100)]
Bug 24114: Remove warn statements from Koha::Patrons

The warn must be done in the cronjob.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Followed this test plan (with two follow-ups applied):
[1] Prefs: UnsubscribeReflectionDelay=1, PatronAnonymizeDelay=2, PatronRemovalDelay=3, FailedLoginAttempts was undef
[2] Pick borrower and set expiry to NOW-2, and lock him (login_attempts=-1) Could be achieved too by settings FailedLoginAttempts and trying wrong passwords. Run cleanup job:
    Locked 0 patrons
    Anonymized 1 patrons
    Deleted 0 patrons
[3] Pick borrower, set expiry to NOW-3. Run cleanup job:
    Locked 0 patrons
    Anonymized 0 patrons
    Deleted 1 patrons

Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24682: Make UsageStatsGeolocation readonly (and redirect to the config page)
Jonathan Druart [Fri, 21 Feb 2020 09:31:54 +0000 (10:31 +0100)]
Bug 24682: Make UsageStatsGeolocation readonly (and redirect to the config page)

To prevent invalid values in this pref (and so on the server), we should
make this input readonly on the syspref page.
The sysprefs related to Hea should be edited from the dedicated page, so
also adding a note about that.

Test plan:
Search syspref with "UsageStats"
Notice the note about the admin page
Notice the UsageStatsGeolocation input is now readonly (and resized, to
display the whole value when filled)

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24527: misc/cronjobs/update_totalissues.pl problem with multiple items
Fridolin Somers [Tue, 28 Jan 2020 15:09:20 +0000 (16:09 +0100)]
Bug 24527: misc/cronjobs/update_totalissues.pl problem with multiple items

misc/cronjobs/update_totalissues.pl when issuing statistics table, no-incremental,  has a problem for biblio with multiple items.
The first SQL query gets the biblios linked to items with issues in statistics :

SELECT
  biblio.biblionumber, COUNT(statistics.itemnumber)
FROM
  biblio
LEFT JOIN
  items
ON
  (biblio.biblionumber=items.biblionumber)
LEFT JOIN
  statistics
ON
  (items.itemnumber=statistics.itemnumber)
WHERE
  statistics.type = 'issue'
$limit
GROUP BY
  biblio.biblionumber

The second SQL query is :
SELECT
  biblio.biblionumber, 0
FROM
  biblio
LEFT JOIN
  items
ON
  (biblio.biblionumber=items.biblionumber)
LEFT JOIN
  statistics
ON
  (items.itemnumber=statistics.itemnumber)
WHERE
  statistics.itemnumber IS NULL
GROUP BY
  biblio.biblionumber

The problem is that this second query will set to 0 where ANY item has no entry in statistics table.
So when running it sets 0 to the biblio that had a value from first
query.

I think the best fix is to use "WHERE statistics.type = 'issue'" inside que JOIN :
LEFT JOIN statistics ON (items.itemnumber=statistics.itemnumber AND statistics.type = 'issue')

Test plan :
1) Begin with an empty database
2) Create a biblio 1 with no items
3) Create a biblio 2 with 3 items
4) Create a biblio 3 with 2 items
5) Checkout and checkin all items of biblio 2
6) Checkout and checkin the firt item of biblio 3
7) run misc/cronjobs/update_totalissues.pl --use-stats -v
8) Check biblio 1 has biblioitems.totalissues = 0
9) Check biblio 2 has biblioitems.totalissues = 3
10) Without patch the biblio 3 has biblioitems.totalissues = 0
11) With patch the biblio 3 has biblioitems.totalissues = 1
12) Check misc/cronjobs/update_totalissues.pl --incremental is OK

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24707: Remove AMICUS from default fr-CA z39.50 servers
Caroline Cyr La Rose [Fri, 21 Feb 2020 17:46:00 +0000 (12:46 -0500)]
Bug 24707: Remove AMICUS from default fr-CA z39.50 servers

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24708: Update Z39.50 server attribute in fr-CA installation file
Caroline Cyr La Rose [Fri, 21 Feb 2020 18:11:14 +0000 (13:11 -0500)]
Bug 24708: Update Z39.50 server attribute in fr-CA installation file

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24705: Holds placed via SIP will be given first priority
Kyle M Hall [Fri, 21 Feb 2020 14:41:27 +0000 (09:41 -0500)]
Bug 24705: Holds placed via SIP will be given first priority

The SIP server does not calculate and pass a priority to AddReserve, which causes the hold to be given priority 1.

Test Plan:
1) Place a hold via SIP for a record with existing holds
2) Note the new hold is top priority
3) Apply this patch
4) Restart SIP
5) Repeat step 1
6) New hold should be last priority

Signed-off-by: Christofer Zorn <Christofer.Zorn@ajaxlibrary.ca>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24705: Add tests
Jonathan Druart [Mon, 24 Feb 2020 09:40:54 +0000 (10:40 +0100)]
Bug 24705: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24711: Don't add logout input to login form
Nick Clemens [Fri, 21 Feb 2020 21:11:37 +0000 (21:11 +0000)]
Bug 24711: Don't add logout input to login form

To test:
1 - Set OpacPublic syspref to 'Disable'
2 - Log in to OPAC
3 - Log out
4 - Try to log in again
5 - No error, but you get the login form again
6 - Apply patch
7 - Repeat
8 - This time you can log in again

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24706: Fix ergonomic issue on the list view if empty
Jonathan Druart [Fri, 21 Feb 2020 14:43:06 +0000 (15:43 +0100)]
Bug 24706: Fix ergonomic issue on the list view if empty

If the list is empty, the toolbar does not render correctly.
Buttons are displayed instead of links, also the "Sort" is displayed
when it should not

Test plan:
- Create a new list, do not add items
- Notice that the toolbar now renders correctly
- Use the different link to create/edit/delete
- Confirm that the sort link is not displayed
- Add a new item
- Confirm that the toolbar is looking the same as before

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24646: Move RoundFinesAtPayment to 'Fines policy' section
Nick Clemens [Wed, 12 Feb 2020 18:44:05 +0000 (18:44 +0000)]
Bug 24646: Move RoundFinesAtPayment to 'Fines policy' section

To test:
 - Search Admin->System preferences for 'RoundFinesAtPayment'
 - Note it is listed under self-check
 - Apply patch
 - Restart/refresh
 - Note it is now under Accounting -> Policy

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24588: (RM follow-up) Update debian/control
Martin Renvoize [Fri, 21 Feb 2020 17:12:56 +0000 (17:12 +0000)]
Bug 24588: (RM follow-up) Update debian/control

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24588: Prevent e-mails from Koha to be flagged as spam
Ulrich Kleiber [Wed, 5 Feb 2020 10:04:20 +0000 (11:04 +0100)]
Bug 24588: Prevent e-mails from Koha to be flagged as spam

Set the e-mail headers Mailer-X and MessageID by Koha,
to gain a better positive score from the spam filter.

To test:
1) Let Koha send an e-mail message.
2) Check the header of this e-mail message with your e-mail client.
   There should be no X-Mailer header with value 'Koha'. If there
   is an MessageID header, it is probably set by the MSA, e.g. Exim.
   Example:
      Message-Id: <E1iyZRY-0006XT-0t@FQDN>
3) Apply patch.
4) Repeat step 1.
5) Check the header of the new e-mail message with your e-mail client.
   There should be a X-Mailer header with value 'Koha' and a MessageID
   header with a value set by Koha.
   Example:
      X-Mailer: Koha
      Message-Id: <15807387030.B731e.18490@FQDN>
6) Sign off.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22655: Adding holds rules to Onboarding tool
Aleisha Amohia [Thu, 13 Feb 2020 02:47:20 +0000 (02:47 +0000)]
Bug 22655: Adding holds rules to Onboarding tool

This patch adds the following fields to the circ rule step in the
onboarding tool:
- holds allowed (total)
- holds allowed (daily)
- holds per record (count)

To test:
1) Apply patch, drop and recreate database, restart memcached and refresh page
2) Go through the installer and get to the final step of the onboarding
tool
3) Confirm the above fields are now available to set in your circulation
rule
4) Save and log in to Koha
5) Go to Admin -> Circ and fines rules
6) Confirm the fields saved correctly

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17510: enable use of subfield 0 in MMT actions
Andreas Roussos [Fri, 14 Feb 2020 19:50:39 +0000 (19:50 +0000)]
Bug 17510: enable use of subfield 0 in MMT actions

When adding MARC modification template (MMT) actions, if a subfield
value of 0 (zero) is entered it will not show up in the action's
description upon saving. Also, if you try to modify an authority or
biblio record using actions that refer to subfield 0 the procedure
will fail.

This patch fixes that.

Test plan:
0) Create a MARC modification template and add some actions to it,
   ideally testing all action types (Delete/Add new/Update existing
   or add new/Move/Copy/Copy and replace); make sure you input a 0
   (integer zero) in the text box for the subfield value(s).
1) As you save each action, observe that subfield 0 ($0) is missing
   from the action description.
2) Home > Tools > Batch record modification: try to modify a biblio-
   graphic record using the modification template you just created.
   Observe that you get an error in the system logs if you click on
   'Show MARC' or 'Modify selected records'.
3) Apply the patch.
4) Repeat steps 0-2. The subfield value ($0) should be displayed in
   the action description and the Batch record modification should
   work without problems.

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17510: update MMT-related unit tests
Andreas Roussos [Fri, 14 Feb 2020 20:07:50 +0000 (20:07 +0000)]
Bug 17510: update MMT-related unit tests

The unit tests related to MARC modification templates need to be
updated with extra tests specific to actions involving subfield 0.

Test plan:
0) Apply the patch.
1) Run the updated unit tests, they should pass without any errors:
   $ prove t/SimpleMARC.t
   $ prove t/db_dependent/MarcModificationTemplates.t

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 11161: Relabel 'child fund' to 'sub fund' in staff interface
Katrin Fischer [Sun, 12 Jan 2020 11:40:51 +0000 (12:40 +0100)]
Bug 11161: Relabel 'child fund' to 'sub fund' in staff interface

It was noted, that 'sub fund' might be a better term to use than
'child fund'. So this patch changes it.

To test, check with and without patch:

- Add a budget in acquisitions
- Add a fund in acquisitions
- Add a sub/child fund to your fund (label of menu item #1)
- Edit your first fund, check option to update owners of
  sub/child funds (#2)
- Try to delete your 'parent' fund (tooltip #3)
- Click on the greyed out entry (alert ÃÃ#4)

If you like the change, please sign-off. If you think otherwise,
please comment on the bug report.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23482: Fix BakerTaylor cover images on lists
Nick Clemens [Wed, 21 Aug 2019 02:24:11 +0000 (02:24 +0000)]
Bug 23482: Fix BakerTaylor cover images on lists

While this needs a username/pass to fully test, it should be possible to
verify the code changes by comparing to opac-results code

To test:
1 - Enable BakerTaylor images
2 - Enter your usernme and password
3 - Do not fill the BookStore URL
4 - Verify OPAC covers are working
5 - Save some times with covers to a public list
6 - Verify they do not display in list
7 - Apply patch
8 - Verify images now work

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17896: Remove duplicated use statements
Jonathan Druart [Fri, 21 Feb 2020 13:35:30 +0000 (14:35 +0100)]
Bug 17896: Remove duplicated use statements

and remove uneeded '&'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17896: load BakerTaylor module with use
Nick Clemens [Fri, 21 Feb 2020 12:56:53 +0000 (12:56 +0000)]
Bug 17896: load BakerTaylor module with use

We are incinsistent here, Amazon and Syndetics module are always loaeded in some places
BakerTaylor is conditional everywhere, and causes issues under plack

For simplicity sake I think we should just load this (small) module where it might be needed

To test:
1 - Disable Baker and Taylor images
2 - Restart plack
3 - Visit opac-readingrecord, opac-detail, opac-search, opac-shelves, opac-user
    Log in to opac
    Virew your reading history
    Make/view a list
    Search the catalog
    Look at an individual title
4 - Enable BakerTaylorEnabled
    If you don't have Baker and Taylor credentials, simply fudge them with bad data and enable
5 - Repeat steps above, in the word of Joubu "Kaboom"
6 - Apply patch
7 - Repeat 1-4
8 - You shoudl be able to load all the pages after enabling the pref

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24676: Remove <p/> typo in opac-auth.tt
David Cook [Tue, 18 Feb 2020 00:59:05 +0000 (00:59 +0000)]
Bug 24676: Remove <p/> typo in opac-auth.tt

This patch removes some trivial invalid HTML from opac-auth.tt

Test plan:
1. Apply patch
2. As an unauthenticated user, try to place a hold on a search result
e.g. http://localhost:8080/cgi-bin/koha/opac-reserve.pl?biblionumber=29
3. View source or use an inspector to see there is no <p></p> block
between <input type="submit" value="Log in" class="btn"> and
<div id="nologininstructions">

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: (QA follow-up) Fix TT closing braces
Martin Renvoize [Fri, 21 Feb 2020 07:03:15 +0000 (07:03 +0000)]
Bug 23777: (QA follow-up) Fix TT closing braces

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: Use To.json in request.tt
Jonathan Druart [Tue, 12 Nov 2019 08:30:40 +0000 (09:30 +0100)]
Bug 23777: Use To.json in request.tt

Test plan:
Use quotes in a library's name, then place an item on hold for a patron
that cannot do it.
If you are allowed to overwrite this restriction you will get a warning:
"This item normally cannot be put on hold except for patrons from
BRANCHNAME"
The library's name should be correcty displayed

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: Use TO.json in value_builder/unimarc_field_4XX.tt
Jonathan Druart [Tue, 12 Nov 2019 08:30:27 +0000 (09:30 +0100)]
Bug 23777: Use TO.json in value_builder/unimarc_field_4XX.tt

No idea how to test this but, as other fixes work, this one should,
right?

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: Use To.json in results.tt
Jonathan Druart [Tue, 12 Nov 2019 08:24:42 +0000 (09:24 +0100)]
Bug 23777: Use To.json in results.tt

Test plan:
Search for a string with quote and confirm that it is correctly
highlighted in the result list.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: Use To.json in authorities.tt
Jonathan Druart [Tue, 12 Nov 2019 08:11:30 +0000 (09:11 +0100)]
Bug 23777: Use To.json in authorities.tt

No fix here.

Test plan:
Edit GENRE/FORM 040$a
With text: Original catalo'"ging age"'ncy
Save, you get the alert

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: Use To.json in preferences.tt
Jonathan Druart [Tue, 12 Nov 2019 07:55:30 +0000 (08:55 +0100)]
Bug 23777: Use To.json in preferences.tt

Test plan:
Search for "foo bar" (with double quotes) in the sysprefs

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: Fix for the advanced editor
Jonathan Druart [Tue, 12 Nov 2019 08:19:31 +0000 (09:19 +0100)]
Bug 23777: Fix for the advanced editor

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23777: Fix auth finder escaping
Jonathan Druart [Mon, 11 Nov 2019 18:03:41 +0000 (19:03 +0100)]
Bug 23777: Fix auth finder escaping

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22359: Prevent undercollection at the server
Martin Renvoize [Fri, 24 Jan 2020 12:23:39 +0000 (12:23 +0000)]
Bug 22359: Prevent undercollection at the server

This patch adds some additional handling to prevent undercollection of
fees at the server side.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22359: Improvements to payment collection inputs
Martin Renvoize [Wed, 20 Nov 2019 16:01:56 +0000 (16:01 +0000)]
Bug 22359: Improvements to payment collection inputs

This patch attempts to clarify the uses of the various input fields on
the paycollect screens.

It does this by adding validation to the form such that entering a
'collected' value that is lower than the 'paid' value is now forbidden.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17702: (RM follow-up) Remove use of I18N tt
Martin Renvoize [Thu, 20 Feb 2020 16:39:52 +0000 (16:39 +0000)]
Bug 17702: (RM follow-up) Remove use of I18N tt

This patch removes the use of the I18N TT plugin in introduced for all
strings in the new template. We're not yet ready to use this plugin for
all strings as we need to further investigate performance for such a
move and perhaps add template compilation.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17702: DBRev 19.12.00.029
Martin Renvoize [Thu, 20 Feb 2020 14:51:02 +0000 (14:51 +0000)]
Bug 17702: DBRev 19.12.00.029

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17702: (QA follow-up) Add new field to kohastructure
Martin Renvoize [Mon, 10 Feb 2020 14:30:19 +0000 (14:30 +0000)]
Bug 17702: (QA follow-up) Add new field to kohastructure

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17702: Add UI to manage account credit types
Julian Maurice [Fri, 7 Feb 2020 12:17:54 +0000 (13:17 +0100)]
Bug 17702: Add UI to manage account credit types

It is the same as for debit types.

It adds a new column `archived` in table `account_credit_types` that has
the same purpose than `account_debit_types.archived`

Test plan:
0. Apply patch && run updatedatabase && update_dbix_class_files
1. Go to Admin » Credit types
2. Add a new credit type, give it a code and a description and check
   'Can be manually added'
3. Go to a patron's accounting section, 'Create manual credit' tab
4. Verify that the new credit type appears
5. Return to Admin » Credit types and archive the credit type
6. Verify that the new credit type is not available anymore in 'Create
   manual credit'
7. Restore the credit type and verify that it is available again
8. Create a manual credit with the new credit type
9. Go to Reports » Cash register and make sure you can find the
   transaction by filtering on transaction type
10. Edit the new credit type and set some library limitations, make sure
    that the credit type doesn't appear if you're connected to a library
    you didn't selected, and that it appears if you're connected to a
    library you selected.

Note to QA team:
The change in Koha/Account.pm, I added it because otherwise Koha died
when adding a manual credit with a custom type.
In that case, offset type will default to 'Manual Credit'. I'm not sure
if that is the best thing to do. I'm open to suggestions :)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24657: Do not explicitely pass a branchcode
Jonathan Druart [Fri, 14 Feb 2020 09:23:39 +0000 (10:23 +0100)]
Bug 24657: Do not explicitely pass a branchcode

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24657: Fix t/db_dependent/Koha/Item.t and t/db_dependent/Holds.t
Agustin Moyano [Thu, 13 Feb 2020 17:16:20 +0000 (14:16 -0300)]
Bug 24657: Fix t/db_dependent/Koha/Item.t and t/db_dependent/Holds.t

on t/db_dependent/Koha/Item.t on line 172 I created 2 Koha::Library::Groups like this

my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );

I didn't realize this was creating 2 new libraries that sometimes messed up with tests, so I changed it to this

my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1, branchcode => undef } } );
my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1, branchcode => undef } } );

on t/db_dependent/Holds.t on line 1058 I created 3 libraries like this

my $library1  = $builder->build_object( { class => 'Koha::Libraries' } );
my $library2  = $builder->build_object( { class => 'Koha::Libraries' } );
my $library3  = $builder->build_object( { class => 'Koha::Libraries' } );

but they needed to be pickup_locations, and sometimes they wheren't set as such, so I changed it to this

my $library1  = $builder->build_object( { class => 'Koha::Libraries', value => {pickup_location => 1} } );
my $library2  = $builder->build_object( { class => 'Koha::Libraries', value => {pickup_location => 1} } );
my $library3  = $builder->build_object( { class => 'Koha::Libraries', value => {pickup_location => 1} } );

To test:
1. do not apply this patch
2. in bash:
   for i in {1..300}; do echo "loop $i"; prove t/db_dependent/Koha/Item.t t/db_dependent/Holds.t; if [ "$?" = "1" ]; then break; fi; done
3. Grab a cup of coffee (or tea if you are healthy) and wait for a while
4. Whithin 300 iterations there should be an error in any of both scripts and for loop should exit
5. Apply this patch
6. repeat step 2 and 3 (decaff this time!)
7. All 300 loops should pass
8. Sign off

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14567: DBRev 19.12.00.028
Martin Renvoize [Thu, 20 Feb 2020 09:12:35 +0000 (09:12 +0000)]
Bug 14567: DBRev 19.12.00.028

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14567: Compiled CSS
Martin Renvoize [Thu, 20 Feb 2020 09:09:45 +0000 (09:09 +0000)]
Bug 14567: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14567: Add a browse interface to the OPAC
Robin Sheat [Tue, 21 Jul 2015 05:14:09 +0000 (17:14 +1200)]
Bug 14567: Add a browse interface to the OPAC

This is an interface for quick and efficient browsing through records.

It presents a page at /cgi-bin/koha/opac-browse.pl that allows you to
enter the prefix of an author, title, or subject and it'll give you a
list of the options that match that. You can then scroll through these
and select the one you're after. Selecting it provides a list of records
that match that particular search.

To Test:
 1 - Apply patches
 2 - Update database (updatedatabase on kohadevbox)
 3 - Compile the CSS
   https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client
   yarn build --view=opac on kohadevbox
 4 - Enable the new syspref OpacBrowseSearch
 5 - Have ES running and some records in it
     SearchEngine syspref set to Elasticsearch
 6 - Browse to opac home, click 'Browse search' link
for your site)
 7 - Test searching for author, title, and subject
 8 - Verify that results are returned in expected order
 9 - Experiment with fuzziness
     https://www.elastic.co/guide/en/elasticsearch/reference/5.6/common-options.html#fuzziness
     Options are: exact (0 edits), fuzzy (1 edit), very fuzzy (2 edits)
10 - Click any result and verify specific titles are correct
11 - Click through title to record and verify it is the correct record
12 - Test that disabling pref removes the link on the opac home

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14898: Add button at manual invoice to redirect to pay tab
Julian Maurice [Wed, 5 Feb 2020 14:07:23 +0000 (15:07 +0100)]
Bug 14898: Add button at manual invoice to redirect to pay tab

Test plan:
1. Create manual invoice for any patron and click on "Save", you should
   be redirected to Account tab
2. Create manual invoice for any patron and click on "Save and pay", you
   should be redirected to Account tab

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14647: Make spelling in file format pull downs match
Katrin Fischer [Sun, 16 Feb 2020 05:41:46 +0000 (05:41 +0000)]
Bug 14647: Make spelling in file format pull downs match

While bibliographic had XML and MARC, authorities had xml and marc
in the pull down. This just makes both the same.

To test:
- Look at the pull downs on both tabs and verify they are
  now using the same spelling

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14647: (follow-up) Fix script not detecting XML output format
Aleisha Amohia [Sun, 9 Feb 2020 21:32:12 +0000 (21:32 +0000)]
Bug 14647: (follow-up) Fix script not detecting XML output format

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14647: (follow-up) Changes to script
Aleisha Amohia [Mon, 10 Jul 2017 02:07:38 +0000 (02:07 +0000)]
Bug 14647: (follow-up) Changes to script

This patch adds the necessary changes to the script so that the filename
extensions works for exporting authorities.

To test:
1) Attempt to export with all filetypes for biblios and authorities
2) Confirm the extension for the exported file (after clicking the
    Export button) is correct for each one

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14647: Make the file name extension dynamic on exporting records
Gus [Tue, 19 Jan 2016 23:33:14 +0000 (23:33 +0000)]
Bug 14647: Make the file name extension dynamic on exporting records

Test -
1. go to cgi-bin/koha/tools/export.pl
2. Check that both tabs ("Export bibliographic records & Rxport authority records") do the following
3. In Output format
4. When changing "File format" from dropdown it update "file name"
5. Still works with user inputted names

Works as expected.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24532: DBRev 19.12.00.027
Martin Renvoize [Thu, 20 Feb 2020 08:45:29 +0000 (08:45 +0000)]
Bug 24532: DBRev 19.12.00.027

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24532: Fix misidentified credit_types from bug 23049
Martin Renvoize [Thu, 30 Jan 2020 14:39:22 +0000 (14:39 +0000)]
Bug 24532: Fix misidentified credit_types from bug 23049

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24532: Fix original DB update for bug 23049
Martin Renvoize [Thu, 30 Jan 2020 13:19:37 +0000 (13:19 +0000)]
Bug 24532: Fix original DB update for bug 23049

Pathalogical cases of Payments and Writeoffs being converted to debits
are identified during the DB update for bug 23049, but we are not
correctly limiting to those types accountlines when subsequently
populating the debit_type field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24670: (QA follow-up) Add missing $rules definition
Martin Renvoize [Wed, 19 Feb 2020 21:30:22 +0000 (21:30 +0000)]
Bug 24670: (QA follow-up) Add missing $rules definition

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24670: Fetch all circulation rules at once to fix perf regression
Jonathan Druart [Mon, 17 Feb 2020 11:54:56 +0000 (12:54 +0100)]
Bug 24670: Fetch all circulation rules at once to fix perf regression

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24538: Handle Net::Netmask parser errors
David Cook [Wed, 19 Feb 2020 02:07:30 +0000 (02:07 +0000)]
Bug 24538: Handle Net::Netmask parser errors

This patch switches from the new() to new2() constructor,
which will return an undef value when it fails to parse a value.

This patch warns on parser failures, but otherwise silently drops
the invalid value, and returns objects for any valid input it can parse.
This way one mistake won't disable the whole feature.

To test:
1. Run the unit test t/Koha/Middlware/RealIP.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24538: Add unit tests for Koha::Middleware::RealIP
David Cook [Wed, 19 Feb 2020 02:05:07 +0000 (02:05 +0000)]
Bug 24538: Add unit tests for Koha::Middleware::RealIP

This patch adds some unit tests for Koha::Middleware::RealIP

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17611: Change 'Pending order' to 'Quantity ordered'
Katrin Fischer [Sun, 12 Jan 2020 09:11:12 +0000 (10:11 +0100)]
Bug 17611: Change 'Pending order' to 'Quantity ordered'

Picking Quantity ordered as it seems more in line with
other pages in Koha where we show information. We always
show the quantity, so it makes sense to also have this
label on the 'order search' and 'copy existing order'.

Order search
1) Make sure you have some orders in your acq module
2) Go to the top and do an empty orders search
3) Review the column headings of the search results
4) Find "Pending order"

Order from existing order (copy)
1) Create or choose an existing open basket
2) 'Add to basket' - 'From existing orders'
3) Search to find some of your orders
4) Look at the column headings, find 'Pending order'
5) Pick some orders and fill out order information, save
6) Summary: Find 'Pending order' in the table again

x) Apply the patch and make sure all 'Pending' orders
above have been changed to 'Quantity ordered'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24103: (RM follow-up) Correction to updatedatabase text
Martin Renvoize [Wed, 19 Feb 2020 17:12:06 +0000 (17:12 +0000)]
Bug 24103: (RM follow-up) Correction to updatedatabase text

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 11297: DBRev 19.12.00.026
Martin Renvoize [Wed, 19 Feb 2020 16:11:13 +0000 (16:11 +0000)]
Bug 11297: DBRev 19.12.00.026

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 11297: (QA follow-up) Make table headings match other pages
Katrin Fischer [Sun, 16 Feb 2020 03:09:07 +0000 (03:09 +0000)]
Bug 11297: (QA follow-up) Make table headings match other pages

The patch set adds a table hading for the Actions column on the
summary page. If you compare with other pages, this should
be labelled 'Actions' instead of 'Options'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 11297: (follow-up) Add html filter to new input field
Katrin Fischer [Wed, 29 Aug 2018 10:20:02 +0000 (10:20 +0000)]
Bug 11297: (follow-up) Add html filter to new input field

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>