koha.git
2 years agoBug 12446: (QA follow-up) Minor kohastructure.sql fix
Tomas Cohen Arazi [Thu, 23 Jun 2022 15:14:33 +0000 (12:14 -0300)]
Bug 12446: (QA follow-up) Minor kohastructure.sql fix

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12446: DBRev 22.06.00.004
Tomas Cohen Arazi [Thu, 23 Jun 2022 15:00:36 +0000 (12:00 -0300)]
Bug 12446: DBRev 22.06.00.004

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12446: DBIC update
Tomas Cohen Arazi [Thu, 23 Jun 2022 14:50:12 +0000 (11:50 -0300)]
Bug 12446: DBIC update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12446: Add canbeguarantee value to patron categories sample data
Maryse Simard [Thu, 12 Nov 2020 21:01:35 +0000 (16:01 -0500)]
Bug 12446: Add canbeguarantee value to patron categories sample data

This patch changes sample data so patron categories of type 'C' or
'P' can be guarantees by default.

Signed-off-by: Salman Ali <salman.ali@inlibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12446: Fix typos
The Minh Luong [Mon, 21 Mar 2022 13:21:50 +0000 (09:21 -0400)]
Bug 12446: Fix typos

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
JD Amended patch: squashed and edited commit message

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12446: Limit available categories when using "Add guarantee" button
Maryse Simard [Wed, 21 Oct 2020 00:39:51 +0000 (20:39 -0400)]
Bug 12446: Limit available categories when using "Add guarantee" button

Test plan:
1) Have some patron categories that can and cannot be guarantee
2) Visit a patron's account and click the "Add guarantee" button
3) In the "category" dropdown, note that all categories are available
4) Apply this patch
5) Repeat step 2 and 3; the dropdown now only contains the categories
for which "can be guarantee" is set to "Yes".

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12446: Ability to allow guarantor relationship for all patron category types
Maryse Simard [Fri, 2 Oct 2020 04:02:38 +0000 (00:02 -0400)]
Bug 12446: Ability to allow guarantor relationship for all patron category types

This adds a new field "Can be guarantee" to patron categories so it
becomes possible for any category type to have a guarantor.

To test:
1) Have a patron category of type 'Adult' and one of type 'Child'
2) Confirm, by searching for the "Patron guarantor" fieldset in the
edit/create form, that:
    => a patron of the first category can't have a guarantor
    => a patron from the second category can
3) Apply patch and run updatedatabase.pl
4) Edit the categories and note the new "Can be guarantee" field
5) It should have been set to "yes" for the "Child" and to "no" for
the "Adult"
5) Repeat step 2. It should behave in the same way.
6) Edit the "Can be guarantee" for any of the category and check
that the fieldset only appears when "Can be guarantee" is set to "yes"
7) prove t/db_dependent/Patrons.t
    => tests should still pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30947: (follow-up) Remove unnecessary object cloning
Joonas Kylmälä [Sun, 19 Jun 2022 10:22:39 +0000 (10:22 +0000)]
Bug 30947: (follow-up) Remove unnecessary object cloning

CalcDateDue() works on its own copy of the $startdate parameter
so the cloning in the calling end is not necessary.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30947: Simplify CanBookBeIssued date handling
Joonas Kylmälä [Sat, 11 Jun 2022 10:50:06 +0000 (10:50 +0000)]
Bug 30947: Simplify CanBookBeIssued date handling

1) This removes support for passing string dates to CanBookBeIssued. The
function didn't publicly even document support for string dates, only
DateTime objects.

2) We get a $duedate always at least from CalcDateDue so having

 $issuingimpossible{INVALID_DATE} = output_pref($duedate);

was unneccesary and thus removed.

3) The check "duedate cannot be before now" was needlessly complex: if
the due date really cannot be before now we should check seconds too
and warn the librarian! Thus the truncation to minutes can be dropped
safely.

To test:
 1) prove t/db_dependent/Circulation.t
 2) prove t/db_dependent/Illrequests.t
 3) Enable OnSiteCheckouts and disable SpecifyDueDate syspref. Create
 on-site checkout for any patron and verify the due date is your
 current date at 23:59, you can check the exact minute with sql:
  > select * from issues

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30947: Add test for Illrequest checkout with custom due date
Joonas Kylmälä [Sat, 11 Jun 2022 10:50:41 +0000 (10:50 +0000)]
Bug 30947: Add test for Illrequest checkout with custom due date

To test:
 1) prove t/db_dependent/Illrequests.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25669: (follow-up) Minor fixes
Kevin Carnes [Wed, 25 May 2022 09:19:21 +0000 (09:19 +0000)]
Bug 25669: (follow-up) Minor fixes

Bulk doesn't support include_type_name, update requirement to
Search::Elasticseach@6.80, and remove data type name from tests.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25669: Use include_type_name parameter in ES calls
Nick Clemens [Mon, 28 Mar 2022 12:00:25 +0000 (12:00 +0000)]
Bug 25669: Use include_type_name parameter in ES calls

This patch includes the parameter:
include_type_name
on our ES calls

It removes the deprecation warning we are seeing, and should allow using ES7 with no other chnages.

For ES8 we will need to remove the hardcoded type,

I would suggest a second patch, with a new syspref "ElasticsearchLegacyType" set to 'True' by default.
Description can explain that this must be set to false, and data reindexed after upgrading to ES7 and before
upgrading to ES8 - then we can drop this pref when we drop ES7 support

When we drop ES6 support the pref can be set default true for upgrades, default 'false' for new installs

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31013: Quote branchcodes in Elasticsearch limits
Nick Clemens [Wed, 22 Jun 2022 13:19:03 +0000 (13:19 +0000)]
Bug 31013: Quote branchcodes in Elasticsearch limits

This patch adds quoting when handling branchcodes in searching in order
to prevent errors when branchcodes are reserved words in ES

To test:
0 - Be using Elasticsearch with Koha
1 - Add a new branch code:OR name:Orly
2 - Add an item to this branch
3 - Use advanced search to limit search to only Orly
4 - Oh really bad, the search fails!
5 - Apply patch
6 - Repeat search
7 - Oh really good, the search succeeds
8 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30822: Clarify that BatchCommitItems is a private function
Martin Renvoize [Thu, 26 May 2022 12:03:10 +0000 (13:03 +0100)]
Bug 30822: Clarify that BatchCommitItems is a private function

BatchCommitItems is only being used within this module and isn't
mentioned in EXPORT_OK. This patch simply renames it to
_batchCommitItems to take the _ standard for private functions and also
adds a little hint to the POD of the function to clarify that the caller
must trigger a re-index.

JK: Amended patch to rename also the function in t/db_dependent/ImportBatch.t
    and fix typo "commiting" => "commiting"

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30822: Make BatchCommitRecords update the index in one request
Martin Renvoize [Fri, 20 May 2022 15:59:23 +0000 (16:59 +0100)]
Bug 30822: Make BatchCommitRecords update the index in one request

When committing staged marc imports to the catalogue we will often be
importing a batch of records. We don't want to send one index request
per biblio affected, we want to index them all after the records have
been modified otherwise we will end up with multiple tasks per record
(when items are also affected).

Test plan:
1) Use the stage marc record tool to stage and commit a set of records and
confirm the behaviour remains correct.
2) If using Elastic, check that only one indexing job is queued to take
place resulting from the committed import.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28355: (QA follow-up) Move Note to new line
Katrin Fischer [Fri, 17 Jun 2022 20:10:55 +0000 (22:10 +0200)]
Bug 28355: (QA follow-up) Move Note to new line

There is an existing pattern for the 'Note:' in pref
descriptions, where it's always added on a new line.
This changes the formatting to match that pattern.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28355: Add a note that SMS to email via mobile provider is not recommended
Nick Clemens [Fri, 17 Jun 2022 12:00:34 +0000 (12:00 +0000)]
Bug 28355: Add a note that SMS to email via mobile provider is not recommended

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30958: OPAC overdrive search result page broken for translations
Alex Buckley [Mon, 13 Jun 2022 22:54:54 +0000 (22:54 +0000)]
Bug 30958: OPAC overdrive search result page broken for translations

Note: You will need a valid OverDrive subscription to test this.

This patch fixes a JavaScript error thrown on the OPAC overdrive search
results page for libraries using translation templates and who don't
have the OverDrivePasswordRequired system preference = 'Required'.

Test plan:
1. Install the en-NZ translation: https://wiki.koha-community.org/wiki/Installation_of_additional_languages_for_OPAC_and_INTRANET_staff_client

2. Enable the en-NZ language:
   - In the OPACLanguages system preference -> tick 'English New Zealand
     (en-NZ)' checkbox and untick 'English (en)'

3. Fill in the OverDrive system preferences:
   - Make sure you set: OverDrivePasswordRequired = "Not required"

4. Perform an OPAC search

5. Click on the Overdrive results link

6. Open the browser console and notice there is a JS error, and the
   OverDrive results do not load

7. Apply patch

8. Update the en_NZ translation:

9. Repeat steps 4, 5 and 6 and notice there is no JavaScript error and
   the OverDrive results do display

Sponsored-by: Melbourne Athenaeum Library, Australia
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29504: (follow-up) Account for other blockers
Martin Renvoize [Wed, 15 Dec 2021 09:20:52 +0000 (09:20 +0000)]
Bug 29504: (follow-up) Account for other blockers

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29504: Allow 'ADDITIONAL_MATERIALS' check to be confirmed
Martin Renvoize [Mon, 22 Nov 2021 11:33:25 +0000 (11:33 +0000)]
Bug 29504: Allow 'ADDITIONAL_MATERIALS' check to be confirmed

The additional materials check when CircConfirmParts is enabled was
errantly relying upon the 'FORCE_CHECKOUT' permission.  This patch
updates the template to allow confirmation as well as cancellation of
chekout.

Test plan
1. Set a staff member with circ permissions, but not FORCE_CHECKOUT
2. Turn on CircConfirmItemParts
3. Log in as staff member in step 1
4. Attempt to checkout an item with a 952$3
5. The only option given is the Continue button (with a red X) and when
   clicked, the item does not get checked out.
6. Apply patch
7. Repeat step 4.
8. You should now have the option to 'Yes, check out (Y)' or
   'No, don't check out (N)'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30997: Fix "CGI::param called in list context" warning in detail.pl
Petro Vashchuk [Mon, 20 Jun 2022 14:08:32 +0000 (17:08 +0300)]
Bug 30997: Fix "CGI::param called in list context" warning in detail.pl

CGI param found1 should be explicitly scalar,
or else error log gets flooded with this warning:

CGI::param called in list context from
/usr/share/koha/intranet/cgi-bin/catalogue/detail.pl line 622

This patch fixes it by working with it in a scalar context.
The functionality still remains the same but warning doesn't flood
error log.

To reproduce:
1. Open any biblio (details.pl) page.
2. Check the error log and find the upper mentioned warning,
check the timestamp to ensure that it was added when you loaded the page.
3. Apply the patch.
4. Load the page again, ensure that the same warning doesn't get added
to the log file again.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30989: (QA follow-up) Use uri filter on OPAC tag cloud page
Katrin Fischer [Fri, 17 Jun 2022 22:23:31 +0000 (22:23 +0000)]
Bug 30989: (QA follow-up) Use uri filter on OPAC tag cloud page

This fixes 2 links on the page:
* The tag within the 'all tags' cloud
* The tag shown in the 'your tags' table

Test plan as before: Test with a tag like +++

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30989: (QA follow-up) Use uri filter on staff detail page
Katrin Fischer [Fri, 17 Jun 2022 21:26:55 +0000 (21:26 +0000)]
Bug 30989: (QA follow-up) Use uri filter on staff detail page

This applies the same fix as the first patch but to the staff
interface detail page. With this fix, a tag like +++ can
be clicked and the tagged records will show.

To test:
- Tag some records in the staff interface with something like +++
- Go to the detail page of one of those recods
- Click on the tag
- Verify nothing is found
- Apply patch
- Repeat - all tagged records will show

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30989: Use uri filter where tag links are displayed
Lucas Gass [Fri, 17 Jun 2022 19:45:42 +0000 (19:45 +0000)]
Bug 30989: Use uri filter where tag links are displayed

TO test:
1. Turn on:  TagsEnabled.
2. Log in to the OPAC and create a tag like "LGBTQ+"
3. Add that record to a list
3. Now try  clicking on that tag from detail, results, and lists page.
4. If you click on the link for the "LGBTQ+" you will get a 'no results found page'.
5. Apply patch
6. Try clicking on each of the tags in detail, results, and lists. They should work now.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30960: Fix JS error message when no pick-up location is selected when placing...
Petro Vashchuk [Mon, 13 Jun 2022 12:02:28 +0000 (15:02 +0300)]
Bug 30960: Fix JS error message when no pick-up location is selected when placing a hold

It's possible to place item-level hold without selecting a pick-up
location, which causes problems: if the item is then returned,
Koha tells about a hold, but gives error 500.
At patron's hold tab you see the number of holds, but cannot see the
actual holds there. However, if you go to the title in question,
then modify the hold so that it has a pick-up location,
then the hold will work normally again.

This patch fixes already existing but not working JS error message and
ensures that hold cannot be made while pickup location is undefined.

To reproduce:
1. Go to admin page, to the libraries configurations, and disable
pickup location for one of them.
2. Pick any biblio that has items that have that same library as a
default pickup location.
3. When placing the item-level hold, notice that the pickup location
dropdown box is empty by default. Keep it empty, place the hold.
4. Go to the patron's page of the patron who you placed that hold for,
check that it doesn't show the new hold.
5. Apply patch.
6. Repeat steps 2 and 3, it shouldn't let you make the item-level hold
until you select a specific pickup location.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30972: Don't replace biblio's local cover images when uploading an image's image
Jonathan Druart [Thu, 16 Jun 2022 10:29:14 +0000 (12:29 +0200)]
Bug 30972: Don't replace biblio's local cover images when uploading an image's image

When attaching a new cover image to an item we should not replace cover
images attached to the bibliographic record if "Replace existing covers"
is ticked.

Test plan:
Attach 1+ image to a bibliographic record
Attach 1 image to an item of this biblio
Attach another image to the item and seect "replace existing covers"
=> Without this patch the images attached to the biblio are removed
=> With this patch applied only the images attached to the image are
removed

Same if you tick the checkbox when attaching an image to the biblio

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30234: Fix local cover image display for other holdings
Jonathan Druart [Mon, 7 Mar 2022 10:30:35 +0000 (11:30 +0100)]
Bug 30234: Fix local cover image display for other holdings

Bug 26145 added the ability to add local cover images to items.
If SeparateHoldings is set, items from other libraries are displayed in
a separate tab, and not considered as visible. We have a JS test to
assume that images not shown are not present, this only apply for the
images for the bibliographic record, as they can come from different
sources.

Test plan:
Turn on LocalCoverImages and SeparateHoldings
Create a record with different items coming from different libraries
Attach images to items and to the biblio
Notice that with this patch you can see the images from the "Other
holdings" tab

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30925: Fix category parameter for addbybiblionumber
Marcel de Rooy [Mon, 20 Jun 2022 07:03:17 +0000 (07:03 +0000)]
Bug 30925: Fix category parameter for addbybiblionumber

In bug 28959 category was replaced in favor of public. But
unfortunately a few places were missed.
This fixes the addbybiblionumber templates.

Test plan:
Add a biblio to a list from the search results using the Add to
or Add to list button on OPAC/intranet.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29963: Do not prefill empty date fields with today's date
Petro Vashchuk [Fri, 3 Jun 2022 16:10:03 +0000 (19:10 +0300)]
Bug 29963: Do not prefill empty date fields with today's date

Revert "Bug 29815: Pre-populate 'Date acquired' field when adding/editing items"
commit bd197c64567fba6899f12e4897d786adf52384d8

Items date fields in MARC framework with dateaccessioned.pl assigned as
plugin automatically prefilled by it with today's date if empty on page
load.

This becomes big problem because it silently changes empty date fields
in single item edit form with today's date. This drastically degrades
UX because user won't noitce that fields were filled.

Also, even when user aware about this problem, user is forced to clean
the field manually each time they edit items with empty fields.

Also in item batch edit tool the probability heavily increases to make
mistake and leave those fields prefilled on mass.

To reproduce problem with single item edit:
1. Edit single item that doesn't have a date set in any of the date
fields where dateaccessioned.pl in MARC framework assigned as plugin,
see that the field got prefilled with today's date.
2. Save the item. See that it overwrote the previously empty date.
3. Apply the patch.
4. Edit single item again, and ensure that the empty date fields don't
get overwriten like it happened previously.

To reproduce problem with bath edit:
1. Edit items in batch for any biblio, see that the date fields where
dateaccessioned.pl in MARC framework assigned as plugin is automatically
 set to current day's date.
2. Apply the patch.
3. Check the fields again, they should be empty after that.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30938: Convert ColumnSettings to TableSettings
Lucas Gass [Fri, 10 Jun 2022 17:27:16 +0000 (17:27 +0000)]
Bug 30938: Convert ColumnSettings to TableSettings

To test:
1. Apply this patch
2. Go to /cgi-bin/koha/acqui/acqui-home.pl
3. The columns button should be restored, make sure you can hide/show columns correctly.
4. Go to Table settings and make sure you can hide columns properly by default.

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>
2 years agoBug 30733: Split strings differently
Victor Grousset/tuxayo [Fri, 10 Jun 2022 23:46:40 +0000 (01:46 +0200)]
Bug 30733: Split strings differently

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: fix url => URL to merge with existing string
Victor Grousset/tuxayo [Mon, 13 Jun 2022 03:29:00 +0000 (05:29 +0200)]
Bug 30733: fix url => URL to merge with existing string

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: Undo some <span> additions that don't yield good strings
Victor Grousset/tuxayo [Mon, 13 Jun 2022 02:49:00 +0000 (04:49 +0200)]
Bug 30733: Undo some <span> additions that don't yield good strings

They need more complex solutions that would be better in a follow up ticket
to not drag this one too long.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: Simplify some singular cases
Victor Grousset/tuxayo [Sat, 11 Jun 2022 23:42:40 +0000 (01:42 +0200)]
Bug 30733: Simplify some singular cases

To be sure translators don't think it's wrong and translate it plurally.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: Undo <span> in an ICS calendar file
Victor Grousset/tuxayo [Thu, 2 Jun 2022 03:42:33 +0000 (05:42 +0200)]
Bug 30733: Undo <span> in an ICS calendar file

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: Wrap one more string in <span>
Victor Grousset/tuxayo [Thu, 2 Jun 2022 03:37:55 +0000 (05:37 +0200)]
Bug 30733: Wrap one more string in <span>

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: Undo bad handling of a plural case
Victor Grousset/tuxayo [Thu, 2 Jun 2022 02:46:27 +0000 (04:46 +0200)]
Bug 30733: Undo bad handling of a plural case

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: Fix string context lost due to being in two parts
Victor Grousset/tuxayo [Thu, 2 Jun 2022 01:35:23 +0000 (03:35 +0200)]
Bug 30733: Fix string context lost due to being in two parts

Due to conditions. Things like "Edit batch" need to be keept in one
strings.

Also removed some capitalization because it wasn't needed and wasn't
consistend with <title> and <h1> which had now capitalization.

Also fixed patron edit-batch.tt and edit-layout.tt because they were
incomplete in regard to their label counterparts. They had the condition
on description and batch_id but weren't displaying anything different
between the two cases.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: Move all semicolons inside the translatable strings
Victor Grousset/tuxayo [Sun, 29 May 2022 23:45:29 +0000 (01:45 +0200)]
Bug 30733: Move all semicolons inside the translatable strings

In the 1st patch, sometimes they where left out

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30733: Simplify translatable strings
Victor Grousset/tuxayo [Wed, 11 May 2022 15:08:32 +0000 (17:08 +0200)]
Bug 30733: Simplify translatable strings

And a few minor fixes when they where causing issues for
translatability.
And rephrased a string about password reset to have it identical to
other strings with the same meaning.

Simplified via wrapping strings with <span> to split to huge
concatenated strings with a lot of %s everywhere.

== Test plan ==
This patch needs mainly proof reading. Still it's possible to do some
basic testing to demonstrate that adding a <span> in an IF doesn't
break anything.
Pick in one of the 110 modified templates a string that you know how to
display. Otherwise:
1. acquisitions => vendor => basket => add to basket =>
   search "from existing record" => add order
2. Cancel the order
3. You see without issue "Bibliographic record will not be deleted"
4. administration => Patron categories
5. Try to delete a used and unused category
6. You see as expected
   Category XXXX is in use. Deletion not possible!
   and
   Confirm deletion of category XXXX

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30924: DBRev 22.06.00.003
Tomas Cohen Arazi [Thu, 16 Jun 2022 14:36:43 +0000 (11:36 -0300)]
Bug 30924: DBRev 22.06.00.003

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30954: (bug 27344 follow-up) Remove background_jobs_update_elastic_index.inc
Jonathan Druart [Mon, 13 Jun 2022 12:47:12 +0000 (14:47 +0200)]
Bug 30954: (bug 27344 follow-up) Remove background_jobs_update_elastic_index.inc

includes/background_jobs_update_elastic_index.inc
vs
includes/background_jobs/update_elastic_index.inc

Both exist and have been added by bug 27344.
The first one is not used.

Test plan:
  git grep background_jobs_update_elastic_index.inc
must not return any occurrences (outside of POs)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30973: Serials search fix body id
Fridolin Somers [Thu, 16 Jun 2022 07:55:51 +0000 (21:55 -1000)]
Bug 30973: Serials search fix body id

The serials search page serials/serials-search.pl has HTML body id :
  <body id="ser_serials-home" class="ser">
It is the same as serials home page.

This patch replaces with id="ser_serials-search"

Test plan :
1) Go to Serials > Advanced search
2) Look at HTML code
3) Check you see <body id="ser_serials-search" class="ser">

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30974: Set size for indexing jobs to 1
Jonathan Druart [Thu, 16 Jun 2022 08:22:02 +0000 (10:22 +0200)]
Bug 30974: Set size for indexing jobs to 1

job's size is the number of records to index, but when finished the progress is always set to 1.

Wich leads to: finished 1/42

Test plan:
Don't apply this patch
Use the batch item modification tool to update more than 1 item
Notice that the new indexing job has a size of the number of items you
modified
When finished, the job detail shows "Finished. 1/X"
Apply this patch, repeat
Notice that now the progress shows 0/1 before the job is done, then 1/1
when finished

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30971: (follow-up) Fix recall.branchcode occurences
Tomas Cohen Arazi [Wed, 15 Jun 2022 19:26:51 +0000 (16:26 -0300)]
Bug 30971: (follow-up) Fix recall.branchcode occurences

This fixes a couple cases actually.

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>
2 years agoBug 30971: (follow-up) Fix one more occurence
Tomas Cohen Arazi [Wed, 15 Jun 2022 19:18:08 +0000 (16:18 -0300)]
Bug 30971: (follow-up) Fix one more occurence

To test:
1. Run:
   $ git grep 'recall.itemnumber'
=> SUCCESS: No more occurences
2. Run:
   $ git grep 'recall.biblionumber'
=> SUCCESS: No more occurences
3. Run:
   $ git grep 'recall\->biblionumber'
=> SUCCESS: No more occurences
4. Run:
   $ git grep 'recall\->itemnumber'
=> FAIL: One standing occurence
5. Apply this patch
6. Repeat 4
=> SUCCESS: No more occurences
7. 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>
2 years agoBug 30971: Recalls log viewer error
Tomas Cohen Arazi [Wed, 15 Jun 2022 19:14:22 +0000 (16:14 -0300)]
Bug 30971: Recalls log viewer error

This patch addresses the itemnumber and biblionumber attributes for
recalls having been renamed.

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>
2 years agoBug 30420: Rename Koha::Patron->get_overdues with ->overdues
Jonathan Druart [Wed, 27 Apr 2022 11:33:09 +0000 (13:33 +0200)]
Bug 30420: Rename Koha::Patron->get_overdues with ->overdues

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29623: (QA follow-up) Add POD to Koha::CirculationRules
Martin Renvoize [Fri, 10 Jun 2022 07:18:37 +0000 (08:18 +0100)]
Bug 29623: (QA follow-up) Add POD to Koha::CirculationRules

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29623: (QA follow-up) Add POD to Koha::Cache::Lite
Martin Renvoize [Fri, 10 Jun 2022 07:11:28 +0000 (08:11 +0100)]
Bug 29623: (QA follow-up) Add POD to Koha::Cache::Lite

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29623: Don't flush the whole L1 cache
Jonathan Druart [Tue, 31 May 2022 05:36:57 +0000 (07:36 +0200)]
Bug 29623: Don't flush the whole L1 cache

We shouldn't flush L1 cache completely, only the values related to the
circulation rules.
It is not correct to update the value of the value we are currently
setting (because of the inheritance concept of the circ rules).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29623: Cache circulation rules
Jonathan Druart [Thu, 2 Dec 2021 16:27:43 +0000 (17:27 +0100)]
Bug 29623: Cache circulation rules

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30917: Improve course reserves breadcrumbs
Owen Leonard [Tue, 7 Jun 2022 11:33:48 +0000 (11:33 +0000)]
Bug 30917: Improve course reserves breadcrumbs

This patch adds course name to the breadcrumbs and page title on the
pages for adding items to a course.

To test, apply the patch and go to course reserves.

- Click a course to view it.
- Click the "Add reserves" button.
- In the breadcrumbs you should see:

  Home > Course reserves > [Course name] > Add reserves

- [Course name] should link correctly to the course detail view. In the
  page title you should see:

  Add reserves > [Course name] > Course reserves > Home

- Enter a barcode or biblionumber and proceed to the next step. Confirm
  that the same changes are in effect on the second page.
- Perform the same tests in the "Batch add reserves" process.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30409: (QA follow-up) Avoid uninitialized variable warnings
Tomas Cohen Arazi [Tue, 14 Jun 2022 11:21:42 +0000 (08:21 -0300)]
Bug 30409: (QA follow-up) Avoid uninitialized variable warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30409: (QA follow-up) Fix grammar in syspref help text
Joonas Kylmälä [Sun, 12 Jun 2022 08:12:23 +0000 (08:12 +0000)]
Bug 30409: (QA follow-up) Fix grammar in syspref help text

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30409: barcodedecode() should always trim barcode
Petro Vashchuk [Sat, 2 Apr 2022 21:02:40 +0000 (00:02 +0300)]
Bug 30409: barcodedecode() should always trim barcode

Barcode is trimmed of leading/trailing whitespaces in many instances
before the barcodedecode sub was called. This patch instead makes that
barcodedecode sub is going to trim it itself and removes unnecessary,
and repetitive code that was used before barcodedecode was called.

Steps to test:
1. Edit item with any barcode, add a bunch of whitespaces at the start
and at the bottom of it. Save the item. Ensure that this action ruins
the barcode and ensure that the spaces are still there by editing the
same item again.
2. Apply the patch.
3. Edit the same item again in the same fashion. Ensure that now all
whitespaces are getting trimmed and it doesn't affect the barcode in
any negative way.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30824: (follow-up) POD
Martin Renvoize [Tue, 24 May 2022 14:29:04 +0000 (15:29 +0100)]
Bug 30824: (follow-up) POD

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30824: Improve performance of BatchCommitItems
Nick Clemens [Fri, 20 May 2022 14:29:58 +0000 (14:29 +0000)]
Bug 30824: Improve performance of BatchCommitItems

This makes two simple changes:
- Limit TransformMarcToKoha to the fields we need
- Pass forward the biblioitemnumber when adding items to a new biblionumber

Profiling with NYTProf I saved ~8-9 seconds importing around 400 bibs/1000 items

Reducing calls in item store to use a passed biblionumber was the largest gain.

To test:
1 - Import some records and items
2 - Verify values etc., revert
3 - Apply patch
4 - Import again
5 - Verify values etc. same as before

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30780: Librarians with only "place_holds" permissions can not update holds data...
Johanna Raisa [Tue, 17 May 2022 05:58:15 +0000 (08:58 +0300)]
Bug 30780: Librarians with only "place_holds" permissions can not update holds data via REST API

This patch enables librarians with only "place_holds" permissions to cancel, suspend and resume holds via REST API.

Test plan:
1) Try to cancel or suspend a hold with only "place_holds" permissions
2) See that it is forbidden.
3) Apply the patch
4) Cancel a hold again
5) The cancellation succeeds
6) prove t/db_dependent/api/v1/holds.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30780: Regression tests
Tomas Cohen Arazi [Mon, 13 Jun 2022 14:46:20 +0000 (11:46 -0300)]
Bug 30780: Regression tests

This patch lowers the used permissions on the suspend/resume tests, and
adds tests for fine-grained permissions on cancelling a hold.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30904: (bug 24387 follow-up) Fix library modification of additional contents
Jonathan Druart [Wed, 8 Jun 2022 09:56:30 +0000 (11:56 +0200)]
Bug 30904: (bug 24387 follow-up) Fix library modification of additional contents

Modifying an existing element of additional content (News) by changing
the library causes a duplication of the entry on the Additional contents
(News) list.  A subsequent attempt of deleting one of the entries results
in deleting both of them.  This is due to the fact that after
the unwanted duplication all the  entries share the same
additional_contents.code.

Test plan
=========

1. Create a piece of news under Tools > News.
2. After having saved it make a modification by changing the library.
   It should result in two rows in the table.
3. Delete one of the lines with Delete button.  Both lines will
   disappear.
4. Apply the patch.
5. Repeat the steps 1 and 2.  Only the one (the modified) entry should be
   present in the table.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30798: Change column order on account-fines table column settings
Emmi Takkinen [Wed, 18 May 2022 09:16:42 +0000 (12:16 +0300)]
Bug 30798: Change column order on account-fines table column settings

Columns Home library and Checked out from are in wrong order
on table settings. Because of this hiding Home library actually
hides Checkout out from column and vice versa. This patch changes
order of these columns on columns_settings.yml

To test:
1) Navigate to columns settings page and modify
account-fines tables column.
=> Note that if you hide  column checked_out_from, column
home_library is hidden on patrons account page.
2) Apply patch and restart plack etc.
=> Column checked_out_from should now be hidden.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30912: Fix db rev 21.12.00.016
Tomas Cohen Arazi [Mon, 13 Jun 2022 13:17:22 +0000 (10:17 -0300)]
Bug 30912: Fix db rev 21.12.00.016

This is a mix of Nick's patch and Jonathan's comment on it. I tested it
with KTD using MySQL 8 and it works correctly.

To test:
1. Launch KTD with bells and whistles:
   $ docker compose -f docker-compose.yml \
                    -f docker-compose.mysql8.0.yml \
                    up -d
2. Inside of it, do:
   $ koha-mysql kohadev
   > update systempreferences set value="21.1200015" where variable="version";
   > \q
   $ restart_all
   $ updatedatabase
=> SUCCESS: All good :-D
3. Run:
   $ koha-mysql kohadev
   > update systempreferences set value="21.1200015" where variable="version";
   > ALTER TABLE user_permissions DROP PRIMARY KEY;
   > \q
   $ updatedatabase
=> FAIL: You get:
Upgrade to 21.12.00.016  [12:47:09]: Bug 30060 - Update user_permissions to add primary key and remove null option from code column
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS `PRIMARY`' at line 1 at /kohadevbox/koha/C4/Installer.pm line 739
4. Apply this patch
5. Run:
   $ updatedatabase
=> SUCCESS: Update goes well
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30883: Authorities merge is limited to 100 biblio with Elasticsearch
Fridolin Somers [Thu, 2 Jun 2022 07:23:23 +0000 (21:23 -1000)]
Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch

In C4::AuthoritiesMarc::merge, we search all biblio records using an authority with Koha::Authorities->linked_biblionumbers().
This method uses simple_search_compat() with no results limit, even saying in comment :
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/Authorities.pm#L80

With Zebra searchengin it is correct.

But not with Elasticsearch, there is an hardcoded limit at 100 in case no limit is given :
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/SearchEngine/Elasticsearch/Search.pm#L346

This means authorities links are wrong after a merge or an edit in case the authority is used in more than 100 biblio records.

:(

I propose to fix by using by default the real server max given by Koha::SearchEngine::Elasticsearch::Search::max_result_window().
This will allow a huge limit nearly impossible to reach.
See Bug 30882 to how increase this limit.

Test plan :
1) Use Elasticsearch search engine
2) Use an authority id=111 linked to 200 biblio records
3) Perform a search 'an:111', you get 200 results
4) Create a new authority id=222 linked to 2 biblio records
5) Perform a search 'an:222', you get 2 results
6) Perform a merge of the two authorties, keeping id=222
7) Perform a search 'an:111'
   without patch you get 100 results
   with patch you get no results
8) Perform a search 'an:222'
   without patch you get 102 results
   with patch you get 202 results

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>
2 years agoBug 30914: (24153 follow-up) Fix cleanup_database.pl --transfers --old-reserves
Jonathan Druart [Tue, 7 Jun 2022 12:11:06 +0000 (14:11 +0200)]
Bug 30914: (24153 follow-up) Fix cleanup_database.pl --transfers --old-reserves

Silly mistake, 'delete if verbose' must be 'delete if confirm'

Test plan:
Try the cleanup_database.pl script to delete transfers and old issues.
Using --transfers --old-reserves and the --confirm flag the entries must be
removed

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30924: DBIC update
Tomas Cohen Arazi [Thu, 9 Jun 2022 15:03:48 +0000 (12:03 -0300)]
Bug 30924: DBIC update

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>
2 years agoBug 30924: Add missing branchtransfers.reason value for recall cancellation
Tomas Cohen Arazi [Thu, 9 Jun 2022 14:58:44 +0000 (11:58 -0300)]
Bug 30924: Add missing branchtransfers.reason value for recall cancellation

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>
2 years agoBug 30924: Fix transferstoreceive.pl explosion on recalls
Tomas Cohen Arazi [Thu, 9 Jun 2022 14:09:18 +0000 (11:09 -0300)]
Bug 30924: Fix transferstoreceive.pl explosion on recalls

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>
2 years agoBug 30399: Make Patron.t pass even if mandatory attributes exist
Jonathan Druart [Wed, 8 Jun 2022 09:39:43 +0000 (11:39 +0200)]
Bug 30399: Make Patron.t pass even if mandatory attributes exist

t/db_dependent/Koha/Patron.t is failing if mandatory attributes already
exist in the DB. We can make it pass easily by deleting all the
attributes before we run the tests.

Test plan:
  prove t/db_dependent/Koha/Patron.t
must return green even if one mandatory patron attribute exists.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12630: Rebase tests and cover CheckReserves
Nick Clemens [Fri, 10 Jun 2022 14:47:44 +0000 (14:47 +0000)]
Bug 12630: Rebase tests and cover CheckReserves

It turns out we do honor reservedate in CheckReserves, so a hold with a lower priority will
fill before a hold in the future. I add tests to cover this and fix the old tests to pass again

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12630: Add regression tests
Jonathan Druart [Wed, 5 Nov 2014 09:32:21 +0000 (10:32 +0100)]
Bug 12630: Add regression tests

Verify that the 2 tests failed before applying this patch and return
green after.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12630: (QA follow-up) - Rename _ShiftPriorityByDateAndPriority to _ShiftPriority
Kyle M Hall [Mon, 25 Aug 2014 14:17:28 +0000 (10:17 -0400)]
Bug 12630: (QA follow-up) - Rename _ShiftPriorityByDateAndPriority to _ShiftPriority

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 12630: Prioritizing "Hold starts on date" -holds causes all other holds to be...
Olli-Antti Kivilahti [Wed, 23 Jul 2014 05:41:47 +0000 (08:41 +0300)]
Bug 12630: Prioritizing "Hold starts on date" -holds causes all other holds to be prioritized as well!

-------------------------
-- REPLICATE LIKE THIS --
-------------------------

0. Enable AllowHoldDateInFuture-system preference!

1. Select a biblio with some holds.
2. Place a hold with the "Hold starts on date"-attribute set to future.
3. More the specific hold up on the priority queue.
4. Add another normal hold, observe how it is prioritized with the "Hold starts on date"-hold, leaving old holds to the prioritization queue tail.

Unfair eh?

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30907: Fix incorrect uses of Koha::Recall->item_level_recall
Tomas Cohen Arazi [Thu, 9 Jun 2022 13:22:16 +0000 (10:22 -0300)]
Bug 30907: Fix incorrect uses of Koha::Recall->item_level_recall

This attribute name was changed to *item_level* but this two remaining
places kept calling it with the old name.

To test, verify things don't explode when looking at checkouts with
recalls and also in the log viewer.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30585: Fix library options on table settings for course_reserves_table
Katrin Fischer [Mon, 6 Jun 2022 21:02:25 +0000 (21:02 +0000)]
Bug 30585: Fix library options on table settings for course_reserves_table

The table on  course-details.pl has columns for both home library and jolding library,
but course_reserves_table in the Table configuration admin area only has a
single toggle for 'library'.

Hiding 'library' hides the home library column. Anything after that is off by one.
Hiding 'staff_note' actually hides the holding library column, 'link' hides
Public note, etc.

To test:
- Add a course and some course reserves
- Go to table configuration and hide 'staff note'
- Look at the list of course reserves for your course
- Verify the wrong column was hidden
- Apply patch
- The configuration area now shows holding_library and home_library
  as separate options.
- Change the settings and verify everything now hides/displays correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30768: Capitalizing "pin" in 2FA setup
Michal Urban [Wed, 8 Jun 2022 15:40:42 +0000 (11:40 -0400)]
Bug 30768: Capitalizing "pin" in 2FA setup

Change of text from "pin" to "PIN" in the 2FA setup interface.
This slight changes clarifies that "PIN" is an acronym,
 and increases user comprehension

To test:
1) Log in as an Administrator
2) Enable TwoFactorAuthentication
3) Log in to a user with superlibrarian permissions.
4) On the user profile page, click the "More" dropdown button,
click "Manage Two-Factor
5) Check that "pin" is displayed in lowercase, in both instances.
6) Apply patch.
7) Refresh the page and observe that "pin" has changed to "PIN"
8) Sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30844: Ensure that allow_nonref is enabled when using older versions of JSON
Kevin Carnes [Thu, 9 Jun 2022 06:12:56 +0000 (08:12 +0200)]
Bug 30844: Ensure that allow_nonref is enabled when using older versions of JSON

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30813: (follow-up) Fix tests import
Tomas Cohen Arazi [Wed, 8 Jun 2022 16:41:14 +0000 (13:41 -0300)]
Bug 30813: (follow-up) Fix tests import

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30508: Do not display OPAC message about block from holds when OPACHoldRequests...
Owen Leonard [Thu, 14 Apr 2022 12:39:05 +0000 (12:39 +0000)]
Bug 30508: Do not display OPAC message about block from holds when OPACHoldRequests is disabled

This patch adds a check for the OPACHoldRequests to determine whether a
message should be shown to patrons whose account is over the
maxoutstanding limit.

To test, apply the patch and set the "maxoutstanding" system preference
to a low value. Set OPACHoldRequests to "Allow."

- Log in to the OPAC as a patron who has outstanding fines or charges
  which exceed the maxoutstanding value you set.
- You should see a message on the "Your summary" page, "Holds are
  blocked because your fine balance is over the limit."
- Set OPACHoldRequests to "Don't allow" and refresh the "Your summary"
  page in the OPAC. The message should disappear.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29312: Remove unnecessary dot
Séverine QUEUNE [Tue, 5 Apr 2022 13:09:08 +0000 (13:09 +0000)]
Bug 29312: Remove unnecessary dot

This patch removes an extra point after the number of shown results.

Test plan :
 - don't apply patch
 - run a report that brings you more than 20 results, e.g. SELECT * FROM biblio LIMIT 50
 - see extra ' .' after the number of shown results
 - apply patch
 - run the report again and see the point isn't displayed anymore
 - check the behaviour is still correct when you change the number of rows displayed
 - sign off !

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27519: Normalize Show/Don't show in system preferences
Shi Yao Wang [Wed, 18 May 2022 14:59:39 +0000 (10:59 -0400)]
Bug 27519: Normalize Show/Don't show in system preferences

Replace Display/Don't display (and some other pairs) by Show/Don't show in system preferences.

Test plan:
1- Go to administration > system preferences
2- View any system preference with Display/Don't display pair of options
(e.g. OPACAcquisitionDetails)
3- Apply the patch
4- Refresh the page and notice it is now a Show/Don't show pair instead
5- Loop the steps with other system preferences until satisfied

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30807: Migrate to patron-title in pay and paycollect
Martin Renvoize [Thu, 19 May 2022 11:53:18 +0000 (12:53 +0100)]
Bug 30807: Migrate to patron-title in pay and paycollect

This patch updates the member-flags template to use the patron-title.inc
include wherever patron names are referenced.

Test plan
1) Navigate to a patron and click through to their accounts tab
2) Note how the patron name displays in the title, breadcrumb and
   headings
3) Click through to make a payment
4) Note how the patron name displays in the title, breadcrumb and
   headings
5) Apply the patch and reload the page
6) Confirm the patron name still appears in each location and is
   consistently formatted and linked as you would expect

Note: This patch also removes a superflous hidden title form element
that was simply passed to and from the controller but not actually used
in any way.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30806: Migrate to patron-title in member-flags
Martin Renvoize [Thu, 19 May 2022 11:34:01 +0000 (12:34 +0100)]
Bug 30806: Migrate to patron-title in member-flags

This patch updates the member-flags template to use the patron-title.inc
include wherever patron names are referenced.

Test plan
1) Navigate to a patron and click through to edit their permissions
2) Note how the patron name displays in the title, breadcrump and
   headings
3) Apply the patch and reload the page
4) Confirm the patron name still appears in each location and is
   consistently formatted and linked as you would expect

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30813: (QA follow-up) Adjust three use statements
Marcel de Rooy [Tue, 7 Jun 2022 12:44:03 +0000 (12:44 +0000)]
Bug 30813: (QA follow-up) Adjust three use statements

Altough we used the namespace when calling, the intention of
bug 17600 was that we do import the routines that we are
calling here.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30813: (follow-up) Correct C4::Breeding call
Nick Clemens [Thu, 26 May 2022 11:54:44 +0000 (11:54 +0000)]
Bug 30813: (follow-up) Correct C4::Breeding call

This patch changes the call to use the fully qualified name and
adds import to C4::Breeding, Koha::MetaSearcher, and removes import
from Koha::MetadataRecord

Additionally it replaces missing fields from the update to using TransformMarcToKoha

Lastly, it reduces the fields used when saving the bredding record to the reservoir

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30813: (follow-up) ImportBatch updates
Nick Clemens [Fri, 20 May 2022 11:26:29 +0000 (11:26 +0000)]
Bug 30813: (follow-up) ImportBatch updates

Missed these in the original commits

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30813: Remove Koha::MetadataRecord::getKohaField
Nick Clemens [Fri, 20 May 2022 10:08:11 +0000 (10:08 +0000)]
Bug 30813: Remove Koha::MetadataRecord::getKohaField

This was essentially a wrapper around TransformKohaToMarcOneField

After changing and updating, it seems easier not to create the intermediary
object and to just transform the data

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30813: Remove TransformMarcToKohaOneField
Nick Clemens [Thu, 19 May 2022 21:39:49 +0000 (21:39 +0000)]
Bug 30813: Remove TransformMarcToKohaOneField

To test:
1 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/db_dependent/Breeding.t
2 - Test Z3950 search in advanced catalog editor

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30813: Adjust TransformMarcToKoha to take kohafields parameter
Nick Clemens [Thu, 19 May 2022 20:10:35 +0000 (20:10 +0000)]
Bug 30813: Adjust TransformMarcToKoha to take kohafields parameter

This adjusts the routine to accept an arrayref of koha fields to process

To test:
prove -v t/db_dependent/Biblio/TransformMarcToKoha.t t/Biblio.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30813: Update TransformMarcToKoha to accept a hashref
Nick Clemens [Thu, 19 May 2022 19:53:16 +0000 (19:53 +0000)]
Bug 30813: Update TransformMarcToKoha to accept a hashref

This patch updates all the calls to pass a hasref rather than an array

It also removes the no longer used framework parameter

To test:
prove -v t/Biblio.t t/db_dependent/Biblio/TransformMarcToKoha.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30789: Improve performance of AddBiblio
Nick Clemens [Thu, 19 May 2022 19:21:27 +0000 (19:21 +0000)]
Bug 30789: Improve performance of AddBiblio

AddBiblio calls TransformMarcRecordToKoha. We are only interested in getting biblio and biblioitems info, so we can pass 'no_items' to save some field lookups

Benchmarking saw a ~75% increase in the performance of this call

To test:
1 - Stage and import some records
2 - Confirm it works the same before and after patch
3 - Add a biblio via cataloguing, confirm it works

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30850: DBRev 22.06.00.002
Tomas Cohen Arazi [Wed, 8 Jun 2022 14:25:26 +0000 (11:25 -0300)]
Bug 30850: DBRev 22.06.00.002

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30850: (QA follow-up) Cosmetic changes to atomic update
Marcel de Rooy [Fri, 3 Jun 2022 06:23:38 +0000 (06:23 +0000)]
Bug 30850: (QA follow-up) Cosmetic changes to atomic update

No need to encode, etc.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30850: dbrev to inform existing users of the mapping change
Caroline Cyr La Rose [Thu, 2 Jun 2022 14:21:09 +0000 (10:21 -0400)]
Bug 30850: dbrev to inform existing users of the mapping change

This patch adds a message in a dbrev to inform users of existing
installations that they might want to add a mapping from 110$a to
biblio.author

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30850: Add default mapping for biblio.author to 110$a (MARC21)
Caroline Cyr La Rose [Wed, 25 May 2022 22:43:33 +0000 (18:43 -0400)]
Bug 30850: Add default mapping for biblio.author to 110$a (MARC21)

This patch adds a mapping to biblio.author in 110$a in the default framework

Note: I added lots of tests for different scenarios, I'm not sure it's necessary to test everything. I don't want this to be a deterrent! The first one is necessary, the rest are use cases.

Note 2: I don't work with ktd so maybe the steps for loading new frameworks are different, sorry about that, I honestly don't know another way to do it.

Test 1 - basic test
Before applying patch,
1- Create a new record with a corporate author (110$a)
2- Query the database, author should be null
select author from biblio where biblionumber = XXXX;

(do other control tests if you want/need before applying the patch)

3- Apply patch
4- Delete frameworks
delete from biblio_framework;
delete from marc_subfield_structure;
delete from marc_tag_structure;
5- Load new frameworks
./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load
6- Edit the record, don't change anything and save it
7- Query the database, author should be filled
8- Go to Administration > MARC Bibliographic framework test, everything should be OK

Test 2 - checkouts table
Before applying patch,
1- Create a new record and item with a corporate author (110$a)
2- Checkout the item for that record to a patron
Note that the author is not listed in the checkouts table
3- Apply patch
4- Delete frameworks
delete from biblio_framework;
delete from marc_subfield_structure;
delete from marc_tag_structure;
5- Load new frameworks
./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load
6- Edit the record, don't change anything and save it
7- Refresh the checkouts table, the author should be listed

Test 3 - notices and slips
Before applying patch,
1- Go to Tools > Notices & slips
2- Edit ISSUESLIP and add <<biblio.author>> after <<biblio.title>>
3- Save the notice
4- Create a new record and item with a corporate author (110$a)
5- Checkout the item for that record to a patron
6- Print the checkout slip
Note that the author is not listed on the slip
7- Apply patch
8- Delete frameworks
delete from biblio_framework;
delete from marc_subfield_structure;
delete from marc_tag_structure;
9- Load new frameworks
./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load
10- Edit the record, don't change anything and save it
11- Print the checkout slip, the author should be listed

Test 4 - labels
Before applying the patch,
1- Create a new record and item with a corporate author (110$a)
2- Go to Tools > Label Creator
3- Create a label batch with that item
4- Export the batch in PDF using the Avery 5160 template and 'Label test' layout
Note that the author is not listed
5- Apply patch
6- Delete frameworks
delete from biblio_framework;
delete from marc_subfield_structure;
delete from marc_tag_structure;
7- Load new frameworks
./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load
8- Edit the record, don't change anything and save it
9- Export the label batch again, the author should be listed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30738: Log warnings for background MARC import
David Cook [Thu, 12 May 2022 04:09:58 +0000 (04:09 +0000)]
Bug 30738: Log warnings for background MARC import

This change logs warnings from the CGI background MARC import.

Test plan:
0) Apply patch
1) Export a record with an item
2) Update the 952$f subfield to "Circulation" (any value over 10 chars)
3) Import the record and try to add the item
4) The import will stay stuck with "Importing" status and 0% job
progress
5) Check the /var/log/koha/kohadev/intranet-error.log file
and notice there's an error with the following text:
"Data too long for column 'coded_location_qualifier' at row 1"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30923: Remove EXPERIMENTAL mark on RESTOAuth2ClientCredentials
Tomas Cohen Arazi [Tue, 7 Jun 2022 19:56:34 +0000 (16:56 -0300)]
Bug 30923: Remove EXPERIMENTAL mark on RESTOAuth2ClientCredentials

The feature is not experimental at all.

To test:
1. Search for the RESTOAuth2ClientCredentials syspref
=> FAIL: It says it is an experimental feature
2. Apply this patch and reload
3. Repeat 1
=> SUCCESS: No longer marked as experimental
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30899: Correct dbrev 211200041
Marcel de Rooy [Tue, 7 Jun 2022 14:11:23 +0000 (14:11 +0000)]
Bug 30899: Correct dbrev 211200041

Replace DROP CONSTRAINT by DROP FOREIGN KEY.

Note: It seems that we do not need a new dbrev for master. A developer
could follow test plan below to correct if really needed.

Test plan:

NOTE: When you check show create table, verify that you see an index for category_code and a foreign key called borrower_attribute_types_ibfk_1.

[1] cp installer/data/mysql/db_revs/211200041.pl installer/data/mysql/atomicupdate/
[2] run updatedatabase; check show create table
[3] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; alter table borrower_attribute_types drop index category_code; RUN updatedatabase again; check show create table
[4] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode); RUN updatedatabase again; check show create table
[5] rm installer/data/atomicupdate/211200041.pl

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 13614: Compiled CSS
Tomas Cohen Arazi [Tue, 7 Jun 2022 12:36:31 +0000 (09:36 -0300)]
Bug 13614: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 13614: Replace usage of YUI on basket groups page
Owen Leonard [Thu, 26 May 2022 16:44:35 +0000 (16:44 +0000)]
Bug 13614: Replace usage of YUI on basket groups page

This patch updates the basket groups interface so that it doesn't rely
on YUI to move baskets in and out of groups. The patch also removes
all YUI assets and many long-obsolete references to YUI-related classes
and IDs.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- Go to Acquisitions.
- Locate a vendor with multiple closed baskets.
- Click "Basket groups" in the sidebar menu.
- Create or edit a basket group.
- On the basket group page you should see the basket group form in one
  column and ungrouped baskets in another.
- Both grouped and ungrouped baskets should be in a sortable
  DataTable.
- Test that when you click the "Add to group" button on an ungrouped
  basket the row is removed from the table of ungrouped baskets and
  added to the table of grouped baskets.
  - The button text on the row should now read "Remove."
- Test the reverse operation: Clicking "Remove" on a grouped basket
  should move it to the table of ungrouped baskets.
- Test that when all baskets are moved out of either of the tables a row
  is displayed with a message specific to that table, e.g. "There are no
  ungrouped baskets."
- Test that the basket group saves correctly when zero or more baskets
  are added to the group.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>