]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 25375: DBRev 22.06.00.052
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:08:38 +0000 (09:08 -0300)]
Bug 25375: DBRev 22.06.00.052

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Spelling fixes
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:06:11 +0000 (09:06 -0300)]
Bug 25375: Spelling fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: New atomicupdate syntax
Tomas Cohen Arazi [Fri, 23 Sep 2022 12:03:50 +0000 (09:03 -0300)]
Bug 25375: New atomicupdate syntax

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Adjust tests and test itemlost, not notforloan
Nick Clemens [Tue, 13 Sep 2022 13:06:03 +0000 (13:06 +0000)]
Bug 25375: Adjust tests and test itemlost, not notforloan

Previous commit correctly lists Zebra availability test, but was a
bad edit. This fixes the availability test to use itemlost

Additiionally, tests were written before limits were agreed. Adjusted
for the current settings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Match current Zebra availability limit
Nick Clemens [Mon, 8 Aug 2022 12:15:16 +0000 (12:15 +0000)]
Bug 25375: Match current Zebra availability limit

In Zebra the availability limit code states:
'available' is defined as (items.onloan is NULL) and (items.itemlost = 0)

We should make ES follow the same behaviour so that changing the engine does not
change this.

To test:
1 - Find or create several records with two items each
2 - For those records setup items as:
    a - one checked out, one available
    b - both marked lost
    c - both damaged
    d - both withdrawn
    e - both notforloan
3 - Enable ES and reindex to confirm everything is set
4 - Perform an advanced search to return those records and 'limit to available items'
5 - Confirm you see records b,c,d,e and records say '2 items, none available'
6 - Apply patch
7 - Run `misc/search_tools/rebuild_elasticsearch.pl -d -b`
8 - Perform an advanced search to return those records and 'limit to available items'
9 - Confirm you see records a,b,c,d and al but a say '2 items, none available'

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Add tests for the "available" ES field
Julian Maurice [Thu, 3 Mar 2022 10:18:25 +0000 (11:18 +0100)]
Bug 25375: Add tests for the "available" ES field

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: (QA follow-up) Count available items rather than iterating
Nick Clemens [Fri, 11 Sep 2020 15:23:02 +0000 (15:23 +0000)]
Bug 25375: (QA follow-up) Count available items rather than iterating

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Get biblionumber from the correct MARC field
Julian Maurice [Fri, 4 Sep 2020 08:25:17 +0000 (12:25 +0400)]
Bug 25375: Get biblionumber from the correct MARC field

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25375: Fix 'available' facet in elasticsearch
Julian Maurice [Wed, 29 Apr 2020 14:13:08 +0000 (16:13 +0200)]
Bug 25375: Fix 'available' facet in elasticsearch

Add a new boolean ES field named 'available', which is true if at least
one item is available, which means the item is not on loan, not
"notforloan", not withdrawn, not lost and not damaged

A full indexation is required

Test plan:
1. Apply patch and run updatedatabase.pl
2. Run `misc/search_tools/rebuild_elasticsearch.pl -d -b`
3. Make sure you have some biblios whose items are all unavailable, some
   biblios whose items are all available, and some biblios with at least
   one item available and at least one item unavailable
4. Use the 'available' filter on both opac and intranet and make sure it
   works as expected.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31367: Add subtotals if budget has children
Nick Clemens [Fri, 26 Aug 2022 13:32:50 +0000 (13:32 +0000)]
Bug 31367: Add subtotals if budget has children

On bug 29287 we added child funds if a fund had no parent id

It turns out funds can have a parent, and still have children (sub-sub-funds)

This patch simply checks for children, rather than checking for lack of parent.

Totals are already calculated correctly in GetBudgetHierarchy

To test:
1 - Add a fund "Fund" to a budget - assign 1000 dollars
2 - Add a sub-fund "SubFund" - assign 100 dollars
3 - Add a sub-sub-fund "SubSubFund" - assign 10 dollars
4 - Add to a basket $5 order from SubSubFund
5 - Add to a basket $50 order from SubFund
6 - Add to a basket $500 order form Fun
7 - View acqui home - note 'SubFund' does not include total from 'SubSubFund'
8 - Apply patch
9 - Confirm all sub-sub-funds totaled in sub-funds and that fund total correctly adds sub and sub-sub funds

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) No userenv, no jobs
Marcel de Rooy [Fri, 23 Sep 2022 09:37:46 +0000 (09:37 +0000)]
Bug 30982: (QA follow-up) No userenv, no jobs

+    # Assume permission if context has no user
+    my $can_manage_background_jobs = 1;
=> This felt a bit unsafe.

Test plan:
Try interface for jobs. Call API with cookie. Call API with OAuth.
Run t/db_dependent/Koha/BackgroundJobs.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) Remove redundancy from template
Marcel de Rooy [Fri, 23 Sep 2022 08:48:05 +0000 (08:48 +0000)]
Bug 30982: (QA follow-up) Remove redundancy from template

The template now contains two lists for both status and type:
a TT list and a JS list. The type list already proves that
redundancy leads to bugs. We miss three types at one side:
    Unknown job type 'stage_marc_for_import'
    Unknown job type 'marc_import_commit_batch'
    Unknown job type 'marc_import_revert_batch'

This patch removes the TT list. And gets the status and type
via an additional js call. For that reason I hide the fieldset
until document ready. This can be improved later when needed.

Test plan:
Look at status and type on both job list and detail view.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) Spelling
Marcel de Rooy [Fri, 23 Sep 2022 07:05:39 +0000 (07:05 +0000)]
Bug 30982: (QA follow-up) Spelling

[1] Correct: BackgrounJob
[2] If should filter out not current jobs
=> Had a hard time reading that one until I replaced if by it.
=> Decided to rephrase it in a more positive way.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) Resolve pod warning
Marcel de Rooy [Tue, 20 Sep 2022 14:47:45 +0000 (14:47 +0000)]
Bug 30982: (QA follow-up) Resolve pod warning

Empty section in previous paragraph at line 32 in file Koha/BackgroundJobs.pm

Test plan:
Run podchecker again on this module.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Rename 'Background Jobs' => 'Jobs'
Tomas Cohen Arazi [Mon, 12 Sep 2022 18:06:51 +0000 (15:06 -0300)]
Bug 30982: Rename 'Background Jobs' => 'Jobs'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Adapt table to new API spec
Tomas Cohen Arazi [Mon, 12 Sep 2022 17:54:08 +0000 (14:54 -0300)]
Bug 30982: Adapt table to new API spec

Disclaimer: this patch is highly opinionated :-D

When I started looking at this patch I felt like the two tables
(current/past jobs) implemented on bug 30462 was the way to go.

In order to make this patches apply after it I had to redo all the
things. Or most of them.

But I decided to keep the idea of filtering out completed tasks, not
just having the option to display 'the last hour' tasks. For the task I
added some required helper methods and the relevant tests as well. So a
behavior change.

Hope you all agree with it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: API tweaks
Tomas Cohen Arazi [Mon, 12 Sep 2022 16:02:25 +0000 (13:02 -0300)]
Bug 30982: API tweaks

This patch makes the following changes to the 'background_jobs' API:

* We now call them 'jobs'
* Removed deprecated query parameter definitions
* Added only_current query parameter
* Controller gets adapted to use $rs->filter_by_current when
  only_current is passed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Add Koha::BackgroundJobs->filter_by_current
Tomas Cohen Arazi [Mon, 12 Sep 2022 15:01:45 +0000 (12:01 -0300)]
Bug 30982: Add Koha::BackgroundJobs->filter_by_current

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Add 'context' to the REST API specs
Jonathan Druart [Tue, 26 Jul 2022 06:44:10 +0000 (08:44 +0200)]
Bug 30982: Add 'context' to the REST API specs

context has been added by bug 30889

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Make code more re-usable
Martin Renvoize [Wed, 29 Jun 2022 14:14:41 +0000 (15:14 +0100)]
Bug 30982: Make code more re-usable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Add tests and implement GET /background_jobs/$id
Jonathan Druart [Wed, 29 Jun 2022 09:28:31 +0000 (11:28 +0200)]
Bug 30982: Add tests and implement GET /background_jobs/$id

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: (QA follow-up) Double quoting and console.log
Martin Renvoize [Tue, 28 Jun 2022 07:10:38 +0000 (08:10 +0100)]
Bug 30982: (QA follow-up) Double quoting and console.log

This patch fixes the issues highlighted by the QA script; We use double
quotes for translatable strings in JS and remove an errant console.log
call.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: Use the REST API for background job list view
Jonathan Druart [Fri, 17 Jun 2022 09:13:19 +0000 (11:13 +0200)]
Bug 30982: Use the REST API for background job list view

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30982: REST API specs
Jonathan Druart [Fri, 17 Jun 2022 07:21:39 +0000 (09:21 +0200)]
Bug 30982: REST API specs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: DBRev 22.06.00.051
Tomas Cohen Arazi [Thu, 22 Sep 2022 12:39:27 +0000 (09:39 -0300)]
Bug 7021: DBRev 22.06.00.051

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: DBIC schema
Tomas Cohen Arazi [Thu, 22 Sep 2022 12:38:04 +0000 (09:38 -0300)]
Bug 7021: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: (QA follow-up) Fix typo
Tomas Cohen Arazi [Thu, 22 Sep 2022 12:37:07 +0000 (09:37 -0300)]
Bug 7021: (QA follow-up) Fix typo

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: (QA follow-up) Add comment to new database column
Kyle M Hall [Fri, 2 Sep 2022 13:33:38 +0000 (13:33 +0000)]
Bug 7021: (QA follow-up) Add comment to new database column

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Move to new atomic update structure
Kyle M Hall [Fri, 2 Sep 2022 11:13:16 +0000 (11:13 +0000)]
Bug 7021: Move to new atomic update structure

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: (QA follow-up): Minor code cleanup
Kyle M Hall [Fri, 2 Sep 2022 11:00:25 +0000 (07:00 -0400)]
Bug 7021: (QA follow-up): Minor code cleanup

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Catch new introductions of UpdateStats
Martin Renvoize [Mon, 23 May 2022 14:21:40 +0000 (15:21 +0100)]
Bug 7021: Catch new introductions of UpdateStats

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Remove superflous 'open'
Martin Renvoize [Mon, 23 May 2022 14:08:27 +0000 (15:08 +0100)]
Bug 7021: Remove superflous 'open'

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Terminology - usercode -> categorycode
Martin Renvoize [Mon, 23 May 2022 13:43:34 +0000 (14:43 +0100)]
Bug 7021: Terminology - usercode -> categorycode

Lets stick to standard terminology and use categorycode rather than
usercode here.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Patron category in the statistics table
Olli-Antti Kivilahti [Wed, 2 Jul 2014 16:54:33 +0000 (19:54 +0300)]
Bug 7021: Patron category in the statistics table

This patch populates the koha.statistics.usercode with borrowers.categorycode where it is easily available.
Currently for statistics.type 'issue' OR 'localuse' OR 'renew'.

Supplied a script to UPDATE the old statistics records.

Have fun!

To test:
1. Add loan for patron.
2. Check statistics table
=> 'usercode' column for this issue should now contain patrons categorycode

To test add_statistics_borrowers_categorycode.pl:
1. Run add_statistics_borrowers_categorycode.pl
2. Check statistics table
=> all statistics which are type 'issue' OR 'localuse' OR 'renew'
should now contain patrons categorycode in 'usercode' column

Also prove that tests in t/db_dependent/Circulation.t still pass.

Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7021: Reintroduce usercode column
Emmi Takkinen [Wed, 16 Jun 2021 11:40:47 +0000 (14:40 +0300)]
Bug 7021: Reintroduce usercode column

This patch reintroduces usercode column to
statistics table.

To test:
1. Apply patch and update database
2. Confirm there's column usercode in statistics
table

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31562: Respect mandatory fields pref
Nick Clemens [Wed, 14 Sep 2022 11:45:38 +0000 (11:45 +0000)]
Bug 31562: Respect mandatory fields pref

To test:
1 - Set gonenoaddress and lost in BorrowerMandatoryField
2 - Edit a patron, confirm fields are required

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 31562: Remove gonenoaddress and lost from OPAC borrower field preferences
Nick Clemens [Wed, 14 Sep 2022 11:35:44 +0000 (11:35 +0000)]
Bug 31562: Remove gonenoaddress and lost from OPAC borrower field preferences

These are not shown, so cannot be unwanted or mandatory

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 31562: Treat flags as other borrower fields
Nick Clemens [Wed, 14 Sep 2022 11:27:03 +0000 (11:27 +0000)]
Bug 31562: Treat flags as other borrower fields

Rather than generate a custom hash for these fields, we should treat them as other borrower data fields

To test:
 1 - Edit a patron, note the 'Lost card' and 'Gone no address' fields
 2 - Edit syspref BorrowerunwantedField
 3 - Set gonenoaddress and lost as unwanted
 4 - Edit patron, the fields remain
 5 - Apply patch
 6 - Edit a patron, fields are hidden
 7 - Unhide one of the fields
 8 - Edit a patron and confirm it shows and saves correctly
 9 - Unhide the other field
10 - Confirm it can be edited and saved

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 31389: (QA follow-up) Missing permissions in tests
Tomas Cohen Arazi [Thu, 22 Sep 2022 11:54:12 +0000 (08:54 -0300)]
Bug 31389: (QA follow-up) Missing permissions in tests

The following bugs refined permissions a bit, and the change was missing
on the tests:

* 23681
* 30335

Bonus: sorted permissions alphabetically for readability.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31389: (QA follow-up) Correct test message
Joonas Kylmälä [Sun, 4 Sep 2022 12:20:26 +0000 (12:20 +0000)]
Bug 31389: (QA follow-up) Correct test message

The test in question concerns non-superlibrarian staff users.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31389: Calculate user permissions in separate function
David Cook [Thu, 18 Aug 2022 03:26:20 +0000 (03:26 +0000)]
Bug 31389: Calculate user permissions in separate function

This patch refactors the setting of user permissions for templates into
a new function, which can be easily unit tested and reduces the amount
of code in C4::Auth::get_template_and_user(). It also aids in the
re-usability of permission checking code.

Test plan:
0) Apply patch and koha-plack --restart kohadev
1) prove t/Koha/Auth/Permissions.t
2) As koha superlibrarian, go to
http://localhost:8081/cgi-bin/koha/tools/tools-home.pl
3) Go to http://localhost:8081/cgi-bin/koha/members/members-home.pl
4) Create new test user with "Staff access..." and "Remaining circulation permissions"
5) Logout of koha superlibrarian
6) Login as test user
7) Note you can only see a limited view of the staff interface
(i.e. no administration, no tools, no reports, etc.)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30497: DBRev 22.06.00.050
Tomas Cohen Arazi [Thu, 22 Sep 2022 11:38:10 +0000 (08:38 -0300)]
Bug 30497: DBRev 22.06.00.050

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30497: Recreate old_reserves_ibfk_4 when it cascades
Marcel de Rooy [Fri, 8 Apr 2022 08:23:56 +0000 (08:23 +0000)]
Bug 30497: Recreate old_reserves_ibfk_4 when it cascades

Test plan:
Drop old_reserves_ibfk_4.
Add back with:
    alter table old_reserves ADD CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE;
Run dbrev. Check that constraint has been replaced by SET NULL.
Run dbrev again. No changes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT 23-08-22 Replaced DROP CONSTRAINT]

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30490: DBRev 22.06.00.049
Tomas Cohen Arazi [Thu, 22 Sep 2022 11:33:09 +0000 (08:33 -0300)]
Bug 30490: DBRev 22.06.00.049

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30490: DBIC schema
Tomas Cohen Arazi [Thu, 22 Sep 2022 11:31:54 +0000 (08:31 -0300)]
Bug 30490: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30490: Adjust constraint itemtypes.itemtypes_ibfk_1
Marcel de Rooy [Tue, 23 Aug 2022 13:00:17 +0000 (13:00 +0000)]
Bug 30490: Adjust constraint itemtypes.itemtypes_ibfk_1

Change from CASCADE to restrict.
In harmony with dbrev 20.06.00.022.

Test plan:
Run the dbrev.
Bonus:
update itemtypes set parent_type='VM' where itemtype='CF';
delete from itemtypes where itemtype='VM';
=> ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`koha_myclone`.`itemtypes`, CONSTRAINT `itemtypes_ibfk_1` FOREIGN KEY (`parent_type`) REFERENCES `itemtypes` (`itemtype`))

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27550: Add unit test for CloneBudgetHierarchy
Julian Maurice [Thu, 8 Sep 2022 10:20:11 +0000 (12:20 +0200)]
Bug 27550: Add unit test for CloneBudgetHierarchy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27550: "Duplicate budget" does not keep users associated with that budget
Jeremy Breuillard [Wed, 24 Nov 2021 09:45:46 +0000 (10:45 +0100)]
Bug 27550: "Duplicate budget" does not keep users associated with that budget

When a budget is duplicated, Owner is copied but not Users

Test plan :
Home > Administration > Budgets
1)Create a budget to allow (active or inactive)
2)Give it some funds by filling up the form, especially Owner and
User(s)
3)Submit then go back to the Budgets dashboard
4)Duplicate the Budget and click on its name
5)Edit it and notice that User(s) is empty
6)Apply the patch
7)Repeat from 1) to 5)

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31564: Pass start label in PDF link
Nick Clemens [Wed, 14 Sep 2022 13:23:58 +0000 (13:23 +0000)]
Bug 31564: Pass start label in PDF link

To test:
1 - Tools->Lbel creator
2 - Make a new batch
3 - Add an item
4 - Click 'export' on the single item
5 - Enter a starting label position greater than 1
6 - Click Export
7 - Click Download as PDF
8 - Note label in 1st position
9 - Apply patch
10 - Repeat and note label position now honored

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 29744: (QA follow-up) Call psgi_env in OO style
Marcel de Rooy [Fri, 16 Sep 2022 07:20:36 +0000 (07:20 +0000)]
Bug 29744: (QA follow-up) Call psgi_env in OO style

Result of git grep -l -E "::psgi_env" | xargs sed -i -e's/::psgi_env/->psgi_env/g'

Also resolving this warn from Auth.t:
Use of uninitialized value $ENV{"SCRIPT_NAME"} in pattern match (m//) at /usr/share/koha/Koha/AuthUtils.pm line 211.

Note that the following warn is resolved on report 30588 (underway).
Use of uninitialized value $return in numeric gt (>) at /usr/share/koha/C4/Auth.pm line 1154.

Test plan:
Run t/db_dependent/Auth.t
Hit some opac, intranet pages. API call.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29744: (QA follow-up) Add underscore test, move to OO
Marcel de Rooy [Fri, 16 Sep 2022 07:07:00 +0000 (07:07 +0000)]
Bug 29744: (QA follow-up) Add underscore test, move to OO

The underscore test comes from bug 31468.
Context methods should actually be OO.

Test plan:
Run t/Context.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29744: Remove unnecessary condition in C4::Auth::safe_exit
David Cook [Wed, 20 Apr 2022 05:27:32 +0000 (05:27 +0000)]
Bug 29744: Remove unnecessary condition in C4::Auth::safe_exit

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Adding David's comments from Bugzilla to safe_exit here.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29744: Harmonize psgi/plack detection methods
Martin Renvoize [Mon, 28 Mar 2022 09:23:58 +0000 (10:23 +0100)]
Bug 29744: Harmonize psgi/plack detection methods

This patch updates and moves the existing psgi_env method out of Auth
and into Context and then replaces any manual references of the same
code to use the new method.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31597: Add missing semicolon to restriction.pl
Emmi Takkinen [Thu, 22 Sep 2022 06:09:50 +0000 (09:09 +0300)]
Bug 31597: Add missing semicolon to restriction.pl

In restrictions.pl line 114 is missing a semicolon after try-catch statement.
This causes error 500 when one tries to delete restriction.

To test:
1. Navigate to "Patron restrictions".
2. Find or create patron restriction to be deleted.
3. Hit "Delete" and confirm deletion.
=> Error 500 is raised.
4. Apply this patch.
5. Try to delete again.
=> Success!

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28167: Remove uninitialized variable warnings from circ/set-library.pl
Joonas Kylmälä [Mon, 29 Aug 2022 20:39:13 +0000 (20:39 +0000)]
Bug 28167: Remove uninitialized variable warnings from circ/set-library.pl

With UseCashRegisters syspref disabled going to the page
/cgi-bin/koha/circ/set-library.pl in staff interface and setting a
library gives the following errors in plack-intranet-error.log:

Use of uninitialized value $register_id in string ne at /kohadevbox/koha/circ/set-library.pl line 79.
Use of uninitialized value $referer in pattern match (m//) at /kohadevbox/koha/circ/set-library.pl line 114.

In the if clause $userenv_register_id appears to be typoed, it should have
been $register_id as $userenv_register_id is always defined. As for the
$referer variable, it is undef if there is no referer so let's just initialize
it to an empty string for the regex so it doesn't give the warning.

To test:
 1) Go directly to /cgi-bin/koha/circ/set-library.pl by typing it in
    the URL bar and set a library
 2) Make sure plack-intranet-error.log doesn't contain the above mentioned errors
    after applying this patch

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 30890: Fixed ILL breadcrumb
Isobel Graham [Thu, 1 Sep 2022 11:06:26 +0000 (12:06 +0100)]
Bug 30890: Fixed ILL breadcrumb

Added correct breadrumb depth when managing requests.

1. Viewing a request on a ILL request page
2. Making sure the breadcrumb has three depths
   and the manage requests has the correct
   request id

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 31598: Fix random failure on Jenkins for Upload.t
Marcel de Rooy [Thu, 22 Sep 2022 08:09:41 +0000 (08:09 +0000)]
Bug 31598: Fix random failure on Jenkins for Upload.t

At some point the warn is made conditional for permanent
files. So it failed when TestBuilder picked a zero value
for permanent. Trivial fix.

Test plan:
Run t/db_dependent/Upload.t a few times

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31497: (follow-up) Expand ID suffix, fix password2, remove debug
Nick Clemens [Fri, 16 Sep 2022 11:06:17 +0000 (11:06 +0000)]
Bug 31497: (follow-up) Expand ID suffix, fix password2, remove debug

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31497: Prevent ID clash on quick add fields
Nick Clemens [Tue, 13 Sep 2022 12:19:57 +0000 (12:19 +0000)]
Bug 31497: Prevent ID clash on quick add fields

The quick add clones the original fields, including ids. This can cause some clash when
other JS is running on the page.

This patch updates the ids of the fields before adding to the form, which prevents bad
copying/clearing of fields

To test:
* Go to patrons module
* Click on Quick add new patron (I chose Patron as category)
* On sample database these fields are marked as mandatory:
  * Surname
  * Cardnumber
  * Library
  * Category
* Fill in Surname, leave cardnumber empty
* Save - mandatory message is shown
* Fill in cardnumber - save
* The patron is saved
* BUT: cardnumber is empty!
APPLY PATCH
* Repeat plan above
* Cardnumber is correctly saved

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30359: Unit tests
Nick Clemens [Thu, 25 Aug 2022 11:18:18 +0000 (11:18 +0000)]
Bug 30359: Unit tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30359: GetBudgetHierarchy is slow on order receive page
Johanna Raisa [Fri, 25 Mar 2022 10:25:56 +0000 (12:25 +0200)]
Bug 30359: GetBudgetHierarchy is slow on order receive page

This patch adds skiptotals parameter to GetBudgetHierarchy so calculating
totals can be skipped from some pages.

Test plan:
1) Open browser's Inspect -> Network
2) Go to receive orders
3) Check the timings for page load
4) Apply the patch
5) Refresh the page
6) Check the timings again
7) prove t/db_dependent/Budgets.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31254: Add additional fields for accountlines
Julian Maurice [Wed, 9 Jun 2021 14:28:51 +0000 (16:28 +0200)]
Bug 31254: Add additional fields for accountlines

Test plan:
1. Go to Admin » Additional fields
   There are two new categories: "Account lines (credit)" and
   "Account lines (debit)"
2. Create fields for both categories, with and without an authorized
   value category
3. Go to a user's accounting page
4. Create a manual invoice. Verify that all "debit" fields are there,
   put a value in them and save
5. Create a manual credit. Verify that all "credit" fields are there,
   put a value in them and save
6. Make a payment. Verify that all "credit" fields are there, put a
   value in them and save
7. Go to the transactions tab, click on the "Details" button for the
   lines you just created and verify that the additional fields are
   there

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31590: Remove Text::CSV::Unicode
Marcel de Rooy [Wed, 21 Sep 2022 12:46:45 +0000 (12:46 +0000)]
Bug 31590: Remove Text::CSV::Unicode

This modules is really not needed.
The wide character test does not make much sense. Just use
encoding as you should.

Test plan:
Run xt/author/Text_CSV_Various.t.
Check about page, perl modules.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: MARC staging/import are long-running tasks
Tomas Cohen Arazi [Mon, 19 Sep 2022 18:33:56 +0000 (15:33 -0300)]
Bug 27421: MARC staging/import are long-running tasks

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: (QA follow-up) Add redirection to job details
Marcel de Rooy [Tue, 6 Sep 2022 12:44:39 +0000 (12:44 +0000)]
Bug 27421: (QA follow-up) Add redirection to job details

Low budget implementation. After 5 seconds we jump to jobs.
Small jobs should already be finished.

Test plan:
Try staging a file. Wait and see if you got redirected.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: (QA follow-up) Template polishing
Marcel de Rooy [Tue, 6 Sep 2022 12:14:02 +0000 (12:14 +0000)]
Bug 27421: (QA follow-up) Template polishing

The completed alert needs a condition on status.
The record_type variable needs a bit of 'context'.

Test plan:
Verify if a failed or new job does not have a Completed alert.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: (QA follow-up) Polishing the backgroundjob modules
Marcel de Rooy [Fri, 19 Aug 2022 07:54:55 +0000 (07:54 +0000)]
Bug 27421: (QA follow-up) Polishing the backgroundjob modules

StageMARCForImport:
- Rollback in catch
- Setting progress, size or status after BatchStageMarcRecords
  in both try and catch block

ImportCommitBatch:
- Move setting size back to enqueue moment
- Rollback in catch
- Setting progress, size or status after BatchStageMarcRecords
  in both try and catch block

ImportRevertBatch:
- Move setting size back to enqueue moment
- Adding transaction/rollback to module since import routine
  does not support it. Could be moved later.
- Setting progress, size or status after BatchStageMarcRecords
  in both try and catch block

Test plan:
Run t/db_dependent/Koha/BackgroundJobs/StageMARCForImport.t
Test staging file
Bonus: Put a die statement in BatchStageMarcRecords.

Test importing batch
Bonus: Include some records with an invalid library code; this will
trigger an FK exception. (Reduce the progress from 50 to 1. If your
first record would be fine, check if it is NOT imported when the job
fails.)

Test reverting batch.
Bonus: Put a die in BatchRevertRecords.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: (QA follow-up) BatchCommitImportRecords needs param for skipping commits
Marcel de Rooy [Mon, 5 Sep 2022 11:57:52 +0000 (11:57 +0000)]
Bug 27421: (QA follow-up) BatchCommitImportRecords needs param for skipping commits

When you submit a background jobs, and it fails, you do not expect
partial results in the database.
Note that when the Background feature would support a partially
completed status, things might change again.

Note that the >0 test was superfluous if you check for ^\d+$.

Test plan:
Run t/db_dependent/Koha/BackgroundJobs/StageMARCForImport.t

Note: This serves to verify that it still runs as expected.
The test plan of the following patch covers the new param.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: (QA follow-up) Sub finish should respect failed status too
Marcel de Rooy [Mon, 5 Sep 2022 10:33:01 +0000 (10:33 +0000)]
Bug 27421: (QA follow-up) Sub finish should respect failed status too

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: (QA follow-up) Similar changes for revert commit
Marcel de Rooy [Fri, 19 Aug 2022 07:34:06 +0000 (07:34 +0000)]
Bug 27421: (QA follow-up) Similar changes for revert commit

Test plan:
Look at job results when reverting imported batch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: (QA follow-up) Include manage URL and item counts for import commit
Marcel de Rooy [Fri, 19 Aug 2022 07:16:22 +0000 (07:16 +0000)]
Bug 27421: (QA follow-up) Include manage URL and item counts for import commit

Test plan:
Run an stage and import.
Check import commit job.
Click to managed batch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: (follow-up) Add exec flag
Nick Clemens [Thu, 18 Aug 2022 14:01:44 +0000 (14:01 +0000)]
Bug 27421: (follow-up) Add exec flag

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: Add tests
Jonathan Druart [Tue, 9 Aug 2022 07:30:43 +0000 (09:30 +0200)]
Bug 27421: Add tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: Fix job's size for import
Jonathan Druart [Fri, 5 Aug 2022 09:49:51 +0000 (11:49 +0200)]
Bug 27421: Fix job's size for import

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: Commit and revert
Jonathan Druart [Mon, 13 Jun 2022 14:15:36 +0000 (16:15 +0200)]
Bug 27421: Commit and revert

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27421: Use Background job for staging MARC records for import
Jonathan Druart [Mon, 13 Jun 2022 12:29:45 +0000 (14:29 +0200)]
Bug 27421: Use Background job for staging MARC records for import

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31342: Add execution locking to process_message_queue.pl
Tomas Cohen Arazi [Fri, 12 Aug 2022 09:50:59 +0000 (06:50 -0300)]
Bug 31342: Add execution locking to process_message_queue.pl

This patch makes the script use an execution lock as provided by
Koha::Script. Previous attempt got too complex and contentious, and
given we have a simple way to achieve the same thing, I decided to
submit an alternative approach.

To test:
1. Apply this patch
2. Add the following content to misc/cronjobs/process_message_queue.pl
   on line 83:

  sleep 100;

3. Save the file
4. Have two terminals open
5. On the first one, run:
   $ kshell
  k$ misc/cronjobs/process_message_queue.pl
6. On the second one, run the same
=> SUCCESS: The second one dies telling it had to skip the run
7. Undo your changes:
   $ git checkout misc/cronjobs/process_message_queue.pl
8. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Liz Rea <liz@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27817: Use biblio-title include in some acquisitions pages
Owen Leonard [Mon, 29 Mar 2021 14:57:22 +0000 (14:57 +0000)]
Bug 27817: Use biblio-title include in some acquisitions pages

This patch adds the use of the biblio-title include in acquisitions
templates which get the right data from their corresponding scripts.

To test, apply the patch and test these Acquisitions pages to confirm
that titles with 245$b, 245$h, etc, show all the correct information.

- Acquisitions -> Vendor -> Basket
- Acquisitions -> Vendor -> Uncertain prices
- Acquisitions -> Invoices -> Invoice
- Acquisitions -> Invoices -> Invoice -> View an invoice which has an
  already-received bibliographic record.
  - Go to receipt page -> Already received.
    -- The "Pending orders" table is unmodified because I wasn't sure
       how to use the biblio-title include in an AJAX DataTable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30472: DBIC schema
Tomas Cohen Arazi [Mon, 19 Sep 2022 18:12:28 +0000 (15:12 -0300)]
Bug 30472: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30755: (follow-up) Add a results hash to automatic renewals
Nick Clemens [Fri, 2 Sep 2022 07:52:15 +0000 (07:52 +0000)]
Bug 30755: (follow-up) Add a results hash to automatic renewals

It's slightly debatable whether auto_too_soon is an error or not. I think
it leans far enough towards error that the other patch is correct. The change, however,
will affect notices and means we cannot count auto_too_soon anymore

This patch adds a new 'results' hash to the info - this includes a count per error
(including auto_renew i.e. success) allowing for notices to decide how to display the info.

To test:
1 - Add to Auto renew digest notice:
[% IF results %]
There were [% results.auto_too_soon %] items that were too soon.
[% END %]
2 - Check out some items to a patron that will be too soon
3 - Check out one that is not too soon and will renew
4 - Ensure patron has auto renew digest selected and that AutoRenewalNotices is set to follow patron preferences
5 - Run the auto renewals cron
6 - Confirm the notice for the patron displays 1 successful renewal, no failures, and a correct count of too_soon

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 30755: Remove auto_too_soon from error count
Martin Renvoize [Fri, 20 May 2022 07:08:28 +0000 (08:08 +0100)]
Bug 30755: Remove auto_too_soon from error count

This patch prevents auto_too_soon errors being counted towards auto
renew errors.

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 31565: Escape datatables MySQL special characters only in LIKE queries
Lari Taskula [Fri, 16 Sep 2022 14:05:15 +0000 (14:05 +0000)]
Bug 31565: Escape datatables MySQL special characters only in LIKE queries

Escaping \ yields no results when performing exact search in datatables.
This patch adds MySQL special character escaping only to LIKE searches.

To test:
1. Add following categorycode 'TEST\CAT' by SQL
insert into categories (categorycode,description) values ('TEST\\CAT', 'TEST\\CAT');
2. Add a patron into TEST\CAT category
3. Go to patron search
4. Limit search by category TEST\CAT
5. Observe no results
6. Apply patch
7. Refresh patron search page
8. Limit search by category TEST\CAT
9. Observe Koha redirecting you to patron you chose in step 2

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31565: Fix datatables searching escape for exact search
Lari Taskula [Wed, 14 Sep 2022 14:34:48 +0000 (14:34 +0000)]
Bug 31565: Fix datatables searching escape for exact search

To test:
1. Add a new patron category with categorycode 'TEST_CAT'
2. Add a patron to category 'TEST_CAT'
3. Go to Patrons search view
4. Under "Search for patron" filters, filter by category you created at step 1
5. Click Search
6. Observe no results
7. Apply this patch and reload
8. Repeat 3-5
9. Observe expected result

Double check tests from Bug 30393 still work as expected:

10. Go to the cities page
11. Add two cities:
   - 'Cordoba %'
   - 'Buenos Aires _'
   - 'London \'
12. Use the column search on the name, alternating _, \ and % as the query
=> SUCCESS: Filtering works correctly!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15348: Add estimated_delivery_date to object spec
Tomas Cohen Arazi [Fri, 16 Sep 2022 20:10:41 +0000 (17:10 -0300)]
Bug 15348: Add estimated_delivery_date to object spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27195: Set focus on first input when adding a new city
Katrin Fischer [Thu, 18 Aug 2022 19:55:17 +0000 (19:55 +0000)]
Bug 27195: Set focus on first input when adding a new city

When adding a new city, the focus/cursor should be
in the first input field of the form: City

To test:
* Add a new city in administration > cities
  - cursur is in no field
* Apply patch
* Add another new city
  - cursor is now in the first input field of the form: City

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

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30472: DBRev 22.06.00.048
Tomas Cohen Arazi [Fri, 16 Sep 2022 19:56:44 +0000 (16:56 -0300)]
Bug 30472: DBRev 22.06.00.048

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30472: Make borrower_relationships.guarantor_id not null
Marcel de Rooy [Wed, 24 Aug 2022 11:37:55 +0000 (11:37 +0000)]
Bug 30472: Make borrower_relationships.guarantor_id not null

In harmony with dbrev 19.06.00.022.

Test plan:
Run dbrev.
Run t/db_dependent/Patron/Relationships.t
Run t/db_dependent/Koha/Patrons.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31531: Remove unnecessary use directives on opac-memberentry.pl
David Cook [Thu, 8 Sep 2022 03:06:59 +0000 (03:06 +0000)]
Bug 31531: Remove unnecessary use directives on opac-memberentry.pl

This patch just removes two redundant use directives in opac-memberentry.pl

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30025: DBRev 22.06.00.047
Tomas Cohen Arazi [Fri, 16 Sep 2022 19:52:16 +0000 (16:52 -0300)]
Bug 30025: DBRev 22.06.00.047

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30025: Replace AllowManualAuthorityEditing with RequireChoosingExistingAuthority
Nick Clemens [Tue, 16 Aug 2022 11:11:09 +0000 (11:11 +0000)]
Bug 30025: Replace AllowManualAuthorityEditing with RequireChoosingExistingAuthority

This flips the pref from an allowance to a requirement, hopefully this makes the logic here clearer

Test as before, but the values for the renamed pref flipped

Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30025: Split BiblioAddsAuthorities into two sysprefs
Nick Clemens [Thu, 26 May 2022 16:14:40 +0000 (16:14 +0000)]
Bug 30025: Split BiblioAddsAuthorities into two sysprefs

This patch adds two new sysprefs:
AutoLinkBiblios
AllowManualAuthorityEditing

Both inherit the setting from BiblioAddsAuhtorities which is removed

To test:
1 -Apply patches
2 - Update database
3 - Confirm old setting is transferred to new option
4 - Confirm you can edit authoriteis manually if AllowManualAuthorityEditing set to allow
5 - Confirm you cannot edit authorities manually if AllowManualAuthorityEditing set to don't allow
6 - Confirm a new bib is linked when AutoLinkBiblios is enabled (set AllowManualAuthorityEditing to add unlinked heading)
7 - Confirm new bib notlinked when AutoLinkBiblios is disabled
8 - Confim new bib not linked when AutoLinkBiblios is enabled, but heading doesn't match an authority and  AutoCreateAuthorities is disabled
9 - Confim new bib linked to new authority when AutoLinkBiblios is enabled, but heading doesn't match an authority and  AutoCreateAuthorities is enabled

Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30025: DB update
Nick Clemens [Fri, 10 Jun 2022 12:10:28 +0000 (12:10 +0000)]
Bug 30025: DB update

Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31299: Fix duplicate output in search_for_data_inconsistencies.pl
Fridolin Somers [Fri, 5 Aug 2022 18:36:50 +0000 (08:36 -1000)]
Bug 31299: Fix duplicate output in search_for_data_inconsistencies.pl

In search_for_data_inconsistencies.pl when there are several inconsistencies on same framework, the second output of items contains the first one.

Looks like it is since Bug 21466

Test plan using koha-testing-docker :
1) Create 2 inconsistencies on the same item via SQL :
   update items set itemlost = 9 where itemnumber=900;
   update items set notforloan = 8 where itemnumber=900;
2) Without patch
3) Run ./misc/maintenance/search_for_data_inconsistencies.pl
=> You see duplicate output :
== Wrong values linked to authorised values ==
* The Framework *BKS* is using the authorised value's category *NOT_LOAN*, but the following items.notforloan do not have a value defined ({itemnumber => value }):
 {900 => 8}
* The Framework *BKS* is using the authorised value's category *LOST*, but the following items.itemlost do not have a value defined ({itemnumber => value }):
 {900 => 8} {900 => 9}

4) Apply patch
5) Run ./misc/maintenance/search_for_data_inconsistencies.pl
=> Fixed :D
== Wrong values linked to authorised values ==
* The Framework *BKS* is using the authorised value's category *LOST*, but the following items.itemlost do not have a value defined ({itemnumber => value }):
 {900 => 9}
* The Framework *BKS* is using the authorised value's category *NOT_LOAN*, but the following items.notforloan do not have a value defined ({itemnumber => value }):
 {900 => 8}

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31558: Fix image drag and drop in TinyMCE
Fridolin Somers [Tue, 13 Sep 2022 20:27:39 +0000 (10:27 -1000)]
Bug 31558: Fix image drag and drop in TinyMCE

Bug 26949 upgraded JS lib TinyMCE to 5.9.2

This version has a known issue on images drag and drop :
https://stackoverflow.com/questions/64782955/tinymce-inline-drag-and-drop-image-upload-not-working

Test plan :
1) Go to Tools > HTML customizations
2) Create a new entry (not using text editor)
3) Drag and drop an image
=> Without patch you see an error message from TinyMCE 'Dropped file type is not supported'
=> With patch : It works !

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 31373: DRY - Use try/catch around _process_tt
Martin Renvoize [Thu, 18 Aug 2022 16:21:31 +0000 (17:21 +0100)]
Bug 31373: DRY - Use try/catch around _process_tt

This patch reduces the repetition in the tools/letter.pl controller
replaceing it with a try/catch block wrapping a call to
C4::Letters::_process_tt instead.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31373: Add INCLUDE_PATH to notice validation
Martin Renvoize [Tue, 16 Aug 2022 16:08:40 +0000 (17:08 +0100)]
Bug 31373: Add INCLUDE_PATH to notice validation

This is a follow-up to bug 31211. It adds the same INCLUDE_PATH
variables as C4::Templates adds during processing to prevent false
failures.

Test plan
1) Add an INCLUDE to any valid notice, for example:
   [% INCLUDE 'patron-title.inc' patron => patron %]
2) Save and continue
3) Confirm you are faced with a validation error complaining that
   the include file cannot be found
4) Apply this patch
5) Confirm that the reported error has dissapeared

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15348: DBRev 22.06.00.046
Tomas Cohen Arazi [Fri, 16 Sep 2022 13:59:04 +0000 (10:59 -0300)]
Bug 15348: DBRev 22.06.00.046

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15348: DBIC schema
Tomas Cohen Arazi [Fri, 16 Sep 2022 13:56:40 +0000 (10:56 -0300)]
Bug 15348: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15348: (QA follow-up) DB update fixes
Tomas Cohen Arazi [Fri, 16 Sep 2022 13:54:54 +0000 (10:54 -0300)]
Bug 15348: (QA follow-up) DB update fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 15348: (follow-up) Fix pre-selected date when editing from late orders page
Katrin Fischer [Wed, 17 Aug 2022 17:54:52 +0000 (17:54 +0000)]
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page

When editing the estimated delivery date from the late orders page,
with multiple late orders, the selected date in the edit form would
always be the same, not matching the edited date.

With this page, the edited date will match what is shown in the form.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>