]> git.koha-community.org Git - koha.git/log
koha.git
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>
(cherry picked from commit a11633379f8d9f6a933da7fa887b2e7966e3765a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 7b645b0208182520d91ff370b6a4e5b79549d2e0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 381b79593e2a86c4d856242a1f6e955d95ae1f24)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit a2e9b440742bb3e207d1906d3c478b936eb277f2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 9afbe872b7e63ce1d88cf6896df3b1046529212b)

2 years agoRevert "Bug 29012: Add default values for blank circulation rules that weren't saved...
Lucas Gass [Thu, 13 Oct 2022 17:31:41 +0000 (17:31 +0000)]
Revert "Bug 29012: Add default values for blank circulation rules that weren't saved to the database"

This reverts commit 387900a65c7cafcf28ad0da415e4136ffa7e0443.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoRevert "Bug 29012: (QA follow-up) Use q{} instead of '' in smart-rules.pl"
Lucas Gass [Thu, 13 Oct 2022 17:31:03 +0000 (17:31 +0000)]
Revert "Bug 29012: (QA follow-up) Use q{} instead of '' in smart-rules.pl"

This reverts commit 294ed32d06101b57f07838910165f75b039e5dea.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoRevert "Bug 29012: DBRev 22.05.05.001"
Lucas Gass [Thu, 13 Oct 2022 17:29:54 +0000 (17:29 +0000)]
Revert "Bug 29012: DBRev 22.05.05.001"

This reverts commit 2256a16b9b1ff51a2c7ccf9453d9c4b7a03f6630.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31473: Fix fragile test about bad OpacHiddenItems conf
Tomas Cohen Arazi [Fri, 26 Aug 2022 19:45:10 +0000 (16:45 -0300)]
Bug 31473: Fix fragile test about bad OpacHiddenItems conf

There's been a behavior change in recent MariaDB that made some cases
deal with truncated data in DOUBLE context instead of DECIMAL.

Probably this:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-27380

This made the affected test fail consistently on those versions.

This trick for checking OpacHiddenItems is correct (as introduced on bug
28125 doesn't really make use of the warning, just prints it in
about.pl) so one option was to just check for a warning.

I decided to keep the test, but add the optional DECIMAL|DOUBLE check on
the qr. This way other eventual changes will make it fail and serve as a
warning in case something more relevant changes.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3a5fb22ad88790673d6d8fbc483f6e219f25f33d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit b02b66acf5ddac1af00215fbcc1d842777b67c3b)

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>
(cherry picked from commit b1ec071866de33ef0eb37cc74b62c8ed77d6afad)

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>
(cherry picked from commit cbe50d798a42b65d4439d30df6bbf2ab6623bbcd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 218419ce2c2502bcad0f8285173b4493d7e9e8fc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 217e953ffb81cbac7f57521d3c0c7568995bb11d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 7343e404b7b486c52a150613f308e452f4f5da05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 89e65657b106570b717dede6476a6d6f65511b67)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit daef044b6f876ea2555c4520e6c91319d2760d25)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 01985605434b7b78cb8f234f8ea66e0a16b3f8c5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 089f5a4cf5c0ec2ae68aef9d5f3aaef47e19ad5c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 66c5ab528cf9ed8afa23dd6f14ddf890ef1e9039)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 5c1db538e6c25da27484e39ae619e09779aac1c2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31302: Fix spelling in sample_notices.yml
Alex Buckley [Tue, 9 Aug 2022 07:26:07 +0000 (07:26 +0000)]
Bug 31302: Fix spelling in sample_notices.yml

Test plan:
1. Apply patch
2. Confirm 'URL(s)', rather than urls(s), is in the line:
You can download the scanned materials via the following URL(s)

Sponsored-by: Catalyst IT, New Zealand
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>
(cherry picked from commit b3d8941c34887b34c69edac8f33b7de179d96267)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31276: Report results are limited to 999,999 no matter the actual number of results
Kyle Hall [Mon, 1 Aug 2022 14:47:04 +0000 (10:47 -0400)]
Bug 31276: Report results are limited to 999,999 no matter the actual number of results

In Koha, any report that uses C4::Reports::Guided will be limited to 999,999 rows. This is causing problems for larger libraries where some reports may have over a million results.

Test Plan:
1) Create a report "SELECT * FROM borrowers" and run it, note the number
   of results
2) Apply this patch
3) Add the line `<report_results_limit>3</report_results_limit>`
   within the <config> block of your koha-conf.xml
4) Restart all the things!
5) Run the report, download the results as a CSV
6) Note your CSV only has 4 lines, the header and 3 patrons

Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5e29433bdc3a5ccd582ece6e2338c6e38e97c5d9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31325: Fix koha-preferences get
Magnus Enger [Tue, 9 Aug 2022 06:49:54 +0000 (06:49 +0000)]
Bug 31325: Fix koha-preferences get

To reproduce:
$ perl koha/misc/admin/koha-preferences get MarcFlavour
This will output something like "HASH(0x55dd4d432840)".

To test:
Apply this patch and run the command again:
$ perl koha/misc/admin/koha-preferences get MarcFlavour
This should output something like "MARC21".

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>
(cherry picked from commit 3f1fe4f178df3423bc95f9a288aaefdda6a6e8c0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31281: Use correct reply-to email when sending overdue mails
Katrin Fischer [Sun, 7 Aug 2022 16:14:37 +0000 (16:14 +0000)]
Bug 31281: Use correct reply-to email when sending overdue mails

Overdue emails are either sent from the issuing or the home
library of an item. We never use the patron's home library,
so the reply-to address must explicitly be set in EnqueueLetter.

To test:
- Set up 2 branches (A and B) with different email addresses.
- Set up an SMTP server for each to use
- Set up an overdue notice trigger for the patron category you'll use
  First letter: 1 day delay, any notice
- Check out an item with home branch B to a patron from A
- Run the the script with:
  overdue_notices.pl -t --frombranch item-homebranch
  overdue_notices.pl -t --frombranch item-issuebranch
- Confirm for each setting that the correct email headers have been
  used. You can see the reply-to address and to-address in the
  message queue:
  SELECT * FROM message_queue;

Signed-off-by: Nason Bimbe <nason.bimbe@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 18b2389de49b5c403f7bd68ef315b044a201eff5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31346: Fix broken Syndetics links on OPAC detail page
Lucas Gass [Thu, 11 Aug 2022 22:56:49 +0000 (22:56 +0000)]
Bug 31346: Fix broken Syndetics links on OPAC detail page

To test:
-Have some Syndetics credentials
-Turn on SyndeticsCoverImages
-Look at some and you'll notice that Syndetics cover images dont always load
-If you view the page source you'll see why. The links are built like this:
https://secure.syndetics.com/index.aspx?isbn=/LC.GIF&amp;amp;client=bedf&amp;type=xw10&amp;upc=843501038123&amp;oclc=1311289389

-Apply patch
-Cover images should load properly.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 10ced3c49485aa5cdfc0cd06cfff30ddb7f9afe7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31245: Do not try to report results if task not started
Tomas Cohen Arazi [Tue, 26 Jul 2022 13:12:05 +0000 (10:12 -0300)]
Bug 31245: Do not try to report results if task not started

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12bc623ae7bcbd03fd4c8505bf1c55010bb3d0f7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31245: Do not call report for job detail view if job not started
Jonathan Druart [Wed, 27 Jul 2022 08:35:08 +0000 (10:35 +0200)]
Bug 31245: Do not call report for job detail view if job not started

We should not generate the report if the job hasn't started yet

Test plan:
Stop the koha-worker processes, modify a new item using the batch mod
tool, then see the detail page of the job

Without this patch an error is generated:
Can't use an undefined value as an ARRAY reference at /kohadevbox/koha/Koha/BackgroundJob/BatchUpdateItem.pm line 175

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 931f4bd79776215b8cb1e656d58abf80b7aad8db)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 29434: add UNIMARC relationship codes for authorities
Andreas Roussos [Mon, 8 Nov 2021 07:19:58 +0000 (08:19 +0100)]
Bug 29434: add UNIMARC relationship codes for authorities

When using the authority finder plugin (authorities/auth_finder.pl),
you can pick an entry from the 'Special relationship:' dropdown menu
in order to set the relationship between authorities.

However, in UNIMARC instances the relationship codes listed are those
for MARC21. The correct codes for UNIMARC are listed in pages 93-94
of the IFLA UNIMARC Manual for Authorities.

Test plan:

1) In a UNIMARC instance, launch authorities/auth_finder.pl in the
   Staff client, by clicking on the 'Tag editor' button. Notice how
   the 'Special relationship:' dropdown menu lists the relationship
   codes for MARC21 instead of UNIMARC.
2) Apply this patch.
3) Launch the authority finder again; this time the correct values
   should be listed in the 'Special relationship:' dropdown menu.

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>
(cherry picked from commit a5dfa2d4901575c93d900f300fe5b5b2d7f178d4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31155: Document --since option in help of borrowers-force-messaging-defaults.pl
Caroline Cyr La Rose [Thu, 14 Jul 2022 14:26:29 +0000 (10:26 -0400)]
Bug 31155: Document --since option in help of borrowers-force-messaging-defaults.pl

This patch adds a section about the --since option in the help section
of borrowers-force-messaging-defaults.pl

To test:
0) Apply patch
1) run the script with the --help option, e.g.
./misc/maintenance/borrowers-force-messaging-defaults.pl --help
--> There should be an explanation of the --since option with examples
    for specific and relative dates
2) Optionally, run the script with different options
--> The behaviour shouldn't have changed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 42b316912097fc11d55d3f8bacc4ade2107b4c7e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31292: Untranslatable string in sample_notices.yaml
Bernardo Gonzalez Kriegel [Fri, 5 Aug 2022 14:34:05 +0000 (11:34 -0300)]
Bug 31292: Untranslatable string in sample_notices.yaml

This patch removes a regex that discard lines in multiline YAML values
On close inspection, there is no need for it.

To test:
1) go to misc translator, update some language
    ./translate update fr-CA

2) check missing string

    egrep "You may pick up your article" po/fr-CA-installer.po

   from sample_notices.yaml

3) apply the patch, repeat 1)

4) repeat 2), verify the string is present in the translation file

5) translate the new string, install the language,
   verify string is present in the translated file
    ./translate install fr-CA

   check fr-CA/mandatory/sample_notices.yml

There are three new strings
msgid "%sDear %s %s,%s"
msgid "%s%s%sTitle: %s"
msgid "%sYou may pick up your article at %s.%sYou can download the scanned materials via the following url(s): %s.%s"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 99790c6c38af93698069f5f493b299a715eabd68)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31289: Hide Article requests column in circulation rules when ArticleRequests...
Caroline Cyr La Rose [Wed, 3 Aug 2022 13:54:27 +0000 (09:54 -0400)]
Bug 31289: Hide Article requests column in circulation rules when ArticleRequests syspref is disabled

This patch hides the Article requests column in the large circulation
rules table when the ArticleRequests system preference is disabled.

To test:
0) Apply patch
1) With ArticleRequests disabled, go to Administration > Circulation and fines
   rules
2) Scroll right in the first table
--> There isn't any mention of article requests in the table
3) Scroll down to see the other tables in the page
--> There are no other article requests tables
4) Enable ArticleRequests in Administration > System preferences
5) Go back to the Circulation and fines rules and refresh the page
6) Scroll right in the first table
--> There should be an article requests yes/no column
7) Scroll down to see the other tables in the page
--> There are other article requests tables, Default open article requests
    limit and Default article request fees

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>
(cherry picked from commit 4b875fa936f1c971e734e71ec7727d780ba9a9af)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31272: Use TT plugins for pickup library and due date in opac-reserve.pl
Katrin Fischer [Sat, 30 Jul 2022 21:35:50 +0000 (23:35 +0200)]
Bug 31272: Use TT plugins for pickup library and due date in opac-reserve.pl

Before this patch the date formatting for the due date was done
in the .pl instead of the template and the branchcode would show
instead of the library's name in the list of items when placing
an item level hold in the OPAC.

To test:
* Find or create a record with mulitple items
* Check out one of the items
* Place a record level hold
* Return an item to set to waiting
* Place an item level hold
* Go to the OPAC and start placing an item level hold
* Verify the messages in the item table show the branchcode
* Apply patch
* Only visible change should be the library name replacing the branchcode

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2353893c1acc45c99f5afbe0bde5dcd049d88660)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31249: Use cronlogaction on update_patrons_category.pl
Tomas Cohen Arazi [Wed, 27 Jul 2022 23:46:03 +0000 (20:46 -0300)]
Bug 31249: Use cronlogaction on update_patrons_category.pl

This patch does what the title says.

To test:
1. Run the script
2. Check the action logs
=> FAIL: Boo, no record of the running cronjob
3. Apply this patch
4. Repeat 1-2
=> SUCCESS: Yay!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <liz@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e4d2ef0f4691058cdb9fdff34a5a555a755f75a2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30992: (follow-up) Fix semicolon at line ending
Katrin Fischer [Sun, 7 Aug 2022 22:11:03 +0000 (22:11 +0000)]
Bug 30992: (follow-up) Fix semicolon at line ending

$itemLoopIter->{reservedate}     = $first_hold->reservedate,
$itemLoopIter->{ExpectedAtLibrary}         = $first_hold->branchcode;

1st line ends with a comma instead of a semicolon.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ddf182192f0706585fc6963992eab11d61c384b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30992: Improve translatability for 'for'
Jonathan Druart [Wed, 13 Jul 2022 06:01:48 +0000 (08:01 +0200)]
Bug 30992: Improve translatability for 'for'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 92f5e02a8c2ee7efaa9478015a860a5f62ee05aa)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30992: Improve translatability for Waiting at|On hold
Jonathan Druart [Wed, 13 Jul 2022 06:01:34 +0000 (08:01 +0200)]
Bug 30992: Improve translatability for Waiting at|On hold

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eedec9e929c641c9dcdb5c002f812ecf034433d4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30879: DBRev 22.05.05.004
Lucas Gass [Thu, 29 Sep 2022 16:51:19 +0000 (16:51 +0000)]
Bug 30879: DBRev 22.05.05.004

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30879: Add option to syspref and update display
Nick Clemens [Wed, 22 Jun 2022 14:55:03 +0000 (14:55 +0000)]
Bug 30879: Add option to syspref and update display

To test:
1 - Update ComponentSortField system preference and verify biblionumber is an option
2 - Repeat test plan from 30327 and confirm sorting with biblionumber works

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 505e12970d81fe30436a6a86189c17c9c242a729)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30879: Handle index/sorting for UNIMARC
Nick Clemens [Wed, 22 Jun 2022 14:49:05 +0000 (14:49 +0000)]
Bug 30879: Handle index/sorting for UNIMARC

Same as before, but test with UNIMARC setup

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fbf1c32a6ff03b29f68f0bee6017fb15ea8b0c1b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30879: Allow biblionumber as sort option in Elasticsearch
Nick Clemens [Wed, 22 Jun 2022 14:42:17 +0000 (14:42 +0000)]
Bug 30879: Allow biblionumber as sort option in Elasticsearch

Repeat previous tests with Elasticsearch engine
You will need to reindex and reset mappings to pickup the changes form the file

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c8c51867c479bc153d84f9e23cad5983bdd535cb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30879: Add biblionumber as a sorting option in MARC21
Nick Clemens [Wed, 22 Jun 2022 14:37:23 +0000 (14:37 +0000)]
Bug 30879: Add biblionumber as a sorting option in MARC21

This patch updates the Local-Number indexing by adding a zeropad option
to Zebra indexing and adding this to the mapping files

It also updates C4/Search.pm to allow biblionumber as an option

To test:
1 - Apply patches
2 - copy etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl to /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
3 - Restart all, reindex zebra
4 - Browse to: http://localhost:8081/cgi-bin/koha/catalogue/search.pl?idx=kw&q=a&sort_by=biblionumber_dsc&count=20
5 - Confirm records sorted correctly
6 - Browse to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?idx=kw&q=a&sort_by=biblionumber_asc&count=20
7 - Confirm records sorted correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 230bae0b02875dc25abe8ba71f6e7217fce80b76)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31274: DBRev 22.05.05.003
Lucas Gass [Thu, 29 Sep 2022 16:11:35 +0000 (16:11 +0000)]
Bug 31274: DBRev 22.05.05.003

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31274: Make sure OPACSuggestionAutoFill is handled as a boolean everywhere
Tomas Cohen Arazi [Mon, 1 Aug 2022 14:38:01 +0000 (11:38 -0300)]
Bug 31274: Make sure OPACSuggestionAutoFill is handled as a boolean everywhere

The YAML preference definition defines it as a string ('yes' or 'no' the
possible values). And the opac-suggestions.tt template has one occurence
of the variable being compared to a string.

This patch does:
- fix the template
- fixes opac.pref for 0|1
- adds an atomicupdate that takes care of moving 'yes' and 'no' to their
  respective boolean values.

To test:
1. Change the syspref value to enable/disable
2. Check on the DB that the value is wrong:
   $ koha-mysql kohadev
   > SELECT value FROM systempreferences WHERE variable='OPACSuggestionAutoFill';
=> FAIL: It is either 'yes' or 'no' depending on what you choose.
3. Apply this patch
4. Run:
   $ updatedatabase
5. Repeat 2
=> SUCCESS: Values are now 0 or 1
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c0b7bf01fabe7dfa558b29a7549c39a6f627c18)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 27849: (follow-up) Add test
Marcel de Rooy [Mon, 1 Aug 2022 07:25:10 +0000 (07:25 +0000)]
Bug 27849: (follow-up) Add test

Compacting the code a bit too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad0aa754ee2a3e8e438594a54b2375b994753951)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 27849: Koha::Token may access undefined C4::Context->userenv
MJ Ray [Wed, 3 Mar 2021 17:54:42 +0000 (17:54 +0000)]
Bug 27849: Koha::Token may access undefined C4::Context->userenv

The _add_default_csrf_params internal function accesses
C4::Context->userenv without checking that it has been defined. I think
not all of the potential callers of it declare that they require a
defined userenv, so we should test and provide defaults for required
values if it is not defined, to avoid some "Can't use an undefined value
as a HASH reference" HTTP 500 Internal Server Errors.

To test:

Do anything that requires a form with CSRF token, such as editing your
details. Behaviour should be unchanged. To test the failure case, you
would need some customised code that indirectly generates a CSRF token
before setting the userenv up and I am not sure there is any in released
Koha yet.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Looks good to me. Working as expected.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8c45fe1aaa54fd9d6ff84617df0bb94b4cfbbb12)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30984: DBIC
Lucas Gass [Thu, 29 Sep 2022 15:39:39 +0000 (15:39 +0000)]
Bug 30984: DBIC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 28864: Have patron card creator use PatronsPerPage
Michael Hafen [Fri, 13 Aug 2021 21:52:52 +0000 (15:52 -0600)]
Bug 28864: Have patron card creator use PatronsPerPage

Add pageLength to members/member.tt
Add aLengthMenu and pageLength to
 patroncards/add_user_search (common/patron_search.tt).
Add aLengthMenu, pageLength, and iDisplayLength to patroncards/edit-batch

Test plan:
1.  Set the PatronsPerPage system preference to any integer other than 20.

2.  Go to Tools -> Patron card creator.
3.  Start a new Card Batch.
4.  Click the 'Add patron(s)' button to open the patron search window.
5.  Do a search.
6.  Add more than 20 patrons to the batch.
7.  Close patron search window.
8.  Click the 'Add patron(s)' button to add the selected patrons to the batch.
9.  Observe that the table of patrons is has 20 as the default per page setting.

10. Apply patch.
11. Reload the batch.
12. Observe that the per page drop down includes the value of PatronsPerPage
     and that value is selected by default.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5ca665f6aaf750fa507875343da0adb423ad7bd8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30984: DBRev 22.05.05.002
Lucas Gass [Thu, 29 Sep 2022 15:29:14 +0000 (15:29 +0000)]
Bug 30984: DBRev 22.05.05.002

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30984: (QA follow-up) Switch from mediumtext to varchar(255)
Kyle Hall [Fri, 29 Jul 2022 10:53:06 +0000 (06:53 -0400)]
Bug 30984: (QA follow-up) Switch from mediumtext to varchar(255)

My research indeicates that tinytext of less than 40 bytes uses
about the same storage as a varchar(255). Also, using
a TEXT field in a complex query may create a temp table.
varchar fields are also more efficient for sorting on.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 526606901626082831ab501609cf05e360551ce1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30984: (QA follow-up) Ternary formatting style
Marcel de Rooy [Fri, 29 Jul 2022 06:39:21 +0000 (06:39 +0000)]
Bug 30984: (QA follow-up) Ternary formatting style

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3a0d75a40cfeec8e14d7092b4cf23763363b45a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30984: Action logs should log the cronjob script name that generated the given log
Kyle Hall [Fri, 17 Jun 2022 10:59:11 +0000 (06:59 -0400)]
Bug 30984: Action logs should log the cronjob script name that generated the given log

When something is changed by a cronjob, and that entity is logged via action logs, we can know what changed, and that it was via a cronjob, but we cannot necessarily know which cronjob made that change. The closest we can come is to find the action logs for the cronjob module which ran before the change which is by no means reliable assuming the CronLog is even enabled.

We should add a new column to action logs to store the name of the script ran for any action logs where the interface is "cron".

Test plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Enable all the Log/Logging sysprefs
4) Run some cronjobs that will generate action logs
5) Note the new action_logs column "script" contains the filename of the
   cronjob that caused the change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 18fd0c89cf7f288ad5ff4527484d9e989ed3e5f7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30468: Restore 'set -e' and remove echos
Jonathan Druart [Mon, 1 Aug 2022 10:31:21 +0000 (12:31 +0200)]
Bug 30468: Restore 'set -e' and remove echos

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4a00658e349fb21a9a334f0ab880d81b8f51d2e3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30468: koha-mysql does not honor Koha's timezone setting
Kyle Hall [Wed, 6 Apr 2022 12:38:00 +0000 (08:38 -0400)]
Bug 30468: koha-mysql does not honor Koha's timezone setting

If I run a query like "SELECT NOW()" from a koha report, I will get a different answer than if I had run it from koha-mysql.
In Koha, we set the timezone for each database connection.
However, koha-mysql does not do this, so instead we are left using the default timezone of the database.

Test Plan:
1) Set your time zone to something other than the database time zone
2) run "SELECT NOW()" using debian/scripts/koha-mysql
   *not* /usr/sbin/koha-mysql
3) Note you get the database timezone's current time
4) Apply this patch
5) Repeat step 2
6) Now you get the correct time!

Signed-off-by: Michal Urban <michalurban177@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e97b099d58e73be44354d2343c0f45077871b398)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31269: Define sDefaultContent for DataTables
Lucas Gass [Fri, 29 Jul 2022 23:41:13 +0000 (23:41 +0000)]
Bug 31269: Define sDefaultContent for DataTables

1. Stage a MARC record for import
2. Once you have one click on 'Manage staged records'
3. You will see an alert that says "Something went wrong when loading the table."
4. If you dismiss that you should see the following error:

DataTables warning: table id=records-table - Requested unknown parameter '' for row 0, column 4. For more information about this error, please see http://datatables.net/tn/4

5. Appy patch
6. Try ssteps 1 & 2 again
7. No DataTable errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 573db0fca181cb36063462ed566adc5bac7f293d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30028: Fix patron message delete confirmation to be translatable
Shi Yao Wang [Fri, 27 May 2022 14:52:08 +0000 (10:52 -0400)]
Bug 30028: Fix patron message delete confirmation to be translatable

Make the message deletion confirmation popup translatable. Test plan
uses fr-CA translations.

Test plan:
1) Switch language to french (fr-CA)
If you do not have the translations, go to
  misc/translator
then do
  ./translate install fr-CA
After it is done, go to administration > global system preference >
l18N/L10N then select Français (fr-CA) under language preference.
Refresh then you should be able to switch languages.
2) Add a message to a patron account from your own branch (or make sure AllowAllMessageDeletion is on)
3) Click "Delete" next to the message
--> a confirmation message appears "Are you sure you want to delete this message? This cannot be undone." with options "Cancel" and "OK".
4) Apply the patch
5) Write a translation in misc/translator/po/fr-CA-messages-js.po :
msgid "Are you sure you want to delete this message? This cannot be undone."
msgstr "Êtes-vous sûr de vouloir supprimer ce message? Cette opération est irréversible."
6) Refresh the translations by going to misc/translator and execute ./translate install fr-CA
7) Refresh and click "Delete" again
--> now the confirmation message is "Êtes-vous sûr de vouloir supprimer ce message? Cette opération est irréversible." with options "Cancel" and "OK"

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>
(cherry picked from commit 622137294a4f1eca66ff794e1a91a75c08fe30c8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30499: Move the include for catalogue-search-box.inc in circ-search.inc to correc...
Tim McMahon [Fri, 29 Jul 2022 18:29:52 +0000 (13:29 -0500)]
Bug 30499: Move the include for catalogue-search-box.inc in circ-search.inc to correct keyboard shortcuts

Keyboard shortcuts for catalog search, check in and renew should be following:
1) Alt-q for catalog search
2) Alt-r for check in
3) Alt-w for renew

However on some of the pages shortcuts get mixed up:

1) Alt-w for catalog search
2) Alt-q for check in
3) Alt-r for renew

Affected files are:
circ/pendingreserves.tt
circ/circulation_batch_checkouts.tt
circ/circulation-home.tt
circ/branchtransfers.tt
circ/branchoverdues.tt
circ/set-library.tt
circ/checkout-notes.tt
circ/renew.tt
circ/waitingreserves.tt
circ/transferstoreceive.tt
circ/offline.tt
circ/bookcount.tt
circ/on-site_checkouts.tt
circ/circulation.tt
circ/transfers_to_send.tt
circ/request-article.tt
circ/overdue.tt
circ/reserveratios.tt
offline_circ/list.tt
offline_circ/process_koc.tt
offline_circ/enqueue_koc.tt
plugins/plugins-upload.tt
plugins/plugins-disabled.tt
pos/registers.tt
pos/register.tt
pos/pay.tt
reports/reports-home.tt
reports/dictionary.tt
reports/guided_reports_start.tt
reserve/request.tt
tools/scheduler.tt

This is because the include statement for catalogue-search-box.inc is in the wrong line in circ-search.inc.

To test:
1) Go to an affected page (circulation-home was the first one I noticed)
2) Try the keyboard shortcuts and notice they are incorrect
3) Apply patch and refresh the page
4) Notice that the keys work properly

Signed-off-by: Andrew <andrewfh@dubcolib.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 94191e5bfe681dca021bb133c9593bc5bc7e2193)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 28707: Translate RECEIPT notice
Bernardo Gonzalez Kriegel [Fri, 6 May 2022 22:27:28 +0000 (19:27 -0300)]
Bug 28707: Translate RECEIPT notice

There is a badly crafted regex used when extracting
strings in multiline fields in yaml files
The regex is my own, introduced in Bug 24262, sorry.

This patch correct it a little. Better eyes are welcome.

To test:
1) go to misc translator, update some language
    ./translate update fr-CA

2) check missing strings

    egrep "Total out|Operator ID|August 31" po/fr-CA-installer.po

   first two are from sample notices, third from sample creator data

3) apply the patch, repeat 1)

4) repeat 2), verify the strings are present in the translation file

5) translate some of the new strings, install the language,
   verify strings are present in the translated files
    ./translate install fr-CA
   check fr-CA/optional/sample_creator_data.yml and
   fr-CA/mandatory/sample_notices.yml

There are some 60+ new strings.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 160d96e176331f8ac8eef4942bcc0af1868017c5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31251: Use jQuery val() to clear_entry
Lucas Gass [Thu, 28 Jul 2022 18:18:15 +0000 (18:18 +0000)]
Bug 31251: Use jQuery val() to clear_entry

1. Add some patron attributes that are textarea and some that have an AV category so they are select dropdowns
2. Go to the patron form and add some values to the patron attributes
3. Use the "Clear" button to try and clear the values, doesnt work.
4. Apply patch
5. Try clearing values from patron attributes that are both select dropdowns and textarea. The "Clear" button should work.

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>
(cherry picked from commit a3198f647496d87e19036432f1be9f87dac4614d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31238: Fix typo in marc_subfields_structure.pl
Emmi Takkinen [Tue, 26 Jul 2022 09:02:16 +0000 (12:02 +0300)]
Bug 31238: Fix typo in marc_subfields_structure.pl

After bug 29001 one is unable to save authorised value to frameworks
subfields. This is caused by minor typo in marc_subfields_structure.pl.

To test:
1. Edit e.g. default frameworks subfield 952$8
2. Add or change fields authorised value
3. Save your changes
=> note that on subfield listing there is no mention that 952$8 is linked to any authorised value
=> if you edit 952$8 authorised value input is empty
4. Apply this patch.
5. Repeat steps 1.-3.
=> authorised value should now be saved

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c39e47cbf3af9b7fcedbfd3a3e0efcffb74efb10)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 29012: DBRev 22.05.05.001
Lucas Gass [Thu, 29 Sep 2022 14:32:20 +0000 (14:32 +0000)]
Bug 29012: DBRev 22.05.05.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 29012: (QA follow-up) Use q{} instead of '' in smart-rules.pl
Kyle Hall [Fri, 29 Jul 2022 12:12:53 +0000 (08:12 -0400)]
Bug 29012: (QA follow-up) Use q{} instead of '' in smart-rules.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f8e77b4e899d6f71fb8987975ba916a65dc8229)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 29012: Add default values for blank circulation rules that weren't saved to the...
Kevin Carnes [Fri, 3 Dec 2021 09:49:59 +0000 (09:49 +0000)]
Bug 29012: Add default values for blank circulation rules that weren't saved to the database

There are 5 fields that are not set if no value is provided when saving/editing a rule in Administration->Circulation and fines rules
- issuelength
- hardduedate
- unseenrenewalsallowed
- rentaldiscount
- decreaseloanholds

This is problematic because it gives the impression these rules are set as blank, but in reality they don't exist and the rule will fal back to the higher level

To test:
1 - Set a rule for
    Patron category: Teacher
    Itemtype: All
    Hard due date: (Today)
    Lona period: 10
2 - Set a rule for
    Patron category: Teacher
    Itemtype: Books
    Hard due date: (leave blank)
    Loan period: 10
3 - Expected behaviour is Book item will checkout to teacher for 10 days, all other types will be due yesterday at 25:59:00
4 - Checkout an non-book item type to teacher
5 - Hard due date applies
6 - Checkout a 'book' item type to teacher
7 - Hard due date applies - FAIL

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>
(cherry picked from commit cf397ac3bcbc93a508954c836d1cb90a84fb2ac6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31247: Fix OPAC authentication when 2FA is enabled
Jonathan Druart [Wed, 27 Jul 2022 15:47:18 +0000 (17:47 +0200)]
Bug 31247: Fix OPAC authentication when 2FA is enabled

Silly mistake from bug 28786, the $type should be compared to "opac"
instead of "OPAC", erk!

Test plan:
Turn 2FA on
Set it up for an user
Login at the OPAC
=> Without this patch you keep being redirected to the auth form screen
=> With this patch applied you are able to successfully login

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e7bb0d2a5ed92a1c9fedd5611e5569f11bd47723)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31247: Add tests
Jonathan Druart [Wed, 27 Jul 2022 15:52:34 +0000 (17:52 +0200)]
Bug 31247: Add tests

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9891b84fefd74059caf81730b1acd26f7cc4569)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoRevert "Bug 31499: Add libhttp-tiny-perl 0.076 dependency for ES7" v22.05.05-01
Lucas Gass [Wed, 28 Sep 2022 14:48:28 +0000 (14:48 +0000)]
Revert "Bug 31499: Add libhttp-tiny-perl 0.076 dependency for ES7"

This reverts commit c3c006713bd8bc457b73dbcd3423a2506369bf9e.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoRevert "Bug 31219: Prevent JS injection in patron extended attributes"
Lucas Gass [Wed, 28 Sep 2022 14:48:14 +0000 (14:48 +0000)]
Revert "Bug 31219: Prevent JS injection in patron extended attributes"

This reverts commit ddaa78bdab360f41b9e3672de7f50cd3053b9116.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoUpdate release notes for 22.05.05 release v22.05.05
Lucas Gass [Mon, 26 Sep 2022 14:35:00 +0000 (14:35 +0000)]
Update release notes for 22.05.05 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoIncrement version for 22.05.05 release
Lucas Gass [Mon, 26 Sep 2022 14:28:35 +0000 (14:28 +0000)]
Increment version for 22.05.05 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoTranslation updates for Koha 22.05.05
Koha translators [Mon, 26 Sep 2022 14:18:21 +0000 (11:18 -0300)]
Translation updates for Koha 22.05.05

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31219: Prevent JS injection in patron extended attributes
Jonathan Druart [Mon, 25 Jul 2022 07:23:25 +0000 (09:23 +0200)]
Bug 31219: Prevent JS injection in patron extended attributes

We are sanitizing other attributes but "extended patron attributes".

Test plan:
Make a patron attribute editable at the OPAC
Edit an existing patron, or register a new one
Use a script tag in the new value ("<script>alert("booh!")</script>" for
instance)
With this patch the value is remove if containing an HTML tag that is
not br b i em big small strong (see C4::Scrubber)

Signed-off-by: Mark Hofstetter <koha@trust-box.at>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31499: Add libhttp-tiny-perl 0.076 dependency for ES7
Mason James [Wed, 31 Aug 2022 16:38:17 +0000 (04:38 +1200)]
Bug 31499: Add libhttp-tiny-perl 0.076 dependency for ES7

no testing info provided

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 486f5af3035228f5ad55175ee6ff0b78a96c64b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31455: (QA follow-up) Make table creation O(N)
Joonas Kylmälä [Thu, 1 Sep 2022 19:45:25 +0000 (19:45 +0000)]
Bug 31455: (QA follow-up) Make table creation O(N)

We can insert the indices before the main loop to a hash,
this way we don't have to look up during each loop iteration
the index from an array which in the worst case might take O(N)
thus making the total time complexity O(N^2).

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 223d9d3a99903cff3d8a3078e6921da79099375c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31455: Make batchMod sort by order scanned
Lucas Gass [Thu, 1 Sep 2022 16:55:14 +0000 (16:55 +0000)]
Bug 31455: Make batchMod sort by order scanned

To test:
1. In batch item deletion and batch item modification add some
   barcodes.
2. Notice they are being sorted by item number, not in the order
   scanned.
3. Appply patch and restart services.
4. Try scanning items again in both batch item deletion and batch item
   modification.
5. The found barcodes should now sort by order scanned.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5c2b2ac09a0cabbab9333bc0cab90cf1880de17f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30909: Retain permanent_location if mapped
Jonathan Druart [Tue, 7 Jun 2022 09:27:04 +0000 (11:27 +0200)]
Bug 30909: Retain permanent_location if mapped

If items.permanent_location is mapped to a MARC subfields we must retain
the value, not using items.location

Test plan:
1 - Map permanent_location to a marc field
2 - Expose that field in the item editor
3 - Change the location of the item and retain the permanent location on saving
4 - note that permanent location has not changed

Test the different other situation, when adding and editing: Empty the field, change only location, change only permanent_location, etc.

Signed-off-by: andrew <andrewfh@dubcolib.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2668a685702a0cd9adf3deeafcc9e4433199e0f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31223: Do not explode if plugins disabled
Tomas Cohen Arazi [Tue, 26 Jul 2022 12:55:38 +0000 (09:55 -0300)]
Bug 31223: Do not explode if plugins disabled

This patch makes the code skip calculating the plugin-related task
codes => class mapping if plugins are entirely disbaled.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Plugins/BackgroundJob.t
=> FAIL: Tests explode with: Can't call method "GetPlugins" on an
undefined value at... Koha/BackgroundJob.pm line 424.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7867106d430dd9ab3f673185945467931a10082e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31223: Regression tests
Tomas Cohen Arazi [Tue, 26 Jul 2022 13:48:21 +0000 (10:48 -0300)]
Bug 31223: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 28896d9c302ad41fce463fd8d80ea02283a7d55b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit d2d78e2581419dd3d8101fd9aecf358c71213733)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31244: Fix 500 if logout and not logged in
Jonathan Druart [Tue, 26 Jul 2022 12:55:02 +0000 (14:55 +0200)]
Bug 31244: Fix 500 if logout and not logged in

Can't use an undefined value as a HASH reference at /kohadevbox/koha/C4/Auth.pm line 985
        C4::Auth::checkauth('CGI=HASH(0x5603b7dc4300)', 0, 'HASH(0x5603b2633238)', 'intranet', undef, 'intranet-main.tt') called at /kohadevbox/koha/C4/Auth.pm line 186
        C4::Auth::get_template_and_user('HASH(0x5603b7b83d08)') called at /kohadevbox/koha/mainpage.pl line 40

Test plan:
Open a private window
Hit /cgi-bin/koha/mainpage.pl?logout.x=1

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1ae5454b01f2a5cfac105b056bc2a8d72ac444a8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31246: <span> displayed in 'Additional fields' section
Tomas Cohen Arazi [Wed, 27 Jul 2022 12:54:19 +0000 (09:54 -0300)]
Bug 31246: <span> displayed in 'Additional fields' section

This patch avoids escaping HMTL data in the additional fields section.

To test:
1. Open the additional fields section
   http://kohadev-intra.mydnsname.org:8081/cgi-bin/koha/admin/additional-fields.pl
=> FAIL: there are some nasty <span> </span> texts in there
2. Apply this patch
3. Reload
=> SUCCESS: Things display nicely again!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a7272f988679904d3f018550a73719fc102b3425)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31120: Items will renew for zero ( 0 ) days if renewalperiod is blank/empty value
Kyle M Hall [Thu, 7 Jul 2022 19:14:59 +0000 (15:14 -0400)]
Bug 31120: Items will renew for zero ( 0 ) days if renewalperiod is blank/empty value

If the rule renewalperiod is the blank empty string instead of being null/undefined or non-existant, Koha will interpret the renewal period as being zero days instead of falling back to the issuelength rule.

It makes sense to me that a literal 0 here should make it renew for zero days even though that is nonsensical.

Test Plan:
1) Delete all your rules
2) Create an all/all/all rules with an empty string for renewal base
   period
3) Note that renewing an item does nothing
4) Apply this patch
5) Restart all the things!
6) Renew again
7) Note the renewal uses the issuelength rule as intended

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b010d99dfcb1a77a6ebd679aabafd819c6e67cf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31120: Add unit tests
Kyle M Hall [Thu, 14 Jul 2022 10:38:57 +0000 (10:38 +0000)]
Bug 31120: Add unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 511ae8298e033ddf2a12799c968d25bd716d62af)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 21982: Circulation statistics wizard does not count deleted items
Jérémy Breuillard [Wed, 24 Nov 2021 15:56:09 +0000 (16:56 +0100)]
Bug 21982: Circulation statistics wizard does not count deleted items

By default statistic assistant filter is set on the
existing items and doesn't mind about deleted items.
The patch corrects this. Items belong to the same library.

Test plan:
1)Make sure to have at least 1 or more item(s) in deleteditems database table
2)Home > Reports > Circulation statistics
3)Fill up 'Issuing library', 'Home library' and 'Holding library'
4)Submit
5)Notice that only statistics for active items are shown
6)Apply patch and repeat from 2) to 5)
7)Now active items and deleted items are shown

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 610f287db9581bfa6d606468810792d25c6dc47b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30878: Avoid resetting waiting reserves tab
Lari Taskula [Wed, 1 Jun 2022 15:06:52 +0000 (15:06 +0000)]
Bug 30878: Avoid resetting waiting reserves tab

When canceling holds waiting over X days in "Holds awaiting pickup"
view, form submission resets the selected tab to "Holds waiting". This
tab reset may cause confusion for the user and lead to unwanted
actions. Instead, the user should be returned to the same tab that they
began with.

To test:
1. Apply patch
2. Navigate to /cgi-bin/koha/circ/waitingreserves.pl
3. Select "Holds waiting over X days" tab
4. Refresh page
5. Observe "Holds waiting over X days" is still selected
6. Have some holds waiting over X days
7. Select one of them and press "Cancel selected (1)" and confirm
8. Observe "Holds waiting over X days" is still selected after form
   submission

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>
(cherry picked from commit 30235d31884c6c24edf692a9f69170b25a645e05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 15187: (QA follow-up) Fix test permissions
Tomas Cohen Arazi [Fri, 22 Jul 2022 18:11:58 +0000 (15:11 -0300)]
Bug 15187: (QA follow-up) Fix test permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e6947b740883670b48f002bba7a64103016bc4ef)

2 years agoBug 15187: (QA follow-up) Add unit test
Martin Renvoize [Wed, 6 Jul 2022 11:52:05 +0000 (12:52 +0100)]
Bug 15187: (QA follow-up) Add unit test

This patch adds a unit test for the newly introduced filter.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 058d411643c4b868553b97896fb065cf9870e456)

2 years agoBug 15187: Index 880 in Zebra the same as Elasticsearch
David Cook [Mon, 2 May 2022 07:34:34 +0000 (07:34 +0000)]
Bug 15187: Index 880 in Zebra the same as Elasticsearch

This patch modifies the MARC21 export to Zebra, so that 880 fields
are rewritten as their linked fields, in the same way that we
already do with Elasticsearch, so that the alternate graphic
representation of fields are indexed accordingly. (ie 880 $6245-01
Chinese titles will be indexed into the title index using the 245 rules)

Test plan:
0. Apply patch
1. Turn on ICU indexing
1b. vi /etc/koha/zebradb/etc/default.idx
1c. Replace charmap word-phrase-utf.chr with icuchain words-icu.xml
1d. Replace charmap word-phrase-utf.chr with icuchain phrases-icu.xml
1e. Restart Zebra server
1f. Re-index Zebra
2. Add record with a 880 $6 245-01 $a 教牧書信 field.
3. Search for this record using a title index with the Chinese title
4. Note that the record is correctly retrieved

(Note: This test probably works better using author or series as they
 present as links on the detail page which makes the fix more obviously
 useful.)

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>
(cherry picked from commit 85690a14f8685a2eb6cb88316bb4a3145c024cc2)

2 years agoBug 26689: Prepend letter codes.
Martin Renvoize [Wed, 29 Jun 2022 16:26:30 +0000 (17:26 +0100)]
Bug 26689: Prepend letter codes.

This patch prepends the credit_type_code and debit_type_code with
CREDIT_ and DEBIT_ respectively when doing a lookup on the notice letter
code.

Test plan
1) As previous patches, however instead of just naming your notice to
   match the credit_type_code or debit_type_code use
   CREDIT_credit_type_code and DEBIT_debit_type_code respectively.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 87aa05f9deb7fa09f059d53b422b89c8411e0c84)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 26689: Check for specific template then fallback - printinvoice
Martin Renvoize [Fri, 12 Mar 2021 16:09:22 +0000 (16:09 +0000)]
Bug 26689: Check for specific template then fallback - printinvoice

This patch adds a check for a more specific ACCOUNT_DEBIT template
(named to match the debit_type_code of the credit line) prior to
falling back to the ACCOUNT_DEBIT template.

Test plan
1/ On a patrons account page use the print option on a series of debit
lines with differing credit types (Overdue, Payout)
2/ Note that the same template 'ACCOUNT_DEBIT' is used for all types
3/ Apply the patch
4/ Run step 1 again and note all still print using ACCOUNT_DEBIT
5/ Add a new notice template under the 'circulation' module with a code
that matches one of your account debit types (OVERDUE, PAYOUT)
6/ Run step 1 again and note that where you have added a specific notice
for that debit type it has been used.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8e46612d7c5dfc8d0faff009ef9f86198bdd0f83)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 26689: Check for specific template then fallback - printfeercpt
Martin Renvoize [Fri, 12 Mar 2021 14:38:31 +0000 (14:38 +0000)]
Bug 26689: Check for specific template then fallback - printfeercpt

This patch adds a check for a more specific ACCOUNT_CREDIT template
(named to match the credit_type_code of the credit line) prior to
falling back to the ACCOUNT_CREDIT template.

Test plan
1/ On a patrons account page use the print option on a series of credit
lines with differing credit types (Payment, Lost Item Return, Writeoff)
2/ Note that the same template 'ACCOUNT_CREDIT' is used for all types
3/ Apply the patch
4/ Run step 1 again and note all still print using ACCOUNT_CREDIT
5/ Add a new notice template under the 'circulation' module with a code
that matches one of your account credit types (PAYMENT, WRITEOFF,
LOST_FOUND)
6/ Run step 1 again and note that where you have added a specific notice
for that credit type it has been used.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 422ab472836cfcd0dd4197173de1213c06375d42)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31121: Fix date formatting in cashup summary modal
Martin Renvoize [Fri, 8 Jul 2022 14:46:04 +0000 (15:46 +0100)]
Bug 31121: Fix date formatting in cashup summary modal

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c12d037da294944cf82208b2bd72d3348b66c0cf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31204: Clearly indicate edit buttons are for record modification
Lucas Gass [Wed, 20 Jul 2022 16:53:28 +0000 (16:53 +0000)]
Bug 31204: Clearly indicate edit buttons are for record modification

To test:
1. Apply patch
2. Do a search and select some records
3. On the toolbar (#selection_ops) open the Edit dropdown.
4. The labels should read 'Batch edit records' and 'Batch delete records'.

Note: To see both you must have batchmod and batchdelete permission.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7ce420ed82862e750b7a6a46c66c5cf1587f5e7d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30838: (QA follow-up) Add unit tests
Martin Renvoize [Wed, 6 Jul 2022 10:54:35 +0000 (11:54 +0100)]
Bug 30838: (QA follow-up) Add unit tests

Two tests added, one in t/db_dependent/Circulation.t to catch the
initial setting of to_address at enqueue time and a second in
t/db_dependent/Letters.t to catch the correcting at send time.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 467b444c7e355b1ef3ecbab29f67544bfd72360b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30838: (QA follow-up) Add missing semicolon
Kyle Hall [Tue, 28 Jun 2022 11:27:17 +0000 (07:27 -0400)]
Bug 30838: (QA follow-up) Add missing semicolon

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 008e6ae9ebd45cc8161a86f293703f02d7409319)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30838: Set to_address to smsalertnumber at send
Martin Renvoize [Tue, 24 May 2022 11:57:09 +0000 (12:57 +0100)]
Bug 30838: Set to_address to smsalertnumber at send

It may be helpful to know exactly what number was used for the sms alert
that was sent. As such, we should ensure it's set at the time of
sending.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9cdc1da651faa24a93f87569bf2b219f31552ee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 30838: Don't fallback through phone numbers for sms
Martin Renvoize [Tue, 24 May 2022 11:32:45 +0000 (12:32 +0100)]
Bug 30838: Don't fallback through phone numbers for sms

This patch removes the fallback handling for smsalartnumber as the
to_address in notices. We ignore the to_address field in the message
queue at send time for sms anyway and use smsalertnumber exclusively so
having this field populated is just confusing to the end user

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5e388ed509c58b5f7398baf6f7bb027b4dc46c1c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31086: DBRev 22.05.04.002
Lucas Gass [Fri, 2 Sep 2022 17:20:14 +0000 (17:20 +0000)]
Bug 31086: DBRev 22.05.04.002

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31086: DBIC
Lucas Gass [Fri, 2 Sep 2022 17:12:24 +0000 (17:12 +0000)]
Bug 31086: DBIC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31086: (QA follow-up) Use plain SQL in db_rev
Tomas Cohen Arazi [Fri, 22 Jul 2022 17:36:39 +0000 (14:36 -0300)]
Bug 31086: (QA follow-up) Use plain SQL in db_rev

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit efd2dfdaae0441c4e8701278853e7a75db285717)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 31086: Notify of problematic holds during upgrade
Nick Clemens [Fri, 22 Jul 2022 12:31:55 +0000 (12:31 +0000)]
Bug 31086: Notify of problematic holds during upgrade

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0704102bc800dd43db1255918348e454a6df2f75)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>