]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 29552: (follow-up) Use CSS to set disabled class
Owen Leonard [Fri, 3 Dec 2021 14:40:41 +0000 (14:40 +0000)]
Bug 29552: (follow-up) Use CSS to set disabled class

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29552: Flatpickr - Disable shortcut buttons if inactive
Jonathan Druart [Tue, 23 Nov 2021 13:17:09 +0000 (14:17 +0100)]
Bug 29552: Flatpickr - Disable shortcut buttons if inactive

If one of the buttons is not relevant we should disable it and mark is
as such on the interface.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 20076: DBRev 21.11.01.004
Kyle Hall [Fri, 14 Jan 2022 14:28:29 +0000 (09:28 -0500)]
Bug 20076: DBRev 21.11.01.004

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 20076: (RM follow-up) Fix system preference boolean logic
Fridolin Somers [Fri, 14 Jan 2022 01:33:09 +0000 (15:33 -1000)]
Bug 20076: (RM follow-up) Fix system preference boolean logic

A Yes/No system preference must use 1 for Yes and 0 for No.
So "Send" for 1/Yes and "Don't send" for 0/No.
We add too much problems with double-negation boolean system preferences (such as dontmerge).

Previous patch changed default value to 1 in atomicupdate, do the same
in installer/data/mysql/mandatory/sysprefs.sql

Also to be consistant, sets options = NULL instead of '' in atomicupdate

Also removed useless added empty line in /misc/cronjobs/overdue_notices.pl

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 20076: (QA follow-up) We need to default to 'Send' on update to keep existing...
Katrin Fischer [Sun, 19 Dec 2021 13:17:33 +0000 (14:17 +0100)]
Bug 20076: (QA follow-up) We need to default to 'Send' on update to keep existing behavior

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 20076: (QA follow-up) Rephrase system preference description sightly
Katrin Fischer [Sun, 19 Dec 2021 13:16:23 +0000 (14:16 +0100)]
Bug 20076: (QA follow-up) Rephrase system preference description sightly

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 20076: (QA follow-up) Reformat database update to use newer format
Katrin Fischer [Sun, 19 Dec 2021 02:55:49 +0000 (02:55 +0000)]
Bug 20076: (QA follow-up) Reformat database update to use newer format

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 20076: Add syspref to remove overdues notification by email to staff if user...
ThibaudGLT [Fri, 10 Dec 2021 15:02:03 +0000 (15:02 +0000)]
Bug 20076: Add syspref to remove overdues notification by email to staff if user has no email address

I took the same test plan as victor but I added the system preference to manage the case more easily, especially for users who do not have access to the koha server.

Test plan
1. Check the size of the message queue
     With the following SQL query (using an SQL report if you want)
     SELECT COUNT(*) FROM message_queue;
2. Run misc/cronjobs/overdue_notices.pl
3. Check the size of the message queue
     To ensure that no other overdues will create noise in this test plan.
     Or you can take them into account.
4. Choose a patron with no email address
5. Create an overdue (checkout an item and unfold "Checkout settings"
   and set a date in the past which is compatible with what you find in
   staff:/cgi-bin/koha/tools/overduerules.pl
6. Run misc/cronjobs/overdue_notices.pl
7. Check that you have two new messages in the queue
8. Inspect these two messages
   SELECT * FROM message_queue ORDER BY time_queued DESC LIMIT 2 \G
   1. One has the type "print" and the borrowernumber matching the patron.
   2. The other has
        subject: Overdue Notices
        borrowernumber: NULL
        message_transport_type: email
        and contains "These messages were not sent directly to the patrons."
        This is the one we don't want anymore.
        Because it's now obsolete due to the first message.
9. Apply this patch
10. Run updatedabatase.pl
11. Change syspref 'EmailOverduesNoEmail' to "Don't send"
12. Delete data from message_queue (if you have access) for a cleaner view
13. Run again misc/cronjobs/overdue_notices.pl
14. Check that only the print message is now generated and not the
      "Overdue Notices" one.

https://bugs.koha-community.org/show_bug.cgi?id=20076

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29530: Fix handling of NumSavedReports preference in reports table
Owen Leonard [Tue, 23 Nov 2021 18:27:21 +0000 (18:27 +0000)]
Bug 29530: Fix handling of NumSavedReports preference in reports table

This patch updates the way the NumSavedReports preference value is used
on the saved reports page so that the setting is correctly incorporated
into the DataTable.

The patch also expands the description of the NumSavedReports preference
in order to clarify the expected behavior when no value is saved.

To test, apply the patch and go to Administration -> System
preferences and note the value of NumSavedReports.

 - Go to Reports -> Use saved.
 - Confirm that the first page of saved reports shows the number
   specified in NumSavedReports.
 - In the "Show" dropdown menu, confirm that the number from
   NumSavedReports is preselected by default.
   - Expand the dropdown menu to confirm that the NumSavedReports number
     is positioned sequentially with the default values. For example, if
     NumSavedReports = "78," the menu options should be
     "10, 20, 50, 78, 100, All".
 - Test with various values of NumSavedReports. A blank value should
   result in the "All" option being selected. A non-numeric or
   non-positive value should result in the default set of options being
   used ("10, 20, 50, 100, All").

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 24866: Changed $raw for html for extra safety
Florian Bontemps [Thu, 25 Nov 2021 08:59:03 +0000 (08:59 +0000)]
Bug 24866: Changed $raw for html for extra safety

Same test plan as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 24866: (follow-up) Replaced tabulations by dashes
Florian Bontemps [Tue, 9 Nov 2021 13:36:36 +0000 (13:36 +0000)]
Bug 24866: (follow-up) Replaced tabulations by dashes

The rendering of SELECT elements is up to the browser.
But Bug 16123 CSS code 'style="padding-left: xx' doesn't work on modern browsers.

Based on the previous contribution, this fix replaces CSS style attribute with dashes, creating a leveled structure that should work with most browsers.

Tested on Linux Ubuntu with Firefox 94.0, Chromium 95.0.4 and Opera 81.0.1
TEST PLAN :

1. Go to the Administration module
2. Add a new budget (ie : Budget 2022)
3. Add a fund to this budget (ie : Book)
4. Add a sub-fund to fund Book (ie : Fiction)
5. Add another sub-fund, this time to sub-fund Book (ie : Adult fiction)
You will have this hierarchy :

Budget 2022
 |____ Book
         |_____ Fiction
                |_____ Adult fiction

6. Go to the Acquisition module
7. Select a vendor and create a new basket
8. Place an order
9. Check the budget dropdown menu

BEFORE PATCH
Book
Fiction
Adult fiction

OR

Book
   Fiction
         Adult fiction

AFTER PATCH
Book
 -- Fiction
 -- -- Adult fiction

Co-authored-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 24866: Display budget hierarchy in the budget dropdown menu used when placing...
Didier Gautheron [Mon, 6 Apr 2020 14:30:40 +0000 (14:30 +0000)]
Bug 24866: Display budget hierarchy in the budget dropdown menu used when placing a new order

The rendering of SELECT elements is up to the browser.
But Bug 16123 CSS code 'style="padding-left: xx' doesn't work on modern browsers.

This patch replace CSS style attribute with &emsp; html entity.

On supported platforms
TEST PLAN :

1. Go to the Administration module
2. Add a new budget (ie : Budget 2020)
3. Add a fund to this budget (ie : Book)
4. Add a sub-fund to fund Book (ie : Adult fiction)

You will have this hierarchy :

Budget 2020
 |____ Book
         |_____ Adult fiction

5. Go to the Acquisition module
6. Select a vendor and create a new basket
7. Place an order
8. Check the budget dropdown menu

BEFORE PATCH
Book
Adult fiction

OR

Book
   Adult fiction

AFTER PATCH
Book
   Adult fiction

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29685: Reduce item processing by calculating 'items any available' outside of...
Nick Clemens [Mon, 13 Dec 2021 12:01:24 +0000 (12:01 +0000)]
Bug 29685: Reduce item processing by calculating 'items any available' outside of loop

See bug 24185, this avoids looping every each item of the record for every item of the record

How to reproduce:

1) on freshly installed kohadevbox create/import one book,
remember that biblionumber for later use it in down below,

2) add 100 items for that book for some library,

3) find some patron, that patron's card number we will
use as a borrower down below to open holds page,

4) check for the rule or set up a single circulation rule
in admin "/cgi-bin/koha/admin/smart-rules.pl",
that rule should match above book items/library/patron,
check that rule to have a non-zero number of holds (total, daily, count) allowed,
and, IMPORTANT: set up "On shelf holds allowed" to "If all unavailable",
("item level holds" doesn't matter).

5) open "Home > Catalog > THAT_BOOK > Place a hold on THAT_BOOK" page
("holds" tab), and enter patron code in the search field,
or you can create a direct link by yourself, for example, in my case it was:
/cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=23529000686353

6) it should be pretty long page generation time on old code, densely increasing for every hundred items added. In the case of this solution, it's fast, and time increases a little only, linear.

In testing with 100 books I went from ~6.5 seconds to ~3.2 seconds

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29557: DBRev 21.11.01.003
Kyle Hall [Fri, 14 Jan 2022 14:13:30 +0000 (09:13 -0500)]
Bug 29557: DBRev 21.11.01.003

2 years agoBug 29557: (QA follow-up) Add note for translated notices to update statement
Katrin Fischer [Sun, 19 Dec 2021 11:05:18 +0000 (12:05 +0100)]
Bug 29557: (QA follow-up) Add note for translated notices to update statement

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29557: Add auto_account_expired to AUTO_RENEWALS
Jonathan Druart [Tue, 23 Nov 2021 13:48:22 +0000 (14:48 +0100)]
Bug 29557: Add auto_account_expired to AUTO_RENEWALS

It was missing and the notice sent was not providing the reason of the
failure.

Test plan:
Check an item out with a date in the past, mark it as auto renew
Modify the expired date of the patron and set it in the past
Run the automatic_renewals.pl cronjob script, confirm that the notice
now contains the reason of the failure.

QA note: The template will be updated only for English installations.
Should we add an alert for others?

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 17127: Remove notes from detail.tt to only use MARCNOTES
Florian Bontemps [Wed, 27 Oct 2021 12:50:42 +0000 (12:50 +0000)]
Bug 17127: Remove notes from detail.tt to only use MARCNOTES

Notes come from the biblio table, but that table is already used to fill in MARCNOTES through Biblio.pm and get_marc_notes.
Get_marc_notes does check for NotesToHide and already read every note on the records, but .notes doesn't go through that same filter.
I don't see the point of keeping notes as a condition when MARCNOTES does the same job but better.

To test:
    1) Take any record, or create one
    2) Input something in the 500 field (or 300 in UNIMARC)
    3) In Systempreferences -> NotesToHide, fill in the number 500 (or 300).
    4) Save, then go look at the record detail in the OPAC and admin website.
    5) You should still see the 500 or 300 field under the Description tab.
    6) Apply patch.
    7) Reload the record detail page.
    8) Observe the error is gone.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29419: Retain user's inputs when suggesting for purchase and match found
Jonathan Druart [Tue, 16 Nov 2021 10:55:08 +0000 (11:55 +0100)]
Bug 29419: Retain user's inputs when suggesting for purchase and match found

If a user suggests for purchase and a match is found, their inputs was
not retained: quantity, item type, library, reason.

Test plan:
1. Suggest for purchase
2. Fill the title in with a string that will match an existing record
3. Fill value in quantity, item type, library and reason input/dropdown
4. Submit
=> Notice that with this patch the values you entered are retained on
the confirmation screen

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29688: Incorrect use of _() in holds.js
Tomas Cohen Arazi [Mon, 13 Dec 2021 13:40:18 +0000 (10:40 -0300)]
Bug 29688: Incorrect use of _() in holds.js

Bug 29404 moved code from request.tt into holds.js, and I didn't know
about the _() vs. __().

This patch fixes that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29790: Restore warning if deletion of serial item fails
Jonathan Druart [Tue, 4 Jan 2022 14:59:15 +0000 (15:59 +0100)]
Bug 29790: Restore warning if deletion of serial item fails

If the deletion of a serial item failed, the UI did not provide a warning/error message.

Test plan:
0. Create a new subscription with "Create an item record when receiving
this serial"
1. Receive a new item, set a barcode
2. Check it out
3. Select the item you have received in the serial item list (page
"Serial collection information") and click "Delete selected issues"
4. Tick "Delete the associated items" and confirm the deletion
=> Without this patch the deletion fail but the UI does not warn it
=> With this patch applied you see a warning "one or more associated
items could not be deleted at this time."

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29789: Remove unused $error from cataloguing/additem.pl
Jonathan Druart [Tue, 4 Jan 2022 14:40:19 +0000 (15:40 +0100)]
Bug 29789: Remove unused $error from cataloguing/additem.pl

my $error        = $input->param('error');

It should be removed as $error is used later but not related to this variable.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29553: (QA follow-up) Check defined instead of evaluating as boolean
Tomas Cohen Arazi [Fri, 17 Dec 2021 15:53:28 +0000 (12:53 -0300)]
Bug 29553: (QA follow-up) Check defined instead of evaluating as boolean

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29553: Regression tests
Tomas Cohen Arazi [Fri, 17 Dec 2021 15:52:17 +0000 (12:52 -0300)]
Bug 29553: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29553: Fix crash on undefined notforloan value
Marcel de Rooy [Mon, 22 Nov 2021 10:53:07 +0000 (10:53 +0000)]
Bug 29553: Fix crash on undefined notforloan value

Test plan:
Set item level itypes to biblioitems.
Find a record with itemtype NULL, having an item.
Place a hold. Without this patch, it crashes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29778: DBRev 21.11.01.002
Kyle Hall [Fri, 14 Jan 2022 13:40:27 +0000 (08:40 -0500)]
Bug 29778: DBRev 21.11.01.002

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29778: Remove DBMS error
Jonathan Druart [Wed, 5 Jan 2022 15:45:34 +0000 (16:45 +0100)]
Bug 29778: Remove DBMS error

ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Table 'additional_contents' is specified twice, both as a target for 'DELETE' and as a separate source for data at /kohadevbox/koha/C4/Installer.pm line 738

Happened on MariaDB 10.1 and 10.3, not 10.6

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29778: Prevent orphan additional contents
Jonathan Druart [Mon, 3 Jan 2022 10:31:54 +0000 (11:31 +0100)]
Bug 29778: Prevent orphan additional contents

When deleting a content, only the main one (lang="default") is removed,
which leads to orphan contents in the DB that are still displayed on the
UI.

Test plan:
0. Don't apply this patch
1. Create some contents, translate them in different languages
2. Delete some of them
=> Note that they are still displayed on the UI and that the entries
with lang!="default" are still in the DB
3. Apply this patch
4. Repeat 1
5. Run updatedatabase
6. Delete from of the contents
=> Note that the orphan entries created before you applied the patch
have been removed and that the "delete" behaviour is now working
correnctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29737: Remove some unecessary parameters
Jonathan Druart [Mon, 20 Dec 2021 12:49:44 +0000 (13:49 +0100)]
Bug 29737: Remove some unecessary parameters

We don't need them. We could also remove the biblionumber but it
requires change to the controller I'd prefer to not do now.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29737: Fix suspend from hold list
Jonathan Druart [Mon, 20 Dec 2021 12:45:04 +0000 (13:45 +0100)]
Bug 29737: Fix suspend from hold list

From holds list of a bibliographic record, the "unsuspend" button does not work as expected.
The form is submitted but the suspension is still there.

There are 3 requests, 2 GET and 1 POST.
One of the GET is rejected by Firefox (NS_BINDING_ABORTED)

Test plan:
Place some items on hold, play with suspend/unsuspend from the hold list
/cgi-bin/koha/reserve/request.pl?biblionumber=XX

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29794: (follow-up) Add license
Tomas Cohen Arazi [Tue, 4 Jan 2022 19:55:05 +0000 (16:55 -0300)]
Bug 29794: (follow-up) Add license

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29794: Add missing include in delete_items.pl
Tomas Cohen Arazi [Tue, 4 Jan 2022 19:51:18 +0000 (16:51 -0300)]
Bug 29794: Add missing include in delete_items.pl

This patch adds a missing include so the script is no longer broken.

To test:
1. Choose an item that is checked out and copy its barcode
2. Run:
   $ kshell
  k$ perl misc/cronjobs/delete_items.pl --verbose \
          --where "barcode='39999000010831'"
=> FAIL: It explodes with:
Can't locate object method "find" via package "Koha::Items"...
3. Apply this patch
4. Repeat 2
=> SUCCESS: You get:
Where statement:  where barcode='39999000010831'
Item '549' not deleted: book_on_loan
5. Sign off :-D

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29747: Delete columns that don't exist from settings
Nick Clemens [Tue, 21 Dec 2021 13:20:46 +0000 (13:20 +0000)]
Bug 29747: Delete columns that don't exist from settings

This patch simply checks if we are callinmg from the plugin, and removes
two columns from the settings if so

To test:
 1 - In Admin->Marc bibliographic framework got to Marc Structure for default framework
 2 - Search for 856$u
 3 - Set Plugin to upload.pl
 4 - Edit a record in the default framework
 5 - Under 856u, click 'Upload'
 6 - Uplaod a file and then click 'Choose'
 7 - nothing happens
 8 - View consiole (f12) and see error
 9 - Apply patch
10 - Reload the page
11 - No more error
12 - Click choose
13 - Record link is populated

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29508: Make GET /patrons/:patron_id use Koha::Patrons->search_limited
Tomas Cohen Arazi [Wed, 17 Nov 2021 19:36:11 +0000 (16:36 -0300)]
Bug 29508: Make GET /patrons/:patron_id use Koha::Patrons->search_limited

This patch makes the route return 404 if the user is not allowed to see
the requested patron information.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: The code doesn't respect limits
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: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29508: Regression tests
Tomas Cohen Arazi [Wed, 17 Nov 2021 19:35:33 +0000 (16:35 -0300)]
Bug 29508: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29506: (follow-up) Adapt GET /patrons
Tomas Cohen Arazi [Wed, 17 Nov 2021 17:57:26 +0000 (14:57 -0300)]
Bug 29506: (follow-up) Adapt GET /patrons

This patch makes GET /patrons rely on this new behavior from the
objects.search helper.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29506: Make objects.search call search_limited if present
Tomas Cohen Arazi [Wed, 17 Nov 2021 17:30:21 +0000 (14:30 -0300)]
Bug 29506: Make objects.search call search_limited if present

This patch makes objects.search implicitly update the passed
*$result_set* to use search_limited. This way no object leaks could
happen without noticing.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail because search_limited is not used
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Results are correctly filtered based on userenv!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29506: Regression tests
Tomas Cohen Arazi [Wed, 17 Nov 2021 17:30:11 +0000 (14:30 -0300)]
Bug 29506: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29503: Make GET /patrons use Koha::Patrons->search_limited
Tomas Cohen Arazi [Wed, 17 Nov 2021 16:07:12 +0000 (13:07 -0300)]
Bug 29503: Make GET /patrons use Koha::Patrons->search_limited

This patch makes the controller method use Koha::Patrons->search_limited
so filters based on configuration and permissions apply when fetching
patrons.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Boo, you get more patrons than you should
3. Apply the patch
4. Repeat 2
=> SUCCESS: Yay! Things are filtered as expected (i.e. using
Koha::Patron->libraries_where_can_see_patrons)
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29503: Regression tests
Tomas Cohen Arazi [Wed, 17 Nov 2021 16:07:07 +0000 (13:07 -0300)]
Bug 29503: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29680: Change markup to correct button radius
Owen Leonard [Mon, 13 Dec 2021 14:13:54 +0000 (14:13 +0000)]
Bug 29680: Change markup to correct button radius

This patch alters the markup around the "Show SQL/Hide SQL" buttons so
that they are not styled as if they are a button group.

To test, apply the patch and run an SQL report.

The "Show SQL code" button should be styled consistently with other
single buttons in the toolbar. Click it to test that the "Hide SQL code"
button is also correct.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29741: (follow-up) Make DELETE /patrons use the new validation method
Tomas Cohen Arazi [Mon, 20 Dec 2021 18:11:02 +0000 (15:11 -0300)]
Bug 29741: (follow-up) Make DELETE /patrons use the new validation method

This patch adapts the route so it uses the newly introduced
Koha::Patron->safe_to_delete method.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Note: There's a trivial behavior change, in which the 'anonymous patron'
use case is caugh eariler than the ->delete call. I left the exception
catch block just in case, who knows :-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: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29741: Add Koha::Patron->safe_to_delete
Tomas Cohen Arazi [Mon, 20 Dec 2021 17:17:49 +0000 (14:17 -0300)]
Bug 29741: Add Koha::Patron->safe_to_delete

This patchset adds a handy method for checking if a patron meets the
conditions to be deleted. This conditions are:

- Has no linked guarantees
- Has no pending debts
- Has no current checkouts
- Is not the system-configured anonymous user

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patron.t
=> FAIL: Of course heh
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass, conditions are validated and the right string is
returned on each case
5. 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: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29741: Unit tests
Tomas Cohen Arazi [Mon, 20 Dec 2021 17:17:31 +0000 (14:17 -0300)]
Bug 29741: Unit tests

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: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29018: Make DELETE /patrons/:patron_id check things
Tomas Cohen Arazi [Mon, 20 Dec 2021 15:05:59 +0000 (12:05 -0300)]
Bug 29018: Make DELETE /patrons/:patron_id check things

When the route was implemented, the checks were overlooked. This patch
adds checks for:
- Guarantees
- Debts
- Current checkouts

Any of those will block deletion, as it should.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail, the route misses checks
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! The three conditions prevent deletion!
5. 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: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29018: Regression tests
Tomas Cohen Arazi [Mon, 20 Dec 2021 15:05:28 +0000 (12:05 -0300)]
Bug 29018: Regression tests

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: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29693: Make CodeMirror work again
Lucas Gass [Tue, 14 Dec 2021 15:43:18 +0000 (15:43 +0000)]
Bug 29693: Make CodeMirror work again

To test:
1. Go to Tools > HTML customizations
2. Open or create a new entry with CodeMirror. ( Edit with text editor )
3. CodeMirror doesn't work, you don't see line numbers or syntax highlighting
4. Apply patch
5. Try steps 1 & 2 again. The CodeMirror editor should now load.
6. Make sure it works in both the Default and English(en) tabs.
7. BONUS: install some other language packs and look at the tabs for that language, it should still work.
8. Try 5 and 6 again but with Additional contents (News) instead of HTML customizations

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29689: (bug 28445 follow-up) Fix AutoBarcode=hbyymmincr
Jonathan Druart [Tue, 14 Dec 2021 11:08:13 +0000 (12:08 +0100)]
Bug 29689: (bug 28445 follow-up) Fix AutoBarcode=hbyymmincr

The selector is not correct, we must to not rely on the number.
This patch fixes a regression caused by bug 28445, but also a
long-standing bug.

* Regression:
The barcode plugin is broken is autoBarcode=<branchcode>yymm0001
There is a JS error in the console:
  Uncaught TypeError: form.field_value is undefined
      Focustag_952_subfield_p_878344
      Focustag_952_subfield_p_878344_handler
      jQuery 11
      BindEventstag_952_subfield_p_878344

* Long standing bug:
If there are several item forms on the same page, the branchcode is not
correctly retrieved. For instance on the "Serial edition" page there are
2 item forms, the homebranch that is used by the barcode plugin will be
the one from the last form.

Test plan:
* regression
Set autoBarcode=<branchcode>yymm0001
Catalogue a new item, click into the barcode input
Notice that without this patch you get a JS error in the console

* long standing bug
Create a new subscription, select "Create an item record when receiving this serial".
Receive a serial
Open the 2 item forms ("Click to add item")
Select 2 different home library and click the barcode inputs.
The prefix (branchcode) should be correct with this patch applied.

QA Note: it would be way easier if all add item forms were using the new
methods, it could be:
  let loc = document.getElementsByName('items.homebranch')[0].value;
Yes, that's all!

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29571: (follow-up) Fix display of pending suggestions in acqui-home.tt
Andreas Roussos [Mon, 13 Dec 2021 06:49:07 +0000 (07:49 +0100)]
Bug 29571: (follow-up) Fix display of pending suggestions in acqui-home.tt

In addition to the Staff Client's home page, the number of pending
suggestions is also displayed in Home > Acquisitions. Currently,
these are only displayed if there are pending suggestions at the
logged in library. However, suggestions should always be displayed.

This follow-up patch fixes that, and also removes a template variable
(`suggestion`) that is no longer in use (removed as part of Bug 4331,
commit 70af4593722ce2f3debd4f6d2c251ad29008b923).

Test plan:
1) Create a suggestion for Library A.
2) Go to Home > Acquisitions while logged in at Library B.
   Without this patch, nothing is displayed regarding suggestions.
3) Apply this patch. Notice how suggestion information is shown, like:
   "Manage suggestions: Library B: 0 / All libraries: 1"
   If you change the library to Library A, you should get:
   "Manage suggestions: Library A: 1"

Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29571: Display all pending suggestions even if none from logged in library
Jonathan Druart [Thu, 25 Nov 2021 13:06:07 +0000 (14:06 +0100)]
Bug 29571: Display all pending suggestions even if none from logged in library

The number of pending suggestions was only displayed if there are pending
suggestions at the logged in library.

Test plan:
Login at CPL
Create a suggestion (ASKED) for another library
=> Without this patch there is nothing on the mainpage
=> With this patch applied you will see info about pending suggestions:

"Suggestions pending approval: Centerville: 0 / All libraries: 1"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com>
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29591: Add autorenew_checkouts column to preferences json
Nick Clemens [Tue, 13 Oct 2020 15:42:39 +0000 (15:42 +0000)]
Bug 29591: Add autorenew_checkouts column to preferences json

Bug 24476 added autorenew_checkouts as a borrower column, intending it to be able to be
hidden if a library was not using the feature.

When the column chooser was added, this column was not included.

To test:
1 - Search system preferences for "BorrowerUnwantedFields"
2 - Click the box to change the value
3 - "autorenew_checkouts" is not an option
4 - Confirm that you see the option to opt patron out of autorenewal when editing patron on staff side
5 - Apply patch and restart everythign
6 - Search for the syspref again
7 - Note that now you can select "autorenew_checkouts"
8 - Check the box and save
9 - Confirm the opt out option is no longer visible during patron editing

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29729: Build a tr for each subscription
Lucas Gass [Fri, 17 Dec 2021 21:09:19 +0000 (21:09 +0000)]
Bug 29729: Build a tr for each subscription

To test:
1 To to Reports > Serials > Serials subscriptions and run the report while selecting a branch without subscriptions.
2 Notice console error
3 If you run the report for a branch WITH subscriptions it works just fine.
4 Apply patch
5 Do 1 again, no console error and show no see 'No entries to show'
6 Make sure it also works when you have a few subscriptions for a branch as well

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29604: Compiled CSS
Kyle Hall [Fri, 7 Jan 2022 11:16:02 +0000 (06:16 -0500)]
Bug 29604: Compiled CSS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29604: Dont add psuedo content to highlighted terms
Lucas Gass [Thu, 2 Dec 2021 01:59:06 +0000 (01:59 +0000)]
Bug 29604: Dont add psuedo content to highlighted terms

To test:
1. Do a search for something where the search terms will be in the 505
   note.
2. Visit the OPAC detail page of the record.
3. The first occurance of the term highlighting will include the CSS
   pseduo element "→ ";
4. Apply patch
5. Do the stuff to regenerate the CSS
   (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface)
6. Do 1 & 2 again.
7. No weird psuedo element in the term highlighting

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29588: (bug 29478 follow-up) Make strings translatable
Jonathan Druart [Tue, 30 Nov 2021 11:07:02 +0000 (12:07 +0100)]
Bug 29588: (bug 29478 follow-up) Make strings translatable

"or", "Yesterday", "Today" and "Tomorrow" are not translatable, we are
using __ when _ should be used (__ is for .js files only).

Test plan:
0. Apply the patch
1. cd misc/translator && perl translate update fr-FR
2. Edit misc/translator/po/fr-FR-staff-prog.po
Search for "or", "Yesterday", "Today" and "Tomorrow" and translate them
3. cd misc/translator && perl translate install fr-FR
4. Enable fr-FR (syspref 'language')
5. Edit a patron and an item and confirm that the flatpickr widget has
the strings correctly translated

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29696: Preserve link to biblio when creating a suggestion
Jonathan Druart [Wed, 15 Dec 2021 06:02:46 +0000 (07:02 +0100)]
Bug 29696: Preserve link to biblio when creating a suggestion

Caused by
  commit 586bed1319592e05f5dc3acf64a1dba8cae69d6b
  Bug 28941: Filter suggestion inputs at the OPAC

We are loosing the link with the biblio (suggestion.biblionumber)

Test plan:
At the OPAC, go to the detail page of a bibliographic record, click
"Suggest for purchase" and submit the form.
Without this patch the suggestion is created but the link to the
bibliographic record is lost
With this patch applied you should see that suggestions.biblionumber has
correctly been preserved

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29696: Add tests
Jonathan Druart [Wed, 15 Dec 2021 06:02:08 +0000 (07:02 +0100)]
Bug 29696: Add tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29436: ES mappings not saved if zebra is configured
Jonathan Druart [Tue, 16 Nov 2021 15:04:45 +0000 (16:04 +0100)]
Bug 29436: ES mappings not saved if zebra is configured

The mappings must be editable even if ES is not turned on yet.

Using a separate array to store the errors as we are testing for $@ ||
@messages.

There is still something wrong that should be improve, but this patch
should be safe for backport.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29457: DBRev 21.11.01.001
Kyle Hall [Fri, 7 Jan 2022 11:00:20 +0000 (06:00 -0500)]
Bug 29457: DBRev 21.11.01.001

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29457: Generic warning at upgrade
Martin Renvoize [Wed, 17 Nov 2021 16:49:27 +0000 (16:49 +0000)]
Bug 29457: Generic warning at upgrade

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Adding exec flag and two dots.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29457: Pass context borrowernumber
Martin Renvoize [Thu, 11 Nov 2021 10:56:45 +0000 (10:56 +0000)]
Bug 29457: Pass context borrowernumber

This patch updates the call to cancel such that we pass the currently
logged in users borrowernumber instead of their userid.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 26587: Use Koha::Cache::Memory::Lite
Jonathan Druart [Mon, 13 Dec 2021 11:25:29 +0000 (12:25 +0100)]
Bug 26587: Use Koha::Cache::Memory::Lite

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 26587: Cache libraries in Koha/Template/Plugins/Branches.pm to improve performance
Björn Nylén [Mon, 3 May 2021 11:13:25 +0000 (13:13 +0200)]
Bug 26587: Cache libraries in Koha/Template/Plugins/Branches.pm to improve performance

This patch caches the Koha::Library object in a hashmap in the Branches object (GetName, GetURL)
to avoid multiple database lookups while looping many items.

To test:
1. Have a biblio with many items (1000's).
2. View in staff (detail.pl) and opac (opac-detail.pl). Note how long it takes to load.
3. Apply patch.
4. Repeat 2. Note that pages load faster.

Sponsored-by: Lund University Library
JK: replaced tab indendation with spaces
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoUpdate release notes for 21.11.01 release v21.11.01
Kyle Hall [Wed, 22 Dec 2021 13:53:09 +0000 (08:53 -0500)]
Update release notes for 21.11.01 release

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
2 years agoIncrement version for 21.11.01
Kyle Hall [Wed, 22 Dec 2021 13:05:16 +0000 (08:05 -0500)]
Increment version for 21.11.01

2 years agoFix translations for Koha 21.11.01
Kyle Hall [Wed, 22 Dec 2021 13:02:33 +0000 (08:02 -0500)]
Fix translations for Koha 21.11.01

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
2 years agoTranslation updates for Koha 21.11.01
Koha translators [Wed, 22 Dec 2021 12:41:00 +0000 (09:41 -0300)]
Translation updates for Koha 21.11.01

2 years agoBug 29586: DBrev
Kyle M Hall [Wed, 22 Dec 2021 13:14:58 +0000 (13:14 +0000)]
Bug 29586: DBrev

2 years agoBug 29586: Add atomic update for existing intallations
Jonathan Druart [Wed, 1 Dec 2021 09:21:59 +0000 (10:21 +0100)]
Bug 29586: Add atomic update for existing intallations

In case an installation was created on 21.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29586: Fix typos in installer files
Nick Clemens [Mon, 29 Nov 2021 12:44:07 +0000 (12:44 +0000)]
Bug 29586: Fix typos in installer files

When HOLD_REMINDER info was added I neglected to move the semicolons, this meant
the statements were ending before the data was added

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28481: (RM follow-up) formatting
Fridolin Somers [Thu, 16 Dec 2021 21:34:07 +0000 (11:34 -1000)]
Bug 28481: (RM follow-up) formatting

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28481: (QA follow-up) Set date to 23:59:59
Martin Renvoize [Mon, 13 Dec 2021 09:36:33 +0000 (09:36 +0000)]
Bug 28481: (QA follow-up) Set date to 23:59:59

This patch changes the fix from adding a day to setting the time to
23:59:59.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28481: Make 'to' date inclusive.
Martin Renvoize [Mon, 29 Nov 2021 10:46:06 +0000 (10:46 +0000)]
Bug 28481: Make 'to' date inclusive.

Test Plan:
1) Sell an item
2) Cash up to make the sale historical
3) Search "Older transactions" with both dates being the current date,
   click "Display" to search
4) Note you get no results
5) Apply the patch
6) You should now see your transaction

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29669: fix uninitialized value warnings when XSLTParse4Display is called
Petro Vashchuk [Thu, 9 Dec 2021 13:47:07 +0000 (15:47 +0200)]
Bug 29669: fix uninitialized value warnings when XSLTParse4Display is called

Wrong key 'xsl_filename' is present in opac-tags.pl and shelves.pl
(the only places where it is used in the code even) instead of
'xsl_syspref' that is actually used and this is the cause of those
warnings.

Also added honeypot to check if other calls in same way happens.
Honeypot probably not needed, review when QA in the Community.

To reproduce (shelves.pl):
1) Prepare some test list with items or use existing one.
2) Go to the lists page (koha/virtualshelves/shelves.pl),
notice multitude of new warnings in the "intranet-error.log" log file
that mostly have to do with "Use of uninitialized value $xslsyspref".
3) Apply the patch.
4) Go back to same page and check it again, warns like that should not
appear in the log file anymore.

To reproduce (opac-tags.pl):
1) Go to the "my tags" page in OPAC and open "tag cloud".
2) Notice a bunch of new warnings in the log file that mostly have to
do with "Use of uninitialized value $xslsyspref".
3) Apply the patch.
4) Reload the page and check the log file again.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29679: Remove redundant divider element from reports menu
Owen Leonard [Mon, 13 Dec 2021 12:16:06 +0000 (12:16 +0000)]
Bug 29679: Remove redundant divider element from reports menu

The SQL report batch operations dropdown menu has divider list items
which add a border between sections (Bibliographic records, item
records, etc.). This element is redundant because the sections have
"headers" which also add a border.

This patch removes them.

To test, apply the patch and run an SQL report which will return results
that trigger the batch modification menu:

SELECT biblio.biblionumber , biblio.title, items.itemnumber,
items.itemcallnumber, items.barcode, borrowers.firstname,
borrowers.surname, borrowers.borrowernumber, borrowers.cardnumber
FROM issues
LEFT JOIN borrowers ON borrowers.borrowernumber=issues.borrowernumber
LEFT JOIN items ON issues.itemnumber=items.itemnumber
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
ORDER BY RAND()

There should be no double border in the menu.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27801: Fix javascript price calculations
Martin Renvoize [Fri, 3 Dec 2021 15:29:00 +0000 (15:29 +0000)]
Bug 27801: Fix javascript price calculations

This patch ensures we're formatting the price values consistently for
the table total and the amount to pay input field.

Test plan
1) Add an item to charge at 0.10.
2) Add this same item 8 or 9 times (Do not use the 'quantity')
3) Note that the table total and the 'Amount paid' values do not match
4) Apply the patch and repeat the above steps.. the values should now
   match.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29349: (follow-up) Fix width of item level dropdowns
Lucas Gass [Tue, 7 Dec 2021 19:21:03 +0000 (19:21 +0000)]
Bug 29349: (follow-up) Fix width of item level dropdowns

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29349: Do not assume holding branch is a valid pickup location
Tomas Cohen Arazi [Fri, 3 Dec 2021 19:45:21 +0000 (16:45 -0300)]
Bug 29349: Do not assume holding branch is a valid pickup location

The original code for pickup locations when placing item-level holds
picked the currently logged-in library.

We made things more robust, as the logged-in library might not be a
valid pickup location for the patron and item. But it was wrongly chosen
to use the holding branch as the default.

A more robust approach is needed, and this precedence is picked this
time (it could be configuration-driven in the future):

    - Logged-in library
    - Empty

To test:
1. Pick a biblio with various valid pickup locations, some not including
   the logged-in library.
2. Pick a patron for placing the hold
=> FAIL: Notice that (when valid pickup location) the holding branch is
always chosen
3. Apply this patch
4. Repeat 2
=> SUCCESS: If valid pickup location, the logged-in branch is picked as
default for item-type level. When it is not, an empty dropdown is used
as a fallback.
5. Sign off :-D

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28855: (follow-up) adapt specific test
Marion Durand [Tue, 9 Nov 2021 13:08:58 +0000 (13:08 +0000)]
Bug 28855: (follow-up) adapt specific test

Adapt the test of function DelSuggestionsOlderThan to match the new behaviour of the function.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28855: Purging suggestions test should not be on timestamp
Marion Durand [Fri, 22 Oct 2021 13:07:43 +0000 (15:07 +0200)]
Bug 28855: Purging suggestions test should not be on timestamp

DelSuggestionsOlderThan is on "date", a timestamp. It can be a problem
because "date" is updated when we update the database, in consequences
all the suggestions take the same date.

This patch use 'manageddate' instead.

In order to test this patch, you will need to have some suggestions
where "Managed on" (suggestions.manageddate in the database) is older
from "Last updated" (suggestions.date in the database). This can append
during some specific update. If you don't have such data, you will have
to add them via SQL request.

Example of sql for insertion (ID is the patron id of a librarian which
can manage suggestions):
INSERT INTO suggestions (suggestedby, suggesteddate, managedby,
manageddate, acceptedby, accepteddate, STATUS, title) VALUES (1,
'2020-10-13', 1, '2020-10-26', 1, '2020-10-26', 'ACCEPTED', 'title');

Test plan:
1- Choose a date and find (or add) a suggestion where:
    - "Last updated" is not older than this date
    - "Managed on" is older than this date
    - "Status" is different from "Pending" ("ASKED" in database)
Calculate number_days = today's date - chosen date
Example: (Today's date 28/10/2021, chosen date : 28/10/2020,
number_days=365)
Suggestion | .. | Managed on | .. | Last updated | .. | Status
title      | .. | 10/26/2020 | .. | 05/15/2021   | .. | Accepted

2- Run cron job
/home/koha/src/misc/cronjobs/purge_suggestions.pl --confirm --days number_days

3- Check that this suggestion has not been deleted

4- Apply the patch

5- Repeat steps 1 and 2

6- Check that this suggestion has been deleted

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29040: Remove warning from the itemtype edit view
Jonathan Druart [Fri, 19 Nov 2021 13:54:58 +0000 (14:54 +0100)]
Bug 29040: Remove warning from the itemtype edit view

Use of uninitialized value $interface in concatenation (.) or string at /kohadevbox/koha/C4/Languages.pm line 121.

We are expecting "intranet" or "opac, here we sent undef which raises a
warning.
For no change in behaviour we can send "both" (or whatever different
than "intranet" and "opac").

Test plan:
Hit /cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK
Notice that the warning does no longer appear in the logs with the patch
applied.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28216: Fix vendor list group by in serials statistics wizard
Fridolin Somers [Mon, 26 Apr 2021 07:40:08 +0000 (09:40 +0200)]
Bug 28216: Fix vendor list group by in serials statistics wizard

Bug 24940 added sort vendor list by aqbookseller.name but removed accidentally the group by.
Now vendors are repeated in the list.

Test plan :
1) Create several subscriptions for same vendor
2) Go to Reports > Serials
3) Check list of vendors
=> Without patch you see the same vendor several times
=> With patch you seen it once
4) Check sort is still on vendor name

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoRevert "Bug 29586: Add atomic update for existing intallations"
Kyle Hall [Fri, 17 Dec 2021 13:58:30 +0000 (08:58 -0500)]
Revert "Bug 29586: Add atomic update for existing intallations"

This reverts commit 352843bd61006761fb269608c398f395c763df21.

2 years agoRevert "Revert "Bug 29631: (QA follow-up) Add missing cleanups""
Kyle Hall [Fri, 17 Dec 2021 13:58:18 +0000 (08:58 -0500)]
Revert "Revert "Bug 29631: (QA follow-up) Add missing cleanups""

This reverts commit 1e2e912be36000d8cb7b93d7848861d709e25192.

2 years agoRevert "Bug 29631: (QA follow-up) Add missing cleanups"
Kyle Hall [Fri, 17 Dec 2021 13:57:19 +0000 (08:57 -0500)]
Revert "Bug 29631: (QA follow-up) Add missing cleanups"

This reverts commit 4862eeab010b1e649f3d727859625538850e0b02.

2 years agoRevert "Bug 29586: Fix typos in installer files"
Kyle Hall [Fri, 17 Dec 2021 13:57:15 +0000 (08:57 -0500)]
Revert "Bug 29586: Fix typos in installer files"

This reverts commit f360bfcd613def19a9244374f7fc57c9b30c9644.

2 years agoRevert "Bug 29586: DB Rev 21.11.01.001"
Kyle Hall [Fri, 17 Dec 2021 13:56:54 +0000 (08:56 -0500)]
Revert "Bug 29586: DB Rev 21.11.01.001"

This reverts commit 87fe54e71bdcd73a4f46dd0adc62ac598bb25021.

2 years agoBug 29586: DB Rev 21.11.01.001
Kyle Hall [Fri, 17 Dec 2021 13:54:00 +0000 (08:54 -0500)]
Bug 29586: DB Rev 21.11.01.001

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29586: Add atomic update for existing intallations
Jonathan Druart [Wed, 1 Dec 2021 09:21:59 +0000 (10:21 +0100)]
Bug 29586: Add atomic update for existing intallations

In case an installation was created on 21.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29586: Fix typos in installer files
Nick Clemens [Mon, 29 Nov 2021 12:44:07 +0000 (12:44 +0000)]
Bug 29586: Fix typos in installer files

When HOLD_REMINDER info was added I neglected to move the semicolons, this meant
the statements were ending before the data was added

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29631: (QA follow-up) Add missing cleanups
Tomas Cohen Arazi [Mon, 13 Dec 2021 10:27:28 +0000 (07:27 -0300)]
Bug 29631: (QA follow-up) Add missing cleanups

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29631: Prevent uniq_lang creation to fail
Jonathan Druart [Fri, 3 Dec 2021 13:33:41 +0000 (14:33 +0100)]
Bug 29631: Prevent uniq_lang creation to fail

We got 2 reports of this problem in the last 24h, uniq_lang unique key is failing to be created because several rows with the same (subtag, type) exist in DB.

I have no idea how this is possible, but apparently it is.

Test plan:
Checkout a commit before 21.06.00.012
reset_all
Create duplicate in language_subtag_registry
> insert into language_subtag_registry(subtag, type, description) values('IN', 'region', 'India');
Checkout master+this patch, updatedatabase
=> Only 1 IN-region exists in the DB, the last one.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29115: Fix syntax errors in club hold functionality
Joonas Kylmälä [Sun, 26 Sep 2021 15:36:45 +0000 (15:36 +0000)]
Bug 29115: Fix syntax errors in club hold functionality

The code didn't previously correctly do the checks for patron
debarment status and whether the patron has fees, this caused the
intended warnings messages to not appear when they should have.

To test:
 1) Create a new club and add a patron to it who has manual debarment
    and a manual charge of over $5 (more than the maxoutstanding syspref).
 2) Try to create a new club hold for the previously created club and
    notice no warnings are listed for the patron.
 3) Apply patch
 4) Try to create now the club hold again and notice the warnings
    being shown in the hold page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29611: Clubs enrollment layout problem in the OPAC
Owen Leonard [Wed, 1 Dec 2021 15:44:26 +0000 (15:44 +0000)]
Bug 29611: Clubs enrollment layout problem in the OPAC

This patch makes a minor change to the HTML of the clubs enrollment form
in the OPAC so that the layout works better.

To test you should have at least one club available which allows public
enrollment. The club should have at least one enrollment field
configured.

- Apply the patch and log in to the OPAC.
- On the "Your summary" page, click the "Clubs" tab.
- Click "Enroll" next to the club you configured.
- You should see an enrollment form with the field(s) you configured.
- The "Finish enrollment" button should be styled green and should be
  positioned inside the box which delineates the Clubs tab.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 9565: Use Koha::Biblio
Jonathan Druart [Mon, 6 Dec 2021 13:44:07 +0000 (14:44 +0100)]
Bug 9565: Use Koha::Biblio

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 9565: (follow-up) Adapt batch record deletion tool
Marion Durand [Thu, 2 Dec 2021 12:41:11 +0000 (13:41 +0100)]
Bug 9565: (follow-up) Adapt batch record deletion tool

Add a column "Subscriptions" to the batch deletion tools
Add a link on the number of subscription to the search page with all the subscriptions of the record
Add a button in the toolbar to select only biblio record without subscriptions

The changes are only on display
It is still possible to delete records that are attached to subscriptions from this tool (as it is possible for records with attached items)

To test:
1) Go to the batch record deletion (in tools)
2) Select a list of record numbers (select some with one or more subscription)
3) Click on Continue
4) Check that there is no column named "Subscription" and that there is no button "Select without subscription" in the toolbar
5) Apply patch
6) Repeat steps 1 to 3
7a) Check that there is a column named "Subscription" fill with the number of subscriptions attached to the record
7b) Check that the link in the subscriptions column send you to the search page with the subscriptions linked to this record
7c) Check that there is a button "Select without subscription" in the toolbar that selects record with no subscription attached
8) Sign off

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 9565: (follow-up) Deleting a biblio should alert/fail if there are existent subsc...
Marion Durand [Thu, 21 Oct 2021 13:06:02 +0000 (15:06 +0200)]
Bug 9565: (follow-up) Deleting a biblio should alert/fail if there are existent subscriptions

Clicking on "Delete record" while there are existent subscriptions no
longer delete the record and the subscription. Instead an alert box
inform the user that he must delete all subscription before deleting the
record.

To test:
1) Add a subscription to a biblio, or check a biblio which has one
   attached already.
2) Remove all items if there are any.
3) Apply patch.
4) Confirm that the 'Delete record' item is disabled in the list.
5) Attempt to 'Delete record', you should recieve
   an error message stating to delete all subscriptions before
   deleting record.
6) Sign off.

Sponsored by: Lunds Universitetsbibliotek

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 9565: Deleting a biblio should alert/fail if there are existent subscriptions
Timothy Alexis Vass [Fri, 13 Nov 2020 09:47:32 +0000 (09:47 +0000)]
Bug 9565: Deleting a biblio should alert/fail if there are existent subscriptions

Currently Koha will delete a biblio record if there are existent serial subscriptions.
This patch will prevent deleting the biblio until attached subscriptions are removed.

To test:
1) Add a subscription to a biblio, or check a biblio which has one attached already.
2) Remove all items if there are any.
3) Apply patch.
4) Confirm that the 'Delete record' item is disabled in the list.
5) Sign off.

Sponsored by: Lunds Universitetsbibliotek

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29484: Make ListSets return noSetHierarchy when no sets defined
Tomas Cohen Arazi [Mon, 15 Nov 2021 12:52:15 +0000 (09:52 -0300)]
Bug 29484: Make ListSets return noSetHierarchy when no sets defined

This simple patch makes our OAI-PMH server return the appropriate error
code when no sets are defined.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ t/db_dependent/OAI/Server.t
=> FAIL: Tests fail. Boo!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! YAY!
5. Sign off :-D

Bonus: you can check with the tool mentioned on the bug report, that
the error is gone. No sets need to be defined.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
JD amended patch
-    ) unless scalar @{$sets} > 0;
+    ) unless @$sets;

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29484: Regression tests
Tomas Cohen Arazi [Mon, 15 Nov 2021 12:51:53 +0000 (09:51 -0300)]
Bug 29484: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29620: (follow-up) Rename remaining old-style parameters
Tomas Cohen Arazi [Thu, 2 Dec 2021 15:25:42 +0000 (12:25 -0300)]
Bug 29620: (follow-up) Rename remaining old-style parameters

The first routes we added named parameters in camelCase. We moved to
snake_case really fast, but there are two that were kept by mistake.

This patch fixes them.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>