koha.git
2 years agoBug 24434: Submit on print slip
Martin Renvoize [Mon, 17 May 2021 09:42:04 +0000 (10:42 +0100)]
Bug 24434: Submit on print slip

This patch ensures that the print slip option on the WrongTransfer modal
also submits the form and thus triggers the actual transfer of the item.

We also prevent a double transfer submission (and thus a cancellation
line appearing in the branchtransfers table) for the case where a
transfer back home is triggered.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24434: Unit tests for updateWrongTransfer
Martin Renvoize [Mon, 10 May 2021 09:11:19 +0000 (10:11 +0100)]
Bug 24434: Unit tests for updateWrongTransfer

Add unit tests to cover updateWrongTransfer

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 24434: (QA follow-up) Remove tab character

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24434: Add Unit Tests for relations
Martin Renvoize [Mon, 10 May 2021 08:12:38 +0000 (09:12 +0100)]
Bug 24434: Add Unit Tests for relations

This patch adds unit tests for the newly introduced to_library (and also
add the missing test for the existing from_library).

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24434: Reinstate updateWrongTransfer
Martin Renvoize [Thu, 6 May 2021 12:53:51 +0000 (13:53 +0100)]
Bug 24434: Reinstate updateWrongTransfer

This patch re-instates the call to updateWrongTransfer to ensure the
transfer line is updated to reflect the new frombranch.

Test plan
note: when applying the patches, also update the database

1/ Check an item out from it's home library
2/ Check the item in at another library
   (with AutomaticItemReturn system preferences enabled)
2a/ Accept the transfer and note we now have a transfer present from the
    items check-in library to it's home library
3/ Check the item in at a third library
3a/ Note you are asked to return the item to it's home library.
3b/ With the patch applied, the modal title should highlight that a
    'Wrong transfer' was detected.
4/ Go to the item record and note the holding library has been updated
   to reflect where the item was most recently checked in.
4a/ With the patch applied the item status should reflect the last
    checked in branch as the 'from' branch of the transfer.
5/ check-in from a 4th library, but use the 'Print slip' option for
   accepting the transfer and confirm that also works.
6/ check-in from a 5th library, but use the 'Cancel' option and check
   that this results in the item staying at it's current location and the
   final transfer having been cancelled.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27064: Correct transferbook.t tests to reflect new behaviour of transferbook()
Joonas Kylmälä [Tue, 15 Jun 2021 08:56:43 +0000 (11:56 +0300)]
Bug 27064: Correct transferbook.t tests to reflect new behaviour of transferbook()

The transferbook() behaviour was changed so that it only allows
transferring the item with a reserve if ignore_reserves=1 is passed to
it. The tests are changed here to reflect that. Note that however the
tests were buggy already before this change because the transfer's
"from" and "to" branches were the same and so the transfer should have
failed due to the error DestinationEqualsHolding, but futher though
the transferbook() code was buggy and it override the
DestinationEqualsHolding checking totally if there was a transfer! So
the tests were earlier working due to a bug in transferbook().

To test):
   1) Make sure the new test scenarios make sense
   2) prove t/db_dependent/Circulation/transferbook.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28350: Fix borrowernotes sorting for patron search
Alexis Ripetti [Thu, 13 May 2021 15:09:05 +0000 (11:09 -0400)]
Bug 28350: Fix borrowernotes sorting for patron search

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28338: Default to holding branch to save clicks
Tomas Cohen Arazi [Wed, 12 May 2021 20:02:27 +0000 (17:02 -0300)]
Bug 28338: Default to holding branch to save clicks

This patch makes request.pl pass the holding library object to the
template, if it is a valid pickup location for the item. This way, the
template can set a good default to save clicks.

To test:
1. Have "Hold pickup library match" set to "Item's home library"
2. Have a record with items in three different branches. For example:
   - item1: homebranch: MPL, holdingbranch: MPL
   - item2: homebranch: FPL, holdingbranch: FPL
   - item3: homebranch: CPL, holdingbranch: IPT
3. Have FPL marked as 'No' for pickup location
4. On the record, open the page for placing a hold for a patron
   (acevedo?)
=> SUCCESS: You are presented the regular hold placing page, with an
extra column on the items for pickup location setting
=> SUCCESS: The item2 (on FPL) cannot be selected, there's a clear message
about not having valid pickup locations
=> FAIL: The other ones don't have anything pre-selected on the
dropdowns
5. Apply this patch
6. Repeat 4 (go back to the record, etc)
=> SUCCESS: Nothing changed BUT the item with holding branch = MPL has
it set by default in the dropdown.
=> SUCCESS: IPT is not a valid pickup location for item3, so not set by
default in this case.
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28338: Make item-level holds use locally defined pickup branches
Tomas Cohen Arazi [Wed, 12 May 2021 18:19:29 +0000 (15:19 -0300)]
Bug 28338: Make item-level holds use locally defined pickup branches

Besides the commit subject, this patch does much more:
- It makes request.pl stop passing a pickup location to
  CanItemBeReserved
- It makes the page use the API to render a dropdown for each item, with
  their valid pickup locations
- Items with no valid pickup locations have a nice message about why
  they are disabled for selection

To test:
1. Apply this patch
2. Choose a biblio for placing a hold
3. Choose a patron
=> SUCCESS: You are presented with a new layout, that includes a
dropdown for choosing each item's pickup location. If an item is not
holdable, it still isn't.
4. Try having an item whose home branch is not marked as a pickup
   location
=> SUCCESS: Notice you cannot choose that item
5. CHoose an item, but do not choose a branch, and click 'Place hold'
=> SUCCESS: It shows an alert about the need to choose a pickup location
6. Choose one of the (only possible) pickup locations for the specific
   item
7. Place the item level hold
=> SUCCESS: All goes as expected!
8. Sign off :D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27931: Add GET /items/:item_id/pickup_locations
Tomas Cohen Arazi [Thu, 11 Mar 2021 19:30:52 +0000 (16:30 -0300)]
Bug 27931: Add GET /items/:item_id/pickup_locations

This patch adds the mentioned route. It does so by:
- Adding the new path in paths.json
- Adding the full route spec in items.json
- Adds a controller method that takes care of the task

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass!
3. Play with your favourite REST tool. Pay special care to
   the AllowHoldPolicyOverride syspref and the expected behaviors.
=> SUCCESS: All works as expected
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27931: Unit tests
Tomas Cohen Arazi [Thu, 11 Mar 2021 19:30:18 +0000 (16:30 -0300)]
Bug 27931: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28538: Insert formatted date if valid
Nick Clemens [Wed, 9 Jun 2021 17:59:59 +0000 (17:59 +0000)]
Bug 28538: Insert formatted date if valid

This patch restores the setting of the date from bug 27937 and adds a parsing of the date to
ensure the correct format

To test:
1 - Follow test plan from bug 27937 - it fails
2 - Follow test plan from bug 28351 - it succeeds
3 - Apply patch
4 - Repeat 1-2
5 - both plans pass now

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28487: Fallback to default template in overdue_notices
Jonathan Druart [Fri, 4 Jun 2021 10:19:18 +0000 (12:19 +0200)]
Bug 28487: Fallback to default template in overdue_notices

There is no fallback to the "default" language if there is no
language-specific template for the lang of the patron.

I am not really sure why we are not using GetPreparredLetter here (which
defaults), but this needs to be backported into all stable branches and
so as small as possible.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: DBRev 21.06.00.002
Jonathan Druart [Mon, 14 Jun 2021 14:37:03 +0000 (14:37 +0000)]
Bug 28490: DBRev 21.06.00.002

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: Add DBIx schema changes for testing
Joonas Kylmälä [Mon, 7 Jun 2021 05:30:35 +0000 (05:30 +0000)]
Bug 28490: Add DBIx schema changes for testing

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: Bring back accidentally deleted relationship columns
Joonas Kylmälä [Wed, 2 Jun 2021 17:37:25 +0000 (20:37 +0300)]
Bug 28490: Bring back accidentally deleted relationship columns

These were in active use before and were accidentally deleted in Bug
26995. This restores those deleted relationship columns.

To test:
 1) verify the borrower_modifications, borrowers,
    deletedborrowers contain the column exactly like it was before after
    applying these patches by comparing to the old kohastructure.sql
    version

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: Comment out the relationship data removing DB update step
Joonas Kylmälä [Wed, 2 Jun 2021 17:22:51 +0000 (20:22 +0300)]
Bug 28490: Comment out the relationship data removing DB update step

These columns that were actively used to store non-patron guarantor
relationship info were dropped incorrectly. In a later patch the
relationship fields will be re-added.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
JD Amended patch: Add a "SKIP" note on the DBrev we commented out

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: Revert "Bug 26995: Drop column relationship from borrowers, deletedborrowe...
Joonas Kylmälä [Wed, 2 Jun 2021 17:14:08 +0000 (17:14 +0000)]
Bug 28490: Revert "Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables"

This reverts commit ca0e7541ecdff13ada9ba8ffbd992c963959d30f.

It was part of a patch set that removed actively used data and must be
therefore reverted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: Revert "Bug 26995: Remove references to relationship column"
Joonas Kylmälä [Wed, 2 Jun 2021 17:13:12 +0000 (17:13 +0000)]
Bug 28490: Revert "Bug 26995: Remove references to relationship column"

This reverts commit 1cc8a77c287666ed878ea58f17216793f52ce224.

It was part of a patch set that removed actively used data and must be
therefore reverted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: Revert "Bug 26995: Fix SQL syntax error on the about page"
Joonas Kylmälä [Wed, 2 Jun 2021 17:12:16 +0000 (17:12 +0000)]
Bug 28490: Revert "Bug 26995: Fix SQL syntax error on the about page"

This reverts commit 1131bb687f14fef7b4cb5f3b194711e85f9227af.

It was part of a patch set that removed actively used data and must be
therefore reverted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: Revert "Bug 26995: Remove occurrences in sample_patrons.yml"
Joonas Kylmälä [Wed, 2 Jun 2021 17:11:02 +0000 (17:11 +0000)]
Bug 28490: Revert "Bug 26995: Remove occurrences in sample_patrons.yml"

This reverts commit 690b073478b04c7c801058b49f85275281c502d5.

It was part of a patch set that removed actively used data and must be
therefore reverted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28490: Revert "Bug 26995: Remove one remaining occurrence in moremember"
Joonas Kylmälä [Wed, 2 Jun 2021 17:08:25 +0000 (17:08 +0000)]
Bug 28490: Revert "Bug 26995: Remove one remaining occurrence in moremember"

This reverts commit c3b50e9e97e917090ce09283807168caaad3de4a.

It was part of a patch set that removed actively used data and must be
therefore reverted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28489: DBIC schema changes
Jonathan Druart [Mon, 14 Jun 2021 14:34:15 +0000 (16:34 +0200)]
Bug 28489: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28489: DBRev 21.06.00.001
Jonathan Druart [Mon, 14 Jun 2021 14:34:48 +0000 (14:34 +0000)]
Bug 28489: DBRev 21.06.00.001

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28489: Don't deal with encoding during the serialization
Jonathan Druart [Sat, 5 Jun 2021 13:27:02 +0000 (15:27 +0200)]
Bug 28489: Don't deal with encoding during the serialization

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28489: POD - CGI::Session::Serialize::yamlxs for CGI::Session
Andrew Nugged [Fri, 4 Jun 2021 19:32:22 +0000 (22:32 +0300)]
Bug 28489: POD - CGI::Session::Serialize::yamlxs for CGI::Session

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28489: Add selenium tests
Jonathan Druart [Sat, 5 Jun 2021 12:50:48 +0000 (14:50 +0200)]
Bug 28489: Add selenium tests

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
JD amended patch: Remove libraries the tests created

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28489: Modify sessions.a_session from longtext to longblob (kohastructure.sql)
Julian Maurice [Thu, 3 Jun 2021 09:28:57 +0000 (11:28 +0200)]
Bug 28489: Modify sessions.a_session from longtext to longblob (kohastructure.sql)

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28489: Modify sessions.a_session from longtext to longblob
Julian Maurice [Wed, 2 Jun 2021 14:05:17 +0000 (16:05 +0200)]
Bug 28489: Modify sessions.a_session from longtext to longblob

This column contains serialized data, it should be a blob.
And it fixes encoding issues.

Test plan:
1. Apply patch and run updatedatabase
2. In $KOHA_CONF make sure that you have
   <strict_sql_modes>0</strict_sql_modes>
3. Create 2 libraries:
  a. TESTÄ/Testä
  b. TEST✓/Test✓
4. Go to the staff interface, change your library to Testä, then
   navigate to a few other pages, make sure there is no encoding problem
   with the library name in the top right corner
5. Do the same with Test✓

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28382: Set trigger to 'Reserve' when actioning a reserve transfer
Martin Renvoize [Wed, 19 May 2021 08:37:35 +0000 (09:37 +0100)]
Bug 28382: Set trigger to 'Reserve' when actioning a reserve transfer

This patch sets the transfer trigger to 'Reserve' when the staff user
confirms they are transfering to fulfil a reserve.

Test plan
1 - Place a hold for delivery at Library B
2 - Sign in at Library A
3 - Browse to Circulation->Transfers
4 - Attempt to transfer an item on the title with the hold to Library B
5 - You get a notice that hold was found
6 - You have the option transfer the for the hold - click it
7 - Confirm hold is set to transit and transfer generated
8 - Check the branchtransfers table and confirm the 'reason' is
  'Reserve' not 'Manual'.

Signed-off-by: David Nind <david@davidnind.com>
JK: fix typo resver -> reserve
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27064: (QA follow-up) Add error message only if we have one defined
Joonas Kylmälä [Mon, 7 Jun 2021 14:07:04 +0000 (17:07 +0300)]
Bug 27064: (QA follow-up) Add error message only if we have one defined

This moves the DestinationEqualsHolding error message addition to if
clause so the value is added to %err hash only when there is actually
an error. Then we only append to the @errmsgloop array the error
message if one was defined.

To test:
 1) Create a hold request to a pickup library where the item currently
 is not
 2) Add transfer to the pickup library using branchtransfers.pl and
 notice without this patch we get and empty message box but with this
 patch we don't get it.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27064: (QA follow-up) Pass 'replace' through to Koha::Item::Transfer->cancel
Martin Renvoize [Thu, 6 May 2021 15:31:39 +0000 (16:31 +0100)]
Bug 27064: (QA follow-up) Pass 'replace' through to Koha::Item::Transfer->cancel

The `replace` option found in Koha::Item->request_transfer should be
passed through to Koha::Item::Transfer->cancel and prevent any reverse
transfers from being queued in such cases.

This prevents modItemTransfer from adding superflous reverse transfers
whenever it is used.

Test plan
1/ Run t/db_dependent/Koha/Item.t to prove the new tests pass

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27064: (QA follow-up) Do not create transfer prior to accepting it
Martin Renvoize [Mon, 17 May 2021 14:51:46 +0000 (15:51 +0100)]
Bug 27064: (QA follow-up) Do not create transfer prior to accepting it

This patch prevents the cancellations we were seeing. Transfers were
being created pre-emtively for reserves in branchtransfers before the
librarian had selected their prefered action. As such, we were getting
double lines in the branchtransfers table.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27064: (QA follow-up) Do not send tobranchcd twice
Martin Renvoize [Mon, 10 May 2021 10:06:36 +0000 (11:06 +0100)]
Bug 27064: (QA follow-up) Do not send tobranchcd twice

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27064: Only allow transferring a hold from the transfers page
Nick Clemens [Fri, 20 Nov 2020 11:34:11 +0000 (11:34 +0000)]
Bug 27064: Only allow transferring a hold from the transfers page

These patches replace the 'Waiting' button on the transfers page with a 'Transfer' button
and correct some other related problem by passing the hold object to the template and
using that to fetch patron info as well as passing the reserve_id through to ensure the correct hold is
affected at all times

To test:
 1 - Place a hold for delivery at Library B
 2 - Sign in at Library A
 3 - Browse to Circulation->Transfers
 4 - Attempt to transfer an item on the title with the hold to Library B
 5 - You get a notice that hold was found (missing patron/branch info)
 6 - You have the option to set the hold waiting - click it
 7 - The transfer is generated and marked completed
 8 - The hold is marked as waiting, but the item is still at Library A and no transfer is active
 9 - The patron is notified that the hold is waiting
10 - Revert the hold or cancel and place a new one
11 - Apply patches
12 - Attempt transfer again
13 - You now have the option to transfer the hold
14 - Click that
15 - Hold is in transit and transfer is generated correctly
16 - Transfer again and choose 'cancel'
17 - Confirm hold is cancelled and transfer generated

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28204: Compiled CSS
Jonathan Druart [Fri, 4 Jun 2021 10:09:48 +0000 (12:09 +0200)]
Bug 28204: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28204: Fix table highlighting on the items table
Petro Vashchuk [Thu, 20 May 2021 13:12:18 +0000 (16:12 +0300)]
Bug 28204: Fix table highlighting on the items table

Fix table highlighting at
/cgi-bin/koha/cataloguing/additem.pl?biblionumber=XXXX
Every odd row of the table didn't get highlighted with the yellow color
when you tried to edit it previously, this patch fixes that.
That happened because every odd row had different coloring style that
was overwriting yellow highlight.

How to reproduce:
1) Head over to the
/cgi-bin/koha/cataloguing/additem.pl?biblionumber=XXXX,
where XXXX is id of some bilbio record that has more than one
biblio item.
2) Press the "Action" button of the first (or any other odd numbered)
biblion item, and from the dropdown menu select "edit" option.
3) Notice that it doesn't highlight it with yellow color.
4) Now do the same but with second biblio item (or any even numbered
item).
5) Notice that it highlights it with the yellow color.
6) Apply the patch. Do yarn build to compile css.
7) Make sure that every row of the table that you edit gets properly
highlighted with the yellow color.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD Amended commit title

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28171: Restore comment to remove ambiguity
Jonathan Druart [Thu, 3 Jun 2021 13:38:01 +0000 (15:38 +0200)]
Bug 28171: Restore comment to remove ambiguity

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28171: Restore previous sorting behaviour for Serial enumchron column
Joonas Kylmälä [Wed, 21 Apr 2021 16:19:07 +0000 (19:19 +0300)]
Bug 28171: Restore previous sorting behaviour for Serial enumchron column

Before Bug 27980 the sorting was done either by item's publisheddate
if it existed in at least one item. If it didn't exist then the
sorting was done using "h - Serial Enumeration / chronology"
field. This restores this sorting functionality in catalogue/detail.pl
page.

To test:
 1. Create a serial subscription for a biblio, make sure to enable the
    option "Create an item record when receiving this serial"
 2. Receive two serials, so that they have different received dates
    and check that the items are now created to the biblio
 3. Add now two additional items with one having "A" and other having
    "B" in the "h - Serial Enumeration / chronology" field.
 4. Try sorting and notice the items with publisheddate are being
    sorted and ones without stay in the order they happened to be
 5. Remove the items with publisheddate and notice that now items with
    "A" and "B" get sorted correctly

Signed-off-by: Christian Nelson <christian.nelson@tritonia.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28171: Revert "Bug 27980: Remove itemdata_publisheddate from controller"
Joonas Kylmälä [Wed, 21 Apr 2021 15:34:57 +0000 (15:34 +0000)]
Bug 28171: Revert "Bug 27980: Remove itemdata_publisheddate from controller"

This reverts commit c7fef23763754ad65c5a59438ed370d53aeec4b6.

The code is needed back to fix broken sorting.

Signed-off-by: Christian Nelson <christian.nelson@tritonia.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28353: Display a list of items that cannot be deleted
Jonathan Druart [Tue, 18 May 2021 07:41:40 +0000 (09:41 +0200)]
Bug 28353: Display a list of items that cannot be deleted

We used to display a list of items that cannot be deleted (checked out
or on hold) on the Batch item deletion tool.
With bug 8132 we improve the error handling, but the info is spread in
the table.

This patch adds, at the top of the page, the list of items (barcode)
that cannot be removed.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28496: Club holds pickup locations don't come from the API
Tomas Cohen Arazi [Tue, 1 Jun 2021 16:14:05 +0000 (13:14 -0300)]
Bug 28496: Club holds pickup locations don't come from the API

This patch fixes a issue that is generated by the fact different inputs
were reusing the same id.

To test:
1. Have a club with some enrollments
2. Make sure you have your circ rules to allow any  library be a pickup
   location.
3. Search for a biblio
4. Try placing a club hold
=> FAIL: The dropdown only has the (currently) logged in library.
5. Apply this patch
6. Repeat 3-4
=> SUCCESS: The dropdown has all the options

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28482: Refresh line from DB to get stored value
Nick Clemens [Fri, 28 May 2021 12:02:19 +0000 (12:02 +0000)]
Bug 28482: Refresh line from DB to get stored value

Before checking if the amount is 0 we get the stored value from the DB. This
ensures any amounts beyond the 6 digit precision we store will be removed.

To test:
1 - Add a processing fee of 15 to an itemtype
2 - Add an item of that type, set the replacement fee to 12.63
3 - Set MarkLostItemsAsReturned to 'On payment' only
4 - Set  WhenLostChargeReplacementFee to 'Charge'
5 - Checkout the item to a patron
6 - Mark the item lost
7 - Reload patron and confirm they are charged 27.63
8 - Go to accounting, pay amount, pay 27.63
9 - Item is still lost and not returned
10 - Apply patch
11 - Checkin the item
12 - Checkout to another patron
13 - Mark lost
14 - Patron charged 27.63
15 - Pay amount, 27.63
16 - Item returned!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28482: Unit test
Nick Clemens [Fri, 28 May 2021 12:02:09 +0000 (12:02 +0000)]
Bug 28482: Unit test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoKoha 21.06 - start of a new dev cycle
Jonathan Druart [Wed, 2 Jun 2021 14:44:17 +0000 (16:44 +0200)]
Koha 21.06 - start of a new dev cycle

Run, rabbit run.
Dig that hole, forget the sun,
And when at last the work is done
Don't sit down it's time to dig another one.

---

Breathe
Waters, Gilmour, Wright

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoKoha 21.05.00 is here! v21.05.00
Jonathan Druart [Fri, 28 May 2021 11:36:02 +0000 (13:36 +0200)]
Koha 21.05.00 is here!

2 years agoAdd release notes for Koha 21.05.00
Jonathan Druart [Fri, 28 May 2021 11:34:01 +0000 (13:34 +0200)]
Add release notes for Koha 21.05.00

2 years agoAdd and fix few messages in second plural form for pl, be, ru languages
Andrew Nugged [Fri, 28 May 2021 10:36:45 +0000 (13:36 +0300)]
Add and fix few messages in second plural form for pl, be, ru languages

Fixed missed "singular" message which had word "one" instead of "{count}" for uk and ru because it should be used not only for "1" but also for "21, 31, ...".

Add formula for 2/3 form for Russian (Plural-Forms:...)
and Belarusian and Ukrainian formulas normalized to be the same for all three languages

2 years agoFix translation issues
Jonathan Druart [Fri, 28 May 2021 09:03:58 +0000 (11:03 +0200)]
Fix translation issues

    sudo apt-get install translate-toolkit
    junitmsgfmt misc/translator/po/*.po

2 years agoTranslation updates for Koha 21.05.00
Koha translators [Fri, 28 May 2021 07:18:38 +0000 (04:18 -0300)]
Translation updates for Koha 21.05.00

2 years ago21.05.00 - Update history.txt
Jonathan Druart [Fri, 28 May 2021 06:44:04 +0000 (08:44 +0200)]
21.05.00 - Update history.txt

See previous commit to know how to regenerate this

2 years ago21.05.00 - Update contributors.yaml
Jonathan Druart [Fri, 28 May 2021 06:43:50 +0000 (08:43 +0200)]
21.05.00 - Update contributors.yaml

    git reset --hard origin/master
    git remote add kumara https://git.koha-community.org/koha-community/kumara
    git remote add oldkoha https://git.koha-community.org/koha-community/oldkoha_1_0_7
    git merge --no-edit -s subtree kumara/master --allow-unrelated-histories
    git merge --no-edit -s subtree oldkoha/master --allow-unrelated-histories
    perl $releate_tools_dir/koha-update-contributors
    git commit -a -m"21.05.00 - Update contributors.yaml"
    perl $releate_tools_dir/koha-update-history
    git commit -a -m"21.05.00 - Update history.txt"
    git format-patch HEAD -n2

2 years agoBug 28475: Fix searching all headings
Tomas Cohen Arazi [Thu, 27 May 2021 15:36:32 +0000 (12:36 -0300)]
Bug 28475: Fix searching all headings

This patch fixes the value of a hidden input that was mistakenly
changed and prevents search all headings from working.

To test:
1. Open the authorities section in the OPAC
2. Choose the 'Search all headings' tab
3. Search for 'a'
=> FAIL: No results
4. Empty the search box, and make sure 'Search all headings' is selected
=> SUCCESS: There are authority records
5. Apply this patch
6. Reload the page
7. Retry 3 and 4
=> SUCCESS: Searching is back!
8. Sign off :-D

Sponsored-by: Asociación Latinoamericana de Integración
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28364: Make log4perl.conf belong to the instance user
Tomas Cohen Arazi [Mon, 17 May 2021 13:29:01 +0000 (10:29 -0300)]
Bug 28364: Make log4perl.conf belong to the instance user

This patch makes koha-create generate the log4perl.conf file for the
instance, belonging to the instance user. This is done in order to have
the z3950 responder work.

My original idea was to make the responder accept a '-g' parameter but
that is not supported by Net::Z3950::Responder. Also, as the library
insists on handling the PID file on its own, it wont' work to handle the
responsability to start-stop-daemon. The only solution I found was
making the fiel be owned by the instance user.

1. Create a Koha instance:
   $ koha-create --create-db test
2. Initiate all the things
3. Enable and start the z3950 responder
   $ koha-z3950-responder --enable test
   $ koha-z3950-responder --start test
4. Try doing some search:
   $ yaz-client localhost:2100
=> FAIL: you get:
Connecting...OK.
Sent initrequest.
Target closed connection
Z> quit
See you later, alligator.
=> FAIL: No warning or anything on the logs
5. Stop the daemon
   $ koha-z3950-responder --stop test
6. Run it manually:
   $ PERL5LIB=/usr/share/koha/lib KOHA_CONF=/etc/koha/sites/test/koha-conf.xml \
              /usr/bin/perl /usr/share/koha/bin/z3950_responder.pl \
              -c /etc/koha/sites/test/z3950 -u test-koha \
              -p /var/run/koha/test/z3950-responder.pid -d test-koha-z3950
7. Repeat the 4, on a separate terminal (no daemon mode this time)
=> FAIL: You get:
Cannot open /etc/koha/sites/test/log4perl.conf (Permission denied) at /usr/share/perl5/Log/Log4perl/Config/BaseConfigurator.pm line 51.
8. Change the file owner:
   $ chown test-koha /etc/koha/sites/test/log4perl.conf
9. Repeat 6, and 4
=> SUCCESS: It doesn't break anymore!
10. Apply this patch
11. Create a new instance, with the patched koha-create:
    $ debian/scripts/koha-create --create-db test1
12: Check the generated files permissions:
    $ ls -l /etc/koha/sites/test2
=> SUCCESS: You get:
-rw-r----- 1 root       test2-koha 19720 May 17 13:26 koha-conf.xml
-rw-r----- 1 test2-koha test2-koha  2825 May 17 13:26 log4perl.conf
-rw-r----- 1 root       test2-koha  2014 May 17 13:26 zebra-authorities-dom.cfg
-rw-r----- 1 root       test2-koha  2279 May 17 13:26 zebra-biblios-dom.cfg
-rw-r----- 1 root       test2-koha    26 May 17 13:26 zebra.passwd

13. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28463: Add summary to all routes
Tomas Cohen Arazi [Thu, 27 May 2021 13:07:12 +0000 (10:07 -0300)]
Bug 28463: Add summary to all routes

This patch adds a 'summary' entry to all routes and verbs. This way,
ReDoc will display a human-friendly description of the route, instead of
the operationId.

To test, repeat the testing steps in the previous patch, and notice that
we now have good descriptions.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28463: Add missing tags
Tomas Cohen Arazi [Thu, 27 May 2021 13:06:38 +0000 (10:06 -0300)]
Bug 28463: Add missing tags

This patch adds entries for:

- Rotas
- Circulation rules
- Macros

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28463: Add tags definitions in swagger.yaml
Tomas Cohen Arazi [Wed, 26 May 2021 20:29:42 +0000 (17:29 -0300)]
Bug 28463: Add tags definitions in swagger.yaml

This patch starts the work of curating the spec documentation-related
aspects. It doesn't involve any functional change on the API, just
labels (used to render docs) and some descriptions basis is added.

- A top level 'tags' entry is added to swagger.yaml.
- The 'name' attribute is left with double quotes. This is on purpose,
  to differentiate from 'x-displayName' which is the actual text to be
  displayer and should be handled by documentation folks, not us, devs
  :-D
- I add a very limited 'description' attribute there. It is the top
  level description of the section. For example the description for the
  'Biblios' section is 'Manage bibliographic records'. As it expects
  Markdown, anything we want can be added there.
- Some labels have been tweaked in paths, to rollback the decision of
  making the labels in paths more end-user friendly. We don't want them
  to be typed much, and I picked what we use the most: snake_case.
- The order in which things are displayed, is the one we specified on
  the swagger.yaml file. The 'batch import profiles' one is left at the
  bottom on purpose. But this is subject to discussion. As a general
  rule, I put them all in alphabetical order (on the x-displayName label
  I mean).

I submit early before family duties so others can pick where I left in
the morning. So:

TODO:
- I'm not sure what's best for Advanced editor macros. My bet is we
  should define a 'Macros' label, and use a summary on the routes
  themselves to specify this are not just 'macros', but advanced editor
  macros. Look at the return claims paths to understand how I propose to
  use the 'summary' attribtue.
- I understand how we use 'rotas', but someone more familiar with the
  terminology,... please... step in.
- Related to the first item here, we need to add summary to all routes,
  so ReDoc doesn't display the operationId anymore. Again, I put an
  example in Return claims that we can follow.

To test:
1. Have KTD running
2. Open your browser at:
   http://localhost:/8080/api/v1/
3. Save the page as spec.json in some known dir
4. Go to that dir and run:
   $ docker run -it --rm -p 8083:80 \
       -v $(pwd)/spec.json:/usr/share/nginx/html/swagger.json \
       -e SPEC_URL=swagger.json redocly/redoc
5. Open your browser at
   http://localhost:8083
=> SUCCESS: You see the docs
6. Look at the list of 'categories' on the left
=> FAIL: They look a bit weird
7. Apply this patch
8. Ctrl+c on the terminal running docker
9. Reload plack
10. Repeat 2 through 6
=> SUCCESS: Wow, things look better!
11. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoUpdate kohastructure.sql for 21.05.00
Jonathan Druart [Thu, 27 May 2021 10:07:17 +0000 (12:07 +0200)]
Update kohastructure.sql for 21.05.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 26734: Rename activethemes with availablethemes
Jonathan Druart [Thu, 27 May 2021 12:25:11 +0000 (14:25 +0200)]
Bug 26734: Rename activethemes with availablethemes

There was an existing call to $self->activethemes that behave as setter:
   85     $self->activethemes($activethemes);

I am not sure what are the side-effects but it does not look good.

It caused warning in the logs:

Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 279.
Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 280.
Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 282.
Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296.
Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296.
Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27899: Missing description for libraryNotPickupLocation on request.pl
Owen Leonard [Mon, 15 Mar 2021 14:07:26 +0000 (14:07 +0000)]
Bug 27899: Missing description for libraryNotPickupLocation on request.pl

This patch adds text to the holds template in the staff client so that
if a particular item is at a library which isn't a hold location the
error message is descriptive.

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

 - Change one of your libraries so that "Pickup location" is set to
   "No."
 - Locate a title in the catalog which has an item at that location.
 - The "pick up at" list will exclude the library so and additional steps
     must be taken to get the message
 - Select a patron and set their library to the one we can't pick up at.
 - Start the process of placing a hold on the title.
 - After selecting the patron to place the hold for, look at the table of
   items under "Place a hold on a specific item."
 - The item located at the library you modified should show an error
   message in the "Hold" column, "Library is not a pickup location."

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Sort authors by lastname || firstname
Jonathan Druart [Thu, 27 May 2021 12:38:44 +0000 (14:38 +0200)]
Bug 28386: Sort authors by lastname || firstname

If several authors have the same lastname, they are swapped in the list between the different runs.

This is reusing the code from the release_tools, see issue #24

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Remove _others_ from the contributor list
Jonathan Druart [Thu, 27 May 2021 12:36:48 +0000 (14:36 +0200)]
Bug 28386: Remove _others_ from the contributor list

We arbitrarily use "_others_" for unknown contributors (biblibre,
bywater, ptfs-e teams, etc)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28442: Sort by lastname for array type roles
Martin Renvoize [Tue, 25 May 2021 14:55:52 +0000 (15:55 +0100)]
Bug 28442: Sort by lastname for array type roles

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28442: Fix 'accessibility_advocate' for current release
Martin Renvoize [Tue, 25 May 2021 12:59:31 +0000 (13:59 +0100)]
Bug 28442: Fix 'accessibility_advocate' for current release

The accessibility_advocate block was positioned incorrectly so wasn't
appearing properly for the current stable releases, only the
development/maintainter block.

This patch fixes that issue

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28442: Update template for new roles
Martin Renvoize [Tue, 25 May 2021 08:29:48 +0000 (09:29 +0100)]
Bug 28442: Update template for new roles

We have multiple accessibility advocates this cycle, so we needed to
adapt the template. I've also added the meeting facilitator as a case
but not added to the team block as a whole.. seeking opinions, perhaps
wait and see if it lasts more than a cycle before adding it fully?

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28442: Add 21.11 release team to teams.yaml
Martin Renvoize [Tue, 25 May 2021 08:29:23 +0000 (09:29 +0100)]
Bug 28442: Add 21.11 release team to teams.yaml

Add the 21.11 release team.

Test plan
1/ Check against https://wiki.koha-community.org/wiki/Release_Teams

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28368: Add fallback language for anonymous payment receipts
Martin Renvoize [Tue, 18 May 2021 14:57:29 +0000 (15:57 +0100)]
Bug 28368: Add fallback language for anonymous payment receipts

This adds a fallback for when a payment is made anonymously to allow
printing a receipt in the staff members current session language.

Test plan
1. Set `EnablePointOfSale` and `UseCashRegisters`
2. Add new cash register`
3. New debit type that 'can be sold'
4. Make a sale (via Point of Sale) using the above debit type.
5. Attempt to 'print receipt' from the subsequent prompt
6. Not the ISE: Can't call method "lang"
7. Apply patch
8. Attempt to 'print receipt' again, this time it should work.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28158: Allow batchMod to run under plack
Jonathan Druart [Tue, 25 May 2021 11:55:39 +0000 (13:55 +0200)]
Bug 28158: Allow batchMod to run under plack

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28158: Remove additional backgroundjob related code
Jonathan Druart [Tue, 25 May 2021 07:20:45 +0000 (09:20 +0200)]
Bug 28158: Remove additional backgroundjob related code

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28158: Remove backgroundjob from batchMod
Jonathan Druart [Mon, 24 May 2021 14:53:48 +0000 (16:53 +0200)]
Bug 28158: Remove backgroundjob from batchMod

== Test plan ==
1 - In the default framework make sure the 952$1 is visible in opac & catalog & editor
2 - Set WhenLostChargeReplacementFee to charge
3 - Set MarkLostitemsAsReturned to return from batch modification
4 - Find/edit an item with a replacement cost
5 - Check out the item to a patron
6 - Batch modify the item
7 - Set the lost status
8 - Item is not returned or charged
9 - with the patch, it is

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28419: Remove suspicious occurrence in opac-shelves.tt
Jonathan Druart [Tue, 25 May 2021 12:46:05 +0000 (14:46 +0200)]
Bug 28419: Remove suspicious occurrence in opac-shelves.tt

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28419: Fix addorderiso2709.tt translatability
Jonathan Druart [Tue, 25 May 2021 12:38:27 +0000 (14:38 +0200)]
Bug 28419: Fix addorderiso2709.tt translatability

It seems that the html tag within the TT comment breaks the translate
script

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28461: Fix orders, biblios, holds
Jonathan Druart [Wed, 26 May 2021 13:02:51 +0000 (15:02 +0200)]
Bug 28461: Fix orders, biblios, holds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28461: Fix SMTP servers and extended attributes
Tomas Cohen Arazi [Wed, 26 May 2021 12:48:06 +0000 (09:48 -0300)]
Bug 28461: Fix SMTP servers and extended attributes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28461: Specify only one tag per route
Jonathan Druart [Wed, 26 May 2021 12:30:00 +0000 (14:30 +0200)]
Bug 28461: Specify only one tag per route

Or the route will be misplaced when generated by redoc

git grep tags api|grep '",'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Disambiguate Tomas and Blou
Jonathan Druart [Wed, 26 May 2021 10:30:50 +0000 (12:30 +0200)]
Bug 28386: Disambiguate Tomas and Blou

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 15720: Add connexion user and password options to connexion daemon
Nick Clemens [Thu, 17 Sep 2020 18:34:21 +0000 (18:34 +0000)]
Bug 15720: Add connexion user and password options to connexion daemon

Currently the connexion daemon does not utilize the user and password passed in the requests, it expects a
user and password to be defined in the config file and for that user to be a valid Koha user with
cataloging permissions.

With that user in place all requests to the daemon are authorized.

As the connections are over TCP we allow defining a new connexion user and password to protect Koha account information.

If not defined current behaviour is preserved. Connexion user and password must both be set it either is set.

Sample config file:
host:
port: 8888
koha:http://localhost:8081
log:/var/log/koha/kohadev/connexion.log
match:ISBN
user:kohauser
password:kohapass
overlay_action:replace
nomatch_action:create_new
item_action:always_add
import_mode:redirect
debug:1

To test:
 1 - Create connexion file and save on the Koha serve
 2 - perl misc/bin/connexion_import_daemon.pl -c /kohadevbox/koha/connexion.cnf
 3 - Ensure the user specified above (connexuser) exists and has edit catalogue permissions
 4 - In another terminal make a request to the server:
        echo -en 'U6turtleA9connexionP5shell00024    a62clear00024   4500' | nc -v localhost 8888
 5 - The request should succeed and record added to batch (probably the import fails, but not important)
 6 - Add to config file
        connexion_user:conuser
 7 - Stop and restart the daemon - it should fail on missing connexion_password
 8 - Comment out connexion_user and add
        connexion_password:conpass
 9 - Stop and restart daemon, it fails on missing connexion_user
10 - Uncomment the user and restart
11 - Make another request
        echo -en 'U6turtleA9connexionP5shell00024    a62clear00024   4500' | nc -v localhost 8888
12 - It fails 'Unauthorized request'
13 - Make another request
        echo -en 'U7conuserA9connexionP7conpass00024    a62clear00024   4500' | nc -v localhost 8888
14 - It succeeds!

Signed-off-by: Allison Blanning <ablanning@hotchkiss.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27942: Prevent XSS vulnerabilities in quote-upload
Jonathan Druart [Wed, 17 Mar 2021 10:38:47 +0000 (11:38 +0100)]
Bug 27942: Prevent XSS vulnerabilities in quote-upload

When uploading new quotes the JS variables are not escaped correctly.

Test plan:
Create a new file with the following content (remove the first and last lines containing """):
"""
":this is a source","this is a text"
"this is another ❤one","and another text❤"
"this <script>alert('foo');</script>","and <script>alert('❤');</script>"
"""

Go to Home › Tools › Quote editor
Click Import quote
Select the file
Edit the third line, hit enter
Import quotes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20982: Sanitize category to prevent XSS on opac-shelves.pl
Jonathan Druart [Thu, 20 May 2021 06:34:48 +0000 (08:34 +0200)]
Bug 20982: Sanitize category to prevent XSS on opac-shelves.pl

== Test plan ==
1. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?category=function(){window.location.href%20=%20%27https://git.koha-community.org/stats/koha-master/authors.html%27}()
2. Note that you are redirected to another website
3. Apply the patch & restart services
4. Repeat the above and you are not redirected

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Add more disambiguations to .mailmap
Jonathan Druart [Tue, 25 May 2021 14:16:11 +0000 (16:16 +0200)]
Bug 28386: Add more disambiguations to .mailmap

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28385: Use ldapserver only if exists
Jonathan Druart [Tue, 25 May 2021 08:34:49 +0000 (10:34 +0200)]
Bug 28385: Use ldapserver only if exists

Fix test
t/db_dependent/Auth_with_ldap.t .. 1/4
 #   Failed test 'use C4::Auth_with_ldap;'
 #   at t/db_dependent/Auth_with_ldap.t line 123.
 #     Tried to use 'C4::Auth_with_ldap'.
 #     Error:  No ldapserver "id="ldapserver"" defined in KOHA_CONF: /etc/koha/sites/kohadev/koha-conf.xml at /kohadevbox/koha/C4/Auth_with_ldap.pm line 55.
 # Compilation failed in require at t/db_dependent/Auth_with_ldap.t line 123.
 # BEGIN failed--compilation aborted at t/db_dependent/Auth_with_ldap.t line 123.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28385: Add tests
Jonathan Druart [Fri, 21 May 2021 06:24:51 +0000 (08:24 +0200)]
Bug 28385: Add tests

This does not test bug 28385 directly but 28278 instead.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28385: ldap server configuration broken since migration from XML::Simple
Dobrica Pavlinusic [Wed, 19 May 2021 10:24:53 +0000 (12:24 +0200)]
Bug 28385: ldap server configuration broken since migration from XML::Simple

Bug 28278 removed usage of XML::Simple which had side-affect that
C4::Context->config("ldapserver") returns one more level of hash
based on id of element, so ldap configuration was no longer
available generating error in log:

No ldapserver "hostname" defined in KOHA_CONF: /etc/koha/sites/srvgit/koha-conf.xml

which is very confusing since hostname is there, but we are looking
at wrong place for it.

== Test plan ==
1. Setup an LDAP server with users or use a public one
     See https://wiki.koha-community.org/wiki/Ldap_testing
2. Configure Koha to use it, see example config above
3. Go to OPAC
4. Koha doesn't compile due to LDAP config not parsed correctly
5. Apply the patch
6. Koha compiles and page loads
7. Log in successfully with one of the LDAP users
8. Bonus: Try to log-in with a wrong username & a good password and
     vice-versa

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28414: Fix labels for return claims
Tomas Cohen Arazi [Fri, 21 May 2021 12:55:25 +0000 (09:55 -0300)]
Bug 28414: Fix labels for return claims

The way labels are used with RedDoc, we need to tidy them better. We
should do it with all the routes, but this one is specially noisy on the
UI.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Add the 3 unknown authors back into the contributors list with a note
Jonathan Druart [Tue, 25 May 2021 07:13:40 +0000 (09:13 +0200)]
Bug 28386: Add the 3 unknown authors back into the contributors list with a note

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Update history using script
Jonathan Druart [Mon, 24 May 2021 13:51:42 +0000 (15:51 +0200)]
Bug 28386: Update history using script

This is an example of what will be regenerated.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Update contributors using script
Jonathan Druart [Mon, 24 May 2021 13:50:57 +0000 (15:50 +0200)]
Bug 28386: Update contributors using script

This is an example of what will be regenerated.
It will need to be regenerated once it will be pushed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Fix Pawel history notes
Jonathan Druart [Mon, 24 May 2021 13:32:06 +0000 (15:32 +0200)]
Bug 28386: Fix Pawel history notes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: fisheye is certainly Olwen
Jonathan Druart [Mon, 24 May 2021 13:08:55 +0000 (15:08 +0200)]
Bug 28386: fisheye is certainly Olwen

After a chat with Chris it seems that fisheye was Olwen.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Add sponsors to .mailmap
Jonathan Druart [Wed, 19 May 2021 13:48:11 +0000 (15:48 +0200)]
Bug 28386: Add sponsors to .mailmap

They were in dev_map.yaml, we are cheating with the <sponsor> email but
it seems to work fine in my tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Disambiguate Séverine (to squash)
Jonathan Druart [Wed, 19 May 2021 13:35:41 +0000 (15:35 +0200)]
Bug 28386: Disambiguate Séverine (to squash)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Add history_notes
Jonathan Druart [Wed, 19 May 2021 09:10:25 +0000 (11:10 +0200)]
Bug 28386: Add history_notes

The "developer" lines of history.txt will be regenerated using the git
history so we need to add this as a separate info.
See the release_tools changes for more info

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Update Hector
Jonathan Druart [Wed, 19 May 2021 06:54:04 +0000 (08:54 +0200)]
Bug 28386: Update Hector

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Meenakshi.R vs Meenakshi R
Jonathan Druart [Wed, 19 May 2021 06:47:46 +0000 (08:47 +0200)]
Bug 28386: Meenakshi.R vs Meenakshi R

Needs to match .mailmap

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Update Kyle
Jonathan Druart [Wed, 19 May 2021 06:40:21 +0000 (08:40 +0200)]
Bug 28386: Update Kyle

Need to match .mailmap

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Update Nicole
Jonathan Druart [Wed, 19 May 2021 06:32:50 +0000 (08:32 +0200)]
Bug 28386: Update Nicole

Need to match .mailmap

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Remove unknown authors
Jonathan Druart [Wed, 19 May 2021 06:09:45 +0000 (08:09 +0200)]
Bug 28386: Remove unknown authors

Those 3 authors are not in the git history, we should remove them from
the author list.
However we could re-add them to the contributor list with a note saying
for instance they were part of the Catalyst Academy (need to double
check that first)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Some manual removals from contributors.yaml
Jonathan Druart [Wed, 19 May 2021 05:47:30 +0000 (07:47 +0200)]
Bug 28386: Some manual removals from contributors.yaml

Those are not real authors and should be removed from the
contributors.yaml file

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28386: Adjust .mailmap
Jonathan Druart [Tue, 18 May 2021 13:48:48 +0000 (15:48 +0200)]
Bug 28386: Adjust .mailmap

Again, we need to adjust our .mailmap
This time the goal is the use it in place of the dev_map.yaml we have in
the release tools.

This will be generated for the release notes, history.txt and
contributors.yaml file

This can be tested using:
  git check-mailmap "author <email>"

For instance:
  git check-mailmap "Wrong name <jonathan.druart@bugs.koha-community.org>"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28369: (QA follow-up) Restore PUT with deprecation message
Tomas Cohen Arazi [Tue, 18 May 2021 15:39:39 +0000 (12:39 -0300)]
Bug 28369: (QA follow-up) Restore PUT with deprecation message

This patch restores the PUT route, but adding a deprecation message. The
controller method is the same, and relevant patch tests are duplicated
but calling PUT, so it still gets tested.

To test:
1. Apply this patch
2. Reload plack
3. Open https://<>/api/v1/.html and find the PUT /holds/{hold_id} route
=> SUCCESS: There's a deprecation wargning!
4. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28369: Set additionalProperties: false and fix things
Tomas Cohen Arazi [Tue, 18 May 2021 12:06:45 +0000 (09:06 -0300)]
Bug 28369: Set additionalProperties: false and fix things

This patch performs a cleanup on the holds routes:
- It adds additionalProperties: false to all missing routes
- It syncs the spec with the guidelines
- additionalProperties: false highlighted some attributes read in the
  controlled weren't declared on the spec, adding them
- PUT /holds/:hold_id is moved to PATCH, as it makes more sense and
  gathered opinions lean towards that

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Lots of things are wrong with the API
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>