]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 14957: Clean controller
Jonathan Druart [Fri, 7 May 2021 10:06:30 +0000 (12:06 +0200)]
Bug 14957: Clean controller

Too many imports and unecessary complicated init of $rules

There are certainly other things to improve, like the "op" handling,
standardize names of "op", etc.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Fix for jQuery undefined
Martin Renvoize [Thu, 6 May 2021 07:23:46 +0000 (08:23 +0100)]
Bug 14957: (QA follow-up) Fix for jQuery undefined

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Fix script name
Martin Renvoize [Thu, 6 May 2021 07:07:38 +0000 (08:07 +0100)]
Bug 14957: (QA follow-up) Fix script name

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Fix template indentation
Martin Renvoize [Wed, 5 May 2021 15:49:11 +0000 (16:49 +0100)]
Bug 14957: (QA follow-up) Fix template indentation

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Update for bug 27846
Martin Renvoize [Wed, 5 May 2021 15:43:37 +0000 (16:43 +0100)]
Bug 14957: (QA follow-up) Update for bug 27846

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Update for bug 17858
Martin Renvoize [Wed, 5 May 2021 15:28:30 +0000 (16:28 +0100)]
Bug 14957: (QA follow-up) Update for bug 17858

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Update for bug 26703
Martin Renvoize [Wed, 5 May 2021 15:13:07 +0000 (16:13 +0100)]
Bug 14957: (QA follow-up) Update for bug 26703

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 14957: (QA follow-up) Update for bug 20054

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 14957: (QA follow-up) Update for bug 20053

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 14957: (QA follow-up) Update for bug 23271

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Add missing filters
Martin Renvoize [Wed, 5 May 2021 15:07:32 +0000 (16:07 +0100)]
Bug 14957: (QA follow-up) Add missing filters

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Comment 'bulkmarcimport' temporarily
Martin Renvoize [Mon, 29 Mar 2021 12:31:59 +0000 (13:31 +0100)]
Bug 14957: (QA follow-up) Comment 'bulkmarcimport' temporarily

It appears this patchset doesn't fully support bulkmarcimport (see bug
25539 for details).

At this time, to get this bug moving I think we should comment out the
ability to define rules that affect bulkmarcimport and then we can fix
and re-enable that feature at a later date.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Rename and move admin link
Martin Renvoize [Mon, 29 Mar 2021 09:31:52 +0000 (10:31 +0100)]
Bug 14957: (QA follow-up) Rename and move admin link

This patch renames 'MARC overlay rules' to 'Record overlay rules' and
moves it up the list to just below 'Record matching rules' to make it
more contextually ordered.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Fix translation issues
Martin Renvoize [Mon, 29 Mar 2021 09:21:23 +0000 (10:21 +0100)]
Bug 14957: (QA follow-up) Fix translation issues

This patch fixes all the translation issues I could spot in the
marc-overlay-rules template.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Clarify 'context' param
Tomas Cohen Arazi [Fri, 26 Mar 2021 19:48:24 +0000 (16:48 -0300)]
Bug 14957: (QA follow-up) Clarify 'context' param

This patch renames the (passed through) 'context' param for
'overlay_context'. I propose doing so, because in Koha-land 'context'
has a special meaning, related to C4::Context and it reads ambigous.

The patch itself is pretty trivial.

Tests should pass:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Biblio/MarcOverlayRules.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 14957: (follow-up) Clarify 'context' param

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (follow-up) marc_merge_rules_modules removed
Tomas Cohen Arazi [Fri, 26 Mar 2021 19:38:31 +0000 (16:38 -0300)]
Bug 14957: (follow-up) marc_merge_rules_modules removed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: DBIC changes
Tomas Cohen Arazi [Fri, 26 Mar 2021 17:52:07 +0000 (14:52 -0300)]
Bug 14957: DBIC changes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: Feature hidden in menues if no other 'cagaloguing' permissions
Tomas Cohen Arazi [Fri, 26 Mar 2021 16:16:09 +0000 (13:16 -0300)]
Bug 14957: Feature hidden in menues if no other 'cagaloguing' permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Rename 'merge' => 'overlay'
Tomas Cohen Arazi [Fri, 26 Mar 2021 16:12:11 +0000 (13:12 -0300)]
Bug 14957: (QA follow-up) Rename 'merge' => 'overlay'

This patch acknowledges the fact that 'merging' has a different meaning
in Koha than the behavior this great patchset introduces. The more
idiomatic way of describing the behavior is to talk about 'overlay rules'.

This patch also:
- Fixes kohastructure.sql missing table encoding a collation
- Fixes the atomic update completely missing a table
- Moves the syspref entry to 'Importing', probably a rebase issue

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 14957: (QA follow-up) Fix syntax error in atomicupdate

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 14957: Fix imports in tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 14957: Fix imports in marc-overlay-rules.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 14957: Fix syspref's values

It didn't switch off when set to "don't use"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD amended patch: Fix license statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Add tooltips
Martin Renvoize [Fri, 26 Mar 2021 17:00:27 +0000 (17:00 +0000)]
Bug 14957: (QA follow-up) Add tooltips

This patch adds an info-tooltip to the field rules in the table header
to expand on their meaning to reduce the need to read the documentation
each time you come to use the configuration tool

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: (QA follow-up) Button styling
Martin Renvoize [Fri, 26 Mar 2021 16:31:39 +0000 (16:31 +0000)]
Bug 14957: (QA follow-up) Button styling

This patch updates the action buttons to include btn-default and
switched from btn-sm to btn-xs to match other similar UI's found in
datatable based admin pages.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: fix context for batchmod and batchimport
David Gustafsson [Fri, 5 Mar 2021 13:35:32 +0000 (14:35 +0100)]
Bug 14957: fix context for batchmod and batchimport

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: Updated schema files
Aleisha Amohia [Wed, 10 Feb 2021 03:49:16 +0000 (16:49 +1300)]
Bug 14957: Updated schema files

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14957: Merge rules system for merging of MARC records
David Gustafsson [Thu, 2 Feb 2017 12:36:38 +0000 (13:36 +0100)]
Bug 14957: Merge rules system for merging of MARC records

Add a rule based system for merging MARC records to for example
prevent field data from being overwritten.

To test:
    1. Apply this patch.
    2. Log in to staff client.
    3. Enable new syspref MARCMergeRules.
    4. Click the new link "MARC merge rules" in the "Catalog"
       section of the Koha administration page.
    5. Create a new rule:
       Module: source, Filter: *, Tag: 245, Preset: Protect.
    6. Clicking "Edit" should allow you to edit corresponding rule.
    7. Clicking "Delete" should remove corresponding rule after confirmation.
    8. Selecting one or more rules followed by clicking "Delete
       selected" should remove all selected rules after confirmation.
    9. Try creating a rule with tag set to "**", the other options does
       not matter. Verify that saving this rule produces an error
       message complaining about invalid tag regular expression.
    10. Try creating a rule with tag set to "008" (or other control
        field) and set Appended: Append and Removed: Skip, the other
        options does not matter. Verify that saving this rule produces
        an error message complaining about invalid combination of actions
        for control field.
    11. With the 245 rule in step 5 in place, edit a bibliographic record,
        change 245a for example (which should be Title for MARC21) and save.
    12. Verify that the changes has not been saved.
    13. Create a new rule:
        Module: source, Filter: intranet, Tag: 245, Preset: Overwrite.
    14. Repeat step 12, and verify that the changes has now been saved.
    15. Run tests in t/db_dependent/Biblio/MarcMergeRules.t and very
        that all tests pass.

Sponsored-by: Halland County Library
Sponsored-by: Catalyst IT
Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: DBRev 21.06.00.037
Jonathan Druart [Tue, 26 Oct 2021 13:44:19 +0000 (15:44 +0200)]
Bug 11175: DBRev 21.06.00.037

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Add tests
Jonathan Druart [Tue, 26 Oct 2021 13:16:54 +0000 (15:16 +0200)]
Bug 11175: Add tests

Add coverage for the message set by get_marc_components when the search
fails.
Also cleans a bit the weird return comparisons.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Test message contents for analytics error
Marcel de Rooy [Tue, 26 Oct 2021 12:46:25 +0000 (12:46 +0000)]
Bug 11175: (QA follow-up) Test message contents for analytics error

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Restore bug 29284
Martin Renvoize [Tue, 26 Oct 2021 09:48:11 +0000 (10:48 +0100)]
Bug 11175: (QA follow-up) Restore bug 29284

This patch restores the functional fixes introduced in bug 29284 and
also prevents the 'Show analytics' link from displaying when no
component parts are found and inline display is enabled.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Fixed error with $err vs $error(s) :)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Do not fetch twice
Marcel de Rooy [Sun, 24 Oct 2021 12:11:02 +0000 (12:11 +0000)]
Bug 11175: (QA follow-up) Do not fetch twice

We were fetching components in the first call of XSLTParse4Display
(opac-detail around L220). And again (opac-detail around L660).
Same for catalogue/detail.pl.
Moving the XSLT block in both scripts and removing the code from
XSLT.pm which again makes the tests obsolete.

Not hiding the link when there are components. Might be helpful too.

Also fixing biblionumber in the XSLTParse4Display call for parts.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Remove caching _components
Marcel de Rooy [Fri, 22 Oct 2021 10:02:09 +0000 (10:02 +0000)]
Bug 11175: (QA follow-up) Remove caching _components

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Uniformize ComponentParts in template
Jonathan Druart [Fri, 22 Oct 2021 08:15:45 +0000 (10:15 +0200)]
Bug 11175: Uniformize ComponentParts in template

More robust as it takes empty array into account

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Add syspref MaxComponentRecords to remove hardcoded limit
Jonathan Druart [Fri, 22 Oct 2021 07:46:43 +0000 (09:46 +0200)]
Bug 11175: Add syspref MaxComponentRecords to remove hardcoded limit

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Restore link to more results
Martin Renvoize [Mon, 18 Oct 2021 15:32:57 +0000 (16:32 +0100)]
Bug 11175: (QA follow-up) Restore link to more results

This patch restores the link to 'more results' should you exceed the
hard coded limit of 300 component parts.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Be more specific with title fields
Martin Renvoize [Mon, 18 Oct 2021 15:14:07 +0000 (16:14 +0100)]
Bug 11175: (QA follow-up) Be more specific with title fields

We were using the MARC::Record title accessor, but that just stringifies
all the subfields of field 245. The indexer, and the XSLT, specifically
use 245a so we need to do the same.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Display components tab if no holdings
Martin Renvoize [Tue, 12 Oct 2021 09:31:47 +0000 (10:31 +0100)]
Bug 11175: (QA follow-up) Display components tab if no holdings

This patch updates the default details tab selection to components for
the case when there are no holdings attached to the record and there is
no HTML5 content to display in preference.

Bug 11175: (QA follow-up) OPAC - Display components tab if no holdings

As for the staff client, this selects the default tab to be 'Components'
for the case where no holdings are found.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Account for difference in simple_search return
Martin Renvoize [Tue, 12 Oct 2021 08:49:34 +0000 (09:49 +0100)]
Bug 11175: (QA follow-up) Account for difference in simple_search return

Thanks to a comment from Andrew, I discovered that the return from
simple_search_compat actually differs depending on if you are using
ElasticSearch or Zebra. The 'results' arrayref contains MARC::Record
objects for ES and raw marc strings if you are using Zebra.  This is
actually already dealt with in the misnamed new_record_from_zebra
function inside C4::Search.. so this patch simply replaces our
MARC::Record instantiation code with a call to that function.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (follow-up) Use clean_search_term
Martin Renvoize [Wed, 1 Sep 2021 15:16:33 +0000 (16:16 +0100)]
Bug 11175: (follow-up) Use clean_search_term

This patch uses the now public clean_search_term from bug 28316 to
sanitize the title string and prevent crashes in elastic search when
title contain reserved characters.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Display components in own tab
Martin Renvoize [Mon, 9 Aug 2021 07:30:12 +0000 (08:30 +0100)]
Bug 11175: Display components in own tab

This patch updates the display so that rather than displaying the
components using the main XSLT and then using CSS to move them into a
box on the right side for display, which causes issues with RTL records;
We instead add them in a new tab beneath the rest of the record details
alongside holdings and other details.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Bug 11175: (QA follow-up) Fixes for bug 12561

Bug 12561 changed the prototype for XSLTParse4Display so this patcha
accounts for the additional calls to that method introduced in this
patchset.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Fix queries
Martin Renvoize [Fri, 6 Aug 2021 16:01:38 +0000 (17:01 +0100)]
Bug 11175: (QA follow-up) Fix queries

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Only get biblio once
Martin Renvoize [Fri, 6 Aug 2021 12:00:29 +0000 (13:00 +0100)]
Bug 11175: (QA follow-up) Only get biblio once

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Move get_component_part_query
Martin Renvoize [Fri, 6 Aug 2021 11:44:23 +0000 (12:44 +0100)]
Bug 11175: (QA follow-up) Move get_component_part_query

This patch removes Koha::Util::Search in preference to embedding the
search query builder in Koha::Biblio as get_analytics_query.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Bug 11175: (QA follow-up) Rename back to get_marc_components

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Take account of bug 15851
Martin Renvoize [Tue, 3 Aug 2021 13:29:27 +0000 (14:29 +0100)]
Bug 11175: (QA follow-up) Take account of bug 15851

We can simplify the code introduced by bug 15851 by moving the
'show_analytics_link' variable assignment into C4::XSLT and thus making
the code more DRY.

Taking the code in bug 15851 as inspiration this patch also adds proper
handling for UseControlNumber vs EasyAnalytics style 773 linking and
ensures we only return analytic component parts and no other records
containing 773's.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (QA follow-up) Move preference to 'Display'
Martin Renvoize [Tue, 3 Aug 2021 08:03:13 +0000 (09:03 +0100)]
Bug 11175: (QA follow-up) Move preference to 'Display'

The 'ShowComponentRecords' preference was displaying under the 'Export'
section in the cataloging system preferences tab. As a display related
feature, I felt it was more appropriate to put it into the 'Display'
section.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (follow-up) Rename routine get_marc_components
Martin Renvoize [Fri, 9 Jul 2021 11:30:35 +0000 (12:30 +0100)]
Bug 11175: (follow-up) Rename routine get_marc_components

For consistency with other marc data accessor methods rename the new
'components' method to 'get_marc_components'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (follow-up) make atomic update idempotent
Petro Vashchuk [Tue, 27 Apr 2021 09:50:56 +0000 (12:50 +0300)]
Bug 11175: (follow-up) make atomic update idempotent

Atomic update tries to insert line into system preferences even if it's
already there. This patch fixes that by adding 'IGNORE' to the query,
making it idempotent.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (follow-up) Add tests
Joonas Kylmälä [Wed, 10 Jun 2020 17:21:46 +0000 (20:21 +0300)]
Bug 11175: (follow-up) Add tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Remove outdated info about Elasticsearch not being suppported
Joonas Kylmälä [Fri, 12 Feb 2021 12:03:15 +0000 (14:03 +0200)]
Bug 11175: Remove outdated info about Elasticsearch not being suppported

Support for Elasticsearch was added in commit "Bug 11175: Add
Elasticsearch support".

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Search using double quotes to support Elasticsearch
Joonas Kylmälä [Tue, 24 Nov 2020 17:19:04 +0000 (19:19 +0200)]
Bug 11175: Search using double quotes to support Elasticsearch

With Elasticsearch if you would use the search string here without the
change to double quotes, i.e.

(rcn='1234' AND cni='FI-XXX') OR rcn='FI-XXX 1234'

then the search would somehow manage to return a record with 001 =
1234 and 003 = FI-XXX. Using double quotes prevents that. Also using
parenthesis around the latter part of the OR seems to work:

(rcn='1234' AND cni='FI-XXX') OR (rcn='FI-XXX 1234')

Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Limit the amount of component parts returned
Joonas Kylmälä [Fri, 13 Nov 2020 17:52:18 +0000 (19:52 +0200)]
Bug 11175: Limit the amount of component parts returned

There was already before this a limit of 100 results when using
Elasticsearch but then the list of component parts was truncated
silently. This change now limits the amount to hard coded limit of 300
which is still fast to render. Also when the 300 component part record
limit is reached there is a link in the list now to list all the
records via the cataloging search.

To test:
   1) Create 300+ component part records and see if the link to list
      all the component part records shows up
   2) Make sure prove t/Koha/Util/Search.t passes

Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Bug 11175: (QA follow-up) Replace en dash with hyphen in perldoc

This fixes the QA tool failure.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Keep component part record list items inside the box
Joonas Kylmälä [Fri, 13 Nov 2020 17:08:17 +0000 (19:08 +0200)]
Bug 11175: Keep component part record list items inside the box

Without this the number denoting the component part item in the list
will overflow and is partly hidden.

To test:
 1) Create 100 component parts
 2) Notice without this patch the number next to the component part is
    not fully shown

Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Add Elasticsearch support
Nick Clemens [Mon, 2 Nov 2020 14:59:33 +0000 (14:59 +0000)]
Bug 11175: Add Elasticsearch support

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (follow-up) Relocate and reword ShowComponentRecords syspref description
Joonas Kylmälä [Mon, 2 Nov 2020 15:24:39 +0000 (17:24 +0200)]
Bug 11175: (follow-up) Relocate and reword ShowComponentRecords syspref description

The syspref is not only affecting staff interface so moving it to
Cataloguing section. Added also notes about UNIMARC and Elasticsearch
not being supported.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (follow-up) Return empty array if no components
Joonas Kylmälä [Wed, 10 Jun 2020 17:20:19 +0000 (20:20 +0300)]
Bug 11175: (follow-up) Return empty array if no components

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: (follow-up) Don't return explicitly undef
Joonas Kylmälä [Mon, 8 Jun 2020 12:12:52 +0000 (15:12 +0300)]
Bug 11175: (follow-up) Don't return explicitly undef

This would create in list context an list of one element that is
undef, which we don't want, we want empty list if there are no
components.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11175: Show record component parts in the detail view
Pasi Kallinen [Mon, 20 Aug 2018 06:51:55 +0000 (09:51 +0300)]
Bug 11175: Show record component parts in the detail view

Shows the component records of a host, on the hosts detail view in
staff client or OPAC, with clickable links to the component records.

The host does not require linking entries to the components, but
components do require a link to the host record via 773$w.

Adds a new search index, Control-number-identifier (aka cni), which
indexes the 003 controlfield.

Adds 'Yet Another System Preference', ShowComponentRecords, which can
be used to turn this feature on or off in staff client and/or OPAC,
and defaults to off.

When looking up the component part records, the code searches for
records with (773$w=Host001 and 003=Host003) or 773$w='Host003 Host001'
or, if the 003 is not defined in the Host, 773$w=Host001.

Does not use easyanalytics or useControlNumber.

Only for MARC21 biblios - UNIMARC has not been updated.

staff-global.css and opac.css have not been recreated, so you need
to use sass to recreate those from staff-global.scss and opac.scss

Test plan:

0) Apply patch
1) perl bulkmarcimport -file /tmp/easypiano.mrc -m MARCXML
   (This file is an attachment on the bug)
2) rebuild the zebra biblio index
3) Search for "easy piano" in staff client, and go to
   the biblio detail page. You should not see anything different
   in the record detail page.
4) Do the same on OPAC.
5) Change the ShowComponentRecords syspref appropriately and check
   the record detail page in staff client and OPAC.
   You should see a list of component part records.

Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
JD amended path
-    if ($xslsyspref =~ m/Details/) {
+    if ( $xslsyspref eq "OPACXSLTDetailsDisplay" || $xslsyspref eq "XSLTDetailsDisplay" ) {

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: Fix regressions.t
Jonathan Druart [Tue, 26 Oct 2021 10:20:54 +0000 (12:20 +0200)]
Bug 19185: Fix regressions.t

The following test is failing:
| #   Failed test 'OPAC - Remove from cart'
| #   at t/db_dependent/selenium/regressions.t line 132.
| Can't call method "get_value" on an undefined value at t/db_dependent/selenium/regressions.t line 110.
| # Looks like your test exited with 2 just after 3.
| [12:14:08] t/db_dependent/selenium/regressions.t

We are dependind on the search engine and the records in the DB but the
installer is not inserting any records.

This patch is suggesting to reuse the code from search_utf8
(and so make it reusable first) for remove_from_cart test.
This code is mocking the Zebra index with some MARC data and so the
search will return results. We will finally be able to click on the
add to/remove from cart links.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29126: Compiled CSS
Jonathan Druart [Mon, 25 Oct 2021 13:49:05 +0000 (15:49 +0200)]
Bug 29126: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29126: (follow-up) Correct color of btn-link class in striped tables
Owen Leonard [Thu, 21 Oct 2021 11:17:33 +0000 (11:17 +0000)]
Bug 29126: (follow-up) Correct color of btn-link class in striped tables

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29126: Accessibility: More corrections to contrast in the OPAC
Owen Leonard [Fri, 24 Sep 2021 18:58:35 +0000 (18:58 +0000)]
Bug 29126: Accessibility: More corrections to contrast in the OPAC

This patch makes a few more corrections to OPAC CSS in order to avoid
having elements which lack sufficient contrast, in particular parts of
the interface where a standard-colored link appears on a darker
background.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

Check the following pages/areas:

- Breadcrumbs navigation
- Datatables buttons (on the "Your summary" page)
- Bibliographic view tabs (Normal/MARC/ISBD) on the bibliographic detail
  pages.
- "Action" menu on the bibliographic detail pages: Place hold, print,
  etc.
- Links inside "striped" tables: Links on the alternate grey background
  are darker to increase contrast.
- Sidebar links on user pages: Your summary, your charges, etc.
- Tag cloud: Approved tags in the weighted list.

Signed-off-by: Jérémy Breuillard <jeremy.breuillard@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28101: Compiled CSS
Jonathan Druart [Mon, 25 Oct 2021 13:48:48 +0000 (15:48 +0200)]
Bug 28101: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28101: (follow-up) Correct breadcrumb divider image
Owen Leonard [Mon, 25 Oct 2021 13:13:18 +0000 (13:13 +0000)]
Bug 28101: (follow-up) Correct breadcrumb divider image

This patch corrects the CSS for generating a chevron-style divider
between breadcrumb items. The CSS copied from staff-global.scss needed
some tweaks to make it work in the OPAC with Bootstrap 4.

Also changed: The Base64-encoded SVG is converted to plain based on
https://css-tricks.com/probably-dont-base64-svg/

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28101: Update breadcrumb markup in the OPAC for consistency and accessibility
Owen Leonard [Wed, 22 Sep 2021 18:15:06 +0000 (18:15 +0000)]
Bug 28101: Update breadcrumb markup in the OPAC for consistency and accessibility

Modified breadcrumbs to be accessible, in particular for a
screen-reader. Also ensured the breadcrumbs were all consistent.

Made the block of breadcrumbs to be a <nav id="breadcrumbs"
aria-label="Breadcrumb" class="breadcrumbs"> with an ordered list
inside. The last breadcrumb also has aria-current="page" to specify that
it is the current page.

To test, apply the patch and rebuild the OPAC CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- Confirm that OPAC templates are updated consistently to use
  breadcrumbs markup beginning with '<nav
  id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">'
- Pages in the OPAC should look consistent, with the last breadcrumb
  styled as text and with the "aria-current" attribute "page."

Sponsored-by: Catalyst IT
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28101: changed styling for breadcrumbs
Wainui Witika-Park [Mon, 19 Apr 2021 00:35:05 +0000 (00:35 +0000)]
Bug 28101: changed styling for breadcrumbs

Updates opac.scss file so the breadcrumbs will appear the same as Bug
27846 (Staff Client breadcrumbs).

This works but the file may need to be changed/cleaned up so that there
is not unnecessary information in it.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28847: Remove diag statements
Jonathan Druart [Mon, 25 Oct 2021 13:02:55 +0000 (15:02 +0200)]
Bug 28847: Remove diag statements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29315: Remove warnings from Search.t
Jonathan Druart [Mon, 25 Oct 2021 12:37:54 +0000 (14:37 +0200)]
Bug 29315: Remove warnings from Search.t

The syspref SearchLimitLibrary was requested but I don't know what to
say; this indicates that the test requires updating at
t/db_dependent/Search.t line 198.
The syspref FacetOrder was requested but I don't know what to say; this
indicates that the test requires updating at t/db_dependent/Search.t
line 198.
The syspref OPACResultsUnavailableGroupingBy was requested but I don't
know what to say; this indicates that the test requires updating at
t/db_dependent/Search.t line 198.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29186: (QA follow-up) Correct the check for showing limit menu
Owen Leonard [Mon, 11 Oct 2021 10:57:40 +0000 (10:57 +0000)]
Bug 29186: (QA follow-up) Correct the check for showing limit menu

The template conditional for showing the limit menu should be changed
to:

[% IF ( unlimited_total > 10 && limit <= 1000 ) %]

- "unlimited_total > 10" so that the "rows per page" button only shows
  if there are more than 10 total results, because 10 is the smallest
  increment the "rows per page" control offers.
- "limit <= 1000" so that the "rows per page" button will show when the
  current result limit is less than or equal to 1000, because 1000 is
  the upper limit to the "rows per page" control.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29186: Move reports result limit menu into toolbar
Owen Leonard [Thu, 17 Sep 2020 19:18:53 +0000 (19:18 +0000)]
Bug 29186: Move reports result limit menu into toolbar

This patch creates a new Bootstrap button menu for selecting the number
of search results to be shown. This replaces the HTML <select>.

To test, apply the patch and go to Reports -> Saved reports.

- Test the appearance and functionality of the "Rows per page" button in
  various situations:
  - A report that returns more than 10 results
  - A report that returns fewer than 10 results
  - A report that returns no results
- Test that the batch operations button menu appears correctly when
  there are biblionumbers, itemnumbers, or cardnumbers in the results.
- When there are no results, or fewer than 10 results with no batch
  operations possible the toolbar shouldn't appear at all.

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20463: (follow-up) Remove option from search templates
Katrin Fischer [Wed, 4 Aug 2021 15:28:06 +0000 (17:28 +0200)]
Bug 20463: (follow-up) Remove option from search templates

Using this search option in the GUI would require the user to
enter the codes from MARC, LDR 19, see:

https://www.loc.gov/marc/bibliographic/bdleader.html

So I think it's better to leave this out for the moment.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20463: (follow-up) Configure short name mrl for Multipart-resource-level index
Katrin Fischer [Wed, 4 Aug 2021 15:26:47 +0000 (17:26 +0200)]
Bug 20463: (follow-up) Configure short name mrl for Multipart-resource-level index

This adds mrl as appreviation of Multipart-resource-level to
the Zebra configuration and Search.pm so it can be used when
searching.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20463: Adding index for Leader 19 Multipart resource record level
Hayley Pelham [Tue, 27 Jul 2021 04:49:24 +0000 (04:49 +0000)]
Bug 20463: Adding index for Leader 19 Multipart resource record level

Sponsored-by: Bibliotheksservice-Zentrum Baden-Wuerttemberg
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29207: Getopt::Long should not ignore cases
Petro Vashchuk [Mon, 11 Oct 2021 13:52:08 +0000 (16:52 +0300)]
Bug 29207: Getopt::Long should not ignore cases

To avoid Getopt::Long treating upper case and lower case options,
this patch restores removed ":config no_ignore_case".

Steps to reproduce:
1. Start koha-z3950-responder deamon for any instance.
2. Check z3950.log log file, there should be
"[fatal] Failed to listen on ...-koha-z3950" in it.
3. Alternatively you can "curl localhost:2100/biblios?version=1.1 -v"
to ensure that it doesn't work "Failed to connect to localhost
port 2100: Connection refused".
4. Apply the patch.
5. Stop and start daemon again.
6. Check the logs again, there should be no new error there.
7. Same way do the curl to ensure that this time it listens on that port.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29309: (follow-up) Change 'Pay fines' to 'Pay charges'
Katrin Fischer [Sat, 23 Oct 2021 22:54:53 +0000 (00:54 +0200)]
Bug 29309: (follow-up) Change 'Pay fines' to 'Pay charges'

Fixes another occurence of the fines to charges.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29309: Make 'Pay all fines' be 'Pay all charges'
Tomas Cohen Arazi [Fri, 22 Oct 2021 21:59:37 +0000 (18:59 -0300)]
Bug 29309: Make 'Pay all fines' be 'Pay all charges'

It is not just fines, it is also fees, etc.

To test:
1. Have a patron with debt
2. Go to the circulation page for the patron
=> FAIL: There's a button saying 'Pay all fines'
3. Apply this patch and reload page
=> SUCCESS: The button now says 'Pay all charges'
4. Enjoy the new terminology
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29227: Patron messaging preferences digest show as editable but are not
Nick Clemens [Thu, 14 Oct 2021 12:03:31 +0000 (12:03 +0000)]
Bug 29227: Patron messaging preferences digest show as editable but are not

On moremember.pl we load the messaging preferences for display only, we do
not need to load the JS for editing the preferences

To test:
0 - Enable EnhancedMessagingPreferences
1 - Load the detais tab for a member
2 - Note the digest column in messaging preferences is clickable
3 - Apply patch
4 - Reload, it is not clickable
5 - Confirm editing the patron (or their messaging prefs) works as expected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29306: Fix warning on undefined $_ in Holds.t
Marcel de Rooy [Fri, 22 Oct 2021 08:19:01 +0000 (08:19 +0000)]
Bug 29306: Fix warning on undefined $_ in Holds.t

Use of uninitialized value $_ in concatenation (.) or string at t/db_dependent/Holds.t line 1658.

Results from copying line 70.

Test plan:
Run Holds.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29284: (follow-up) Fix code that I copied from too
Nick Clemens [Thu, 21 Oct 2021 10:31:18 +0000 (10:31 +0000)]
Bug 29284: (follow-up) Fix code that I copied from too

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29284: (follow-up) Improve error logging to prevent warns
Nick Clemens [Thu, 21 Oct 2021 10:26:12 +0000 (10:26 +0000)]
Bug 29284: (follow-up) Improve error logging to prevent warns

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29284: Unit test
Nick Clemens [Thu, 21 Oct 2021 10:08:05 +0000 (10:08 +0000)]
Bug 29284: Unit test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29284: Handle the case of an exclamation point in parentheses
Nick Clemens [Wed, 20 Oct 2021 12:49:42 +0000 (12:49 +0000)]
Bug 29284: Handle the case of an exclamation point in parentheses

This expands the regex to handle this specific case

To test:
1 - Load record created for last patch
2 - Note analytics error
3 - Apply patch
4 - Restart and reload
5 - No more errorm also no Analytics link
6 - Add a 773$t to a record with title used before:
    Digger does it all (not really!)
7 - reload the initial record
8 - See 'Show analytics' link
9 - Click the link
10 - You should end up on the record you added the 773 to

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29284: Don't die on analytics searching error
Nick Clemens [Wed, 20 Oct 2021 12:46:07 +0000 (12:46 +0000)]
Bug 29284: Don't die on analytics searching error

This patch adds an eval around the call to search for analytic records
It pases a value to the template on the staff side, but logs the warning on
the opac

This seems similar to 'decoding_error' which is noted on staff side, but absent on OPAC

The eval follows the patter used during searching

To test:
1 - Add a title to catalog, with 245a:
    Digger does it all (not really!)
2 - Set searchEngine preference to: Elasticsearch
3 - The record does not load
4 - Apply patch
5 - The record loads, there is a note about analytics at the top fo the record
6 - View record in opac, no note
7 - Check logs on intranet and opac, searching error is logged

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28585: (QA follow-up) Add explicit tests for setting date/date-time attributes
Tomas Cohen Arazi [Thu, 21 Oct 2021 18:33:54 +0000 (15:33 -0300)]
Bug 28585: (QA follow-up) Add explicit tests for setting date/date-time attributes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28585: (QA follow-up) Fix object.t
Martin Renvoize [Thu, 21 Oct 2021 15:08:19 +0000 (16:08 +0100)]
Bug 28585: (QA follow-up) Fix object.t

Object.t was still testing for the return of DateTime objects from
attributes_from_api. I checked all calls to attrbutes_from_api for
reliance of DateTime objects and confirmed they all get passed into
search calls and thus are better served as SQL formatted strings.

I then converted the test to check that the rfc3339 formatted dates
passed in were converted to strings appropriate for feeding into SQL
where statements instead.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD amended patch:
  FAIL   spelling
    formated ==> formatted

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28585: (follow-up) Tests for q= supporting date/date-time parameters
Tomas Cohen Arazi [Fri, 25 Jun 2021 14:49:06 +0000 (11:49 -0300)]
Bug 28585: (follow-up) Tests for q= supporting date/date-time parameters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28585: Use the datetime_parser for handling API dates
Tomas Cohen Arazi [Fri, 25 Jun 2021 14:37:29 +0000 (11:37 -0300)]
Bug 28585: Use the datetime_parser for handling API dates

This patchset takes the GET /patrons route as a sample usage for filtering
on date and date-time (including timestamp) fields.

It then makes Koha::Object->attributes_from_api use the DB storage
datetime parser for format the parameters correctly.

To test:

1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: It doesn't find the patron when filtering by date
3. Apply this patch
4. Repeat 2
=> SUCCESS: It works now!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28585: Regression tests
Tomas Cohen Arazi [Fri, 25 Jun 2021 12:57:11 +0000 (09:57 -0300)]
Bug 28585: Regression tests

This patch adds tests for filtering GET calls with date/date-time
parameters. Tests fail because the feature is not working

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29278: Fix selector of hint used to show age
Owen Leonard [Tue, 19 Oct 2021 16:20:19 +0000 (16:20 +0000)]
Bug 29278: Fix selector of hint used to show age

This patch modifies the patron entry form to correct a problem with the
write_age() function introduced by the switch to Flatpickr on this page
(Bug 28937).

Rather than selecting the element based on the sequence of elements on
the page, we should add an ID for direct selection.

To test, apply the patch and go to Patrons.

- Locate a patron record which has a date of birth saved.
  - When you open that patron for editing, you should see their age
    displayed below the date of birth input field, e.g. "Age: 23 years 9
    months."
  - Changing the date in the date of birth field should update the age
    string correctly.
- Go to Patrons -> New patron.
  - The date of birth field should have a hint showing the required date
    format, e.g. "(DD.MM.YYYY)".
  - When you select a date of birth using the Flatpickr calendar the age
    string should be updated correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29270: Remove flatpickr instantiation from request.tt
Jonathan Druart [Fri, 15 Oct 2021 07:49:19 +0000 (09:49 +0200)]
Bug 29270: Remove flatpickr instantiation from request.tt

The JS code is only used when placing a hold for club BUT the date
inputs are not displayed there.

Test plan:
Place holds for patrons and clubs and confirm that the two date inputs
are working correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29241: Allow display of past date for .futuredate
Jonathan Druart [Thu, 14 Oct 2021 09:36:02 +0000 (11:36 +0200)]
Bug 29241: Allow display of past date for .futuredate

When a past date is set for a flatpickr instance with the .futuredate
class, only dates in the future are available AND the input is blanked.
It does not display the date in the past.

For instance if a hold is expired (expirationdate in the past), the date input will be blanked.

We can use the flatpickr's allowInvalidPreload option to allow date in the past to be displayed.

Test plan:
Place a hold
Edit its expirationdate and set a date in the past (yesterday is fine)
Go to /reserve/request.pl?biblionumbers=42
=> With the patch you see the date, and the widget let you chose anoter date,
in the future
=> Without this patch the expiration date is not displayed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: Add missing +x on new test files
Jonathan Druart [Mon, 25 Oct 2021 11:09:34 +0000 (13:09 +0200)]
Bug 19185: Add missing +x on new test files

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: Split installation and onboarding
Jonathan Druart [Wed, 20 Oct 2021 10:04:25 +0000 (12:04 +0200)]
Bug 19185: Split installation and onboarding

The previous installation tests were testing the full onboarding process
by not selecting all the sample data.
It would be good to test the whole sample data set.

So there are now 2 files, 00-onboarding.t and 01-installation.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: DB must exist but empty
Jonathan Druart [Wed, 20 Oct 2021 09:08:02 +0000 (11:08 +0200)]
Bug 19185: DB must exist but empty

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: Fix language selection
Jonathan Druart [Wed, 20 Oct 2021 08:24:30 +0000 (10:24 +0200)]
Bug 19185: Fix language selection

'en' is in an optgroup

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: Fix tests
Jonathan Druart [Wed, 28 Apr 2021 14:36:12 +0000 (16:36 +0200)]
Bug 19185: Fix tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: Add selenium tests for installation and onboarding process
Jonathan Druart [Fri, 4 May 2018 17:52:44 +0000 (14:52 -0300)]
Bug 19185: Add selenium tests for installation and onboarding process

== Test plan ==
1. Apply the patches (including bug 19821)
2. restart_all
3. prove -Mt::lib::Bootstrap t/db_dependent/selenium/00-installation.t
4. result: Config entry 'database_test' does not exist at
     /home/vagrant/kohaclone/t/lib/Bootstrap.pm line 18
5. Edit $KOHA_CONF, add a database_test entry identical to database
     You should have:
     <database>koha_kohadev</database>
     <database_test>koha_kohadev</database_test>
6. restart_all
7. prove -Mt::lib::Bootstrap t/db_dependent/selenium/00-installation.t
8. result: Entries 'database_test' and 'database' have the same value in your
     config at /home/vagrant/kohaclone/t/lib/Bootstrap.pm line 20.
9. Edit $KOHA_CONF, edit database_test with koha_test as DB name
10. restart_all
11. prove -Mt::lib::Bootstrap t/db_dependent/selenium/00-installation.t
12. result: Access denied for user 'koha_kohadev'@'localhost'
       to database 'koha_test'
13. Connect to the DBMS
14. Example for koha_testing_docker
      docker exec -it koha_db_1 bash
      mysql -u root --password=password
15. GRANT ALL PRIVILEGES ON `koha_test`.* TO 'koha_kohadev';
16. prove -Mt::lib::Bootstrap t/db_dependent/selenium/00-installation.t
17. result: All tests successful.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: Ease elements selection
Jonathan Druart [Fri, 4 May 2018 17:36:38 +0000 (14:36 -0300)]
Bug 19185: Ease elements selection

- The marcflavour select needs an id to be selected easily
- "Continue to the next step" should be a button (like others)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19185: Use submit button if only one exists on the page
Jonathan Druart [Fri, 4 May 2018 17:44:44 +0000 (14:44 -0300)]
Bug 19185: Use submit button if only one exists on the page

During the installation process we do not have fieldset.action, in order
to not complicate changes we are just going to use the submit button if
only one exists.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19821: Require database_test != database
Jonathan Druart [Fri, 2 Nov 2018 14:00:01 +0000 (11:00 -0300)]
Bug 19821: Require database_test != database

To prevent developpers to drop their database.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19821: Use database_test entry if exists
Jonathan Druart [Fri, 4 May 2018 17:26:25 +0000 (14:26 -0300)]
Bug 19821: Use database_test entry if exists

If the database_test entry exists in the config file we are going to use
it. This will be a trick for developers and CI

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19821: Do not modify KOHA_CONF, use new database_test entry instead
Jonathan Druart [Fri, 4 May 2018 17:41:14 +0000 (14:41 -0300)]
Bug 19821: Do not modify KOHA_CONF, use new database_test entry instead

I have tried to use the original idea of this patch for bug 19185, but
it cannot work as it. ENV is not shared between processus and KOHA_CONF
will not be read by webserver (used for selenium tests).

Moreover on bug 19185 we are testing the installation process and we do
not want the database to be populated with sample data, we just need a
new and clean DB.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19821: Ignore .proverc and .proverc.dist in Makefile.t
Julian Maurice [Fri, 4 May 2018 05:41:45 +0000 (07:41 +0200)]
Bug 19821: Ignore .proverc and .proverc.dist in Makefile.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19821: Install sample data, ES mappings and Version syspref
Julian Maurice [Fri, 16 Feb 2018 15:00:34 +0000 (16:00 +0100)]
Bug 19821: Install sample data, ES mappings and Version syspref

Also move .proverc to .proverc.dist, so it cannot be used by accident.

Different ways to use it:

1/ prove --rc .proverc.dist
   Use defaults

2/ cp .proverc.dist .proverc && prove
   Allows to configure db name, marcflavour, and prove options

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19821: Close filehandle after writing
Julian Maurice [Mon, 18 Dec 2017 08:09:58 +0000 (09:09 +0100)]
Bug 19821: Close filehandle after writing

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 19821: Run tests on a separate database
Julian Maurice [Fri, 15 Dec 2017 14:18:24 +0000 (15:18 +0100)]
Bug 19821: Run tests on a separate database

Running the tests on the same database as the one used for dev has some
drawbacks:
- Everybody has different data, so we cannot make any assumptions about
data in tests and it can make tests fail for non-obvious reasons.
- Tests have to clean up every change to the database using SQL
transactions, so we cannot write testable code that use transactions
(AFAIK)
- Transactions in tests happen to be committed sometimes, resulting in
garbage data added to the dev database

This patch provides a .proverc file that will load t/lib/Bootstrap.pm
before the tests are run.
t/lib/Bootstrap.pm is responsible for recreating a fresh database and
telling the test scripts to use it.
To use it, just run prove normally from the root directory of Koha.
By default, the database is 'koha_test' and it's created using MARC21
SQL files, it can be changed by running:

    prove --norc \
    --Mt::lib::Bootstrap=database,koha_test,marcflavour,UNIMARC

Test plan:
1. Apply bug 19185 which will also apply these patches
2. In the DBMS run `select count(*) from koha_kohadev.borrowers;`
     (adapt if your usual koha DB isn't koha_kohadev)
3. Run the test plan of bug 19185 and during execution of the
   installation test, pay attention to the following:
4. List the databases in the DBMS (show databases;) to ensure that
   koha_test is created
5. After the test has run, the koha_test database should not be here anymore.
6. In the DBMS run `select count(*) from koha_kohadev.borrowers;`
7. That was to verify that the database you use usually was untouched.
   The counts should be the same.

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>