]> git.koha-community.org Git - koha.git/log
koha.git
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 years agoBug 29138: DBRev 21.06.00.032
Jonathan Druart [Tue, 12 Oct 2021 09:14:38 +0000 (11:14 +0200)]
Bug 29138: DBRev 21.06.00.032

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29138: (QA follow-up) Changes to UPDATE
Marcel de Rooy [Fri, 8 Oct 2021 06:30:13 +0000 (06:30 +0000)]
Bug 29138: (QA follow-up) Changes to UPDATE

Move the condition to the WHERE clause, using COALESCE to
prevent mysqlism (IFNULL) and strings for strict SQL.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested on NULL, 0, 1, 2, no, yes. (2 and yes become 0 too. Fine.)
Tested strict sql mode: no truncated incorrect DOUBLE value-error anymore.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29138: Use zero instead of no in LoadSearchHistoryToTheFirstLoggedUser
Andrew Fuerste-Henry [Wed, 29 Sep 2021 19:24:13 +0000 (19:24 +0000)]
Bug 29138: Use zero instead of no in LoadSearchHistoryToTheFirstLoggedUser

To test:
- apply patch
- set LoadSearchHistoryToTheFirstLoggedUser to 'Don't add'
- confirm via sql that value=0
- confirm on OPAC that search history is not loaded to account on login

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>
3 years agoBug 29197: Add missing import in commit_file.pl
Tomas Cohen Arazi [Fri, 8 Oct 2021 13:44:00 +0000 (10:44 -0300)]
Bug 29197: Add missing import in commit_file.pl

This patch adds a new method import to the commit_file.pl script.

To test:
1. Have MARC data staged
2. Run:
   $ kshell
  k$ perl misc/commit_file.pl --list-batches
=> FAIL: You get
Undefined subroutine &main::GetAllImportBatches called at misc/commit_file.pl line 68.
3. Apply this patch
4. Repeat 2
=> SUCCESS: You get the list of batches
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
3 years agoBug 29193: Specify paging as false in circ-patron-search-results.js
Nick Clemens [Thu, 7 Oct 2021 19:34:01 +0000 (19:34 +0000)]
Bug 29193: Specify paging as false in circ-patron-search-results.js

This patch removes paging from patron searches using circ-patron-search-results.js

To test:
1 - Browse to a record
2 - Click on the 'Holds' tab
3 - Search for 'a' in patrons
4 - Note you see only 20 results
5 - Sort by name and note that you see different results
6 - Apply patch
7 - Reload page and search
8 - Note you see all results

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 28748: Prepare pickup locations for overridden holds
Nick Clemens [Wed, 6 Oct 2021 11:57:19 +0000 (11:57 +0000)]
Bug 28748: Prepare pickup locations for overridden holds

The logic in request.pl only passes pickup locations if a hold is allowed,
they are not calculated when the hold is overridden.

This patch copies the pickup locations code into the override conditional,
adjusting to mark the item overridden

This also highlights an condition of override:
If a hold is allowed, but there are no valid pickup locations the override
is not allowed.

To test:
 1 - Set a holds rule to allow on-shelf holds only if all unavailable
 2 - Set AllowHoldPolicyOverride to 'Allow'
 3 - Find a record with several items available
 4 - Attempt to place a hold
 5 - The items have a yellow triangle, but no pickup locations
 6 - Place an item level hold
 7 - Note the hold has no pickup location
 8 - Cancel the hold
 9 - Apply patch and restart all
10 - Attempt hold again
11 - Items still have yellow triangle, but there are dropdowns for pickup location
12 - Place an item level hold, verify a pickup location is set
13 - Cancel the hold
14 - Alter circ rule to allow on shelf holds
15 - Change 'Default checkout, hold and return policy' - 'Hold pickup library match' to "item's hold group"
16 - Ensure there is no group for the item
17 - Attempt to place hold
18 - Override is not allowed 'No valid pickup locations'

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>
3 years agoBug 29135: Fix handling of deleted items in OAI-PMH provider
Ere Maijala [Thu, 30 Sep 2021 19:53:15 +0000 (22:53 +0300)]
Bug 29135: Fix handling of deleted items in OAI-PMH provider

When the OAI-PMH provider was configured to include item information
in the returned records, deleting an item would cause the record to
be reported as deleted. The provider also did some useless checks when
determining the timestamp of a deleted record. These checks only had
a performance impact.

To test:
1) Create /var/lib/koha/kohadev/OAI.yaml with:

format:
  marcxml:
    metadataPrefix: marcxml
    metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim
    schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
    include_items: 1

2) Set preference OAI-PMH to Enable
3) Set preference OAI-PMH:ConfFile to /var/lib/koha/kohadev/OAI.yaml
4) Delete an item from a record
5) View the page: http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml
6) Note the record is now listed as deleted
7) Run prove -v t/db_dependent/OAI/

Sponsored-by: The National Library of Finland
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>
3 years agoBug 28734: Clear cache to prevent random failures
Jonathan Druart [Tue, 12 Oct 2021 07:10:58 +0000 (09:10 +0200)]
Bug 28734: Clear cache to prevent random failures

MSS is modified, we must clear the cache before and after

    #   Failed test 'Authorised value is correctly parsed to show description rather than code'
    #   at t/db_dependent/Koha/Biblio.t line 617.
    #          got: 'CODE'
    #     expected: 'Description should show'

    #   Failed test 'Authorised value is correctly parsed for OPAC to show description rather than code'
    #   at t/db_dependent/Koha/Biblio.t line 624.
    #          got: 'CODE'
    #     expected: 'Description should show OPAC'
    # Looks like you failed 2 tests of 13

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27526: (follow-up) Remove uneeded call to TransformMarcToKoha
Jonathan Druart [Tue, 12 Oct 2021 06:53:49 +0000 (08:53 +0200)]
Bug 27526: (follow-up) Remove uneeded call to TransformMarcToKoha

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Add tests for item-level_itypes=0
Jonathan Druart [Fri, 8 Oct 2021 13:05:39 +0000 (15:05 +0200)]
Bug 3142: Add tests for item-level_itypes=0

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Handle biblio level item type
Jonathan Druart [Fri, 8 Oct 2021 10:03:41 +0000 (12:03 +0200)]
Bug 3142: Handle biblio level item type

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: (QA follow-up) Include notforloan itemtypes
Marcel de Rooy [Fri, 8 Oct 2021 09:10:22 +0000 (09:10 +0000)]
Bug 3142: (QA follow-up) Include notforloan itemtypes

As was done in the code already.
Note that we are ignoring effective itemtype now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: (QA follow-up) Cosmetic changes
Marcel de Rooy [Fri, 8 Oct 2021 08:31:52 +0000 (08:31 +0000)]
Bug 3142: (QA follow-up) Cosmetic changes

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Add note about imprecision of filter_by_for_hold
Jonathan Druart [Tue, 5 Oct 2021 12:32:47 +0000 (14:32 +0200)]
Bug 3142: Add note about imprecision of filter_by_for_hold

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Add test for the circ rule
Jonathan Druart [Tue, 5 Oct 2021 12:30:49 +0000 (14:30 +0200)]
Bug 3142: Add test for the circ rule

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Add tests
Jonathan Druart [Tue, 5 Oct 2021 12:17:22 +0000 (14:17 +0200)]
Bug 3142: Add tests

And fix a bug!

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Use filter_by_for_holds where holdability is calculated
Jonathan Druart [Tue, 22 Jun 2021 13:49:45 +0000 (15:49 +0200)]
Bug 3142: Use filter_by_for_holds where holdability is calculated

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Add itype
Jonathan Druart [Tue, 22 Jun 2021 13:43:10 +0000 (15:43 +0200)]
Bug 3142: Add itype

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Exclude damaged items
Jonathan Druart [Tue, 22 Jun 2021 13:39:55 +0000 (15:39 +0200)]
Bug 3142: Exclude damaged items

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 3142: Add itemlost, withdrawn and notforloan
Jonathan Druart [Tue, 22 Jun 2021 13:38:29 +0000 (15:38 +0200)]
Bug 3142: Add itemlost, withdrawn and notforloan

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29169: Fix wrong terminology when article request is not available
Tomas Cohen Arazi [Thu, 7 Oct 2021 15:02:24 +0000 (12:02 -0300)]
Bug 29169: Fix wrong terminology when article request is not available

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>
3 years agoBug 29134: (follow-up) Specify which borrowernumber
Nick Clemens [Fri, 8 Oct 2021 14:42:48 +0000 (14:42 +0000)]
Bug 29134: (follow-up) Specify which borrowernumber

When performing a search that includes permissions we need to specify we are comparing
the borrowers tabnle borrowernumber

To test:
1 - Browse to Admin->Funds
2 - Edit a fund
3 - Click '+ Add users'
4 - Attempt a search, no results
5 - Check plack-error.log
    C4::Utils::DataTables::Members::search(): DBI Exception: DBD::mysql::st execute failed: Column 'borrowernumber' in IN/ALL/ANY subquery is ambiguous at /kohadevbox/koha/svc/members/search line 80
6 - Apply patch
7 - Repeat 1-3
8 - search for 'a'
9 - Result!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29182: (follow-up) Fix ArticleRequests.t
Marcel de Rooy [Thu, 7 Oct 2021 09:56:22 +0000 (09:56 +0000)]
Bug 29182: (follow-up) Fix ArticleRequests.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29182: (follow-up) Simplify Koha::ArticleRequest->store
Tomas Cohen Arazi [Wed, 6 Oct 2021 12:10:38 +0000 (09:10 -0300)]
Bug 29182: (follow-up) Simplify Koha::ArticleRequest->store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29182: Make sure methods call the overloaded ->store
Tomas Cohen Arazi [Wed, 6 Oct 2021 12:01:13 +0000 (09:01 -0300)]
Bug 29182: Make sure methods call the overloaded ->store

This patch addresses the issue of `request()` and `set_pending()`
calling $self->SUPER::store instead of the overloaded one.

This prevents created_on being set.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/ArticleRequest.t
=> FAIL: created_on is not set on two methods
3. Apply this patch
4. Repeat 2
=> SUCCESS: created_on is now set!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29182: Regression tests
Tomas Cohen Arazi [Wed, 6 Oct 2021 12:00:48 +0000 (09:00 -0300)]
Bug 29182: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29131: Row striping breaks color coding on item circulation alerts
Owen Leonard [Tue, 5 Oct 2021 12:12:34 +0000 (12:12 +0000)]
Bug 29131: Row striping breaks color coding on item circulation alerts

The CSS we use for table row "striping," which uses 'tbody
tr:nth-child(odd),' is often difficult to work with because it takes a
lot of increased specificity to override the default. Bootstrap
compounds this by adding its own similar CSS.

In order to overcome this I've added '!important' to the CSS embedded in
the item circulation alerts page. I normally would avoid '!important'
but since this CSS is only relevant to this page I think it's
appropriate.

This patch also adds [% FILTER collapse %] around the <style> block and
does some reindenting, so ignore whitespace when using diff to see the
changes clearly.

To test, apply the patch and go to Administration -> Item circulation
alerts.

- Check the "Legend" table. The first cells should be distinct colors:
  red, pink, and green.
- In the "Checkout" table, table cells should be green by default.
  Clicking in one of the cells should turn it red with the text
  "Disabled for all."
- Use the "Select a library" dropdown to pick a library.
- Clicking in any green cell should turn the cell pink and add the text
  "Disabled for XXX" where XXX is the branchcode.

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>
3 years agoBug 29062: Unit tests
Nick Clemens [Thu, 7 Oct 2021 13:13:20 +0000 (13:13 +0000)]
Bug 29062: Unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 29062: (QA follow-up) Add comment
Marcel de Rooy [Wed, 6 Oct 2021 13:32:55 +0000 (13:32 +0000)]
Bug 29062: (QA follow-up) Add comment

Wrapped it in a TODO ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>