koha.git
6 months agoBug 35276: Remove authentication params from suggestion hash
Marcel de Rooy [Tue, 7 Nov 2023 12:57:42 +0000 (13:57 +0100)]
Bug 35276: Remove authentication params from suggestion hash

These would be forwarded to Koha::Objects->as_list and crash on
unknown column.

Test plan:
Logout from staff.
Enter URL /suggestion/suggestion.pl
Without this patch, it crashes. Now it does not.

Note: The crash may show auth_forwarded_hash but I also saw
koha_login_context passing by. Same issue.

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>
(cherry picked from commit e2821c7962ca7594f029f4c7fdb0c2f70028eb9b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 months agoBug 35298: Remove focus handler from dateaccessioned plugin.
Marcel de Rooy [Thu, 9 Nov 2023 08:05:34 +0000 (08:05 +0000)]
Bug 35298: Remove focus handler from dateaccessioned plugin.

Test plan:
Verify that setting focus to date acquired field in items editor
fills date of today when field is empty but does not replace existing
date.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
(cherry picked from commit 0583deac95b35f1ad96493262e922d7ac3eef102)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 months agoBug 35103: Add option to gulp tasks to pass a list of tasks
Jonathan Druart [Thu, 19 Oct 2023 07:41:03 +0000 (09:41 +0200)]
Bug 35103: Add option to gulp tasks to pass a list of tasks

You can now generate the messages.po for all languages with:
  gulp po:update --task messages

or for only es-ES
  gulp po:update --task messages --lang es-ES

It may be helpful for the "update po" script that will be used on
weblate.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 months agoBug 27992: [23.05] (follow-up) Fix unit test with unblessed patron
Fridolin Somers [Mon, 13 Nov 2023 19:12:08 +0000 (09:12 -1000)]
Bug 27992: [23.05] (follow-up) Fix unit test with unblessed patron

6 months agoBug 21284: [23.05] (follow-up) Fix unit test with unblessed patron
Fridolin Somers [Mon, 13 Nov 2023 19:04:24 +0000 (09:04 -1000)]
Bug 21284: [23.05] (follow-up) Fix unit test with unblessed patron

7 months agoBug 35187: [23.05] (follow-up) Fix missing line breaks in WELCOME notice
Jonathan Druart [Sat, 11 Nov 2023 10:04:06 +0000 (11:04 +0100)]
Bug 35187: [23.05] (follow-up) Fix missing line breaks in WELCOME notice

yaml was broken because of extra space

7 months agoBug 35144: Update style of 'Required' label for OPAC patron attributes
Owen Leonard [Tue, 7 Nov 2023 19:06:13 +0000 (19:06 +0000)]
Bug 35144: Update style of 'Required' label for OPAC patron attributes

This patch makes some changes to style and markup of the part of the
OPAC patron entry form which displays patron attribute entry fields.

To test, apply the patch and rebuild the OPAC CSS.

- Create at least two patron attributes which have both "Display in
  OPAC" and "Editable in OPAC" checked: One which is linked to an
  authorized value, one which isn't. At least one attribute should be
  mandatory. At least one attribute should be repeatable.
- Test the form using either patron self-registration or by logging in
  to the OPAC and clicking the "Personal details" link in the sidebar.
- Check the appearance of required fields in the form, including the
  mandatory patron attributes.
- Confirm that the "Clear" and "New" controls look good and work
  correctly, including fields cloned with the "New" button.

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>
(cherry picked from commit dd70e43b66fc2a887c5a5d6afc165ebf20469354)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35273: Fix item selection when receiving
Jonathan Druart [Tue, 7 Nov 2023 10:23:34 +0000 (11:23 +0100)]
Bug 35273: Fix item selection when receiving

For partial receives with items created on order, the
aqorders_items table was not correctly updated when only
some of the ordered items were received.

To test:
1) Create a basket with creating items on order
2) Create an order line with 3 items
3) Close basked
4) Receive shipment and create invoice
5) Receive your created order line
6) Edit first item displayed, add barcode
7) Check checkbox and receive
8) Verify the order line has been split 2:1
9) Receive again - notice all 3 items are showing.
  We should only see the remaining 2
10) Undo receive
11) Apply patch
12) Repeat steps 5)-9)
13) Verify that in step 9) only the remaining 2 items display now.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4fd674761199c2cce6ffbd0c272ee22f19711c4f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 29007: Add cancellation reason input on check in
Thibaud Guillot [Fri, 3 Nov 2023 14:30:04 +0000 (15:30 +0100)]
Bug 29007: Add cancellation reason input on check in

Test plan:

1) Check an item in with already a confirmed hold
2) Cancel the hold, it was cancelled without possibility to choosing a
   reason
3) Apply this patch and do it again, you must see an input to choose
   your cancellation reason (list from VA)

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>
(cherry picked from commit fe93b31ec73f22712189f9e4d385ec453b1cbd5a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35284: Fix tests
Jonathan Druart [Thu, 9 Nov 2023 09:45:32 +0000 (10:45 +0100)]
Bug 35284: Fix tests

This fix patrons_search.t but other selenium tests certainly need
adjustements

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dbf07b8cd3143660449cc49d855d2ceca56a42fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35284: Add throttling to column filters
Jonathan Druart [Thu, 9 Nov 2023 07:58:41 +0000 (08:58 +0100)]
Bug 35284: Add throttling to column filters

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5220dd6004ff34d29c29e1e139d6d17ccecff9b4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35284: Fix Vue tables
Jonathan Druart [Thu, 9 Nov 2023 07:58:11 +0000 (08:58 +0100)]
Bug 35284: Fix Vue tables

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8738dcd9886cdb5d91e481e11d0d1c730a9e9127)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35284: Add DT delay to kohaTable
Jonathan Druart [Wed, 8 Nov 2023 21:23:20 +0000 (22:23 +0100)]
Bug 35284: Add DT delay to kohaTable

To test:
* When a specific initComplete exists (general patron search)
* When no specific initComplete exists (cities)

=> KO
* ERM tables display twice the "show X entries" dropdown list
* Column filters are not affected

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3819f4a57c9c208746e7f147ab085c36ccaf7d68)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35008: (QA follow-up) Add selenium unit tests
David Cook [Fri, 10 Nov 2023 01:06:39 +0000 (01:06 +0000)]
Bug 35008: (QA follow-up) Add selenium unit tests

This patch addds selenium tests for the ILS-DI feature.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a89aee37239495a7a655d99a3a910ecdd3fce835)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35008: Make ILS-DI not require auth when OpacPublic disabled
Aleisha Amohia [Sun, 8 Oct 2023 21:59:19 +0000 (21:59 +0000)]
Bug 35008: Make ILS-DI not require auth when OpacPublic disabled

To test, disable OpacPublic and ensure a call to ilsdi.pl will still return expected results from a private browser, not logged into the OPAC.

Sponsored-by: Auckland University of Technology
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb130f559ecc0a232adce9a8af0084a99d6e9a81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35283: Add missing subfield h to action note 583 in OPAC detail page
Katrin Fischer [Thu, 9 Nov 2023 21:33:10 +0000 (21:33 +0000)]
Bug 35283: Add missing subfield h to action note 583 in OPAC detail page

$x is nonpublic note, so it makes sense to only display it in staff, but
$h is Jurisdiction and we should show it in OPAC and staff alike.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 653dc1b2214d0ebb291766406354c69cfa57c7e1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35283: Add missing subfields h and x to field 583 for staff XSLT
David Cook [Wed, 8 Nov 2023 02:24:01 +0000 (02:24 +0000)]
Bug 35283: Add missing subfields h and x to field 583 for staff XSLT

This change adds the missing subfields h and x to field 583 for
the detail XSLT in the staff interface.

Test plan:
0. Apply the patch and koha-plack --reload kohadev
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=29
2. Click on tab "5"
3. Scroll down to 583 and click on "ACTION NOTE" to expand subfields
4. Fill in using the following example:
   583 0#$adowngraded$c19910110$hJoe Smith$otitle$xfrom secret FRD to confidential NSI
5. Click "Save"
6. Note that the "Action note" now shows "Joe Smith" and "from secret
   FRD to confidentail NSI"

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>
(cherry picked from commit d74a89e2dabe355f05c4c45b6b39e581509e1c16)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 33164: Do not prevent processing of all error messages
Aleisha Amohia [Mon, 23 Oct 2023 22:28:55 +0000 (22:28 +0000)]
Bug 33164: Do not prevent processing of all error messages

This follow-up patch removes the use of $exit_required_p completely. The sysprefs BlockReturnOfLostItems and BlockReturnOfWithdrawnItems are handled in other scripts, and should not prevent the processing of all returns error messages when enabled.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 64460e4f4e01d8cb84a8037f444e5f7739a6bd40)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 33164: Ensure return claim message shows if lost item return blocked
Aleisha Amohia [Tue, 7 Mar 2023 22:07:04 +0000 (11:07 +1300)]
Bug 33164: Ensure return claim message shows if lost item return blocked

This fix ensures that a return claim confirmation always shows, even if
the return of lost items has been blocked by BlockReturnOfLostItems
being enabled.

To test:

1. Set BlockReturnOfLostItems system preference to Block
2. Check out an item to a patron
3. Go to the patrons page and claim a return on the item
4. Check in the item and keep checking in the item. Notice the message
"Item is lost, cannot be checked in." shows every time, but the return
claim message only shows sometimes.

5. Apply the patch and restart services

6. Check in the item and keep checking in the item. Confirm both the
lost message shows and the return claim message shows every time.
7. Confirm the return of the item is still blocked.

Sponsored-by: Pymble Ladies' College
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f56880812323a003d3d9d043c10c3142d397ac4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35278: Fix warn from column_settings.pl
Marcel de Rooy [Mon, 6 Nov 2023 14:00:49 +0000 (14:00 +0000)]
Bug 35278: Fix warn from column_settings.pl

We need to add scalar to the calls. These parameters are not meant
to be used as multi_param.

Test plan:
Try With and without this patch on staff:

Try: /cgi-bin/koha/admin/columns_settings.pl
=> WITHOUT: No warnings
=> WITH: Same. No change.
Try: /cgi-bin/koha/admin/columns_settings.pl?module=acqui&page=basket
=> WITHOUT: Opens module, scrolls down. CGI::param called in list context in logfile
=> WITH: Opens module, scrolls down.
Try: /cgi-bin/koha/admin/columns_settings.pl?module=acqui&page=basket&table=orders
=> WITHOUT: Opens module, scrolls down. CGI::param called in list context in logfile
=> WITH: Opens module, scrolls down.

Try: /cgi-bin/koha/admin/columns_settings.pl?module=acqui&module=admin
* Hash like: panel => acqui, admin => page, undef  => table, undef => modules, $modules (SHIFTED)
=> WITHOUT: Acqui expanded showing: There is no page using the table configuration in this module.
=> CGI::param warning in log.
=> And: Problem = a value of table has been passed to param without key
=> And: Problem = a value of modules has been passed to param without key
=> WITH: Only the first module (Acqui) should be expanded.

Try: /cgi-bin/koha/admin/columns_settings.pl?module=acqui&module=admin&page=basket&table=orders
* Hash like: panel => acqui, admin => page, basket => table, orders => modules, $modules hash (SHIFTED)
=> WITHOUT: Acqui expanded showing: There is no page using the table configuration in this module.
=> And: CGI param log warning.
=> WITH:: Opens Acqui. Second module ignored. Scrolling.

Try: /cgi-bin/koha/admin/columns_settings.pl?module=admin&module=acqui&page=basket&table=orders
* Hash like: panel => admin, acqui=> page, basket => table, orders => modules, $modules hash (SHIFTED)
=> WITHOUT: Admin expanded showing: There is no page using the table configuration in this module.
=> And: CGI param log warning.
=> WITH: Admin should be expanded (page and table ignored, not in Admin). No scroll.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1b11de87b991ddae4d31861c9cdc321ce45d229d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34413: Fix style of Flatpickr in iOS mobile view
Owen Leonard [Thu, 9 Nov 2023 13:21:06 +0000 (13:21 +0000)]
Bug 34413: Fix style of Flatpickr in iOS mobile view

This patch updates Flatpickr CSS in the OPAC and staff interface so that
date fields are displayed correctly in iOS mobile views.

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

- In the OPAC, click "Create new account"
- In the account entry form, confirm that the date of birth field looks
  correct and that the date-picker works as it should.
- In the staff client, go to Patrons -> New patron.
- Check the date of birth field in this form too.

This patch has been tested in the Xcode iOS device simulator with iOS
17. While I wasn't able to reproduce the problem in Firefox, I was able
to use the developer tools' responsive design mode to trigger the mobile
view and thus be able to see the styles which are being applied:

- In the OPAC, on the "Create new account" screen, open the Web
  Developer Tools panel (Tools -> Browser tools -> Web Developer Tools).
- Click the "Responsive Design Mode" button in the upper-right corner of
  the developer tools panel (it looks like a phone and tablet together).
- The main browser window will now how some settings at the top.
- In the first dropdown, choose an iPhone model.
- The date of birth field should now be styled differently because of
  the addition of a "flatpickr-mobile" style.
- Right-click the field and choose "Inspect." In the developer console
  you can see the styles which are being applied to the field. One of
  those should be ".flatpickr-input.flatpickr-mobile"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9e9fa64d5a9f8966c45a923b258c994df70ac35f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35295: Move JS asset in returns.tt
Lucas Gass [Wed, 8 Nov 2023 21:18:27 +0000 (21:18 +0000)]
Bug 35295: Move JS asset in returns.tt

To Test:
1. Place a hold
2. Check-in an item of the held record
3. No hold modal ðŸ˜±
4. APPLY PATCH
5. Hold modal!!!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 771334218acc2a5eb97bac1eab38a53543084444)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35254: Add import_record_id to order inputs
Nick Clemens [Fri, 3 Nov 2023 20:10:01 +0000 (20:10 +0000)]
Bug 35254: Add import_record_id to order inputs

This patch follows the logic of bug 32166 and adds specific inputs for each order to avoid any misalignment when some records are not imported

To test:
1 - Find a vendor in acquisitions
2 - Create or find an open basket
3 - Add to basket form a new file
4 - Stage file and add to basket
5 - Select the second record in the list
6 - Enter price info
7 - Save (don't forget, you need to set item type in the second tab)
8 - The order has no price info!
9 - Apply patch
10 - Repeat 3-7 above, staging file fresh
11 - Confirm order has correct prices
12 - Test with a file with many records
13 - Confirm any combination of choosing/skipping records works as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7e2f6d66d6a8cae55d3c879ec2ce89af59439ffa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35262: Improve OPAC self registration confirmation page
Owen Leonard [Mon, 6 Nov 2023 19:40:06 +0000 (19:40 +0000)]
Bug 35262: Improve OPAC self registration confirmation page

This patch corrects logic in the OPAC self registration confirmation
template so that the right column markup is shown when various
combinations of OpacNav, OpacNavBottom, and OpacNavRight are displayed.

To test, apply the patch and enable the PatronSelfRegistration system
preference, and deactivate the PatronSelfRegistrationVerifyByEmail
preference.

- Go to the OPAC and start the process of registering online.
- Fill in the form and submit it.
- On the registration confirmation page, check that the layout looks
  correct.
- Test with the presence of various combinations of OpacNav,
  OpacNavBottom, and OpacNavRight HTML customizations.

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>
(cherry picked from commit 64edb692458262133818553c4cbfa86ca3612260)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35206: Adjust style of add button on curbside pickups administration
Owen Leonard [Tue, 31 Oct 2023 17:10:15 +0000 (17:10 +0000)]
Bug 35206: Adjust style of add button on curbside pickups administration

This patch adds Bootstrap classes to the "Add" button on the curbside
administration page, in the "Curbside pickup hours" section. This makes
it consistent with the markup of similar buttons in the interface and
makes it slightly smaller so that it fits better in the form.

To test, apply the patch and make sure the "CurbsidePickup" preference
is enabled.

- Go to Administration -> Curbside pickups.
- Fill out the form, including the "New slot" fields in the "Curbside
  pickup hours" section.
  - Confirm that the corresponding "Add" button looks correct, and that
    it works to add your new slot.

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>
(cherry picked from commit cc70e17f5d07ad8988a1a4a02e0049abc7428547)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34328: DBRev 23.05.05.003
Tomas Cohen Arazi [Wed, 8 Nov 2023 20:36:37 +0000 (17:36 -0300)]
Bug 34328: DBRev 23.05.05.003

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f4001d5462a3490d04e65b3cf7a45174b9eb4b86)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34328: Make update idempotent
Martin Renvoize [Fri, 6 Oct 2023 09:41:20 +0000 (10:41 +0100)]
Bug 34328: Make update idempotent

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Perltidied the atomic update.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1dd482bb8ebf7091dfff913ad9dc8f8a0e6f328d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34328: (follow-up) Add description to en_GB
Martin Renvoize [Fri, 21 Jul 2023 07:21:23 +0000 (08:21 +0100)]
Bug 34328: (follow-up) Add description to en_GB

This follow-up adds the language description string for Scottish Gaelic
to the en_GB translation.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 037619ab95d502086fe9727536fad9496301d2e1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34328: Add Scottish Gaelic to languages
Martin Renvoize [Thu, 20 Jul 2023 15:31:40 +0000 (16:31 +0100)]
Bug 34328: Add Scottish Gaelic to languages

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 44aa68c3dfa2b067b317cdb1c6578e517e115d46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 21284: (QA follow-up) Fix QA script issues
Kyle M Hall [Fri, 3 Nov 2023 16:45:22 +0000 (16:45 +0000)]
Bug 21284: (QA follow-up) Fix QA script issues

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit db19d3f18d8eaffce7def6adc6c86941b9d33d34)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 21284: (QA follow-up) Rename itemonhold and recordonhold
Kyle M Hall [Fri, 3 Nov 2023 16:43:47 +0000 (16:43 +0000)]
Bug 21284: (QA follow-up) Rename itemonhold and recordonhold

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 37c8cf6e34de8db5a3147ffed9cfa96e075080f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 21284: ILS-DI: Allow GetPatronInfo to tell if a loaned item is on hold by someone...
Matthias Meusburger [Fri, 27 Apr 2018 14:22:28 +0000 (16:22 +0200)]
Bug 21284: ILS-DI: Allow GetPatronInfo to tell if a loaned item is on hold by someone else.

This patch adds two new entries in the loans section of GetPatronInfo response:

 - itemonhold: number of holds on this specific item.
 - recordonhold: number of holds on the record.

It allows an ILS-DI client to know if a loaned item is already on hold by someone else, and how many holds there are.

Test plan:
1. Apply the patch.
2. Enable the ILS-DI system preference.
3. Check out an item for a patron and make sure there no other holds at either an item or record level.
4. Check that the new itemonhold and recordonhold entries displayed are equal to zero (example: http://127.0.0.1:8080/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=19&show_contact=0&show_loans=1).
5. Add either a record or item level hold for the record used in step 2.
6. Check that itemonhold and recordonhold values are incremented accordingly.
   Note: a hold at an item level counts as a hold at a record level, but not vice-versa.
7. Run the tests and make sure they pass: prove t/db_dependent/ILSDI_Services.t
8. Sign-off!

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>
(cherry picked from commit d1d5811279fe6a2c8fc0953142fffe3adc9f249b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34938: (QA follow-up) Tidy code
Kyle M Hall [Fri, 3 Nov 2023 15:58:30 +0000 (11:58 -0400)]
Bug 34938: (QA follow-up) Tidy code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d373a55f4aa185c7e86aa3d3b14cb689c31e849)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34938: Add collection column to hold ratio report
Lucas Gass [Wed, 27 Sep 2023 18:38:31 +0000 (18:38 +0000)]
Bug 34938: Add collection column to hold ratio report

To test:
1. Create enough holds on items so that they will appear on the holds ratio report.
2. Visit circ/reserveratios.pl by going to Circulation > Holds ratios
3. No collection column.
4. Apply patch and restart services
5. Look again at circ/reserveratios.pl, now you should see a collection column.
6. Ensure that the data in the column looks correct.
7. Go to Administration > Table settings to ensure you can hide that column, and other columns in the table.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b0dedd61a488812a1180a1e748186e66e1c9a9fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35198: Sort database column names alphabetically on automatic item modification...
Owen Leonard [Tue, 31 Oct 2023 13:48:11 +0000 (13:48 +0000)]
Bug 35198: Sort database column names alphabetically on automatic item modification page

This patch modifies the automatic item modification by age page so that
the rule entry form sorts <select>s alphabetically, making it easier to
find the entry you need.

The [% FOR field IN... %] directives now include the "sort" method, e.g.

    [% FOR field IN agefields.sort %]

To test, apply the patch and go to Cataloging -> Item modifications by
age

- Click the "Add rules" button, then the "Add rule" button.
- Check the "Age field," "Conditions," and "Substitutions" dropdowns to
  confirm that the choices are listed alphabetically.
- Fill in the form and save the rule.
- Go back and edit the rule you created. Check that the dropdowns are
  still correct.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd258280482e0c84bf6baf61d7054b1c628e53f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 33050: Tidy
Tomas Cohen Arazi [Wed, 8 Nov 2023 13:10:23 +0000 (10:10 -0300)]
Bug 33050: Tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f88cb1da4fdef813c74b5eb890df8d12d72c47ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 33050: Allow to specify quote char in runreport.pl
Fridolin Somers [Thu, 23 Feb 2023 06:40:14 +0000 (20:40 -1000)]
Bug 33050: Allow to specify quote char in runreport.pl

Add to script misc/cronjobs/runreport.pl quote char arg (only for CSV).
See perl doc https://metacpan.org/pod/Text::CSV#new

This patch also adds missing '--separator' in POD.

Test plan :
1 - Write a SQL report
2 - perl misc/cronjobs/runreport.pl --format csv 1 (or correct report number)
3 - Note you get double quotes
4 - Apply patch
5 - Repeat #2 - no change
6 - perl misc/cronjobs/runreport.pl --format csv --quote "'" 1
7 - Now it is single quote delimited
8 - perl misc/cronjobs/runreport.pl --format tsv --separator "'" 1
9 - Error is reported, you cannot set quote unless csv
10 - Try empty string as quote

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>
(cherry picked from commit 4d604ac2a942354bc903bc9c697d8b18d412e39b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34557: DBRev 23.05.05.002
Tomas Cohen Arazi [Wed, 8 Nov 2023 13:04:23 +0000 (10:04 -0300)]
Bug 34557: DBRev 23.05.05.002

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b6ec7064e3ecd6297b7fa27367babdba0c74f0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34557: (follow-up) Make link more like button in staff interface
Owen Leonard [Fri, 18 Aug 2023 07:02:24 +0000 (07:02 +0000)]
Bug 34557: (follow-up) Make link more like button in staff interface

This patch adds Bootstrap button style to the link and changes the text
from "Load your checkouts" to "Show your checkouts."

The patch adds an anchor to the link so that the browser jumps down the
page a bit making the checkouts more visible.

The patch also corrects the includes for Font Awesome files. No icons
were loading because of incorrect asset links.

To test, follow the previous patch's test plan, checking that the button
looks correctly styled and that the page reloads with the checkout form
at the top.

Confirm that Font Awesome icons are loading throughout the page.

Signed-off-by: AndrewA <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fbe06c7d9cb3f60d7b1553f462bbc9725d899fe9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34557: Add SCOLoadCheckoutsByDefault system preference
Nick Clemens [Thu, 17 Aug 2023 09:10:54 +0000 (09:10 +0000)]
Bug 34557: Add SCOLoadCheckoutsByDefault system preference

This patch adds a enw system preference SCOLoadCheckoutsByDefault

When enabled, a patron's list o fcurrent checkouts will be loaded when the sign in to the SCO
module. If disabled, they will see link to load their checkouts. In either case, a new section
is added to the SCO to show a brief display of the last checked out it

To test:
1 - Enable WebBasedSelfCheck system preference
2 - Browse to:
    http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
3 - Sign in the SCO user (or enable AutoSelfCheck)
4 - Sign in as a user with several items checked out
5 - Confirm you see a list of items checked out
6 - Apply patches, updatedatabase, restart_all
7 - 'Finish' and login patron to SCO again
8 - Confirm you still see the list
9 - 'Finish'
10 - Chenge the system preference
11 - Sign in to SCO, confirm checkouts do not load
12 - Confirm you see 'Load your checkouts' link
13 - Check an item out
14 - Confirm you see the last checkout, but not a list
15 - Attempt to checkout an item that cannot be checked out
16 - Confirm "Return to account summary" does not load checkouts
17 - Click "Load your checkouts"
18 - Confirm they load
19 - Check out another item, confrim they remain and are updated
20 - Checkout an item that cannot be issued
21 - Confirm 'Return to account summary' loads the checkouts again

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: AndrewA <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8c801ea1323dd5247a8c4e1477b800d18f64f28b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35253: Add classes to materials specfied message on check in and checkout
Lucas Gass [Fri, 3 Nov 2023 17:48:00 +0000 (17:48 +0000)]
Bug 35253: Add classes to materials specfied message on check in and checkout

To test:
1. APPLY PATCH
2. Add a materials specified message to an item. ( 952$3 )
3. Add the following CSS to your IntranetUserCSS:

    .mats_spec_label { color: white; background: purple;  }
    .mats_spec_message { color: white; background: green; }

4. Checkout that item. Notice the message should be green and the label (Note about the accompanying materials:) should be purple.
5. Check in that item. Notice the message should be green and the label (Note about the accompanying materials:) should be purple.

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>
(cherry picked from commit 1f2bdac94d5821900b35e610184b806a38ddd9f5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34704: Remove regex for adding additional line breaks to print templates
Katrin Fischer [Tue, 7 Nov 2023 22:31:31 +0000 (22:31 +0000)]
Bug 34704: Remove regex for adding additional line breaks to print templates

This makes sure that we don't change the line breaking for either
HTML nor plain text print notices.
For plain text, the <pre> is used to keep the line breaks as defined
in the notices template.
For HTML we require on the line breaks added by block elements in the
HTML notice, not adding any additional ones like before.
This gives the full control of the formatting to the notice editor.

To test:
* Make sure your patron doesn't have an email address
* Make sure to check the hold filled notice in messaging preferences
* Place a old on any item
* Checkin the item
* Confirm hold
* Verify notices tab shows the Hold (print) notice
* ./misc/cronjobs/gather_print_notices.pl ./ --html
* Verify the generated file has the HTML output wrapped in pre.
* Reformat the HOLD print notice to be HTML by setting the checkbox.
  Mmake sure to add some empty lines for (they should not print later)
  and some <br>, <p>, <div>  - They should be reflected in the notice later.
* Repeat test.
* All should be well :)

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4c15ad658d59d7f63d27fe61dc102ecd4c22a03d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35187: Fix missing line breaks in WELCOME notice
Katrin Fischer [Fri, 10 Nov 2023 18:24:15 +0000 (18:24 +0000)]
Bug 35187: Fix missing line breaks in WELCOME notice

When a notices is marked as HTML, we need to use block elements
(p, div, li, etc.) or explicit line breaks.
This adds the line breaks where required.

To test:

WELCOME
* Without patch
* Make sure your Koha can send email (set up SMTP server, KohaAdminLibraryAddress)
* Make sure your patron has an email set
* In patron account, use "More > Welcome email"
* Verify all text is on one line
* Apply patch
* reset_all to install new sample notice templates
* Repeat test, verify welcome notice is now nice

7 months agoBug 35280: Fix patron attributes "clear" link in OPAC patron entry form
Owen Leonard [Tue, 7 Nov 2023 17:07:17 +0000 (17:07 +0000)]
Bug 35280: Fix patron attributes "clear" link in OPAC patron entry form

This patch makes a minor correction to the JavaScript controlling the
behavior of the "clear" link which appears on the patron entry form next
to patron attribute <select>s or <textarea>s which are editable in the
OPAC.

To test, apply the patch and create patron attributes
which have both "Display in OPAC" and "Editable in OPAC" checked.

- Create one which is tied to an authorized value, and one which isn't.
- Log in to the OPAC and click the "Personal details" tab.
- In the entry form, find the patron attribute fields under the
  Additional information" heading..
- Select a value in the dropdown, and enter text in the textarea.
- Confirm that clicking the corresponding "Clear" link for each works as
  expected.

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>
(cherry picked from commit 3a027a0da974ecc72d2144f2b503d3013257c8a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34857: Do not enable hidden select element (regression from bug 33233).
Andreas Jonsson [Tue, 7 Nov 2023 13:42:58 +0000 (14:42 +0100)]
Bug 34857: Do not enable hidden select element (regression from bug 33233).

Test plan:

Using Chrome as web browser:

* Go to opac advanced search
* Press "more options"
* Search for two keywords using "and" operator (on ktd search for idea AND behind, which matches 1 result)
* Search for two keywords using "or" operator (on ktd search for idea OR behind, which matches 4 results)
* Search for two keywords using "not" operator (on ktd search for idea NOT behind, which matches 2 results)

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>
(cherry picked from commit b5d174c7d9e87766fc7dbe6160932052199b4638)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35272: Add padding above vendor contracts section
Owen Leonard [Tue, 7 Nov 2023 11:54:56 +0000 (11:54 +0000)]
Bug 35272: Add padding above vendor contracts section

This patch makes minor updates to the CSS and markup of the vendor
detail page so that the different page sections have the correct
margins.

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

- In Acquisitions, locate a vendor and add at least one contract if
  necessary.
- View the vendor details page. Each section (Vendor details, Ordering
  information, Contracts) should have comfortable and consistent
  margins.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ce9cd1458c4417e6e52e87df5fe8baeeb6c2d7dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 31041: (follow-up) Clean up and generalise
Martin Renvoize [Tue, 7 Nov 2023 11:35:22 +0000 (11:35 +0000)]
Bug 31041: (follow-up) Clean up and generalise

This patch cleans out the print media css rules that were originally
added for modalprinting.  The window.open method is simpler to maintain
and will more reliably print modal content as expected.

We factor out the printer code into it's own JS asset that we can apply
to other printable modals and then use it in the two existing places
where such modals have been defined already (cashup summary and bundle
confirmation).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ef880e349f959686a830bda67ec5a295e3d76eb4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 31041: Prevent duplicate display of cashup summary when printing
Lucas Gass [Thu, 2 Nov 2023 19:56:00 +0000 (19:56 +0000)]
Bug 31041: Prevent duplicate display of cashup summary when printing

To test:
1. Have POS on.
2. Have some registers and items for sale. Make some sales to 'Cashup'.
3. If you have enough enough lines in the table so that 'register.pl' would print on 2 or more pages, the summary will be duplicated that same number of time.

If you are lazy like me and don't want to make that many transaction you can also add some content to the page like this:

for (let i = 0; i < 100; i++) {
  $('#register').append('<h1>TEST</h1>');
}

4. APPLY PATCH, clear browser cahche
5. Try printing again, you should only get one cashup summary when printing.

Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 85fb62f3d6e0784bf75309325b78712f18877055)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 31041: add modal_printer.js asset to registers.tt
Lucas Gass [Tue, 7 Nov 2023 22:32:47 +0000 (22:32 +0000)]
Bug 31041: add modal_printer.js asset to registers.tt

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fcd97d8741d1141ee99e5ad0d8ec89d0f9ea32c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34931: Remove fieldset/legend in favor of div/h3
Lucas Gass [Thu, 12 Oct 2023 22:14:10 +0000 (22:14 +0000)]
Bug 34931: Remove fieldset/legend in favor of div/h3

1. Create some PA_CLASS authorized values.
2. Create some custom patron attributes and add them to the newly created PA_CLASS's.
3.  Set CollapseFieldsPatronAddForm to collapse 'Additional attributes and identifiers'.
4. Go to a new or existing patron record.
5. At the top of the page click the checkbox for "Show collapsed fields:".
6. Scroll down to that section and notice the PA_CLASS <legend> element is shown but not the individual patron attributes within that PA_CLASS.
7. Apply patch
8. Try again, the Additional attributes and identifiers fieldset should display properly.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1944c66fc03e0e661745ece4bbc04e0607dd6def)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34375: Fix the option to provide no fund in budget dropdown
Matt Blenkinsop [Mon, 6 Nov 2023 10:40:33 +0000 (10:40 +0000)]
Bug 34375: Fix the option to provide no fund in budget dropdown

Currently it is not possible to use the No fund option as the dropwdown will default to the first budget in the list. This patch re-adds this option so that the defaulting behaviour is fixed

Test plan:
1) Go to a vendor record in Acquisitions and then Receive Shipment
2) Enter an invoice number
3) Leave the Shipping cost empty and Shipping Fund as 'No fund'
4) Receive some orders or go straight to Finish receiving
5) Notice the Shipping fund has defaulted to the first fund in the alphabetical list of funds.  It is not possible to select 'No fund' and the selected fund is recorded in shipmentcost_budgetid incorrectly.
6) Apply patch
7) Repeat steps 1-5 and this time the No fund option should be used correctly

Signed-off-by: Georgia Newman <g.newman@arts.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e7e0390dabbe267abb702812c03a484c4a7909b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 27992: (QA follow-up) Terminology: returned -> checked in
Katrin Fischer [Sun, 5 Nov 2023 12:39:13 +0000 (12:39 +0000)]
Bug 27992: (QA follow-up) Terminology: returned -> checked in

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2430d59a00780455622ecfe5b42af3c47f7e8617)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 27992: (QA follow-up) Perltidy
Katrin Fischer [Sun, 5 Nov 2023 12:07:25 +0000 (12:07 +0000)]
Bug 27992: (QA follow-up) Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7e0cd0e2117fed6a1c8ea9deb673dbbc771b655a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 27992: Unit test
Lucas Gass [Mon, 30 Oct 2023 16:45:54 +0000 (16:45 +0000)]
Bug 27992: Unit test

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f7e289415681e2b97065648576fd3f9fab6ff15b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 27992: Call AddReturn on stats patron
Lucas Gass [Fri, 27 Oct 2023 23:36:05 +0000 (23:36 +0000)]
Bug 27992: Call AddReturn on stats patron

To test:
1. Create a Statistical Patron
2. Check out an item to the Stat Patron, that is checked out to another user
3. See that the local use is recorded, but the item does not get checked in
4. Check out an item that has a lost status and note that the local use is recorded, and the lost status is cleared.
5. Item is NOT checked in
6. Apply patch
7. Repeat steps 2 - 4. Item is checked in.
8. Set BlockReturnOfLostItems to Block.
9. Have a checkout to another patron then mark it as lost.
10. Check it out to the Statistical Patron. You should see the message "Item was lost, cannot be returned."
12. Conform the item remains on the patron's account.
13. Turn off BlockReturnOfLostItems, check out the same item to the Statistical Patron. You should see a message "Item was lost, now found."
14. Conform the item was actually checked in.

15. Set BlockReturnOfWithdrawnItems to Block.
16. Have a checkout to another patron then mark it as withdrawn.
17. Check it out to the Statistical Patron. You should see the message "Item was withdrawn, cannot be returned."
18. Conform the item remains on the patron's account.
19. Turn off BlockReturnOfWithdrawnItems, check out the same item to the Statistical Patron. You should see a message "Item was withdrawn."
20. Conform the item was actually checked in.

21. Have an item on a regular patron account that has a hold on it.
22. Check it out to the Statistical Patron
23. See the message "Item on hold, please checkin."

24. Have an item on a regular patron account that has a claim return on it.
25. Checkit it out to the Statistical Patron.
26. See the message "Item claimed returned, please checkin."

27. Have an item on a regular patron account that has been recalled.
28. Checkit it out to the Statistical Patron.
29. See the message "Item can fill a recall, please checkin."

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fe0f8389b2710f83256aff4b0b05a9809190bd6a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35245: Set default width for select2 in authorities
Pedro Amorim [Fri, 3 Nov 2023 10:17:23 +0000 (10:17 +0000)]
Bug 35245: Set default width for select2 in authorities

Test plan:
1) Edit a authority Marc framework, e.g. 'CHRON_TERM', visit:
   /cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=CHRON_TERM
2) Pick any field to turn into a AV field, e.g. 371, and edit its subfields:
   /cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=371&authtypecode=CHRON_TERM
3) Pick a subfield e.g. 'd' and click edit, visit:
   /cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=371&tagsubfield=d&authtypecode=CHRON_TERM#subdfield
4) Pick a Authorized value list e.g. DEPARTMENT, click Submit
5) Create a new authority of the same type 'CHRON_TERM', visit:
   /cgi-bin/koha/authorities/authorities.pl?authtypecode=CHRON_TERM
6) Click on Tab '3' and click on field 371 ADDRESS to expand it
7) Notice field 'd' select2 width is very narrow
8) Apply patch. Repeat. Notice its not narrow anymore

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>
(cherry picked from commit f918c3ff803d811ad025bff42e1263e3b3aafa83)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34993: (QA follow-up) Perltidy
Katrin Fischer [Sun, 5 Nov 2023 11:50:17 +0000 (11:50 +0000)]
Bug 34993: (QA follow-up) Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24e1ee2118311bad39203a932dd4c6ab67c5d8c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34993: Pass context parameters to generate_subfield_form
Emily Lamancusa [Thu, 2 Nov 2023 16:56:35 +0000 (12:56 -0400)]
Bug 34993: Pass context parameters to generate_subfield_form

Pass necessary parameters from the UI to ensure that the basic
MARC editor can correctly identify when a framework is changed,
a bib is being duplicated, or a bib is being imported with Z39.50 -
for purposes of filling in default values according to the settings
of ApplyFrameworkDefaults.

To test:
1. Set the system preference ApplyFrameworkDefaults - Select All
2. Create or edit a MARC bibliographic framework with a default value in
   one of the fields (such as 500$a)
3. Go to the Cataloguing module and create a new record using the
   framework from step 2
   --> Confirm that the default value is filled in
4. Search for an existing bib record
5. Click Edit > Edit record to open the basic editor
6. If the field from step 2 already has data, clear it
7. Switch the framework to the framework from step 2
   --> Confirm that the default value is filled in
8. Clear the field again, and save the edit
9. Click Edit > Edit as new (duplicate)
   --> Confirm that the default value is filled in
10. Go to the cataloguing module and do a Z39.50 search
11. Find a record that does not have a value for the subfield from step 2
12. Import the record using the framework from step 2
    --> Confirm that the default value is filled in

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>
(cherry picked from commit 0c941147903294dd33996a8d293285c9a82e4f13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35215: Add few assumptions in Suggestions.t around emailing
Marcel de Rooy [Wed, 1 Nov 2023 14:50:47 +0000 (14:50 +0000)]
Bug 35215: Add few assumptions in Suggestions.t around emailing

Test plan:
Without this patch, set pref ReplytoDefault or EmailAddressForSuggestions.
Run t/db_dependent/Suggestions.t (FAIL)
Fill branch email and reply for CPL branch.
Run t/db_dependent/Suggestions.t (FAIL: more errors)
Apply patch.
Run t/db_dependent/Suggestions.t (PASS)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0ea2a1c7be73995ca4b26c67f049912259c457a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35212: Correct mismatched label on identity provider entry form
Owen Leonard [Wed, 1 Nov 2023 10:21:41 +0000 (10:21 +0000)]
Bug 35212: Correct mismatched label on identity provider entry form

This patch corrects the identity provider form so that the label for the
"Allow staff" field has the correct "for" attribute. Currently it is a
duplicate of the one for the "Allow OPAC" field.

To test, apply the patch and go to Administration -> Identity providers.

- Click "New identity provider"
- Near the bottom of the form, look for the "Allow staff" field.
- Clicking the "Allow staff" label should activate the corresponding
  dropdown.

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>
(cherry picked from commit 15f0dc2c2a027896c0b2f62c4e08cd46279426e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35205: Fix duplicate id attribute in desks search form
Owen Leonard [Tue, 31 Oct 2023 16:58:48 +0000 (16:58 +0000)]
Bug 35205: Fix duplicate id attribute in desks search form

This patch updates the header search form for desks administration so
that it doesn't contain an HTML id attribute which duplicates one on the
desks entry form.

To test, apply the patch and make sure the "UseCirculationDesks" system
preference is enabled.

- Go to Administration -> Circulation desks -> New desk.
- Click the "Desk" label in the entry form. Cursor focus should move to
  the adjacent input field.
- Click the "Search desks" label in the header search form to confirm
  that your cursor moves to the header search 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>
(cherry picked from commit 9a39c181dfc4b5075fe939620d18e4a6b28b45bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34624: [23.05.x] Add "for" attribute to label in header search forms which lack it
Owen Leonard [Fri, 13 Oct 2023 11:28:56 +0000 (11:28 +0000)]
Bug 34624: [23.05.x] 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

7 months agoBug 35181: Don't pass undef to header
Nick Clemens [Thu, 2 Nov 2023 10:56:30 +0000 (10:56 +0000)]
Bug 35181: Don't pass undef to header

It seems passing an undef value causes the headers to be malformed.

To test:
1 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303
2 - Note 'Invalid-metadata' at top of page, as well as other headers
3 - Apply patch, restart all
4 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303
5 - Page should now appear as xml
6 - Edit record 303, or any record with valid metadata in the advanced cataloging editor
7 - Confirm there is no error or alert
8 - Edit record 369 in the advanced cataloging editor
9 - Confirm there is an alert

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 38e95c7769ccb7686c1e10347173bfaffa4b70c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 17798: (follow-up) Adjust color of fieldset nested in .dialog.alert
Owen Leonard [Fri, 3 Nov 2023 12:22:34 +0000 (12:22 +0000)]
Bug 17798: (follow-up) Adjust color of fieldset nested in .dialog.alert

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>
(cherry picked from commit aaa0bd2391fc49a23c2d7a5a8369c7b7300e6bdf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 17798: Add fieldset for 'Yes, check out (Y)'
Nick Clemens [Thu, 2 Nov 2023 19:10:02 +0000 (19:10 +0000)]
Bug 17798: Add fieldset for 'Yes, check out (Y)'

With the increased text, the buttons don't arrange neatly. Adding a
fieldset around the options for 'Yes' mitigates this somewhat - it
could do with a bit more styling, however, it also fixes bug 23953

To test:
Confirm the 'Yes' options are more clear that they only affect the yes
button
Confirm the other buttons arrange nicely

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>
(cherry picked from commit 5d291a6f1d9df762232379bc214753953c2d672e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 17798: Confirm hold when printing slip from another patron's account
Nick Clemens [Thu, 2 Nov 2023 19:05:16 +0000 (19:05 +0000)]
Bug 17798: Confirm hold when printing slip from another patron's account

This patch adds a few pieces of information to the print slip button
and makes the code confirm the hold

As we are printing before the confirm, we also add the ability to pass
in the itemnumber to 'ReserveSlip'

This is slightly hacky, however, I don't see another way to allow
printing without an additional page reload.

To test:
 1 - Place a title level hold for patron A, for delivery to library B
 2 - Attempt to checkout an item from the record above to Patron B from
     library A
 3 - You receive an alert about the hold
 4 - Click "Don't check out, confirm hold, and print slip"
 5 - Confirm the slip looks correct and has item info
 6 - Confirm that item is in transit to fill hold
 7 - Revert transit status
 8 - Attempt to checkout the item to Patron B from Library B
 9 - Click "Don't check out, confirm hold, and print slip"
10 - Confirm slip is correct
11 - Confirm item is marked waiting

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>
(cherry picked from commit 3ec73d80e2a88e3a87eefc886865ccfb91f9be09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 32379: Add check on existing item
Marcel de Rooy [Thu, 2 Nov 2023 10:47:50 +0000 (10:47 +0000)]
Bug 32379: Add check on existing item

Simplest fix; bail out with output_error.

Test plan:
Try /cgi-bin/koha/cataloguing/additem.pl?biblionumber=1&op=saveitem&itemnumber=999999
Note: Replace 1 by existing biblionumber, and iitem 999999 should not exist.
You should get the 404 screen now.

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>
(cherry picked from commit 0677a53e1445342ac4927a1177100f69e4f02271)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35190: DBIC schema
Tomas Cohen Arazi [Fri, 3 Nov 2023 17:19:52 +0000 (14:19 -0300)]
Bug 35190: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cfc63f77bbeb10f3b80c706361ffabed041853ef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35190: DBRev 23.06.00.062
Tomas Cohen Arazi [Fri, 3 Nov 2023 17:18:17 +0000 (14:18 -0300)]
Bug 35190: DBRev 23.06.00.062

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2a0410a70146a6d2bc223300255262bc6190eb7c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35190: Adjust UI handling to avoid inserting an empty string
Emily Lamancusa [Mon, 30 Oct 2023 17:19:02 +0000 (13:19 -0400)]
Bug 35190: Adjust UI handling to avoid inserting an empty string

To test:
1. In the Administration module, create an Additional Field that is
   not linked to an authorized value
2. Create another Additional Field that is linked to an authorized
   value
3. Access the database in the command line (koha-mysql kohadev)
4. Select all from additional_fields
5. Confirm that each field correctly lists either the appropriate
   authorized value, or NULL

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 97c09f1d3cf58500bf7b0f06446592fb77f6570f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35190: Adjust tests
Emily Lamancusa [Mon, 30 Oct 2023 16:07:28 +0000 (12:07 -0400)]
Bug 35190: Adjust tests

Test plan:
prove t/db_dependent/Koha/AdditionalField.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3be301e628d63e3fc71bcd709f90756f0b9aab8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35190: Set default NULL for authorised_value_category in additional_fields table
Emily Lamancusa [Mon, 30 Oct 2023 15:31:31 +0000 (11:31 -0400)]
Bug 35190: Set default NULL for authorised_value_category in additional_fields table

To test:
1. Start KTD without this patch
2. In the Administration module, create an Additional Field with
   Authorized Value set to None
3. Create another Additional Field with Authorized Value set to an
   existing authorized value
4. Apply patch and updatedatabase
5. Access the database in the command line with koha-mysql kohadev
6. Select all rows from additional_fields
7. Confirm that the two Additional Fields from earlier have values of
   NULL and the correct authorized value, respectively, in their
   authorised_value_category fields.
8. reset_all to test new install
9. Access the database in the command line
10. Show the table structure for additional_fields and confirm that
    default for authorised_value_category is NULL

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 40414f9c694f3d044f81662c6d9df9c6ca19e2fc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink
Tomas Cohen Arazi [Tue, 27 Sep 2022 19:10:51 +0000 (16:10 -0300)]
Bug 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink

This patch makes the trivial change of making the linker script rely on
LinkerRelink instead of CatalogModuleRelink, which is confusing and
incorrect (according to both sysprefs descriptions).

To test:
1. Verify that relinking is now tied to the right syspref

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4310e13a6416d680e825621278859e3b91b1942a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35242: Force memcache restart after koha upgrade
Mason James [Thu, 2 Nov 2023 22:56:51 +0000 (11:56 +1300)]
Bug 35242: Force memcache restart after koha upgrade

to test..

1/ install koha-common
    $ sudo apt install koha-common

2/ start memcached, check PID
    $ sudo service memcached start
    $ sudo systemctl status  memcached | grep PID
        Main PID: 52851 (memcached)

3/ build and install new koha-common package (will trigger a restart)
    $ sudo apt install ./koha-common-git+deadbeef.deb

5/ check that memcache is started, and has new PID (52900)
    $ sudo systemctl status  memcached | grep PID
        Main PID: 52900 (memcached)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1fa096e7a03ad7d42ca5f4de12d873ea1b8a4bce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35004: Set row.quantity_received to 1 if row.quantity_received is empty and we...
Slava Shishkin [Fri, 6 Oct 2023 16:25:30 +0000 (19:25 +0300)]
Bug 35004: Set row.quantity_received to 1 if row.quantity_received is empty and we're in 'cataloguing' mode

Before the code changes only field value was set to 1,
but "row.quantity_received" still had an undefined value.
After correction row.quantity_received set to 1 if it is empty,
but only when effective_create_items == 'cataloguing',
and after that its value assigned to the form field.

To test:
1. Add a new basket.
2. Create an order line
3. Receive shipment and create an invoice
4. Start receiving your order:
    Verify:
    - Quantity ordered: X
    - Quantity received: 1 (pre-filled, don't touch or change it)
5. Click "Confirm"
6. Observe the Receive error popup: "Order ZZZ: No quantity to receive
   set. No items will be created."
7. Verify that "Order receive" was not happen (received orders remains
   empty)
8. Apply the patch and make sure your order is received correctly after
   step 5.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9110547de098264e2574e27f35859674f1ed18a2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35073: perltidy subscription-batchedit.pl
Pedro Amorim [Tue, 17 Oct 2023 09:24:09 +0000 (09:24 +0000)]
Bug 35073: perltidy subscription-batchedit.pl

git show -w <this_patch_hash>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ffb5022591f6b96c50bf8a9c0409bd01b108a65c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35073: Default to existing value if there is one
Pedro Amorim [Tue, 17 Oct 2023 09:20:59 +0000 (09:20 +0000)]
Bug 35073: Default to existing value if there is one

For values that dont exist in the batch edit submission, i.e. UI says 'No change', we default to existing value if there is one.

Test plan:
Preparation - Additional fields:
1) Add a new 'additional field', visit:
/cgi-bin/koha/admin/additional-fields.pl
2) Click 'subscription' and '+ New field'. Enter a 'name' and hit 'save'.

Serials:
1) Add a new serial, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Put a biblionumber in the 'record' field, i.e. '112'. Press 'next' and click 'ok' on the alert box
3) Fill all the required fields and click 'test prediction'
4) Input something in the additional field created previously.
5) Click 'save subscription'. Notice the additional field is as expected.
6) Repeat steps 1-5 to create a second serial.

Batch edit:
1) Visit serials and hit the 'Search' button:
/cgi-bin/koha/serials/serials-home.pl
2) Click the 2 checkboxes for the 2 serials we created previously and click the new link that pops up 'edit selected serials'.
3) Click 'Save' without changing anything.
4) Go back to either of the serials, notice the value for the additional field is unchanged. Visit:
/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=1

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7294908de35a46f491af4e170fb9f6294a5fb4bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35073: Rename additional_fields to available_additional_fields
Pedro Amorim [Tue, 17 Oct 2023 09:18:29 +0000 (09:18 +0000)]
Bug 35073: Rename additional_fields to available_additional_fields

'additional_fields' is ambiguous and in other places we name this available_additional_fields instead. Do the same here.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 05d131febf2d98d1c0ec18da845589dcd80a5e8d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35185: Remove is_html flag from sample notices that are plain text
Katrin Fischer [Sun, 29 Oct 2023 15:20:03 +0000 (15:20 +0000)]
Bug 35185: Remove is_html flag from sample notices that are plain text

Some notices had the is_html flag for new installations, but actually
didn't include any HTML formatting. These should be plain text
to have the line breaks behave as expected.

This updates:
* 2FA_OTP_TOKEN
* OPAC_REG_VERIFY

We cannot do a database update here, as libraries will
have changed and updated these. So this is only for new
installations.

To test:
* Apply patch
* reset_all (create a new sample database)
* Verify that the HTML checkbox is not set for these notices
* Verify they appear as plain text notices, not including HTML tags

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>
(cherry picked from commit c6284eed812eb4de52738e845b662e199f58fd1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 24480: (follow-up) Adjust tests
Nick Clemens [Fri, 15 Sep 2023 20:06:41 +0000 (20:06 +0000)]
Bug 24480: (follow-up) Adjust tests

With the way the patchset alters to use insert_fields_ordered, we now add fields to the beginning of their number group as opposed to appending before. We just need ot shift the order we expect the fields to end up in to make the tests pass

To test:
1 - Apply all patches except this
2 - prove -v t/SimpleMARC.t t/db_dependent/MarcModificationTemplates.t
3 - It fails
4 - Apply this
5 - prove -v t/SimpleMARC.t t/db_dependent/MarcModificationTemplates.t
6 - It passes

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eeffa57eab1a693fe8c91990a987e12b61962e80)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 24480: (follow-up) Shift new fields into array and add after all are copied
Nick Clemens [Fri, 15 Sep 2023 19:59:57 +0000 (19:59 +0000)]
Bug 24480: (follow-up) Shift new fields into array and add after all are copied

The updated code removed the pushing of fields to an array - this caused a bug.
When multiple fields were copied and replaced and there were more fields added than existed originally we were adding the new field to the end, then removing the first occurence of the original field. If we tried to move 2 650 fields to 651 and the record had no 651 we would:
- Delete the first 651, there were none, so nothing happened
- Take the first 650, add it to the end of the 651 group (there were none, so it became the first 651)
- Delete the first 651, which was the field we just copied
- Take the second 650 and add it to the end of the 651 group (whihc had none, because we deleted it)

I re-add the line, but do as suggesed by Phil and reverse the order (unshift vs push)

To test:
1 - Apply other patches
2 - prove -v t/SimpleMARC.t
3 - It fails
4 - Apply this patch
5 - prove -v t/SimpleMARC.t
6 - It still fails, but more tests pass (there's another patch to follow)

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 498f0dfeccacb38fbc0b3ccbc6c47e769f7f8518)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 24480: Unit test
Arthur Suzuki [Sat, 25 Jan 2020 22:19:52 +0000 (23:19 +0100)]
Bug 24480: Unit test

This updates the SimpleMARC tests and MarcModificationTemplates
tests to expect the new order of fields

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 48fd8d1900f23d33c2e7aa5f3a9f10c21cafdb54)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 24480: Fix insert_fields_ordered instead of append_fields in SimpleMARC
Arthur Suzuki [Fri, 17 Jan 2020 09:26:58 +0000 (10:26 +0100)]
Bug 24480: Fix insert_fields_ordered instead of append_fields in SimpleMARC

Test plan :
 - create a marc modification template which add a new field to a record
 - apply that template to some records
 - verify that the new field is always appended at the bottom of the record, even if some fields are higher.
 - apply patch
 - apply template to another set of records
 - verify the added field is now ordered within the already existing fields in the records

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d3112dc3191a82e6cc6072394bd8d6035f66e15c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35079: Replace --force-extract by --generate-pot={always,auto,never}
Julian Maurice [Tue, 17 Oct 2023 15:13:55 +0000 (17:13 +0200)]
Bug 35079: Replace --force-extract by --generate-pot={always,auto,never}

This restores the original behaviour of always building the POT file
in order to not break existing workflows
Option --force-extract is deleted in favor of a new option
--generate-pot that can have 3 values:

* always: always build the POT file. This is the default value
* auto: build the POT file only if it does not exist
* never: never build the POT file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 months agoBug 35079: Rebuild POT files only if necessary or asked explicitely
Julian Maurice [Tue, 17 Oct 2023 14:33:37 +0000 (16:33 +0200)]
Bug 35079: Rebuild POT files only if necessary or asked explicitely

By default, gulp tasks po:create and po:update won't rebuild the POT
files if they already exist.
Both tasks gained a new option --force-extract to rebuild them
unconditionally

This makes it possible to create/update PO files for multiple languages
sequentially without rebuilding the POT file for each language.
For instance:

    gulp po:update --lang fr-FR
    # do something with the PO files
    gulp po:update --lang en-GB
    # ...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
7 months agoBug 35043: Do not have \n or \t appear in PO files
Jonathan Druart [Thu, 12 Oct 2023 10:35:12 +0000 (12:35 +0200)]
Bug 35043: Do not have \n or \t appear in PO files

This is a trick, so that we won't have to deal with \t in PO files.
\n is not a problem, but it seems consistent to use the same method for
both.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
7 months agoBug 35043: Use Locale::PO->quote
Jonathan Druart [Thu, 12 Oct 2023 09:44:16 +0000 (11:44 +0200)]
Bug 35043: Use Locale::PO->quote

We have our own "quote_po" sub that is stating that Locale::PO::quote
is buggy because it does not deal with quoting new lines correctly.
However it seems that it is fixed now.

Ideally we could use Locale::PO::quote everywhere, but it does not
escape tab characters:
  $string =~ s/\\(?!t)/\\\\/g;           # \t is a tab

This means the following:
msgid "Tabulation (\\t)"
msgstr "Tabulation (\\t)"
become:
-msgid "Tabulation (\t)"
-msgstr "Tabulation (\t)"

And we are seeing the following on Weblate:
https://snipboard.io/BjQmDC.jpg

Note that Locale::PO has not been updated since 2014...

The real problem behind this is that we have 2 methods to quote strings.
At first glance it seems that Locale::PO::quote was not used before, but
with the introduction of the koha-i18n project we will have scripts that
will use Locale::PO->save_file_fromarray, which uses Locale::PO->quote
=> Those scripts will be used on the translation server for post
processing (security reason, marking potential XSS strings as fuzzy).

Test plan:
0. Do not apply the patch
1. gulp po:update --lang LANG # Replace LANG with your favorite language
   code
2. git commit -a -m"init PO files"
3. Apply this patch
4. Repeate 1.
5. git diff
   => The change is about the "Tabulation" and "New line" strings from
      tools/csv-profiles.tt
6. Translate them (replace the \t and \n with %s) and remove the fuzzy
   flag
7. install the template: cd misc/translator && perl translate install
   LANG
8. Enable the language, use it and go to the "Nouveau profil CSV" view
   => Notice that the \t and \n are correctly displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
7 months agoBug 35024: Do not wrap translations
Jonathan Druart [Wed, 11 Oct 2023 09:35:41 +0000 (11:35 +0200)]
Bug 35024: Do not wrap translations

PO files wrap differently depending on versions.

Looks like (thanks Julian!) it's coming from libunistring, between 0.9.10 and 1.0 I am seeing a change in how the strings in the PO files are wrapped.

Debian 11 (using libunistring 0.9):
"%s %sPrintemps%s %s %sÉté%s %s %sAutomne%s %s %sHiver%s %s %sPrtps%s %s %sÉté"
"%s %s %sAut%s %s %sHiv%s %s %s %s"

Debian 12, Ubuntu 22.04(using libunistring 1.0)
"%s %sPrintemps%s %s %sÉté%s %s %sAutomne%s %s %sHiver%s %s %sPrtps%s %s "
"%sÉté%s %s %sAut%s %s %sHiv%s %s %s %s"

It *could* come from this changes:
https://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=blob;f=NEWS;h=5a43ddd7011d62a952733f6c0b7ad52aa4f385c7;hb=HEAD
   * The functions u*_possible_linebreaks and u*_width_linebreaks now make it
     easier to work with strings that contain CR-LF sequences: In this case,
     in the returned array, it will return UC_BREAK_CR_BEFORE_LF followed by
     UC_BREAK_MANDATORY (instead of twice UC_BREAK_MANDATORY).

The command used is:
% msgmerge --backup=off --quiet -F --update misc/translator/po/fr-FR-staff-prog.po misc/translator/Koha-staff-prog.pot

No matter the value of --width.

One solution is to use --no-wrap, and never wrap :)

I sent an email to the list about this suggestion https://lists.katipo.co.nz/pipermail/koha/2023-October/060143.html

Test plan:
% gulp po:update --lang LANG

And notice that the lines are no wrapped anymore.

Note that in master there were already not wrapped (?)
commit edd378f4d14d79107d662b053c8e6f750326dd23
Translation updates for Koha 23.05.00

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
7 months agoBug 34959: Sort PO files correctly
Jonathan Druart [Fri, 6 Oct 2023 14:48:57 +0000 (16:48 +0200)]
Bug 34959: Sort PO files correctly

The PO files are not sorted when we update them which leads to
unnecessary changes that are commited: hard to see differences and
make git index grow superfluously.

Test plan:
0. Do not apply this patch
1. gulp po:update --lang es-ES
2. git commit -a -m"First PO update"
3. Run again the gulp update command
4. git diff
=> You have a lot of changes generated here, the po:update is not
idempotent.

5. Apply this patch
6. Run the gulp update command
7 git commit -a -m"PO update after 34959"
8. Run the gulp update command
9. git diff
=> No changes are generated

Note that this patch will all the entries by files, and per line
numbers.
It fixes a bug in some condition, where we add information/context about
the string. For instance search for "For the first occurrence" in the
file. Prior to this patch this was not correct, we didn't add info about
the first occurrence (but whichever in the list).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 months agoBug 34959: Remove unused sub
Jonathan Druart [Fri, 6 Oct 2023 15:17:51 +0000 (17:17 +0200)]
Bug 34959: Remove unused sub

Nothing special here, this sub is not used and we can remove it.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 months agoBug 35171: (QA follow-up): tidy up POD
Victor Grousset/tuxayo [Mon, 30 Oct 2023 19:58:21 +0000 (20:58 +0100)]
Bug 35171: (QA follow-up): tidy up POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1e53f48efecfdd05db6acc31083ee2590f278f1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35171: Add send_empty option to runreport
Nick Clemens [Thu, 26 Oct 2023 18:03:40 +0000 (18:03 +0000)]
Bug 35171: Add send_empty option to runreport

This patch adds a new 'send_empty' option to runreport.pl

To test:
1 - Create a report in Koha that will not return any results:
    SELECT barcode FROM items WHERE 1=2
2 - perl misc/cronjobs/runreport.pl 1
3 - Output is: NO OUTPUT: 0 results from execute_query
4 - perl misc/cronjobs/runreport.pl 1 --send_empty
5 - Output is: no results were returned for the report
6 - perl misc/cronjobs/runreport.pl 1 --send_empty --email
7 - It will die on an email error unless you have SMTP configured - this si good, it means we sent an email
8 - Bonus points: Test on a system that can correctly send emails, confirm it works :-)

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>
(cherry picked from commit 4bfd1e21c6ff2415c8e36ec2e376ca1c1330fbb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34008: Harmonize attribute names
Tomas Cohen Arazi [Mon, 30 Oct 2023 16:14:16 +0000 (13:14 -0300)]
Bug 34008: Harmonize attribute names

This patch harmonizes the attribute names with what is used for `items`
and `checkouts` in terms of terminology.

It also adapts the tests so they are less random failure-prone (they had
a fixed value for the item type, which might make things explode if the
chosen value already exists on the DB.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 78589dbe6ecf1a4126b0420894a732bd58a9752a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34008: (QA follow-up) 'item_type_id' should be used
Tomas Cohen Arazi [Mon, 30 Oct 2023 14:08:15 +0000 (11:08 -0300)]
Bug 34008: (QA follow-up) 'item_type_id' should be used

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 05f0604d609c180070207f5608b256639e2e2ccb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34008: Add REST endpoint for list of itemtypes
Andreas Jonsson [Sat, 16 Sep 2023 10:13:15 +0000 (10:13 +0000)]
Bug 34008: Add REST endpoint for list of itemtypes

Test plan:
* Enable the system preference RESTBasicAuth
* curl -s --request GET http://kohadev-intra.mydnsname.org:8081/api/v1/itemtypes
  should give 401 Unauthorized
* curl -s -u koha:koha --request GET http://kohadev-intra.mydnsname.org:8081/api/v1/itemtypes
  should produce JSON-list of itemtypes
* curl -s -u koha:koha --header "x-koha-embed: translated_descriptions" --request GET http://kohadev-intra.mydnsname.org:8081/api/v1/itemtypes
  should include the field translated_descriptions containing the translated descriptions, if any

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] perltidy -b t/db_dependent/api/v1/itemtypes.t # Resolve bad score of 44
[EDIT] chmod 755 t/db_dependent/api/v1/itemtypes.t
[EDIT] perltidy -b Koha/REST/V1/ItemTypes.pm
Lesson: Please run qa tools yourself and adjust accordingly?
Edit (tcohen): I restored the item_type_translated_description.yaml file
as the entire API was broken because of the lack of it.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82bdf93ab71f4d16ced622667ef89bafb5008d1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35033: (QA follow-up): tidy up code
Victor Grousset/tuxayo [Mon, 30 Oct 2023 17:58:09 +0000 (18:58 +0100)]
Bug 35033: (QA follow-up): tidy up code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0a8303c9fac42e16d4ff5c13dd700789d4a438c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35033: Add a validation for biblioitems in about/system information
Blou [Wed, 11 Oct 2023 15:57:28 +0000 (11:57 -0400)]
Bug 35033: Add a validation for biblioitems in about/system information

In the About section, under the System information tab, we get validation between
issues, borrowers, biblio, items, reserves tables, and their deleted/old counterpart.

But there's no validation for biblioitems.

This patch will simply add the same test (and display) as the others, but for biblioitems.

Testing
0) Create a simple biblio entry through cataloguing. Note the biblioitemnumber created.
1) Insert a dummy entry in deletedbiblioitem using the biblioitemnumber.  An simple SQL will do
insert into deletedbiblioitems select * from biblioitems where biblioitemnumber = GIVENbin;
2) Go to about, see there's no warning in systeminformation.
3) apply the patch, validate that an error appears.

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>
(cherry picked from commit 07ac0b1f72245de6e8ecf2a1a9d2e485ca233f79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 34424: Add Emily Lamancusa to QA Team
Katrin Fischer [Sun, 29 Oct 2023 14:36:38 +0000 (14:36 +0000)]
Bug 34424: Add Emily Lamancusa to QA Team

Long overdue.

To test:
* Apply patch
* Verify that Emily shows as part on the QA Team
  on the About page

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e42d5c6e6f5a8d5c958a3dad5583490a550ce862)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35180: DBIC schema
Tomas Cohen Arazi [Wed, 1 Nov 2023 18:26:00 +0000 (15:26 -0300)]
Bug 35180: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3f1e21bbca753168e194f0d4f23f9c84ebadeeaf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 months agoBug 35180: Fix 246 to 264 in COMMENT of deletedbiblioitems.publishercode
Katrin Fischer [Sun, 29 Oct 2023 09:31:06 +0000 (09:31 +0000)]
Bug 35180: Fix 246 to 264 in COMMENT of deletedbiblioitems.publishercode

This fixes a typo in the comment.

To test:
* Please check diff of the patch closely.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f5d0667f5a1eb6898c14a5cefddfe9c21609762d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>