koha.git
2 years agoBug 29596: DBRev 21.11.04.001 v21.11.04-1
Kyle M Hall [Fri, 25 Mar 2022 12:14:27 +0000 (12:14 +0000)]
Bug 29596: DBRev 21.11.04.001

2 years agoBug 19169: Add a test to detect unneeded 'atomicupdate' files
Mason James [Sat, 5 Mar 2022 02:30:21 +0000 (15:30 +1300)]
Bug 19169: Add a test to detect unneeded 'atomicupdate' files

to test...

1/ set git repo
    $ git reset --hard v21.11.03

2/ run test
    $ prove ./t
    OK

3/ apply patch

4/ run test again, observe FAIL

    $ prove ./t/00-check-atomic-updates.pl
    ./t/00-check-atomic-updates.pl .. 1/?
    #   Failed test 'check for unhandled atomic updates: bug_29596.pl'
    #   at ./t/00-check-atomic-updates.pl line 34.
    #                   'bug_29596.pl'
    #           matches '(?^u:.*pl$)'
    # Looks like you failed 1 test of 3.
    ./t/00-check-atomic-updates.pl .. Dubious, test returned 1 (wstat 256, 0x100)
    Failed 1/3 subtests

JD Amended patch: fix copyright year
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoUpdate Koha.pm version to 21.11.04.000 v21.11.04
Kyle M Hall [Fri, 25 Mar 2022 10:27:23 +0000 (06:27 -0400)]
Update Koha.pm version to 21.11.04.000

2 years agoUpdate release notes for 21.11.04 again
Kyle M Hall [Thu, 24 Mar 2022 18:23:43 +0000 (18:23 +0000)]
Update release notes for 21.11.04 again

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoMerge remote-tracking branch 'security/21.11.x' into 21.11.x
Kyle M Hall [Thu, 24 Mar 2022 18:19:19 +0000 (14:19 -0400)]
Merge remote-tracking branch 'security/21.11.x' into 21.11.x

2 years agoUpdate release notes for 21.11.04
Kyle Hall [Thu, 24 Mar 2022 18:04:14 +0000 (14:04 -0400)]
Update release notes for 21.11.04

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
2 years agoIncrement version for 21.11.04 release
Kyle Hall [Thu, 24 Mar 2022 17:53:41 +0000 (13:53 -0400)]
Increment version for 21.11.04 release

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
2 years agoFix translations for Koha 21.11.04
Kyle Hall [Thu, 24 Mar 2022 17:52:23 +0000 (13:52 -0400)]
Fix translations for Koha 21.11.04

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
2 years agoTranslation updates for Koha 21.11.04
Koha translators [Thu, 24 Mar 2022 16:15:45 +0000 (13:15 -0300)]
Translation updates for Koha 21.11.04

2 years agoBug 29915: (QA follow-up) Spelling
Martin Renvoize [Wed, 16 Mar 2022 14:07:23 +0000 (14:07 +0000)]
Bug 29915: (QA follow-up) Spelling

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: Add selenium tests
Jonathan Druart [Fri, 28 Jan 2022 16:12:04 +0000 (17:12 +0100)]
Bug 29915: Add selenium tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: Add a note for tests
Jonathan Druart [Thu, 27 Jan 2022 14:12:40 +0000 (15:12 +0100)]
Bug 29915: Add a note for tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: (QA follow-up) Add a comment in checkauth on $flags
Marcel de Rooy [Wed, 26 Jan 2022 15:54:28 +0000 (15:54 +0000)]
Bug 29915: (QA follow-up) Add a comment in checkauth on $flags

This is quite a misleading call.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: Changes to Auth.t
Marcel de Rooy [Wed, 26 Jan 2022 12:27:56 +0000 (12:27 +0000)]
Bug 29915: Changes to Auth.t

Test plan:
Run Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: Add tests
Jonathan Druart [Wed, 26 Jan 2022 10:58:33 +0000 (11:58 +0100)]
Bug 29915: Add tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: (QA follow-up) Fix POD typo
Marcel de Rooy [Tue, 25 Jan 2022 14:52:31 +0000 (14:52 +0000)]
Bug 29915: (QA follow-up) Fix POD typo

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: Tiny session adjustments
Marcel de Rooy [Tue, 25 Jan 2022 13:55:00 +0000 (13:55 +0000)]
Bug 29915: Tiny session adjustments

It may be that we need a few additional flushes.
And checking the returned session before clearing busc.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: Changes for get_session and check_cookie_auth
Marcel de Rooy [Mon, 24 Jan 2022 13:08:01 +0000 (13:08 +0000)]
Bug 29915: Changes for get_session and check_cookie_auth

If we look for an existing session, do not create a new one.
Found a bug in the unset_userenv calls. For this moment
changing the calls in Auth here. Later fix goes to bug
29954.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29915: Don't generate a new session ID for anonymous navigation
Jonathan Druart [Thu, 20 Jan 2022 11:05:11 +0000 (12:05 +0100)]
Bug 29915: Don't generate a new session ID for anonymous navigation

When a user is not logged in, a new session ID is generated every time a
new page is hit.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 22993: Handle default messaging preferences during patron creation from API
Nick Clemens [Fri, 25 Feb 2022 20:04:41 +0000 (20:04 +0000)]
Bug 22993: Handle default messaging preferences during patron creation from API

TO test:
1 - Set default messaging preferences for a patron category
2 - Create a patron in that category using the API
3 - Verify messaging preferences are not set
4 - Apply patch, restart all
5 - Create another patron
6 - Verify messaging preferences are correctly set
7 - prove -v t/db_dependent/api/v1/patrons.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22993: Unit tests
Nick Clemens [Fri, 25 Feb 2022 20:04:14 +0000 (20:04 +0000)]
Bug 22993: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29771: Scalar context for split
Tomas Cohen Arazi [Thu, 23 Dec 2021 19:58:57 +0000 (16:58 -0300)]
Bug 29771: Scalar context for split

This patch tackles a very specific scenario. Calling split(...,
CGI::param) makes it be called in list context. The split docs say:

split /PATTERN/,EXPR,LIMIT

this means the first CGI param will be used as EXPR and the second one
as LIMIT, which is wrong anyway. So the fix is to just force scalar
context.

To test:
1. Not sure, just make sure nothing breaks when using the scripts in the
   browser.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29771: Remove trivial cases
Tomas Cohen Arazi [Thu, 23 Dec 2021 19:16:58 +0000 (16:16 -0300)]
Bug 29771: Remove trivial cases

I squashed the patches because they are too trivial to have a test plan.
Or it is too much work to write the test plan for such trivial cases. I
leave the original commit messages just in case.

Generally, this are all cases in which CGI::param is being called in a
trivially identifiable _list context_. i.e. they are assigned to a
@variable.

I left one case out on purpose: admin/auth_subfields_structure.pl

Paul introduced this:

my @kohafield = ''.$input->param('kohafield');
and then:
my $kohafield = $kohafield[$i];

My intuition says it is forcing scalar context on the first assignment
so the list contains a single element and then inside the loop some
$kohafield assignments should lead to undef, and even warnings. I leave
it for a separate patch because it is not that easy testable and is a
sensible area.

Bug 29771: Remove warning from  acqui/finishreceive.pl

This patch removes a warning that shows when receiving.

To test:
1. Do the acq workflow up to the receive step.
2. Once you choose the items and click on Finish
=> FAIL: There's a warning in the logs
3. Revert receipt
4. Apply this patch
5. Receive
=> SUCCESS: No more warnings
6. Sign off :-D

Bug 29771: Remove warning from svc/members/add_to_list

To test:
1. Run:
   $ tail -f /var/log/koha/kohadev/*-error.log
2. Generate a patron list
3. Perform a patron search that gives you a few
4. Select some, and choose to add them to the list
=> FAIL: The logs show the infamous warn:
CGI::param called in list context from /kohadevbox/koha/svc/members/add_to_list
5. Apply this patch
6. Restart plack and repeat 4
=> SUCCESS: No warn!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30128: DBIC Schema update
Kyle Hall [Fri, 11 Mar 2022 11:35:03 +0000 (06:35 -0500)]
Bug 30128: DBIC Schema update

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30203: DBrev 21.11.03.001
Kyle Hall [Fri, 11 Mar 2022 11:25:59 +0000 (06:25 -0500)]
Bug 30203: DBrev 21.11.03.001

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30128: Change language_subtag_registry.description to varchar(255)
Fridolin Somers [Fri, 18 Feb 2022 06:37:13 +0000 (20:37 -1000)]
Bug 30128: Change language_subtag_registry.description to varchar(255)

In database, language_descriptions.description is VARCHAR(255).
language_subtag_registry.description is VARCH(25), it should have same size.

You can see in https://www.loc.gov/standards/iso639-2/php/code_list.php there is for example 'South American Indian languages'

Test plan :
1) Run atomic update
2) Check language_subtag_registry.description is now varchar(255)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30203: Circulation.t: prevent locking by setting envvar
Marcel de Rooy [Thu, 3 Mar 2022 10:27:20 +0000 (10:27 +0000)]
Bug 30203: Circulation.t: prevent locking by setting envvar

Running this test without prove is disastrous. The LOCK in
the called SendCirculationAlert will ruin your data.
But no longer when you apply this patch.

Test plan:
Run prove Circulation.t
Inspect your data (e.g. borrowers table).
Run perl Circulation.t
Inspect your data (e.g. borrowers table) again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30147: Fix modules usage in opac-detail.pl
Fridolin Somers [Fri, 25 Feb 2022 00:24:18 +0000 (14:24 -1000)]
Bug 30147: Fix modules usage in opac-detail.pl

On the ktd sample database when trying to go to the detail page from the result list:
Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_opac_opac_2ddetail_2epl::searchResults called at /kohadevbox/koha/opac/opac-detail.pl line 260
Turning off OpacBrowseResults makes the error disappear.

In opac-detail.pl, use C4::Search is missing searchResults and getRecords

To test:
- Search for something that gives several result pages in OPAC, example: e
- Switch to one of the last pages using link on top of results, example: 10
- Open any of the records listed in detail view
- Verify that the error is shown
- Apply patch and repeat, error is gone and browsing behaves as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29826: Manage call of Template Plugin Branches GetName() with null or empty branc...
Fridolin Somers [Sat, 8 Jan 2022 01:34:49 +0000 (15:34 -1000)]
Bug 29826: Manage call of Template Plugin Branches GetName() with null or empty branchcode

Bug 26587 added a concatenation that sends a warning if var is undef :
$ prove t/db_dependent/Template/Plugin/Branches.t
Use of uninitialized value $branchcode in concatenation (.) or string at /kohadevbox/koha/Koha/Template/Plugin/Branches.pm line 35.

This patch adds an early return empty string when GetName is called with $branchcode null or empty string.

Test plan :
1) Run t/db_dependent/Template/Plugin/Branches.t without patch
2) Run with the patch to see warning disappear

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30098: Only redirect from patron search if single result is on first page
Nick Clemens [Mon, 14 Feb 2022 18:38:16 +0000 (18:38 +0000)]
Bug 30098: Only redirect from patron search if single result is on first page

This patch simply adds a check that we are oin the first page (starting at result 0)
before redirecting to a isngle patron

To test:
1 - Perform a patron search that returns 41 results, on Koha testing docker, 'a' works
2 - Go to second page of results, works
3 - Go to third page of results, redirected to the patron
4 - Apply patch
5 - Repeat search and paging
6 - On third page you remian in results and are not redirected to patron

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 26269: "Date due to" and "Show any items currently checked out" filters doesn...
Marion Durand [Mon, 18 Oct 2021 12:35:21 +0000 (14:35 +0200)]
Bug 26269: "Date due to" and "Show any items currently checked out" filters doesn't work properly in overdues.pl

Filter "Date due to" is now taken into account even when filled with a
future date for the displayed result and downloaded results.
Filter "Show any items currently checked out" is now taken into account
for the downloaded results.

To test:
1- Go to Circulation then to overdues
2a- Add a filter with "Date due To" > today
2b- Check that only the results with "Due date" < today are displayed
(not those with "Due date" between today and the date requested)
2c- Click on "Download file of displayed overdues"
2d- Check that the file contains only the results with "Due date" <
today (not those with "Due date" between today and the date requested)
3a- Reset filter and then add the filter "Show any items currently
checked out"
3b- Check that all the results are displayed (even those with "Due date"
> today)
3c- Click on "Download file of displayed overdues"
3d- Check that the file contains only the results with "Due date" <
today (not those with "Due date" between today and the date requested)
9- Apply the patch
10- Repeat step 1 to 8, checking that all the results corresponding to
the selected filter are now displayed/downloaded

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

Signed-off-by: Theodoros Theodoropoulos <theod@lib.auth.gr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29220: Minor fixes and improved code readability
David Gustafsson [Wed, 13 Oct 2021 13:36:43 +0000 (15:36 +0200)]
Bug 29220: Minor fixes and improved code readability

The current handling of onsite checkouts with OnSiteCheckoutsForce
syspref enabled is confusing and hard to understand. It's also fragile
with a high risk future changes could result in subtle bugs.

Also fix an inconsistency in which errors (DEBT_GUARANTORS) are considered blocking for
forced onsite checkouts.

To test:
1) Enable OnSiteCheckouts, disable OnSiteCheckoutsForce
2) Edit a biblio item and for example set Not for loan to a value
restricting loans
3) Try to check out the item for some patron
4) A message that item is not for loan should be displayed
5) Select "On-site checkout" and try again
6) The same message should be displayed
7) Try to checkout with some invalid barcode
8) A message that barcode was not found should be displayed
9) Now enable OnSiteCheckoutsForce
10) Try to checkout the item for some patron
11) A message that item is not for loan should be displayed
12) Select "On-site checkout" and try again
13) Checkout should now succeed, no messages should be displayed
14) Try to checkout with some invalid barcode
15) A message that barcode was not found should be displayed
16) All of the above steps should produce the same result with and without this patch

Additional:
Before patch:
 a) Set  NoIssuesChargeGuarantorsWithGuarantees to 1
 b) add a guarantee with another guarantor
 c) charge a 1.01 fine to other guarantor
 d) checkout is blocked due to fines
Apply patch
 e) checkout is allowed when onsite checkouts forced

Sponsored-by: Gothenburg University Library
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29877: Make POST /holds handle maxreserves correctly
Tomas Cohen Arazi [Thu, 13 Jan 2022 15:10:30 +0000 (12:10 -0300)]
Bug 29877: Make POST /holds handle maxreserves correctly

The current implementation doesn't consider the following values for the
syspref: undef and 0.

The tests mistakenly didn't cover them.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, obvious warnings about comparing undefined values
         too.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. You can try on Postman as well
=> SUCCESS: Behavior is correct!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29877: Regression tests
Tomas Cohen Arazi [Thu, 13 Jan 2022 15:10:24 +0000 (12:10 -0300)]
Bug 29877: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30178: (bugs 27526 and 28445 follow-up) Every librarian can edit every item with...
Janusz Kaczmarek [Thu, 24 Feb 2022 20:26:46 +0000 (21:26 +0100)]
Bug 30178: (bugs 27526 and 28445 follow-up) Every librarian can edit every item with IndependentBranches on

Problem arises after applying bugfix 27526 and 28445: with
IndependentBranches on, a librarian without superlibrarian privileges,
can edit (and potentially delete) every item (i.e. also from a foreign
branch).  This is because can_be_edited calculation is buggy (in two spots).

Test plan:
1. Have (at least) two branches defined.
2. Have IndependentBranches set.
3. Have a biblio record with items belonging to different branches.
4. Be a librarian without superlibrarian rights, with editcatalogue
   and tool permissions set.

Scenario A (Edit items):
1. Go to Edit -> Edit items view (cataloguing/additems.pl).
2. You will be able to edit every item, also ones not from the branch
   you are from (cf. the button 'Actions').
3. Apply the patch.
4. Repeat 1.
5. You should be able to edit only the items from your branch.

Scenario B (Edit items in batch):
1. From Normal view go to Edit -> Edit items in batch.
2. You will be able to batch edit every item, also ones not from the branch
   you are from.
3. Apply the patch.
4. Repeat 1.
5. You should be able to edit only the items from your branch (and
   see 'Cannot edit' for others.

Scenario C (Delete items in batch):
1. From Normal view go to Edit -> Delete items in batch.
2. You will not see the string 'Cannot delete' and only by chance
   will not be able to activate the checkboxes next to foreign items.
3. Apply the patch.
4. Repeat 1.
5. You should be able to delete only the items from your branch (and
   see 'Cannot delete' for others.

Scenario D and E:
Analogous steps can be executed from Tools -> Batch item modification
and Tools -> Batch item deletion

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30072: (follow-up) Silence useless warning
Tomas Cohen Arazi [Fri, 11 Feb 2022 18:35:31 +0000 (15:35 -0300)]
Bug 30072: (follow-up) Silence useless warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30072: Add missing hold actions plugin hooks
Tomas Cohen Arazi [Fri, 11 Feb 2022 18:28:31 +0000 (15:28 -0300)]
Bug 30072: Add missing hold actions plugin hooks

This patch introduces the after_hold_action plugin hook, with 4
different 'action' parameters:

- fill
- cancel
- suspend
- resume

To test:
1. Apply the unit tests
2. Run:
   $ kshell
  k$ t/db_dependent/Koha/Plugins/Holds_hooks.t -v
=> FAIL: The hooks are not in the code, so the expected output from the
Koha::Plugin::Test plugin is not there, and the tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Note: I think we could deprecate 'after_hold_create' and migrate it to
the one introduced here, using the 'place' action.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30072: Unit tests
Tomas Cohen Arazi [Fri, 11 Feb 2022 18:28:10 +0000 (15:28 -0300)]
Bug 30072: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29886: Add Koha::Suggestions->search_limited
Tomas Cohen Arazi [Fri, 14 Jan 2022 16:03:54 +0000 (13:03 -0300)]
Bug 29886: Add Koha::Suggestions->search_limited

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: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29886: Unit tests
Tomas Cohen Arazi [Fri, 14 Jan 2022 17:49:29 +0000 (14:49 -0300)]
Bug 29886: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 25616: [21.11.x] (follow-up) Fix t/Search.t
Fridolin Somers [Wed, 2 Mar 2022 18:52:54 +0000 (08:52 -1000)]
Bug 25616: [21.11.x] (follow-up) Fix t/Search.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 25616: [21.11.x] (QA follow-up) Catch a case in labels/label-item-search.pl
Martin Renvoize [Tue, 22 Feb 2022 16:15:11 +0000 (16:15 +0000)]
Bug 25616: [21.11.x] (QA follow-up) Catch a case in labels/label-item-search.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 25616: [21.11.x] (follow-up) Use uppercase in advanced search booleans
Fridolin Somers [Tue, 15 Feb 2022 07:21:40 +0000 (21:21 -1000)]
Bug 25616: [21.11.x] (follow-up) Use uppercase in advanced search booleans

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 25616: [21.11.x] Fix t/db_dependent/Search.t
Fridolin Somers [Tue, 15 Feb 2022 07:16:16 +0000 (21:16 -1000)]
Bug 25616: [21.11.x] Fix t/db_dependent/Search.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 25616: [21.11.x] Uppercase hard coded lower case boolean operators for Elasticsearch
David Gustafsson [Thu, 28 May 2020 12:30:03 +0000 (14:30 +0200)]
Bug 25616: [21.11.x] Uppercase hard coded lower case boolean operators for Elasticsearch

Uppercase occurances of all (hopefully) lowercase "and"
used in ElasticSearch Query String Query contexts

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29989: Improve headings in MARC staging template
Owen Leonard [Tue, 1 Feb 2022 11:55:23 +0000 (11:55 +0000)]
Bug 29989: Improve headings in MARC staging template

This patch updates the MARC staging page so that the headings are
descriptive based on the context.

To test, apply the patch and go to Tools -> Stage MARC for import.

- The heading should be "Stage MARC records for import."
- Upload a MARC file and stage the file for import.
- The heading on the next page should read "MARC staging results."

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29589: (follow-up) Add TT filter
Katrin Fischer [Sat, 26 Feb 2022 22:41:11 +0000 (23:41 +0100)]
Bug 29589: (follow-up) Add TT filter

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29589: MARCOverlayRules - fix translatability issue
Jonathan Druart [Tue, 30 Nov 2021 13:10:58 +0000 (14:10 +0100)]
Bug 29589: MARCOverlayRules - fix translatability issue

Strings must not contain html tags, we should use KohaSpan instead.

Test plan:
Apply the patch, update translation for a given language, edit XX-YY-staff-prog.po

Notice that the string is now
"The %s preference is not set, don't forget to enable it for rules to take effect."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30035: Fix failing test
Jonathan Druart [Fri, 4 Mar 2022 07:47:15 +0000 (08:47 +0100)]
Bug 30035: Fix failing test

Looks like there was a change in the output for Spanish.
Can be 'ene.' in older versions

Sponsored-by: Orex Digital
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30035: Fix month name in prediction pattern
Jonathan Druart [Mon, 7 Feb 2022 08:26:12 +0000 (09:26 +0100)]
Bug 30035: Fix month name in prediction pattern

We are using %B to display the month name but it seems that using the
CLDR pattern LLLL would be more appropriated.
https://metacpan.org/pod/DateTime#CLDR-Patterns
%B   - The full month name.
LLLL - The wide stand-alone form for the month.

For instance in Catalan:
https://metacpan.org/pod/DateTime::Locale::ca
%B will display "de gener" when LLLL will be "gener"

Test plan:
Create a new numbering pattern:
Home > Serials > Numbering patterns > New numbering pattern
Numbering formula: {X}
Label: monthname
Add: 1
Every: 1
Set back to: 1
When more than: 999
Formatting: Name of month
And test it at the bottom of the form
Locale: Catalan
The number column should contain "gener", not "de gener"
Test other locales and confirm that the output is correct (no change
expected for English, French and Spanish for instance).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29687: Uninitialized warning C4/XSLT line 286
Marcel de Rooy [Mon, 13 Dec 2021 13:23:57 +0000 (13:23 +0000)]
Bug 29687: Uninitialized warning C4/XSLT line 286

From plack-opac-error.log:
[WARN] Use of uninitialized value $value in concatenation (.) or string at /usr/share/koha/C4/XSLT.pm line 286.

Test plan:
An opac search triggered the warning. So repeat it without warns.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30185: Missing return in db rev 210600003.pl
Fridolin Somers [Sat, 26 Feb 2022 01:57:41 +0000 (15:57 -1000)]
Bug 30185: Missing return in db rev 210600003.pl

db rev files are constructed with a return {...}, db rev 210600003.pl is missing return word.
I don't know if it can impact the db upgrade but we should fix it for consistency.

To test upgrade from a version 21.05 and check db rev is applied.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30164: Fix datatable wrapper when no filter passed
Jonathan Druart [Wed, 23 Feb 2022 14:21:04 +0000 (15:21 +0100)]
Bug 30164: Fix datatable wrapper when no filter passed

This problem appears (at least) on the cities list view:
If you pass a filter in the "Search cities" filter in the header, it
won't be taken into account and all the cities will be displayed.

There are two problems. First we are passing an "empty" q=[] in the
body, the filter from the header is passed as URL parameters. We should
not need to pass the q if it's empty.
Then the main problem is coming from a bug in
Koha::REST::Plugin::Query but I didn't manage to track it down. If we
have two 2 passed, only the second one will be used. We are certainly
using a hash somewhere we should not.

This patch is fixing the bug but not on the correct side. A follow-up
bug should take care of the main problem at lower level.

Test plan:
Hit /admin/cities.pl
Create some cities
Use the filter in the header of the page and submit
=> Without this patch all cities are retrieved
=> With this patch applied only the relevant cities are displayed.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29338: (follow-up) only show print button when hold is waiting or intransit
Lucas Gass [Tue, 21 Dec 2021 21:36:28 +0000 (21:36 +0000)]
Bug 29338: (follow-up) only show print button when hold is waiting or intransit

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29338: Add print hold/transfer button to request.tt
Lucas Gass [Wed, 27 Oct 2021 21:58:44 +0000 (21:58 +0000)]
Bug 29338: Add print hold/transfer button to request.tt

1. Apply patch
2. Make some holds, have some item level and some bib level
3. On request.tt notice a new column on the holds_table called 'Print hold/transfer slip'
4. Make sure the button works and takes you to the proper hold/transfer slip
5. Make sure it works well with both item/bib level holds

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30153: (QA follow-up) Fix unit tests
Martin Renvoize [Tue, 22 Feb 2022 16:28:19 +0000 (16:28 +0000)]
Bug 30153: (QA follow-up) Fix unit tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30153: Use uppercase AND to join query parts
Thomas Klausner [Tue, 22 Feb 2022 14:09:58 +0000 (15:09 +0100)]
Bug 30153: Use uppercase AND to join query parts

C4::Search->FindDuplicate joins title and author using 'and'
(lowercase). When this query is passed on to ElasticSearch, it
interprets the lowercase 'and' as a term to search for, because the
operator has to be in uppercases ('AND').

Test plan:
* Reproduce the bug:
- Set SearchEngine to ElasticSearch (and make sure you have the data
  indexed etc)
- Find an existing book, note the title (245a) and the author (100a)
- Create a new book (Cataloging -> New Record)
- Fill in the same title and author using the same data as in an
  existing book (and any other fields that might be required)
- Click "save"
=> A new book will be created, the Duplicate Finder has failed

* Apply the patch

* Check if it's working now:
- Create a new book (Cataloging -> New Record)
- Fill in the same title and author using the same data as in an
  existing book (and any other fields that might be required)
- Click "save"
- The DuplicateFinder should now report the already exising book

Maybe we should also check if Zebra does not have any problems with the
uppercase 'AND'? In that case, repeat the above steps, but set
SearchEngine to Zebra :-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29287: Add child funds to display of parent funds on acqui home
Nick Clemens [Wed, 20 Oct 2021 18:47:01 +0000 (18:47 +0000)]
Bug 29287: Add child funds to display of parent funds on acqui home

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Michael Sutherland <sudrland@vt.edu>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30132: Fix POD, show correct usage of Getopt::Long
David Schmidt [Fri, 18 Feb 2022 14:00:20 +0000 (15:00 +0100)]
Bug 30132: Fix POD, show correct usage of Getopt::Long

the USAGE of overdue_notices.pl shows options such as -date OR
-csv that should be written with double dashes like --date or --csv

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28663: Prevent discounts against void lines
Martin Renvoize [Mon, 5 Jul 2021 18:37:57 +0000 (19:37 +0100)]
Bug 28663: Prevent discounts against void lines

With the introduction of double entry accounting for VOID actions, we
need to add an additional filter to the 'Apply discount' button appearance

Test plan
1/ Add a debt
2/ Pay the debt
3/ Void the payment
4/ Confirm that with the patch applied the 'Apply discount' button does
not appear on the 'Void' accountline.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30084: Remove dependency of liblocale-codes-perl (follow-up)
Mason James [Wed, 2 Mar 2022 05:52:24 +0000 (18:52 +1300)]
Bug 30084: Remove dependency of liblocale-codes-perl (follow-up)

trival patch, no test plan

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30084: Remove explicit dependency of liblocale-codes-perl
Mason James [Mon, 24 May 2021 21:21:53 +0000 (09:21 +1200)]
Bug 30084: Remove explicit dependency of liblocale-codes-perl

1/ apply patch

2/ build and install new koha-common package

=> Package liblocale-codes-perl is not installed, Koha does not need it

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
JD amended patch: fix commit message
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
2 years agoUpdate release notes for 21.11.03 release v21.11.03
Kyle M Hall [Fri, 25 Feb 2022 18:32:37 +0000 (18:32 +0000)]
Update release notes for 21.11.03 release

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoIncrement version for 21.11.03 release
Kyle M Hall [Fri, 25 Feb 2022 18:06:54 +0000 (18:06 +0000)]
Increment version for 21.11.03 release

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoFix translations for Koha 21.11.03
Kyle M Hall [Fri, 25 Feb 2022 17:33:53 +0000 (17:33 +0000)]
Fix translations for Koha 21.11.03

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoMerge remote-tracking branch 'koha-translate/21.11.03-translate-20220225' into 21...
Kyle Hall [Fri, 25 Feb 2022 16:39:40 +0000 (11:39 -0500)]
Merge remote-tracking branch 'koha-translate/21.11.03-translate-20220225' into 21.11.x

2 years agoTranslation updates for Koha 21.11.03
Koha translators [Fri, 25 Feb 2022 16:21:47 +0000 (13:21 -0300)]
Translation updates for Koha 21.11.03

2 years agoMerge remote-tracking branch 'security/21.11.x' into 21.11.x
Kyle Hall [Fri, 25 Feb 2022 15:57:26 +0000 (10:57 -0500)]
Merge remote-tracking branch 'security/21.11.x' into 21.11.x

2 years agoBug 30133: (follow-up) Update objects.search POD
Tomas Cohen Arazi [Mon, 21 Feb 2022 11:59:05 +0000 (08:59 -0300)]
Bug 30133: (follow-up) Update objects.search POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations
Tomas Cohen Arazi [Fri, 18 Feb 2022 19:07:02 +0000 (16:07 -0300)]
Bug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations

This patch does the same thing we did for items on the previous patch,
but for biblios. The tests are almost the same as well.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30133: Simplify code
Tomas Cohen Arazi [Fri, 18 Feb 2022 18:22:36 +0000 (15:22 -0300)]
Bug 30133: Simplify code

This patch simplifies the code, and also fixes a problem with branchcode
comparisson failing, highlighted when running the tests

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> FAIL: Tests fail. Notably:
- Link header pagination is wrong
- X-*Total-Count headers have two values (dupicated)
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30133: Avoid calling c->objects->search twice
Nick Clemens [Fri, 18 Feb 2022 14:25:41 +0000 (14:25 +0000)]
Bug 30133: Avoid calling c->objects->search twice

Calling this twice sets double pagination headers, which messes up the page for the requests and
retrieves on ly the end of the list

This patch simply avoids a doulbe call

TO DO: must implement same for Biblio->pickup_locations and cover with tests
this also returns all as needing override

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30133: Regression tests
Tomas Cohen Arazi [Fri, 18 Feb 2022 18:33:42 +0000 (15:33 -0300)]
Bug 30133: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30129: Add test
Jonathan Druart [Mon, 21 Feb 2022 11:59:40 +0000 (12:59 +0100)]
Bug 30129: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30129: remove the third required date that was causing 500 error
Petro Vashchuk [Fri, 18 Feb 2022 11:42:34 +0000 (13:42 +0200)]
Bug 30129: remove the third required date that was causing 500 error

This problem appeared because of this commit:
Bug 14435 Add the ability to store result's report
cf9031711282f4be23e4a639797d0fd178940e1f

This patch fixes it by removing the third $date that wasn't removed
back then.

To reproduce:
1) Head over to Reports page.
2) Search for report by date. It should cause 500 error.
3) Apply the patch.
4) Repeat the search again, it should be working now.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29962: (bug 27526 follow-up): Fix columns button on item list
Jonathan Druart [Fri, 28 Jan 2022 08:49:44 +0000 (09:49 +0100)]
Bug 29962: (bug 27526 follow-up): Fix columns button on item list

The "Columns" button on the item list view has been broken (hidden) by
bug 27526.
"column_name" was removed from the item_header_loop:
-    if ( $kohafield && $kohafield =~ /items.(.+)/ ) {
-        $header_value{column_name} = $1;
-    }

We can still access the attribute name using 'attribute' however.
The difference is that non-mapped subfield will have an "attribute", but
there is a net to prevent a crash in columns_settings.inc:
 12         var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
 13         var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
 14         if ( used_id == -1 ) return;

We should simply pass attribute.

Test plan:
Create a non-mapped subfield (952$k)
Edit an item, add a value for k
On the item table at the top of the edit form notice that the "Columns"
button is back and that it's working correctly.
Note that 'k' cannot be hidden (may be considered as a bug, but it's not
a regression).

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29803: Do not wait for the images more than 5 seconds
Jonathan Druart [Mon, 10 Jan 2022 11:29:11 +0000 (12:29 +0100)]
Bug 29803: Do not wait for the images more than 5 seconds

In case of the previous bug, the page was calling the callback function
every 100ms, endlessly. We should add a test to prevent future similar
problem.

Test plan:
Remove the previous patch "Prevent local cover image to be hidden if
Coce is enabled"
Recreate the test plan
=> You should see the local image displayed after 5 seconds, and a
log in the JS console

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29803: Prevent local cover image to be hidden if Coce is enabled
Jonathan Druart [Mon, 10 Jan 2022 11:19:54 +0000 (12:19 +0100)]
Bug 29803: Prevent local cover image to be hidden if Coce is enabled

If Coce is enabled by no image are returned by the service, then no
other image will be displayed (actually un-hidden)

The getURL is returning early if no image is returned by the service and
the "done" flag is never set.

Test plan:
Add a local cover image to a bibliographic record (ktd biblionumber=14
is good)
Set CoceHost = http://coce.bywatersolutions.com
Select all CoceProviders
Enable OpacCoce

=> If no image is returned by Coce then the local image should be
displayed anyway

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27770: ES: Deprecated aggregation order key [_term] used, replaced by [_key]
Kevin Carnes [Tue, 8 Feb 2022 13:35:18 +0000 (14:35 +0100)]
Bug 27770: ES: Deprecated aggregation order key [_term] used, replaced by [_key]

Starting in Elasticsearch 6.0 _key should be used instead of _term to order
buckets by their term

To test:
1) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
2) If you observe an error about types, apply patch for bug 25669
3) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
4) Observe if you get a deprecation warning about order key
5) Apply patch
6) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
7) Observe no deprecation warning about order key
8) Sign off

Sponsored-by: Lund University Library
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation
Jonathan Druart [Fri, 28 Jan 2022 14:04:49 +0000 (15:04 +0100)]
Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation

If you cancel holds in bulk, the list is not updated as we enqueued the
task. But the "Update hold(s)" button will explode if clicked.

Test plan:
Place several holds on a bib record
Use the "Cancel selected" link to cancel holds in bulk
The job is enqueued and the hold list still show the holds you cancelled
Click "Update holds"
=> Without this patch you get an ugly 500
Can't call method "found" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1060
=> With this patch applied the table is refresh, no crash (and there is
a warning in the log, that may not be necessary)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30115: Uninitialized value warning in C4/Output.pm
Blou [Tue, 15 Feb 2022 21:18:15 +0000 (16:18 -0500)]
Bug 30115: Uninitialized value warning in C4/Output.pm

Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 180.
Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 197.
Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 211.

This is in pagination_bar sub.  A lot of pages call it.  For me it
happened with any Authority search (authorities/authorities-home.pl)
producing multiple results.

Simple fix is initializing the variable.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29625: Add test for get_all_biblios_iterator
Jonathan Druart [Fri, 18 Feb 2022 10:01:55 +0000 (11:01 +0100)]
Bug 29625: Add test for get_all_biblios_iterator

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29625: Fix var name in Koha::BiblioUtils get_all_biblios_iterator
Fridolin Somers [Thu, 2 Dec 2021 22:21:45 +0000 (12:21 -1000)]
Bug 29625: Fix var name in Koha::BiblioUtils get_all_biblios_iterator

In Koha::BiblioUtils, get_all_biblios_iterator method is a class level method like get_from_biblionumber.
So its first arg should be named $class instead of $self.
Even if this var in not used.

Test plan :
1) Run Elasticsearch full rebuild with and without patch
2) Check all biblio records are in index

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 22671: Show warning if browser doesn't support applicationCache
Owen Leonard [Mon, 18 Oct 2021 12:29:19 +0000 (12:29 +0000)]
Bug 22671: Show warning if browser doesn't support applicationCache

This patch adds a check for browser support for the "applicationCache"
feature required by the offline circulation tool. If the feature is not
available, a message is shown to the user that offline circulation is
disabled.

To test, apply the patch and enable the AllowOfflineCirculation system
preference.

In a browser which supports applicationCache (Firefox < 81, Chrome < 94,
Safari <= 15), go to Circulation -> Built-in offline circulation
interface.

- You should see the standard Offline Circulation menu options: Check
  out, check in, syncrhonize, etc.
- Click "Synchronize," then "Download records."
- The process should complete correctly, updating the "last synced"
  information on the page.

Follow the same steps in a browser which has dropped support for
applicationCache. As soon as you reach the built-in offline circulation
page you should see a message, "Your browser is not compatible..."

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29853: Add HTML filter before KohaSpan filter
Fridolin Somers [Wed, 12 Jan 2022 05:40:35 +0000 (19:40 -1000)]
Bug 29853: Add HTML filter before KohaSpan filter

Usage of Template Toolkit plugin KohaSpan as filter is actually :
  Group [% added.title | $KohaSpan class = 'name' | $raw %] created.

But KohaSpan filter does not escape HTML characters.
Whe should filter HTML then KohaSpan.

This patch adds TT html filter before KohaSpan.
Also replaces in Javascript html() with text()
to ensure special caracters are still encoded.
See https://api.jquery.com/text/

Test plan :
1) Create a library with name Libra&apos;rie
2) Create a library group with name Grou&apos;pe
3) Play with this group
4) Add library
5) Remove library
6) Edit group
7) Delete group
8) Each time check that &apos, is not interpreted as single quote

Signed-off-by: Solène Desvaux <solene.desvaux@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29761: Prevent batch patron modification to process several time the same patron
Alex Buckley [Mon, 13 Dec 2021 02:31:51 +0000 (02:31 +0000)]
Bug 29761: Prevent batch patron modification to process several time the same patron

If a cardnumber, SMS number, or borrower number is inputted multiple times then the batch patron
modification page should not display that patron multiple times.

Test plan:
1. Create three text files that list card numbers, SMS numbers, and borrower numbers for three patrons. Example lists are below, notice in each there is one number duplicated:

Card numbers:
  23529000035676
  23529000651225
  23529000080862
  23529000035676

Borrower numbers:
  19
  49
  7
  49

SMS numbers:
  2125551212
  2125551212
  2125551213
  2125551214

2. Enable sending of SMS messages:
* Set SMSSendDriver system preference to Email

3. Make sure the cardnumbers, borrower numbers, and SMS numbers listed
above belong to patrons in your Koha

4. Go to Tools > Batch patron modification

5. Upload lists of cardnumbers, SMS numbers, and borrower numbers above, and confirm the following is happening in the batch patron modification page:
- Upload the text file of cardnumbers. Notice one patron is displayed twice
- Paste in the list of cardnumbers. Notice one patron is displayed twice
- Upload the text file of SMS numbers. Notice one patron is displayed twice
- Paste in the list of SMS numbers. Notice one patron is displayed twice
- Upload the text file of borrower numbers. Notice one patron is displayed twice
- Paste in the list of borrower numbers. Notice one patron is displayed twice

6. Apply patch and restart services

7. Repeat step 5 and this time observe that the patron record is not duplicated in the batch patron modification page

Sponsored-By: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
JD Amended patch: adjust commit title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29795: add empty value for branchcode on self-reg form
Lucas Gass [Tue, 4 Jan 2022 22:44:32 +0000 (22:44 +0000)]
Bug 29795: add empty value for branchcode on self-reg form

1. Set branch code as a PatronSelfRegistrationBorrowerMandatoryField
2. Go to the self reg form and look at the Home library field, it defaults to the first choice alphabetically
3. Fill out the other required fields and the captcha. Don't change the branchcode value.
4. Submit the form, it submits.
5. If branchcode is required it should default to an empty value and force the user to make a choice.
6. Apply patch
7. Repeat 1-3
8. Now you cannot submit the form unless you choose a branchcode
9. Make sure it still works normally when branchcode is not in PatronSelfRegistrationBorrowerMandatoryField

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30099: Fix error when accessing circulation.pl without patron parameter
Fridolin Somers [Mon, 14 Feb 2022 20:35:53 +0000 (10:35 -1000)]
Bug 30099: Fix error when accessing circulation.pl without patron parameter

If I access circulation.pl directly, with no patron cardnumber or borrowernumber submitted, I get an error:
Can't call method "messages" on an undefined value at /kohadevbox/koha/circ/circulation.pl line 525

This is caused by Bug 29230 which calls $patron outside a
"if ($aptron)".

Test plan :
1) In staff interface, click in 'check out' search box
2) Hit enter (without a search text)
=> Without patch you get an error
=> With patch you see a blank page /cgi-bin/koha/circ/circulation.pl

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30090: Don't export some columns in patron search results
Fridolin Somers [Mon, 14 Feb 2022 21:04:25 +0000 (11:04 -1000)]
Bug 30090: Don't export some columns in patron search results

The checkout and Edit buttons should not export (Exel, Print) on the patron search result list.
Same for fist column with checkboxes.

Test plan :
1) Go to patrons module /cgi-bin/koha/members/members-home.pl
2) Perform a search with results
3) Click on 'Export' then 'Print'
=> Check you dont see column with checkboxes (text 'Select patron') and colum with actions

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30082: Bibliographic details tab missing when user can't add local cover image
Owen Leonard [Fri, 11 Feb 2022 15:24:43 +0000 (15:24 +0000)]
Bug 30082: Bibliographic details tab missing when user can't add local cover image

This patch corrects the template logic which determines whether the
"Images" tab should be displayed on the bibliographic detail page. The
"Images" tab should display whenever local cover images are enabled, not
just if the user has permission to manage cover images.

To test, apply the patch and go to Administration -> System preferences.

- Enable the LocalCoverImages system preference.
- Locate and view the detail page for a bibliographic record in the
  catalog which doesn't have a local cover image attached.

  - If you are logged in as a user with upload_local_cover_images
    permission you should see an "Images" tab with the message "No
    images have been uploaded for this bibliographic record yet" and an
    upload button.
  - If you are logged in as a user without upload_local_cover_images
    permission you should see an "Images" tab with just the "No
    images..." message.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29952: Replace obsolete DataTable column filter function
Owen Leonard [Thu, 27 Jan 2022 11:50:28 +0000 (11:50 +0000)]
Bug 29952: Replace obsolete DataTable column filter function

The "Filter paid transactions" link on the Accounting -> Transactions
page is broken because it uses an obsolete DataTables function for
filtering. This patch updates it to use the current syntax, available in
DataTables since version 1.10.

To test, apply the patch and locate a patron in the staff interface who
has multiple fines, some paid.

- View the patron's "Accounting" page and click the "Transactions" tab.
- Click the "Filter paid transactions" link. The table should be
  filtered so that only transactions with an outstanding amount > zero
  are shown.
- The filter link should change to read "Show all transactions."
- Clicking "Show all transactions" should clear the filter.
- Test with one or more columns hidden using the "Columns" control.
  Filtering should still work correctly with columns hidden.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29706: (follow-up) Adjust code to work for multi-holds
Nick Clemens [Tue, 8 Feb 2022 12:30:23 +0000 (12:30 +0000)]
Bug 29706: (follow-up) Adjust code to work for multi-holds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29706: Hide items that cannot be held by default when placing hold on OPAC
Nick Clemens [Thu, 16 Dec 2021 01:59:50 +0000 (01:59 +0000)]
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC

This patch adds a 'holdable' and 'unholdable' class to the rows of the table

Additionally I rename the 'backgroundcolor' field to 'onloan' as that is what it contains.
Note: Out of the box, there is no css associated with this class

I add a div around the table to allow hiding the new buttons as well when optiuons are hidden

It would be nice in the future to utilise a Koha table here, however, it is complicated by multi-holds

To test:
 1 - Add a number of items to a record, ensuring they belong to different libraries
 2 - Set 'Default checkout, hold and return policy'->'Hold policy' to 'From home library'
 3 - Sign in to opac and attempt to placehold on the record
 4 - Click 'show more options' and 'a specificitem'
 5 - Note holds table includes items that cannot be held
 6 - Apply patch
 7 - Reload holds page
 8 - Note items that cannot be heldare hidden
 9 - Click 'Show unholdable items' and note they appear
10 - Click 'Hide unholdable items' and veriofy they hide
11 - Test with multi holds

Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29706: Improve table elements
Nick Clemens [Thu, 16 Dec 2021 01:12:52 +0000 (01:12 +0000)]
Bug 29706: Improve table elements

This patch add a thead and tbody element to the 'copiesrow' table

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29385: Catch register_id for payments against fees
Jonathan Druart [Thu, 2 Dec 2021 12:52:45 +0000 (13:52 +0100)]
Bug 29385: Catch register_id for payments against fees

This patch refactors the pay method in SIP FeePayment such that we
consistently pass parameters to both invocations of Koha::Account->pay.

It ensure the missing cash_register definition is passed when a set of
account lines to pay is defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28576: Update the maximum size of an image.
The Minh Luong [Tue, 1 Feb 2022 19:44:06 +0000 (14:44 -0500)]
Bug 28576: Update the maximum size of an image.

This patch modifies the maximum size of a patron's image, from 500KB to
2MB. Also, in Home/Patrons/anyPatron, when you try to add an image to a
patron, you can now see the supported file types AND the maximum size.

The following places are affected by this patch:
- Home/Patrons/anyPatron
- Home/Tools/Upload patron images
- Home/Tools/Patron card creator/Images

To test:
1)Search for any patron and go to his page.
2)Hover over the image area on the left and click on the "Add" button.
3)Notice that the message above the choose file button only specifies
file types without the maximum size.
4)Add an image bigger than 500KB.
5)Nothing happens. (This is because the maximum size is 5KB)
6)Apply the patch.
7)Repeat steps from 1 to 3.
8)Notice that the message now includes the maximum size.
9)Add an image bigger than 500KB, but smaller than 2MB.
10)The image is succesfully uploaded.
11)Add an image bigger than 2MB.
12)Nothing happens. (The maximum size is now 2MB)
13)Repeat the steps 9 to 12 in "Home/Tools/Upload patron images" and
"Home/Tools/Patron card creator/Images".
14)Notice that the maximum size is updated.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28576: Add patron image in patron detail section does not specify image size...
Salman Ali [Wed, 16 Jun 2021 17:20:24 +0000 (13:20 -0400)]
Bug 28576: Add patron image in patron detail section does not specify image size limit

When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented.

This is not the case with the 2 other places where we can add patron images in which they give warnings:
Home/Tools/Upload patron images
Home/Tools/Patron card creator/Images

For now, i simply added the size limit to the file supported message.

To test:
1)Search for any patron and go to his page
2)Hover over the image area on the left and click on add
3)Notice the message above the choose file button only specifies file types not size.
4)Add an image bigger than 500 kb
5)Nothing happens
6)Apply patch
7)Repeat steps from 1 to 3
8)Notice the message now includes the maximum size

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29519: Allow resolution of claims return at checkin
Martin Renvoize [Wed, 17 Nov 2021 16:07:40 +0000 (16:07 +0000)]
Bug 29519: Allow resolution of claims return at checkin

Add a 'Resolve' button in the alert dialogue that is displayed when a
lost item with a return claim is checked in. The button will trigger the
usual resolution modal allowing the user to pick their resolution.

This patch splits the resolution modal out of checkouts.js and
checkouts-table.inc so it can be used outside of the checkouts table.
We then reload it, optionally based upon the presence of the claims
preference, where needed.  This has the added benefit that it saves a
little bit of page load data in cases where the feature is not enabled.

Test plan
1. As we alter the file locations of the resolution handling code we
   need to test that normal claims functionality continue to work as
   expected.
2. Test the new functoinality by checking in an item that has been
   claimed as returned (but not yet resolved). The dialogue box should
   now contain a 'resolve' button next to each claimant and clicking
   upon it should trigger the resolution modal where the librarian can
   subsequently pick the resolution and submit it.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29570: Simplify for loop
Jonathan Druart [Tue, 8 Feb 2022 16:35:27 +0000 (17:35 +0100)]
Bug 29570: Simplify for loop

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29570: Enable sorting orders by summary
Tomas Cohen Arazi [Wed, 2 Feb 2022 20:10:36 +0000 (17:10 -0300)]
Bug 29570: Enable sorting orders by summary

This patch enables (on receiving) sorting orders by the summary column.
It needs the previous patches to work. Title is given more precedence as
expressed by users on the bug report. Which, by the way, makes sense.

To test:
1. Create a basket
2. Create orders
3. Close basket
4. Receive shipment
5. Enter invoice information
=> SUCCESS: You should see your pending orders
=> FAIL: Verify the 'Summary' column is not sortable
7. Apply this patches
8. Restart Plack
9. Reload the page
=> SUCCESS: Can sort by the summary column
10. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>