]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 27600: Remove password check from `cancel_hold`
Martin Renvoize [Mon, 10 May 2021 15:09:17 +0000 (16:09 +0100)]
Bug 27600: Remove password check from `cancel_hold`

As suggested in the bugzilla comments, the cancel_hold method also
doesn't require the password checking code.

Test plan
1/ Run t/db_dependent/SIP/ILS.t and watch it pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27600: Remove password check from SIP2 `renew_all`
Martin Renvoize [Wed, 3 Feb 2021 10:03:31 +0000 (10:03 +0000)]
Bug 27600: Remove password check from SIP2 `renew_all`

This patch removes the password check code from the renew_all method for
SIP2. This is required, as many units send an empty AD field in the SIP
message which can cause the transaction to fail.. but the authentication
should have already taken place earlier in the session.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27600: Add unit test
Martin Renvoize [Wed, 3 Feb 2021 10:16:30 +0000 (10:16 +0000)]
Bug 27600: Add unit test

This patch adds a basic unit test to catch the case where patron_pwd is
sent to renew_all as an empty string.

Test plan
1/ Run t/db_dependent/SIP/ILS.t and watch it fail
2/ Apply second patch
3/ Re-run the above test and watch it pass.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28264: (QA follow-up) Impliment fix for debit_type_code
Martin Renvoize [Tue, 11 May 2021 08:39:42 +0000 (09:39 +0100)]
Bug 28264: (QA follow-up) Impliment fix for debit_type_code

The fix for the debit_type line was also missing.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28264: Transaction type is empty is cash register statistics wizard report
Ivan Dziuba [Thu, 6 May 2021 19:33:02 +0000 (15:33 -0400)]
Bug 28264: Transaction type is empty is cash register statistics wizard report

To test:
1) Go into a patron file and add some manual fees and pay them
2) Go to Reports > Statistics wizards > Cash register
3) In the form, choose Transaction type: All transactions
4) Click "Submit"
5) Note that the Transaction type column is empty
6) In the form, choose Output: To a file
7) Click "Submit"
8) Open the file in a spreadsheet software (I use LibreOffice)
9) The Transaction type column IS NOT empty

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27348: Fix test on ALTERNATE_INDEXER_DAEMON in koha-indexer
Jonathan Druart [Thu, 7 Jan 2021 09:55:35 +0000 (10:55 +0100)]
Bug 27348: Fix test on ALTERNATE_INDEXER_DAEMON in koha-indexer

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27348: Fix test on INDEXER_PARAMS in koha-indexer
David Cook [Thu, 7 Jan 2021 00:22:03 +0000 (00:22 +0000)]
Bug 27348: Fix test on INDEXER_PARAMS in koha-indexer

koha-indexer doesn't test INDEXER_PARAMS correctly which causes errors
to display when stopping/starting the daemon.

This patch fixes the test so that the variable is tested as a string,
so that no errors are created and the params are passed correctly.

Test plan:
0. Apply patch
1. vi /etc/default/koha-common
2. Add the following to the bottom of the file:
INDEXER_PARAMS="-daemon -sleep 6"
3. cp debian/scripts/koha-indexer /usr/sbin/koha-indexer
4. koha-indexer --stop kohadev
5. Note no errors
6. koha-indexer --start kohadev
7. Note no errors
8. ps -efww | grep "indexer"
9. Note that rebuild_zebra.pl has the arguments "-daemon -sleep 6"

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28443: Terminology: Issuing should be Checking out
Owen Leonard [Mon, 7 Jun 2021 16:36:20 +0000 (16:36 +0000)]
Bug 28443: Terminology: Issuing should be Checking out

This patch modifies the title element of the batch checkout page so that
it uses the phrase "Batch check out" instead of "Issuing."

To test, apply the patch and enable BatchCheckouts system preference.

- Open a patron for checkout who has a category included in the
  BatchCheckoutsValidCategories system preference.
- Click the "Batch check out" tab and confirm that the page's title is
  correct.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28428: Capitalization: Password Updated
Owen Leonard [Mon, 24 May 2021 10:58:00 +0000 (10:58 +0000)]
Bug 28428: Capitalization: Password Updated

This patch corrects the case of two headings on the "Change password"
page in the staff interface.

As far as I can tell these strings are never seen because the page
redirects to the patron detail page instead of redisplaying after a new
password or username is submitted.

A visual inspection of the patch may be the only test.

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 28476: Update info in docs/teams.yaml file
Mason James [Sun, 6 Dec 2020 05:33:58 +0000 (18:33 +1300)]
Bug 28476: Update info in docs/teams.yaml file

to test...
 1/ apply patch
 2/ view 'about' page to confirm info is updated

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Looks good.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 28476: Update info in docs/teams.yaml file (2)

oops, correct info

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28280: itemtype page, add price formatting
Didier Gautheron [Tue, 4 May 2021 07:15:52 +0000 (09:15 +0200)]
Bug 28280: itemtype page, add price formatting

To Test:
1- create an item type with a 'Default replacement cost' and a
'Processing fee (when lost)'
2- numbers are displayed with 6 decimals.
4- apply patch
5- numbers are displayed with 2 decimals.

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: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28522: Correct eslint errors in staff-global.js
Owen Leonard [Mon, 7 Jun 2021 12:26:02 +0000 (12:26 +0000)]
Bug 28522: Correct eslint errors in staff-global.js

This patch makes minor corrections to staff-global.js in order to quiet
warnings from ESLint. This includes:

- Remove unused variables
- Declare undeclared variables
- Update list of global and exported variables and functions
- Correct whitespace
- Remove an unused function (paramOfUrl)

To test, apply the patch and clear your browser cache if necessary.

- Confirm that the first search header form field has focus when
  switching bewteen pages.
- Confirm that text entered in any search header form field persists
  when you switch search header form tabs, e.g. a word typed into the
  "Check out" tab is copied to the "Check in" form when you switch to
  that tab.
- Perform a search from the "Search the catalog" tab in the header. On
  the search results page and any following detail page your search term
  should remain in the header search form.
- From a bibliographic detail page, confirm that selecting a list from
  the "Add to list" button menu correctly triggers a popup window.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28427: Terminology: Shelf should be list
Owen Leonard [Mon, 24 May 2021 10:24:59 +0000 (10:24 +0000)]
Bug 28427: Terminology: Shelf should be list

This patch corrects the title element on the download list page in the
staff interface.

The affected page should never be seen by the user because other
error-handling should take precedence. In order to see it you have to
set up such an error:

- Log into the staff client as a user with existing lists.
- Open the Lists page.
- Open one of your lists in a new tab.
- In the original tab, delete the list you opened.
- In the tab showing the contents of the list, click the "Download" menu
  button and select an option.
- You should be redirected to a page with an error message at the top.
- The title of this page should be correct: "Download list."

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: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28423: JavaScript error on MARC modifications page
Owen Leonard [Fri, 21 May 2021 17:11:09 +0000 (17:11 +0000)]
Bug 28423: JavaScript error on MARC modifications page

This patch makes a minor change to the MARC modifications template so
that the "mmtas" variable isn't defined if there is no JSON to be
assigned as its value.

To test, apply the patch and go to Administration -> MARC modification
templates.

 - If necessary, add a template with at least one action.
 - Check the browser console, there should be no errors.
 - Click the "Edit" button corresponding to one of the template actions.
 - The details of the action should load correctly in the edit form and
   there should be no errors in the 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: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28582: Fix hashref in a warning message
Marcel de Rooy [Thu, 17 Jun 2021 09:38:15 +0000 (09:38 +0000)]
Bug 28582: Fix hashref in a warning message

Can't enqueue letter HASH(0x55edf1806850)

Test plan:
If you cancel an article request when there is no email address
(no branch email, no KohaAdminEmailAddress), Koha warns.
Verify that the warning now contains the letter code.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28545: Noisy uninitialized warn at opac-MARCdetail.pl line 313
Marcel de Rooy [Thu, 10 Jun 2021 14:02:16 +0000 (14:02 +0000)]
Bug 28545: Noisy uninitialized warn at opac-MARCdetail.pl line 313

Test plan:
You do not even need a NULL value in a authorised value controlled
item field, a zero in damaged or withdrawn is enough to trigger the
warnings. (Because only the 1 is linked to an authvalue.)

Check your plack-opac-error.log before and after applying this change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Without the patch I had at least four warnings per item: withdrawn,
lost, damaged and notforloan.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28479: Use primary keys to check object existence in TestBuilder
Joonas Kylmälä [Fri, 28 May 2021 10:33:24 +0000 (13:33 +0300)]
Bug 28479: Use primary keys to check object existence in TestBuilder

The TestBuilder::build_object function used any foreign keys to check
whether an object already exists or not. This brought incorrectly
results of unrelated objects because using any other keys other than
primary keys don't guarantee our results to point to one single
object. For example, as is put here in the unit test, if you created
two items with the same biblionumber and then tried to create a hold
using build_object() we were using the biblionumber to check whether
an item was linked to the hold already. Thus, we were checking whether
a random item was already linked to the hold instead of the one we
wanted either by passing it explicitly to build_object() or the one
build_object() created implicitly. This also resulted in following
warnings when there were more than one match:

DBIx::Class::Storage::DBI::select_single(): Query returned more than
one row.  SQL that returns multiple rows is DEPRECATED for ->find and
->single at /kohadevbox/koha/t/lib/TestBuilder.pm line 235

To test:
 $ prove t/db_dependent

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28388: Preserve "Browse results" when "view plain" is clicked
Jonathan Druart [Fri, 21 May 2021 07:37:54 +0000 (09:37 +0200)]
Bug 28388: Preserve "Browse results" when "view plain" is clicked

This patch modifies the way search sessions are preserved in the OPAC so
that viewing the "plain MARC" view will not cause the search context to
be lost.

To test, apply the patch and make sure OpacBrowseResults is enabled.

- Perform a search in the OPAC which will return multiple search
  results.
- View the details of one of the search results.
  - You should see a "Browse results" box in the right-hand sidebar.
- Click the "MARC view" link.
  - If you click back to the "Normal view" now, the results browser
    should still appear.
  - From the MARC view, click the "view plain" link.
  - Return to the "Normal view."
    - Before the patch: The results browser is gone.
    - After the patch: The results browser is still there.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28511: Road types in OPAC should prefer OPAC description if one exists
Owen Leonard [Mon, 7 Jun 2021 18:47:25 +0000 (18:47 +0000)]
Bug 28511: Road types in OPAC should prefer OPAC description if one exists

This patch modifies the patron entry form in the OPAC so that if street
types are defined in authorized values, the OPAC description is
preferred.

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

- Add or edit entries in the "ROADTYPE" category.
  - Some entries should have only the "Description" set, while others
    should have "Description" and "Description (OPAC)".
- In the OPAC, open the patron registration page. Check the "Stree type"
  drop down in the "Main address" section.
  - For entries which have an OPAC description, this value should show.
  - For entries without an OPAC description the default should show.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28422: OPAC MARC detail view doesn't correctly evaluate holdability
Owen Leonard [Mon, 24 May 2021 15:55:43 +0000 (15:55 +0000)]
Bug 28422: OPAC MARC detail view doesn't correctly evaluate holdability

This patch modifies the MARC detail view in the OPAC so that it
evaluates whether a title can be placed on hold in the same way it is
done on the "normal" detail page and the ISBD detail page. This allows
for consistency in the display of the "Place hold" link.

To test, apply the patch and log into the OPAC.

 - Perform a search which will return results, at least one of which can
   be placed on hold.
 - View the detail page, the MARC detail page, and the ISBD detail page.
   In each case the "Place hold" link should appear in the sidebar.
 - View the same pages for a record which cannot be placed on hold to
   confirm that the link doesn't appear. For instance:
   - All items are not for loan.
   - All items are lost.
   - There are no items attached.

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: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 21286: Add Corporate-name as phrase to zebra indexes
Nick Clemens [Mon, 24 May 2021 13:13:10 +0000 (13:13 +0000)]
Bug 21286: Add Corporate-name as phrase to zebra indexes

When using Zebra for searching, Koha performs a number of searches in order
to improve relevancy. This means that even for 'wordlist' search, we perform a phrase search.

When selecting 'Corporate-name' as an index, this expansion of the search causes errors and fails
the search

We can fix this for 'Corporate-name' searches by adding a phrase index

To test:
 1 - Edit koha-conf.xml and uncomment the zebra debug line and add 'request' to the list
 2 - Restart all
 3 - tail -f /var/log/koha/kohadev/zebra-output.log
 4 - Edit a record to add a 110 field e.g. 'House plants'
 5 - Enable syspref IntranetCatalogSearchPulldown
 6 - Search for 'Corporate name' and term 'House plants'
 7 - No results
 8 - View the log, see 'ERROR' and full search terms listed
 9 - Apply patch
10 - copy the zebra files to the production instance:
    cp etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
    cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
11 - restart all
12 - rebuild: sudo koha-rebuild-zebra -v -f kohadev
13 - Repeat search
14 - Success!

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: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28344: Restore ability to issue refund against older payments
Martin Renvoize [Thu, 13 May 2021 10:25:36 +0000 (11:25 +0100)]
Bug 28344: Restore ability to issue refund against older payments

When implimenting the refund features into the point of sale system, it
appears that at some point we lost the ability to apply refunds against
accountlines in the historic transactions table. This patch restores
that ability.

Test plan:
1/ Add some transations via the point of sale system
2/ Navigate to the 'register details' page and note that you have the
option to refund some of the lines.
3/ Use the Cashup option to make the transactions historic
4/ Refresh the page and then select a past date to see the historic
transactions in the second datatable
5/ Note that the option to refund has not dissapeared from all lines
6/ Apply patch
7/ Refresh and note the refund option now appears as expected.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28313: (follow-up) Define roadtypes
Jonathan Druart [Mon, 21 Jun 2021 08:53:48 +0000 (10:53 +0200)]
Bug 28313: (follow-up) Define roadtypes

It's not necessarily defined at this point

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28313: Add street type to alternate address in OPAC
Lucas Gass [Mon, 10 May 2021 21:16:59 +0000 (21:16 +0000)]
Bug 28313: Add street type to alternate address in OPAC

1. Add some values to the ROADTYPE authorized value
2. Go to PatronSelfRegistrationBorrowerUnwantedField and make sure B_streettype is NOT checked
3. Go the self reg form, no alternate address street type field
4. Apply patch
5. Check the self reg form, B_streettype should be there with all the options defined in ROADTYPE a.v.
6. Check the self modification form, B_street type should be there.
7. Make sure PatronSelfRegistrationBorrowerUnwantedField and PatronSelfModificationBorrowerUnwantedField hide the field correctly.
8. Make sure PatronSelfRegistrationBorrowerMandatoryField properly makes the field required.

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 28191: Upate wording on batch patron deletion
Katrin Fischer [Thu, 3 Jun 2021 23:33:11 +0000 (23:33 +0000)]
Bug 28191: Upate wording on batch patron deletion

This adds another point to the list of things that prevent patron
deletion:

<li>They have permissions assigned to them.</li>

In order to test:
- Go to tools > patron deletion and anonymization
- Verify the new condition shows at the top of the page.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28513: Fix analytics search links so they don't match unrelated biblios
Joonas Kylmälä [Fri, 4 Jun 2021 11:06:53 +0000 (14:06 +0300)]
Bug 28513: Fix analytics search links so they don't match unrelated biblios

At least when using Searchengine=Elasticsearch what happened was that
without () parenthese included the search for Host-item field was done
only to the first token, the subsequent ones matched any
fields. Adding the parentheses restrict the search to Host-item search
field only.

To test:
 1) Set Searchengine = elasticsearch
 2) Make a biblio with 245a = "biológica paranaense." and 773a = "Acta"
 3) Go to a biblio with 245a = "Acta biológica paranaense" (in
 kohadevbox or create one if you need).
 4) Notice that the "Acta biológica paranaense" biblio's detail page link "Show
 analytics" takes to the "biológica paranaense" incorrectly just
 because the 773a has "Acta" and the words "biológica" and "paranaense"
 appear elsewhere in the biblio.
 5) Apply patch and notice the link is now not created at all

Signed-off-by: David Nind <david@davidnind.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27929: (QA follow-up) Hide tag editor on regex
Nick Clemens [Fri, 11 Jun 2021 17:44:01 +0000 (17:44 +0000)]
Bug 27929: (QA follow-up) Hide tag editor on regex

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27929: Allow regex for subfield linked with cataloguing plugin
Jonathan Druart [Thu, 11 Mar 2021 15:22:13 +0000 (16:22 +0100)]
Bug 27929: Allow regex for subfield linked with cataloguing plugin

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28542: Move new authority from Z39.50/SRU to a button
Fridolin Somers [Thu, 10 Jun 2021 13:05:51 +0000 (15:05 +0200)]
Bug 28542: Move new authority from Z39.50/SRU to a button

Actually in authority tools bar, 'New from Z39.50/SRU' is inside 'New autority' menu.
This is different from biblio cataloguing toolbar, and adds a click to access it.

I propose to move this to its own button.

Test plan :
1) Create a Z39.50/SRU server connexion for authorities
2) Go to authorities home page
3) Check you see buttons 'New autority' and 'New from Z39.50/SRU'
4) Click on 'New autority'
5) Check you only see autority types
6) Click on 'New from Z39.50/SRU'
7) Check you go to Z39.50/SRU popup
8) Delete Z39.50/SRU server connexion for authorities
9) Go to authorities home page
10) Check you dont see 'New from Z39.50/SRU'

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoUpdate release notes for the 21.05.01 release v21.05.01
Nick Clemens [Thu, 24 Jun 2021 13:01:30 +0000 (13:01 +0000)]
Update release notes for the 21.05.01 release

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
3 years agoIncrement version for 21.05.01 release
Nick Clemens [Thu, 24 Jun 2021 12:47:39 +0000 (12:47 +0000)]
Increment version for 21.05.01 release

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
3 years agoTranslation fixes for 21.05.01 release
Nick Clemens [Thu, 24 Jun 2021 12:30:39 +0000 (12:30 +0000)]
Translation fixes for 21.05.01 release

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
3 years agoTranslation updates for Koha 21.05.01
Koha translators [Thu, 24 Jun 2021 11:55:25 +0000 (08:55 -0300)]
Translation updates for Koha 21.05.01

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
3 years agoBug 28409: Adjust regression test
Jonathan Druart [Thu, 24 Jun 2021 07:55:23 +0000 (09:55 +0200)]
Bug 28409: Adjust regression test

We are no longer expecting an URI escaped value but a corrected category
value, either 1 or 2.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
3 years agoBug 28409: Simplify data validation
Jonathan Druart [Fri, 21 May 2021 07:09:53 +0000 (09:09 +0200)]
Bug 28409: Simplify data validation

Simplify the affectation then trust it.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
JD Amended patch: remove duplicate comma

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
3 years agoBug 28409: Comprehensively validate category in opac-shelves.pl
David Cook [Fri, 21 May 2021 06:52:25 +0000 (06:52 +0000)]
Bug 28409: Comprehensively validate category in opac-shelves.pl

Default to a category of 1 (ie Private). Only allow input of 1
or 2 (ie Public)

== 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. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=add&shelfname=foo&category=9
4. Note that you can't see this list in the Lists (but it has been added to the database)
5. Apply the patch & restart services
6. 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}()
7. Note that you are not redirected to another website
8. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=add&shelfname=bar&category=9
9. Note that "bar" has been added as a Private list

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28600: Resolve variable scope issue
Tomas Cohen Arazi [Fri, 18 Jun 2021 18:20:30 +0000 (15:20 -0300)]
Bug 28600: Resolve variable scope issue

This patch fixes a scope issue. Originally, a variable declared as

our $borcat

was replaced by

my $patron

This patch makes the method not rely on global variables, but have a
parameter for the patron, and thus things are clearer.

To test:
1. Open the OPAC detail page for a record
=> FAIL: The logs show some errors about the $patron variable not
available in the scope
2. Apply this patch
3. Repeat 1
=> SUCCESS: No errors
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28586: (follow-up) updated_by should be set
Tomas Cohen Arazi [Thu, 17 Jun 2021 19:02:35 +0000 (16:02 -0300)]
Bug 28586: (follow-up) updated_by should be set

This patch makes the route set the 'updated_by' attribute as well, when
resolving a return claim through the API.

Tests are added for this behavior.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/return_claims.t
=> SUCCESS: Tests pass! updated_by is set correctly!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28586: Pass the right parameter to resolve claim
Tomas Cohen Arazi [Thu, 17 Jun 2021 15:49:56 +0000 (12:49 -0300)]
Bug 28586: Pass the right parameter to resolve claim

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28616: (bug 28220 follow-up) Replace Data::Printer with simple warn
Jonathan Druart [Wed, 23 Jun 2021 07:40:36 +0000 (09:40 +0200)]
Bug 28616: (bug 28220 follow-up) Replace Data::Printer with simple warn

$_ is an exception that will be stringify in scalar context. We don't
need Data::Printer here.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28519: Add lib to koha-shell
Jonathan Druart [Thu, 17 Jun 2021 13:41:46 +0000 (15:41 +0200)]
Bug 28519: Add lib to koha-shell

Test plan:
% koha-shell kohadev -c 'echo $PERL5LIB'
=> /kohadevbox/koha:/kohadevbox/koha/lib

% koha-shell kohadev
echo $PERL5LIB
=> /kohadevbox/koha:/kohadevbox/koha/lib:/kohadevbox/qa-test-tools

Note that this is not consistent but at least we have lib now in both
situations

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28519: Put CGI::Session::Serialize::yamlxs in lib directory
David Cook [Mon, 7 Jun 2021 00:14:55 +0000 (00:14 +0000)]
Bug 28519: Put CGI::Session::Serialize::yamlxs in lib directory

This patch adds a "lib" directory to the source tree which gets
mapped to the same directory as "C4" and "Koha" for single and
standard installations.

CGI::Session::Serialize::yamlxs is put into this "lib" directory.

This patch also includes some changes so that dev/git installations
work as well.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28503: (follow-up) Get rid of tests warnings
Tomas Cohen Arazi [Mon, 14 Jun 2021 17:49:43 +0000 (14:49 -0300)]
Bug 28503: (follow-up) Get rid of tests warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28503: Compare item homebranch to patron branch when hold policy set to 'from_hom...
Nick Clemens [Wed, 2 Jun 2021 15:20:08 +0000 (15:20 +0000)]
Bug 28503: Compare item homebranch to patron branch when hold policy set to 'from_home_library'

This fixes an issue in the way we calculate the check for hold policy 'from_home_library'

Currently we change the comparison based on ReservesControlBranch, however, that should
only control the rule we fetch, not how we compare

When ReservesControlBranch is set to "patron's home library" we compare the patron's branch to
the patron's branch, this is useless and means we pass the check for all branches all of the time

We should instead compare the patron's branch to the item's branch, and only fetch the rule using ReservesControlBranch

To test:
 1 - Have a record with an item from library A and library B
 2 - Set the 'Default checkout, hold and return policy'->Hold policy->From home library for all libraries
     and ensure you have no branch specific/itemtype specific rules set
 3 - Attempt to place a hold on the record for a patron from library B
 4 - Note that only the library B item is holdable - place a title level hold (do not choose an item)
 5 - Check in the item from library A
 6 - It fills the hold - This is incorrect - ignore the hold
 7 - Apply patch
 8 - Restart all the things
 9 - Check in the item from library A
10 - No hold found
11 - Check in the item from library B
12 - Hold found, correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 28503: Clarify what ReservesControlBranch controls

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28503: Unit tests
Nick Clemens [Wed, 2 Jun 2021 15:05:08 +0000 (15:05 +0000)]
Bug 28503: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28488: Javascript error in self-checkout (__ is not defined)
Owen Leonard [Mon, 7 Jun 2021 16:02:35 +0000 (16:02 +0000)]
Bug 28488: Javascript error in self-checkout (__ is not defined)

This patch adds inclusion of the internationalization JavaScript which
is required by the newest version of the DataTables include. It
references the double-underscore function provided by i18n.js.

To test, apply the patch and log into the self-checkout system as a user
with checkouts. The table of checkouts should display correctly and
there should be no JavaScript errors in the console.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28518: Display missing inputs for "Return to the last advanced search"
Jonathan Druart [Sat, 5 Jun 2021 14:08:46 +0000 (16:08 +0200)]
Bug 28518: Display missing inputs for "Return to the last advanced search"

When more than 3 search terms are passed on the advanced search form,
the "Return to the last advanced search" feature does not display them.

Test plan:
Perform an adv search at the OPAC, enter more than 3 terms, launch the
search, click the "Return to the last advanced search" link and confirm
that all the entries are there.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28383: Fix itemsearch when accessed from the login form
Jonathan Druart [Fri, 11 Jun 2021 11:25:57 +0000 (13:25 +0200)]
Bug 28383: Fix itemsearch when accessed from the login form

There are params here (credentials), we need to test for the existence of $format.

Test plan:
logout
access /cgi-bin/koha/catalogue/itemsearch.pl
Login
=> Without this patch you get a 500 (because we hit the exit statement)
=> With this patch you see the items search form.

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: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28467: (QA follow-up) Remove errorenous space in borrowers.lastseen
Katrin Fischer [Tue, 1 Jun 2021 04:43:23 +0000 (04:43 +0000)]
Bug 28467: (QA follow-up) Remove errorenous space in borrowers.lastseen

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28467: Update wording of TrackLastPatronActivity syspref
Andrew Fuerste-Henry [Wed, 2 Jun 2021 14:58:53 +0000 (14:58 +0000)]
Bug 28467: Update wording of TrackLastPatronActivity syspref

To Test:
1 - look up TrackLastPatronActivity
2 - Read it, be dissatisfied with it
3 - apply patch, restart, reload page
4 - be happier with the new wording

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: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28520: Allow creating a transfer back automatically if a hold is canceled during...
Joonas Kylmälä [Tue, 8 Jun 2021 08:14:20 +0000 (11:14 +0300)]
Bug 28520: Allow creating a transfer back automatically if a hold is canceled during transit

This fixes regression caused by "Bug 12362: Cancel transfer with hold
cancelation" where cancelled hold's transfer didn't show up in
intranet and opac because it create a new transfer that was not yet
put in in-transit state. The original idea of bug 12362 was to be able
to trigger transfer back home if a hold was cancelled (a regression
caused by bug 26078). However, we can do it more simply by setting the
$validTransfer variable true in the item check-in code when we are
dealing with Reserve transfers. More down in the AddReturn() code
there is also a check "and !$resfound" to make sure we only try to
trigger the transfer back home automatically if there is no hold
waiting at the current location the item arrived in.

It should be noted however that now we only display generic message
for the automatic transfer reason. Bug 12362 made the return display
as the reason "Transfer was cancelled whilst in transit". However,
since this fixes the original regressions caused by bug 26078 and
restores similar behaviour to that I think giving a more descriptive
message for example regarding a hold being cancelled can be considered
a further enhancement.

To test:
 1) Apply patch
 1) Have biblio with item in branch A
 2) Create a new hold with a pickup library to branch B
 3) Check-in the item at branch A and confirm the hold and transfer
 4) Cancel the hold
 5) Check-in the hold at branch B and notice it prompt to return it to
 branch A

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28520: Bring back TransferCancellation reason handling from reverted Bug 12362
Joonas Kylmälä [Tue, 8 Jun 2021 07:55:52 +0000 (10:55 +0300)]
Bug 28520: Bring back TransferCancellation reason handling from reverted Bug 12362

The code from Bug 12362 was reverted but there might be still in
database transfers with the reason 'TransferCancellation' so we need
to restore the code to handle displaying that information.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28520: Revert "Bug 12362: Reverse transfer upon cancellation"
Joonas Kylmälä [Tue, 8 Jun 2021 07:50:29 +0000 (07:50 +0000)]
Bug 28520: Revert "Bug 12362: Reverse transfer upon cancellation"

This reverts commit d0407686eb070c5bdf0302147a198027abea5ac0.

This commit was part of a series adding adding reverse transfers, i.e.
transfers that were created for transfers that were cancelled and
we wanted the item to return back to its sending library. This however
hid the information about transfer happening and we need another approach
to the problem.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28520: Revert "Bug 12362: Cancel transfer with hold cancelation"
Joonas Kylmälä [Tue, 8 Jun 2021 07:50:05 +0000 (07:50 +0000)]
Bug 28520: Revert "Bug 12362: Cancel transfer with hold cancelation"

This reverts commit 6c105829144cd341a4bc65ad8d0ee1f996b423d4.

This commit was part of a series adding adding reverse transfers, i.e.
transfers that were created for transfers that were cancelled and
we wanted the item to return back to its sending library. This however
hid the information about transfer happening and we need another approach
to the problem.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
JD amended patch: restore Koha::Item::Transfer->from_library (we are
adding tests in a future patch).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28520: Revert "Bug 12362: (QA follow-up) Fix ModItemTransfer cancellation handling"
Joonas Kylmälä [Tue, 8 Jun 2021 07:47:32 +0000 (07:47 +0000)]
Bug 28520: Revert "Bug 12362: (QA follow-up) Fix ModItemTransfer cancellation handling"

This reverts commit fbba09f63f200d3e57a8612554984d807867cf84.

This commit was part of a series adding adding reverse transfers, i.e.
transfers that were created for transfers that were cancelled and
we wanted the item to return back to its sending library. This however
hid the information about transfer happening and we need another approach
to the problem.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 24434: DBIC Update
Kyle M Hall [Fri, 18 Jun 2021 14:43:28 +0000 (10:43 -0400)]
Bug 24434: DBIC Update

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 24434: DBRev 21.05.01.002
Jonathan Druart [Tue, 15 Jun 2021 14:41:01 +0000 (14:41 +0000)]
Bug 24434: DBRev 21.05.01.002

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 24434: Add 'WrongTransfer' to cancellation_reasons
Martin Renvoize [Thu, 6 May 2021 13:14:24 +0000 (14:14 +0100)]
Bug 24434: Add 'WrongTransfer' to cancellation_reasons

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28490: DBRev 21.05.01.001
Jonathan Druart [Mon, 14 Jun 2021 14:37:03 +0000 (14:37 +0000)]
Bug 28490: DBRev 21.05.01.001

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 years agoBug 28489: DBRev 21.05.01.000
Jonathan Druart [Mon, 14 Jun 2021 14:34:48 +0000 (14:34 +0000)]
Bug 28489: DBRev 21.05.01.000

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 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: Kyle M Hall <kyle@bywatersolutions.com>