koha.git
18 months agoBug 24860: Add ability to select an item group when placing a hold - OPAC
Kyle Hall [Thu, 9 Jun 2022 18:06:45 +0000 (14:06 -0400)]
Bug 24860: Add ability to select an item group when placing a hold - OPAC

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 24860: Add ability to select an item group when placing a hold
Kyle Hall [Fri, 3 Jun 2022 10:33:25 +0000 (06:33 -0400)]
Bug 24860: Add ability to select an item group when placing a hold

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 24860: Implement reserves.item_group_id
Kyle M Hall [Fri, 28 Feb 2020 19:45:44 +0000 (14:45 -0500)]
Bug 24860: Implement reserves.item_group_id

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 24860: Add new syspref EnableItemGroupHolds
Kyle M Hall [Fri, 28 Feb 2020 15:51:47 +0000 (10:51 -0500)]
Bug 24860: Add new syspref EnableItemGroupHolds

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 24860: Add reserves.item_group_it
Kyle M Hall [Fri, 28 Feb 2020 15:37:05 +0000 (10:37 -0500)]
Bug 24860: Add reserves.item_group_it

This feature builds upon bug 24857 and allows placing holds that target a specific item group of a record. It is patterned after the feature that allows limiting hold selection by itemtype ( AllowHoldItemTypeSelection ).

Test Plan:
1) Apply bug 24857 and this bug's patches
2) Run updatedatabase.pl
3) Restart all the things!
4) Enable the sysprefs EnableVolumes and EnableVolumeHolds
5) Create a record, items and item groups, with each item being assigned to
an item group
6) Place a hold for a patron
7) Note the new selector to choose an item group in addition to record and item level holds
8) Place an item group level hold
9) Check in an item from the record that is not part of that item group
10) Note the hold is not trapped for that item
11) Check in an item from the record that *is* part of that item group
12) Note the hold is trapped for that item
13) Place an item group level hold for another item
14) Run the holds queue builder
15) Note the holds queue targets only items from that item group
16) Check out all the items of that item group to other patrosn
17) Re-run the holds queue builder
18) Note the holds queue no longer has a line for that hold,
    as all items that could fill that hold are now unavailable

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31517: (QA follow-up) Fix indentation
Katrin Fischer [Wed, 2 Nov 2022 22:27:11 +0000 (22:27 +0000)]
Bug 31517: (QA follow-up) Fix indentation

Also removes commented out Data::Dumper.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31517: Remove unused get_tag function
Joonas Kylmälä [Fri, 2 Sep 2022 20:09:46 +0000 (23:09 +0300)]
Bug 31517: Remove unused get_tag function

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31517: Replace raw SQL queries in C4::Tags with Koha object accesses
Joonas Kylmälä [Fri, 2 Sep 2022 19:56:12 +0000 (22:56 +0300)]
Bug 31517: Replace raw SQL queries in C4::Tags with Koha object accesses

To test:
 1) Create a few new tags to any biblio by visiting the biblio's detail
 page on OPAC
 2) The visit http://localhost:8080/cgi-bin/koha/opac-tags.pl and try
 deleting those tags.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31654: (follow-up) Update hint
Martin Renvoize [Thu, 3 Nov 2022 14:18:12 +0000 (14:18 +0000)]
Bug 31654: (follow-up) Update hint

This patch updates the 'public' hint to include the additional
functionality we now tie to it.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31654: Hide non-public libraries from MastheadLibraryPulldown (bug_31654_hide_non...
Thomas Klausner [Wed, 5 Oct 2022 10:14:31 +0000 (12:14 +0200)]
Bug 31654: Hide non-public libraries from MastheadLibraryPulldown (bug_31654_hide_nonpublic_libs)

Do not list library in masthead and advanced search if branches.public is false

Test Plan:

* Set OpacAddMastheadLibraryPulldown to "Add"
* Go to Administration -> Libraries, edit "Fairfield", set "public" = "no" (at the end of the form)
* Or connect to DB and run
  update branches set public = 0 where branchcode like 'F%';
  This will set all three libraries starting with F to non-public
* open OPAC
* The "All libraries" Pulldown in the Header (between search slot and search button) still shows the non-public libraries
* Go to OPAC -> Advanced Search, scroll to "Location and availability": The selectbox still shows the non-public libraries

Now apply the patch

* Open OPAC
* The "All libraries" Pulldown in the Header now should not contain the libraries set to "public = no"
* And in the Advanced Search "Location and availability" pulldown those libraries should also not be shown.

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Claude Demeure <claude.demeure@mailo.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31889: Replace append_fields in _embed_items
Marcel de Rooy [Thu, 20 Oct 2022 14:27:25 +0000 (14:27 +0000)]
Bug 31889: Replace append_fields in _embed_items

Test plan:
Run t/db_dependent/Koha/Biblio/Metadata.t again. Should pass.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31889: Add unit test to show problem
Marcel de Rooy [Thu, 20 Oct 2022 14:27:25 +0000 (14:27 +0000)]
Bug 31889: Add unit test to show problem

Test plan:
Run t/db_dependent/Koha/Biblio/Metadata.t
Fails with:
  not ok 10 - 951-952s-953 in 245,100,942,951,953,999,952,952,952,952,952,952,952,952

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31889: Remove exported ghost routine from Biblio module
Marcel de Rooy [Thu, 20 Oct 2022 13:05:00 +0000 (13:05 +0000)]
Bug 31889: Remove exported ghost routine from Biblio module

It has been moved to a Koha object.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29102: Remove ignore_found_holds
Nick Clemens [Thu, 23 Dec 2021 17:16:12 +0000 (17:16 +0000)]
Bug 29102: Remove ignore_found_holds

If not counting patrons holds, found or unfound, we no longer need this option
introduced by bug 28078

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>
18 months agoBug 29102: Do not count patron's own hold against limits
Nick Clemens [Thu, 23 Dec 2021 16:49:34 +0000 (16:49 +0000)]
Bug 29102: Do not count patron's own hold against limits

This patch makes three changes:
1 - The borrower's own holds are not counted towards HighHolds limit
2 - We exclude all hold counts from CanItemBeReserved
3 - Static mode should only decrease hold when over the decreaseLoanHighHoldsValue, not when equal

Previously a patron's hold could put the count over the threshhold, and
if the patron is only allowed 1 hold per record, and the hold wasn't found before
the checkout, it would make all items unholdable, thus lowering the theshhold for
dynamic HighHolds

To test:
 1 - Set sysaprefs:
     decreaseLoanHighHolds  - enable
     decreaseLoanHighHoldsDuration - 1
     decreaseLoanHighHoldsValue - 1
     decreaseLoanHighHoldsControl - "over the number of holdable items on the record" / dynamic
     decreaseLoanHighHoldsIgnoreStatuses - blank
 2 - Set circ rules to allow 1 hold per record and loan period of 5
 3 - Find/create a record with 3 items
 4 - Place a title level hold for two different patrons
 5 - Attempt to checkout item - note warning about high holds
 6 - Cancel checkout
 7 - Set decreaseLoanHighHoldsControl - "on the record" / static
 8 - Attempt checkout - note warning about high holds
 9 - Apply patch
10 - Checkout item - no warning
11 - checkin item, replace hold
12 - Set decreaseLoanHighHoldsControl - "over the number of holdable items on the record" / dynamic
13 - Checkout item - no warning
14 - prove t/db_dependent/DecreaseLoanHighHolds.t

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>
18 months agoBug 32037: Check for existence of object before building link
Nick Clemens [Fri, 28 Oct 2022 14:43:10 +0000 (14:43 +0000)]
Bug 32037: Check for existence of object before building link

This patch adds a check on the existence of the object and passes this to the template

I also drop a level of IF by moving to ELSIF

To test:
 1 - Enable ReturnLog amd IssueLog
 2 - Checkout an item to a patron
 3 - Return it
 4 - View 'Modification log' tab of the borrwer
 5 - Note item links, test them, they work
 6 - Delete the item
 7 - Reload and try links again, they do not work
 8 - Apply patch
 9 - Reload, no more links
10 - Checkout and return another item
11 - This one has links, and they work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31919: Compiled CSS
Tomas Cohen Arazi [Fri, 4 Nov 2022 22:17:39 +0000 (19:17 -0300)]
Bug 31919: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31919: Add backgground color to hovered items in header dropdowns
Owen Leonard [Thu, 27 Oct 2022 11:27:55 +0000 (13:27 +0200)]
Bug 31919: Add backgground color to hovered items in header dropdowns

This alternate patch is different in a few ways:

- Add a hover background color only to items in dropdown menus.
- Use an SCSS variable for the background color
- Update the specificity of the hover CSS to more fully override
  Bootstrap's default.

To test, apply the patch and rebuild the staff interface CSS.

- On any page in the staff interface, test the behavior of links in the
  nav header.
- The always-visible links (Circulation, Patrons, etc) should keep the
  same style as before: Underline on hover.
- In dropdown menus like "More" and the user menu in the upper right
  corner, hovered links should have a green background.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32085: Consistent classes for primary buttons: Labels
Owen Leonard [Wed, 2 Nov 2022 12:43:17 +0000 (12:43 +0000)]
Bug 32085: Consistent classes for primary buttons: Labels

This patch makes changes the button markup in label-creation templates
-- including the barcode image generator -- so that all submit buttons
and any buttons that should should be styled as primary buttons have the
Bootstrap class "btn btn-primary."

To test, apply the patch and view label-related pages to confirm
that everything looks correct. In most cases there are no visible
changes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 27259: Add HomeOrHoldingBranch checks where it was missing from
Joonas Kylmälä [Thu, 17 Dec 2020 15:35:07 +0000 (17:35 +0200)]
Bug 27259: Add HomeOrHoldingBranch checks where it was missing from

The TooMany() function and fine calculation functions were incorrectly
hard coded to use homebranch for fetching the circulation rules. Those
ignored completely the syspref HomeOrHoldingBranch where the user
might have set it to holdingbranch and therefore the fines and whether
patron has too many checkouts (TooMany()) were counted using the
unintended branch's rules. This problem only arises in the cases where
there are branch specific circulation rules defined.

Test plan:
1. Make sure following tests pass:
   $ prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t
   $ prove t/db_dependent/Circulation/TooMany.t

Test plan for fines.pl:
1. Add branch specific fine rules for branches A and B. A having a
   fine of 1 per day and B having a fine of 0 per day.
2. Set sysprefs:
   CircControl = the library the items is from
   finesMode = Calculate and charge
   HomeOrHoldingBranch = holdingbranch
3. Create an item with home and holding branch of A
4. Checkout the item with a due date in the past (the past due date can be
   specified by clicking "Checkout settings" in the checkout page) and
   make sure the branch you are checking from is B.
5. Run perl /usr/share/koha/bin/cronjobs/fines.pl
6. Notice that fines have popped up now to the patron incorrectly
7. Apply patch
8. Pay fines, Check-in the item and check it out again
9. Run perl /usr/share/koha/bin/cronjobs/fines.pl
10. Notice that fine is now 0. This means that the branch
    B (holdingbranch of the checked-out item) specific rule is used.

Test plan for staticfines.pl:
1. Add branch specific fine rules for branches A and B. A having a
   fine of 1 per day and B having a fine of 0 per day.
2. Set sysprefs:
   CircControl = the library the items is from
   finesMode = Calculate and charge
   HomeOrHoldingBranch = holdingbranch
3. Create an item with homebranch A and holding branch of A
4. Checkout the item with a due date in the past (the past due date can be
   specified by clicking "Checkout settings" in the checkout page) and
   make sure the branch you are checking from is B.
5. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE>
   and notice that now there is inccorectly fines
6. Apply patch
7. Pay fines, Check-in the item and check it out again
8. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE>
    and notice the fines are now not generated

Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 27259: Test HomeOrHoldingBranch usage in _CalculateAndUpdateFine()
Joonas Kylmälä [Fri, 18 Dec 2020 15:47:40 +0000 (17:47 +0200)]
Bug 27259: Test HomeOrHoldingBranch usage in _CalculateAndUpdateFine()

This shows that HomeOrHoldingBranch syspref is incorrectly not used by
_CalculateAndUpdateFine() when it decides which circ rule to use.

Run "prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t" to
notice the tests now fail.

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 27259: Test HomeOrHoldingBranch usage in TooMany()
Joonas Kylmälä [Fri, 18 Dec 2020 10:22:46 +0000 (12:22 +0200)]
Bug 27259: Test HomeOrHoldingBranch usage in TooMany()

This shows that HomeOrHoldingBranch syspref is incorrectly not used by
TooMany() when it decides which circ rule to use.

Run "prove t/db_dependent/Circulation/TooMany.t" to notice the tests
now fail.

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31881: Fix search link in MARC view
Fridolin Somers [Thu, 20 Oct 2022 00:18:20 +0000 (14:18 -1000)]
Bug 31881: Fix search link in MARC view

In framework a subfield can be defined with a link (with a search field).
This create an hyperlink in MARC view.
Currently with Elasticsearch the link does not work because search query contains 'field,phr:',
which is useless since the link contains 'idx=field,phr'.
With Zebra looks like the idx param is ignored.

Test plan :
1) Use Elasticsearch search engine
2) Edit subfield 245$a in default framework
3) Enter 'title' in 'Link'
4) Save
5) Create a record with default framework with 245$a = 'The Fifth Elephant'
6) Go to MARC view
7) Click on link in 245$a
8) You find the record

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32066: Check 2FA pref in check_cookie_auth
Jonathan Druart [Thu, 3 Nov 2022 07:47:24 +0000 (07:47 +0000)]
Bug 32066: Check 2FA pref in check_cookie_auth

Test plan:

Without this patch:
1. Set the syspref TwoFactorAuthentication (enforce or enabled)
2. Configure 2FA for a patron
3. Logout
4. Authenticate but don't enter the 2FA code
5. Switch off the syspref (disabled) [via another browser or so]
6. Patron is stuck on the [original] login screen. [Only removing
   the session cookie would resolve it.]

With this patch:
1. Follow the steps above again. But note that you can refresh
   your browser window to get in now.
2. Verify that Auth.t passes now too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32066: Add unit test to Auth.t
Marcel de Rooy [Thu, 3 Nov 2022 08:49:26 +0000 (08:49 +0000)]
Bug 32066: Add unit test to Auth.t

Test plan:
Run without next patch. Should fail.
Run with next patch. Should pass.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=31881

18 months agoBug 21381: (QA follow-up) Add missing filter
Martin Renvoize [Wed, 2 Nov 2022 14:11:25 +0000 (14:11 +0000)]
Bug 21381: (QA follow-up) Add missing filter

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=31881

18 months agoBug 21381: (follow-up) fix typo in columns setting yml
Lucas Gass [Mon, 24 Oct 2022 21:38:51 +0000 (21:38 +0000)]
Bug 21381: (follow-up) fix typo in columns setting yml

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>
https://bugs.koha-community.org/show_bug.cgi?id=31881

18 months agoBug 21381: (follow-up) Fix table configuration for new column
Katrin Fischer [Mon, 17 Oct 2022 22:19:17 +0000 (22:19 +0000)]
Bug 21381: (follow-up) Fix table configuration for new column

The new column was added to the table settings configuration.

To test:
* Make sure the column shows up in the columns menu of the table
  in the staff interface.
* Verify it can be hidden/unhidden correctly using the menu
  or the table setings.

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>
https://bugs.koha-community.org/show_bug.cgi?id=31881

18 months agoBug 21381: Add serial enumeration to circulation/checkout history
Katrin Fischer [Mon, 17 Oct 2022 21:42:24 +0000 (21:42 +0000)]
Bug 21381: Add serial enumeration to circulation/checkout history

* Set readinghistory and intranetreadinghistory to Allow
* Check out some items and return some.
  At least one item should have serial enumeration set to something
* Go to OPAC > patron account > checkout history
* Verify the Vol info shows the same as on the detail page.
* Go to staff interface > patron account > circulation history
* Verify the Vol info shows correctly there as well.
  Bug 21381: Add serial enumeration to circulation/checkout history

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>
https://bugs.koha-community.org/show_bug.cgi?id=31881

18 months agoBug 31987: (QA follow-up) Fix indentation and remove trailing spaces
Katrin Fischer [Wed, 2 Nov 2022 19:16:05 +0000 (19:16 +0000)]
Bug 31987: (QA follow-up) Fix indentation and remove trailing spaces

Fix tabs for 4 spaces in file.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=31881

18 months agoBug 31987: Update plugin unimarc_field_110 fields
Thibaud Guillot [Wed, 26 Oct 2022 12:31:29 +0000 (14:31 +0200)]
Bug 31987: Update plugin unimarc_field_110 fields

According to https://www.ifla.org/wp-content/uploads/U_B_110_update2021_ONLINE_FINAL.pdf

Test plan:

1) Be sure to manage unimarc 110 field in your bibliographic framework
2) Edit a record and click on plugin unimarc_110_field input to see new
select values

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=31881

18 months agoBug 32016: Fix clear filter button behavior
Thibaud Guillot [Thu, 27 Oct 2022 12:15:19 +0000 (14:15 +0200)]
Bug 32016: Fix clear filter button behavior

For example, if you filter by global search input a datatable which saves its previous state when you want to return to this datatable, the backup is recovered in a cookie but the "clear filter" button is disabled because for it the input is empty, the verification of the recovery of the cookie not being made.

When loading I therefore added the verification of the cookie and if the search value is not empty then the button can be activated.

Test plan:

1) Be sure to have some orders and baskets which can be received
2) Go to 'cgi-bin/koha/acqui/booksellers.pl' and click on 'Receive
shipments'
3) Enter something in global search
4) Go to receive and cancel or save to be back on datatable
5) See that you cannot remove your previous input by the 'clear filter'
button
6) Apply this patch
7) Repeat steps 3) and 4)
8) See that now you can remove your search

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=31881

18 months agoBug 30718: Fix curbside pickups
Jonathan Druart [Fri, 4 Nov 2022 11:13:43 +0000 (12:13 +0100)]
Bug 30718: Fix curbside pickups

No slots are displayed without this patch

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31713: Fix permissions
Tomas Cohen Arazi [Thu, 3 Nov 2022 18:42:20 +0000 (15:42 -0300)]
Bug 31713: Fix permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29672: (QA follow-up) Add POD
Kyle Hall [Wed, 2 Nov 2022 11:10:13 +0000 (07:10 -0400)]
Bug 29672: (QA follow-up) Add POD

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29672: Fix test t/db_dependent/Koha/Plugins/Plugins.t
Julian Maurice [Wed, 2 Nov 2022 08:46:45 +0000 (09:46 +0100)]
Bug 29672: Fix test t/db_dependent/Koha/Plugins/Plugins.t

Table plugin_data was not always cleared

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29672: Clear cache of enabled plugins when a plugin's state change
Julian Maurice [Mon, 6 Jun 2022 07:14:59 +0000 (09:14 +0200)]
Bug 29672: Clear cache of enabled plugins when a plugin's state change

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29672: Increase performance of Koha::Plugins->call
Julian Maurice [Thu, 9 Dec 2021 13:49:32 +0000 (14:49 +0100)]
Bug 29672: Increase performance of Koha::Plugins->call

Make use of Koha::Cache::Memory::Lite to avoid hitting the database and
creating plugins object for every call to Koha::Plugins->call

Test plan:
1. Make sure plugins still work by executing
   `prove t/db_dependent/Koha/Plugins/Plugins.t`
2. Run the test script provided in the following patch to see how it
   affects performances

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31713: DBRev 22.06.00.077
Tomas Cohen Arazi [Thu, 3 Nov 2022 13:36:39 +0000 (10:36 -0300)]
Bug 31713: DBRev 22.06.00.077

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31713: (QA follow-up) Make credits positive
Katrin Fischer [Wed, 2 Nov 2022 11:50:42 +0000 (11:50 +0000)]
Bug 31713: (QA follow-up) Make credits positive

* This makes amount and amountoutstanding for credits positive
* Adapts the total line to read credits instead of due when the
  balance is >0

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31713: (follow-up) Display print option for any outstanding
Martin Renvoize [Tue, 1 Nov 2022 14:23:17 +0000 (14:23 +0000)]
Bug 31713: (follow-up) Display print option for any outstanding

Prior to this patch we only allowed printing if the balance was owed to
the library.. This patch exposes the option when the patron is owed too.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31713: (follow-up) Fix terminology
Martin Renvoize [Tue, 1 Nov 2022 14:21:58 +0000 (14:21 +0000)]
Bug 31713: (follow-up) Fix terminology

This patch fixes the terminology as proposed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31713: (QA follow-up) Add current date to slip
Kyle Hall [Fri, 21 Oct 2022 12:20:33 +0000 (08:20 -0400)]
Bug 31713: (QA follow-up) Add current date to slip

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Reverting the KohaDates.now changes. We can simply use [% today %].
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31713: Add FEE_SUMMARY slip template
Martin Renvoize [Mon, 10 Oct 2022 11:02:43 +0000 (12:02 +0100)]
Bug 31713: Add FEE_SUMMARY slip template

This patch adds the new FEE_SUMMARY print slip notice template to the
database.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31713: Add FEE_SUMMARY print slip link
Martin Renvoize [Fri, 7 Oct 2022 15:24:57 +0000 (16:24 +0100)]
Bug 31713: Add FEE_SUMMARY print slip link

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31854: (QA follow-up) Terminology: loans > checkouts
Katrin Fischer [Wed, 2 Nov 2022 19:10:30 +0000 (19:10 +0000)]
Bug 31854: (QA follow-up) Terminology: loans > checkouts

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31854: Document --not_borrowed_since and anonymization
Magnus Enger [Tue, 18 Oct 2022 12:41:23 +0000 (14:41 +0200)]
Bug 31854: Document --not_borrowed_since and anonymization

To test:
- Run "perldoc misc/cronjobs/delete_patrons.pl"
- Note the absence of information about the potential conflict
  between --not_borrowed_since and anonymization
- Apply this patch
- Re-run the perldoc command and make sure the note about
  anonymization make sense

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31873: Check ->find before calling ->safe_delete
Marcel de Rooy [Wed, 19 Oct 2022 13:48:18 +0000 (13:48 +0000)]
Bug 31873: Check ->find before calling ->safe_delete

When there is no item, you cannot safely delete it :)

Resolve this warning:
  Can't call method "safe_delete" on an undefined value at /usr/share/koha/cataloguing/additem.pl line 379
(Line numbers may vary across versions.)

Test plan:
Open item editor.
Add a new item.
Add another tab with same form. Delete new item.
Go back to former tab. Try to delete again.
You should see an alert now on top of the form.

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: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32076: Add page-section to basketgroup.tt and clean-up markup
Lucas Gass [Wed, 2 Nov 2022 18:57:51 +0000 (18:57 +0000)]
Bug 32076: Add page-section to basketgroup.tt and clean-up markup

This patch adds the page-section div to the basket group 'Ungrouped baskets'. It also adds the row class to the fieldset to get the list to display properly.

To test:
1. Apply patch
2. Make sure the page section div for 'Ungrouped baskets' looks good.
3. Look at the markup changes and make sure the make sense.
4. Make sure the form still works as it should.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31995: (QA follow-up) Add 'system preference' to help text
Katrin Fischer [Wed, 2 Nov 2022 17:00:32 +0000 (17:00 +0000)]
Bug 31995: (QA follow-up) Add 'system preference' to help text

We often get asked where something can be found in setting,
adding the hint that RealTimeHoldsQueue is a system preference
is hopefully helpful here.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31995: build_holds_queue.pl should check to see if the RealTimeHoldsQueue syspref...
Kyle Hall [Thu, 27 Oct 2022 17:44:59 +0000 (13:44 -0400)]
Bug 31995: build_holds_queue.pl should check to see if the RealTimeHoldsQueue syspref is on

The real time hold queue and the build_holds_queue.pl jobs are not 100% compatible in that we should not be running the cron if the real time queue is enabled, this could lead to double server work. It would be good to have a check in build_holds_queue for the RealTimeHoldsQueue syspref and not run the job if the preference is enabled.

There might be times when we'd want to force a run of this job without changing the syspref. To that end we would also want a flag for this job so that system administrators could force the job from the command line if required, overriding this limitation.

Test Plan:
1) Apply this patch
2) Try run misc/cronjobs/holds/build_holds_queue.pl with the -h/--help and -m/--man options
3) Disable RealTimeHoldsQueue
4) Run with no options, should succeed
5) Enable RealTimeHoldsQueue
6) Run with no options, should display a message and not rebuild the
   holds queue
7) Run again with the -f/--force option, should succeed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32064: Add test data for all report subpermissions
David Cook [Wed, 2 Nov 2022 00:44:25 +0000 (00:44 +0000)]
Bug 32064: Add test data for all report subpermissions

This patch adds test data to prove that all authorizations
for subpermissions are set when only a top level flag is set.

To test:
0) Apply patch
1) prove ./t/Koha/Auth/Permissions.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32006: Add page-section for local use system preferences
Lucas Gass [Wed, 2 Nov 2022 22:17:33 +0000 (22:17 +0000)]
Bug 32006: Add page-section for local use system preferences

To test:
1. Go to the System preferences > Local use
2. Notice there is no page section and the table has much more space on the left than other system preference sections
3. Apply patch
4. Look again, the extra space on the left should be eliminated and the page-section should be added.
5. Use an HTML validator to spot errors.

Note: I elimiated the inline style on the table that set the width to 80%. I don't see why that is needed but if it is we should be using CSS to do so.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29792: DBRev 22.06.00.076
Tomas Cohen Arazi [Thu, 3 Nov 2022 12:51:36 +0000 (09:51 -0300)]
Bug 29792: DBRev 22.06.00.076

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 29792: Automatically send wrong transfers
Nick Clemens [Fri, 30 Sep 2022 11:01:56 +0000 (11:01 +0000)]
Bug 29792: Automatically send wrong transfers

Bug 24434 reinstated the 'updateWrongTransfer' call here, but made the assertion that
the transfer should not be sent until 'Ok' was clicked.

I see how unsent transfers are useful for rotation, but I believe for wrong transfer we shouldn't require a confirm or print. If a library does want to, the 'transfersblockcirc' system preference will enforce clicking the button
to continue

This patch also confirms a transfer when item already has a transfer and only options are Confirm/Print because the transfer already exists

To test:
1 - Disable TransfersBlockCirc system preference
2 - Manually transfer an item from branch A to branch B
3 - Check in the item at branch A
4 - Dismiss modal without confirming
5 - View item on biblio details page, item not in transit
6 - Check in item, confirm transfer
7 - Note item in transit on details page
8 - Check in the item at branch C
9 - Dismiss modal without confirm
10 - View item on biblio detail, not in transit
11 - Checkin at A, cancel transfer
12 - Apply patch
13 - repeat 1 - 4
14 - Confirm item appears in transit
15 - Check in at branch C, dismiss modal
16 - Confirm item in transit

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31974: Compiled CSS
Tomas Cohen Arazi [Thu, 3 Nov 2022 12:48:14 +0000 (09:48 -0300)]
Bug 31974: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31974: (follow-up) Correct some other specificity issues
Owen Leonard [Thu, 27 Oct 2022 12:11:54 +0000 (12:11 +0000)]
Bug 31974: (follow-up) Correct some other specificity issues

This follow-up makes a couple other minor corrections to label
alignment. This allows for correct top-alignment of labels in forms but
lets labels in other contexts, especially checkbox or radio button
labels, to be aligned "middle."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31974: Regression: Bug 31813 incorrectly affected labels in the header search
Owen Leonard [Tue, 25 Oct 2022 16:09:46 +0000 (16:09 +0000)]
Bug 31974: Regression: Bug 31813 incorrectly affected labels in the header search

This patch adds a specific white-space property to header search labels
so that they do not wrap. The change made by Bug 31813 overrode the
white-space property incorrectly.

To test, apply the patch and rebuild the staff interface CSS.

- Go to Administration.
- The header search label "Search system preferences" should appear on
  one line.
- Check that labels still wrap correctly on pages like the patron edit
  screen and the staged MARC record detail view.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31422: (QA follow-up) Fix terminology and switch icon
Katrin Fischer [Wed, 2 Nov 2022 22:50:58 +0000 (22:50 +0000)]
Bug 31422: (QA follow-up) Fix terminology and switch icon

* fa-exclamation-circle looks more like 'info', but I feel this
  should be more of a warning, so switched to fa-exclamation-triangle
* Changed branches to libraries in message

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31422: Add patron's current category to dropdown while editing
Nick Clemens [Thu, 20 Oct 2022 14:53:33 +0000 (14:53 +0000)]
Bug 31422: Add patron's current category to dropdown while editing

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31943: Compiled CSS
Tomas Cohen Arazi [Thu, 3 Nov 2022 12:05:00 +0000 (09:05 -0300)]
Bug 31943: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31943: Date inputs wider than other inputs
Owen Leonard [Thu, 27 Oct 2022 16:25:05 +0000 (16:25 +0000)]
Bug 31943: Date inputs wider than other inputs

This patch sets a width on Flatpickr instances so that they better match
the typical width of a text input field.

The patch also corrects the "X" ("clear date") link color to return it
to the original red color. In doing this I've defined a new
$warning-text-color variable and replaced other instances of #CC0000
with this variable.

I've also tweaked the appearance of the Flatpickr shortcut links
("Today," "Tomorrow," etc) so that they match other links in Koha.

To test, apply the patch and rebuild the staff interface CSS.

- Go to patrons and locate a patron record.
- Edit the patron.
- In the patron entry form, confirm that the "Date of birth" field
  matches the width of the text fields around it.
- The "X" should be red.
- Click the date of birth field to trigger the calendar popup.
- The "Yesterday" and "Today" links should be colored the default green
  seen elsewhere in the staff interface.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31963: Only show hold fee msg on OPAC if patron will be charged
Aleisha Amohia [Mon, 24 Oct 2022 23:08:52 +0000 (23:08 +0000)]
Bug 31963: Only show hold fee msg on OPAC if patron will be charged

This patch ensures HoldFeeMode is considered when displaying a message
to patrons on the OPAC that says they'll be charged a hold fee when
placing or collecting the hold.

When HoldFeeMode is set to not_always or "only if all items are checked
out and the record has at least one hold already" then the hold fee
message should only show if all items on the record are checked out, AND
the record has at least one hold already - both of these conditions must
be met.

To test:
1. Go to Administration -> Patron categories
2. Edit your patron category and give a hold fee of $1.
3. Go to Administration -> System preferences and search for
HoldFeeMode. Set to 'only if all items are checked out and the record
has at least one hold already' if not already set. Keep this tab open.
4. In another tab, open the OPAC.
5. Search the OPAC for a record with one item which is NOT checked out.
6. Go to place a hold on this record. Confirm you see a message saying
that you will be charged a hold fee, even though not all items are
checked out and the record does not have a hold --> This is the bug.

7. Apply patch and restart services.

Items available, no holds placed

8. Repeat steps 5-6. This time, you should NOT see the hold fee message.

Items available, holds placed

9. In your staff interface tab, find the same record.
10. Place a hold for a different patron on this record.
11. In your OPAC tab, find this record again and go to place a hold. You
should NOT see the hold fee message.

No items available, no holds placed

12. In your staff interface tab, cancel the hold placed on this record.
13. Check out the item to a different patron.
14. In your OPAC tab, find this record again and go to place a hold. You
should NOT see the hold fee message.

No items available, holds placed

15. In your staff interface tab, keep the item checked out to another
patron.
16. Place a hold for a third patron on this record.
17. In your OPAC tab, find this record again and go to place a hold. You
SHOULD see the hold fee message.

Multiple holds

18. Search the OPAC for a record. Make sure your search will return more
than one result, including our test record.
19. Check the checkbox for our test record, plus another record where
the item is not checked out.
20. Click the Place hold button to place holds on all of our selected
records. You should only see the hold fee message above our test record.

21. In your staff interface tab, test setting HoldFeeMode to the other
values and confirm the hold message shows on the OPAC as expected.
22. Confirm tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32002: Make submit button yellow on administration > Did you mean?
Owen Leonard [Fri, 28 Oct 2022 18:40:49 +0000 (18:40 +0000)]
Bug 32002: Make submit button yellow on administration > Did you mean?

This patch corrects the class on the "Did you mean?" page's save button
so that it is consistent with other primary submit buttons.

To test, apply the patch and go to Administration -> Did you mean?

The "Save configuration" button should be yellow.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31960: (follow-up) Make headings match
Owen Leonard [Tue, 1 Nov 2022 12:13:49 +0000 (12:13 +0000)]
Bug 31960: (follow-up) Make headings match

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31960: Information on job detail view is misaligned
Owen Leonard [Tue, 25 Oct 2022 11:46:12 +0000 (11:46 +0000)]
Bug 31960: Information on job detail view is misaligned

This patch updates the structure of the background jobs template so that
HTML processed in the report includes is well styled. The patch does
this by breaking the report and detail includes out of the fieldset and
putting them in a separate section.

This patch also adds the page-section class to the table view of current
and past background jobs.

Note: The patch includes indentation changes, so please ignore
whitespace when viewing the diff.

To test, apply the patch and go to Administration -> Manage jobs.

- The table of jobs (even if empty) should be contained in a
  page-section style white box.
- Test various processes which trigger a backgroud job:
  - Batch item modification
  - Batch item deletion
  - Batch hold deletion
  - Batch record modification
  ... etc.
- After each process has been started, view the details of the job.
- The information about the job shold be displayed well, with separate
  sections for "Report" and "Detailed messages."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32070: Consistent classes for primary buttons: Acquisitions
Owen Leonard [Wed, 2 Nov 2022 11:43:32 +0000 (11:43 +0000)]
Bug 32070: Consistent classes for primary buttons: Acquisitions

This patch makes changes the button markup in Acquisitions templates
so that all submit buttons and any buttons that should should be styled
as primary buttons have the Bootstrap class "btn btn-primary."

To test, apply the patch and view pages in Acquisitions to confirm
that everything looks correct. In most cases there are no visible
changes.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32068: Consistent classes for primary buttons: Administration
Owen Leonard [Tue, 1 Nov 2022 18:58:30 +0000 (18:58 +0000)]
Bug 32068: Consistent classes for primary buttons: Administration

This patch makes changes the button markup in Administration templates
so that all submit buttons and any buttons that should should be styled
as primary buttons have the Bootstrap class "btn btn-primary."

To test, apply the patch and view pages in Administration to confirm
that everything looks correct. In most cases there are no visible
changes.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32044: Compiled CSS
Tomas Cohen Arazi [Wed, 2 Nov 2022 22:27:13 +0000 (19:27 -0300)]
Bug 32044: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32044: Improve consistency in primary submit buttons
Owen Leonard [Mon, 31 Oct 2022 18:19:03 +0000 (18:19 +0000)]
Bug 32044: Improve consistency in primary submit buttons

We currently have a mix of ways to style buttons, including some using
Bootstrap's btn-primary class and some with CSS targeting
input[type='submit']. This patch works to make these buttons more
consistent in their appearance and to improve the modularity of related
SCSS.

The patch also removes some unused CSS from login.css.

To test, apply the patch and rebuild the staff interface CSS.

Test various page to see if main submit buttons look correct in their
default, hover, and active states:

- The login page
- Circulation -> Checkouts -> Check out button (btn-primary)
- Circulation -> Set library (input[type='submit'])
- Cataloging -> Basic MARC editor (split button)

Also check "default" buttons:

- Patrons -> Sidebar filter (input[type='button'])
- Circulation -> Checkouts -> Show checkouts (btn-default)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31877: Fix capitalization: "Delete this Tag" and "Repeat this Tag"
Katrin Fischer [Mon, 24 Oct 2022 20:44:21 +0000 (22:44 +0200)]
Bug 31877: Fix capitalization: "Delete this Tag" and "Repeat this Tag"

To get to the string in the staff interface:
1. In the staff interface, go to Cataloging
2. Click "New record"
3. Hover the mouse cursor over one of the delete tag buttons (rectangle with a small x next to the tag title)
   --> a little popup thing (tooltip?) appears with "Delete this Tag"
4. Open the developper tools inspector in your browser
5. Click on the delete tag button
   --> the image alt text is "Delete this Tag"
6. Repeat the same check in the authorities editor
7. Apply patch
8. All tooltips and alt text should read correctly now

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31876: Fix capitalization "Click to Expand Tag"
Katrin Fischer [Mon, 24 Oct 2022 20:32:27 +0000 (20:32 +0000)]
Bug 31876: Fix capitalization "Click to Expand Tag"

The string "Click to Expand this Tag" appears in addbiblio.tt a couple of times. It should be "Click to expand this tag".

To get to the string for the staff interface:
1. In the staff interface, go to Cataloging
2. Click "New record"
3. Hover the mouse cursor over one of the tag titles (e.g. CONTROL NUMBER)
   --> a little popup thing (tooltip?) appears with "Click to Expand this Tag"
4. Go to Administration > Global system preferences
5. Search for advancedMARCeditor
6. Change the value to "Don't show"
7. Click "Save all Cataloging preferences"
8. Go back to Cataloging > New record
9. Hover the mouse cursor over the tag number (e.g. 001)
   --> a little popup thing (tooltip?) appears with "<tag title> Click to Expand this Tag"
10. Go to Authorities > new record
11. Hover over the desription of a tag which subfields are collapsed
   --> verify the tooltip appears with "Click to Expand this Tag"
12. Apply patch, all occurrences should be fixed now.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32050: Add 'page-section' to calendar page
Owen Leonard [Fri, 14 Oct 2022 11:00:07 +0000 (11:00 +0000)]
Bug 32050: Add 'page-section' to calendar page

This patch adds a "page-section" div to a couple of areas on the
calendar page.

To test, apply the patch and go to Tools -> Calendar.

The content in the page's two columns should be wrapped in a white box.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32014: Compiled CSS
Tomas Cohen Arazi [Wed, 2 Nov 2022 22:21:55 +0000 (19:21 -0300)]
Bug 32014: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32014: Tweak style of checkout settings panel
Owen Leonard [Thu, 27 Oct 2022 11:36:01 +0000 (11:36 +0000)]
Bug 32014: Tweak style of checkout settings panel

This patch makes some minor changes to the CSS controlling the way the
checkout settings panel displays, as well as the panel showing the last
checked-out item.

To test, apply the patch and rebuild the staff interface CSS.

- Go to Circulation and locate a patron to check out to.
- On the checkout page, click the "settings" icon in the barcode field.
- The checkout settings panel should display. Confirm that the spacing
  looks good.
- Check out an item to the patron.
- Confirm that the panel showing the last checked out item information
  looks correct: A green-bordered box with a white background, no
  rounded corners.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32038: Sidebar and footer style improvements on suggestions page
Owen Leonard [Fri, 28 Oct 2022 17:24:08 +0000 (17:24 +0000)]
Bug 32038: Sidebar and footer style improvements on suggestions page

This patch makes some changes to the suggestions template in order to
make the sidebar filter form and bulk action table footer forms more
usable and readable.

Some global changes to <fieldset class="brief"> style are made.

To test, apply the patch and rebuild the staff interface CSS.

- Go to Suggestions.
- Confirm that the sidebar contains two sections: Organize by and Filter
  by.
- Test that the links under "Filter by" work to expand and collapse the
  different sections (bibliographic, suggestion, and acquisition).
- Below the table of existing suggestions you should see the section
  "Change selected suggestions."
- Each form should look good, with labels in bold above each form field,
  with "primary" style submit buttons.
- Because some global styles have been modified, check that fieldsets
  with the class "brief" are still displayed correctly in other areas:
  - In sidebar forms: Patrons, Acquisitions order and invoice searches,
    overdues and holds to pull in Circulation.
  - In other areas: The Quick spine label creator; the upload plugin
    form; the calendar's add holiday form.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31664: Display pending transfer information on details page
Nick Clemens [Fri, 30 Sep 2022 12:01:36 +0000 (12:01 +0000)]
Bug 31664: Display pending transfer information on details page

If a transfer is requested, but not sent, we should display this information on biblio details for staff

This patch also removes nocancel parameter that was not used, passes transfer object directly to template

To test
1 - Manually transfer an item
2 - Note the item shows in transit on details page
3 - Remove the datesent to emulate a pending transfer
    UPDATE branchtransfers SET datesent = NULL itemnumber=1;
4 - View details page - no info on transfer
5 - Apply patch
6 - Item shows 'Transit pending'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32035: Add "Koha" to the staff interface home page
David Nind [Sat, 29 Oct 2022 23:30:03 +0000 (23:30 +0000)]
Bug 32035: Add "Koha" to the staff interface home page

Currently the staff interface does not include Koha before the version
number shown on the home page.

Test plan:
1. Log in and view the staff interface home page.
2. In the bottom right-hand corner "Version 22.06.00" is shown.
3. Apply the patch.
4. Refresh the staff interface home page.
5. It now shows "Koha 22.06.00" (linked to the Koha website).
6. Sign off :D (or comment on alternative options).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Claude Demeure <claude.demeure@mailo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32012: runreport.pl should use binmode UTF-8
Fridolin Somers [Thu, 27 Oct 2022 09:15:35 +0000 (23:15 -1000)]
Bug 32012: runreport.pl should use binmode UTF-8

Like Bug 26832 added binmode UTF-8 to script misc/search_tools/export_elasticsearch_mappings.pl, this should be added to misc/cronjobs/runreport.pl.

Test plan :
1) Do not apply patch
2) Create a SQL report with :
   SELECT 'accentué',barcode FROM items limit 3
3) Note the id of this report, for example 1
4) Run : misc/cronjobs/runreport.pl 1 --format csv | tee /tmp/without.csv
=> You see output with unknown character instead of é :
5) Run : file --mime-type /tmp/without.csv
=> You see : /tmp/without.csv: iso-8859-1
6) Apply patch
7) Run : misc/cronjobs/runreport.pl 1 --format csv | tee /tmp/with.csv
=> You see correct output with é
8) Run : file --mime-type /tmp/without.csv
=> You see : /tmp/without.csv: utf-8

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>
18 months agoBug 32022: Compiled CSS
Tomas Cohen Arazi [Fri, 28 Oct 2022 19:43:15 +0000 (16:43 -0300)]
Bug 32022: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32022: (follow-up) Ensure action background takes presidence
Martin Renvoize [Fri, 28 Oct 2022 07:53:08 +0000 (08:53 +0100)]
Bug 32022: (follow-up) Ensure action background takes presidence

The action class sets the background to transparent, but because it's
often used in conjunction with the fieldset which includes the card
mixin the background rule was getting overridden to white.

Test plan
1. Consider the same cases as the original patch
2. Confirm that the last test now shows the buttons outside of the card
   but nicely spaced to clearly belong to it.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32022: Style tweaks to fieldsets and page-section
Owen Leonard [Thu, 27 Oct 2022 15:28:11 +0000 (15:28 +0000)]
Bug 32022: Style tweaks to fieldsets and page-section

This patch makes CSS changes to try to bring some consistency to
various elements which are similar in the general sense of "white box."
Fieldsets, page-section, etc.

To test apply the patch and rebuild the staff interface CSS.

Test various pages with page-section, fieldsets, etc.:

- Patron details
- Patron edit
- Patron accounting
- Check Tools -> Patron lists -> New to confirm that there is not a gap
  between the submit button's container and the rest of the form.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31948: DBRev 22.06.00.075
Tomas Cohen Arazi [Fri, 28 Oct 2022 19:36:21 +0000 (16:36 -0300)]
Bug 31948: DBRev 22.06.00.075

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31948: Add timestamp to tmp_holdsqueue table
Katrin Fischer [Fri, 28 Oct 2022 13:56:10 +0000 (13:56 +0000)]
Bug 31948: Add timestamp to tmp_holdsqueue table

With the option to have real time updates to tmp_holdsqueue
a timestamp will be really helpful to help find the most recently
added entries.

To test:
* Place some holds on a record with available items
* Run build_holds-queue.pl
* Verify the hold shows up under circulation > holds queue
* Apply patch
* Run build_holds_queue.pl again
* Verify this works without any issues
* Turn on RealTimeHoldsQueue
* Update pick-up location, add another hold
* Make sure these changes are reflected in the holds queue as well
* Look at the database and verify timestamps are set

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31986: Add page-section to various administration pages
Owen Leonard [Tue, 25 Oct 2022 19:13:06 +0000 (19:13 +0000)]
Bug 31986: Add page-section to various administration pages

This patch adds a page-section div to some administration pages in order
to provide a consistent structure visual contrast. The following pages
are modified:

Additional fields
Funds
Authority types
Authority types -> MARC tag structure
Authority types -> MARC tag structure -> Subfields
MARC bibliographic framework
MARC bibliographic framework -> MARC tag structure
MARC bibliographic framework -> MARC tag structure -> Subfields
MARC Bibliographic framework test
Classification configuration
Currencies and exchange rates
EDI accounts
Library EANs
Item search fields
Koha to MARC mapping
Record overlay rules
Record matching rules
OAI sets configuration
SMTP servers
Z39.50/SRU servers

To test, view each page to confirm that the page-section div visibly
delineates the main content area.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31760: Compiled CSS
Tomas Cohen Arazi [Fri, 28 Oct 2022 19:40:21 +0000 (16:40 -0300)]
Bug 31760: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31760: Fix contrast of 'separator'
Martin Renvoize [Thu, 13 Oct 2022 10:49:02 +0000 (11:49 +0100)]
Bug 31760: Fix contrast of 'separator'

This patch increases the contrast of the separator pipe visible in the
staff client upper right corner of the header bar.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31992: Fix t::lib::Mocks::Zebra
Jonathan Druart [Wed, 26 Oct 2022 15:34:10 +0000 (17:34 +0200)]
Bug 31992: Fix t::lib::Mocks::Zebra

This will fix t/db_dependent/www/batch.t and t/db_dependent/www/search_utf8.t

QA - improvement ideas welcome! It's definitely not the best we can do.

Test plan:
  prove t/db_dependent/www/search_utf8.t t/db_dependent/www/batch.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 23012: (follow-up) Fix t/db_dependent/Koha/Items.t
Aleisha Amohia [Thu, 27 Oct 2022 01:13:08 +0000 (01:13 +0000)]
Bug 23012: (follow-up) Fix t/db_dependent/Koha/Items.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 23012: Fix t/db_dependent/Koha/Item.t
Tomas Cohen Arazi [Tue, 25 Oct 2022 17:56:23 +0000 (14:56 -0300)]
Bug 23012: Fix t/db_dependent/Koha/Item.t

With the follow-up changes, the return value is no longer a scalar, but
a hashref, but the tests weren't updated accordingly.

This patch fixes this situation.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item.t
=> FAIL: Tests fail
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 30036: Fix db_rev permissions
Tomas Cohen Arazi [Thu, 27 Oct 2022 21:19:27 +0000 (18:19 -0300)]
Bug 30036: Fix db_rev permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 32011: 2FA - Prevent qr_code to not be generated
Jonathan Druart [Thu, 27 Oct 2022 08:53:06 +0000 (10:53 +0200)]
Bug 32011: 2FA - Prevent qr_code to not be generated

Caught by selenium/authentication_2fa.t

 #   Failed test 'Enforce 2FA setup on first login'
 #   at t/db_dependent/selenium/authentication_2fa.t line 291.Error while executing command: unexpected alert open: Dismissed user prompt dialog: [object Object] at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.
 at /usr/share/perl5/Selenium/Remote/Driver.pm line 356.

There is a 500 in the logs:
 "POST /api/v1/app.pl/api/v1/auth/two-factor/registration HTTP/1.1" 500

That is caused by
[ERROR] POST /api/v1/auth/two-factor/registration: unhandled exception (Mojo::Exception)<<Overflow error. version 8
total bits: 1268  max bits: 1232>>

It's coming from GD::Barcode, in my understanding we should increase 'Version'.

Test plan:
Remove all other subtests from the selenium to speed up its exec, then
run it in a loop. Without this patch the tests fail quite often (1/10),
now it should not fail with this error (maybe another one, see bug
32010)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31993: Improve specificity of authorized values breadcrumbs
Owen Leonard [Wed, 26 Oct 2022 15:11:08 +0000 (15:11 +0000)]
Bug 31993: Improve specificity of authorized values breadcrumbs

This patch adds a link back to the current authorized value category to
the breadcrumbs. The page title has also been modified to match.

To test apply the patch and go to Administration -> Authorized values.

- Click an authorized value category, e.g. CCODE.
- Click "New authorized value for CCODE"
- In the breadcrumbs menu you should see: "Home ->  Administration ->
  Authorized values -> Authorized values for category CCODE -> New
  authorized value.
- The "Authorized values for category CCODE" link should take you back
  to the correct view.
- The page title should match.
- Return to the list of CCODE authorized values and open one for
  editing.
- The breadcrumbs should include a link back to "Authorized values for
  category CCODE"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 27017: (QA follow-up) Don't die if aqorders.biblionumber is null
Kyle Hall [Thu, 27 Oct 2022 18:03:05 +0000 (14:03 -0400)]
Bug 27017: (QA follow-up) Don't die if aqorders.biblionumber is null

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 27017: Code more defensively in process_invoice
Colin Campbell [Fri, 13 Nov 2020 13:46:13 +0000 (13:46 +0000)]
Bug 27017: Code more defensively in process_invoice

This patch adds a check for ordernumber precence in the EDI Invoice
message lines and skips process if one is not found.

We log the failure as a trace log to allow administrators the oportunity
to track down the issue further.

We also add a trace log to entries to show which bib the invoice line
is receipting to.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31969: (follow-up) Unit tests for Koha::BackgroundJobs->purge
Björn Nylén [Thu, 27 Oct 2022 08:47:56 +0000 (10:47 +0200)]
Bug 31969: (follow-up) Unit tests for Koha::BackgroundJobs->purge

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31969: (follow-up) Move deletion code to Koha::BackgroundJobs->purge for reuse.
Björn Nylén [Wed, 26 Oct 2022 12:45:23 +0000 (14:45 +0200)]
Bug 31969: (follow-up) Move deletion code to Koha::BackgroundJobs->purge for reuse.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 31969: Add background queue options to cleanup_database
Björn Nylén [Mon, 24 Oct 2022 13:12:03 +0000 (15:12 +0200)]
Bug 31969: Add background queue options to cleanup_database

This patch adds background queue options to cleanup_database.pl to allow
for purging completed background jobs.

--bg-jobs DAYS Purge all finished background jobs this many days old. Defaults to 1 if no DAYS provided.
--bg-type TYPE What type of background job to purge. Defaults to "update_elastic_index" if omitted
               Specifying "all" will purge all types. Repeatable.

To test:
 1 - Enable elastic search in Koha
 2 - perl misc/maintenance/touch_all_items.pl
 3 - Generate an number of diffrent types of bg-jobs (eg batch_hold_cancel,
     batch_biblio_record_deletion, batch_item_record_deletion)
 4 - Check db and note there are a bunch of diffrent jobs
 5 - Update to make them old
     UPDATE background_jobs SET ended_on = '2022-10-01 00:00:00', status='finished'
 6 - perl misc/cronjobs/cleanup_database.pl
 7 - Note bg-jobs entry shows in help
 8 - perl misc/cronjobs/cleanup_database.pl --bg-jobs 1 -v
 9 - Note that elasticqueue would have been cleared
10 - perl misc/cronjobs/cleanup_database.pl --bg-jobs 1 -v --confirm
11 - Note that number of entries deleted is reported
12 - Attempt to clear other job types, including "all" eg
     perl misc/cronjobs/cleanup_database.pl --bg-jobs 1 --bg-type batch_item_record_deletion  -v --confirm
     perl misc/cronjobs/cleanup_database.pl --bg-jobs 1 --bg-type all  -v --confirm
13 - Confirm in staff interface that jobs are gone:
     http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
     (Uncheck 'Current jobs only')

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 30407: Fix sysprefs.sql syntax
Tomas Cohen Arazi [Thu, 27 Oct 2022 17:40:09 +0000 (14:40 -0300)]
Bug 30407: Fix sysprefs.sql syntax

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 30407: DBRev 22.06.00.074
Tomas Cohen Arazi [Thu, 27 Oct 2022 16:37:23 +0000 (13:37 -0300)]
Bug 30407: DBRev 22.06.00.074

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