koha.git
9 months agoBug 34415: Remove T::D::C from EdiTransport.t, move to t/db
Marcel de Rooy [Wed, 26 Jul 2023 07:29:06 +0000 (07:29 +0000)]
Bug 34415: Remove T::D::C from EdiTransport.t, move to t/db

Moving file now here.

Test plan:
Run t/db_dependent/Koha/Edifact/Transport.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: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34812: Move subtests to db_dependent/Koha.t
Marcel de Rooy [Mon, 18 Sep 2023 09:05:13 +0000 (09:05 +0000)]
Bug 34812: Move subtests to db_dependent/Koha.t

Note that a few isbn tests were identical.
Tidied the three moved subtests here.

Test plan:
Run t/db_dependent/Koha.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34812: Remove Test::DBIx from Koha.t
Marcel de Rooy [Sun, 17 Sep 2023 14:56:46 +0000 (14:56 +0000)]
Bug 34812: Remove Test::DBIx from Koha.t

The DBIx fixture here is replaced by a simple mock on Libraries.
getFacets only needs the count of libraries.
Feels better than removing all libraries here..

Note: Moved tests at 'root level' to a new subtest.

Test plan:
Run t/Koha.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34781: Add a span tag in opac-memberentry
Marcel de Rooy [Wed, 13 Sep 2023 11:29:17 +0000 (11:29 +0000)]
Bug 34781: Add a span tag in opac-memberentry

Test plan:
Enable self registration and GDPR consent (privacy policy).
Look at selfreg page on OPAC. Scroll to bottom.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33876: Add class for styling
Lucas Gass [Wed, 31 May 2023 22:38:50 +0000 (22:38 +0000)]
Bug 33876: Add class for styling

To test:
1. Checkout and item that has a public and nonpublic note.
2. In the checkout table ( Title column ) notice the notes display. If you use the browser dev tools to inspect you'll notice a "-" outside of any HTML element.
3. Apply patch.
4. See the '-' is now inside of a html element with class of seperator.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34552: Don't exclude payments with no status
Nick Clemens [Fri, 25 Aug 2023 15:51:12 +0000 (15:51 +0000)]
Bug 34552: Don't exclude payments with no status

Bug 29664 removed payments with a void status, however, the query also
removed any payments with no status set

Test Plan:
1 - Set up your cash registers and enable POS and add a debit type that is able to be sold
2 - Take 2 payments via POS
3 - Void one payment
4 - Go to Reports->Statistics wizards->Cash register
4) Verify neither shows for the "All payments to the library" and
   "Payment" transaction type filters
5) Apply this patch
6) Restart all the things!
7) Verify the non-voided fee shows for the "All payments to the library" and
   "Payment" transaction type filters and the voided fee does not

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34711: Remove use of onclick for opac-privacy.pl
David Cook [Tue, 5 Sep 2023 04:58:52 +0000 (04:58 +0000)]
Bug 34711: Remove use of onclick for opac-privacy.pl

This change removes the "onclick" attribute for the buttons
on opac-privacy.pl.

Note: The Javascript is placed in a separate file, which is
the preferred way for Javascript to be handled by
Content-Security-Policy

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACPrivacy
2. Set syspref to "Allow"
3. Go to http://localhost:8080/cgi-bin/koha/opac-privacy.pl
4. The confirmation modal appears and "OK" and "Cancel" buttons work as
   expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34724: (QA follow-up):
Pedro Amorim [Fri, 8 Sep 2023 16:01:03 +0000 (16:01 +0000)]
Bug 34724: (QA follow-up):

Replace href from thumbnail link with a # to keep pointer event. The href link gets reconstructed by showCover anyway
Remove return false from on click event, its not triggering a location change anymore because of the above
Remove check for imagenumber, its a non-null primary key, if the image exists, then the imagenumber must also exist

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34724: Remove inline onclick handler for opac-imageviewer.pl
David Cook [Wed, 6 Sep 2023 06:40:21 +0000 (06:40 +0000)]
Bug 34724: Remove inline onclick handler for opac-imageviewer.pl

This patch moves the click handler for thumbnails for opac-imageviewer.pl
out of the inline HTML and out to an existing <script> element.

Test plan:
0. Apply the patch (including dependent patches)
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=localcover
2. Change both *LocalCoverImages sysprefs to "Show"
3. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=AllowMultipleCovers
4. Change "AllowMultipleCovers" to "Allow"
5. Go to
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
6. Click "Images (0)" tab
7. Download or make two JPEG images
8. Upload the images
9. Go to http://localhost:8080/cgi-bin/koha/opac-imageviewer.pl?biblionumber=29
10. See one large image in the centre and two smaller thumbnails on the right side
11. Click on the thumbnail of the image that isn't displayed in the centre
12. Note that the image changes
13. Click the other thumbnail and note that the image changes back

PA amended patch: Added missing test plan step

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34725: Remove use of onclick for OPAC cart
David Cook [Wed, 6 Sep 2023 06:57:15 +0000 (06:57 +0000)]
Bug 34725: Remove use of onclick for OPAC cart

This patch moves the click handler in the OPAC cart from the inline HTML
and out to an existing <script> element.

Test plan:
0. Apply the patch
1. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
2. Add the results to the cart
3. Click on the "Cart"
4. One by one click on the title of each row
5. Notice how the parent window changes to the detail record for that title

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34400: Inconsistencies in OAI sets page titles, breadcrumbs, and header
Owen Leonard [Fri, 25 Aug 2023 16:35:18 +0000 (16:35 +0000)]
Bug 34400: Inconsistencies in OAI sets page titles, breadcrumbs, and header

This patch fixes a couple of inconsistencies in the style of the
OIA sets administration screen, making sure the page title, breadcrumb
navigation, and page headers are consistent with each other.

The patch also corrects the structure of the form on the OAI set
mappings page so that the submit button is outside the "page-section"
area.

To test, apply the patch and go to Administration -> OAI sets. Test each
variation of the page:

- Main page
- New OAI set
- Edit OAI set
- OAI set mappings

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34789: DBRev 23.06.00.019
Tomas Cohen Arazi [Mon, 18 Sep 2023 14:56:35 +0000 (11:56 -0300)]
Bug 34789: DBRev 23.06.00.019

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34789: (QA follow-up) Improve output of database update
Katrin Fischer [Sun, 17 Sep 2023 13:18:49 +0000 (13:18 +0000)]
Bug 34789: (QA follow-up) Improve output of database update

* Adds description
* Adds column names to success messages

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34789: Update unit tests
Matt Blenkinsop [Thu, 14 Sep 2023 12:27:20 +0000 (12:27 +0000)]
Bug 34789: Update unit tests

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>
9 months agoBug 34789: Update usage throughout Koha modules and Vue components
Matt Blenkinsop [Thu, 14 Sep 2023 12:26:53 +0000 (12:26 +0000)]
Bug 34789: Update usage throughout Koha modules and Vue components

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>
9 months agoBug 34789: DBIC file
Matt Blenkinsop [Thu, 14 Sep 2023 12:25:21 +0000 (12:25 +0000)]
Bug 34789: DBIC file

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>
9 months agoBug 34789: Database and API update
Matt Blenkinsop [Thu, 14 Sep 2023 12:23:49 +0000 (12:23 +0000)]
Bug 34789: Database and API update

Currently the erm_eholdings_titles table has a field called preceeding_publication_title_id. This should be preceding_publication_title_id

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>
9 months agoBug 34735: Remove uneeded CSS
Pedro Amorim [Thu, 7 Sep 2023 09:55:28 +0000 (09:55 +0000)]
Bug 34735: Remove uneeded CSS

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34735: Update breadcrumb markup
Pedro Amorim [Thu, 7 Sep 2023 09:53:43 +0000 (09:53 +0000)]
Bug 34735: Update breadcrumb markup

Make the breadcrumb navigation item markup match the rest of Koha

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34735: Remove pointer events from disabled links
Pedro Amorim [Thu, 7 Sep 2023 09:52:06 +0000 (09:52 +0000)]
Bug 34735: Remove pointer events from disabled links

Add pointer-events: none to a.disabled links in staff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34735: Style disabled breadcrumbs
Lucas Gass [Thu, 7 Sep 2023 01:52:47 +0000 (01:52 +0000)]
Bug 34735: Style disabled breadcrumbs

To test:
1. Turn on ERMModule.
2. Notice the disbaled breadcrumbs are color: #000;
3. Apply patch, yarn build
4. Look again, disbaled breadcrumbs are color; #696969;

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34411: Inconsistencies in Additional fields page titles, breadcrumbs, and header
Owen Leonard [Wed, 6 Sep 2023 10:38:41 +0000 (10:38 +0000)]
Bug 34411: Inconsistencies in Additional fields page titles, breadcrumbs, and header

This patch makes changes to the additional fields administration
template in order to make it more consistent with other pages in Koha.

To test, apply the patch and go to Administration -> Additional fields.
View each variation of the page to confirm that breadcrumb navigation,
page title, and page headings are consistent with each other.

- Main list
  - Table view (e.g. aqbasket, aqorders, etc)
    - New field
    - Edit field

Signed-off-by: Salah Ghedda <salah.ghedda@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34409: Fix inconsistencies in Audio alerts headers
Owen Leonard [Thu, 7 Sep 2023 15:41:58 +0000 (15:41 +0000)]
Bug 34409: Fix inconsistencies in Audio alerts headers

This patch makes a minor change to the structure of the audio alerts
administration template so that the add/edit form is more consistent
with other similar forms.

The patch doesn't make any changes to page title and breadcrumbs because
the add/edit action doesn't trigger a page reload, so the required
change can't be made just with markup.

To test, apply the patch and enable the AudioAlerts system preference
if necessary.

- Go to Administration -> Audio alerts.
- Click "New alert" and confirm that the form looks correct.
- Edit an existing alert to confirm that this view also looks correct.

Signed-off-by: Salah Ghedda <salah.ghedda@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34407: Inconsistencies in Z39.50 servers page titles, breadcrumbs, and header
Owen Leonard [Thu, 7 Sep 2023 16:46:05 +0000 (16:46 +0000)]
Bug 34407: Inconsistencies in Z39.50 servers page titles, breadcrumbs, and header

This patch makes changes to the Z39.50 servers administration and
related templates in order to make them more consistent with other pages
in Koha.

One case has been added to page title and breadcrumb navigation: An
indication that a search has been performed. The subheading is modified
to make it clear that the search is a "starts with" search.

To test, apply the patch and go to Administration -> Z39.50/SRU
servers. View each variation of the page to confirm that breadcrumb
navigation, page title, and page headings are consistent with each
other.

- Z39.50/SRU servers list.
  - New Z39.50 server
  - New SRU server
  - Edit Z39.50 server
  - Edit SRU server
    - Modify SRU search field mapping for a bibliographic record
      server
    - Modify SRU search field mapping for an authority record server
  - Use the header search form to search for a server by name

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34380: Fix inconsistencies in Item types page titles, breadcrumbs, and header
Owen Leonard [Tue, 5 Sep 2023 17:06:51 +0000 (17:06 +0000)]
Bug 34380: Fix inconsistencies in Item types page titles, breadcrumbs, and header

This patch fixes inconsistencies in the item type administration page so
that page titles, breadcrumb navigation, and page headers are consistent
with each other and with other pages in Koha.

To test, apply the patch and go to Administration -> Item types. Check
each variation of the page to confirm that everything looks correct:

- Item types list
 - New item type
 - Edit item type
 - Confirm deletion of item type

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33406: (follow-up) Mock SearchEngine to ensure using ES
Nick Clemens [Mon, 18 Sep 2023 13:24:53 +0000 (13:24 +0000)]
Bug 33406: (follow-up) Mock SearchEngine to ensure using ES

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34719: Add middle_name to patron autocomplete
Lucas Gass [Thu, 7 Sep 2023 21:19:26 +0000 (21:19 +0000)]
Bug 34719: Add middle_name to patron autocomplete

To test:
1. Apply patch and clear browser cache.
2. Find some patrons with middle_name populated or add new patrons with a middle_name.
3. Make sure PatronAutoComplete is on
4. Try searching for a part of one of the patron's names who has a middle_name.
5. It should appear in the autocomplete dropdown

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34794: Fix typo in recalls_to_pull.tt
Matt Blenkinsop [Thu, 14 Sep 2023 15:17:54 +0000 (15:17 +0000)]
Bug 34794: Fix typo in recalls_to_pull.tt

Fixed typo - it's v its

Test plan:
Look at the bug patch and confirm the change is correct

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33406: (QA follow-up) Adjust tests and tidy
Nick Clemens [Thu, 14 Sep 2023 13:21:44 +0000 (13:21 +0000)]
Bug 33406: (QA follow-up) Adjust tests and tidy

Rather than test that nothing is returned, we want to test that the terms are filtered as expected. This also avoids the possibility of the tests failing in a db where there is a record for Donald Duck

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33406: Filter out some known isolated trouble makers
Janusz Kaczmarek [Tue, 8 Aug 2023 08:41:53 +0000 (08:41 +0000)]
Bug 33406: Filter out some known isolated trouble makers

Test plan:
1) Launch k-t-d with ES:
-- ktd --es7 pull
-- ktd --es7 up
2) Visit /cgi-bin/koha/authorities/authorities-home.pl and search for 'tim'
3) Edit that, add a dash '-' to 100$a, like 'Bunce, Tim - name'"
4) Do a authority search for 'tim - name', notice it errors out
5) Apply patch
6) Perform the same search, notice it doesn't error and returns the correct record

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33406: Handle ES search errors for authorities
Jonathan Druart [Thu, 11 May 2023 10:38:53 +0000 (12:38 +0200)]
Bug 33406: Handle ES search errors for authorities

We are dealing ok with ES exceptions for biblio records search,
catching them and raising them to the end user. But we don't for
authorities, where we explode with an ugly 500.

Test plan:
Search for "(term_1*) AND (-) AND (term_2*)" in the authority search and
notice that you don't get a 500 but an error instead saying that you
should try again

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33406: Add tests
Pedro Amorim [Mon, 4 Sep 2023 12:28:29 +0000 (12:28 +0000)]
Bug 33406: Add tests

Test plan:
1) Apply this tests patch only
2) Run: prove t/Koha/SearchEngine/ElasticSearch/Search.t
3) Notice it fails with nasty ES "Failed to parse query" error
4) Apply the other patches
5) Repeat 2) - notice theres no nasty error

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34589: Only update users if permission is added
Nick Clemens [Tue, 22 Aug 2023 15:09:17 +0000 (15:09 +0000)]
Bug 34589: Only update users if permission is added

To test:
1 - Assign a user 'edit_items' permission
2 - Manually run the update
    perl -e 'use C4::Installer; warn Data::Dumper::Dumper(C4::Installer::run_db_rev("installer/data/mysql/db_revs/221200003.pl"));'
3 - Edit patron permissions
4 - Note they now have edit_any_item permission
5 - Remove that permission
6 - Run the update again
7 - Edit patron permissions
8 - They have edit_any_item again - remove it
9 - Apply patch
10 - Run the update
11 - Edit patron permissions
12 - No new permissions added!
13 - sudo koha-mysql kohadev
     DELETE FROM permissions WHERE code = 'edit_any_item'
14 - Run the update again
15 - Edit patron permissions
16 - They do have edit_any_item

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 14156: Add id tags to each MARC note in the display
Owen Leonard [Tue, 15 Aug 2023 07:36:43 +0000 (07:36 +0000)]
Bug 14156: Add id tags to each MARC note in the display

This patch adds tag number to the data which is returned by
$biblio->get_marc_notes(). The bibliographic detail page in the staff
client is modified to use the tag number in both a class (for consistent
styling across the same tag number) and id (for unique styling for each
repeated tag).

To test, apply the patch and restart services.

- As a quick test for custom CSS, go to Administration -> System
  preferences and locate the IntranetUserCSS preference.
  - Add this testing CSS:

   .marcnote { font-size:140%; font-family: serif; }
   .marcnote-500 { background-color: #66FFCC; }
   .marcnote-511 { background-color: #99FFFF; }
   .marcnote-520 { background-color: #CCFF00; }
   .marcnote-521 { background-color: #CCFFFF; }
   .marcnote-538 { background-color: #FFCCCC; }
   .marcnote-546 { background-color: #FFFFCC; }

- Locate a record with multiple notes fields. In the sample data, record
  46, "Viridiana" is a good example which works well with the above CSS.
- On the bibliographic detail page for the record, click the
  "Descriptions" tab.
  - Each MARC note should be colored according to the tag it comes from.
  - Inspect the HTML to confirm that each paragraph also has its own
    unique ID.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34787: Fix typo gorup
Marcel de Rooy [Thu, 14 Sep 2023 09:31:00 +0000 (09:31 +0000)]
Bug 34787: Fix typo gorup

No test plan (fixing comment).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34716: Fix typo
Matt Blenkinsop [Tue, 5 Sep 2023 13:40:07 +0000 (13:40 +0000)]
Bug 34716: Fix typo

Fixes a typo where "it's" should be "its"

Test plan:
1) Check the commit and observe that the change has been made correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33818: Descriptive title added to opac-ISBDdetail.tt
Matt Blenkinsop [Wed, 24 May 2023 14:51:04 +0000 (14:51 +0000)]
Bug 33818: Descriptive title added to opac-ISBDdetail.tt

This patch adds the biblio.title to the breadcrumb for the ISBD viewer.
This now matches the normal and MARC views and is much clearer for
screen readers.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33045: Fix shebang of marcrecord2csv.t
Marcel de Rooy [Fri, 15 Sep 2023 09:26:31 +0000 (09:26 +0000)]
Bug 33045: Fix shebang of marcrecord2csv.t

Resolves:
bash: t/db_dependent/Record/marcrecord2csv.t: /usr/bin/perl;: bad interpreter: No such file or directory

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33045: Use process_tt in C4::Record::marcrecord2csv
Kyle Hall [Wed, 22 Feb 2023 18:16:35 +0000 (13:16 -0500)]
Bug 33045: Use process_tt in C4::Record::marcrecord2csv

Bug 33030 implements a new helper subroutine to standardize processing of Template Toolkit syntax outside slips and notices. We should use this subroutine in marcrecord2csv.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Record/marcrecord2csv.t

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>
9 months agoBug 34443: Spelling: Patron search pop-up Sort1: should be Sort 1
Owen Leonard [Fri, 8 Sep 2023 15:44:33 +0000 (15:44 +0000)]
Bug 34443: Spelling: Patron search pop-up Sort1: should be Sort 1

This patch instances of "Sort1" and "Sort2" being used
as labels in the interface, replacing the strings with "Sort 1" and
"Sort 2"

To test, apply the patch and test this page:

With the borrowerRelationship system preference populated, edit a
child record and click the "Add guarantor" button. There are two
fields in the form with the updated labels.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34743: Fix POD description
Matt Blenkinsop [Fri, 8 Sep 2023 11:04:56 +0000 (11:04 +0000)]
Bug 34743: Fix POD description

Currently --expiration-from-today has the same definition as --update-expiration. The description has now been updated to reflect the fact that it will set the date from today, and not the patron's enrollment date

Test plan:
Look at the patch file and confirm that the POD now mentions today's date rather than the patron's enrollment date

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34228: Add translation context to "Managed by"
Caroline Cyr La Rose [Mon, 10 Jul 2023 14:52:35 +0000 (10:52 -0400)]
Bug 34228: Add translation context to "Managed by"

This patch adds context for translators to the Managed by string when it
applies to acquisitions baskets (as opposed to purchase suggestions).

To test:
0. If you don't already have acquisitions set up, create a budget and a vendor

1. Apply patch

2. Create a basket
   2.1. Go to Acquisitions
   2.2. Search for a vendor
   2.3. Click New > Basket
   2.4. Fill out the form
   2.5. Click Save

3. View the basket details page
   --> The page works (no errors)
   --> 'Managed by:' is displayed on the right, no spelling errors

4. Click Add to basket > From a new (empty) record
   --> The page works (no errors)
   --> 'Managed by:' is displayed under Basket details, no spelling errors

5. Click Cancel

6. Update the po files

gulp po:update --lang xx-XX

for example, gulp po:update --lang fr-CA

7. Check the xx-XX-messages.po file (e.g. misc/translator/po/fr-CA-messages.po)
   --> There should be an entry for 'Managed by:' with a line msgctxt that gives the 'Acquisitions basket managed by user' context

8. Update the file with a random phrase for the 'Managed by:' translation

for example, I translated 'Managed by:' by 'AAAAAAA:', just to see the difference

\#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt:308
\#: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt:281
msgctxt "Acquisitions basket managed by user"
msgid "Managed by:"
msgstr "AAAAAAA:"

9. Install a new language
   9.1. Run the following commands in the terminal, replacing xx-XX with the language code (e.g. fr-CA)

   ./misc/translator/translate install xx-XX

   9.2. In the Koha staff interface, go to Administration > System preferences
   9.3. Search for language
   9.4. Check the box next to the new language
   9.5. Save

10. Switch the language of the interface

11. Redo steps 3 and 4
   --> The pages still work (no errors)
   --> The 'Managed by:' string should be replaced by whatever you put in step 8

Optional test
12. In the staff interface in English, view one or more of these pages, the 'Managed by' string should be unchanged
- Acquisitions > Suggestions (Managed by column heading)
- Acquisitions > Suggestions (Organize by: Managed by sorting option)
- Acquisitions > Suggestions (Filter by: Suggestion information: Managed by filter option)
- Acquisitions > Suggestions > Click on a suggestion (Managed by table row under Suggestion management)
- Patrons > Patron account > Purchase suggestions (Managed by column heading)

13. View these same pages in the other language, the Managed by string should NOT be changed to whatever you put in step 8

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34656: (QA follow-up) perltidy
Emily Lamancusa [Thu, 31 Aug 2023 14:52:52 +0000 (10:52 -0400)]
Bug 34656: (QA follow-up) perltidy

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34656: Do not update real Time Holds Queue when moving from cart to shelf
Nick Clemens [Wed, 30 Aug 2023 13:46:52 +0000 (13:46 +0000)]
Bug 34656: Do not update real Time Holds Queue when moving from cart to shelf

To test:
1 - Enable RealTimeHoldsQueue system preference
2 - Set UpdateItemLocationOnCheckin to _ALL_: CART
3 - Check in an item
4 - Check the background jobs - the RTHQ is updated
5 - perl -e 'use C4::Items; C4::Items::CartToShelf(##);' -- substitute the itemnumber from above
6 - Check the background jobs - no new update to RTHQ
7 - Confirm item was set back to correct permanent_location

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34656: Unit test
Nick Clemens [Wed, 30 Aug 2023 13:46:17 +0000 (13:46 +0000)]
Bug 34656: Unit test

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34767: Pass fee_ack into ::Transaction::Renew(All)
Martin Renvoize [Tue, 12 Sep 2023 15:24:19 +0000 (16:24 +0100)]
Bug 34767: Pass fee_ack into ::Transaction::Renew(All)

This patch copies the $fee_ack field into the generated
::Transaction::Renew|All objects such that the fee acknowldegement flag
is respected for renewals.

Test plan
To test:
1) Add a rental charge to an itemtype
2) Checkout an item of that itemtype to a user
3) Attempt a renewal of that item via SIP2 and note that it fails
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m renew
4) Pass the fee_acknowledgement bit in renewal and note the renewal
   still fails.
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m renew
5) Apply patch and note the above now succeeds
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m renew

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>
9 months agoBug 34768: Remove checkbox column from relatives fines on OPAC
Nick Clemens [Tue, 12 Sep 2023 15:28:34 +0000 (15:28 +0000)]
Bug 34768: Remove checkbox column from relatives fines on OPAC

When a patron has a guarantee and can see their fines on the opac and
an opac payment plugin is enabled there is an error on the 'Charges'
tab.

The table uses a 'COLSPAN' variable which is set to 5 or 6 depending on
if OPAC payments are enabled. The guarantees table has one less column
than the patron's however, so it is going out of range and causing a JS
error. Additionally, we are adding a column to the child's table which
is not used as their fines cannot be selected for payment at this time.

This patch removes the checkbox column and sets the colspan directly to
4

I also fix an issue where the table is not being set as we need to
reference the patron object in the guarantor info to obtain the id.

To test:
1 - Set system preference: AllowStaffToSetFinesVisibilityForGuarantor to
    allow
2 - Find a patron
3 - Add some fines to their account
4 - Install and enable an opac payment plugin
    (https://github.com/bywatersolutions/koha-plugin-pay-via-govolution
    for example)
5 - Sign in to OPAC as borrower
6 - Go to 'Charges' tab
7 - Select a fee
8 - Confirm 'Make payment' button enabled and 'amount to pay' is
    updated
9 - Add a guarantee to patron in staff interface
10 - Set 'Show charges to guarantors' to 'Yes'
11 - Add and pay a fine for the child
12 - View guarantor account on the OPAC
13 - Confirm you now see child's charges
14 - Confirm selecting your own fees does not enable the button or
     update amount to pay
15 - Note JS error in console
16 - Apply patch
17 - Reload patrons page
18 - Confirm the table loads correctly (no JS error)
19 - Confirm selecting a fine updates the total and enables button
20 - Disable the payment plugin
21 - Confirm the display is still correct, no errors

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34764: Set fee_acknowledged to expect a string
Martin Renvoize [Tue, 12 Sep 2023 13:18:37 +0000 (14:18 +0100)]
Bug 34764: Set fee_acknowledged to expect a string

For consistency with other options I opted to have the fee acknowledged
parameter to expect a string and as it's an optional parameter I've
dropped the default value of 'N' too.

Test plan
1) Prior to this patch
1a) Attempt a checkout without passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will be '|BON', the default
1b) Attempt a checkout passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will still be '|BON', failure
1c) Attempt a checkout passing a string for fee_acknoewledeged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will still be '|BON', failure
2) Apply the patch
2a) Attempt a checkout without passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m checkout`
    The optional `|BO` element should not be present
2b) Attempt a checkout passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged N --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will now be '|BON', success
2c) Attempt a checkout passing a string for fee_acknoewledeged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will now be '|BOY', success

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>
9 months agoBug 34736: Don't trigger quantity change on loading order
Nick Clemens [Thu, 7 Sep 2023 19:02:08 +0000 (19:02 +0000)]
Bug 34736: Don't trigger quantity change on loading order

We have a change event to automatically check or uncheck the first items on a list when
the value is changed directly.

The code is calling this when setting the quantity when loading an order, but this is causing a problem
in that we are setting the quantity to load.switch orders and triggering the checkboxes wrongly

To test:
 1 - Create a new basket, create items on placing the order
 2 - Create an order line with 4 items
 3 - Create another order line with 2 items
 4 - Close the basket
 5 - Receive shipment and create an invoice
 6 - Select both orders via the checkboxes got multi-receive
 7 - Click "receive selected"
 8 - Edit first order line, quantity received = 1 (1 out of 4)
 9 - Verify that one item is also selected in the table
10 - Switch to "next order"
11 - Quantity received is 0, no items checked in the second order
12 - Switch to "Previous order"
13 - ERROR: Item checkbox was lost, quantity received still correct
14 - Switch to next order
15 - ERROR: item is now checked, quantity received 0
16 - Note: We see a mix up of the information entered, one has the checkbox now, the other the quantity.
17 - Save changes
18 - Click confirm
19 - Continue (complaint about the second order left unchanged)
20 - You are back on the summary:
     * pending order: quantity changed from 4 to 3 - correct
     * received order: quantity shows 1 - correct
21 - Click on receive for your updated order line (with 3 items)
     * 4 items show to be received (should be 3)
22 - Apply patch
23 - Cancel receipt of items
24 - Repeat 1-12
25 - Items are loaded correctly
26 - Try with various checkboxes and switch back and forth
27 - Confirm that manually adjusting quantity received checks the first n boxes
28 - Confirm setting quantity to 0 unchecks the boxes

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34532: Silence warns in Patroncard.pm
Lucas Gass [Mon, 14 Aug 2023 21:11:52 +0000 (21:11 +0000)]
Bug 34532: Silence warns in Patroncard.pm

To test:

1. Go to patron card creator and make a patron card batch, card layout, and card template.
2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate.
3. Now go create a card batch while tailing the plack-intranet-error log/
4. Notice in the logs:

[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109.
[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248.
[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249.

5. Apply patch, restart_all
6. Try again and notice the WARNS should be gone from the logs now.
7. Make sure you can still create patron cards and the PDF's the generate look right.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34414: Remove DBD::Mock
Marcel de Rooy [Wed, 26 Jul 2023 06:56:03 +0000 (06:56 +0000)]
Bug 34414: Remove DBD::Mock

We never actually used it. See BZ report.

Test plan:
Run git grep DBD::Mock. Only finding old release notes.
Run git grep mock_add_resultset. Nothing.
Bonus: Find a few other DBD::Mock properties/attributes.

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: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33940: (QA follow-up) Remove obsolete length of 20
Marcel de Rooy [Fri, 21 Jul 2023 09:44:18 +0000 (09:44 +0000)]
Bug 33940: (QA follow-up) Remove obsolete length of 20

Currently 32. Could be 43 tomorrow :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33940: Consider NULL as valid
Jonathan Druart [Fri, 21 Jul 2023 08:46:41 +0000 (10:46 +0200)]
Bug 33940: Consider NULL as valid

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 33940: Move C4::Members cardnumber sub to Koha::Policy::Patrons::Cardnumber
Jonathan Druart [Wed, 7 Jun 2023 13:37:55 +0000 (15:37 +0200)]
Bug 33940: Move C4::Members cardnumber sub to Koha::Policy::Patrons::Cardnumber

Test plan:
The idea here is to confirm this patch does not introduce regression.
For that you will play with the CardnumberLength syspref and create a
new user, modify an existing one, and check that the UI does not let you
modify an invalid cardnumber.
The onboarding process and the patron import tool will also have to be tested

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 33940: Fix selfreg

please squash with first patch

Bug 33940: Fix messages we sent to templates

please squash with the first patch

Bug 33940: Fix what we send to memberentry

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (QA follow-up) Fix permissions
Tomas Cohen Arazi [Tue, 12 Sep 2023 19:21:40 +0000 (16:21 -0300)]
Bug 17499: (QA follow-up) Fix permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34721: (QA follow-up) update the other labels
Pedro Amorim [Thu, 7 Sep 2023 13:47:21 +0000 (13:47 +0000)]
Bug 34721: (QA follow-up) update the other labels

Showing only available items -> Showing only records with available items
Show all items -> Show all records

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34721: Change facet availability text in staff interface and OPAC
Lucas Gass [Tue, 5 Sep 2023 21:34:36 +0000 (21:34 +0000)]
Bug 34721: Change facet availability text in staff interface and OPAC

To test:
1. Apply patch
2. Do a catalog search in the staff interface. Make sure the 'Availability' button reads 'Limit to records with available items'.
3. Do a catalog search in the OPAC. Make sure the 'Availability' button reads 'Limit to records with available items'.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: Replace Koha::MessageAttribute(s) with Koha::Patron::MessagePreference...
Lari Taskula [Fri, 10 Feb 2023 10:48:19 +0000 (10:48 +0000)]
Bug 17499: Replace Koha::MessageAttribute(s) with Koha::Patron::MessagePreference::Attribute(s)

To test:
1. prove t/db_dependent/Illrequests.t
2. grep -rn 'Koha::MessageAttribute', observe no results in Koha code

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (follow-up) Add $patron->messaging_preferences accessor
Lari Taskula [Thu, 18 Mar 2021 03:16:11 +0000 (03:16 +0000)]
Bug 17499: (follow-up) Add $patron->messaging_preferences accessor

To test:
1. prove t/db_dependent/Koha/Patron.t

Sponsored-by: The National Library of Finland
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (follow-up) Rename to Koha::Patron::MessagePreference
Lari Taskula [Thu, 18 Mar 2021 02:13:50 +0000 (02:13 +0000)]
Bug 17499: (follow-up) Rename to Koha::Patron::MessagePreference

Koha::Patron::Message refers to "messages" table that is used for circulation
messages. MessagePreference now refers to a messaging preference that is used
for enqueued notifications.

To test:
1. prove t/db_dependent/Koha/Patron/MessagePreference/Attributes.t
2. prove t/db_dependent/Koha/Patron/MessagePreference/Transport/Preferences.t
3. prove t/db_dependent/Koha/Patron/MessagePreference/Transport/Types.t
4. prove t/db_dependent/Koha/Patron/MessagePreference/Transports.t
5. prove t/db_dependent/Koha/Patron/MessagePreferences.t

Sponsored-by: The National Library of Finland
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (follow-up) Contact information vs. mtt validation
Lari Taskula [Wed, 18 Nov 2020 02:15:23 +0000 (02:15 +0000)]
Bug 17499: (follow-up) Contact information vs. mtt validation

This patch adds a subroutine that handles message transport type validation by
first checking related patron contact information.

As an example, if there is no email address, we shouldn't let email be selected
as a messaging transport type.

The reason to isolate logic into a separate subroutine is that C4/Reserves.pm
_koha_notify_reserve() also uses the same logic and we should not duplicate it.
C4::Reserves::_koha_notify_reserve() will be adjusted to use this new sub in
Bug 18595.

To test:
1. prove t/db_dependent/Koha/Patron/Message/Preferences.t

Sponsored-by: The National Library of Finland
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (follow-up) Validate phone and itiva transport types
Lari Taskula [Wed, 18 Nov 2020 04:10:48 +0000 (04:10 +0000)]
Bug 17499: (follow-up) Validate phone and itiva transport types

Message transport types 'phone' and 'itiva' were not validated unlike
'email' and 'sms'. This patch adds equivalent checks to the missing mtts.

To test:
1. prove t/db_dependent/Koha/Patron/Message/Preferences.t

Sponsored-by: The National Library of Finland
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (follow-up) Fix warning
Lari Taskula [Thu, 5 Nov 2020 18:26:42 +0000 (18:26 +0000)]
Bug 17499: (follow-up) Fix warning

Fix warning

DBIx::Class::Storage::DBI::select_single(): Query returned more than one row.
SQL that returns multiple rows is DEPRECATED for ->find and ->single.

Sponsored-by: The National Library of Finland
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (follow-up) More explicit exceptions
Lari Taskula [Wed, 4 Nov 2020 15:19:22 +0000 (15:19 +0000)]
Bug 17499: (follow-up) More explicit exceptions

Adds and throws more detailed exceptions.

This is useful for APIs and generating translatable errors in GUI.

In short, replaces Koha::Exceptions::BadParameter with:

Koha::Exceptions::Patron::NotFound
Koha::Exceptions::Patron::Category
Koha::Exceptions::Patron::Category::NotFound
Koha::Exceptions::Patron::Message::Preference
Koha::Exceptions::Patron::Message::Preference::AttributeNotFound
Koha::Exceptions::Patron::Message::Preference::DaysInAdvanceOutOfRange
Koha::Exceptions::Patron::Message::Preference::DaysInAdvanceNotAvailable
Koha::Exceptions::Patron::Message::Preference::DigestNotAvailable
Koha::Exceptions::Patron::Message::Preference::DigestRequired
Koha::Exceptions::Patron::Message::Preference::EmailAddressRequired
Koha::Exceptions::Patron::Message::Preference::NoTransportType
Koha::Exceptions::Patron::Message::Preference::SMSNumberRequired

To test:
1. prove t/db_dependent/Koha/Patron/Message/Preferences.t

Sponsored-by: The National Library of Finland
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (QA follow-up) Fix POD errors
Martin Renvoize [Wed, 8 Jul 2020 12:32:17 +0000 (13:32 +0100)]
Bug 17499: (QA follow-up) Fix POD errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: (QA follow-up) Fix Licence Statements
Martin Renvoize [Wed, 8 Jul 2020 12:20:35 +0000 (13:20 +0100)]
Bug 17499: (QA follow-up) Fix Licence Statements

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: Replace test subroutines with build_object
Emmi Takkinen [Wed, 26 Feb 2020 10:04:08 +0000 (12:04 +0200)]
Bug 17499: Replace test subroutines with build_object

This patch replaces subroutines used to build test
objects with call to $builder->build_object.

To test prove that tests are still running with:
prove t/db_dependent/Koha/Patron/Message/*

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: Define koha_object(s)_class where needed
Emmi Takkinen [Thu, 20 Feb 2020 10:45:27 +0000 (12:45 +0200)]
Bug 17499: Define koha_object(s)_class where needed

This patch adds koha_object(s)_class for needed modules
to fix issues with tests.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 17499: Add Koha-objects for messaging preferences
Lari Taskula [Fri, 21 Oct 2016 14:26:24 +0000 (17:26 +0300)]
Bug 17499: Add Koha-objects for messaging preferences

This patch adds Koha-objects for messaging preferences.

Adds simple validation for messaging preferences.

The validation includes
- throw exception if both borrowernumber or categorycode is given for a new pref
- throw exception if patron for the given borrowernumber is not found
- throw exception if category for the given categorycode is not found
- throw exception if days in advance cannot be configured but is given
- throw exception if days in advance configuration is invalid (value between 0-30)
- throw exception if digest is not available but attempted to set on
- throw exception if digest must be enabled but attempted to set off
- throw exception on duplicate messaging preference

Adds a method for getting available messaging options.

Adds a method for setting default messaging preferenes.
  $patron->set_default_messaging_preferences (where $patron is a Koha::Patron)
  ...or...
  Koha::Patron::Message::Preference->new_from_default({
    borrowernumber => 123,
    categorycode => "ABC",
    message_attribute_id => 1,
  });

Since messaging preference is a feature that has multiple related database tables,
usage via Koha-objects is sometimes frustrating. This patch adds easy access to
message transport types via
  $preference->message_transport_types                              (for getting)
  $preference->set({ message_transport_types => ['email', 'sms'] }) (for setting)
  (also supports other calling conventions, see documentation for more)

Adds optional parameter message_name for Koha::Patron::Message::Preferences->find
and ->search. Simplifies the Koha-object usage by allowing developer to skip joins
and / or querying the message name via attribute_id from message_attributes table.

Includes test coverage for basic usage.

To test:
1. prove t/db_dependent/Koha/Patron/Message/*

Following Bug 17499, check also Bug 18595 that replaces C4::Members::Messaging
with these new Koha-objects.

Signed-off-by: Dominic Pichette <dominic@inlibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34502: Remove useless SEARCH_RESULT.localimage
David Cook [Wed, 9 Aug 2023 01:06:05 +0000 (01:06 +0000)]
Bug 34502: Remove useless SEARCH_RESULT.localimage

This patch removes a useless Template Toolkit tag.

To test:
0. Apply the patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=LocalCoverImages
2. Change to "Show"
3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
4. Upload an image
5. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test
6. Note that the local cover image appears even without the TT tag

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 32765: Retry transfer after cancelling hold
Julian Maurice [Tue, 31 Jan 2023 08:20:15 +0000 (09:20 +0100)]
Bug 32765: Retry transfer after cancelling hold

When trying to manually transfer an item that is on hold, we have the
choice to cancel the hold and try the transfer again. When choosing
this option, the hold is correctly cancelled but the transfer is not
tried again.
This patch fixes that

Test plan:
1. Place a hold on a specific item
2. Try to transfer it manually (Circulation » Transfer)
3. Choose the option to "Cancel hold and then attempt transfer"
4. See that the hold was cancelled, but no transfer was made
5. Apply the patch
6. Repeat step 1-3
7. See that the hold was cancelled, and the transfer was made

Signed-off-by: Nicolas Giraud <nicolas.giraud@inlibro.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 27378: Fix permissions
Tomas Cohen Arazi [Tue, 12 Sep 2023 12:48:04 +0000 (09:48 -0300)]
Bug 27378: Fix permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34223: (follow-up) Ensure consistent ordering of statuses
Martin Renvoize [Mon, 11 Sep 2023 13:50:43 +0000 (14:50 +0100)]
Bug 34223: (follow-up) Ensure consistent ordering of statuses

This patch adds an order_by clause to ensure consistent ordering of the
returned status and status_alias statuses from the database between
MySQL 8 and other DB engines.

This fixes the failing tests introducd in bug 34223.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34572: Simplify template logic around check-in input form
Owen Leonard [Fri, 18 Aug 2023 07:40:16 +0000 (07:40 +0000)]
Bug 34572: Simplify template logic around check-in input form

This patch makes a minor simplifying change to the check-in template
around how to style the barcode input field in dropbox or fine-exempt
mode.

To test, apply the patch and go to Circulation.

- If necessary, check some items out to patrons so that you have items
  to check in.
- Go to the check-in page and click the icon inside the barcode field to
  expand the panel of options.
- Check the "book drop mode" checkbox. The barcode field should now be
  highlighted yellow.
- Check in an item. When the page redisplays, the barcode field should
  have the same highlighted style.

- If necessary, enable the finesMode system preference.
- On the check-in page, in the panel of options, check the "Forgive
  overdue fines" checkbox. Test checking in again, confirming the same
  style consistency in the barcode field.

Signed-off-by: Inkeri <inkeri.hakulinen@helsinki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34723: Show thumbnails on opac-imageviewer.pl when imagenumber not provided
David Cook [Wed, 6 Sep 2023 06:28:45 +0000 (06:28 +0000)]
Bug 34723: Show thumbnails on opac-imageviewer.pl when imagenumber not provided

This patch fixes a method call in the opac-imageviewer.pl so that thumbnails
correctly appear.

Test plan:
0. Apply the patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=localcover
2. Change both *LocalCoverImages sysprefs to "Show"
3. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=AllowMultipleCovers
4. Change "AllowMultipleCovers" to "Allow"
5. Go to
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
6. Click "Images (0)" tab
7. Download or make two JPEG images
8. Upload the images
9. Go to http://localhost:8080/cgi-bin/koha/opac-imageviewer.pl?biblionumber=29
10. See one large image in the centre and two smaller thumbnails on the right side

PA amended patch: Added missing test plan step

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 27378: DBRev 23.06.00.018
Tomas Cohen Arazi [Tue, 12 Sep 2023 12:37:31 +0000 (09:37 -0300)]
Bug 27378: DBRev 23.06.00.018

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 27378: (QA follow-up) Tidy admin/preferences.pl
Katrin Fischer [Fri, 4 Aug 2023 12:47:04 +0000 (12:47 +0000)]
Bug 27378: (QA follow-up) Tidy admin/preferences.pl

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 27378: Introduce cookie consent to OPAC and staff client
Matt Blenkinsop [Mon, 11 Jan 2021 14:50:17 +0000 (14:50 +0000)]
Bug 27378: Introduce cookie consent to OPAC and staff client

To avoid confusion around commit messages and the content of this enhancement, this first commit is a squashed commit of all the original code submited to this bug. Following a few years of inactivity, it has been rebased and re-submitted with some fixes and concept changes contained in the more recent commits.

Signed-ff-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: (follow-up) Add missing filters

(cherry picked from commit 6b8565b949b62269f6d850e6d412458d0dbcfb37)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: Fix accessibility issues

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: Update to new atomicupdate structure

This patch consolidates the previous 4 database update files into one atomicupdate file in line with the new structure

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: Change ConsentJS to CookieConsentedJS

This patch updates the name of the ConsentJS syspref to CookieConsentedJS and amends the description to be more clear what the syspref is for

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: Stop the codemirror editor and delete confirmation from duplicating

Previously, if the "Add new code button" was clicked in the CookieConsentedJS editor, the original entry would have duplicated CodeMirror editors.
This was exponential, i.e adding two new lines would result in three codemirror editors appearing on the first entry, two on the second and so on.
The click event was not being applied properly and was being applied to every element with the .expand-textarea class, rather than specifically the new elements being created. The addExpandHandler function now loops through each element individually and decides whether to apply the click event handler.

Similarly, the delete confirmation was dupliacting for the same reason. This has also been resolved.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: Remove two sysprefs and replace with html customisations

Currently there are two sysprefs - CookieConsentBar and CookieConsentPopup. These allow the user to select what text they would like to see in the consent bar and modal. These have been removed and replaced with HTML customisations to allow more flexible customisations and different languages.

Sponsored by: PTFS-Europe

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: (QA follow-up) Small fixes and tidy-ups

This patch does the following:
- Realphabetizes the lines in sysprefs.sql
- Fixes a formatting error in patrons.pref
- Adjusts the position of the cookie consent bar if the language selector is visible
- Fixes translatability on the syspref modal

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: (QA follow-up) Allow staff to view their cookie consents

This patch allows staff to view their cookie consents through a link in the dropdown menu in the navbar. Previously staff had no way of accessing their cookie consents

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: (QA follow-up) Add cancel button to cookie modal

This patch adds a cancel button to the modal for reviewing cookie consents. Previously there was no way to exit without selecting one of the cookie options

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: (QA follow-up) Add filtering for OPAC only and staff only cookies

This patch fixes an issue where cookies selected as OPAC only would still show in the staff client and vise versa. The cookies are now filtered and only the correct cookies will be used in the OPAC and staff client

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 27378: (QA follow-up) Fix tests and character encoding

This patch fixes an encoding issue when using diacritics. It also fixes a failing test, corrects the format of the "Cancel" links in the modal and perltidy has been used on all relevant files

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34079: The phrase "Displaying [all|approved|pending|rejected] terms" was separated
Caroline Cyr La Rose [Wed, 21 Jun 2023 14:59:47 +0000 (10:59 -0400)]
Bug 34079: The phrase "Displaying [all|approved|pending|rejected] terms" was separated

This patch reunites the words for the sentence "Displaying
[all|approved|pending|rejected] terms" in order to facilitate
translating in languages that have a different syntax.

To test:
1. Install a new language

   ./misc/translator/translate install xx-XX

2. Check the xx-XX-staff-prog.po file for the sentence
   --> All the words are individual strings

3. Apply patch

4. Update the po files

   ./misc/translator/translate update xx-XX

5. Check the xx-XX-staff-prog.po file again
   --> The sentence is reunited for each status (Displaying all terms,
       Displaying approved terms, etc.)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34081: Contextualization of "Approved" (one term) vs "Approved" (more than one...
Caroline Cyr La Rose [Wed, 21 Jun 2023 16:27:12 +0000 (12:27 -0400)]
Bug 34081: Contextualization of "Approved" (one term) vs "Approved" (more than one term), and other tag statuses

To test:

1. Apply patch

2. Install language

   ./misc/translator/translate install xx-XX

3. Update po files

   ./misc/translator/translate update xx-XX

4. View the xx-XX-messages.po file

   --> Strings for tag statuses for one tag should be separated from
       strings for statuses for multiple tags, with context Tags
       (single) or Tags (multiple)

5. Change the strings so you know which is which

   For example, in French, the approved status for a single tag would
   be "Approuvé" and for multiple tags would be "Approuvés" (with the
   plural s at the end)

6. Apply translations

   ./misc/translator/translate install xx-XX

7. Add tags through the OPAC
   7.1. In another tab, go to the OPAC
   7.2. Log in
   7.3. Search for a record
   7.4. From the detailed record, click Add tags
   7.5. Enter a tag and click Add

8. In the staff interface, go to Tools > Tags

9. Approve/Reject the tag
   --> The status in the table and on the button should be the singular
       status, the status in the summary on the right should be plural

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34257: (QA follow-up): tidy up code
Victor Grousset/tuxayo [Sun, 3 Sep 2023 23:06:23 +0000 (01:06 +0200)]
Bug 34257: (QA follow-up): tidy up code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34257: Limit item types by branch in batchMod.pl
Lucas Gass [Fri, 18 Aug 2023 14:45:14 +0000 (14:45 +0000)]
Bug 34257: Limit item types by branch in batchMod.pl

To test:
1. Go to Item types administration.
2. Set some items types to be limited to a branch you are not logged in as.
3. Find some items from the branch you are logged in at and go to Batch item modification.
4. Add the barcodes and attempt to edit the item type to the one you limited in step 2.
5. You can change these item types to ones that your branch should not be able to.
6. Apply patch
7. Try steps 4 -5 again but this time you should not see item types in the dropdown that are limited to other branches.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34402: Sorting holds on patron account includes articles
Owen Leonard [Wed, 26 Jul 2023 12:25:11 +0000 (12:25 +0000)]
Bug 34402: Sorting holds on patron account includes articles

This patch adds some configuration to the table of holds shown on the
checkout and patron detail pages so that sorting by title correctly
excludes articles.

To test, apply the patch and clear your browser cache.

- Check out to a patron who has multiple holds on titles which include
  leading articles like "a" "an" and "the."
- Click the holds tab and click the "title" column to sort by title.
  - The titles should be correctly sorted alphabetically while ignoring
    articles.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34624: (follow-up) Add "for" attribute to serials-search.inc label
Owen Leonard [Fri, 8 Sep 2023 10:56:24 +0000 (10:56 +0000)]
Bug 34624: (follow-up) Add "for" attribute to serials-search.inc label

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34624: (follow-up) fix broken <span>
Victor Grousset/tuxayo [Thu, 7 Sep 2023 03:34:59 +0000 (05:34 +0200)]
Bug 34624: (follow-up) fix broken <span>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34624: Add "for" attribute to label in header search forms which lack it
Owen Leonard [Fri, 25 Aug 2023 17:43:00 +0000 (17:43 +0000)]
Bug 34624: Add "for" attribute to label in header search forms which lack it

This patch adds a "for" label to header search forms labels which lack
it.

To test, apply the patch and test the affected pages to confirm that
clicking the label corresponding to the active search form can be
clicked to move cursor focus to that input field.

As you activate each search form, the cursor focus will automatically be
moved to the input. Click outside of the field to remove the focus, and
then click the label to test that it is correctly tied to the field.

- Staff interface home page:
  - Checkout, Check in, Renew, Search patrons, and Search catalog.
- Acquisitions: Vendor search and orders search
- Acquisitions -> Vendor search -> Vendor -> Contracts: Contract search
- Acquisitions -> Vendor search -> Vendor -> Basket -> Add to basket ->
  From a suggestion: Search suggestions
- Authorities: Main heading ($a only), Main heading, All headings, and
  Entire record.
- Administration -> Budgets: Search funds
- Administration -> Cities & towns: City search
- Administration -> Currencies: Currencies search
- Administration -> Desks: Search desks
  * With UseCirculationDesks enabled
- Administration -> Patron categories: Search patron categories
- Administration -> System preferences: Search system preferences
- Administration -> Z39.50 servers -> Z39.50 server search
- Cataloging: Cataloging search
- E-resource management: Search agreements, Search licenses, Search
  packages, and Search titles
  * With ERMModule enabled
- Patrons -> Search patrons
- Serials: Search subscriptions
- Tools -> Notices & slips: Search notices

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34163: Handle both anonymous userenv when generating CSRF tokens
David Cook [Fri, 30 Jun 2023 02:50:17 +0000 (02:50 +0000)]
Bug 34163: Handle both anonymous userenv when generating CSRF tokens

An anonymous session might have a userenv which is undef or which is
a hashref of undef/empty values.

This patch generates the "anonymous" prefix for undef/empty 'id'
values, which prevents CSRF errors when logging in via OAuth2/OIDC
following a Koha logout.

Test plan:
Before applying patch:
1. Go to https://wiki.koha-community.org/wiki/Testing_SSO
2. Set up OpenID Connect realm, user, client, and Koha
integration to Keycloak for koha-testing-docker as noted in the wiki

3. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl?logout.x=1
4. Click on OIDC "Log in with XXXX" button and log into IDP
5. Note that you're not logged in and you instead see an error message like:
"There was an error authenticating to external identity provider wrong_csrf_token"

6. Apply patch
7. Go to "Sessions" section of the test realm in Keycloak
e.g. http://sso:8082/auth/admin/master/console/#/test/sessions
8. Click "Action" on the far right side of the screen
9. Choose "Sign out all active sessions"

After applying patch:
10. koha-plack --restart kohadev
11. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl?logout.x=1
12. Click on OIDC "Log in with XXXX" button and log into IDP
13. Note that you're logged in

14. prove t/Token.t
15. Note all tests pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34731: (follow-up) Fix conditional variable declaration
Martin Renvoize [Mon, 11 Sep 2023 11:47:48 +0000 (12:47 +0100)]
Bug 34731: (follow-up) Fix conditional variable declaration

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34731: Use Koha::Notice::Message in EnqueueLetter
Kyle M Hall [Thu, 7 Sep 2023 15:40:59 +0000 (11:40 -0400)]
Bug 34731: Use Koha::Notice::Message in EnqueueLetter

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Letters.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>
9 months agoBug 34731: Don't call SendQueuedMessages if message_id is bad
Kyle M Hall [Thu, 7 Sep 2023 15:15:25 +0000 (11:15 -0400)]
Bug 34731: Don't call SendQueuedMessages if message_id is bad

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>
9 months agoBug 34731: Throw exception if SendQueuedMessages is passed a bad message_id
Kyle M Hall [Thu, 7 Sep 2023 15:04:32 +0000 (11:04 -0400)]
Bug 34731: Throw exception if SendQueuedMessages is passed a bad message_id

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Letters.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>
9 months agoBug 34639: Restore order_by
Lari Taskula [Tue, 29 Aug 2023 19:14:56 +0000 (19:14 +0000)]
Bug 34639: Restore order_by

To test:
1. prove t/db_dependent/Koha/Item.t
2. Observe success

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34639: Use coderef for releationship
Nick Clemens [Tue, 29 Aug 2023 12:17:14 +0000 (12:17 +0000)]
Bug 34639: Use coderef for releationship

This patch switches from a simple relationship to a custom join as
illustrated in the DBIx::Class docs

Reference:
https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditions

This does not include an order_by, so I am not sure if it is sufficient

To test:
1 - On command line:
    export DBIC_TRACE=1;
2 - Save simple script:
use Modern::Perl;
use Koha::Items;

my $items = Koha::Items->search( {'me.itemnumber'=>27}, {prefetch => 'current_branchtransfers'} );
my $item = $items->next;

warn $item->_result->current_branchtransfers->count();
warn $item->get_transfer();
3 - run it
4 - Note that the query doesn't include conditions on the transfers
5 - Apply patch
6 - Repeat
7 - Note that query is correct

Test in staf client:
1. Add an item to library A
2. Go to Circulation -> Transfer
3. Transfer the item from library A to another library B
4. Set your currently logged in library to library B
5. Check-in the item
6. Observe message "Item received from A"
7. View the bibliographic record of the item (catalogue/detail.pl)
8. Observe item in "In transit from A to B since xx/xx/xxxx Available"
9. Apply patch
10. Restart all
11. Reload details - item no longer in transit

Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34639: Add tests
Lari Taskula [Tue, 29 Aug 2023 09:34:04 +0000 (09:34 +0000)]
Bug 34639: Add tests

To reproduce:

1. Add an item to library A
2. Go to Circulation -> Transfer
3. Transfer the item from library A to another library B
4. Set your currently logged in library to library B
5. Check-in the item
6. Observe message "Item received from A"
7. View the bibliographic record of the item (catalogue/detail.pl)
8. Observe item in "In transit from A to B since xx/xx/xxxx Available"

To test:
1. prove t/db_dependent/Koha/Item.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34403: Inconsistencies in Currencies and exchange rates page titles, breadcrumbs...
Owen Leonard [Fri, 25 Aug 2023 17:38:56 +0000 (17:38 +0000)]
Bug 34403: Inconsistencies in Currencies and exchange rates page titles, breadcrumbs, and header

This patch updates the currencies administration page in order to make
the page title, breadcrumb navigation, and page headings consistent with
each other.

To test, apply the patch and go to Administration -> Currencies and
exchange rates. Test each variation of the page to confirm that the
title, breadcrumbs, and headings are consistent.

- Currencies main page
- New currency
- Edit currency
- Delete currency confirmation

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34412: (QA follow-up) Terminology updates
Owen Leonard [Fri, 8 Sep 2023 10:42:24 +0000 (10:42 +0000)]
Bug 34412: (QA follow-up) Terminology updates

- Use "system preference" instead of just "preference"
- Use "system_preference" as placeholder in translatable strings

This patch also updates a few places where the placeholder i18n syntax
can be used for consistency.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34412: (follow-up) Clarify page heading, remove unused markup
Owen Leonard [Wed, 6 Sep 2023 10:53:55 +0000 (10:53 +0000)]
Bug 34412: (follow-up) Clarify page heading, remove unused markup

This patch updates the heading for the "modify" view so that it includes
the name of the preference being modified.

The patch also removes markup related to the "add_validate"
state--a view confirming that a preference has been added--because that
view doesn't exist.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34412: Inconsistencies in System preferences page titles, breadcrumbs, and header
Owen Leonard [Tue, 5 Sep 2023 17:58:58 +0000 (17:58 +0000)]
Bug 34412: Inconsistencies in System preferences page titles, breadcrumbs, and header

This patch makes changes to the markup of various areas of the local use
system preferences template in order to make it more consistent with
other pages in Koha.

To test, apply the patch and go to Administration -> System
preferences -> Local use. View each variation of the page to confirm
that breadcrumb navigation, page title, and page headings are consistent
with each other.

- On the main page confirm that the heading is "Local use system
  preferences"
  - New preference:
    - The form on this page has been updated to make the markup
      structure more consistent with other pages, with the heading
      outside the white box of the form.
    - The two portions of the form have been combined into one so that
      the layout of the form is more consistent with similar forms.
 - Edit preference
 - Delete:
   - The deletion confirmation page has been reformatted to use an
     "alert" style dialog with styled confirmation buttons.
   - The "Data deleted" view has been reformatted to use a "message"
     style dialog.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34085: (follow-up) remove typo in Javascript
David Cook [Thu, 24 Aug 2023 06:25:52 +0000 (06:25 +0000)]
Bug 34085: (follow-up) remove typo in Javascript

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34085: Remove the use of event attributes from basket groups template
Owen Leonard [Wed, 21 Jun 2023 17:24:20 +0000 (17:24 +0000)]
Bug 34085: Remove the use of event attributes from basket groups template

This patch removes the use of event attributes (onclick, onsubmit) from
the basket groups template. These events are defined now along with the
other in-page JS.

This change allows us to move the scripts to the bottom of the page.

Unrelated changes: There was no confirmation tied to the process of
deleting a basket group. I've added one. And there were several "MSG_"
variables defined which were unused and have been removed.

To test you should have at least one vendor with at least one basket
group.

- Apply the patch and go to Acquisitions.
- Locate a vendor with an associated basket group.
- Edit a basketgroup
  - Confirm that editing works correctly (leaving "Close basket group"
    unchecked")
  - Confirm that editing works correctly with "Close basket group"
    checked.
- In the list of closed basket groups, confirm that all the controls
  work correctly.
- Create an empty basket group and confirm that clicking the associated
  "Delete" button in the list of basket groups triggers a confirmation,
  "Are you sure you want to delete this basket group?" Test that both
  confirming and cancelling work correctly.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>