Commit graph

48188 commits

Author SHA1 Message Date
3593ed50fe Bug 32537: (QA follow-up) Don't allow invalid no block values
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b1867f8485)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 16:17:59 +00:00
61c4d9d374 Bug 32537: Add no-block option to SIP cli emulator
This patch adds the option to pass a no-block option and use this
in checkout/checkin/renew messages

To test:
1 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831
2 - Confirm out like:
    SEND: 09N20221227    20183920221227    201839APCPL|AOCPL|AB39999000010831|ACterm1|BIN|
    (Note the N after 09)
3 - Apply patch
4 - Restart SIP, repeat 1
5 - Confirm still an N
6 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n N
7 - Confirm still an N
8 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n Y
9 - Confirm the send has a Y after 09

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 0880d80949)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 16:17:30 +00:00
677e68c7f1 Bug 32797: Check if fields have a value, not if true
When saving OAI set mappgins we are checking for truth, this prevents
saving subfield 0. We should check for content

To test:
1 - Go to Admin->OAI sets
2 - Create a set
3 - Define mappings for the set
4 - Attempt to save a rule on field 952 subfield 0 (withdrawn)
5 - It does not save
6 - Apply patch
7 - Try again
8 - Success!

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>
(cherry picked from commit 6f606e00c5)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:57:22 +00:00
11d9b0125d Bug 32673: Remove misc/load_testing/ scripts
see comment 0 for more info

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3bf31ae4d4)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:56:03 +00:00
cd3e4c196c Bug 32612: (QA follow-up) Add missing interface for Logger
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 89ff35b025)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:55:21 +00:00
c04c3e7ec8 Bug 32612: (QA follow-up) Remove worker.log
It is not used; overruled by daemon's --output option.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 94cb6925d4)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:55:07 +00:00
af67b6f6c5 Bug 32612: (QA follow-up) Remove more unneeded appender lines
To be more consistent ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c37c3e874c)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:54:49 +00:00
a538cfea5b Bug 32612: (QA follow-up) Update package files
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>
(cherry picked from commit cb1da500ec)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:54:34 +00:00
9b25eb0ed3 Bug 32612: (QA follow-up) Remove superfluous line
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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>
(cherry picked from commit 09e0f8e30d)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:54:19 +00:00
872d03963e Bug 32612: Add worker-error to log4perl conf
To test:
1 - Apply patch
2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below:
log4perl.logger.worker = WARN, WORKER
log4perl.appender.WORKER=Log::Log4perl::Appender::Screen
log4perl.appender.WORKER.stderr=1
log4perl.appender.WORKER.mode=append
log4perl.appender.WORKER.layout=PatternLayout
log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n
log4perl.appender.WORKER.utf8=1
3 - Restart all
4 - Edit misc/background_jobs_worker.pl
-        my $job = Koha::BackgroundJobs->find($args->{job_id});
+        my $job;# = Koha::BackgroundJobs->find($args->{job_id});
5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log
6 - Force enqueue a job (that won't be found because of #4
  perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});'
7 - Note error in log like:
  [2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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>
(cherry picked from commit 3b1f2c57ea)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:54:06 +00:00
dfc1e7d2da Bug 32712: (QA follow-up) Add missing include
I assumed it wasn't needed because teh .tt files using this already
includ teh Koha plugin. But we shuoldn't skip, just in case someone
doesn't notice when reusing this, and debugging will be a pain.

Sorry for that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1b6e9c7bd1)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:51:32 +00:00
c59571cbf0 Bug 32741: Fix {biblios|authorities}/bib1.att duplicate codes
This patch fixes a duplicate attribute code for Author-in-order in the
biblios definition.
The picked code matches what was already in ccl.properties.

Also Chronological-term for authorities gets fixed.

To test:
1. Apply the regression tests
2. Run:
  k$ prove xt/verify_bib1.att.t
=> FAIL: Some failiures
3. Apply this patch
4. Repeat 1
=> SUCCESS: Tests now pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4999a2895)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:51:17 +00:00
a37207a192 Bug 32741: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7451330729)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:50:58 +00:00
a2e4fd53e4 Bug 32779: ERM - Fix import from list
There is a typo, '$' is missing, which caused the following error:
Use of inherited AUTOLOAD for non-method Koha::BackgroundJob::CreateEHoldingsFromBiblios::fix_coverage() is no longer allowed at /kohadevbox/koha/Koha/BackgroundJob/CreateEHoldingsFromBiblios.pm line 126

Test plan:
Create a list, add an item
Turn on ERM
Create a package
Go to /cgi-bin/koha/erm/eholdings/local/titles
Click "Import from list"
Select the package, then your list, and import
It should succeed

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d8022865ca)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:50:17 +00:00
857c0015cc Bug 32779: Add tests
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4288ba2ff8)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:49:29 +00:00
e358100ebf Bug 32401: Remove x-koha-query support
HTTP headers can only contain ASCII characters, and it is thus
impractical to use a header for passing DB queries that could contain
non-ascii characters.

We don't need it, and should be removed.

This patch removes traces from the datatables.js files and also from
detail.tt, which had it set to false anyway.

See bug 32406 and bug 32409 for the cases in which it was being used,
and problematic.

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 a454653629)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:48:47 +00:00
270170cd0e Bug 32409: Fix cashup searching with non latin-1 chars
This patch fixes a problem with the way queries are passed to the API so
cashups are searchable with non-laint1 chars.

To test:
1. Have two superlibrarian users, one with non-latin1 chars on the name
   (e.g. خمسة)
2. Setup a debit type that can be sold.
3. Use the POS module to have some activity, using both your regular
   user and the other one.
4. Go to the register you used, and choose 'Transaction history'
5. Perform a couple cashups with each user ('Record cashup').
6. Look at the 'Cashup history' table
=> SUCCESS: You see cashups for both users
7. Use the 'Search' filter with latin chars
=> SUCCESS: Your user with only latin1 chars is displayed on the table
8. Repeat, using some non-latin1 char found on the other user
=> FAIL: Table is not refreshed or filtered!
9. Apply this patch
10. Reload the page
11. Repeat 8
=> SUCCESS: Filtering works now!
12. Sign off :-D

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

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 96cba5503c)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:47:22 +00:00
b40ebaae3c Bug 32406: Switch acq datatable from headers to query param
This patch changes the pending orders datatable from using the
x-koha-query header to the "q" query parameter, so that it is
able to support UTF-8 encoded scripts rather than just Latin-1
scripts.

Test plan:

1. Apply patch
2. Go to
http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=29
3. Change title from "Gairm" to "五" (alternatively use "cœur" or Arabic title)
4. Create a basket containing multiple records including bib 29 五
5. Close the basket
6. Receive shipment
7. You should be on a page like the following:
http://localhost:8081/cgi-bin/koha/acqui/parcel.pl?invoiceid=3
8. In the search box, type in 五
9. Note that you see a "Processing..." box and then the
results are filtered to just show the order for 五

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
tcohen amend: removed the line instead as we are probably phasing out
that DT configuration option anyway.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9248a0ef1f)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:46:14 +00:00
3ac3c2238c Bug 32633: (QA follow-up) Add handling for authorities merge
When you first click 'actions -> merge' from a result in the authories
search page you will see a new 'Merging with authority: ' text appear at
the top of the search results.

Prior to this patch, the text appears outside of the white page-section
and is almost un-noticable.

After this patch, we add a page-section with bg-info (blue backround)
around the merge message which makes it stand up more clearly.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c2664482e4)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:42:57 +00:00
f458997152 Bug 32633: (QA follow-up) Move page-section nesting
This follow-up makes a small change to the page-section nesting on the
Cataloging and Authorities search results pages.  We move the 'h2'
outside of the page section but include the paging and number of results
inside with the results tables themselves.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 734a1fe63b)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:42:37 +00:00
8bf45d929d Bug 32633: Add 'page-section' to cataloging and authority pages
This patch adds a "page-section" container div around the main section
of cataloging and authority pages which lack it.

This patch contains indentation changes, so please ignore whitespace
when looking at the diff.

Apply the patch and view the following pages to confirm that the main
content is contained in a white box:

 - Cataloging -> Cataloging search results
 - Cataloging -> Edit items: The table of items and the item edit form
   should each be contained in a page-section.
 - Authorities -> Search results
 - Authorites -> Merge authorities: From the authorities search results
   list, click "Actions -> Merge" for one result, and then "Actions ->
   Merge" for another.
 - Click "Next" after selecting a merge reference.
   - The "Destination record" information should be contained in a
     page-section.

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 b88ec7daeb)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
2023-02-06 15:42:22 +00:00
dbcbf5fcd1 Bug 30310: Fix date_to_rfc3339
We need the customParseFormat plugin to provide a custom date format to
the dayjs constructor.
Found while working on bug 32559, don't remove this function, it will be
used later.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dded614fa1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:43:39 +00:00
d89aff3fb5 Bug 30310: Replace one more occurrence to moment
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e6af365491)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:43:23 +00:00
086643357e Bug 30310: Add missing utc plugin
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dbfbd4c983)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:43:09 +00:00
60b351d53c Bug 30310: Adjust about page
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I fixed a rebase issue that was being carried
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f847055586)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:42:55 +00:00
e83c6be0f5 Bug 30310: Remove momentjs
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d8cc4950bf)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:42:40 +00:00
1786ee8796 Bug 30310: Adjust js-date-format
Test plan:
Confirm that the test plan from bug 24455 is still passing

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 63242128a1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:42:22 +00:00
f42bdbffa8 Bug 30310: Add dayjs timezone plugin
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 37c6d4fccc)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:42:08 +00:00
1530ea0735 Bug 31095: (Rebase follow-up) Correct fine rules and AddIssue calls
This patch corrects the errant call to AddIssue that passes a patron
object instread of a patron hash to AddIssue in the tests and also adds
lengthunit to squash a pair of warnings.

However, it doesn't resolve the failing test.. still somthing going on
there.

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

Bug 31095: Fix Circulation.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 50f997a4b4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:41:09 +00:00
127502dc7e Bug 31095: DBIC additions and relation name tweak
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ebb3eac6a1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:40:46 +00:00
9d171ab40a Bug 31095: (QA follow-up) Fix POD
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0b37d3131)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:40:26 +00:00
03049e2509 Bug 31095: (follow-up) Iterate debarments in batch mod
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 847d50f865)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:40:10 +00:00
28c484d8c5 Bug 31095: (QA follow-up) Fix after rebase
Signed-off-by: Nick Clemens <nick@bywatersolutions.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 f73bafaf87)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:39:48 +00:00
ef3970cd2e Bug 31095: Remove GetDebarments from Koha::Patron::Debarments
This patch finally removes GetDebarments from the codebase.

Test plan
1. Confirm GetDebarments is no longer mentioned in the codebase. `git
   grep GetDebarments`
2. Confirm t/db_dependent/Patron/Borrower_Debarments.t continues to pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 7c1ffd2b11)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:39:29 +00:00
9ab60f26aa Bug 31095: Remove GetDebarments from Borrower_Debarments.t
This patch replaces calls to GetDebarments with teh
$patron->restritions->search() equivilents.

Test plan
1. Run the test prior to the patch and confirm it passes
2. Run the test after the patch and confirm it passes
3. Confirm no tests were removed

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 52c786205e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:38:41 +00:00
580a534ad9 Bug 31095: Remove GetDebarments from Restriction/Type.t
This patch replaces GetDebarments with $patron->restrictions in
t/db_dependent/Koha/Patron/Restriction/Type.t

Test plan
1. Confirm t/db_dependent/Koha/Patron/Restriction/Type.t passes prior to
   the patch
2. Confirm t/db_dependent/Koha/Patron/Restriction/Type.t passes after
   the patch
3. Confirm no tests were removed

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 4a3a22f2b4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:38:23 +00:00
fb6ce1be46 Bug 31095: Remove GetDebarments from MarkIssueReturned.t
This patch removes GetDebarments from Ciculation/MarkIssueReturned.t

Test plan
1. Confirm t/db_dependent/Circulation/MarkIssueReturned.t passes prior
   to the patch
2. Confirm t/db_dependent/Circulation/MarkIssueReturned.t passes after
   the patch
3. Confirm no tests have been removed

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 f35fb71977)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:38:08 +00:00
e8cc616f0e Bug 31095: Remove GetDebarments from maxsuspensiondays.t
This patch replaces GetDebarments in maxsuspensiondays.t with calls to
the restrictions accessor.

Test plan
1. Confirm t/db_dependent/Circulation/maxsuspensiondays.t passes prior
   to this patch
2. Confirm t/db_dependent/Circulation/maxsuspensiondays.t passes after
   this patch
3. Confirm no tests have been removed in this patch

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 07d3426ae8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:37:48 +00:00
7c8b170ddb Bug 31095: Remove GetDebarments from Patron::Import
This patch replaced GetDebarments with $patron->restrictions->search in
Koha::Patron::Import.

Test plan
1. Confirm that importing patrons with debarred and debarredcomment
   fields in the import still works as expected

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 9ea8cf0a8f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:37:28 +00:00
1d6c3d29b1 Bug 31095: Remove GetDebarments from Circulation.t
Replace GetDebarments with $patron->restrictions.

Test plan
1. Run test prior to patch - all should pass
2. Run test after patch - all should pass
3. Confirm no tests were removed as part of the patch

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 4452236233)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:37:10 +00:00
500cc50a8d Bug 31095: Remove GetDebarments from Circulation.pm
This patch removes GetDebarments from Circulation.pm replacing them with
calls to $patron->restrictions and filtering using a chained search
call.

Test plan
1. Confirm that t/db_dependant/Circulation.t continues to pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 0f15a74853)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:36:53 +00:00
49664013b1 Bug 31095: Remove GetDebarments from tools/modborrowers.pl
This patch removes GetDebarments from the modborrowers tool controller
and replaces it with $patron->restrictions as appropriate.

Test plan
1. Confirm that the 'Batch patron modification' tool pages still load
   and perform as expected.

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 e44c5146d3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:36:33 +00:00
b0082f0ba6 Bug 31095: Remove keyed_on_code
We no longer require keyed_on_code from Koha::Patron::Restrictoin::Types
as we have relation accessors for the relevent use cases and no longer
reference the method anywhere in the codebase!

Test plan
1. Confirm 'keyed_on_code' is no longer referenced anywhere in the
   codebase.
   `git grep keyed_on_code`

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 700bff51e9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:36:12 +00:00
7838782fae Bug 31095: Remove borrower_debarments and patron_restrictions includes
This patch removes the aforementioned includes and drops the last
remaining reference to them.

We have replaces these includes with patron-restrictions-tab.inc and
restriction-types.inc.

Test plan
1. Confirm the includes are no longer referenced anywhere in the
   codebase. 'git grep borrower_debarments.inc', 'git grep
   patron_restrictions.inc'

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 6388fbbd7f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:35:51 +00:00
9d62222a9f Bug 31095: Remove GetDebarments from members/memberentry.pl
This patch removes the use of GetDebarments from members/memberentry.pl
and replaces the references in the templates with patron.restrictions.

Test plan
1. Add a new user and confirm that the patron restrictions section does
   not appear on the form
2. Edit the user and confirm the patron restrictions section now appears
3. Add a manual restriction using the patron edit form
4. Confirm the restriction appears on the patron edit form
5. Confirm you can remove the restriction usine the patron edit form

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 4017946876)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:35:28 +00:00
a67c873364 Bug 31095: Remove GetDebarments from members/moremember.pl
This patch removes the use of GetDebarments from members/moremember.pl
and replaces template references with patrons.restrictions and the new
includes introduced in the prior patch

Test plan
1. Confirm that the 'Restrictions (x)' tab still appears on the patron
   details page.
2. Confirm that the 'Restrictions (x)' tab count is correct
3. Confirm that the 'Restrictions (x)' tab table functions
4. Confirm that the 'Restrictions (x)' tab 'Add manual restriction' form
   works as expected

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 efd9ed271c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:35:11 +00:00
58cc83f272 Bug 31095: Remove GetDebarments from circ/circulation.pl
This patch remove the use of GetDebarments from circ/circulation.pl,
replacing it with a reference to patron.restrictions in the template and
includes.

Test plan
1. Confirm that the 'Restrictions (x)' tab still appears on the checkout
   page for a user.
2. Confirm that the 'Restrictions (x)' tab count is correct
3. Confirm that the 'Restrictions (x)' tab table functions
4. Confirm that the 'Restrictions (x)' tab 'Add manual restriction' form
   works as expected

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 2a9ad26912)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:34:48 +00:00
b1bff08691 Bug 31095: Add type relation accessor to Koha::Patron::Restriction
Signed-off-by: Nick Clemens <nick@bywatersolutions.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 55d5e0a40d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:34:28 +00:00
6233475801 Bug 31095: Add restrictions accessor to Koha::Patron
Signed-off-by: Nick Clemens <nick@bywatersolutions.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 83b3ccc3c8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:34:10 +00:00
3274c68a76 Bug 31095: Add Koha::Patron::Restriction(s)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.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 437e752938)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-02-01 15:31:51 +00:00