koha.git
3 years agoBug 12224: DBRev 20.12.00.022
Jonathan Druart [Fri, 5 Mar 2021 12:53:34 +0000 (12:53 +0000)]
Bug 12224: DBRev 20.12.00.022

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12224: (follow-up) Format today with KohaDates
Katrin Fischer [Fri, 5 Mar 2021 11:29:41 +0000 (12:29 +0100)]
Bug 12224: (follow-up) Format today with KohaDates

Updates the slip templates to use [% today | $KohaDates %].
Adding an explicit USE statement is not necessary in this case.

To test:
- When testing the feature according to the test plan, make sure
  that the date for today shows up formatted to the DateFormat
  system preference.

Note: As we are printing today's checkins, I have intentionally left
oft the time. But it could be easily added if a library wanted it.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12224: Some code improvements
Jonathan Druart [Wed, 3 Mar 2021 15:44:52 +0000 (16:44 +0100)]
Bug 12224: Some code improvements

* Use Koha::Patrons->old_checkouts
* perltidy
* Make sure $today_start and $today_end will always be on the same day
(we never know!)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12224: (QA follow-up) Ensure patron language is respected
Martin Renvoize [Wed, 24 Feb 2021 10:21:36 +0000 (10:21 +0000)]
Bug 12224: (QA follow-up) Ensure patron language is respected

Things have moved on a bit since this code was first written, we now
expect a 'lang' parameter passed into GetPrepparedLetter to allow for
translated notices.

Simple fix, so a quick QA follow-up will suffice :)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12224: (follow-up) Loop old_issues with itemnumber
Aleisha Amohia [Sun, 31 Jan 2021 22:11:51 +0000 (11:11 +1300)]
Bug 12224: (follow-up) Loop old_issues with itemnumber

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12224: (follow-up) Switching to TT notice
Aleisha Amohia [Wed, 2 Dec 2020 22:04:23 +0000 (11:04 +1300)]
Bug 12224: (follow-up) Switching to TT notice

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12224: (follow-up) Access old_issues table when editing notice
Aleisha Amohia [Mon, 21 Sep 2020 21:37:34 +0000 (09:37 +1200)]
Bug 12224: (follow-up) Access old_issues table when editing notice

This QA follow-up allows access to the old_issues table when editing the
notice in Tools.

Signed-off-by: Alexandra Speer <alexandra.speer@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12224: (follow-up) Move button to patron column in checkins table
Owen Leonard [Fri, 18 Sep 2020 13:53:29 +0000 (13:53 +0000)]
Bug 12224: (follow-up) Move button to patron column in checkins table

This patch moves the "Print checkin slip" out of its own column and into
the colum containing patron information. I think this makes more sense
because the slip is specific to a patron, not the individual item which
has been checked in.

Also changed: printcheckinslip function should be triggered via a class,
not a non-unique ID. The function should handle the click using
"preventDefault" rather than "return false."

To test, apply the patch and check in some items checked out to various
patrons.

- In the table of checked-in items, confirm that the "Print checkin
  slip" appears correctly in the column of patron information.
- Confirm that the button works correctly to print the correct slip for
  the associated patron.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Alexandra Speer <alexandra.speer@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 12224: Print a slip of borrower's checkins for today
Aleisha Amohia [Thu, 17 Sep 2020 23:58:05 +0000 (11:58 +1200)]
Bug 12224: Print a slip of borrower's checkins for today

To test:

1) Apply patch and run installer
2) Check out two items (or more) to a borrower
3) Check in two items (or more) for this borrower (you should end up on
    circ/returns.pl)
4) Notice the checked-in items table has started building. There should
be a new column with the button 'Print checkin slip' in each row.
5) Click the button and confirm the checkin slip opens for printing in a
new window.
6) Go to the patron's account
7) Click the Print dropdown. Confirm there is a 'Print checkin slip'
option. Click this and confirm the checkin slip opens for printing in a
new window.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Alexandra Speer <alexandra.speer@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27745: prevent warning for uninitialized value as a hash key
Petro Vashchuk [Wed, 3 Mar 2021 09:32:48 +0000 (11:32 +0200)]
Bug 27745: prevent warning for uninitialized value as a hash key

When you edit and save items with an empty "c - Shelving location"
field, it gets stored into the database as "NULL",
which is allowed in the database, and the field is not "required",
so this seems expected.

But when the search page is rendered, it gets value by location key
($shelflocations->{ $item->{location} }) which gives undef warning.

Solved by checking if $item->{location} is perl true.

To reproduce:
    1) Edit the book or create new one with an empty shelving location.
    2) Use the search feature to have that book in the searched list.
    3) Check plack-intranet-error.log to find "Use of uninitialized
value in hash element" error.
    4) Apply the patch.
    5) Repeat the search and check the logs again to ensure that error
didn't appear again.

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27795: Misalignment of TOTAL value in lateorders page
Owen Leonard [Thu, 25 Feb 2021 14:20:14 +0000 (14:20 +0000)]
Bug 27795: Misalignment of TOTAL value in lateorders page

This patch corrects the colspan in the footer of the late orders page.

It also adds a quantity total cell to the footer and changes the
container of the buttons at the bottom of the page from a <p> tag to
the standard <fieldset class="action">.

To test, apply the patch and go to Acquisitions -> Late orders.

In the footer of the late orders page, there should be a total under the
"Quantity" column. The total cost number should be correctly aligned
under the "total cost" header cell.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27752: Correct eslint errors in batchMod.js
Owen Leonard [Mon, 22 Feb 2021 15:44:54 +0000 (15:44 +0000)]
Bug 27752: Correct eslint errors in batchMod.js

This patch makes minor changes to batchMod.js in order to address errors
raised by ESLint. These changes include whitespace changes, so diff
accordingly.

To test, apply the patch and go to Tools -> Batch item modification.

- Submit a batch of barcodes for modification.
- Uncheck some checkboxes to hide columns in the table showing your
  submitted items.
- Return to the batch item modification page and submit your batch
  again.
- The columns you selected should still be hidden.
- Submit a batch of items for deletion.
- The same columns should be hidden here too.

To confirm that ESLint is happy with the changes you could open the file
for editing using an editor with ESLint integration, or install ESLint
on the command line:
https://eslint.org/docs/user-guide/command-line-interface

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27410: (follow-up) Updates to accommodate currency entry
Owen Leonard [Thu, 21 Jan 2021 14:40:52 +0000 (14:40 +0000)]
Bug 27410: (follow-up) Updates to accommodate currency entry

This patch makes two modifications in order to allow the entry of
currency strings (e.g. 1.25).

 - Inputmode changed to "decimal"
 - Regex pattern changed to "^\d+(\.\d{2})?$" as found in
   admin/debit_types.tt

To test, apply the patch and test entry of various strings in the manual
invoice "amount" field. Confirm that the field only accepts digits or
digits followed by a decimal and two digits.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27410: Update intranet-tmpl/prog/en/modules/members/maninvoice.tt to reflect...
Mazen Khallaf [Tue, 19 Jan 2021 09:36:34 +0000 (09:36 +0000)]
Bug 27410: Update intranet-tmpl/prog/en/modules/members/maninvoice.tt to reflect ACC2

Test Plan:
1. Open intranet-tmpl/prog/en/modules/members/maninvoice.tt
2. Search for instances of 'input type="number"'
3. If none are found then patch was successful

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27408: (follow-up) Updates to accommodate currency entry
Owen Leonard [Thu, 21 Jan 2021 14:29:03 +0000 (14:29 +0000)]
Bug 27408: (follow-up) Updates to accommodate currency entry

This patch makes two modifications in order to allow the entry of
currency strings (e.g. 1.25).
- Inputmode changed to "decimal"
- Regex pattern changed to "^\d+(\.\d{2})?$" as found in
  admin/debit_types.tt

To test, apply the patch and test entry of various strings in the manual
credit "amount" field. Confirm that the field only accepts digits or
digits followed by a decimal and two digits.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27408: Update intranet-tmpl/prog/en/modules/members/mancredit.tt for ACC2
Mazen Khallaf [Tue, 19 Jan 2021 09:45:34 +0000 (09:45 +0000)]
Bug 27408: Update intranet-tmpl/prog/en/modules/members/mancredit.tt for ACC2

Test Plan:

1. Open intranet-tmpl/prog/en/modules/members/mancredit.tt
2. Search for instances of 'input type="text"
3. If none are found then patch was successful

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27668: Compiled CSS
Jonathan Druart [Fri, 5 Mar 2021 12:15:51 +0000 (13:15 +0100)]
Bug 27668: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27668: Improve validation of patron entry form in the OPAC
Owen Leonard [Wed, 10 Feb 2021 19:43:25 +0000 (19:43 +0000)]
Bug 27668: Improve validation of patron entry form in the OPAC

This patch improves the way we handle required fields in the patron
entry/update form in the OPAC. Instead of doing multiple checks for each
field using mandatory.defined(), the template now loops over a list of
fields and sets a "required" variable for any which are required.

Then, for each form field, the "required" variable is used to set
classes on labels, input fields, and the "required" text hints. The
class on form fields acts as a hook for the jQuery validator plugin. The
class on the text hints allows us to hide the text hint using CSS,
eliminating the necessity of using a template conditional.

The patch also adds the missing validator-strings include which enables
translation of the jQuery validator plugin's validation error messages.

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

 - Go to Administration -> System preferences and enable
   PatronSelfRegistration.
 - Select multiple fields to be required using the
   PatronSelfRegistrationBorrowerMandatoryField preference.
 - In the OPAC, start the process of registering for an account.
 - The fields you designated as mandatory should each have a "Required"
   label under them.
 - Try to submit the form without entering any data. The required fields
   should now be highlighted in red and have another label, "This field
   is  required."
 - Fill in the required fields and submit the form. It should submit
   correctly.
 - Modify the PatronSelfRegistrationBorrowerMandatoryField preference
   and select all fields as mandatory. Confirm that all fields in the
   patron entry form work correctly.
 - Test that form validation works correctly when modifying a logged-in
   patron's existing account.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27777: (alternate) Improve tables on Point of Sale page for low screen resolutions
Owen Leonard [Wed, 24 Feb 2021 16:58:28 +0000 (16:58 +0000)]
Bug 27777: (alternate) Improve tables on Point of Sale page for low screen resolutions

This alternate solution makes these minor changes:

- The Bootstrap grid classes are adjusted so that the breakpoint
  between the two-column layout and the single-column layout happens at
  a wider browser-width.
- The DataTable configurations are modified to set "autoWidth" to
  "false," which gives us a more fluid behavior.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27776: Remove default sort order of sales table
Martin Renvoize [Wed, 24 Feb 2021 15:53:13 +0000 (15:53 +0000)]
Bug 27776: Remove default sort order of sales table

This patch drops the default sort on table initialisation so that the
table remains sorted in the order in which items are added unless the
user explicitly chooses to apply a sort order.

We also correct a mistake in the targets for disabling sorting on the
'Actions' column and update the hidden 'CODE' column to use the same
syntax as the other definitions for consistency.

Test plan
1/ Enable the point of sale system and set some debit types to allow
sale.
2/ Navigate to the point of sale page and added some items to sell
3/ Update the price for a few lines and note the sort order does not
change.
4/ Update the quantity for a few lines and note the sort order does not
change.
5/ Sort a column using the headers and note it works
6/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27717: Display date of birth even if the patron is under 1
Martin Renvoize [Wed, 17 Feb 2021 12:25:34 +0000 (12:25 +0000)]
Bug 27717: Display date of birth even if the patron is under 1

This patch moves the 'age' condition to below the date of birth display,
allowing the date to display for babies.

Test plan
1/ Add a user with a date of birth within the last year
2/ Check that the date of birth appears on the patron details page
(under contact details) with the patch applied.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25674: Remove default vhost
Jonathan Druart [Mon, 11 Jan 2021 09:04:07 +0000 (10:04 +0100)]
Bug 25674: Remove default vhost

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25674: Add documentation
Tomas Cohen Arazi [Mon, 4 Jan 2021 16:15:08 +0000 (13:15 -0300)]
Bug 25674: Add documentation

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25674: Adapt koha-create
Tomas Cohen Arazi [Mon, 4 Jan 2021 16:14:52 +0000 (13:14 -0300)]
Bug 25674: Adapt koha-create

This patch adds the following option switches to koha-create:

--mb-host
--mb-port
--mb-user
--mb-pass
--mb-vhost

They are used to override the default values on instance creation.

To test:
1. Play with the several option switches and verify that the resulting
   koha-conf.xml contains the expected data.
=> SUCCESS: It works as expected
2. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25674: Add placeholders for RabbitMQ configuration
Tomas Cohen Arazi [Mon, 4 Jan 2021 16:14:34 +0000 (13:14 -0300)]
Bug 25674: Add placeholders for RabbitMQ configuration

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26742: Remove die from connect
Jonathan Druart [Mon, 14 Dec 2020 09:05:02 +0000 (10:05 +0100)]
Bug 26742: Remove die from connect

The change was not advertised and it needs to be done on a separate bug
report (+ test coverage)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26742: Add configuration to koha-conf.xml for message broker
David Cook [Tue, 20 Oct 2020 00:54:46 +0000 (11:54 +1100)]
Bug 26742: Add configuration to koha-conf.xml for message broker

The connection details for the message broker should be configurable.
This patch adds configuration options to koha-conf.xml. If they
are not specified, then default connection details will be used.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: DBRev 20.12.00.021
Jonathan Druart [Thu, 4 Mar 2021 16:26:04 +0000 (16:26 +0000)]
Bug 22824: DBRev 20.12.00.021

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Add warning to the about page
Jonathan Druart [Thu, 11 Feb 2021 12:34:02 +0000 (13:34 +0100)]
Bug 22824: Add warning to the about page

Just in case, add a warning to the about page.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD amended patch: there was a "bad space" between "warnNoActiveCurrency"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Fix encoding of misc/admin/koha-preferences output
Julian Maurice [Fri, 19 Feb 2021 09:48:42 +0000 (10:48 +0100)]
Bug 22824: Fix encoding of misc/admin/koha-preferences output

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Prevent YesNo to be filled with invalid values
Jonathan Druart [Mon, 15 Feb 2021 10:37:58 +0000 (11:37 +0100)]
Bug 22824: Prevent YesNo to be filled with invalid values

This patch prevents koha-preferences to set other values than 1/0 to be
used for YesNo prefs

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Fix koha-preferences dump
Jonathan Druart [Mon, 15 Feb 2021 10:10:00 +0000 (11:10 +0100)]
Bug 22824: Fix koha-preferences dump

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Adjust POD for koha-preferences
Jonathan Druart [Mon, 15 Feb 2021 10:03:24 +0000 (11:03 +0100)]
Bug 22824: Adjust POD for koha-preferences

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Fix ES reindex
Jonathan Druart [Thu, 11 Feb 2021 13:56:57 +0000 (14:56 +0100)]
Bug 22824: Fix ES reindex

koha-elastic --rebuild was failing with
Unable to update mappings for index "koha_kohadev_biblios". Reason was: "Could not convert [marc_data.index] to boolean"

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Adjust tests to match final behaviours
Jonathan Druart [Thu, 11 Feb 2021 13:27:56 +0000 (14:27 +0100)]
Bug 22824: Adjust tests to match final behaviours

Finally we diverge quite a lot with how it worked prior to this patch
set. Reflect the changes in the tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Atomic update
Jonathan Druart [Thu, 11 Feb 2021 11:31:25 +0000 (12:31 +0100)]
Bug 22824: Atomic update

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Fix default values for YesNo
Jonathan Druart [Thu, 11 Feb 2021 11:31:05 +0000 (12:31 +0100)]
Bug 22824: Fix default values for YesNo

select variable, value from systempreferences where type="YesNo" and ( ( value <>'1' and value <>'0' ) or value is null );

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Remove C4::Boolean, true_p, boolean_preference, etc.
Jonathan Druart [Thu, 11 Feb 2021 11:18:31 +0000 (12:18 +0100)]
Bug 22824: Remove C4::Boolean, true_p, boolean_preference, etc.

It seems that we don't really need all this overhead.
YesNo must be a boolean and contain 1 or 0.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Replace wrong auto replacement
Jonathan Druart [Thu, 11 Feb 2021 11:12:36 +0000 (12:12 +0100)]
Bug 22824: Replace wrong auto replacement

This must be "no", it has been caught by the previous sed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Fix yes/no vs 1/0
Jonathan Druart [Thu, 11 Feb 2021 11:12:03 +0000 (12:12 +0100)]
Bug 22824: Fix yes/no vs 1/0

Patch generated with:
 perl -p -i -e 's# no: # 0: #' **/*.pref
 perl -p -i -e 's# yes: # 1: #' **/*.pref

no must be 0 and yes must be 1!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Correct on/off behaviour
Jonathan Druart [Thu, 11 Feb 2021 10:49:54 +0000 (11:49 +0100)]
Bug 22824: Correct on/off behaviour

Here things are starting to be a bit tricky.
IMO we don't want to replicate the ImplicitTyping behaviour from
YAML::Syck but handle correctly the different value.
We have the list of available values in the .pref file, the values in DB
must match them.

We want 1 or 0 in DB.

2 more occurrences:
finesMode => Dealt on bug 27676 ('off' is ok here)
itemBarcodeInputFilter => 'OFF' is correct here

Note that we don't use ~ or true/false in *.pref

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Fix searching.pref
Jonathan Druart [Thu, 11 Feb 2021 10:44:50 +0000 (11:44 +0100)]
Bug 22824: Fix searching.pref

One .pref file make YAML::XS fails.
The correct display must be, before and after this patchset:
 If "Unescape escaped" is selected this will allow writing regular expressions "\/like this\/" while "/this/", "or/this" will be escaped and interpreted as regular strings.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Replace YAML::Syck with YAML::XS
Jonathan Druart [Thu, 11 Feb 2021 09:19:29 +0000 (10:19 +0100)]
Bug 22824: Replace YAML::Syck with YAML::XS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Fixing first error in tests
Jonathan Druart [Thu, 11 Feb 2021 09:10:32 +0000 (10:10 +0100)]
Bug 22824: Fixing first error in tests

There was an encoding issue. The parent bug report have been fixed, see
bug 27673 and patches related to Encode

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Replace YAML::Syck with YAML::XS in tests
Jonathan Druart [Thu, 11 Feb 2021 09:09:48 +0000 (10:09 +0100)]
Bug 22824: Replace YAML::Syck with YAML::XS in tests

In order to understand how things will work after the changes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22824: Add tests
Jonathan Druart [Thu, 11 Feb 2021 09:01:02 +0000 (10:01 +0100)]
Bug 22824: Add tests

Writing some tests to see how things are working currently

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27048: (follow-up) Correction to elapsed printing
Martin Renvoize [Mon, 1 Mar 2021 14:00:39 +0000 (14:00 +0000)]
Bug 27048: (follow-up) Correction to elapsed printing

JD Amended patch: Remove perlcritic error
"$d" is declared but not used at line 839, column 5.  Unused variables clutter code and make it harder to read.  (Severity: 3)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27048: Add basic timekeeping to rebuild_zebra
Martin Renvoize [Wed, 18 Nov 2020 10:36:43 +0000 (10:36 +0000)]
Bug 27048: Add basic timekeeping to rebuild_zebra

This patch adds a start time, end time and elapsed times on the 'records
exported' lines to the verbose output of the rebuild_zebra.pl script.

Test plan
1/ Run rebuild_zebra.pl -a -b -v
2/ Note the new timestamps included on the verbose output
3/ Signoff

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24623: Phase out jquery.cookie.js: Advanced MARC editor
Owen Leonard [Fri, 19 Feb 2021 00:01:26 +0000 (00:01 +0000)]
Bug 24623: Phase out jquery.cookie.js: Advanced MARC editor

This patch changes cookie handling in the MARC editor templates so that
the js-cookie plugin is used instead of jquery.cookie.

To test, apply the patch and go to Cataloging.

 - Search for a title using the cataloging search in the header search
   form.
 - In the search results, choose "Edit record" from the "Actions" menu.
 - By default you should be taken to the "basic" MARC editor.
 - From the "Settings" menu button, choose "Switch to advanced editor."
 - Return to the cataloging home page and perform another search.
 - Now when you choose "Edit record" you should be taken directly to the
   advanced editor.
 - In the advanced editor, choose "Switch to basic editor" from the
   "Settings" menu.
 - The basic editor should now be saved as the default.
 - Test also with "Edit record" links in catalog search results.

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24624: Remove unused jquery.cookie.js plugin
Owen Leonard [Thu, 18 Feb 2021 18:07:02 +0000 (18:07 +0000)]
Bug 24624: Remove unused jquery.cookie.js plugin

This patch removes inclusion of the jquery.cookie.js plugin from the
"Receive orders" page in Acquisitions. It is unused.

To test apply the patch and follow the process for receiving an order in
Acquisitions:

- Acquisitions -> Vendor -> Receive shipments -> Receive a new shipment
- The table of pending orders should display correctly, and there should
  be no JavaScript errors in the browser console.

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26960: Move batch item modification template JavaScript to the footer
Owen Leonard [Fri, 6 Nov 2020 18:55:19 +0000 (18:55 +0000)]
Bug 26960: Move batch item modification template JavaScript to the footer

This patch modifies the batch item modification template so that the
JavaScript is in the footer, conforming with best practices.

The items form can contain <script> tags injected by cataloging plugins.
These are moved from the body of the page into the footer be repeating
the template loop that previously output the script tag.

To test, apply the patch and test the process of submitting items for
batch modification.

After submitting a batch of items, test the "Edit items" form.
Confirm that JavaScript-dependent interactions work correctly:

 - Select2-styled dropdowns
 - RegEx checkboxes
 - Datepicker
 - Plugins like:
   - dateaccessioned.pl on 952d
   - stocknumberam123.pl on 952i
   - callnumber.pl on 952o

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26959: Compiled CSS
Jonathan Druart [Thu, 4 Mar 2021 13:29:48 +0000 (14:29 +0100)]
Bug 26959: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26959: (follow-up) Fix CSS for column selection labels
Owen Leonard [Wed, 3 Mar 2021 17:53:47 +0000 (17:53 +0000)]
Bug 26959: (follow-up) Fix CSS for column selection labels

This patch modifies the staff interface SCSS in order to fix the display
of column selection checkbox labels on the batch item modification page.
Even though the style of the elements defines the "white-space" as
"nowrap," adding whitespace within the element (as was done to correct
indentation) still created problems.

Changing the display property of the elements to "inline-block" corrects
this.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26959: (follow-up) Add markup comments
Owen Leonard [Fri, 6 Nov 2020 18:29:56 +0000 (18:29 +0000)]
Bug 26959: (follow-up) Add markup comments

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

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

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26959: Reindent batch item modification template
Owen Leonard [Fri, 6 Nov 2020 17:16:36 +0000 (17:16 +0000)]
Bug 26959: Reindent batch item modification template

This patch reindents the batch item modification template to make
indentation consistent. Some lines have been split up.

Some markup issues have been corrected: Removed script "type" attribute,
removed obsolete "CDATA" markers, removed obsolete IE-specific
conditional comment.

To test, apply the patch and go to Tools -> Batch item
modification.

- Test the process of submitting a barcode file, and item number file,
  and a list of barcodes.
- Confirm that everything works as expected.

Use your preferred method for checking the differences between files
while ignoring whitespace. I use diff with the  "-w" flag, but I've been
known to leave my car keys in the refrigerator from time to time. The
only changes you see should be split lines.

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25690: (follow-up) Supress warning about unitialized string
Joonas Kylmälä [Thu, 4 Mar 2021 10:33:24 +0000 (12:33 +0200)]
Bug 25690: (follow-up) Supress warning about unitialized string

This fixes the warning:
Use of uninitialized value in string eq at /kohadevbox/koha/C4/Reserves.pm line 860.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25690: (follow-up) Correct grammar in warning messages
Joonas Kylmälä [Fri, 26 Feb 2021 11:33:15 +0000 (13:33 +0200)]
Bug 25690: (follow-up) Correct grammar in warning messages

This makes the meaning of the warnings a bit more clear.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25690: (QA follow-up) PROCESSED -> PROCESSING for consistency
Martin Renvoize [Fri, 19 Feb 2021 12:06:10 +0000 (12:06 +0000)]
Bug 25690: (QA follow-up) PROCESSED -> PROCESSING for consistency

PROCESSED gave the apearance that the item processing had been completed
whereas in reading the code it appears to actually signify that the item
is awaiting/in proessing state.

This patch updates the variable to be PROCESSING consistently throughout
the codebase.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25690: Add SIP2 tests for checking out with holds
Joonas Kylmälä [Thu, 18 Feb 2021 15:37:36 +0000 (17:37 +0200)]
Bug 25690: Add SIP2 tests for checking out with holds

This should cover whether checking out is allowed for all different
hold states:

Attached:
 - Waiting
 - In processing
 - Transfer

Unattached:
 - Reserved

To test:
 1) prove t/db_dependent/SIP/Transaction.t => passes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25690: Make CanBookBeIssued return In Processing state as needing confirmation
Joonas Kylmälä [Wed, 17 Feb 2021 14:20:28 +0000 (16:20 +0200)]
Bug 25690: Make CanBookBeIssued return In Processing state as needing confirmation

This prevents checking out to a patron an item with hold to someone
else in the In Processing state via staff interface.

Also the checkout error message via SIP is now a more clearer one: "Item is
on hold for another patron." Before it was "Item cannot be issued:
$confirmation".

Also the branch transfer and batch checkout pages are adapted to this new
confirmation message as well.

To test:
 1) Create bib level hold to an item for patron A
 2) Check-in that item via SIP2, now the hold state should be "In processing"
 3) Apply patch
 4) Try to checkout the item to patron B via staff interface and
    notice we get now confirmation prompt do we really want to do it
    because it is in processing.

 In order to not have to setup SIP2 server, alternatively steps 1) and
 2) can be done so that you check-in the item in staff interface and
 make it Waiting, and then with SQL change it to "In processing":

 UPDATE reserves SET found = "P" WHERE reserve_id = XXX;
 UPDATE reserves SET waitingdate = NULL WHERE reserve_id = XX
 UPDATE reserves SET expirationdate = NULL WHERE reserve_id = XXX;

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25690: Remove duplicated logic in SIP2 checkouts
Joonas Kylmälä [Wed, 17 Feb 2021 12:17:36 +0000 (14:17 +0200)]
Bug 25690: Remove duplicated logic in SIP2 checkouts

Because AllowItemsOnHoldCheckoutSIP only affects the checkoutability
of non-attached, i.e. RESERVED holds in SIP2 we can therefore use the
common code from CanBookBeIssued and ignore only the RESERVED confirmation
message case in SIP2 checkout code.

This slightly changes the checkout error message given for "In
processing" holds that someone other than the holdee tries to
checkout. Otherwise there is no logic changes. The message that this
changes is "Item is on hold for another patron." vs. now "Item cannot
be issued: $confirmation". It is easier to create follow-up patch to
properly add INPROCESSING confirmation to CanBookBeIssued and then
show correct message based on the CanBookBeIssued return value.

To test:
 1) Apply all patches from bug 25690 to get latest Transaction.t version
 2) prove t/db_dependent/SIP/Transaction.t => passes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25690: SIP2: Don't allow checking out attached hold that is being transferred
Joonas Kylmälä [Wed, 17 Feb 2021 12:28:03 +0000 (14:28 +0200)]
Bug 25690: SIP2: Don't allow checking out attached hold that is being transferred

Items that are attached to a hold and being transferred (found = T) is
final decision and you cannot checkout those to other patrons.

To test (if you have applied all patches from bug 25690):
 1) prove t/db_dependent/SIP/Transaction.t => passes

To test (if you don't have all patches):
 1) Create hold and set pickup library to something else where the
    item is at
 2) Return the item and it should confirm the hold and start transfer
 3) Apply this patch
 4) Try to checkout this item now to some other patron via SIP2 and
    notice it doesn't allow it
 5) Revert this patch
 6) Notice you can now checkout somebody else's hold that is being transferred!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25690: Remove double usage of 'Reserved' return value
Joonas Kylmälä [Wed, 17 Feb 2021 12:04:47 +0000 (14:04 +0200)]
Bug 25690: Remove double usage of 'Reserved' return value

The patch "Bug 19116: Hold not set to waiting after transfer" added a
new meaning to 'Reserved' return value of C4::Reserves::CheckReserves
function. Let's remove double usage and have separate Transferred
return value so we can differentiate between attached and non-attached
holds. This will come useful in future refactorings.

This patch does no changes to the logic except in the
/cgi-bin/koha/circ/branchtransfers.pl and circulation.pl we now give
similarly to waiting state notice about hold being transferred.

To test:
   1) Apply this patch
   2) Create a new item level hold so that pickup library is different
   than where the item is currently. Then return the item so that hold
   is being attached and transferred.
   3) Go to branchtransfers.pl and try to create a new transfer: it
   should prompt you with message "Item is attached to a hold and
   being transferred for XXX" and provide you with option to cancel
   the hold or to ignore the transfer.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26057: (QA follow-up) Fix Biblios, Reserves, Z3950Responder and XSLT tests
Martin Renvoize [Thu, 4 Mar 2021 08:21:29 +0000 (08:21 +0000)]
Bug 26057: (QA follow-up) Fix Biblios, Reserves, Z3950Responder and XSLT tests

With the introduction of datecancellation we now have two fields to
check to varify if a transfer is 'complete' or not.  I forgot to update
these tests at the time to ensure the datecancellation field was not set
when adding the mock transfer.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26363: Remove tmp file during package build (follow-up)
Mason James [Thu, 4 Mar 2021 02:41:12 +0000 (15:41 +1300)]
Bug 26363: Remove tmp file during package build (follow-up)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25846: (follow-up) Show "No cover image available" message
Owen Leonard [Wed, 3 Mar 2021 17:26:39 +0000 (17:26 +0000)]
Bug 25846: (follow-up) Show "No cover image available" message

This patch restores the use of a "No cover image available" message in
staff interface search results when no cover image was found by any
image service.

The patch also corrects markup in the search results template which was
preventing the "Adlibris cover image" text from being correctly hidden.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27473: Remove the redirect after 10sec
Jonathan Druart [Mon, 1 Mar 2021 13:16:34 +0000 (14:16 +0100)]
Bug 27473: Remove the redirect after 10sec

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27473: (follow-up) Remove the redirect message
Owen Leonard [Mon, 1 Mar 2021 13:05:22 +0000 (13:05 +0000)]
Bug 27473: (follow-up) Remove the redirect message

I don't think it's necessary to remove the redirect because I don't
think it does any harm, but why include a message about it? I think we
should treat this step like all the others and provide a button to take
the user to the next page.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27473: (follow-up) Change wording of the button
Katrin Fischer [Sun, 7 Feb 2021 00:06:02 +0000 (00:06 +0000)]
Bug 27473: (follow-up) Change wording of the button

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27473: Improved link text in installer
Eden Bacani [Wed, 20 Jan 2021 02:12:11 +0000 (02:12 +0000)]
Bug 27473: Improved link text in installer

Test Plan
1. run reset_all to run koha installer
2. Check that after importing sample data step that link says 'Continue
to the next stage'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26618: Improve Exception Class Names
Martin Renvoize [Thu, 18 Feb 2021 10:48:41 +0000 (10:48 +0000)]
Bug 26618: Improve Exception Class Names

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26618: (QA follow-up) Fix unit test for TranferCollection change
Martin Renvoize [Mon, 22 Feb 2021 12:15:44 +0000 (12:15 +0000)]
Bug 26618: (QA follow-up) Fix unit test for TranferCollection change

We update TransferCollection to use the settled upon standard for
passing error messages back from a method. This patch updates the
corresponding unit test.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26618: (QA follow-up) Update messages syntax
Martin Renvoize [Thu, 18 Feb 2021 15:25:42 +0000 (15:25 +0000)]
Bug 26618: (QA follow-up) Update messages syntax

As highlighted, we were not using the standard form of message passing
here. This patch updates the template and controller to adopt the more
usual syntax.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26618: Remove use of transferbook in RotatingCollections
Martin Renvoize [Fri, 18 Dec 2020 16:37:29 +0000 (16:37 +0000)]
Bug 26618: Remove use of transferbook in RotatingCollections

This patch replaces the use of C4::Circulation::transferbook in
C4::RotatingCollections with calls to Koha::Item->request_transfer and
adds handling for the various failure cases which that can throw.

We also introduce additional feedback for the end user where it did not
exist before. Now we notify the user if some of the collection could not
be transfers or if transfers were queued rather than set to request
immediately.

Test plan
1/ Set up a rotating collection
2/ Transfer the collection
3/ Confirm the action succeeds
4/ Set up some branch transfer limits that will affect items in your
collection
5/ Transfer the collection
6/ Note that the transfer succeeds but some items are returned as
failures

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: DBRev 20.12.00.020
Jonathan Druart [Wed, 3 Mar 2021 13:44:52 +0000 (13:44 +0000)]
Bug 24446: DBRev 20.12.00.020

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: (QA follow-up) Use 'receive' method in ModReserveAffect
Martin Renvoize [Thu, 18 Feb 2021 14:45:38 +0000 (14:45 +0000)]
Bug 24446: (QA follow-up) Use 'receive' method in ModReserveAffect

ModeReserveAffect was setting all transfers in the queue to received by
looping through a resultset. This patch updates the logic to try and
catch the in_transit transfer and receive just that one instead.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: (QA follow-up) Remove superflous store calls
Martin Renvoize [Thu, 18 Feb 2021 10:54:34 +0000 (10:54 +0000)]
Bug 24446: (QA follow-up) Remove superflous store calls

The original code here called store after setting each field. Instead,
we set all the fields and call store at the end and save ourselves a few
database hits.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: (QA follow-up) SIP test fix for bug 27166
Martin Renvoize [Thu, 18 Feb 2021 08:43:25 +0000 (08:43 +0000)]
Bug 24446: (QA follow-up) SIP test fix for bug 27166

A new test was introduced in bug 27166 since this code was written, this
patch simply updates the test for the additional 'TransferTrigger'
message that is returned by this patchset.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: (QA follow-up) Set TransferTrigger to 'Reserve' for bug 24298
Martin Renvoize [Thu, 18 Feb 2021 08:42:48 +0000 (08:42 +0000)]
Bug 24446: (QA follow-up) Set TransferTrigger to 'Reserve' for bug 24298

The SIP initiated transfer was set to use the 'TransferTrigger' passed
back from AddReturn; However, TransferTrigger is not set for reserves in
AddReturn (It's is set controller side by circ/returns.pl). We thus need
to also hard code the trigger type in the SIP transaction for reserves.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: (QA follow-up) Correction to datecancelled for ModItemTransfer
Martin Renvoize [Fri, 22 Jan 2021 11:11:53 +0000 (11:11 +0000)]
Bug 24446: (QA follow-up) Correction to datecancelled for ModItemTransfer

ModItemTransfer always replaces any existing transfers, including those
in transit.. so we needed to add a 'force' option to
Koha::Item::Transfer->cancel();

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: (QA follow-up) Fix ModItemTransfer tests
Martin Renvoize [Thu, 21 Jan 2021 14:49:48 +0000 (14:49 +0000)]
Bug 24446: (QA follow-up) Fix ModItemTransfer tests

Seems I missed passing trigger in the tests for ModItemTransfer. This
patch corrects that oversight.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
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>
3 years agoBug 24446: (QA follow-up) Update transferbook Test
Martin Renvoize [Thu, 21 Jan 2021 14:43:26 +0000 (14:43 +0000)]
Bug 24446: (QA follow-up) Update transferbook Test

Needed for a rebase, a new test was introduced so we need to add the
trigger option into that test now too.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: (QA follow-up) Update unit test for ModItemTransfer
Martin Renvoize [Mon, 22 Feb 2021 12:50:55 +0000 (12:50 +0000)]
Bug 24446: (QA follow-up) Update unit test for ModItemTransfer

Update unit test to reflect we now use cancellationdate and
cancellation_reason in ModItemTransfer

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Update ModItemTransfer for daterequested/datecancelled
Martin Renvoize [Fri, 18 Dec 2020 16:29:32 +0000 (16:29 +0000)]
Bug 24446: Update ModItemTransfer for daterequested/datecancelled

C4::Items::ModItemTransfer is used throughout the codebase and currently
it will never set the daterequested or datecancelled fields.  With the
modifications to how circulation deals with transfers we need to update
this function to set those fields appropriately. Functionality has been
retained, ModItemTransfer will continue to add a transfer regardless of
limits or current transits existing.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Add datesent/datecancelled handling to GetTransfersFromTo
Martin Renvoize [Wed, 7 Oct 2020 07:21:16 +0000 (08:21 +0100)]
Bug 24446: Add datesent/datecancelled handling to GetTransfersFromTo

With the first uses of Koha::Item->request_transfer and
Koha::Item::Transfer->cancel having been added, we need to update
GetTransferFromTo to respect transfers that have been requested but
not yet sent and not cancelled.

Test plan
1/ Run the included unit test
2/ Confirm the "Transfers to recieve" page loads
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Add datecancelled handling to GetTransfers
Martin Renvoize [Wed, 7 Oct 2020 07:31:56 +0000 (08:31 +0100)]
Bug 24446: Add datecancelled handling to GetTransfers

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance
Martin Renvoize [Tue, 6 Oct 2020 13:13:47 +0000 (14:13 +0100)]
Bug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance

This patch prioritizes the RotatingCollection transfer type over the
StockRotationAdvance transfers allowing us to queue up a our transfer
behind it.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: (follow-up) Handle cases of pre-existing transfers
Martin Renvoize [Fri, 18 Dec 2020 16:36:51 +0000 (16:36 +0000)]
Bug 24446: (follow-up) Handle cases of pre-existing transfers

This is a long standing bug in stockrotation (and transfers in general)
where by if a transfer is in progress and another transfer is requested
then the original transfer is inexplicitly cancelled. This patch updates
the stockrotation code to handle queued transfers, either adding a
StockrotationAdvance transfer to the queue when an in progress transfer
was triggered to fulfil a Reserve, or otherwise cancelling the transfer
as stockrotation should take precidence.

To test
1/ Run t/db_dependent/StockRotationsItems.t.
2/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Update GetTransfers Unit Test
Martin Renvoize [Wed, 7 Oct 2020 13:10:46 +0000 (14:10 +0100)]
Bug 24446: Update GetTransfers Unit Test

We updated the return signature for GetTransfers and as such need to
update the corresponding unit test

Test plan
1/ Run t/db_dependent/Circulation/transfers.t
2/ Confirm it passes
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Update transferbook Unit Test
Martin Renvoize [Thu, 8 Oct 2020 08:02:50 +0000 (09:02 +0100)]
Bug 24446: Update transferbook Unit Test

We updated C4::Circulation::transferbook to return the to_branch branchcode as
the data entity for 'WasTransfered'. This patch updates the corresponding unit
test.

To test:
1/ Run t/db_dependent/Circulation/transferbook.t
2/ Signoff if it passes

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Catch daterequested in circ returns
Martin Renvoize [Fri, 17 Jan 2020 13:58:12 +0000 (13:58 +0000)]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Update StockRotationItem to use daterequested
Martin Renvoize [Tue, 24 Mar 2020 07:46:10 +0000 (07:46 +0000)]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Improve StockRotationItem->advance tests
Martin Renvoize [Fri, 18 Dec 2020 16:36:20 +0000 (16:36 +0000)]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24446: Update branchtransfers.daterequested for stockrotation
Martin Renvoize [Fri, 17 Jan 2020 15:18:24 +0000 (15:18 +0000)]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
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>
3 years agoBug 26057: DBIC schema changes
Jonathan Druart [Wed, 3 Mar 2021 13:50:39 +0000 (14:50 +0100)]
Bug 26057: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26057: DBRev 20.12.00.019
Jonathan Druart [Wed, 3 Mar 2021 13:44:52 +0000 (13:44 +0000)]
Bug 26057: DBRev 20.12.00.019

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26057: (QA follow-up) Fix Indexer tests
Martin Renvoize [Mon, 22 Feb 2021 12:31:50 +0000 (12:31 +0000)]
Bug 26057: (QA follow-up) Fix Indexer tests

The addition of cancellationdate meant that our test objects in the
Indexer tests now longer matched expectations and as such the tests
failed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26057: (QA follow-up) Drop test for 'reason'
Martin Renvoize [Thu, 21 Jan 2021 14:27:44 +0000 (14:27 +0000)]
Bug 26057: (QA follow-up) Drop test for 'reason'

We decided this test was superflous to requirements and as such I've
removed it as requested.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
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>
3 years agoBug 26057: Add 'cancel' method to Koha::Item::Transfer
Martin Renvoize [Fri, 18 Dec 2020 16:36:07 +0000 (16:36 +0000)]
Bug 26057: Add 'cancel' method to Koha::Item::Transfer

This patch adds the 'cancel' method to Koha::Item::Transfer which sets
the transfer as cancelled by updating the datecancelled field. We also
update Koha::Item->get_transfer here to accomodate for the new
resolution available for a transfer.

Test plan:
1/ Run the included unit tests additions (t/db_dependent/Koha/Items.t,
t/db_dependent/Koha/Item/Transfer.t

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26057: Add datecancelled, cancellation_reason fields
Martin Renvoize [Mon, 21 Sep 2020 14:20:12 +0000 (15:20 +0100)]
Bug 26057: Add datecancelled, cancellation_reason fields

This patch adds the datecancelled and cancellation_reason fields to the
branchtransfers table to record when and why transfers have been
cancelled.

To test
1/ Run the database update
2/ Check the database for the 'datecancelled' and 'cancellation_reason'
fields
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>