]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 31313: (QA follow-up) Show transfer status correctly if item in transit
Joonas Kylmälä [Tue, 23 Aug 2022 19:51:32 +0000 (19:51 +0000)]
Bug 31313: (QA follow-up) Show transfer status correctly if item in transit

The patch "Bug 31313: Fix availability - OPAC
opac-detail" (70cb4e22c07) caused the OPAC detail page only show
"Available" status even when the item was in transit.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: (QA follow-up) Show status "On hold" correctly if there are waiting holds
Joonas Kylmälä [Tue, 23 Aug 2022 19:51:17 +0000 (19:51 +0000)]
Bug 31313: (QA follow-up) Show status "On hold" correctly if there are waiting holds

The patch "Bug 31313: Fix availability - OPAC
opac-detail" (70cb4e22c07) cause the OPAC detail page only show
"Available" status even when there were waiting holds.

The onhold item field is removed at the same go as it was confusing
and unused since "Bug 2655: Fixes availabilty counts if items are on
hold shelf. Patch (2/2)" (a37545eb1)

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31387: Fix othernames required label
Lucas Gass [Wed, 17 Aug 2022 17:09:44 +0000 (17:09 +0000)]
Bug 31387: Fix othernames required label

1. Mark othernames as required via PatronSelfRegistrationBorrowerMandatoryField
2. Go to the self-reg form, the field is required but the span that makes it look required stays hidden. (<div class="required_label required">Required</div>)
3. Mark initials as required via PatronSelfRegistrationBorrowerMandatoryField.
4. Now the label_required field appears for othernames in the self ref form
5. Apply patch
6. Try again, the label should now properly show when othernames is marked as required

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31348: Make koha-plack stop gracefully
David Cook [Fri, 12 Aug 2022 02:27:52 +0000 (02:27 +0000)]
Bug 31348: Make koha-plack stop gracefully

0. Apply patch
1. cp /usr/sbin/koha-plack /usr/sbin/koha-plack.bak
2. cp debian/scripts/koha-plack /usr/sbin/koha-plack
3. Now at roughly the same time do the following two actions:
    3a. Go to http://localhost:8081/cgi-bin/koha/about.pl
    3b. koha-plack --stop kohadev
4. Note that the HTTP request completes
5. Click on "Home"
6. Note that the error is "Service Unavailable" rather than "Proxy Error",
which would've occurred with an interrupted HTTP request/response

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31388: Add select2 to fund selection in new order form
Fridolin Somers [Wed, 17 Aug 2022 21:18:46 +0000 (11:18 -1000)]
Bug 31388: Add select2 to fund selection in new order form

In new order form, when you have a lot of funds,
would be useful to have autocompletion in funds combobox.

Test plan :
1) Create an activ and an inactiv budget with at least one fund
2) Create a new order 'From a new (empty) record'
3) Check you see autocompletion in 'Fund' combobox
4) Click on 'Show inactive'
5) Check you see inactiv funds in combobox

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 6936: Allow multiple itemtypes for bib record export
David Cook [Mon, 8 Aug 2022 02:23:57 +0000 (02:23 +0000)]
Bug 6936: Allow multiple itemtypes for bib record export

This patch allows multiple item types to be chosen when exporting
bib records from the Tools module.

Test plan:
0. Apply patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/tools/export.pl
2. Select "All" for "Item type" and note 435 bibs are exported
3. Select "Books" and note 360 bibs are exported
4. Select "Books" and "Visual Materials" and note 380 bibs are exported

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31390: Remove noisy warns in C4::Templates
David Cook [Thu, 18 Aug 2022 01:14:03 +0000 (01:14 +0000)]
Bug 31390: Remove noisy warns in C4::Templates

This patch removes two noisy warnings from C4::Templates

0) Apply patch and koha-plack --restart kohadev
1) Go to http://localhost:8081/
2) Note no warnings in /var/log/koha/kohadev/plack-intranet-error.log
3) Go to http://localhost:8080/
3) Note no warnings in /var/log/koha/kohadev/plack-opac-error.log

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31377: Add internal note column to booksellers.tt
Lucas Gass [Tue, 16 Aug 2022 22:25:07 +0000 (22:25 +0000)]
Bug 31377: Add internal note column to booksellers.tt

To test:
-Apply patch
-Add some vendors and give them an internal note
-Go to /cgi-bin/koha/acqui/booksellers.pl
-Notice that there is a column which includes the internal note

Signed-off-by: Andrew Fuerste-Henry <andrewfh@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31321: Remove GetItemsInfo from catalogue/detail.pl
Jonathan Druart [Fri, 3 Dec 2021 15:43:06 +0000 (16:43 +0100)]
Bug 31321: Remove GetItemsInfo from catalogue/detail.pl

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with catalogue/detail

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
JK: Amend follow-up fixes from Joubu to this patch

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29955: Fix method import issues
Tomas Cohen Arazi [Mon, 22 Aug 2022 16:06:14 +0000 (13:06 -0300)]
Bug 29955: Fix method import issues

This patch fixes this:

$ prove t/db_dependent/Utils/Datatables_Virtualshelves.t
t/db_dependent/Utils/Datatables_Virtualshelves.t .. 2/13 Use of inherited AUTOLOAD for non-method Koha::Virtualshelf::haspermission() is no longer allowed at /kohadevbox/koha/Koha/Virtualshelf.pm line 248.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31355: Add paging = false to items table on opac-reserve
Nick Clemens [Fri, 12 Aug 2022 15:51:13 +0000 (15:51 +0000)]
Bug 31355: Add paging = false to items table on opac-reserve

Moving to an ajax datatable and paging would be a future fix, this restores
lost functionality

To test:
1 - Find or create a title with 20 items
2 - Place a hold in opac
3 - Attempt to select a specific item
4 - Note only 10 show
5 - Apply patch
6 - All items show

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29939: Use the REST API for ratings
Jonathan Druart [Tue, 16 Aug 2022 10:14:06 +0000 (12:14 +0200)]
Bug 29939: Use the REST API for ratings

This patch replaces opac-ratings-ajax.pl with a new REST API route
POST /public/biblios/42/ratings

Note that we could go further and refactor the 'start_rating' select
code.

Test plan:
Test the "star ratings" feature at the OPAC, on the different page
where it's displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31425: Minor correction to patron categories admin title
Owen Leonard [Fri, 19 Aug 2022 18:00:37 +0000 (18:00 +0000)]
Bug 31425: Minor correction to patron categories admin title

This patch corrects the patron categories administration template so
that an extra angle bracket isn't included in the page title on the main
view.

To test, apply the patch and go to Administration -> Patron categories.
The page title should read:

Patron categories › Administration › Koha

...with no extra "›" at the beginning.

Check that other views (new, edit, delete) are unaffected.

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>
2 years agoBug 31352: Change 'Borrower name' to 'Patron name'
Alex Buckley [Tue, 16 Aug 2022 01:10:43 +0000 (13:10 +1200)]
Bug 31352: Change 'Borrower name' to 'Patron name'

Test plan:
1. Go to Tools > Patron card creator > New > Card batch
2. Enter a borrowernumber and click 'Add patron(s)'
3. Observe a table with the leftmost column name 'Borrower name' loads
4. Apply patch
5. Refresh page
6. Observe the leftmost column name is 'Patron name'

Sponsored-by: Catalyst IT, New Zealand
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>
2 years agoBug 30718: (follow-up) index_records is called more times than we thought
Tomas Cohen Arazi [Mon, 22 Aug 2022 14:19:27 +0000 (11:19 -0300)]
Bug 30718: (follow-up) index_records is called more times than we thought

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31076: Handle year limits with equal sign or colon
Nick Clemens [Fri, 1 Jul 2022 11:08:57 +0000 (11:08 +0000)]
Bug 31076: Handle year limits with equal sign or colon

To test:
1 - Enable ES and index
2 - Set expandedSearchOption to 'show'
3 - Advanced search on staff and opac using Year field on staff and Publication date range on OPAC for:
    2005
    2005-
    -2005
    <2005
    >2005
    2005-2010
4 - Confirm ranges don't work on staff side, but do on opac
5 - Apply patch
6 - Repeat searches - they work on both staff and opac
7 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31017: DBRev 22.06.00.036
Tomas Cohen Arazi [Fri, 19 Aug 2022 19:26:23 +0000 (16:26 -0300)]
Bug 31017: DBRev 22.06.00.036

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31017: DBIC update
Tomas Cohen Arazi [Fri, 19 Aug 2022 19:22:13 +0000 (16:22 -0300)]
Bug 31017: DBIC update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31017: (follow-up) Add type field to api
Nick Clemens [Wed, 10 Aug 2022 17:24:51 +0000 (17:24 +0000)]
Bug 31017: (follow-up) Add type field to api

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31017: Update field name to 'type'
Nick Clemens [Tue, 9 Aug 2022 19:17:14 +0000 (19:17 +0000)]
Bug 31017: Update field name to 'type'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31017: Add new vendor_type field to edit screen and display
Nick Clemens [Thu, 23 Jun 2022 10:58:31 +0000 (10:58 +0000)]
Bug 31017: Add new vendor_type field to edit screen and display

This patch adds a new vendor_type field when creating/editing vendors
and displays the field on search and details for a vendor

To test:
 1 - Apply patch, update database
 2 - Edit/create a vendor in acquisitions
 3 - Note new 'Vendor type' field, free text in editor
 4 - Save a value
 5 - Confirm it displays in vendor search results and vendor main page
 6 - In Authorised values add a new value to 'VENDOR_TYPE' category
 7 - Confirm the description of VENDOR_TYPE shows and makes sense
 8 - Add/Edit a vendor, note the vendor type is now a dropdown selection
 9 - Save with a value
10 - Confirm the description shows in results and vendor page and vendor details

Signed-off-by: Caroline <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: KIT Library Germany <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31017: DB Updates
Nick Clemens [Thu, 23 Jun 2022 10:57:31 +0000 (10:57 +0000)]
Bug 31017: DB Updates

Signed-off-by: KIT Library Germany <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28327: (follow-up) Comma as default CSV delimiter
Fridolin Somers [Fri, 24 Jun 2022 07:38:11 +0000 (21:38 -1000)]
Bug 28327: (follow-up) Comma as default CSV delimiter

Looks like most of existing code wants comma as default value.

Also impact installer/data/mysql/mandatory/sysprefs.sql.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28327: Unify CSV delimiter special behavior for tabulation
Fridolin Somers [Wed, 12 May 2021 10:00:31 +0000 (12:00 +0200)]
Bug 28327: Unify CSV delimiter special behavior for tabulation

System preference 'CSVdelimiter' has a special case for tabulation.
Preference value contains string 'tabulation' but string '\t' must be used in CSV file.

This is OK in many places, for exemple Bug 17590.

This patch adds C4::Context->csv_delimiter to add a uniq metod dealing
with this behavior.
Also create Koha::Template::Plugin::Koha->CSVDelimiter for calls from
Toolkit Templates.

Test plan :
1) Set system preference 'CSVdelimiter' = 'tabs'.
2) Create CSV export in impacted pages
3) Check columns are separated by tabulation character and not string 'tabulation'
4) Check with another delimiter

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28327: Add unit tests
Fridolin Somers [Tue, 22 Mar 2022 07:48:50 +0000 (21:48 -1000)]
Bug 28327: Add unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29955: (QA follow-up) Tidy code block
Tomas Cohen Arazi [Fri, 19 Aug 2022 18:51:21 +0000 (15:51 -0300)]
Bug 29955: (QA follow-up) Tidy code block

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29955: Move populate_order_with_prices to Koha namespace
Julian Maurice [Wed, 26 Jan 2022 14:58:26 +0000 (15:58 +0100)]
Bug 29955: Move populate_order_with_prices to Koha namespace

and split the subroutine into 2 smaller subroutines (one for ordering,
the other for receiving)

Test plan:
1. Create a vendor and an acquisition basket
2. In this basket, create new orders using all the different methods
   (from an existing record, from a suggestion, from a new record, ...)
   then close the basket and receive these orders.
   Make sure it works the same with and without the patch
3. Run tests in t/Prices.t,
   t/db_dependent/Acquisition/populate_order_with_prices.t, and
   t/db_dependent/Budgets.t

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30218: Add subfield g to field 150 in C4::Heading::MARC21 mappings
Thomas Klausner [Thu, 3 Mar 2022 14:39:20 +0000 (15:39 +0100)]
Bug 30218: Add subfield g to field 150 in C4::Heading::MARC21 mappings

When creating authorities via SRU or linking exising authorities
(via cgi-bin/koha/authorities/auth_finder.pl) the search results are
generated using the hardcoded mappings $bib_heading_fields /
$auth_heading_field from C4::Heading::MARC21. For TOPIC_TERM / field 150
these mappings currently include the subfield `abvxyz68`.

But: We are using the GND provided by Deutsche Nationalbibliothek.
We imported some authorities from there, for example:

http://d-nb.info/gnd/4114171-4 "Kind <0-3 Jahre>" (kid 0-3 years)
http://d-nb.info/gnd/4196417-2 "Kind <0-4 Jahre>" (kid 0-4 years)

When searching for these terms, Koha only displays "Kind", which is not
very helpful, as there are a lot of different authorities for different
age bands.

GND stores "Kind" in 150a, and "0-3 Jahre" in 150g.

But in the hardcoded mappings used by Koha, subfield g is not included.

This patch adds subfield g to these mappings, thus making it possible to
easily select the correct authority.

Test plan:
* Create an authority (or edit an existing one) and set 150g to "foo"
* Create a new biblio (or edit an existing one), go to field 650 and click
  on the search-icon on the right.
* A popup should open, where you can search for "Authority type: TOPIC_TERM",
  enter the name of the authority (150a!) in the search box
* In the resulting list, you will only see the value of 150a.
* Apply the patch
* Search again, now you should see "foo" in the result list

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31385: (follow-up) Add code based URL on the staff CMS view
Marcel de Rooy [Thu, 18 Aug 2022 08:44:44 +0000 (08:44 +0000)]
Bug 31385: (follow-up) Add code based URL on the staff CMS view

Test plan:
Create a page with contents in two languages.
Verify that the Default URL shows the default content and the
Current language URL shows content based on active language.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31385: (follow-up) Same change at intranet side
Marcel de Rooy [Thu, 18 Aug 2022 07:29:35 +0000 (07:29 +0000)]
Bug 31385: (follow-up) Same change at intranet side

Test plan:
Try at staff side: tools/page.pl?code=CODE

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31385: Allow searching a CMS page by code
Marcel de Rooy [Wed, 17 Aug 2022 13:41:53 +0000 (13:41 +0000)]
Bug 31385: Allow searching a CMS page by code

Test plan:
Add a CMS page with two languages for it.
Look at the code column in the DB.
Try opac/opac-page.pl?code=[CODE]&lang=[LANG]. Test leaving lang
empty and passing various languages.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I squashed the lang => language patch

2 years agoBug 31343: Prevent two nodes #holdscr on waiting reserves
Jonathan Druart [Fri, 12 Aug 2022 13:19:10 +0000 (15:19 +0200)]
Bug 31343: Prevent two nodes #holdscr on waiting reserves

Two nodes with id="holdscr" existed on this patch. I guess the table
was not initiated properly before 31138 neither.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31343: (bug 31138 follow-up) Don't hide error
Jonathan Druart [Fri, 12 Aug 2022 13:17:45 +0000 (15:17 +0200)]
Bug 31343: (bug 31138 follow-up) Don't hide error

Some errors are not passing settings and so the error is hidden

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30941: (QA follow-up) Only export what is needed
Tomas Cohen Arazi [Fri, 19 Aug 2022 14:00:42 +0000 (11:00 -0300)]
Bug 30941: (QA follow-up) Only export what is needed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix imports
Tomas Cohen Arazi [Fri, 19 Aug 2022 13:12:06 +0000 (10:12 -0300)]
Bug 30718: Fix imports

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31395: Only try to cancel holds if item found
Tomas Cohen Arazi [Thu, 18 Aug 2022 17:00:54 +0000 (14:00 -0300)]
Bug 31395: Only try to cancel holds if item found

This patch makes the code dealing with waiting holds with cancellation
requests be dependent on the fact an item has been found.

The returns.pl controller is a bit messy as the real return takes place
outside the main `if ($item)` block. This should be refactored and
probably run inside a transaction...

In the meantime this patch will make the job.

To test:
1. Try to return an invalid barcode (e.g. ASDQWE)
=> FAIL: Things explode
2. Apply this patch
3. Repeat 1
=> SUCCESS: Doesn't explode!
4. Verify that returning an item with a waiting hold with cancellation
   requests still cancells the hold.
=> SUCCESS: It does!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31282: Fix broken characters in patron_emailer.pl verbose mode
Tomas Cohen Arazi [Tue, 2 Aug 2022 12:24:57 +0000 (09:24 -0300)]
Bug 31282: Fix broken characters in patron_emailer.pl verbose mode

To test:
1. Have a report containing:
   SELECT tomascohen@theke.io;
2. Have a members notice containing ¡ and other non-ASCII characters.
3. Run (changing the report number and notice code accordingly):
   $ kshell
  k$ perl misc/cronjobs/patron_emailer.pl --report 4 \
           --notice BIRTHDAY --from tomascohen@theke.io --module members
=> FAIL: non-ASCII characters are broken
4. Apply this patch
5. Repeat 3
=> SUCCESS: Things print correctly!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30941: (QA follow-up) Import methods explicitly
Tomas Cohen Arazi [Fri, 19 Aug 2022 12:06:57 +0000 (09:06 -0300)]
Bug 30941: (QA follow-up) Import methods explicitly

By explicitly importing the Koha::I18N methods, I get rid of this error:

kohadev-koha@kohadevbox:/kohadevbox/koha$ qa -c 2 --run-tests
testing 2 commit(s) (applied to 9b2bf04 '09 Bug 30507: Value builder for field')

Processing files before patches
|========================>| 12 / 12 (100.00%)

An error occurred : Inconsistent hierarchy during C3 merge of class 'Koha::I18N':
current merge results [
Koha::I18N,
]
merging failed on 'Exporter' at /kohadevbox/qa-test-tools/koha-qa.pl line 112.

This happens because the Koha::I18N library is exporting all its methods
explicitly and, by design, the __ methods used in value builders cannot
determine which of the imported methods to use i.e. if Koha::I118N::__
or Koha::CodeList::Unimarc::MediumOfPerformance:__

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30941: (QA follow-up) Add exec flag to scripts
Kyle M Hall [Fri, 19 Aug 2022 11:22:17 +0000 (11:22 +0000)]
Bug 30941: (QA follow-up) Add exec flag to scripts

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30941: Add cataloguing plugins for 146$bcdef (UNIMARC)
Julian Maurice [Wed, 19 Jan 2022 15:09:28 +0000 (16:09 +0100)]
Bug 30941: Add cataloguing plugins for 146$bcdef (UNIMARC)

Test plan:
1. Configure the default MARC framework to use those value builders:
   - unimarc_field_146b for 146$b
   - unimarc_field_146c for 146$c
   - unimarc_field_146d for 146$d
   - unimarc_field_146e for 146$e
   - unimarc_field_146f for 146$f
2. Verify that they all work correctly according to
https://www.ifla.org/files/assets/uca/unimarc_updates/BIBLIOGRAPHIC/u-b_146.pdf

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30507: Value builder for field 183
jeremy breuillard [Fri, 4 Mar 2022 13:16:33 +0000 (14:16 +0100)]
Bug 30507: Value builder for field 183

This patch provides values builders for the subfields $a and $2. Those are unimarc official codes who help to
identify the kind of items
Test plan:
1)Go to Home > Cataloging > New record
2)Section 1 - field 183 : it contains subfields $a & $2
3)Inputs are writable but notice that no plugins are suggested
4)Apply patch and repeat 1) to 3)
5)Values builders plugins are available for $a and $2

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30506: Value builder for field 182
jeremy breuillard [Fri, 4 Mar 2022 13:16:33 +0000 (14:16 +0100)]
Bug 30506: Value builder for field 182

This patch provides values builders for the subfields $a, $c and $2. Those are unimarc official codes who help to
identify the kind of items
Test plan:
1)Go to Home > Cataloging > New record
2)Section 1 - field 182 : it contains subfields $a, $c & $2
3)Inputs are writable but notice that no plugins are suggested
4)Apply patch and repeat 1) to 3)
5)Values builders plugins are available for $a, $c and $2

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30504: Value builder for field 181
jeremy breuillard [Thu, 3 Mar 2022 09:32:04 +0000 (10:32 +0100)]
Bug 30504: Value builder for field 181

This patch provides values builders for the subfields $a, $b, $c and $2. Those are unimarc official codes who help to identify the kind of items

Test plan:
1)Go to Home > Cataloging > New record
2)Section 1 - field 181 : it contains subfields $a, $b, $c & $2
3)Inputs are writable but notice that no plugins are suggested
4)Apply patch and repeat 1) to 3)
5)Values builders plugins are available for $a, $b, $c and $2

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: (QA follow-up) Remove double use KohaDates
Marcel de Rooy [Fri, 19 Aug 2022 09:37:40 +0000 (09:37 +0000)]
Bug 30718: (QA follow-up) Remove double use KohaDates

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: (QA follow-up) KohaDates filter on inputs
Marcel de Rooy [Fri, 19 Aug 2022 09:04:49 +0000 (09:04 +0000)]
Bug 30718: (QA follow-up) KohaDates filter on inputs

Found another one on a visible input. Replaced with html filter.
koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt:                                            <input type="text" class="enrolmentperioddate" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />

But we also have a few hidden ones. First verified that cleanborrowers did not work anymore with expirydate.
Fixed it with passing iso dateformat to resolve.
intranet-tmpl/prog/en/modules/acqui/parcels.tt:            <input type="hidden" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" />
intranet-tmpl/prog/en/modules/serials/subscription-add.tt:                                          <input type="hidden" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt:                                    <input type="hidden" name="new_hard_due_date" value="[% new_hard_due_date | $KohaDates %]" />
intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:            <input type="hidden" name="not_borrowed_since" value="[% not_borrowed_since | $KohaDates %]" />
intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:            <input type="hidden" name="last_issue_date" value="[% last_issue_date | $KohaDates %]" />
intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:            <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry | $KohaDates %]" />
intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:                <input type="hidden" name="borrower_lastseen" value="[% borrower_lastseen | $KohaDates %]" />

Test plan:
Try cleanborrowers with expiry date.
cd koha-tmpl; git grep "<input.*\$KohaDates" | grep -v iso

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: (QA follow-up) Apply prevent duplication on OPAC too
Marcel de Rooy [Fri, 19 Aug 2022 08:35:14 +0000 (08:35 +0000)]
Bug 30718: (QA follow-up) Apply prevent duplication on OPAC too

See former intranet side patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix serial claims filters
Jonathan Druart [Wed, 10 Aug 2022 08:28:32 +0000 (10:28 +0200)]
Bug 30718: Fix serial claims filters

https://bugs.koha-community.org/show_bug.cgi?id=30718
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix renewal with due date
Jonathan Druart [Tue, 9 Aug 2022 06:41:37 +0000 (08:41 +0200)]
Bug 30718: Fix renewal with due date

This was a test added by the following commit:

commit 99eccc18ed4a21fa416a3d61fed3f70825dc2203
Date:   Thu Jun 16 10:10:09 2011 +0100
    Bug 5549 : Handle datetimes on return

It's no longer needed now, we can pass a DateTime or an ISO-formatted
date

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix dates display at the OPAC
Jonathan Druart [Fri, 5 Aug 2022 09:13:30 +0000 (11:13 +0200)]
Bug 30718: Fix dates display at the OPAC

Found dateofbirth so far, do we have others?

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Apply flatpickr changes to OPAC
Jonathan Druart [Fri, 5 Aug 2022 09:10:42 +0000 (11:10 +0200)]
Bug 30718: Apply flatpickr changes to OPAC

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Prevent 'reset' icon to appear twice
Jonathan Druart [Tue, 19 Jul 2022 12:33:24 +0000 (14:33 +0200)]
Bug 30718: Prevent 'reset' icon to appear twice

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix time display
Jonathan Druart [Tue, 19 Jul 2022 12:23:10 +0000 (14:23 +0200)]
Bug 30718: Fix time display

Especifically when timeformat=12h

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix scheduler
Jonathan Druart [Mon, 18 Jul 2022 13:27:22 +0000 (15:27 +0200)]
Bug 30718: Fix scheduler

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix holidays
Jonathan Druart [Mon, 18 Jul 2022 13:13:17 +0000 (15:13 +0200)]
Bug 30718: Fix holidays

Template process failed: undef error - The given date (07/18/2022) does not match the date format (iso)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Add missing USE KohaDates
Jonathan Druart [Mon, 18 Jul 2022 13:10:59 +0000 (15:10 +0200)]
Bug 30718: Add missing USE KohaDates

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix serials/showpredictionpattern.pl
Jonathan Druart [Mon, 18 Jul 2022 13:10:02 +0000 (15:10 +0200)]
Bug 30718: Fix serials/showpredictionpattern.pl

Can't locate object method "ymd" via package "2022-02-01" (perhaps you forgot to load "2022-02-01"?) at /kohadevbox/koha/serials/showpredictionpattern.pl line 100
eval {...} at /kohadevbox/koha/serials/showpredictionpattern.pl line 2

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Fix today's date on overdue
Jonathan Druart [Mon, 18 Jul 2022 13:09:42 +0000 (15:09 +0200)]
Bug 30718: Fix today's date on overdue

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Pass DT to filter_by_lates
Jonathan Druart [Thu, 14 Jul 2022 13:24:19 +0000 (15:24 +0200)]
Bug 30718: Pass DT to filter_by_lates

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30718: Use flatpickr's altInput
Jonathan Druart [Mon, 11 Jul 2022 14:14:38 +0000 (16:14 +0200)]
Bug 30718: Use flatpickr's altInput

The idea rely on the KohaDates TT plugin for the date formatting. We
should not have any output_pref calls in pl or pm (there are some
exceptions, for ILSDI for instance).

Also flatpickr will deal with the places where dates are inputed. We
will pass the raw SQL value (what we call 'iso' in Koha::DateUtils), and
the controller will receive the same value, no need to additional
conversion.
Note that DBIC has the capability to auto-deflate DateTime objects,
which makes things way easier. We can either pass the value we receive
from the controller, or pass a DT object to our methods.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30779: Remove _update_import_record_marc and update tests
Nick Clemens [Wed, 17 Aug 2022 11:56:37 +0000 (11:56 +0000)]
Bug 30779: Remove _update_import_record_marc and update tests

This patch removes the now unused: _update_import_record_marc

Additionally, as items are already present in import biblio we no longer need to embed
them, so that parameter is removed and the option removed from the sub and pod and everywhere
it was used

In all cases, we were embedding, so we don't need a way to get without

Tests updated

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30779: Do not update import marc after importing items
Nick Clemens [Mon, 16 May 2022 19:57:23 +0000 (19:57 +0000)]
Bug 30779: Do not update import marc after importing items

We are stripping the marc item tags at import - we save them when not importing items, but
strip when importing items

I think we can save on writes by leaving them in the record. This also allows comparison to what was staged
versus items created

To test:
 1 - Stage a marc record with items, but do not look for items
 2 - Confirm the item tags remain in staged marc
 3 - Import the record
 4 - Confirm items are nto in imported marc record
 5 - Stage the record again, but look for items
 6 - Confirm the item tags are stipped from imported record
 7 - Import and confirm imported record has no item tags
 8 - Apply patch and repeat 1-5
 9 - Confirm item tags remain in record
10 - Import and confirm item tags not in imported marc

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30684: (follow-up) Use log_warning_msg for the "not running" warning
Alex Buckley [Wed, 17 Aug 2022 13:50:01 +0000 (13:50 +0000)]
Bug 30684: (follow-up) Use log_warning_msg for the "not running" warning

Also, return 0 rather than return 1 in else clause of koha-zebra

Sponsored-by: Catalyst IT, New Zealand
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30684: When a service isn't running koha-* scripts --restart should start it
Alex Buckley [Tue, 7 Jun 2022 05:42:20 +0000 (05:42 +0000)]
Bug 30684: When a service isn't running koha-* scripts --restart should start it

Test plan:
1. Stop plack, indexer, sip, worker, z3950 and zebra.

Note: To test Z39.50 restarting you will need to setup the server: https://wiki.koha-community.org/wiki/Setting_up_the_Z39.50_and_SRU_Server#Setting_up_the_Z39.50_and_SRU_Server

2. Run restart command for each service:
- [Plack] sudo koha-plack --restart {instance}
- [Indexer] sudo koha-indexer --restart {instance}
- [SIP] sudo koha-sip --restart {instance}
- [Worker] sudo koha-worker --restart {instance}
- [z3950] sudo koha-z3950-responder --restart {instance}
- [Zebra] sudo koha-zebra --restart {instance}

3. Observe the services do not get restarted.
Instead you get an error saying the service is not running

4. Apply patch

5. If you are using kohadevbox you must copy koha-* scripts to /usr/sbin/:
sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack
sudo cp debian/scripts/koha-indexer /usr/sbin/koha-indexer
sudo cp debian/scripts/koha-sip /usr/sbin/koha-sip
sudo cp debian/scripts/koha-worker /usr/sbin/koha-worker
sudo cp debian/scripts/koha-z3950-responder /usr/sbin/koha-z3950-responder
sudo cp debian/scripts/koha-zebra /usr/sbin/koha-zebra

6. Repeat step 2

7. This time confirm that each service is restarted

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images
Alex Buckley [Tue, 26 Jul 2022 04:38:29 +0000 (16:38 +1200)]
Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images

This is because opac-detail.tt has coce-coverimg as an ID, but OPAC
coce.js targets coce-coverimg as a class.

opac-detail.tt should be changed to have coce-coverimg as a class.

Test plan:
1. Set your system preferences:
- CoceHost = https://coce.mykoha.co.nz
- CoceProviders = Select all
- OpacCoce = Enable

2. Add the ISBN of '9780262336499' to a biblio

3. Open a "Incognito" window in your browser (recommended to use Google
Chrome to test this)

4. View the biblio detail page in the OPAC. Observe a 'Coce image from
Amazon' box loads with a spinner

5. Apply patch and restart services

6. Clear your browser cache

7. Reload the same biblio detail page in the OPAC. Observe no image is
displayed.

8. View another OPAC biblio detail page that does have a successfully
loading coce image and confirm the source of that image is listed: For
example 'Coce image from Amazon.com' is displayed

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28854: (follow-up) Remove errant warning
Martin Renvoize [Thu, 18 Aug 2022 08:44:03 +0000 (09:44 +0100)]
Bug 28854: (follow-up) Remove errant warning

Oops, I left in a bare warn from debugging.. this simply removes it; it
is unrequired.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31382: Pass password_has_expired param to templte
Nick Clemens [Wed, 17 Aug 2022 11:09:14 +0000 (11:09 +0000)]
Bug 31382: Pass password_has_expired param to templte

This patch restores the param, while still leaving the check against invalid
login credentials to ensure we don't leak information.

To test:
 1 - enable  EnableExpiredPasswordReset
 2 - Edit a patron to set password to expire in the past
 3 - Attempt opac login as patron
 4 - It fails, but you are redirected to login screen with no info
 5 - Apply patch
 6 - Attempt login
 7 - You are notified password expired and given reset link
 8 - Go back to login screen
 9 - Login with correct username,, wrong password
10 - You are notified of incorrect credentials, not password expiration

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31382: Regression tests
Tomas Cohen Arazi [Wed, 17 Aug 2022 18:40:07 +0000 (15:40 -0300)]
Bug 31382: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31222: Reduce query size for batchMod
Nick Clemens [Fri, 22 Jul 2022 14:47:36 +0000 (14:47 +0000)]
Bug 31222: Reduce query size for batchMod

The object search is currently:
Koha::Items->search({ barcode => \@contentlist }

Which generate code like:
barcode = 1 OR barcode = 2 OR barcode = 3 ....

This can get quite large

We can reduce the query size by using -in:
Koha::Items->search({ barcode => { -in => \@contentlist } }

Which generates code like:
barcode in ( 1, 2, 3 )

To test:
1 - Apply patch
2 - Perform batch modifications
3 - Confirm nothing has changed

Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29782: Fix handling records without title or content
Marcel de Rooy [Tue, 16 Aug 2022 12:02:13 +0000 (12:02 +0000)]
Bug 29782: Fix handling records without title or content

Test plan:
Save a new record with only a title in the non-default tab (english).
Check if you see it on the list. Edit.
Save a new record without title but only content in non-default lang.
Check if you see it.
Do the same 2 edits on the default tab only. Verify too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: Fix C4::ILSDI::Services::AuthenticatePatron
Tomas Cohen Arazi [Wed, 17 Aug 2022 13:33:07 +0000 (10:33 -0300)]
Bug 27342: Fix C4::ILSDI::Services::AuthenticatePatron

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel...
Alex Buckley [Wed, 10 Aug 2022 15:32:24 +0000 (15:32 +0000)]
Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel image

This is because the intranet detail.tt has coce-coverimg as an ID.
Intranet results.tt has coce-coverimg as a class. Intranet coce.js
targets coce-coverimg as a class.

Intranet detail.tt should be changed to have coce-coverimg as a class.
This is inline with the change made to the OPAC in bug 31217

Test plan:
1. Set your system preferences:
- CoceHost = https://coce.mykoha.co.nz
- CoceProviders = Select all
- IntranetCoce = Enable

2. Add the ISBN of '9780262336499' to a biblio

3. Open a "Incognito" window in your browser (recommended to use Google
Chrome to test this)

4. View the biblio detail page in the intranet. Observe a 'Coce image
from Amazon' box loads with a spinner

5. Apply patch and restart services

6. Clear your browser cache

7. Reload the same biblio detail page in the intranet. Observe no image
is displayed.

8. Do an intranet search to get the biblio returned in search results
page. Confirm no cover image box is displayed

9. View the intranet search result and detail pages for a different
biblio that you know Coce should be displaying the cover image of and
confirm that it is correctly displayed with the source of that image
listed: For example 'Coce image from Amazon.com' is displayed

Sponsored-by: Catalyst IT, New Zealand
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 19540: Tell the patron why a hold cannot be placed on items
Jonathan Druart [Thu, 7 Jan 2021 12:44:33 +0000 (13:44 +0100)]
Bug 19540: Tell the patron why a hold cannot be placed on items

This patch adds an explanation when a hold cannot be placed, in some situation:
tooManyReserves
tooManyHoldsForThisRecord
tooManyReservesToday
itemAlreadyOnHold

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26632: Remove two more occurrences
Nick Clemens [Mon, 16 May 2022 19:37:59 +0000 (19:37 +0000)]
Bug 26632: Remove two more occurrences

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26632: (Bug 22532 follow-up) Remove random variables
Nick Clemens [Mon, 16 May 2022 19:32:03 +0000 (19:32 +0000)]
Bug 26632: (Bug 22532 follow-up) Remove random variables

AddBiblioToBatch and AddAuthToBatch were btoh passing a random number for the
parameter $update_counts

This simply removes that value as should have been done on 22532

To test:
1 - Stage a marc file
2 - Confirm it works befor and after patch

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23202: Fix screen freeze when ordereing several items
Johanna Raisa [Tue, 26 Jul 2022 09:01:56 +0000 (12:01 +0300)]
Bug 23202: Fix screen freeze when ordereing several items

This patch fixes adding multiple items on order acquisitions

The error is: Uncaught TypeError: $(...).parent(...).attr(...) is undefined

Test plan:
1) Set dateaccessioned.pl plugin to ACQ framework's 952$d field.
2) Create basket to a vendor and add order from a new empty record.
3) Add date acquired value from calendar.
4) Add multiple items and see that the view freezes.
5) Apply the patch
6) Reload the page and repeat the steps 3 and 4.
7) See that the items are added.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD Amended patch: adjust commit title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: Fix holds_count and priority
Jonathan Druart [Wed, 17 Aug 2022 08:16:26 +0000 (10:16 +0200)]
Bug 31313: Fix holds_count and priority

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15326: (follow-up) Fix staff permissions and consider library limits
Aleisha Amohia [Mon, 15 Aug 2022 05:31:57 +0000 (17:31 +1200)]
Bug 15326: (follow-up) Fix staff permissions and consider library limits

To test:
1. Take note of what your logged in library is
2. Add a new page that can be viewed on the OPAC and staff interface.
Limit the library to a different library, not your logged in library
3. Use a News item to create a hyperlink to your new page on the OPAC
and staff interface.
4. Confirm that a page error shows if you try to view the new page.
5. Edit the new page and set the library to All libraries.
6. Try to go to the new page again and confirm it shows.
7. Log out and log back into the staff interface as a staff user that
isn't a superlibrarian
8. Confirm you can view the new page as this user

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15326: (follow-up) Hide RSS feed if no news items
Aleisha Amohia [Tue, 2 Aug 2022 00:40:04 +0000 (12:40 +1200)]
Bug 15326: (follow-up) Hide RSS feed if no news items

If there are pages but no news items showing on the OPAC, the RSS feed container
should not show.

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15326: Using AdditionalContents for custom pages on OPAC
Aleisha Amohia [Fri, 17 Dec 2021 02:06:51 +0000 (02:06 +0000)]
Bug 15326: Using AdditionalContents for custom pages on OPAC

This page utilises the Additional Contents feature to add custom pages
to the staff client and the OPAC in the user's desired language.

To test:
1. Apply patch and restart services
2. In the staff client, go to Tools, then go to the new 'Pages' page
3. Add a new page to display on both the staff client and OPAC.
4. Confirm the URLs in the Page URL column work as expected.
5. Confirm that any pages made for the staff client only do not show in
the OPAC, and that any pages made for the OPAC only do not show in the
staff client.
6. Confirm that pages do not show on the OPAC main page where news items
show. Confirm news items show on the OPAC main page as expected.

Sponsored-by: Chartered Accountants Australia and New Zealand
Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Lisette Scheer <lisettePalouse+Koha@gmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31294: Show "Required" label on mandatory fields
David Cook [Thu, 11 Aug 2022 05:40:45 +0000 (05:40 +0000)]
Bug 31294: Show "Required" label on mandatory fields

This patch adds "Required" label on mandatory fields for Article Requests

0. Apply the patch
1. koha-plack --restart kohadev
2. Change syspref 'ArticleRequests' to 'Enable'
3. Change syspref 'ArticleRequestsMandatoryFields' to '[Select all]'
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
5. Click "Request article" for "Gairm"
6. Note that "Title", "Author", "Volume", "Issue", "Date", "Pages", and
   "Chapters" all say required
7. Change syspref 'ArticleRequestsMandatoryFields' to 'Title' and
   'Author'
8. Go to http://localhost:8080/cgi-bin/koha/opac-request-article.pl?biblionumber=29
9. Note that only "Title" and "Author" say required

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: (QA follow-up) Fix test
Tomas Cohen Arazi [Tue, 16 Aug 2022 13:50:47 +0000 (10:50 -0300)]
Bug 27342: (QA follow-up) Fix test

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: (QA follow-up) Remove dbh from new tests
Martin Renvoize [Wed, 10 Aug 2022 07:12:53 +0000 (08:12 +0100)]
Bug 27342: (QA follow-up) Remove dbh from new tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: Remove dbh from C4::Auth
Jonathan Druart [Tue, 5 Jan 2021 10:28:16 +0000 (11:28 +0100)]
Bug 27342: Remove dbh from C4::Auth

We must not pass $dbh but retrieve it when needed instead

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27342: Improve test for OPAC
Jonathan Druart [Tue, 5 Jan 2021 10:18:26 +0000 (11:18 +0100)]
Bug 27342: Improve test for OPAC

We don't need to build allowed_scripts_for_private_opac for staff

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30901: Add Unit Tests
Kyle Hall [Wed, 29 Jun 2022 19:01:38 +0000 (15:01 -0400)]
Bug 30901: Add Unit Tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30901: Add POD for Koha::Template::Plugin::CirculationRules
Kyle M Hall [Fri, 3 Jun 2022 17:34:53 +0000 (13:34 -0400)]
Bug 30901: Add POD for Koha::Template::Plugin::CirculationRules

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30901: Add Renewals method to CirculationRules template plugin
Kyle M Hall [Fri, 3 Jun 2022 17:14:06 +0000 (13:14 -0400)]
Bug 30901: Add Renewals method to CirculationRules template plugin

It would be useful to be able to report renewals used/remaining in some notices and slips.

Test Plan:
1) Apply this patch
2) Add the following to the RENEWAL notices:
--
[% USE CirculationRules %]
[% SET renewals = CirculationRules.Renewals( borrower.id, item.id ) %]
You have used [% renewals.count %] of [% renewals.allowed %], you have [% renewals.remaining %] renewals left.
--
3) Trigger a renewal notice
4) Verify the text is correct!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31312: Remove GetItemsInfo from misc/migration_tools/rebuild_zebra.pl
Jonathan Druart [Thu, 2 Jun 2022 09:38:02 +0000 (11:38 +0200)]
Bug 31312: Remove GetItemsInfo from misc/migration_tools/rebuild_zebra.pl

Hum... Item2Marc ok here?

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search.

Here we are going to deal with misc/migration_tools/rebuild_zebra.pl

Test plan:
I am not sure, what do we want to test here? Items' info indexed
correctly?

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30922: Make the "Relative's checkouts" table configurable by the table settings
Shi Yao Wang [Wed, 6 Jul 2022 14:47:03 +0000 (10:47 -0400)]
Bug 30922: Make the "Relative's checkouts" table configurable by the table settings

Adds "relatives-issues-table" in table settings.

Test plan:
1- Apply the patch
2- Check out an item to a patron with a guarantor
3- Go to the guarantor's "details" and "check out" page > relatives'
checkouts and look at the different columns (you should see collection
and location)
4- Go to
    admin > table settings > patron > moremember > relatives-issues-table
 or
    admin > table settings > circulation > circulation >
relatives-issues-table
to hide some columns (e.g. collection and location) and click save
5- Do step 3 again and notice some columns (e.g. collection and location) are hidden
6- Also notice the "Columns" and "Export" buttons that should work as
intended

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29673: Allow English sql localization script
Marcel de Rooy [Thu, 9 Dec 2021 15:07:18 +0000 (16:07 +0100)]
Bug 29673: Allow English sql localization script

Test plan:
You might want to add a simple SQL statement to your English
custom.sql in order to verify the execution.
Run a Koha install (in English).
Check if the data shows your custom sql action.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) _ vs __
Tomas Cohen Arazi [Tue, 16 Aug 2022 13:19:56 +0000 (10:19 -0300)]
Bug 29723: (QA follow-up) _ vs __

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) Ensure ID's match Module names
Martin Renvoize [Wed, 10 Aug 2022 13:52:53 +0000 (14:52 +0100)]
Bug 29723: (QA follow-up) Ensure ID's match Module names

There was a disparity between module codes and how it was used to
construct ID's for various elements.. this patch updates ID's to match
codes for circulation and illrequests.

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) Correct scroll to table
Martin Renvoize [Wed, 10 Aug 2022 11:14:35 +0000 (12:14 +0100)]
Bug 29723: (QA follow-up) Correct scroll to table

This patch enabled scrolling directly to the correct table configuration when clicking the 'Configure this table'
button from any KohaTable/kohaTable table in Koha.

Test plan
1. Navigate to Administration > Cities
2. Click 'Configure this table'
3. Confirm the result is the table settings page and you are scrolled to
   the cities table configuration

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) Switch to using ID's on column settings
Martin Renvoize [Wed, 10 Aug 2022 10:27:18 +0000 (11:27 +0100)]
Bug 29723: (QA follow-up) Switch to using ID's on column settings

This patch updates the column settings page to use ID's instead of
Indexes to restor the open accordian card after a setting change.

Test plan
1 Go to Administration -> Table settings.
2 All panels should be collapsed.
3 Test expanding and collapsing panels to confirm it's working
  correctly.
4 Make a change to one of the table configurations. After clicking
  "Save" the page should reload with the same panel expanded.

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: (QA follow-up) Make button text translatable
Martin Renvoize [Wed, 10 Aug 2022 07:36:18 +0000 (08:36 +0100)]
Bug 29723: (QA follow-up) Make button text translatable

This patch makes the button text translatable. Whilst we're here I also added a wrench icon,
set the title attribute and added a class.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29723: Add a "Configure table" button for KohaTable tables
Jonathan Druart [Fri, 17 Dec 2021 09:19:35 +0000 (10:19 +0100)]
Bug 29723: Add a "Configure table" button for KohaTable tables

This patch suggests to have a "Configure table" button when a table can
be configured in the "Table settings" administraition area.

Test plan:
Go to different views where the table can be configured (you an
exhaustive list on bug 29648), notice the "Configure table" button (if
you have the 'manage_column_config' subpermission.

Note that the link is correct but the scrollbar is not adjusted at the
correct position. Maybe we could improve that switching to the bootstrap
accordion plugin?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31313: Unit tests
Tomas Cohen Arazi [Tue, 16 Aug 2022 13:10:03 +0000 (10:10 -0300)]
Bug 31313: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31318: Remove GetItemsInfo from serials/routing-preview
Jonathan Druart [Fri, 3 Jun 2022 06:26:41 +0000 (08:26 +0200)]
Bug 31318: Remove GetItemsInfo from serials/routing-preview

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with serials/routing-preview

Test plan:
List items on the modified view and confirm that all the info is
displayed correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31314: (QA follow-up) Prefetch and make routines use result objects
Nick Clemens [Fri, 12 Aug 2022 15:33:45 +0000 (15:33 +0000)]
Bug 31314: (QA follow-up) Prefetch and make routines use result objects

This reduces lookups for the related items that we now fetch in the templates

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31314: (QA follow-up) Search Koha::Items not $biblio->items
Nick Clemens [Fri, 12 Aug 2022 15:04:30 +0000 (15:04 +0000)]
Bug 31314: (QA follow-up) Search Koha::Items not $biblio->items

To get the host items we need to search all items, not those limited to the
same biblionumber

To test:
1 - Enable EasyAnalytics
2 - Attach an item to a record
3 - Confirm it is listed in the items list on opac reserve

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>