koha.git
22 months agoBug 31163: Sort cashups newest to oldest
Martin Renvoize [Fri, 15 Jul 2022 13:58:40 +0000 (14:58 +0100)]
Bug 31163: Sort cashups newest to oldest

The cashup history table was sorting from oldest to newest.. it's
perferable to show the most recent at the top by default.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29114: Trim whitespace before the barcode
Andrii Veremeienko [Fri, 29 Oct 2021 13:44:19 +0000 (16:44 +0300)]
Bug 29114: Trim whitespace before the barcode

The solution was to add regexp that trims all whitespaces.

How to test:
1. Go to the koha/virtualshelves/shelves.pl;
2. Add new list or edit existing one;
3. Start adding new items;
4. In the "Barcode" field add barcode(s) with whitespaces before them;
5. Observe that it wasn't added as the barcode isn't recognized because of whitespaces;
6. Apply the patch;
7. Repeat step 4;
8. Observe that the item was successfully added;

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 27667: (QA follow-up) Fix singular index and rephrase heading
Katrin Fischer [Fri, 15 Jul 2022 13:23:18 +0000 (13:23 +0000)]
Bug 27667: (QA follow-up) Fix singular index and rephrase heading

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 27667: Display a warning for records missing in Elasticsearch
Fridolin Somers [Wed, 11 May 2022 19:38:23 +0000 (09:38 -1000)]
Bug 27667: Display a warning for records missing in Elasticsearch

On "About Koha" page are displayed the numbers of indexed biblios and authorities with ES.
It could be great if we could have comparison with the number of records in the database to display the number of missing records.
In the "System information" tab with the other "Data problems".

If Searchengine has any issue (index count will be -1), we do not
display missing records.

Test plan :
1) Use Elasticsearch searchengine
2) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
3) Go to "About Koha" page and look at System information tab
=> you see no warning
4) On a biblio record delete the MARCXML in biblio_metadata.metadata
5) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
6) Go to "About Koha" page and look at System information tab
=> you see warning : 1 record(s) missing on a total of 435 in indice koha_kohadev_biblios.
7) On a authority record delete the MARCXML in auth_header.marcxml
8) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
9) Go to "About Koha" page and look at System information tab
=> you see warning : 1 record(s) missing on a total of 1705 in indice koha_kohadev_authorities.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 20439: Sort SMS providers in alphabetical order by DB field
Lucas Gass [Fri, 15 Jul 2022 16:55:53 +0000 (16:55 +0000)]
Bug 20439: Sort SMS providers in alphabetical order by DB field

To test:
1/ Add 'Email' to the 'SMSSendDriver' system preference.
2/ Make sure 'EnhancedMessagingPreferencesOPAC' and 'EnhancedMessagingPreferences' are turned on.
3/ Add some SMS providers (/cgi-bin/koha/admin/sms_providers.pl) with different names.
4/ Notice on memberentry.pl and opac-messaging.pl the SMS providers sort by when they were added, not alphabetically.
5/ Apply patch and restart services.
6/ Look at memberentry.pl and opac-messaging.pl and notice that they SMS providers now sort alphabetically.

Signed-off-by: George Williams <george@nekls.org
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31144: When modifying an order we should not load the vendor default discount
Nick Clemens [Tue, 12 Jul 2022 18:39:06 +0000 (18:39 +0000)]
Bug 31144: When modifying an order we should not load the vendor default discount

After placing an order in a basket with a discount of "0" if you attempt to modify we will load the vendor default discount, this can lead to accidentally applying a discount when modifying other order parts

To test:
0 - Have a vendor with a discount set
1 - Add an order to a basket
2 - While adding, set discount to 0
3 - Add order - prices are calculated ocrrectly
4 - Modify order
5 - Note discount is populated with vendor discount
6 - Cancel
7 - Apply patch
8 - Modify order
9 - Discount remains at 0
10 - Repeat with a vendor with no discount set
11 - Placing order not specifiying discount it remains blank
12 - Modifying order discount remains blank
13 - Modify order and set discount
14 - Confirm it is retained on modifcation

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31068: Context for translation: Print (verb) vs. Print (noun)
Caroline Cyr La Rose [Mon, 4 Jul 2022 16:10:54 +0000 (12:10 -0400)]
Bug 31068: Context for translation: Print (verb) vs. Print (noun)

This patch adds context to the term Print in the context of message transport types (as opposed to printing something/print button), for translation purposes.

To test:
0- Apply patch

Check the terms to be changed
1- Go to Tools > Notifications & slips
2- Edit a notification
** 3- In the tabs for different transport types, check the 'Print' term (letter.tt)
4- Go to Tools > Overdue notice/status triggers
** 5- In the transport types, check the 'Print' column heading (overduerules.tt)

Add a new language (fr-CA in the example, change for whatever language code you want)
6- In a terminal, run
gulp po:create --lang fr-CA
7- Then, run
gulp po:update --lang fr-CA
8- In system preferences, enable the new language in language and OpacLanguages
9- Switch the language in staff interface and OPAC

Change the translations
10- In your favourite text editor, open fr-CA-messages.po
11- Find the string msgctxt "Message transport type"
12- Enter a word in msgstr
13- Save the file
14- In a terminal, go to misc/translator
15- Run
./translate install fr-CA

Check the translations
16- Redo the steps to check the terms (steps 1-5) and make sure the terms in steps 3 and 5 are changed for the word you put in step 12.

17- Optionally, check the other pages where the term is supposed to be unchanged and make sure it is unchanged

Check the terms to leave unchanged (optional)
18- Enable the HoldsAutoFill and UseCashRegisters system preferences
19- Go to Administration > Cash registers and create a cash register
20- Go to a patron's account
** 21- Check the 'Print' button in the menu bar or the patron's account (members-toolbar.inc)
22- Go to the 'Accounting' tab
23- Create a manual invoice
** 24- In the 'Transactions' tab, check the 'Print' button in the fee line (boraccount.tt)
25- Pay the fee (make sure to use the cash register)
** 26- In the 'Transactions' tab, check the 'Print' button in the payment line (boraccount.tt)
27- At the top of the transactions table, click the 'Export' option
** 28- Check the 'Print' option (columns_settings.inc)
29- Go to the 'Check out' tab and check out an item
30- Go to the item's bibliographic record
** 31- Check the 'Print' button in the menu bar of the detailed record (cat-toolbar.inc)
32- Add the record to the cart and open the cart
** 33- Check the 'Print' button in the cart (basket.tt)
34- Place a hold on the item
35- In the search bar at the top, click the 'Check in' tab and check in the item
** 36- Check the 'Print' button in the 'Hold filled for' message (returns.tt)
37- Go to Tools > Cash summary for Branch
38- Click 'record cashup' and confirm
39- Click the 'Summary' link in the 'Last cashup' column
** 40- Check the 'Print' button in the cashup summary modal (cashup_summary.inc)
41- Go to Serials
42- Create a subscription (if there aren't any)
43- Receive an issue
44- From the subscription detail page, go to Create routing list
45- Add a recipient to the list
46- Save the routing list
47- Click 'Save and preview routing slip'
** 48- Check the 'Print' button in the routing list preview (routing_preview_slip.tt)

Note: I can't find where the 'Print' from tinymce_i18n.inc is displayed in the staff interface

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29105: Add effective_itemtype handling to items api
Martin Renvoize [Fri, 24 Sep 2021 11:19:12 +0000 (12:19 +0100)]
Bug 29105: Add effective_itemtype handling to items api

This patch adds effective_item_type_id to the items api.

We overload the to_api method to append the effective_item_type_id field
with that of the effective itemtype code.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29105: Unit test
Martin Renvoize [Fri, 24 Sep 2021 14:13:55 +0000 (15:13 +0100)]
Bug 29105: Unit test

This patch adds a unit test for the addition of effective_item_type_id
to the items responses.

Test plan
1) Run the unit test prior to applying the second patch and confirm it
   fails
2) Apply the second patch and confirm the unit test now passes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31071: Compiled CSS
Tomas Cohen Arazi [Mon, 18 Jul 2022 17:39:25 +0000 (14:39 -0300)]
Bug 31071: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31071: Regression: date due removed from staff search results
Owen Leonard [Tue, 12 Jul 2022 14:45:13 +0000 (14:45 +0000)]
Bug 31071: Regression: date due removed from staff search results

This patch corrects a regression caused by Bug 28321, which
inadvertently removed the date due from output of item information in
each search result.

To test, apply the patch and perform a catalog search which will return
some results which are checked out and some which aren't. Confirm that
the checked out items show the date due correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31106: Fix links generated in XSLTs
Tomas Cohen Arazi [Tue, 5 Jul 2022 00:09:05 +0000 (21:09 -0300)]
Bug 31106: Fix links generated in XSLTs

This patch addresses the case of links that are generated on the XSLT
side, those linking to and from host records using 773$t and 773$a.

To test:
1. Pick a bibliographic record (I chose 'Unconditional' from the sample
   data
2. Add " and ? to the title statement. I changed it to
   'Uncond"itional?¿'
3. Add a child record to it
4. Open the detail page for the host record
=> FAIL: It doesn't show the 'Show analytics' link
5. Repeat 4 for the same record, in the OPAC
=> FAIL: It doesn't show the 'Show analytics' link
6. Apply this patch
7. Repeat 4 and 5.
=> SUCCESS: Links are shown!
8. Follow the links
=> SUCCESS: The links take you to the right resultset!
9. Go to the child record, and notice the link back to the parent works
   :-D
10. Sign off :-D

Sponsored-by: Theke Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31106: Make clean_search_term escape double quotes
Tomas Cohen Arazi [Mon, 4 Jul 2022 18:19:27 +0000 (15:19 -0300)]
Bug 31106: Make clean_search_term escape double quotes

We noticed that several characters will break Zebra queries. So search
terms need to be quoted for things to work. In this context, double
quotes inside search terms are problematic because double quotes are
what we use for quoting strings.

This patch makes the clean_search_term method escape double quotes.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/Koha/SearchEngine/Zebra/QueryBuilder.t
=> FAIL: It doesn't work as it should!
3. Apply this patch
4. Repeat 2
=> SUCCESS: It does the job!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31106: Unit tests
Tomas Cohen Arazi [Mon, 4 Jul 2022 18:18:44 +0000 (15:18 -0300)]
Bug 31106: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 30882: (QA follow-up) Fix tests
Tomas Cohen Arazi [Mon, 18 Jul 2022 17:36:28 +0000 (14:36 -0300)]
Bug 30882: (QA follow-up) Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31069: Remove ExplodedTerms dependency on templates
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:33:47 +0000 (12:33 -0300)]
Bug 31069: Remove ExplodedTerms dependency on templates

This patch removes the use of templates and CGI in ExplodedTerms by using the
Koha::I18N library.

The functionality on the package is too simple, and messing with the
template paths complexity on the tests was too much, given we have a
nice way to have translatable strings at the package level.

This patch does that, and cleans up the test file as well, that required
complex template and CGI mocking to run properly.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/SuggestionEngine_ExplodedTerms.t
=> FAIL: It fails in master
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass
4. Follow the original test plan
=> SUCCESS: Things work
5. Enjoy the rest of the day and forget this ever happened

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29632: DBIC update
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:11:15 +0000 (12:11 -0300)]
Bug 29632: DBIC update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29632: (QA follow-up) Add ENUM value to kohastructure.sql :-D
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:09:41 +0000 (12:09 -0300)]
Bug 29632: (QA follow-up) Add ENUM value to kohastructure.sql :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: DBIC update
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:07:42 +0000 (12:07 -0300)]
Bug 28854: DBIC update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29632: DBRev 22.06.00.017
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:05:40 +0000 (12:05 -0300)]
Bug 29632: DBRev 22.06.00.017

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 30882: Add max_result_window to index config
Fridolin Somers [Thu, 2 Jun 2022 06:24:03 +0000 (20:24 -1000)]
Bug 30882: Add max_result_window to index config

Elasticsearch number of results is by default limited by setting "index.max-result-window", default value is 10000.
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-max-result-window

We use this setting:
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/SearchEngine/Elasticsearch/Search.pm#L411

I propose we add this setting in index config.

Test plan:
1) Use Elasticsearch
2) Apply patch and flush memcached
3) Rebuild indexes: misc/search_tools/rebuild_elasticsearch.pl -v -b -d
4) Check the settings of index (when using koha-testing-docker*):
   curl 'es:9200/koha_kohadev_biblios/_settings?pretty&filter_path=**.max_result_window'
5) You should see:
   "max_result_window" : "1000000"

* You also need to add this setting to the es section in koha-testing-docker's
docker-compose.yml (after the networks configuration):
     ports:
         - "9200:9300"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29632: Unit tests
Nick Clemens [Mon, 11 Jul 2022 15:56:05 +0000 (15:56 +0000)]
Bug 29632: Unit tests

This patch adds unit tests, as well as changing existing test to use a mock
and read the data as passed in tests, rather than relying on what exists in
the DB

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29632: Don't sort cn-sort numerically
Nick Clemens [Tue, 28 Jun 2022 13:47:45 +0000 (13:47 +0000)]
Bug 29632: Don't sort cn-sort numerically

When defining our sort fields in we defined all as 'numeric'

For other string containing numbers this is likely correct, however,
for callnumbers it is not. e.g. E45 should sort before E7

This patch adds a new 'callnumber' type and deifnes this for cn-sort and
adds to the field maping a sort without numeric set

To test:
0 - Be using ES with Koha
1 - On records with single item, add callnumbers:
    VA65 E7 R63 1984
    VA65 E7 T35 1990
    VA65 E45 R67 1985
2 - Add public note 'shrimp' or something to make them easily searchable as a group
3 - Search for 'shrimp', sort by callnumber
4 - Note E45 comes last, it should come first
5 - Apply patch
6 - Reset ES mappings
7 - Reindex ES
8 - Repeat search
9 - Sorting should be correct when set to callnumber

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Michal Urban <michalurban177@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31153: Correct include for patron-search-header
Lucas Gass [Thu, 14 Jul 2022 15:10:55 +0000 (15:10 +0000)]
Bug 31153: Correct include for patron-search-header

To test:
1) Turn on recalls
   1.1) In Administration > Global system preferences, enable UseRecalls
   1.2) Add recalls permissions in your circulation rules
2) In the OPAC, log in as a patron
3) Find a record with checked out items and place a recall
4) In the staff interface, go to the patron's account
5) Click on any tab on the left in the patron's account (e.g. Holds history)
--> Note that the Koha logo and search bar is at the top of the page between the module menu and the breadcrumbs
6) Click on the 'Recalls history' tab
--> Note that the Koha logo and search bar disappear
7) Apply patch
8) Conform search bar is there

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 14680: Always subtract discount from price to calculate estimated cost
Nick Clemens [Tue, 12 Jul 2022 18:10:54 +0000 (18:10 +0000)]
Bug 14680: Always subtract discount from price to calculate estimated cost

This patch simply removes a discrepancty where when a discount is provided on the order form
we add the discount to the price, and when it comes form the vendor we subtract the discount.

Discounts should always descrease the estimated cost

To test:
 0 - Have a vendor with a discount of 10% specified
 1 - Export a record from your Koha
 2 - Stage the record for import and match on biblionumber
 3 - Add to a basket in acq from the staged file
 4 - Select the title, and set order price to $10 and do not fill the discount field
 5 - Add the order - note $10 RRP and $9 actual/budgeted cost
 6 - Repeat 2&3
 7 - Select the tile, set price $10 and discount 50%
 8 - Add the order - note $20 RRP and $10 actual/budgeted cost! FAIL
 9 - Apply patch, restart all
10 - Repeat 2-7
11 - Add the order, note $10 RRP and $5 actual.budgeted cost

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31083: Fix part_name handling in js-biblio-format
Martin Renvoize [Mon, 4 Jul 2022 10:49:00 +0000 (11:49 +0100)]
Bug 31083: Fix part_name handling in js-biblio-format

This patch corrects the typo introduced in bug 28854 for part_name
handling in the js-biblio-format include.  We also introduce proper
whitespace addition when concatenating subtitle, medium and parts to the
title string.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 30578: Fix multi-terms search
Jonathan Druart [Mon, 13 Jun 2022 18:58:44 +0000 (20:58 +0200)]
Bug 30578: Fix multi-terms search

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 30578: Remove ajaxSetup from checkouts.js
Jonathan Druart [Mon, 13 Jun 2022 18:46:28 +0000 (20:46 +0200)]
Bug 30578: Remove ajaxSetup from checkouts.js

It was a IE fix apparently
  commit f021b52e71deaac0b46992fa33ef02f2b001e56d
  Bug 11703 [QA Followup] - Stop IE from caching ajax request

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 30578: Fix on-select for 2 occurrences
Jonathan Druart [Mon, 13 Jun 2022 18:46:17 +0000 (20:46 +0200)]
Bug 30578: Fix on-select for 2 occurrences

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 30578: Restore highlighting of patrons from the logged-in library
Jonathan Druart [Mon, 13 Jun 2022 18:37:44 +0000 (20:37 +0200)]
Bug 30578: Restore highlighting of patrons from the logged-in library

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 30578: Remove circ/ysearch.pl in favor of the /patrons REST API route
Jonathan Druart [Thu, 9 Jun 2022 09:03:27 +0000 (11:03 +0200)]
Bug 30578: Remove circ/ysearch.pl in favor of the /patrons REST API route

This patch removes the circ/ysearch.pl script used by the jQuery autocomplete widget.
We can now use the /api/v1/patrons endpoint to retrieve the patrons and
generate the patron result list.

Prior to this patch the different occurrences were defining the style
and the list of patron's attributes to display for each option (name,
date of birth, age, address, etc.). Now they are all displaying the same
information.

To acchieve this we had to:
* Make js-date-format.inc and js-patron-get-age.inc available from js_includes.inc
and so available from everywhere, which is certainly a good move. We
could discuss why this code is in include file instead of JS files
however.
* Remove the .ajaxSetup call in tags-review.js to reduce its scope: an
underscore parameter was added to the REST API query (?)

A better solution would have been to extend the existing widget
(https://learn.jquery.com/jquery-ui/widget-factory/extending-widgets/)
but I didn't manage to do it, and I feel like there is a bug in jQuery
autocomplete. The "source" was not taken into account.
We could think about replacing the jQuery autocomplete with something
else, but that's outside the scope of this bug.

Test plan:
Search for patrons and confirm the autocomplete works and that the
"select" action works as before (either a redirect or select the
patrons) on the different views:
* Place a hold
* Search for tags (form on the left)
* In the header, "Check out" and "Search patrons"
* Add instructors to course reserves
* View logs (the "librarian" input)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 11158: Add complete field to authority "starts with" search
David Cook [Tue, 5 Jan 2021 00:21:16 +0000 (00:21 +0000)]
Bug 11158: Add complete field to authority "starts with" search

This patch adds "complete field" to the authority "starts with"
search so that it uses the untokenized "p" register.

Test plan:
1. Apply the patch
2. koha-plack --restart kohadev
3. Go to http://localhost:8081/cgi-bin/koha/authorities/authorities-home.pl
4. Type in "Espen" into the search box and hit "Submit"
5. Note that there are 3 results
6. Change "contains" to "starts with" and hit "Submit"
7. Note that no results are returned
8. Change the search from "Espen" to "Sandberg" and hit "Submit"
9. Note that 3 results are returned
10. Experiment to your heart's content and rejoice at your new found power

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31036: (QA follow-up) Add a warning to the system preference
Martin Renvoize [Fri, 15 Jul 2022 14:20:03 +0000 (15:20 +0100)]
Bug 31036: (QA follow-up) Add a warning to the system preference

As suggested by Katrin, adding a warning to the system preference that
this has an effect on SIP configurations that needs to be understood.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31036: Treat SIP00 that same as CASH
Martin Renvoize [Fri, 24 Jun 2022 08:20:52 +0000 (09:20 +0100)]
Bug 31036: Treat SIP00 that same as CASH

SIP00 is the code for CASH transactions that have taken place on a SIP
client.  Cash management treats CASH type transactions as a special case
for banking and register requirements. This patch brings SIP00 in line
with the CASH handling code of cash management.

Test plan
1) Enable cash management with 'EnablePointOfSale'
2) Enable cash registers with 'UseCashRegisters'
3) Add a cash register via 'Administration > Cash registers'
4) Make some payments against the ash register in the staff client
5) Attempt to make a payment via a SIP client without having associated
   a cash register to the SIP account config
5a) This should now fail
6) Attach the cash register to the SIP account used above
6a) Payment should now work again on SIP transactions
7) Look at the cash register details page for the cash register
7a) 'Bankale' should now include cash from both SIP and Staff client
sales

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31069: fix <span> in OPAC search suggestions (Did you mean)
Victor Grousset/tuxayo [Sat, 9 Jul 2022 03:39:39 +0000 (05:39 +0200)]
Bug 31069: fix <span> in OPAC search suggestions (Did you mean)

== test plan ==
1. Enable "Did you mean?":
   . go to Administration > Additional parameters > Did you mean?
   . put a tick in each plugin and save the configuration
2. In the OPAC, search for 'open source'
3. Without the patch you see escaped <span> after "Did you mean:"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 29094: Adding hold via SIP should check if patron can hold item first
Kyle Hall [Thu, 23 Sep 2021 12:57:30 +0000 (08:57 -0400)]
Bug 29094: Adding hold via SIP should check if patron can hold item first

When placing holds via SIP2, there is no holdability check. This seems very incorrect.

Test Plan:
1) Apply this patch
2) prove -r t/db_dependent/SIP

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31137: (QA follow-up) Also fix new template page
Nick Clemens [Fri, 15 Jul 2022 12:10:43 +0000 (12:10 +0000)]
Bug 31137: (QA follow-up) Also fix new template page

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31137: Only display label printer profiles when editing labels
Adolfo Rodríguez [Tue, 12 Jul 2022 07:20:45 +0000 (09:20 +0200)]
Bug 31137: Only display label printer profiles when editing labels

This patch filters the printer profiles in the label edition template so you may only choose Printer Profiles created for Labels.

To test
1 Create a new Printer Profile in Patron Cards
2 Edit a Label template, pick the Printer Profile you just created.
3 Save the Label Template. You get an error 500
4 apply patch, restart services
5 Edit a Label template and check that you can't pick the Printer Profile you created in Patron Cards

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31146: Fix unclosed table element
Lucas Gass [Thu, 14 Jul 2022 15:30:09 +0000 (15:30 +0000)]
Bug 31146: Fix unclosed table element

To test:
1) Install another language and enable it in the OPACLanguages system preference
2) Also make sure opaclanguagesdisplay is set to Allow
3) Make sure OpacLangSelectorMode is set to display the switch in the footer (either top and bottom or footer only)
4) Turn on recalls
   4.1) In Administration > Global system preferences, enable UseRecalls
   4.2) Add recalls permissions in your circulation rules
5) In the OPAC, log in as a patron
6) Find a record with checked out items and place a recall
7) Go to your account
--> Note that the language switch is at the bottom left of the screen
8) Click on any tab in the patron's account
--> Note that the language switch is at the bottom left of the screen
9) Click on 'Your recalls history'
--> Note that the language switch is right under the recalls history table
10) Apply patch
11) The changelanguage div should now be properly placed at the bottom of the page.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31134: Mock EdifactLSQ for t/Edifact.t
Martin Renvoize [Thu, 14 Jul 2022 11:05:29 +0000 (12:05 +0100)]
Bug 31134: Mock EdifactLSQ for t/Edifact.t

This patch adds a mock for the EdifactLSQ preference so we can
consistently pass when a database is not available.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31129: Fix debarment count on circulation page
Martin Renvoize [Mon, 4 Jul 2022 12:14:45 +0000 (13:14 +0100)]
Bug 31129: Fix debarment count on circulation page

This patch was split from bug 23681 where QA identified the issue.

This patch fixes the debarment count displayed on the circulation page
tabs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 25449: (QA follow-up) Set items.itype to mandatory by default (UNIMARC)
Katrin Fischer [Sun, 12 Jun 2022 12:32:37 +0000 (12:32 +0000)]
Bug 25449: (QA follow-up) Set items.itype to mandatory by default (UNIMARC)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 25449: Set items.itype mandatory by default
Jonathan Druart [Tue, 26 May 2020 10:08:23 +0000 (12:08 +0200)]
Bug 25449: Set items.itype mandatory by default

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31139: Fix basic_workflow.t
Jonathan Druart [Tue, 12 Jul 2022 09:30:55 +0000 (11:30 +0200)]
Bug 31139: Fix basic_workflow.t

Error while executing command: element not interactable: Element <input id="tag_952_subfield_w_810691" class="input_marceditor items.replacementpricedate noEnterSubmit flatpickr-input" name="items.replacementpricedate" type="hidden"> is not reachable by keyboard at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Not sure if it's coming from bug 30717 or not. git bisect told me it was the culprit but we released 22.05 and it seems that we got basic_workflow.t green since then.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Fix permissions problem
Tomas Cohen Arazi [Wed, 13 Jul 2022 22:09:39 +0000 (19:09 -0300)]
Bug 28854: Fix permissions problem

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Compiled CSS
Tomas Cohen Arazi [Wed, 13 Jul 2022 19:48:17 +0000 (16:48 -0300)]
Bug 28854: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: DBRev 22.06.00.016
Tomas Cohen Arazi [Wed, 13 Jul 2022 19:22:21 +0000 (16:22 -0300)]
Bug 28854: DBRev 22.06.00.016

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Replace unique constraint in return claims
Martin Renvoize [Wed, 13 Jul 2022 17:11:34 +0000 (18:11 +0100)]
Bug 28854: (follow-up) Replace unique constraint in return claims

This patch fixes the failing test for the return claims api.  We add a
new unique constraint to replace the one we removed earlier in the
patchset. One should not be able to create a duplicate return claim for
the same issue of an item.

Test plan
1) Run the database update
2) Confirm that t/db_dependent/api/v1/return_claims.t now passes
3) Confirm that t/db_dependent/api/v1/items.t continues to pass
4) Bonus points, confirm that bundle checkin still works when items are
   missing

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: DBRev 22.06.00.015
Tomas Cohen Arazi [Wed, 13 Jul 2022 15:21:05 +0000 (12:21 -0300)]
Bug 28854: DBRev 22.06.00.015

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: DBIC update
Tomas Cohen Arazi [Wed, 13 Jul 2022 13:34:23 +0000 (10:34 -0300)]
Bug 28854: DBIC update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (QA follow-up) Fix DB revision for AV's above 10
Martin Renvoize [Mon, 11 Jul 2022 15:18:25 +0000 (16:18 +0100)]
Bug 28854: (QA follow-up) Fix DB revision for AV's above 10

The authorised_value field is a varchar and so 'MAX' will sort '9' above
'10' and cause issues if you have more than 9 AV values already for LOST
or NOT_LOAN.

This patch adds a 'CAST' to the field so we can use MAX correctly.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (QA follow-up) Remove duplicate key test
Martin Renvoize [Mon, 11 Jul 2022 15:08:05 +0000 (16:08 +0100)]
Bug 28854: (QA follow-up) Remove duplicate key test

We now allow duplication of issue_id accross the return claims table (to
allow for the case where a bundle item has been loaned and thus multiple
claims can result from the same checkout.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (QA follow-up)
Kyle Hall [Mon, 11 Jul 2022 12:31:34 +0000 (08:31 -0400)]
Bug 28854: (QA follow-up)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Remove fields from from bundle items
Martin Renvoize [Fri, 1 Jul 2022 11:43:12 +0000 (12:43 +0100)]
Bug 28854: (follow-up) Remove fields from from bundle items

This patch removes the itemtype and collection code fields from the
bundle items table.

We will add the itemtype back in at a later date with a new bug as the
display code needs some careful consideration and we felt that doing
that work inline here would be an unrequired blocker.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (QA follow-up) Add missing TT filters
Katrin Fischer [Fri, 1 Jul 2022 11:38:26 +0000 (11:38 +0000)]
Bug 28854: (QA follow-up) Add missing TT filters

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Add handling for part_numbers/names
Martin Renvoize [Mon, 27 Jun 2022 15:36:09 +0000 (16:36 +0100)]
Bug 28854: (follow-up) Add handling for part_numbers/names

This patch adds part number/name handling to the new biblio-format js
include. This will add such details to bundle management tables.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Link to 'In bundle' on OPAC
Martin Renvoize [Mon, 27 Jun 2022 14:26:04 +0000 (15:26 +0100)]
Bug 28854: (follow-up) Link to 'In bundle' on OPAC

This patch adds the 'In bundle: Link' to the OPAC to mirror what we have
on the staff client.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Restore block styling on bundled span
Martin Renvoize [Mon, 27 Jun 2022 14:00:50 +0000 (15:00 +0100)]
Bug 28854: (follow-up) Restore block styling on bundled span

This patch restores a css rule that we lost during rebases that makes
the 'bundled' span that appears for bundled items on their respective
details pages so that the 'In bundle: ' text in the status field of the
table appears beneath the 'Not for loan (Added to bundle)' text.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Make 'Manage bundle' button a 'toggle'
Martin Renvoize [Mon, 27 Jun 2022 13:54:42 +0000 (14:54 +0100)]
Bug 28854: (follow-up) Make 'Manage bundle' button a 'toggle'

This patch adds and removes the 'active' class to the 'Manage bundle'
button such that it correctly reflects whether the manage area is
expanded or not for the bundle item.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Add bundle item status to manage button
Martin Renvoize [Mon, 27 Jun 2022 13:47:03 +0000 (14:47 +0100)]
Bug 28854: (follow-up) Add bundle item status to manage button

This patch adds the item counts (Present|Lost) to the 'Manage bundle'
button in the catalogue details page.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Restore last seen date formatting
Martin Renvoize [Mon, 27 Jun 2022 13:31:04 +0000 (14:31 +0100)]
Bug 28854: (follow-up) Restore last seen date formatting

We lost the date formatting somewhere along the line with rebases, this
patch restores the call to $date for last seen date.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Link bundle items to thier biblios
Martin Renvoize [Mon, 27 Jun 2022 10:54:49 +0000 (11:54 +0100)]
Bug 28854: (follow-up) Link bundle items to thier biblios

This patch splits out the title formatting from the bundle item title
display into it's own new js-biblio-format include file and adds biblio
linking options.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Disable bundle editing for checked out
Martin Renvoize [Mon, 27 Jun 2022 09:15:16 +0000 (10:15 +0100)]
Bug 28854: (follow-up) Disable bundle editing for checked out

This patch disables the add and remove options under bundle management
when the bundled item in question is checked out.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Use barcodedecode in Koha::REST::V1::Items
Martin Renvoize [Fri, 24 Jun 2022 15:55:25 +0000 (16:55 +0100)]
Bug 28854: (follow-up) Use barcodedecode in Koha::REST::V1::Items

This removes any leading or trailing whitespace from the external id
passed

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Improve error for item not found
Martin Renvoize [Fri, 24 Jun 2022 15:50:53 +0000 (16:50 +0100)]
Bug 28854: (follow-up) Improve error for item not found

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Fix typo in templates and test plan
Katrin Fischer [Fri, 24 Jun 2022 13:55:54 +0000 (13:55 +0000)]
Bug 28854: (follow-up) Fix typo in templates and test plan

* aready > already
* 61 > 62

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Move preferences to "Item bundles"
Martin Renvoize [Mon, 20 Jun 2022 10:44:07 +0000 (11:44 +0100)]
Bug 28854: (follow-up) Move preferences to "Item bundles"

Move the preferences into a section under 'Circulation' called 'Item
bundles'

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Rename column configuration to barcode
Martin Renvoize [Mon, 20 Jun 2022 10:30:38 +0000 (11:30 +0100)]
Bug 28854: (follow-up) Rename column configuration to barcode

This patch updates the column configuration from 'external_id' to
'barcode'

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Translations fixes
Martin Renvoize [Mon, 20 Jun 2022 10:14:53 +0000 (11:14 +0100)]
Bug 28854: (follow-up) Translations fixes

This patch wraps and unwraps strings appropriately for trasnlation.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Add default AV and Syspref values
Martin Renvoize [Mon, 20 Jun 2022 09:18:08 +0000 (10:18 +0100)]
Bug 28854: Add default AV and Syspref values

This patch adds the new AV and System Preferences to the installer.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Unit tests - chargelostitem
Martin Renvoize [Mon, 20 Jun 2022 09:06:37 +0000 (10:06 +0100)]
Bug 28854: Unit tests - chargelostitem

This patch adds unit tests for the changes to chargelositem to ensure
bundle charging works as expected setting the correct issue_id.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Unit test for AddReturn addition
Martin Renvoize [Fri, 17 Jun 2022 14:01:04 +0000 (15:01 +0100)]
Bug 28854: Unit test for AddReturn addition

This patch adds tests for the AddReturn change that adds an 'InBundle' message
to the return.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Unit test for Koha::Item additions
Martin Renvoize [Fri, 17 Jun 2022 12:08:46 +0000 (13:08 +0100)]
Bug 28854: Unit test for Koha::Item additions

This patch adds unit tests for the new methods added to Koha::Item
including:

* return_claim
* return_claims
* is_bundle
* in_bundle
* bundle_host
* bundle_items
* add_to_bundle
* remove_from_bundle

Test plan
1) Run t/db_dependent/Koha/Item.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Use Koha::Item->itemtype introduced with bug 20469
Martin Renvoize [Fri, 17 Jun 2022 11:24:09 +0000 (12:24 +0100)]
Bug 28854: (follow-up) Use Koha::Item->itemtype introduced with bug 20469

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (QA follow-up) Fix QA tool complaints
Katrin Fischer [Fri, 17 Jun 2022 09:28:27 +0000 (09:28 +0000)]
Bug 28854: (QA follow-up) Fix QA tool complaints

* Typo in code comment
* Permissions on atomicupdate
* Missing TT filter in template
* Spelling in template

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Make barcode comparison case insensative
Martin Renvoize [Wed, 15 Dec 2021 11:15:42 +0000 (11:15 +0000)]
Bug 28854: Make barcode comparison case insensative

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: (follow-up) Only count rows in the body
Martin Renvoize [Tue, 14 Dec 2021 16:47:54 +0000 (16:47 +0000)]
Bug 28854: (follow-up) Only count rows in the body

This patch fixes the count to only include table rows in the body, i.e.
skip the header row.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Add modal after checkin to print missing items list
Martin Renvoize [Tue, 30 Nov 2021 14:34:48 +0000 (14:34 +0000)]
Bug 28854: Add modal after checkin to print missing items list

This patch adds a further modal to the post checkin alert to allow the
user to print a view and print a list of items that went missing at this
checkin to allow for replacements to be picked.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Add 'Remove from bundle' dialogue to details display
Martin Renvoize [Tue, 30 Nov 2021 09:35:46 +0000 (09:35 +0000)]
Bug 28854: Add 'Remove from bundle' dialogue to details display

This patch adds the counterpart of the 'Add to bundle' modal prompt for
adding items to bundles from the catalogue details display.  It allows
for scanning barcodes to remove them from a bundle.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Add count of scanned items to verification modal
Martin Renvoize [Fri, 26 Nov 2021 10:21:08 +0000 (10:21 +0000)]
Bug 28854: Add count of scanned items to verification modal

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Highlight when a scanned item is unexpected
Martin Renvoize [Thu, 25 Nov 2021 17:54:08 +0000 (17:54 +0000)]
Bug 28854: Highlight when a scanned item is unexpected

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Enable claims return view when BundleLostValue is set
Martin Renvoize [Thu, 25 Nov 2021 14:28:03 +0000 (14:28 +0000)]
Bug 28854: Enable claims return view when BundleLostValue is set

This patch adds the alternation of BundleLostValue to enable the return
claims functionality when Bundles are enbled.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Improve lost details display for bundle items
Martin Renvoize [Thu, 25 Nov 2021 12:10:57 +0000 (12:10 +0000)]
Bug 28854: Improve lost details display for bundle items

This patch adds the return claim details to the bundle item status
display on the catalogue details page.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Add ordering to checkin validation modal
Martin Renvoize [Wed, 24 Nov 2021 10:16:53 +0000 (10:16 +0000)]
Bug 28854: Add ordering to checkin validation modal

This enhancement adds simple dataTable ordering to the verification
modal table at bundle checkin time.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Add option to print content list after verification
Martin Renvoize [Fri, 19 Nov 2021 15:11:26 +0000 (15:11 +0000)]
Bug 28854: Add option to print content list after verification

We already allowed the user to view and print an updated content list
after a varification showed that items were missing from the bundle.
This patch adds the option to view and print the list even if the
content has been varified to have not changed.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Simplified status handling for bundle inventory check
Martin Renvoize [Thu, 18 Nov 2021 15:17:03 +0000 (15:17 +0000)]
Bug 28854: Simplified status handling for bundle inventory check

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Record and display who lost the item
Martin Renvoize [Thu, 23 Sep 2021 12:58:50 +0000 (13:58 +0100)]
Bug 28854: Record and display who lost the item

This patch records the bundle issue from which an item is marked as lost
so that we may use that to infer who lost the item (for later charges
and display).

Test plan
0) Apply all patches up to this point
1) Checkout a bundle to a user
2) Checkin the bundle and do not scan one of the barcodes at
   confirmation
   * Note that the item not scanned is marked as lost
3) Navigate to the biblio for the lost item and note that it is marked
   as lost.
4) Navigate to the biblio for the collection and expand the collection
   item that contains the lost item. Note the item is marked as lost and
   checkout details are listed.
5) Checkin the lost item
   * The item should be marked as found and the return_claims line should
   be marked as resolved.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Drop unique index on issue_id in return claims
Martin Renvoize [Thu, 18 Nov 2021 15:04:38 +0000 (15:04 +0000)]
Bug 28854: Drop unique index on issue_id in return claims

With the introduction of circulating items within a bundle set, we can
now loose multiple items from the bundle from the same issue.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Highlight bundle rows to clarify UI
Martin Renvoize [Thu, 30 Sep 2021 07:44:22 +0000 (08:44 +0100)]
Bug 28854: Highlight bundle rows to clarify UI

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Update circulation functionality for bundles
Martin Renvoize [Thu, 23 Sep 2021 10:37:52 +0000 (11:37 +0100)]
Bug 28854: Update circulation functionality for bundles

This patch updates the circulation system to account for bundle
checkins. We add a content verification step to ensure bundle content is
all present at checkin and we use this comparison to mark missing items
as lost.

Test plan
0) Apply patches up to this point
1) Checkin an item that belongs to a bundle
   * An alert should be triggered noting that the item belongs to a
     bundle
   * The option to remove the item from the bundle should be clear
   * Click remove should result in the alert dissapearing and the item
     having been removed from the bundle.
2) Checkin an item bundle
   * A modal confirmation dialog should appear requesting each item
     barcode be scanned
   * As items are scanned they should be highlighted in yellow in the
     bundle content table
   * Upon submission;
     * The user will be alerted to any unexpected items that were
       scanned and told to put them to one side.
     * The user will be alerted that any missing items in the validation
       will have been marked as lost.
     * The bundle item will be marked as checked in.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Expose functionality to attach items to bundles
Martin Renvoize [Thu, 23 Sep 2021 09:01:23 +0000 (10:01 +0100)]
Bug 28854: Expose functionality to attach items to bundles

This patch adds methods the the Koha::Item object for managing item
bundling operations and then exposes those methods via the REST API.

We include the new `BundleNotLoanValue` preference for setting not
for loan values when an item is added to a bundle.

Finally, we expose bundle management via the catalogue details page.

Test plan:
0) Apply patches up to this point and run the database update
1) Configuration: `BundleNotLoanValue` should have been set by the
   database update and point to a newly added AV value.
2) Creating a new bundle
   * Add a new bib record
   * Mark the bib record as a 'collection' type by setting leader
     position 7 to 'c'
   * Add a new item to this bib record
   * You should see a new 'Manage bundle' button available in the
     'Actions' column of the Holdings table.
   * Clicking 'Manage bundle' should expand the table to include a new
     row directly beneath this one.
   * Use the new 'Add to bundle' button that appears in this row to
     trigger a modal that allows entering the barcode of items you wish
     to add to the bundle
   * Upon closing the modal, the bundle content table should reload and
     contain your newly associated items.
   * You can subsequently remove an item from a bundle using the new
     'Remove' button.
3) Not for loan
   * Items that have been added into a bundle should now appear as 'Not
     for loan' from their original biblio record and note which bundle
     they belong to.
4) Error cases
   * Try adding an item that already belongs to a bundle to another
     bundle: Note an error is displayed in the modal form.
5) The bundles feature can be disabled by unsetting the
   `BundleNotLoanValue` system preference.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 28854: Database update
Martin Renvoize [Thu, 23 Sep 2021 07:28:15 +0000 (08:28 +0100)]
Bug 28854: Database update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31145: Supply defaults for vendors and funds
Nick Clemens [Tue, 12 Jul 2022 18:52:21 +0000 (18:52 +0000)]
Bug 31145: Supply defaults for vendors and funds

This is a convenience bug - when koha testing docker creates sample vendors and budgets there are small issues:

1 - The vendor website gets a random string - you can't edit the vendor without removing this
2 - The funds have random values for statistical categories, and you get empty dropdowns when choosing a fund in ordering

To test:
1 - Apply patch
2 - Restart all
3 - Edit 'My vendor'
4 - note webstie is empty and you can save without changing anythign
5 - Add order to basket for my vendor
6 - Confirm that when selecting a fund statistic 1 and statistic 2 remain as text input fields

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31141: Remove 'select_column' from waiting_holds.inc
Martin Renvoize [Tue, 12 Jul 2022 10:22:36 +0000 (11:22 +0100)]
Bug 31141: Remove 'select_column' from waiting_holds.inc

In the only place we use the waiting_holds include, we were hard coded
to always pass the 'select_column' variable as true.

We can simply and clarify the logic by just removing this superflous
variable.

Test plan
1. Confirm that the waiting holds tables continue to display as expected

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31133: Don't generate values for more than one FK
Jonathan Druart [Tue, 12 Jul 2022 07:11:12 +0000 (09:11 +0200)]
Bug 31133: Don't generate values for more than one FK

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31104: Add a selenium test
Jonathan Druart [Tue, 12 Jul 2022 08:25:25 +0000 (10:25 +0200)]
Bug 31104: Add a selenium test

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31140: (QA follow-up) Remove leftover POD
Jonathan Druart [Tue, 12 Jul 2022 13:44:25 +0000 (10:44 -0300)]
Bug 31140: (QA follow-up) Remove leftover POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 31140: TestBuilder.t is failing on item groups modules
Kyle Hall [Tue, 12 Jul 2022 10:12:26 +0000 (06:12 -0400)]
Bug 31140: TestBuilder.t is failing on item groups modules

Test Plan:
1) prove t/db_dependent/TestBuilder.t
2) Note failures
3) Apply this patch
4) prove t/db_dependent/TestBuilder.t
5) Note all tests pass!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 21978: Fix Selenium tests
Jonathan Druart [Tue, 12 Jul 2022 08:42:39 +0000 (10:42 +0200)]
Bug 21978: Fix Selenium tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22 months agoBug 30275: (QA follow-up) Trivial fix to schema file
Tomas Cohen Arazi [Tue, 12 Jul 2022 02:36:56 +0000 (23:36 -0300)]
Bug 30275: (QA follow-up) Trivial fix to schema file

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>