]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 23463: Fix tests
Tomas Cohen Arazi [Thu, 6 Feb 2020 13:24:04 +0000 (10:24 -0300)]
Bug 23463: Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Fix safe_return return value in deletion tools
Jonathan Druart [Thu, 30 Jan 2020 15:15:14 +0000 (16:15 +0100)]
Bug 23463: Fix safe_return return value in deletion tools

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: (follow-up) Fix timestamp default value
Jonathan Druart [Tue, 28 Jan 2020 11:54:37 +0000 (12:54 +0100)]
Bug 23463: (follow-up) Fix timestamp default value

For discussion, this patch revert the changes made previously.

This line exists in Koha::Item->store as it is the translation of:
    if (exists $item->{'timestamp'}) {
        delete $item->{'timestamp'};
    }
that was coming from _do_column_fixes_for_mod (called from ModItem)

To preserve existing behavior I would be in favor of keeping it like that to
avoid regression, and deal with it separately if we want to improve/remove it.

So basically here we are setting it to undef in Koha::Item->store to make it
handle correctly by the parent Koha::Object->store. I agree that's kind of weird
and must be improved.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Move DelItem.t and Items_DelItemCheck.t tests to a Koha/Item.t subtest
Jonathan Druart [Mon, 27 Jan 2020 16:20:26 +0000 (17:20 +0100)]
Bug 23463: Move DelItem.t and Items_DelItemCheck.t tests to a Koha/Item.t subtest

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Fix timestamp default value
Jonathan Druart [Mon, 27 Jan 2020 15:54:20 +0000 (16:54 +0100)]
Bug 23463: Fix timestamp default value

This sounds wrong as we should let the DBMS do that, but it was failing.
Here we are doing the same as Koha::Patron->store for dateenrolled

To recreate the failure, prove t/db_dependent/Koha/Item.t without this
patch:
DBD::mysql::st execute failed: Column 'timestamp' cannot be null [for
Statement "UPDATE `items` SET `more_subfields_xml` = ?, `timestamp` = ?
WHERE ( `itemnumber` = ? )" with ParamValues: 0='<?xml version="1.0"
encoding="UTF-8"?>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: (follow-up) Remove DelItemCheck and ItemSafeToDelete
Jonathan Druart [Tue, 10 Dec 2019 11:58:09 +0000 (12:58 +0100)]
Bug 23463: (follow-up) Remove DelItemCheck and ItemSafeToDelete

Wrong replacement in additem.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: cn_sort needs to be updated if cn_source changed
Jonathan Druart [Mon, 2 Dec 2019 13:32:09 +0000 (14:32 +0100)]
Bug 23463: cn_sort needs to be updated if cn_source changed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Replace recently added occurrences
Jonathan Druart [Mon, 2 Dec 2019 11:02:28 +0000 (12:02 +0100)]
Bug 23463: Replace recently added occurrences

Few occurrences have been added since this patchset has been originaly
written

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: build cn_sort only if needed
Jonathan Druart [Mon, 12 Aug 2019 23:27:30 +0000 (18:27 -0500)]
Bug 23463: build cn_sort only if needed

No need to calculate cn_sort if not dirty when we store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Fix items.cn_source vs cn_source
Jonathan Druart [Mon, 12 Aug 2019 22:51:24 +0000 (17:51 -0500)]
Bug 23463: Fix items.cn_source vs cn_source

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: update permanent_location if location has been updated
Jonathan Druart [Thu, 8 Aug 2019 02:13:18 +0000 (21:13 -0500)]
Bug 23463: update permanent_location if location has been updated

This change to Koha::Item->store seems correct here, but tests from /db_dependent/Items.t is failing now.

Adjusting them to make them pass.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Fix AutomaticItemModificationByAge.t
Jonathan Druart [Thu, 8 Aug 2019 01:47:20 +0000 (20:47 -0500)]
Bug 23463: Fix AutomaticItemModificationByAge.t

We do not want to log if nothing changed

How could we do that better?

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Getting less item-level_itypes warnings (?)
Jonathan Druart [Thu, 8 Aug 2019 01:28:06 +0000 (20:28 -0500)]
Bug 23463: Getting less item-level_itypes warnings (?)

So, we get less warnings. I do not really understand why...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Fix failing tests
Jonathan Druart [Wed, 7 Aug 2019 16:09:57 +0000 (11:09 -0500)]
Bug 23463: Fix failing tests

And adding a FIXME about discard_changes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Fix CancelReceipt.t
Jonathan Druart [Wed, 7 Aug 2019 16:00:49 +0000 (11:00 -0500)]
Bug 23463: Fix CancelReceipt.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Remove no longer needed subs related to default values
Jonathan Druart [Wed, 7 Aug 2019 15:44:24 +0000 (10:44 -0500)]
Bug 23463: Remove no longer needed subs related to default values

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Remove DelItemCheck and ItemSafeToDelete
Jonathan Druart [Tue, 6 Aug 2019 16:58:01 +0000 (11:58 -0500)]
Bug 23463: Remove DelItemCheck and ItemSafeToDelete

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Remove DelItem
Jonathan Druart [Tue, 6 Aug 2019 16:29:27 +0000 (11:29 -0500)]
Bug 23463: Remove DelItem

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Remove ModItem
Jonathan Druart [Tue, 6 Aug 2019 16:14:25 +0000 (11:14 -0500)]
Bug 23463: Remove ModItem

There should not be any calls left

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Remove _mod_item_dates
Jonathan Druart [Tue, 6 Aug 2019 16:14:07 +0000 (11:14 -0500)]
Bug 23463: Remove _mod_item_dates

We did not do anything useful here.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: _do_column_fixes_for_mod dealt with integer location and timestamp moved
Jonathan Druart [Tue, 6 Aug 2019 16:12:31 +0000 (11:12 -0500)]
Bug 23463: _do_column_fixes_for_mod dealt with integer location and timestamp moved

That's done in Koha::Item->store, and Koha::Object->store for integers.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: _set_derived_columns_for_mod was only used for cn_sort
Jonathan Druart [Tue, 6 Aug 2019 16:11:38 +0000 (11:11 -0500)]
Bug 23463: _set_derived_columns_for_mod was only used for cn_sort

Same as _set_defaults_for_add

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Move plugin hook
Jonathan Druart [Tue, 6 Aug 2019 15:17:28 +0000 (10:17 -0500)]
Bug 23463: Move plugin hook

From C4::Items to Koha::Item

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: remove trivial UpdateHoldingbranch sub
Jonathan Druart [Mon, 18 Mar 2019 18:06:03 +0000 (15:06 -0300)]
Bug 23463: remove trivial UpdateHoldingbranch sub

We do not need this subroutine, moving it where it is used.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Replace ModItem with Koha::Item->store
Jonathan Druart [Mon, 18 Mar 2019 17:56:19 +0000 (14:56 -0300)]
Bug 23463: Replace ModItem with Koha::Item->store

Starting to replace the ModItem calls with Koha::Item->store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: AddItem removing
Jonathan Druart [Mon, 18 Mar 2019 17:41:37 +0000 (14:41 -0300)]
Bug 23463: AddItem removing

We are done with AddItem, only need to log and index.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Replace _set_derived_columns_for_add
Jonathan Druart [Mon, 18 Mar 2019 17:20:51 +0000 (14:20 -0300)]
Bug 23463: Replace _set_derived_columns_for_add

Remove the unique call to _set_derived_columns_for_add
Even if design to deal with other values it only dealts with cn_sort

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Remove _set_defaults_for_add
Jonathan Druart [Mon, 18 Mar 2019 17:15:37 +0000 (14:15 -0300)]
Bug 23463: Remove _set_defaults_for_add

_set_defaults_for_add is no longer needed as it is handled by dbic and koha::object->store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Replace AddItem calls with Koha::Item->store
Jonathan Druart [Mon, 18 Mar 2019 02:12:46 +0000 (23:12 -0300)]
Bug 23463: Replace AddItem calls with Koha::Item->store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: fix for testbuilder - set default value items.damaged=0
Jonathan Druart [Mon, 18 Mar 2019 02:12:22 +0000 (23:12 -0300)]
Bug 23463: fix for testbuilder - set default value items.damaged=0

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Remove uneeded SearchItemsByField subroutine
Jonathan Druart [Mon, 18 Mar 2019 00:10:00 +0000 (21:10 -0300)]
Bug 23463: Remove uneeded SearchItemsByField subroutine

It is no longer used.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: Replace SearchItemsByField by SearchItems
Jonathan Druart [Mon, 18 Mar 2019 00:09:29 +0000 (21:09 -0300)]
Bug 23463: Replace SearchItemsByField by SearchItems

The subroutine SearchItemsByField is only called once and can be
replaced easily with SearchItems

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24297: Record 'Manual' trigger transfers
Martin Renvoize [Fri, 17 Jan 2020 11:25:28 +0000 (11:25 +0000)]
Bug 24297: Record 'Manual' trigger transfers

To test:
1 - Apply patches, restart_all
2 - Gi to Circulation->Transfer
3 - Transfer an item
4 - Check the branch transfers table
5 - The reason is set to 'Manual'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24436: DBRev 19.12.00.049
Martin Renvoize [Fri, 20 Mar 2020 16:02:15 +0000 (16:02 +0000)]
Bug 24436: DBRev 19.12.00.049

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24436: Add handling for reserve transfer triggers
Martin Renvoize [Fri, 17 Jan 2020 10:47:49 +0000 (10:47 +0000)]
Bug 24436: Add handling for reserve transfer triggers

To test:
1 - Place a hold for pickup at a different branch than you are signed in at on an item owned by current branch
2 - Check in the item
3 - Confirm the transfer
4 - Check the branchtransfers table and note the reason is 'Reserve'
5 - Set the preference CanMarkHoldsToPullAsLost to allow
6 - Place a hold on an item at branch you are singed in at
7 - Ensure you are not using strict sql modes (bug 22431)
8 - Go to Circulation->Holds to pull
9 - Mark hold as lost
10 - Check branchtransfers and confirm reason is "LostReserve"
11 - Check in item from step 1 at the correct branch
12 - Go to Circulation->Holds awaiting pickup
13 - Cancel the reserve
14 - Check branchtransfers and confirm reason is "CancelReserve"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24436: Add 'Reserve' options to branchtransfers trigger
Martin Renvoize [Fri, 17 Jan 2020 11:20:37 +0000 (11:20 +0000)]
Bug 24436: Add 'Reserve' options to branchtransfers trigger

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24299: DBRev 19.12.00.048
Martin Renvoize [Fri, 20 Mar 2020 15:57:45 +0000 (15:57 +0000)]
Bug 24299: DBRev 19.12.00.048

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24299: Add Unit test for 'reason' in transferbook
Martin Renvoize [Fri, 20 Mar 2020 11:15:54 +0000 (11:15 +0000)]
Bug 24299: Add Unit test for 'reason' in transferbook

Test plan
1/ Run test and verify it passes
2/ Signoff

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24299: Record 'RotatingCollection' as a transfer trigger
Martin Renvoize [Thu, 16 Jan 2020 16:40:10 +0000 (16:40 +0000)]
Bug 24299: Record 'RotatingCollection' as a transfer trigger

This patch adds support for passing a trigger to
C4::Circulation::transferbook and passes 'RotatingCollection' to it when
called inside the rotating collections routine.

Test plan:
1/ Perform a rotating collection transfer operations
2/ Check the database for instances of 'RotatingCollection' in the
branchtransfers.reason field.
3/ Signoff

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24299: Add 'RotatingCollection' branchtransfer trigger
Martin Renvoize [Thu, 16 Jan 2020 16:43:09 +0000 (16:43 +0000)]
Bug 24299: Add 'RotatingCollection' branchtransfer trigger

This patch adds the RotatingCollection value to the database enum for
branchtransfer.reason

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24688: Check the priority of the fulfilled hold when fixing priorities
Aleisha Amohia [Thu, 20 Feb 2020 01:36:32 +0000 (01:36 +0000)]
Bug 24688: Check the priority of the fulfilled hold when fixing priorities

Currently when fixing priorities of existing holds, priorities aren't
fixed when checking out a middle priority hold because the hold has been
fulfilled and deleted. This patch adds a check for, if the hold can't be
found, an old hold with the required reserve_id.

To test:
1. Place at least four holds on a biblio for different borrowers
2. Check out an item to the 3rd priority borrower
3. Check the existing holds table for the biblio. The priorities might be
out of order, or try clicking the dropdowns and there might be an empty
dropdown option, or open the browser developer tools and notice the option
values in the select are missing value=3.
4. Apply patch and restart memcached
5. Check out an item to the 2nd priority borrower
6. Check the existing holds table for the biblio. Confirm the priorities
have been fixed and are now consecutive with no gaps.

Sponsored-by: Chartered Accountants Australia and New Zealand
Signed-off-by: Emmi Takkinen <emmi.takkinen@outlook.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24892: Resolve uninitialized warns from opac-memberentry
Marcel de Rooy [Wed, 18 Mar 2020 13:54:52 +0000 (13:54 +0000)]
Bug 24892: Resolve uninitialized warns from opac-memberentry

Especially line 500 (current master).

Use of uninitialized value $new_data{"sort2"} in string eq at /usr/share/koha/opac/opac-memberentry.pl line 500.
Use of uninitialized value in string eq at /usr/share/koha/opac/opac-memberentry.pl line 500.

Simple fix, not completely trivial due to adding xor ;)

Test plan:
Do not apply, update from opac memberentry. Check warns in log.
Apply patch, update again. Less warns?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24848: Improve manual links for the label creator
Katrin Fischer [Fri, 13 Mar 2020 17:40:38 +0000 (17:40 +0000)]
Bug 24848: Improve manual links for the label creator

Some of the manual links in the label creator tool were
not working correctly or pointing to the wrong pages.

A problem is the label-manage.pl file. This can show
different data depending on an added parameter. Example:
/cgi-bin/koha/labels/label-manage.pl?label_element=template

But it appears that parameters will be ignored when creating
links to the manual. So this patch links to the beginning
of the label creator section in the manual for now.

To test:
- Go to the lable creator
- Try the various pages of the tool
  - Note: All 'New ...' links should point to the
    correct section in the manual (batches, templates, ...)
    Except: Barcode range. This feature is new and not
    yet documented in the manual. Link goes to label creator section.
  - Note: All 'Manage ...' links should point to the
    beginning of the 'label creator' section in the manual

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24553: Use 'barcode' not 'item_id' when removing hold from SIP patron
Nick Clemens [Tue, 25 Feb 2020 14:42:29 +0000 (14:42 +0000)]
Bug 24553: Use 'barcode' not 'item_id' when removing hold from SIP patron

The drop_hold routine was using the wrong parameter for item info in the patron's
array of holds. We store it as 'barcode' not 'item_id'. This is true for both waiting and unavailable
holds

To test:
1 - Apply unit tests patch
2 - prove -v t/db_dependent/SIP/ILS.t
3 - It fails
4 - Apply second patch
5 - prove -v t/db_dependent/SIP/ILS.t
6 - It passes!

You can also see bug 24175 - you cna hack sip_cli_emulator to allow cancelling a hold
and check the messages, test coverage is improved by this patch and should be sufficient
for testing

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24553: Unit tests
Nick Clemens [Tue, 25 Feb 2020 14:42:17 +0000 (14:42 +0000)]
Bug 24553: Unit tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22025: Remove warnings when importing patrons
Jonathan Druart [Mon, 16 Mar 2020 14:43:49 +0000 (15:43 +0100)]
Bug 22025: Remove warnings when importing patrons

The following warning is raised when importing patrons
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018

if one of the following headers is passed but does not have a value:
 * privacy
 * privacy_guarantor_fines
 * privacy_guarantor_checkouts
 * anonymized

Test plan:
- Do not apply the patch
- Generated a csv file with at least one those headers
- Import it using the import_patrons.pl script (or using the GUI)
- Notice the warnings without the patch
- Apply the patch
- Confirm that the warnings do not longer appear

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22025: Add a regression test
Jonathan Druart [Mon, 16 Mar 2020 14:43:38 +0000 (15:43 +0100)]
Bug 22025: Add a regression test

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13775: Set main headings to mandatory in authority frameworks (UNIMARC)
Jonathan Druart [Thu, 12 Dec 2019 09:12:41 +0000 (10:12 +0100)]
Bug 13775: Set main headings to mandatory in authority frameworks (UNIMARC)

Same as previously, for UNNIMARC

For unimarc_complet:
CLASS => 245
CO => 210
CO_UNI_TI => 235
EXP => 232
FAM => 220
GENRE/FORM => 280
NAME_COL => 245
NP => 200
NTEXP => 242
NTWORK => 241
PA => 260
PERS => 223
PUB => 217
SAUTTIT => 240
SNC => 250
SNG => 215
TM => 216
TU => 230
WORK => 231

For unimarc_lecture_pub:
CO => 210
NP => 200
SAUT => 200
SAUTTIT => 240
SCO => 210
SNC => 250
SNG => 215
STU => 230
TU => 230

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13775: Set main headings to mandatory in authority frameworks
Jonathan Druart [Thu, 12 Dec 2019 09:10:23 +0000 (10:10 +0100)]
Bug 13775: Set main headings to mandatory in authority frameworks

For MARC21 we need to set the following tags as mandatory:
  CHRON_TERM => 148
  CORPO_NAME => 110
  GENRE/FORM => 155
  GEOGR_NAME => 151
  MEETI_NAME => 111
  PERSO_NAME => 100
  TOPIC_TERM => 150
  UNIF_TITLE => 130

Note that it also fixes an error on the UI, which was initially reported
on bug 13775.

Test plan:
- Create a fresh install in the language of your choice.
- Confirm that when you create a new authority you cannot save without
entering a value for the main heading

- Edit marc record's field 648 -> chronological term
- Try to add there one by clicking a link on the left side of the field.
From there it opens me to a new window, click "Create a new authority"
Click on the authority creating fields randomly, save.
=> Without this patch an error occurred "Can't call method "subfields"
on an undefined value at authorities/blinddetail-biblio-search.pl line 88."

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 8595: (follow-up) Changing other occurrences of 'host item' to 'host record'
Aleisha Amohia [Tue, 25 Feb 2020 02:02:22 +0000 (02:02 +0000)]
Bug 8595: (follow-up) Changing other occurrences of 'host item' to 'host record'

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 8595: Rename 'host item' to 'host record'
Aleisha Amohia [Thu, 13 Feb 2020 21:23:58 +0000 (21:23 +0000)]
Bug 8595: Rename 'host item' to 'host record'

To test:

1) Enable the syspref EasyAnalyticalRecords
2) Find a biblio record, go to the detail page
3) Click the Edit dropdown and notice the option "Link to host item"
4) Apply patch and refresh page
5) Click the Edit dropdown and confirm the renamed "Link to host record"
button

Sponsored-by: Catalyst IT
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23808: (follow-up) Object methods can be used directly, no need for unblessed
Kyle M Hall [Fri, 20 Mar 2020 12:58:29 +0000 (08:58 -0400)]
Bug 23808: (follow-up) Object methods can be used directly, no need for unblessed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23808: (follow-up) Pre-fill guarantee's contact details from guarantor patron...
Alex Buckley [Tue, 17 Mar 2020 23:59:03 +0000 (23:59 +0000)]
Bug 23808: (follow-up) Pre-fill guarantee's contact details from guarantor patron in memberentry.pl

Pre-fill guarantee contact details (email, phone) from guarantor record
when adding a gurantee to a guarantor's record

Test plan:

1. Apply first two patches and follow test plans
2. On an adult's patron record (which has an primary phone number, secondary
   phone, other phone, primary email, secondary email and fax set) select
   'Add a guarantee' and observe the guarantee's 'Contact' section is not
   pre-filled with that information from the guarantor
3. Apply this patch
4. On the same adult's record select 'Add a guarantee' and observe that the
   'Primary phone', 'Secondary phone', 'Other phone', 'Primary email',
   'Secondary email', 'Fax' have been pre-filled from the guarantor's record
5. Fill out the rest of the memberentry.pl and 'Save' and observe that those
   contact details are successfully saved
6. Repeat step 4 and alter the 'Primary phone' and 'Primary email'
   fields and save and observe that those altered values are saved
7. Run tests and confirm they pass:
   sudo koha-shell <instancename>
   prove xt
   prove t

Sponsored-by: South Taranaki District Council, NZ
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23808: (follow-up) Display card number in 'Guarantor information' in memberentry.pl
Alex Buckley [Tue, 17 Mar 2020 20:43:59 +0000 (20:43 +0000)]
Bug 23808: (follow-up) Display card number in 'Guarantor information' in memberentry.pl

Instead of displaying 'Patron #' and displaying the guarantor's borrowernumber
in 'Guarantor information' we should display 'Patron card number:' with
the cardnumber displayed as that value is more meaningful to librarians.
The hyperlink containing the borrowernumber should stay the same so that
librarians can easily visit the patron record of existing guarantor
patrons.

Test plan:

1. Apply first patch and follow it's test plan
2. On an Adult patrons record select 'Add guarantee'
3. In 'Guarantor information' section of memberentry.pl observe in the
   pre-filled guarantor information there is a line 'Patron #:' with a
   link displaying a borrowernumber (not card number) and when you click
   on the link it takes you to the adult/guarantors patron account
4. Select 'Search to add' and search and add another guarantor
5. Observe in the added guarantor 'Patron #:' is displayed along with the
   borrowernumber (not card number). The borrowernumber displayed in not
   a link.
6. Apply this patch
7. On a adults patron select 'Add guarantee'
8. Observe in 'Guarantor information' section the pre-filled guarantor now
   has 'Patron card number:' displayed (instead of 'Patron #:', and it's
   link now displays the guarantors cardnumber.
   Clicking on the link still takes you to the guarantors patron account
9. Repeat step 4
10. Observe in the added guarantor they also have 'Patron card number:'
    (instead of 'Patron #:'). A cardnumber rather than borrowernumber is
    displayed. The cardnumber is not a link.
11. Confirm tests still pass:
    sudo koha-shell <instancename>
    prove xt
    prove t

Sponsored-by: South Taranaki District Council, NZ
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23808: Pre-fill guarantor fields when adding guarantee to guarantor
Alex Buckley [Tue, 17 Mar 2020 04:50:32 +0000 (04:50 +0000)]
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor

Bug 14570 removed the guarantor pre-fill functionality when selecting
'Add guarantee' to an Adult patron. This is because guarantor
information would now only display if (1) the patron record exists
(which it won't when first adding guarantee to guarantor record) and (2)
if there is already a guarantor added to a guarantee

This patchfix will pre-fill guarantor fields and address fields (so the guarantee
has the same address as the guarantor) if no relationship (existing
guarantor data exists) and a guarantor_id is handed to memberenty.pl in
URL when clicking 'Add guarantee' button on Adults patron record.

Test plan:
1. Add adult patron make sure to fill in their 'Main address' details
2. Select 'Add guarantee'
3. Observe no details of the adult patron are displaying in the
   'Guarantor information' section or 'Main address' sections of memberentry.pl
4. Select 'Search to add', search for your adult patron and choose
  'Select' to add them as guarantor
5. Fill out rest of memberentry.pl and 'Save'
6. Observe adult is showing as the guarantor
7. Apply patch
8. Run tests:
   sudo koha-shell <instancename>
   prove xt
   prove t
9. Confirm tests pass
10. Return to your adult patron
11. Select 'Add guarantee'
12. Observe in 'Guarantor information' and 'Main address' sections of
    memberentry.pl are pre-filled with the 'patron #' (borrowernumber),
    surname, firstname and street number, address, address2 (if you
    filled that in on adults account), city
13. Fill out the rest of memberenty.pl and save and confirm your adult
    patron is showing as the guarantor and the pre-filled address details
    have been saved and are showing
14. Repeat steps 10,11 and 12 and in the 'Guarantor information' select
    'Search to add' and add another adult as guarantor
15. Fill out the rest of memberentry.pl and 'Save' and notice with this
    patch applied you can still add multiple guarantors successfully

Sponsored-by: South Taranaki District Council, NZ
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23411: Do not fall back to 'email' for SMS messages
Nick Clemens [Thu, 1 Aug 2019 14:57:29 +0000 (14:57 +0000)]
Bug 23411: Do not fall back to 'email' for SMS messages

To test:
 1 - Have a patron wiht an sms number, but no email
 2 - Enable sms by setting SMSDriver syspref to Email
 3 - Set Notice triggers to send an overdue via sms and email
 4 - Ensure the selected notice is defined only for 'email'
 5 - Checkout an overdue to the patron above
    You can set a specify a due date in the past
 6 - perl misc/cronjobs/overdue_notices.pl -t
 7 - Check the patron notices tab, they have a print notice and an SMS notice pending
 8 - The SMS notice used the 'email' template
 9 - Apply patch
10 - sudo koha-mysql kohadev
11 - DELETE * FROM message_queue WHERE borrowernumber={borrower as above};
12 - Run the cron again
13 - Patron should have a print notice queued, no sms
14 - Define an SMS notice
15 - delete the message queue
16 - Run again
17 - The patron should have a print and an SMS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24830: Fix parse_prefetch recursion and +count cases
Agustin Moyano [Mon, 9 Mar 2020 15:05:03 +0000 (12:05 -0300)]
Bug 24830: Fix parse_prefetch recursion and +count cases

When a child of a prefetched element wasn't found on element's
prefetch_whitelist, no prefetch element was returned.. including element
it self. Now we return element's name if no child was found.

Also, embeded keys that ended with +count where taken literaly. Now we
search the correct key by stripping _count of embedded element if it was
declared as "is_count"

To test:
1. Apply test patch but not this one
2. prove t/Koha/REST/Plugin/Query.t
CHECK => tests shoul fail
3. Apply this patch
4. prove t/Koha/REST/Plugin/Query.t
SUCCESS => tests pass
5. Sign off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24830: Add tests
Agustin Moyano [Thu, 12 Mar 2020 21:47:40 +0000 (18:47 -0300)]
Bug 24830: Add tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24250: Do not duplicate debarred comment in patron screen message AF field
Jonathan Druart [Tue, 17 Dec 2019 10:31:40 +0000 (11:31 +0100)]
Bug 24250: Do not duplicate debarred comment in patron screen message AF field

Caused by
  commit bddfed75913a2302c19c00b00a6fe86538af6f9f
  Bug 19933: Remove patronflags - tricky ones

Test plan:
1 - Setup SIP in your testing environment
    https://wiki.koha-community.org/wiki/Koha_SIP2_server_setup
2 - Set a patron to have a restriction
3 - Send a patron status request or patron information command via
    the SIP cli emulator (see link above)
4 - Note the comment on the restriction is sent only once

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23900: Add tests
Jonathan Druart [Wed, 26 Feb 2020 11:51:06 +0000 (12:51 +0100)]
Bug 23900: Add tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23900: Teach label maker to concat database fields
Jonathan Druart [Mon, 11 Nov 2019 16:54:56 +0000 (17:54 +0100)]
Bug 23900: Teach label maker to concat database fields

Test plan:
- define a label layout with this field list: "100a 245s","enumchron copynumber"
- find or create a record with values for all of those fields
- generate a label for that record
- the 100a and 245s successfully display on one line
- the enumchron and copynumber are displayed and separated by a space

Try other combinations

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24904: Speed up installer process - 1 query per table
Jonathan Druart [Thu, 19 Mar 2020 10:57:16 +0000 (11:57 +0100)]
Bug 24904: Speed up installer process - 1 query per table

Since bug 13897 we are using YAML file to store the installer data.
We are generating/executing 1 query per row, which is much more slower than before.
We should generate 1 query per table to get back to the previous execution time.

With this patch we are going to generate a single one big SQL query per
table.

Test plan:
1/ Checkout a commit before bug 13897:
git checkout -b before_13897 0706922221dcdf9fa8ed7fcf86245c5622f33a3c
2/ Execute the following commands (several times, to get a median!):
mysql -h db -u koha_kohadev -ppassword -e"DROP DATABASE koha_kohadev";
mysql -h db -u koha_kohadev -ppassword -e"CREATE DATABASE koha_kohadev";
koha-shell -p -c "perl benchmark_installer.pl sql" kohadev;
Note the different times displayed in the output, especially the first 2
installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.yml
installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml
They are the number of seconds took to insert them
3/ checkout master
git checkout -B master origin/master # Will reset your master branch!
4/ Execute the previous commands but without the 'sql' parameter passed
to the benchmark script
mysql -h db -u koha_kohadev -ppassword -e"DROP DATABASE koha_kohadev";
mysql -h db -u koha_kohadev -ppassword -e"CREATE DATABASE koha_kohadev";
koha-shell -p -c "perl benchmark_installer.pl" kohadev;
Note the different times.
5/ Apply this patch and retry 4

Please post the execution times when you signoff on this patch.

Spoiler: total time goes from 21s to 4s.
marc21_framework_DEFAULT.yml from 12s to .5s

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
My numbers, 99.99% confidence

3.906 Â±0.252    SQL files
15.516 Â±0.772   YAML wo/patch
3.324 Â±0.193    YAML w/patch

Very good!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24809: (QA follow-up) Add prefix to prevent disambiguity
Marcel de Rooy [Fri, 20 Mar 2020 10:12:24 +0000 (10:12 +0000)]
Bug 24809: (QA follow-up) Add prefix to prevent disambiguity

This seems not to be needed. Just at the safe side.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24809: Get only timestamp of deleted items attached to existing bibs when check...
Nick Clemens [Thu, 5 Mar 2020 10:59:22 +0000 (10:59 +0000)]
Bug 24809: Get only timestamp of deleted items attached to existing bibs when check if bib deleted

To test:
 1 - Edit/create a file in the koha home dir '/var/lib/koha/{instance}/OAI.yaml' with content like below:
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 the systempreferences below to indicated values:
  OAI-PMH => Enable
  OAI-PMH:ConfFile => /var/lib/koha/{instace}/OAI.yaml
 3 - View a record with items and confirm the items show:
  http://localhost:8080/cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=marcxml&identifier=KOHA-OAI-TEST:4
 4 - Delete the items, then delete the record
 5 - Reload the URL from step 3
 6 - Internal Server Error:
  Empty String at /kohadevbox/koha/Koha/OAI/Server/Record.pm line 58.
    at /usr/share/perl/5.24/Carp.pm line 167
 7 - Apply patch
 8 - restart_all
 9 - Repeat
10 - Reload URL from step 3
11 - Success

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22987: (RM follow-up) Schema Update
Martin Renvoize [Fri, 20 Mar 2020 10:39:42 +0000 (10:39 +0000)]
Bug 22987: (RM follow-up) Schema Update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24870: Translate installer data label
Bernardo Gonzalez Kriegel [Sun, 15 Mar 2020 00:00:24 +0000 (21:00 -0300)]
Bug 24870: Translate installer data label

This patch enable the translation of the
labels 'Mandatory' or 'Optional' present at install time
for groups of installer files.

To test:
1) Try install using de-DE language,
   at step3 verify 'Mandatory' and 'Optional'
   labels for marc21 or other data checklist
   Do not close this window!
2) Apply this patch
3) Update de-DE translation files, reinstall lang files
   cd misc/translator
   ./translate update de-DE
   ./translate install de-DE
4) Reload page at step3, now 'Mandatory' label
is translated to 'Pflichtfeld'
5) Verify strings in translation file
Search for
^msgid \"Mandatory\"
^msgid \"Optional\"
in po/de-DE-staff-prog.po.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24856: Remove itemtypes.imageurl in fr-FR sample data
Jonathan Druart [Thu, 12 Mar 2020 09:01:10 +0000 (10:01 +0100)]
Bug 24856: Remove itemtypes.imageurl in fr-FR sample data

in installer/data/mysql/fr-FR/3-LecturePub/sample_itemtypes.sql and installer/data/mysql/fr-FR/4-Conservation/sample_itemtypes.sql the values of imageurl point to non-existent images.

Test plan:
Insert the 2 sql file and confirm that imageurl is not empty

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24901: Add tests for transferbook
Martin Renvoize [Thu, 19 Mar 2020 08:10:00 +0000 (08:10 +0000)]
Bug 24901: Add tests for transferbook

Test plan:
0/ Read the commit and confirm the new tests make sence
1/ Run the tests and verify they pass
2/ Signoff

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24901: Minor refactor of tests
Martin Renvoize [Wed, 18 Mar 2020 19:25:57 +0000 (19:25 +0000)]
Bug 24901: Minor refactor of tests

Test plan:
0/ Read the change and verify it makes sense

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24566: UpdateItemLocationOnCheckin triggers SIP2 alert flag, even with checked_in...
Kyle M Hall [Mon, 3 Feb 2020 12:56:37 +0000 (07:56 -0500)]
Bug 24566: UpdateItemLocationOnCheckin triggers SIP2 alert flag, even with checked_in_ok enabled

If UpdateItemLocationOnCheckin, it triggers an alert flag but cannot be acted on in the same way as LocalUse and thus should be removed in the same fashion.

Test Plan:
1) Enable UpdateItemLocationOnCheckin and set it up to trigger at
checkin for an item
2) Return that item via SIP2
3) Note the alert flag is set
4) Apply this patch
5) Repeat steps 1 and 2
6) The alert flag should not be set

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kevin Cook <ILS@cedarparktexas.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24818: (RM follow-up) Update account_line date definition
Martin Renvoize [Thu, 19 Mar 2020 13:07:06 +0000 (13:07 +0000)]
Bug 24818: (RM follow-up) Update account_line date definition

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24818: (RM follow-up) Update tests for DATE -> TIMESTAMP change
Martin Renvoize [Thu, 19 Mar 2020 13:05:10 +0000 (13:05 +0000)]
Bug 24818: (RM follow-up) Update tests for DATE -> TIMESTAMP change

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24726: Replace one occurrence in print statement
Jonathan Druart [Wed, 18 Mar 2020 10:20:30 +0000 (11:20 +0100)]
Bug 24726: Replace one occurrence in print statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24726: Update overdue_notices to use inbound_email_address
Martin Renvoize [Tue, 25 Feb 2020 13:20:18 +0000 (13:20 +0000)]
Bug 24726: Update overdue_notices to use inbound_email_address

This patch updates the overdue_notices functionality to use the
inbound_email_address method to obtain the correct email address
for a branch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24723: Update EmailPurchaseSuggestions to use inbound_email_address
Martin Renvoize [Tue, 25 Feb 2020 11:14:12 +0000 (11:14 +0000)]
Bug 24723: Update EmailPurchaseSuggestions to use inbound_email_address

This patch updates the EmailPurchaseSuggestions functionality to
use the inbound_email_address method to obtain the correct email address
for a branch when it is set to BranchEmail

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24721: Update emailLibrarianWhenHoldIsPlaced to use inbound_email_address
Martin Renvoize [Tue, 25 Feb 2020 11:03:58 +0000 (11:03 +0000)]
Bug 24721: Update emailLibrarianWhenHoldIsPlaced to use inbound_email_address

This patch updates the emailLibrarianWhenHoldIsPlaced functionality to
use the inbound_email_address method to obtain the correct email address
for a branch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17674: Handling of special cases
Maryse Simard [Fri, 21 Feb 2020 19:09:17 +0000 (14:09 -0500)]
Bug 17674: Handling of special cases

This patch adds handling for those 2 particular cases:
1. Deleting the expected issue
2. Deleting a serial and it's item, but one item cannot be deleted

To test:

1.1 Create a subscription that creates items
1.2 Receive two issues
1.3 Use the new button to delete the 'Expected' issue
1.4 The issue is correctly deleted, but the new expected issue created
to replace the one which has been deleted don't have a published or
received date and is show in it's own tab.
1.5 Apply patch
1.6 Repeat steps 1.1 through 1.4
    => The new expected issue is created correctly

2.1 Use the same serial as in 1 or repeat step 1.1 and 1.2
2.2 Check out one of the items
2.3 Delete the corresponding serial and check box to delete items
2.4 The serial is deleted, but not the item.
    => No feedback is show to the user
2.5 Apply patch
2.6 Repeat step 2.1 through 2.4
    => As before, the serial is deleted, but not the item
    => This time, an error is shown to inform the user

Signed-off-by: sonia <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17674: Allow UI to delete serials in batch
Pierre-Marc Thibault [Wed, 10 Oct 2018 15:25:59 +0000 (11:25 -0400)]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Test plan :
- Apply patch.
- Create at least four serials with items.
- Notice that new items have a numbering pattern and a date in the enumchron field.
- Use the button Delete selected issues for the following steps.
- Delete a serial and its associated item.
- Confirm the serial and item are gone.
- Delete a serial and not its item.
- Confirm the serial is gone.
- Confirm the item is still there and the date part in the enumchron field is gone.
- Delete the two lasts serials.
- Confirm they are gone.

Sponsored-by: CCSR
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sonia <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22987: DBRev 19.12.00.047
Martin Renvoize [Thu, 19 Mar 2020 09:29:06 +0000 (09:29 +0000)]
Bug 22987: DBRev 19.12.00.047

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22987: Add biblioimages.timestamp
Tomas Cohen Arazi [Mon, 13 Jan 2020 14:41:21 +0000 (11:41 -0300)]
Bug 22987: Add biblioimages.timestamp

This patch adds the timestamp column to the biblioimages table.
To test:
1. Apply this patch
2. Run:
   $ updatedatabase
   $ koha-mysql kohadev
   > SHOW CREATE TABLE biblioimages;
=> SUCCESS: Notice the new column is there with the right settings
3. Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24510: Add missing filter
Jonathan Druart [Mon, 16 Mar 2020 11:16:27 +0000 (12:16 +0100)]
Bug 24510: Add missing filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24510: Code cleaning
Jonathan Druart [Wed, 26 Feb 2020 16:38:53 +0000 (17:38 +0100)]
Bug 24510: Code cleaning

Additional test plan:
Create 3 clubs: abc adf axy
place a hold for on of those club, search for a club 'a'
you will get the focus on the "Clubs" tab

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24510: When Placing a Hold, cursor doesn't focus on Patron Name
Owen Leonard [Wed, 26 Feb 2020 15:53:48 +0000 (15:53 +0000)]
Bug 24510: When Placing a Hold, cursor doesn't focus on Patron Name

This alternate patch tries to implement a fix in a more "correct" way by
tying the cursor focus to the initialization of the jQueryUI tabs. By
configuring both the "create" and "activate" events we can make sure the
correct input field is focused.

I think the only advantage of this patch over the other one is that
tying the focus to the tabs activation makes it a little more obvious
where in the DOM loading sequence the focus is being set.

To test, follow the original patch's test plan:

TEST PLAN:
1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold
   on the left, it does the same thing.
3. Note that the cursor does not go to Patron Name (for whom to place
   the hold for), it goes to the Top Search bar under Checkout.
4. Apply patch and reload the page.
5. The focus should now be correctly set.
6. Toggle between 'Patrons' and 'Club' tabs.
7. Focus should stay set.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24510: Add focus to Patron/club input
Lucas Gass [Fri, 24 Jan 2020 15:34:07 +0000 (15:34 +0000)]
Bug 24510: Add focus to Patron/club input

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24774: Set JSON indentation of 2 spaces in .editorconfig
Lari Taskula [Mon, 2 Mar 2020 09:18:26 +0000 (09:18 +0000)]
Bug 24774: Set JSON indentation of 2 spaces in .editorconfig

To test:
1. Start an editor that supports .editorconfig
2. Open or create a JSON file
3. Observe identation is set to 2 spaces by default

Sponsored-by: Hypernova Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24298: (RM follow-up) Schema Class Update
Martin Renvoize [Thu, 19 Mar 2020 09:21:14 +0000 (09:21 +0000)]
Bug 24298: (RM follow-up) Schema Class Update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24818: DBRev 19.12.00.046
Martin Renvoize [Thu, 19 Mar 2020 09:18:45 +0000 (09:18 +0000)]
Bug 24818: DBRev 19.12.00.046

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24818: Update database accountlines.date to timestamp
Martin Renvoize [Fri, 6 Mar 2020 11:20:51 +0000 (11:20 +0000)]
Bug 24818: Update database accountlines.date to timestamp

This update increases the resolution for the 'date' field, used for
'creation date' in accountlines from a 'date' to a 'timestamp'.

This matches other tables where both a created and updated field are
included.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24384: Add Access-Control-Allow-Origin support to OPAC reports svc
Tomas Cohen Arazi [Thu, 9 Jan 2020 14:45:14 +0000 (11:45 -0300)]
Bug 24384: Add Access-Control-Allow-Origin support to OPAC reports svc

This patch makes the opac/svc/report script use output_with_http_headers
so it sets the Access-Control-Allow-Origin header.

To test:
1. Create a new public report and remember the report id
2. Use your favourite too to fetch the report in JSON by issuing:
   GET http://localhost:8080/cgi-bin/koha/svc/report?id=1
=> FAIL: There is no Access-Control-Allow-Origin header
3. Apply this patch
4. Restart Plack
   $ sudo koha-plack --restart kohadev
5. Set the AccessControlAllowOrigin to anything (for example,
   https://koha-community.org)
6. Repeat 2
=> SUCCESS: On the response headers you find
Access-Control-Allow-Origin: https://koha-community.org
7. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 3137: DBRev 19.12.00.045
Martin Renvoize [Thu, 19 Mar 2020 09:13:42 +0000 (09:13 +0000)]
Bug 3137: DBRev 19.12.00.045

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 3137: Compiled CSS
Martin Renvoize [Thu, 19 Mar 2020 09:11:30 +0000 (09:11 +0000)]
Bug 3137: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 3137: (QA follow-up) Switch hidden for collapsed in text
Katrin Fischer [Fri, 13 Mar 2020 15:35:17 +0000 (15:35 +0000)]
Bug 3137: (QA follow-up) Switch hidden for collapsed in text

Changes the text and tooltip on top of the add/edit patron screen
to use collapsed instead of hidden.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 3137: (follow-up) Rename using 'collapse', remove syspref lettering and fix guara...
Aleisha Amohia [Wed, 11 Mar 2020 04:02:53 +0000 (04:02 +0000)]
Bug 3137: (follow-up) Rename using 'collapse', remove syspref lettering and fix guarantor section collapsing

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 3137: HideFieldsPatronAddForm syspref
Aleisha Amohia [Fri, 7 Feb 2020 02:57:40 +0000 (02:57 +0000)]
Bug 3137: HideFieldsPatronAddForm syspref

This patches adds a syspref - HideFieldsAddPatronFrom - that controls
which fieldsets are hidden by default in the add patron form.

To test:
1) Apply patch and update database
2) Go to System preferences and confirm HideFieldsPatronAddForm has no
fields selected
3) Go to add a patron / edit an existing patron (any patron category).
confirm everything still works as expected.
4) Tick some of the fields in the syspref to hide them in the form
5) Go back to add patron form.
6) Confirm these fields are hidden and listed at the top of the page
7) Toggle the checkbox and confirm the hidden fields show or hide as
expected.
8) Go back to the HideFieldsPatronAddForm system preference and ensure
the Main address option is checked to be hidden
9) Go to the patron's details page
10) Click to edit the Contact Information section
11) Confirm the Main address option shows and the checkbox to show
hidden fields is not present.
12) Confirm you can click the legend of each section to show and hide
sections

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15775: Change wording slightly
Katrin Fischer [Sat, 29 Feb 2020 22:36:46 +0000 (23:36 +0100)]
Bug 15775: Change wording slightly

maxoutstanding only blocks holds, for checkouts we got
noissuechage.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15775: Show message on OPAC summary if holds are blocked due to fines
Aleisha Amohia [Thu, 6 Feb 2020 22:25:06 +0000 (22:25 +0000)]
Bug 15775: Show message on OPAC summary if holds are blocked due to fines

To test:
1) Set maxoutstanding syspref to 5
2) Create a manual invoice for a borrower for $6
3) Log in to the OPAC as this borrower
4) Go to opac-user.pl, your summary page
5) Confirm there is a warning box explaining that the borrower is
blocked from holds due to fines
6) Back on the staff side, pay some or all of the borrower's fines so
they are no longer over the max outstanding amount
7) Refresh the summary page in the OPAC and confirm the warning is gone

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24701: Add column config to course_items_table
Lucas Gass [Fri, 21 Feb 2020 20:54:41 +0000 (20:54 +0000)]
Bug 24701: Add column config to course_items_table

This patch adds course_items_table to the column config tool
TEST PLAN:
1. Have some course reserves
2. Add some items to that course reserve and browse to opac-course-details
2. See all the unconfigurable columns
3. Apply patch
4. Browse to column config > OPAC > opac-course-details
5. Try hiding each column and make sure the correct column is hidden on opac-course-details.pl

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24844: Focus syspref searchbar
Aleisha Amohia [Wed, 11 Mar 2020 03:38:44 +0000 (03:38 +0000)]
Bug 24844: Focus syspref searchbar

To test:
1) Go to Administration
2) Notice neither of the syspref search bars are focussed so you have to
click inside one to begin searching
3) Apply patch and refresh page
4) Notice the header syspref search bar is now focussed so you can begin
typing straight away

Sponsored-by: Catalyst IT
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24847: Select AND by default in items search
Fridolin Somers [Wed, 11 Mar 2020 11:00:21 +0000 (14:00 +0300)]
Bug 24847: Select AND by default in items search

In items search form, when clicking on "New field" a new conjunction and search field are added.
It would save time to select AND conjunction by default, like it is in advanced search.

Test plan:
1) Go to items search
2) Click on  "New field"
3) Check that AND is selected

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24846: DBRev 19.12.00.044
Martin Renvoize [Thu, 19 Mar 2020 08:55:55 +0000 (08:55 +0000)]
Bug 24846: DBRev 19.12.00.044

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>