koha.git
2 years agoBug 25030: (QA follow-up) Add POD
Nick Clemens [Mon, 18 Oct 2021 11:09:00 +0000 (11:09 +0000)]
Bug 25030: (QA follow-up) Add POD

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 25030: Implement IncludeSeeFromInSearches with Elasticsearch
Julian Maurice [Tue, 10 Nov 2020 14:22:21 +0000 (15:22 +0100)]
Bug 25030: Implement IncludeSeeFromInSearches with Elasticsearch

Test plan:
1. Create an authority with at least a 1XX$a and a 4XX$a, for instance:
    100 $a Foo
    400 $a Bar
2. Create a biblio and add a link to this authority using the
   cataloguing plugin
3. Disable syspref IncludeSeeFromInSearches
4. Reindex the biblio. You should be able to find it when searching
   'Foo' but not when searching 'Bar'
5. Enable syspref IncludeSeeFromInSearches
6. Reindex the biblio. You should be able to find it when searching
   'Foo' and also when searching 'Bar'
   without the patch, 'Bar' doesn't yeld results. With it, it does.
7. prove t/db_dependent/Koha/SearchEngine/Elasticsearch.t

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29215: (bug 3137 follow-up) Fix guarantor block toggle
Jonathan Druart [Tue, 19 Oct 2021 09:50:37 +0000 (11:50 +0200)]
Bug 29215: (bug 3137 follow-up) Fix guarantor block toggle

The guarantor template must be kept hidden, always.

Test plan:

Edit a patron with a guarantor, click the legend of the "patron
guarantor" block and confirm that the template is not shown

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>
2 years agoBug 29261: (bug 15812 follow-up) Fix translation issue in include file
Jonathan Druart [Mon, 18 Oct 2021 09:05:18 +0000 (11:05 +0200)]
Bug 29261: (bug 15812 follow-up) Fix translation issue in include file

Strings must be surrounded by double quote or it wil break the translate
script.

Without this patch you get:
  5  "dt_name":
  6  "<a %]\"="%]\""
in the translated template and the UI explodes with "Template process
failed: file error - parse error"

Test plan:
Apply this patch, update PO files for a given language, translate
"View". Search for something like:
  msgid "\\\"View\\\""
  msgstr "\\\"Näytä\\\""
Remove fuzzy.
Install the language and search for patrons

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29221: Correctly display refund info
Jonathan Druart [Tue, 19 Oct 2021 09:39:48 +0000 (11:39 +0200)]
Bug 29221: Correctly display refund info

2132             $messages->{'LostItemFeeRefunded'} = $updated_item->{_refunded};

But, in returns.pl:
495     elsif ( $code eq 'LostItemFeeRefunded' ) {
496         $template->param( LostItemFeeRefunded => 1 );
497     }

1. Set BlockReturnOfLostItems to 'don't block'
2. Make sure your 'Default lost item fee refund on return policy' circ rule is set to 'Leave lost item charge'
3. Check something out and then mark it as lost.
4. Check the item in
=> No message to tell there was a refund

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 17600: Fix imports for svc/letters/preview
Jonathan Druart [Thu, 21 Oct 2021 07:56:29 +0000 (09:56 +0200)]
Bug 17600: Fix imports for svc/letters/preview

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: (QA follow-up) Test for hook calls properly
Tomas Cohen Arazi [Tue, 19 Oct 2021 12:46:32 +0000 (09:46 -0300)]
Bug 28211: (QA follow-up) Test for hook calls properly

Some warnings, that mean a hook has been called were not tested.
This patch adds those tests, and does some tidy also.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28153: (follow-up) Ensure update is idempotent
Nick Clemens [Tue, 19 Oct 2021 11:28:40 +0000 (11:28 +0000)]
Bug 28153: (follow-up) Ensure update is idempotent

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29240: Rename start_for with date_to
Jonathan Druart [Tue, 19 Oct 2021 07:57:26 +0000 (09:57 +0200)]
Bug 29240: Rename start_for with date_to

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29240: (follow-up) Correct more instances
Owen Leonard [Thu, 14 Oct 2021 17:05:07 +0000 (17:05 +0000)]
Bug 29240: (follow-up) Correct more instances

This patch fixes linked date fields in these pages:

 - Reports -> Patrons with the most checkouts
 - Reports -> Patrons statistics wizard
 - Reports -> Most-circulated items
 - Reports -> Catalog statistics wizard
 - Reports -> Guided reports
 - Reports -> Average loan time
 - Reports -> Holds statistics wizard

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29240: Centralise from/to handling
Martin Renvoize [Thu, 14 Oct 2021 14:06:30 +0000 (15:06 +0100)]
Bug 29240: Centralise from/to handling

This patch moves to using a data-start_for attribute to point the 'from'
flatpickr to the 'to' flatpickr.

We also fix the date validation issue in the onClose handler inline.

Test plan.
1. Check that the from/to datpicker combinations work on each of the
   changed pages.
2. Look at the console for errors, there should be none

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29233: Correct missed jQueryUI datepicker in serials search sidebar
Owen Leonard [Wed, 13 Oct 2021 18:27:17 +0000 (18:27 +0000)]
Bug 29233: Correct missed jQueryUI datepicker in serials search sidebar

This patch fixes the serials search sidebar so that the "Expires before"
field uses Flatpickr instead of jQueryUI datepicker.

To test, apply the patch and go to Serials. Perform a subscription
search which will return multiple results.

In the sidebar, test that the "Expires before" field uses a
Flatpickr widget and works 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>
2 years agoBug 29232: Clean up obsolete jQueryUI datepicker code from cash register stats template
Owen Leonard [Wed, 13 Oct 2021 17:58:58 +0000 (17:58 +0000)]
Bug 29232: Clean up obsolete jQueryUI datepicker code from cash register stats template

This patch removes some jQueryUI datepicker code from
reports/cash_register_stats.tt which was left behind by Bug 28949.

To test, apply the patch and go to Reports -> Cash register statistics
wizard. The "From" and "To" date fields should work correctly, since
Flatpickr code is unchanged.

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>
2 years agoBug 29263: (bug 24387 follow-up) Fix 'Cancel' link when editing a html custom
Jonathan Druart [Mon, 18 Oct 2021 12:53:05 +0000 (14:53 +0200)]
Bug 29263: (bug 24387 follow-up) Fix 'Cancel' link when editing a html custom

When editing content that is a html customization, the 'cancel' link
should redirect to the html custom list, not the 'news' list.

Test plan:
Create or edit a html customization, click the 'Cancel' link
=> You should be redirected to the html custom list

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>
2 years agoBug 29153: Fix CodeMirror textareas to work with all languages
Lucas Gass [Fri, 15 Oct 2021 17:05:42 +0000 (17:05 +0000)]
Bug 29153: Fix CodeMirror textareas to work with all languages

To test:
1. Go to Tools > HTML customizations
2. Open or create a new entry with CodeMirror. ( Edit with text editor )
3. CodeMirror doesn't work, notice a console error.
4. Apply patch
5. Try steps 1 & 2 again. The CodeMirror editor should now load.
6. Make sure it works in both the Default and English(en) tabs.
7. BONUS: install some other language packs and look at the tabs for that language, it should still work.

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>
2 years agoBug 20277: Improve 773 link when $a is present
Katrin Fischer [Sun, 22 Aug 2021 04:07:02 +0000 (04:07 +0000)]
Bug 20277: Improve 773 link when $a is present

At the moment $t (Title) and $a (Main heading - author) are both
searched in ti,phr, which sometimes may work, as ti contains the
full 245 field, including $c with author information. But often
$c will not match what is in 100$a, so the search fails.

This splits the search string so we search for $t in with ti,phr
and for $a in au.

To test:
- Make sure UseControlnumber is deactivated
- Search for a record with an author in 100 in your catalog
  Example from sample data: Programming Perl / Tom Christiansen, Brian D. Foy & Larry Wall.
- Add a child record using New > Add child record
- Verify that in 773 $a and $t are filled in
- Complete mandatory fields and save the record
. In OPAC and staff interface:
- Verify the link in the detail page is doing a search with ti,phr
- Verify the link works/doesn't work (more likely the latter)
- Apply patch
- Verify the link has changed and (now) works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29254: Fix date formatting on the additional contents form
Jonathan Druart [Mon, 18 Oct 2021 09:50:11 +0000 (11:50 +0200)]
Bug 29254: Fix date formatting on the additional contents form

We are sending ymd but flatpickr is expecting a 'dateformat' formatted
date.

Test plan:
Create a new content, set a date, save, edit again
=> The date must be displayed correctly

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29020: Add link on the admin module
Jonathan Druart [Fri, 8 Oct 2021 13:57:31 +0000 (15:57 +0200)]
Bug 29020: Add link on the admin module

It works! P1 and P2 are inverted in the test plan, but
the principle that user with manage permission accesses
bg jobs from the admin page and user who do not only
have access through main page is there.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29020: Add link on the mainpage for users without admin access
Jonathan Druart [Fri, 8 Oct 2021 13:53:02 +0000 (15:53 +0200)]
Bug 29020: Add link on the mainpage for users without admin access

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: Fix test
Jonathan Druart [Tue, 19 Oct 2021 07:25:25 +0000 (09:25 +0200)]
Bug 28211: Fix test

    #   Failed test 'Plugin enabled, route defined'
    #   at t/db_dependent/Koha/REST/Plugin/PluginRoutes.t line 125.
    # Looks like you failed 1 test of 2.

105         $good_plugin = $plugin
106             if $plugin->{metadata}->{description} eq 'Test plugin';

The wrong plugin was considered the good one.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28153: DBRev 21.06.00.035
Jonathan Druart [Mon, 18 Oct 2021 09:27:18 +0000 (11:27 +0200)]
Bug 28153: DBRev 21.06.00.035

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28153: (follow-up) Add installer files and update atomicupdate
Nick Clemens [Fri, 15 Oct 2021 15:02:50 +0000 (15:02 +0000)]
Bug 28153: (follow-up) Add installer files and update atomicupdate

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28153: Add 'Hold reminder' messaging preference
Nick Clemens [Thu, 15 Apr 2021 13:26:55 +0000 (13:26 +0000)]
Bug 28153: Add 'Hold reminder' messaging preference

This adds a new preference for patrons to choose how they wish to receive
'Hold reminder' notices.

The notice is always digested per branch

To test:
 1 - Apply patches
 2 - Update database
 3 - Ensure EnhancedMessagingPreferences and EnhancedMessagingPreferencesOPAC are enabled
 4 - View a patron and note new messaging preference
 5 - Confirm same on the opac for a patron account
 6 - All transports should be disabled by default
 7 - Place a hold for the patron and check it in to confirm
 8 - Run hold reminder script
    perl misc/cronjobs/holds_reminder.pl -v -c
 9 - No message should be queued for patron
10 - Enable the message in a transport for which 'HOLD_REMINDER' notice has content for the patron
11 - Run the script
12 - Patron should have a message queued
13 - Ensure a different transport has content for the notice
14 - Run the script forcing a transport
   perl misc/cronjobs/holds_reminder.pl -v -c -mtt=print
15 - The patron should have a message queued in the forced transport

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28831: DBRev 21.06.00.034
Jonathan Druart [Mon, 18 Oct 2021 09:26:32 +0000 (11:26 +0200)]
Bug 28831: DBRev 21.06.00.034

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28831: Add the new group by substatus-block
Marcel de Rooy [Thu, 9 Sep 2021 09:18:01 +0000 (09:18 +0000)]
Bug 28831: Add the new group by substatus-block

Test plan:
Change OPACResultsUnavailableGroupingBy to substatus.
Verify the result on opac results. (You need a few unavailable items
with different statuses on a few branches.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28831: Add choose/when, and change indentation
Marcel de Rooy [Thu, 9 Sep 2021 08:56:07 +0000 (08:56 +0000)]
Bug 28831: Add choose/when, and change indentation

As a first step:
[1] Add the new pref OPACResultsUnavailableGroupingBy in the xslt,
    and pass it via C4/XSLT.
[2] Add a choose/when construction in the third part of Availability.
[3] Add indentation (8 spaces) of the inner block handling group by branch.

Test plan:
Make sure that OPACResultsUnavailableGroupingBy eq branch.
Verify that OPAC results are still untouched.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28831: Database revision, add new preference
Marcel de Rooy [Thu, 9 Sep 2021 09:37:50 +0000 (09:37 +0000)]
Bug 28831: Database revision, add new preference

The preference OPACResultsUnavailableGroupingBy allows you to
group unavailable items by substatus, only showing item counts, on
the OPAC XSLT results.

This is meant to be useful for larger consortia.

Test plan:
Run dbrev.
Check new pref on Admin, preferences, OPAC tab.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: (QA follow-up) Add unit tests
Kyle M Hall [Thu, 14 Oct 2021 11:57:55 +0000 (11:57 +0000)]
Bug 28211: (QA follow-up) Add unit tests

JD amended patch: typo multipled ==> multiplied

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: (QA follow-up) POD changes
Marcel de Rooy [Fri, 8 Oct 2021 07:00:10 +0000 (07:00 +0000)]
Bug 28211: (QA follow-up) POD changes

[1] Resolving qa warn on POD coverage.
[2] Adding a line about the passing refs-tric.
[3] Removing an outdated line on available methods.
[4] Removing POD section for after_hold_create. Strayed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: (QA follow-up) Remove test_call_recursive
Marcel de Rooy [Fri, 8 Oct 2021 06:51:03 +0000 (06:51 +0000)]
Bug 28211: (QA follow-up) Remove test_call_recursive

Obsoleted now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: Replace use of call_recursive() with call()
Kyle M Hall [Fri, 23 Apr 2021 15:53:51 +0000 (11:53 -0400)]
Bug 28211: Replace use of call_recursive() with call()

This is based on Julian's idea on bug 28026 where we could get rid of call_recursive by passing refs as arguments to call.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Plugins/Plugins.t
3) prove t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28785: Don't send SessionRestrictionByIP to template
Jonathan Druart [Fri, 30 Jul 2021 12:19:02 +0000 (14:19 +0200)]
Bug 28785: Don't send SessionRestrictionByIP to template

It's not used.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28785: Add skip_version_check for checkauth
Jonathan Druart [Thu, 29 Jul 2021 09:28:38 +0000 (11:28 +0200)]
Bug 28785: Add skip_version_check for checkauth

We could have this patch but we also could decide to skip it. The idea
is to avoid 2 checks of the version when we are coming from checkauth.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28785: Adjust check_cookie_auth calls
Jonathan Druart [Thu, 29 Jul 2021 09:16:40 +0000 (11:16 +0200)]
Bug 28785: Adjust check_cookie_auth calls

The previous patch makes check_cookie_auth return the session instead of
$sessionID, so we are adjusting the different calls to prevent
confusion.
However they are mainly used to check the authentication status and
don't care about this second variable.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28785: Centralize cookie auth check in check_cookie_auth
Jonathan Druart [Thu, 29 Jul 2021 09:03:46 +0000 (11:03 +0200)]
Bug 28785: Centralize cookie auth check in check_cookie_auth

This code is duplicated in 3 different places, we must call
check_cookie_auth instead.

It makes check_cookie_auth returns a 'restricted' when
SessionRestrictionByIP is set and the IP changed.
It also returns a third parameters contained the old and new IP, to fill
the "info" hash in checkauth but apparently the oldip and newip
variables are not even used from the template. We may want to remove it
completely.

No change is expected with this patch, the different authentication
methods should still work as before.

Test plan:
Log in the staff and OPAC interfaces, logout.
Log in and call script that call the 3 different subroutines modified by
this patch. For instance you can list checkouts (that is using
check_cookie_auth) and display a patron's image (using check_api_auth).

QA with good knowledge of the C4::Auth module and the different
authentication methods is required.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27949: (QA follow-up) Remove TODO
Nick Clemens [Thu, 7 Oct 2021 13:48:55 +0000 (13:48 +0000)]
Bug 27949: (QA follow-up) Remove TODO

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27949: Allow multiple article requests print slip
Agustin Moyano [Thu, 3 Jun 2021 20:41:22 +0000 (17:41 -0300)]
Bug 27949: Allow multiple article requests print slip

This bug allows for batch printing of multiple article requests slips

To test:
1. apply this patch
2. restart_all
3. enable ArticleRequests preference
4. create multiple article requests
5. go to circ/article-requests.pl in staff interface
6. print a single slip from a row
CHECK => it works as expected
7. select all rows and print slip from general actions menu (above the table)
SUCCESS => all article requests slips are printed
8. select multiple rows (not all) and print slip from general actions menu (above the table)
SUCCESS => only selected article requests slips are printed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
JD amended patch: Perltidy!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29243: Correct call when adding items from staged records
Nick Clemens [Thu, 14 Oct 2021 11:30:21 +0000 (11:30 +0000)]
Bug 29243: Correct call when adding items from staged records

To test:
1 - Populate system preference  NewItemsDefaultLocation
2 - Stage a file of marc records
3 - Create an acquisitions basket with 'AcqCreateItems' set to 'ordering'
4 - Attempt to add to basket from your staged file
5 - You get a 500 error, and in the logs:
    Can't use string ("") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Items.pm line 1605.
6 - Apply patch
7 - Repeat #4
8 - Success!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: (follow-up) Display count of modified items when too many to display
Nick Clemens [Fri, 15 Oct 2021 16:40:54 +0000 (16:40 +0000)]
Bug 28445: (follow-up) Display count of modified items when too many to display

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Split and join on ' | ' instead of '|' for repeatable
Jonathan Druart [Wed, 13 Oct 2021 15:51:52 +0000 (17:51 +0200)]
Bug 28445: Split and join on ' | ' instead of '|' for repeatable

Is that correct?!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Respect MaxItemsToDisplayForBatchMod from job detail view
Jonathan Druart [Wed, 13 Oct 2021 15:27:23 +0000 (17:27 +0200)]
Bug 28445: Respect MaxItemsToDisplayForBatchMod from job detail view

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: delete_biblios is a boolean
Jonathan Druart [Wed, 13 Oct 2021 15:18:38 +0000 (17:18 +0200)]
Bug 28445: delete_biblios is a boolean

Will fix:
Batch deletion failed: Cannot enqueue this job. (The error was: Can't use string ("on") as an ARRAY ref while "strict refs" in use at /kohadevbox/koha/Koha/BackgroundJob/BatchDeleteItem.pm line 214. , see the Koha log file for more information).

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Don't surround the whole batch with a transaction
Jonathan Druart [Mon, 11 Oct 2021 14:26:12 +0000 (16:26 +0200)]
Bug 28445: Don't surround the whole batch with a transaction

It makes more sense to commit when an item has successfully been modified and
so move the transaction inside the loop.

It also fixes the progress of the whole job.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Fix subfields to blank
Jonathan Druart [Mon, 11 Oct 2021 13:46:05 +0000 (15:46 +0200)]
Bug 28445: Fix subfields to blank

The value of the checkbox was not correct

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Improve robustness of tests
Jonathan Druart [Wed, 6 Oct 2021 13:45:17 +0000 (15:45 +0200)]
Bug 28445: Improve robustness of tests

* Libraries are ordered by name by default but if others have been added
the test may fail

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Don't display the items if not finished yet
Jonathan Druart [Wed, 28 Jul 2021 07:46:45 +0000 (09:46 +0200)]
Bug 28445: Don't display the items if not finished yet

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Fix encoding issue with the background job's report
Jonathan Druart [Tue, 27 Jul 2021 16:19:18 +0000 (18:19 +0200)]
Bug 28445: Fix encoding issue with the background job's report

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: UI change for repeatable and regex
Jonathan Druart [Tue, 27 Jul 2021 13:29:38 +0000 (15:29 +0200)]
Bug 28445: UI change for repeatable and regex

This patch applies the changes describe in the main commit message about
the "limitation" and "the behaviour in master was buggy".

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Use the task queue for the batch delete and update items tool
Jonathan Druart [Tue, 27 Jul 2021 09:05:54 +0000 (11:05 +0200)]
Bug 28445: Use the task queue for the batch delete and update items tool

Here we go!

Disclaimer: this patch is huge and does many things, but splitting it in
several chunks would be time consuming and painful to rebase. However it
adds many tests and isolate/refactor code to make it way more reusable.

This patchset will make the "batch item modification" and "batch item
deletion" features use the task queue (reminder: Since bug 28158, and so
21.05.00, we do no longer use the old "background job" functionality and
the user does not get any info about the progress of the job).

More than that, more of the code to build an item form and a list of
items is now isolated in module (.pm) and include files (.inc)

We are reusing the changes made by bug 27526 that simplifies the way we
edit/create items (no more unecessary serialization Koha > MARC > MARCXML
> XML > HTML)

New module:
* Koha::BackgroundJob::BatchDeleteItem
    Subclass for process item deletion in batch
* Koha::BackgroundJob::BatchUpdateItem
    Subclass for process item modification in batch
* Koha::Item::Attributes
    We needed an object to represent item's attributes that are not
    mapped with a koha field (aka "more subfields xml")
    This module will help us to create the marcxml from a hashref and the
    reverse.
* Koha::UI::Form::Builder::Item
    The code that was used to build the add/edit item form is
    centralised in this module. In conjunction with the
    subfields_for_item BLOCK (from html_helpers.inc) it will be really
    easy to reuse this code in other places where the item form is used
    (acquisition and serials modules)
* Koha::UI::Table::Builder::Items
    Same as previously for the table. We are now using this table from 3
    different places (batch item mod, batch item del, backgroung job
    detail view) and the code is only in one place.
    To use with items_table_batchmod BLOCK (still from html_helpers.inc)

This patch is fixing some bugs about repeatable subfields and regex. A UI
change will reflect the limitation: if you want to apply a regex on a
subfield you cannot add several subfields for the same subfield code.

Test plan:

Prepare the ground:
- Make sure you are always using a bibliographic/item record using the framework
you are modifying!
- Add some subfields for items that are not mapped with a koha field
(note that you can use 'é' for more fun, don't try more funny
characters)
- Make some subfields (mapped and not mapped with a kohafield)
repeatable
- Add default values to some of your subfields

There are 4 main screens to test:
1. Add/edit item form
The behaviour should be the same before and after this patch.
See test plan from bug 27526.
Those 2 prefs must be tested:
    * SubfieldsToAllowForRestrictedEditing
    * SubfieldsToUseWhenPrefill

2. Batch modification
a. Fill some values, play with repeatable and regex.
Note that the behaviour in master was buggy, only the first value was modified by the regex:
    * With subfield = "a | b"
    1 value added with "new"
    => "new | b"

    * With subfield = "a | b"
    2 new fields "new1","new2"
    => "new2 | b"

Important note: For repeatable subfields, a regex will apply on the subfields in
the "concatenated form". To apply the regex on all the different subfields of a given
subfield code you must use the "g" modifier.
This could be improved later, but keep in mind that it's not a regression or behaviour
change.

b. Play with the "Populate fields with default values from default framework" checkbox

c. Use this tool to modify items and play with the different sysprefs that
interfer with it:
    * NewItemsDefaultLocation
    * SubfieldsToAllowForRestrictedBatchmod
    * MaxItemsToDisplayForBatchMod
    * MaxItemsToProcessForBatchMod

3. Batch deletion
a. Batch delete some items
b. Check items out and try to delete them
c. Use the "Delete records if no items remain" checkbox to delete
bibliographic records without remaining items.
d. Play with the following sysprefs and confirm that it works as
expected:
    * MaxItemsToDisplayForBatchDel
e. Stress the tool: Go to the confirmation screen with items that can be
deleted, don't request the job to be processed right away, but check the
item out before.

4. Background job detail view
You must have seen it already if you are curious and tested the above.
When a new modification or deletion batch is requested, the confirmation
screen will tell you that the job has enqueued. A link to the progress
of the job can be followed.
On this screen you will be able to see the result of the job once it's
fully processed.

QA notes:
* There are some FIXME's that are not blocker in my opinion. Feel free to
discuss them if you have suggestions.
* Do we still need MaxItemsToProcessForBatchMod?
* Prior to this patchset we had a "Return to the cataloging module" link
if we went from the cataloguing module and that the biblio was deleted.
We cannot longer know if the biblio will be deleted but we could display
a "Go to the cataloging module" link on the "job has been enqueued"
screen regardless from where we were coming from.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Start form with empty library for batch mod
Jonathan Druart [Tue, 20 Jul 2021 15:44:20 +0000 (17:44 +0200)]
Bug 28445: Start form with empty library for batch mod

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Adjust code to handle regexs
Jonathan Druart [Mon, 26 Jul 2021 16:30:33 +0000 (18:30 +0200)]
Bug 28445: Adjust code to handle regexs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Use Koha::UI::Form::Builder::Item from batchmod as well
Jonathan Druart [Mon, 26 Jul 2021 16:29:16 +0000 (18:29 +0200)]
Bug 28445: Use Koha::UI::Form::Builder::Item from batchmod as well

Now that it's reusable, let use it somewhere else!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Move controller code to Koha::UI::Form::Builder::Item
Jonathan Druart [Mon, 26 Jul 2021 16:26:32 +0000 (18:26 +0200)]
Bug 28445: Move controller code to Koha::UI::Form::Builder::Item

To ease reusability

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Isolate add item form to an include file
Jonathan Druart [Mon, 26 Jul 2021 16:25:19 +0000 (18:25 +0200)]
Bug 28445: Isolate add item form to an include file

To ease reusability

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28769: (QA follow-up) Fix another occurrence
Marcel de Rooy [Fri, 15 Oct 2021 06:51:55 +0000 (06:51 +0000)]
Bug 28769: (QA follow-up) Fix another occurrence

Framework plugin unimarc_leader_authorities.pl.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28769: Remove tabloop from cataloguing plugins
Jonathan Druart [Tue, 20 Jul 2021 08:30:30 +0000 (10:30 +0200)]
Bug 28769: Remove tabloop from cataloguing plugins

There is a "tabloop" variable that is passed from the add item form logic to the cataloguing plugins.
But there is confusion, sometimes it's an iterator ($i) and sometimes (batchMod.pl) an array.

Actually this tabloop variable is never used from cataloguing plugins, we should remove it.

Test plan:
Read the code and confirm the above.
You can also test a couple of plugins and confirm that they are still
working.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27526: Fix for prefill preventing duplication
Andrew Nugged [Fri, 15 Oct 2021 21:16:35 +0000 (00:16 +0300)]
Bug 27526: Fix for prefill preventing duplication

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27526: Fix 'add & duplicate item'
Jonathan Druart [Wed, 13 Oct 2021 07:34:19 +0000 (09:34 +0200)]
Bug 27526: Fix 'add & duplicate item'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27526: Fix 'duplicate item'
Jonathan Druart [Wed, 13 Oct 2021 07:29:12 +0000 (09:29 +0200)]
Bug 27526: Fix 'duplicate item'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29093: (follow-up) DBRev 21.06.00.033
Jonathan Druart [Fri, 15 Oct 2021 11:16:55 +0000 (13:16 +0200)]
Bug 29093: (follow-up) DBRev 21.06.00.033

Had to decrease the number because of a patch removed from the branch but forgot to rename the dbrev file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28337: Use existing definition in ccl.properties and bib1.att
Nick Clemens [Mon, 30 Aug 2021 12:28:39 +0000 (12:28 +0000)]
Bug 28337: Use existing definition in ccl.properties and bib1.att

As the field is already dfined, we don't need to add anything here.
Bib1.att can use the existing number as well

To test, enable zebra debugging in koha-conf, adding 'request' to the list:
<zebra_loglevels>none,fatal,warn,request</zebra_loglevels>

Restart all the things

Repeat matching (redo matching with no rule, then with OCN rule)
Tail the zebra-output.log and note 1=Ohter-control-number is searched and match is found
Perform a search in the staff client for: other-control-number:expialodocious
Note in logs that 1=1211 is searched

Previous test plan did not mention copying ccl.properties and bib1.att to the package install,
so highlighted that things work without these changes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28337: Add System-control-number index to Zebra MARC21 files
Nick Clemens [Wed, 12 May 2021 17:49:36 +0000 (17:49 +0000)]
Bug 28337: Add System-control-number index to Zebra MARC21 files

To test:
1 - Apply patch
2 - Copy zebra files to destination:
    cp /kohadevbox/koha/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml /etc/koha/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml
    cp /kohadevbox/koha/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl /etc/koha/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl
3 - Reindex authorities
4 - Edit an authority and add 035$aExpialodocious
5 - Export the authority
6 - Create a new record matchign rule:
    Matching rule code: OCN
    Description: Other control number
    Match threshhold: 1000
    Record type: Authority record
    Search-index: Other-control-number
    Score: 1000
    Tag: 035
    Subfields: a
7 - Stage the record and use the new matchign rule
8 - Match found!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28389: Add 'Details' link to refund type payout lines in POS
Martin Renvoize [Wed, 19 May 2021 13:24:33 +0000 (14:24 +0100)]
Bug 28389: Add 'Details' link to refund type payout lines in POS

This patch adds a link to the account-details page for refund type
payout lines displaying on the register details page of cash management.

Test plan
1/ Enable 'UseCashRegisters'
2/ Add some transactions with at least one including a 'Refund'
3/ Look at the transaction history for the current register (Tools >
Cash management > Transaction history for X)
4/ Note the refund line does not contain a link to 'Details'
5/ Apply the patch
6/ The refund line should now have a 'Details' button on the right.
7/ Bonus points, perform a cashup and then search for older transactions
and check the 'Details' button appears in this table too.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29209: Credits for Saxion in Dutch translation
Marcel de Rooy [Tue, 12 Oct 2021 12:30:17 +0000 (12:30 +0000)]
Bug 29209: Credits for Saxion in Dutch translation

The Rijksmuseum sponsored translation for Dutch-The Netherlands for
many years. More recently Saxion did the bulk of that work.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Ronald Wijlens <r.j.wijlens@saxion.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29093: DBIC schema changes
Jonathan Druart [Fri, 15 Oct 2021 09:06:36 +0000 (11:06 +0200)]
Bug 29093: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29093: DBRev 21.06.00.033
Jonathan Druart [Fri, 15 Oct 2021 09:03:40 +0000 (11:03 +0200)]
Bug 29093: DBRev 21.06.00.033

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29093: (QA follow-up) Rebasing issue
Marcel de Rooy [Wed, 6 Oct 2021 12:05:54 +0000 (12:05 +0000)]
Bug 29093: (QA follow-up) Rebasing issue

Bug 27944 added another block for the new stage introduced.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29093: (follow-up) Fix the all fields empty-warning
Marcel de Rooy [Wed, 6 Oct 2021 11:56:33 +0000 (11:56 +0000)]
Bug 29093: (follow-up) Fix the all fields empty-warning

We should allow checking the TOC box only.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29093: (QA follow-up) Adding two hover texts
Marcel de Rooy [Wed, 29 Sep 2021 11:23:32 +0000 (11:23 +0000)]
Bug 29093: (QA follow-up) Adding two hover texts

See QA request. Adding TOC hover text to:
- OPAC user page, tab Article requests
- Patron details page, Check out, tab Article requests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29093: Interface changes
Marcel de Rooy [Thu, 23 Sep 2021 13:23:44 +0000 (13:23 +0000)]
Bug 29093: Interface changes

Show the TOC checkbox on OPAC and staff.

Test plan:
Add new article request on OPAC or staff. Tick checkbox.
Verify if TOC is Yes on opac-user or staff patron details.
Check the list view on circ/article-requests.pl.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29093: Database revision for article_requests.toc_request
Marcel de Rooy [Thu, 23 Sep 2021 12:30:31 +0000 (12:30 +0000)]
Bug 29093: Database revision for article_requests.toc_request

Test plan:
Run dbrev or new install.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29199: Fix parameters of ListCallNumbers
Marcel de Rooy [Mon, 11 Oct 2021 08:34:00 +0000 (08:34 +0000)]
Bug 29199: Fix parameters of ListCallNumbers

[1] ItemBranch should have been passed with quotes.
[2] You cannot use $x as class name, you need to use xsl:attribute.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29111: Remove unused indicator modification code for items
Joonas Kylmälä [Sun, 26 Sep 2021 08:10:15 +0000 (08:10 +0000)]
Bug 29111: Remove unused indicator modification code for items

The indicator value for 952 was hard coded in every case to " ". In
order to achieve that we can simply pass undef to TransformHtmlToXml()
and it will set the indicator values to " ".

To test:
 1) Make sure the submission of (at least some) the modified files
 still work, e.g. test that making a new item via
 cataloguing/additem.pl works.

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29111: Remove dead code from acqui/addorderiso2709.pl
Joonas Kylmälä [Sun, 26 Sep 2021 08:01:51 +0000 (08:01 +0000)]
Bug 29111: Remove dead code from acqui/addorderiso2709.pl

Test plan:
 1) open acqui/addorderiso2709.pl in your code editor and make sure
 nothing references $item in the if block where it was removed from

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29213: Fix typo ol in member-alt-contact-style.inc
Fridolin Somers [Tue, 12 Oct 2021 18:49:48 +0000 (08:49 -1000)]
Bug 29213: Fix typo ol in member-alt-contact-style.inc

There is a typo in member-alt-contact-style.inc, tag ol is open twice for alternate contact.

Test plan :
1) Create new patron
2) Look at HTML structure in "Alternate contact" section
=> Without patch you see <ol> twice and </ol> once
=> With patch you see once <ol> and </ol>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29157: Date and Datetime attributes cannot be set NULL
Tomas Cohen Arazi [Thu, 7 Oct 2021 18:28:40 +0000 (15:28 -0300)]
Bug 29157: Date and Datetime attributes cannot be set NULL

This patch makes Koha::Object->attribute_from_api allow setting
attributes the undef value. The original implementation passed the value
directly to dt_from_string, which made the attribute be set the current
date.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t \
           t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail! Our code is buggy!
3. Apply this patch
4. Repeat 2
=> SUCCESS! Fix fixed this thing!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29157: Regression tests
Tomas Cohen Arazi [Thu, 7 Oct 2021 18:16:01 +0000 (15:16 -0300)]
Bug 29157: Regression tests

This patch implements regression tests for the filed bug.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 15812: (follow-up) Enable click cell to select
Martin Renvoize [Fri, 1 Oct 2021 11:25:20 +0000 (12:25 +0100)]
Bug 15812: (follow-up) Enable click cell to select

This patch adds handling to allow clicking anywhere in the table cell to
select/deselect the patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 15812: (follow-up) Tweaks to patron results display
Martin Renvoize [Fri, 1 Oct 2021 08:58:08 +0000 (09:58 +0100)]
Bug 15812: (follow-up) Tweaks to patron results display

Move the button into the actions column and make 'cardnumber' a link to
checkout, with a tooltip.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 15812: (follow-up) Add permission check for 'Check out' button
Nick Clemens [Thu, 30 Sep 2021 11:31:45 +0000 (11:31 +0000)]
Bug 15812: (follow-up) Add permission check for 'Check out' button

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 15812: Use patron search in place of circ search
Nick Clemens [Fri, 24 Sep 2021 00:05:30 +0000 (00:05 +0000)]
Bug 15812: Use patron search in place of circ search

The 'Checkout' search hijacks some of the DataTables searching code used for 'Search patrons'
Rather than try to implement the search again on another page, we can simply send the user
to the patron search if the cardnumber is not found

Additionally, this patch adds a 'Check out' button to the patron search results to allow
going to checkotus directly

To test:
1 - Apply patch
2 - Perform a 'Checkout' search from the header
3 - Note that:
    For a cardnumber, you are redirected directly to checkouts page for the borrower
    For a search with one result, you are redirected directly to the checkout page for the borrower
    For a search with many results, you are redirected to the patron search results
    and there is a 'Checkout' button under the cardnumber
4 - Confirm circulation page works as expected (i.e. checkout to a patron)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28978: Compiled CSS
Jonathan Druart [Tue, 12 Oct 2021 09:16:39 +0000 (11:16 +0200)]
Bug 28978: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28978: Convert installer CSS to SCSS
Owen Leonard [Wed, 8 Sep 2021 23:30:11 +0000 (23:30 +0000)]
Bug 28978: Convert installer CSS to SCSS

This patch creates a new SCSS file, installer.scss, from which
installer.css will be compiled.

Most of the resulting CSS is unchanged, but some minor sections were
removed because they were obsolete. The jQueryUI-specific section isn't
fully converted to SCSS because it's going to go away with the addition
of Flatpickr.

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

- Confirm that koha-tmpl/intranet-tmpl/prog/css/installer.css is
  updated.
- Go through the complete web installation process, including
  onboarding, to confirm that everything is styled as before.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28956: Correct default tax rate on orderreceive
Wainui Witika-Park [Mon, 6 Sep 2021 23:15:39 +0000 (23:15 +0000)]
Bug 28956: Correct default tax rate on orderreceive

When there is more than one tax rate defined in system preferences, and
a vendor has a tax rate that is not 0%, then when you are receiving an
order in a basket for that vendor, the default tax rate should be the
correct non 0 rate. This should be seen in acqui/orderreceive.

To test:
1) Go to staff client
2) Go to Koha administration
3) Search for "tax rate" in system preferences
4) Add 0|0.15 into the preference
5) Create a vendor
6) Set vendor tax rate to 15%
7) Add a new basket to vendor
8) Add to basket
9) Add any sample order to basket - add actual cost
10) Close basket
11) Receive shipment
12) Make invoice
13) Click on Receive in the table
14) Should be on orderreceive.pl page
15) Observe tax rate default is 0%
16) Apply patch
17) Refresh page
18) Observe tax rate default is 15%

Sponsored-by: Catalyst IT
Signed-off-by: Julien Sicot <julien.sicot@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29162: Change template structure on OPAC library page so that a single library...
Owen Leonard [Mon, 4 Oct 2021 19:18:04 +0000 (19:18 +0000)]
Bug 29162: Change template structure on OPAC library page so that a single library can easily be hidden

This patch adds markup to the OPAC library page so that CSS or JS can
more easily target elements of the page:

- Each library is wrapped in a div, e.g. <div id="section_CPL">
- Classes are added to the paragraphs containing phone, fax, URL, and
  library description.
- An ID has been added to the menu of libraries in the sidebar so that
  they can be targetted individually.

To test, apply the patch and go to Administration -> System prefernces.

- Add some testing CSS to the OPACUserCSS system preference, if
  necessary replacing "CPL" with a branchcode in your system:

  div#section_CPL,
  li#menu_CPL {
     font-size: 80%;
  }

- In the OPAC, view the "Libraries" page.
- In the view of all libraries you should see your CSS reflected in the
  section for that library.
- In the individual library view you should see the menu item for that
  library affected by your custom CSS.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28963: Compiled CSS
Jonathan Druart [Tue, 12 Oct 2021 09:09:29 +0000 (11:09 +0200)]
Bug 28963: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28963: Use Flatpickr on calendar page
Owen Leonard [Mon, 4 Oct 2021 16:33:25 +0000 (16:33 +0000)]
Bug 28963: Use Flatpickr on calendar page

This patch replaces the use of jQueryUI's datepicker widget on the
Calendar page.

In order to ease customization of the static calendar which shows the
current calendar, I've converted the calendar.css file to SCSS. This
allows us to define new SCSS variables to pass to the Flatpickr SCSS.

Also changed: Removed some unecessary comments in the template.

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

- Go to Tools -> Calendar.
- Confirm that entering holidays works correctly for all types: Single,
  weekly, yearly, ranges, repeated ranges.
- Confirm that holidays are deleted as expected.
- Confirm that the colors of each type of holiday is correct.

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>
2 years agoBug 28988: (follow-up) Add markup comments
Owen Leonard [Thu, 9 Sep 2021 18:42:48 +0000 (18:42 +0000)]
Bug 28988: (follow-up) Add markup comments

This patch adds comments to the template to highlight the markup
structure.

This patch should have no effect on the page's appearance or
functionality.

https://bugs.koha-community.org/show_bug.cgi?id=28988

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>
2 years agoBug 28988: Reindent calendar template
Owen Leonard [Thu, 9 Sep 2021 18:32:20 +0000 (18:32 +0000)]
Bug 28988: Reindent calendar template

This patch performs general template cleanup to the calendar template:
Make indentation consistent and trim trailing whitespace.

To test, apply the patch and go to Tools -> Calendar.

The page should look correct and work correctly. If you view the diff
while ignoring whitespace the only changes should be where line breaks
were introduced.

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>
2 years agoBug 29177: Remove TODO in acqui/finishreceive
Marcel de Rooy [Tue, 5 Oct 2021 14:05:49 +0000 (14:05 +0000)]
Bug 29177: Remove TODO in acqui/finishreceive

Replacing a multiple object->column(value) by ->update.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29116: Use a pre-existing accessor instead of reimplementing it
Joonas Kylmälä [Sun, 26 Sep 2021 16:09:20 +0000 (16:09 +0000)]
Bug 29116: Use a pre-existing accessor instead of reimplementing it

We can use the Koha::Patron::is_expired accessor instead of re-writing
it in request.pl.

To test:
 1) Make that a warning is being shown with and without this patch
    when placing a hold to an expired patron account

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29112: Compiled CSS
Jonathan Druart [Tue, 12 Oct 2021 09:09:08 +0000 (11:09 +0200)]
Bug 29112: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29112: Module navigation sidebars in staff now show bullet points
Owen Leonard [Tue, 5 Oct 2021 16:22:20 +0000 (16:22 +0000)]
Bug 29112: Module navigation sidebars in staff now show bullet points

Bug 27873 removed an image file which was still being referenced in the
staff interface CSS, intended to replace the default bullet point in
sidebar menus like Administration and Tools pages have.

This patch creates a new variable in the SCSS "mixins" file so that the
SVG image file created by Bug 27873 can be reused, and corrects the CSS
for the affected menus.

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

- Go to Tools -> Patron lists
  - The sidebar menu should be styled with little arrows instead of
    the default HTML bullets.
- Check the same on an Administration page, e.g. Administration ->
  Libraries.
- Check that there hasn't been a regression on the checkout and patron
  detail views:
  - Check out to a patron who has one or more messages on their account,
    e.g. overdues, return claims, holds waiting, notes, messages, etc.
  - The display of these list items should be the same: An arrow bullet
    point instead of the default.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28441: Terminology: Reserve notes should be Hold notes
Owen Leonard [Thu, 7 Oct 2021 14:04:32 +0000 (14:04 +0000)]
Bug 28441: Terminology: Reserve notes should be Hold notes

This bug corrects the text "Reserve notes" to be "Hold notes" on the
holds to pull page.

To test, apply the patch and go to Circulation -> Holds to pull.

You should see in the table header a column labeled  "Hold notes."

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>
2 years agoBug 28579: Typo: No record have been imported because they all match an existing...
Owen Leonard [Thu, 7 Oct 2021 15:44:03 +0000 (15:44 +0000)]
Bug 28579: Typo: No record have been imported because they all match an existing record in your catalog.

This patch corrects a grammatical error in text which might be shown
when adding records from a staged file to a basket. It corrects this:

  "No record have been imported because they all match an existing
  record in your catalog."

..to this:

  "No records have been imported because they all match existing
  records in your catalog."

To see the error in Koha, apply the patch and export some records from
Koha (Tools -> Export) and then re-import them using Tools -> Stage MARC
for import.

- Go to Acquisitions -> Vendor -> Basket -> Add to basket -> From a
  staged file.
- Click the "Add to order" button corresponding to the file you just
  uploaded.
- Select all records and define default accounting details.
- When you click "Save" you should see the error message.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28470: Typo: Are you sure you with to chart this report?
Owen Leonard [Thu, 7 Oct 2021 14:19:56 +0000 (14:19 +0000)]
Bug 28470: Typo: Are you sure you with to chart this report?

This patch corrects the text of a warning on the report results page,
from this:

_("Fetching full chart data for reports with many rows can cause
performance issues. Are you sure you with to chart this report?")

...to this:

_("Fetching full chart data for reports with many rows can cause
performance issues. Are you sure you want to chart this report?")

To test, apply the patch and go to Reports -> Use saved.

 - Run a report which, unlimited, will return more than 1000 rows.
 - Click the "Fetch all data for chart" button.
 - You should be asked for confirmation. Check that the text is correct.

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>
2 years agoBug 29172: (follow-up) Amend preference text for control fields
Katrin Fischer [Mon, 4 Oct 2021 18:21:02 +0000 (18:21 +0000)]
Bug 29172: (follow-up) Amend preference text for control fields

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29172: Make CustomCoverImagesURL compatible with control fields
Jonathan Druart [Tue, 5 Oct 2021 11:57:04 +0000 (13:57 +0200)]
Bug 29172: Make CustomCoverImagesURL compatible with control fields

Bug 22445 added CustomCoverImagesURL that deals with MARC fields, but
control fields were not supported.

Test plan:
Turn CustomCoverImages on
Fill CustomCoverImagesURL with https://covers.openlibrary.org/b/isbn/{006}-M.jpg
Add an isbn in 006 (0596001738 will work)
Go to the detail page of the bibliographic record and confirm that you
see a cover image.

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>
2 years agoBug 24698: QA fixes
Joonas Kylmälä [Sun, 3 Oct 2021 11:51:22 +0000 (11:51 +0000)]
Bug 24698: QA fixes

This is a squashed patch of the following patches:

Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced

The original patch "Bug 24698: Add plugin and template files for
unimarc authority leader" doesn't work without explictly importing the
methods from C4::Auth and C4::Output due to the default exports being
changed in those modules after the patch was made.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Remove debug info being outputted to the template

This is only needed during development.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Align variables with whitespace

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Remove dead code

These were left off from the copy&paste taken from
unimarc_field_100_authorities.pl

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Fix formatting and typos

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter

It should only be used when we want to override the default of auth
being required.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Make plugin script executable

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Use spaces instead of tabs

This makes the QA script happy.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Don't specify select element's size if it is 1

This is to make the QA script happy, in order to not to break
Bootstrap CSS rules, see Bug 28066 for more info

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Don't specify script type explictly

It's makes the QA script complain because the option doesn't have any
effect nowadays:

https://www.w3.org/TR/2017/REC-html52-20171214/obsolete.html#warnings-for-obsolete-but-conforming-features
Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (follow-up) remove HTML select option for Series

The IFLA authorities format specification defines only the letters a-l
as possible values for authority leader 000 character position 9 ("Type
of entity"). Therefore, the first option from the HTML select dropdown
menu (" - Series") must be removed.

Mentored-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24698: Add plugin and template files for unimarc authority leader
George Veranis [Fri, 12 Mar 2021 11:51:57 +0000 (12:51 +0100)]
Bug 24698: Add plugin and template files for unimarc authority leader

In Unimarc installations when adding/editing an authority record there is no
Tag Editor for the leader field ( 000 ).

This patch fixes that.

Test plan:

1) Try to catalogue a new authoritry and check if on field 000 you can find
the Tag Editor.
2) Apply the patch.
3) In the authorities framework view the subfields of field 000 and select for
plugin option the value unimarc_leader_authorities.pl.
4) Restart memcached / plack if needed.
5) Repeat step 1 and notice if the Tag Editor is visible and click it to open
new window in order to manage the field contents and press OK.
6) Check the value of the generated leader.

Signed-off-by: Esther <estherm@sodapsringsid.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>