]> git.koha-community.org Git - koha.git/log
koha.git
5 months agoBug 36827: Fix tab formatting
Matt Blenkinsop [Fri, 10 May 2024 13:13:20 +0000 (13:13 +0000)]
Bug 36827: Fix tab formatting

This patch removes unwanted whitespace between the tabs and the tab content

Test plan:
1) Enable the ERM module and navigate to the eUsage > Reports sections
2) Observe the whitespace between the tabs and the content
3) Apply patch and run yarn build
4) Hard refresh the page, the whitespace should be gone

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 11cdeb0889ecd4b2827690a6e7df45c912f2a9e1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36828: Remove commented out code
Matt Blenkinsop [Fri, 10 May 2024 13:18:45 +0000 (13:18 +0000)]
Bug 36828: Remove commented out code

Test plan:
1) Look at the patch diff and observe that the commented out code has been removed

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f3af09c78cbec3e091164e71f74c97bcb90f9978)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36370: Add ContentWarningField to UNIMARC XSLT
Fridolin Somers [Wed, 20 Mar 2024 15:04:14 +0000 (16:04 +0100)]
Bug 36370: Add ContentWarningField to UNIMARC XSLT

Bug 31123 added new feature with preference ContentWarningField.
Add this behavior to UNMARC XSLT files.

This patch adds new template 'tag_content_warning' in UNIMARCslimUtils.xsl
called in results and details pages.

New field is placed after 3xx.

Test plan (in both interfaces OPAC and staff):
1) Create a new field 599 in framework
2) Set system preference ContentWarningField to 599
3) Edit a record to add a 599 with text in $a$b and an URL in $u
4) Perform a search to find this record
=> Check you see content_warning: <a href="$u">$a</a> $b
5) Click on details page
=> Check you see content_warning: <a href="$u">$a</a> $b

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 274c0bee86be52c9c66c0df3fccdd45c0c271977)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36794: Illegitimate modification of biblionumber subfield content (999 $c)
Janusz Kaczmarek [Mon, 6 May 2024 13:24:10 +0000 (13:24 +0000)]
Bug 36794: Illegitimate modification of biblionumber subfield content (999 $c)

It happens that librarians, by mistake, open a biblio editor putting in the
URL, by hand, the biblionumber prefixed with a blank (e.g.
.../addbiblio.pl?biblionumber= 123 -- mind the space before 123).
In such a case the editor opens with the right biblio record (i.e. 123)
but, after saving the record, the content of the biblionumber MARC
field (999 $c for a standard MARC 21 installation) results modified and
contains additional initial blanks.

Moreover, while using ES and making a search for the record (with title,
author etc.) we get two records on the result list (instead of one).

This is because in the addbiblio.pl script $biblionumber is taken (and
continuously used) directly from CGI parameter, without any
validation and/or correction.

Test plan:
==========
0. Have a test installation with ES.
1. Open a biblio record in the editor with an added space before
   biblionumber value, e.g.:
   http://ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber= 123
   Save the record.
2. From the Normal view choose Save -> MARCXML.  Open the saved file in
   your favourite editor.  You should see, at the end, something like:
   <datafield tag="999" ind1=" " ind2=" ">
     <subfield code="c"> 123</subfield>
   (mind the space before 123).
   This is not right.
3. Make a search with the title or author's name from the record (e.g.
   Henning Mankell for the record 123 from the default ktd data set).
   You should get two records instead of one (while using ES).
4. Apply the patch, restart_all.  Repeat p. 1 and 2 with a different
   biblionumber.  Notice the unchanged (i.e. without spaces) value
   of 999 $c subfield in the exported record and only one record
   as a result of a search.

WNC amended patch - rebased, added conditional in case no bib, moved comments to their own lines

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c74169ba27c2e12473239b15358e428bc05da9f5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36799: Illegitimate modification of MARC authid field content (001)
Janusz Kaczmarek [Tue, 7 May 2024 09:13:54 +0000 (09:13 +0000)]
Bug 36799: Illegitimate modification of MARC authid field content (001)

It happens that librarians to save time open an authority editor by putting
in the URL, by hand, the authid prefixed, by mistake, with a blank (e.g.
.../authorities.pl?authid= 100 -- mind the space before 100).  In
such a case the editor opens with the right auth record (i.e. 100) but,
after saving the record, the content of the authid MARC field (001 for
a standard MARC 21 installation) results modified and contains
additional initial blanks.

Moreover, if the heading (1XX field) was modified in the authority record
during such an edit, the changes will not propagate to the linked
bibliographic records.  And won't in the future.

This is because in the authorities.pl script $authid is taken (and
continuously used) directly from CGI parameter, without any
validation and/or correction (line 540 in the current main branch).

Test plan:
==========
1. Open an auth record in the editor with an added space before
   authid value, e.g.:
   http://ktd:8081/cgi-bin/koha/authorities/detail.pl?authid= 100
   Modify the heading field -- in the ktd data set:
       150 Computerized typesetting
   Save the record.
2. a) Open the record for editing again--see the space added before
   the authid in field 001.  Close the editor (with Cancel).
   b) Try to go to the linked biblio records with Used in X records.
   Note no results, if using ES.
   c) Remove the space before authid (after an:) in the URL.
   Go to the linked biblio records.  See that the content of
   the field controlled by the modified auth record did not
   update.
3. Apply the patch; restart_all.
4. Repeat p. 1 and 2 with a different authid.  Everything should
   be OK now.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4b66fbc4ebc0fe706f9a9b9057a19ee0c1b13aa3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 33849: Do not reset new patrons home library when error occurs
Emmi Takkinen [Thu, 4 Apr 2024 06:04:47 +0000 (09:04 +0300)]
Bug 33849: Do not reset new patrons home library when error occurs

While adding new patron, if patron is flagged as duplicate
or another error occurs and their home library differs from
library user is logged in, patrons home library resets as
logged in users library. This happens with all patrons
expect those with category type C. This patch removes checking
if patrons category type is C from code so that all category
types use previously chosen home library even if error occurs.

To test:
1. Add new patron and set their library to a different
library than the one you're logged in.
2. Cause an error (wrong age, duplicate etc) while saving.
3. Attempt to save.
=> Note that patrons home library is set as one you're
logged in.
4. Apply this patch.
5. Repeat steps 1 to 3.
=> Note that patrons home library hasn't changed.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d2f41df188c3d8e8d8705c6a5ceb583e3e29e629)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35149: DBRev 23.11.05.007
Katrin Fischer [Mon, 13 May 2024 08:33:50 +0000 (08:33 +0000)]
Bug 35149: DBRev 23.11.05.007

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2b3ad46f979d0ba2e5c0ea2e128597e9c8bf153e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35149: Change CircAutoPrintQuickSlip syspref explanation
David Gustafsson [Wed, 21 Feb 2024 19:03:42 +0000 (20:03 +0100)]
Bug 35149: Change CircAutoPrintQuickSlip syspref explanation

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 42d95f362a89c9c2236220f6b961b1748792087f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35149: Add Option to ignore submit of checkout field when empty
Stefan Berndtsson [Mon, 25 Sep 2023 12:05:06 +0000 (14:05 +0200)]
Bug 35149: Add Option to ignore submit of checkout field when empty

1) Apply patch
2) Set CircAutoPrintQuickSlip to "do nothing"
3) Go to the checkouts form for a specific patron
4) Submit the form with empty value
5) Verify that no action is taken and you stay on the current page

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3d030ded6bc3d60b6a6e0ca8c6c648b5bb167e0e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36797: Change WHILE loop into FOREACH
Lucas Gass [Tue, 7 May 2024 16:03:54 +0000 (16:03 +0000)]
Bug 36797: Change WHILE loop into FOREACH

To test:
1. Find a record that has 1000 non-waiting holds with different priorities.
2. Try loading the reserve page for that record ( /reserve/request.pl?biblionumber=X )
3. Error: Template process failed: undef error - WHILE loop terminated (> 1000 iterations)
4. APPLY PATCH
5. Try again, this time the page should load.
6. Try testing on a record with less than 1000 holds, making sure the priorities are still set right.
7. Make sure you can change your priorities and everything works right.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5cc42c162c51aa3624f5e46e2ad6c70dd5ee6f01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35927: Selecting MARC framework again doesn't work when adding to basket from...
Fridolin Somers [Mon, 29 Jan 2024 09:08:00 +0000 (10:08 +0100)]
Bug 35927: Selecting MARC framework again doesn't work when adding to basket from an external source

Like Bug 19372, selecting MARC framework currently doesn't work when adding to basket from an external source.
Strangly I can reproduce on koha-testing-docker, but we have this issue with a Ubuntu Focal install.
Looks like it comes from a bad syntaxe than needs to be replaced in any case.

Test plan:
1) Add an order to a basket from an external source
2) Select another framework than the default one on the search result
   view. Before doing 'add order' on choosen search result line.
3) Chek the framework code you will pick will be used in the created biblio record

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b7a5cc5beeb4af7cd23a414519c038f007f5b959)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36335: Fix ILS-DI GetRecords bad encoding for UNIMARC
Fridolin Somers [Fri, 15 Mar 2024 15:02:11 +0000 (16:02 +0100)]
Bug 36335: Fix ILS-DI GetRecords bad encoding for UNIMARC

ILS-DI GetRecords generates bad encoding of MARCXML for UNIMARC, like OAI in Bug 34467

Enable ILS-DI and display a record with :
<opac url>/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=<biblionumber>

Well-known issue, fixed
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5406aaedfa86aa97ed06019f4862bff285a4aad2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34041: (follow-up) escape double dashes to prevent issues
Tomas Cohen Arazi [Fri, 10 May 2024 12:30:53 +0000 (09:30 -0300)]
Bug 34041: (follow-up) escape double dashes to prevent issues

Having double dashes inside a commmented block is not valid XML. This
patch restores it, with an added message explaining it

To test:
1. Run:
   $ xmllint etc/z3950/config.xml
=> FAIL: You get:
etc/z3950/config.xml:5: parser error : Double hyphen within comment: <!--
  <config>
      <z3950_responder_options>
      <z3950_responder_options>--add-item-status k -t 5</z3950_responder_options
2. Apply this patch
3. Repeat 1
=> SUCCESS: All good!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 11c69496bcd216ad264acd87409e5160c73995bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34041: z3950 responder additional options not coming through properly
Liz Rea [Fri, 16 Jun 2023 17:50:35 +0000 (12:50 -0500)]
Bug 34041: z3950 responder additional options not coming through properly

This patch adds the <config> node that the z3950 responder starter script is looking for in the z3950/config.xml to the example code.

To test:
 - verify that the <config> </config> is around the commented z3950_additional_options suggestion in the etc/z3950/config.xml file
 - copy the config stanza to the live file: /etc/koha/sites/kohadev/z3950/config.xml
 - restart_all
 - ps aux | grep z3950
 - confirm the script has restarted
 - confirm the options: --add-item-status k -t 5 have been passed through

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3878dbe9994186d70b3eb94e5096d4d1c6cf5452)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36486: Fix file perms and tidiness
Julian Maurice [Fri, 10 May 2024 08:29:13 +0000 (10:29 +0200)]
Bug 36486: Fix file perms and tidiness

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8d24f3e80eaeb615e1c143a2c3559ef9bdf787f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36486: Add tests for Koha::DateTime::Format::SQL
Julian Maurice [Tue, 2 Apr 2024 07:34:25 +0000 (09:34 +0200)]
Bug 36486: Add tests for Koha::DateTime::Format::SQL

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e6382d04ada91640ca1c5224df8e1beb0c929bc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36380: Add filter value on patron statistics report summary
Thibaud Guillot [Thu, 21 Mar 2024 08:25:08 +0000 (09:25 +0100)]
Bug 36380: Add filter value on patron statistics report summary

Test plan:
1) Go to reports and select "Patrons"
2) Select some filters (patron category, library,..) and run it
3) Normally you will see filters selected but with blank value like
   "branch code = "
4) Apply this patch
5) Refresh

Sponsored by: BibLibre

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e75e59d8561f247f2f58c514f7dbe50d40d9fe01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36676: SIP2 drops connection on unknown patron id in fee paid message
Jan Kissig [Tue, 23 Apr 2024 18:19:05 +0000 (20:19 +0200)]
Bug 36676: SIP2 drops connection on unknown patron id in fee paid message

When sending a fee paid message to SIP2 with an unknown patron id it will respond with an empty response followed by dropping the connection to a client.

Test plan:
a) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1   -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01
Output:
Trying 'fee_paid'
SEND: 3720240423    124447FT00USDBV0.01|AO|AA2352900100046|ACterm1|
Use of uninitialized value $data in concatenation (.) or string at /usr/share/koha/bin/sip_cli_emulator.pl line 355, <GEN0> chunk 1.
READ:

b) apply patch
c) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1   -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01
Output:
Trying 'fee_paid'
SEND: 3720240423    125602FT00USDBV0.01|AO|AA2352900100046|ACterm1|
READ: 38N20240423    125602AO|AA2352900100046|AFInvalid patron barcode.|

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d59e148879c0495f5071998d4521875e9c9022ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36388: Mouse operation does not work in draggable fields in authority editor
Janusz Kaczmarek [Thu, 21 Mar 2024 15:20:24 +0000 (16:20 +0100)]
Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6e09fb6ad8eaab2e219c01cc332b404ad89088c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 27363: Restore temporary selection of Z39.50 targets throughout multiple searches
Phil Ringnalda [Thu, 2 May 2024 23:19:17 +0000 (16:19 -0700)]
Bug 27363: Restore temporary selection of Z39.50 targets throughout multiple searches

The advanced editor currently saves which Z39.50 servers are selected
in local storage using the index in the sorted array of servers, and
then misreads them back as though they were server_ids. We want them to
be server_ids, since that's immutable and the index can change with
changes in rank or server name.

We use the data-server-id property in the HTML more often as a server_id
than as the index that's currently stored there, so this patches
switches it back to be the server_id, and in the one place we would use
the index, instead uses Array.find to just get the server object instead
of referencing it by index.

Test plan:
 1. Set the preference EnableAdvancedCatalogingEditor to enable
 2. Administration - Z39.50 Servers, for NATIONAL LIBRARY OF FRANCE
    uncheck "Preselected"
 3. To be sure you don't have confusing saved preferences, open
    Firefox's Developer Tools, in the Storage tab open Local Storage and
    select your URL
 4. In the row for cateditor_preferences_{your Koha user id}, if there
    are any values for selected_search_targets, delete them so you
    have "selected_search_targets":{}
 5. Open the advanced editor, and click "Advanced »" in the search box
 6. You should have Local catalog unchecked, LIBRARY OF CONGRESS checked
    because it is preselected, and NATIONAL LIBRARY OF FRANCE unchecked
 7. Toggle each checkbox so Local catalog and France are selected, and
    LoC is unselected.
 8. In a new broser tab, open the advanced editor, and click "Advanced »"
 9. You will see Local catalog unchecked, LoC checked, and France
    unchecked.
    That's the bug.
10. Apply patch, open the advanced editor in a new tab, click "Advanced »"
11. Toggle the checkboxes so Local catalog and France are selected, and
    LoC is not selected.
12. Open the advanced editor in another new tab, click "Advanced »"
13. You should see what you just set, Local catalog and France checked,
    and LoC unchecked, That's the correct behavior.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a8f4fe946cbafd46621a7a94812580ce0104fe7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36804: Fix clear filter
Pedro Amorim [Tue, 7 May 2024 15:46:23 +0000 (15:46 +0000)]
Bug 36804: Fix clear filter

1) Visit serials and click "New subscription":
http://localhost:8081/cgi-bin/koha/serials/serials-home.pl
2) Enter '112' on the record input and '1' on the vendor input. Click "Next"
3) 'First issue publication date' -> Enter some date in the past
4) 'Frequency' -> Enter '2/day'
5) 'Subscription start date' Same as step 3)
6) 'Subscription end date' Some date in the future
7) 'Numbering pattern' -> Enter 'Number'
8) Click 'Test prediction pattern'. Click 'Save subscription'
9) On the left side menu -> Click "Serial collection". Click the yellow button 'Edit serials'
10) On the first serial, edit the status to 'Late'. Save.
11) Visit serials claims:
http://localhost:8081/cgi-bin/koha/serials/claims.pl?supplierid=1
12) Input some dates in "From" and "To"
13) Click 'Clear filter'. Notice it doesn't work.
14) Apply patch. Repeat.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e6b778b5d49cffcb33ccfa30542c4271d35e60e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36774: Add cypress tests
Pedro Amorim [Wed, 8 May 2024 15:26:52 +0000 (15:26 +0000)]
Bug 36774: Add cypress tests

Inside k-t-d, run:
cypress run --spec t/cypress/integration/flatpickr_spec.ts

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 46c5a51d58565f2773a9438c195711c0156b866c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36774: Remove wrapper if already exists
Pedro Amorim [Fri, 3 May 2024 14:07:25 +0000 (14:07 +0000)]
Bug 36774: Remove wrapper if already exists

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c6e2995d278df289065a32f19af7ca9b9226d3ea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34360: Get distinct biblionumber
Nick Clemens [Thu, 11 Jan 2024 11:53:42 +0000 (11:53 +0000)]
Bug 34360: Get distinct biblionumber

This fixes the problem noted in the bug:
[WARN] DBIx::Class::ResultSetColumn::new(): Attempting to retrieve non-unique column 'biblionumber' on a resultset containing one-to-many joins will return duplicate results. at /usr/share/koha/Koha/Objects.pm line 421

We are taking a list of items, assuming the scenario is that these are from a single biblio and possibly some host_items, then searching and ordering conditionally on whether the biblio is a serial.

Current code gets the first biblio from the list - this patch adds a 'DISTINCT' to the results ebfore fetching the column

To test:
1 - Find a biblio in the staff interface
2 - Transfer one of the items a few times
3 - Recreate the issue on the command line:
    export DBIC_TRACE=1
    perl -e 'use Koha::Items; my $items = Koha::Items->search({biblionumber=>9})->search_ordered(undef,{ prefetch => ['issue','current_branchtransfers'] }); $items->next'
4 - Note warning:
    DBIx::Class::ResultSetColumn::new(): Attempting to retrieve non-unique column 'biblionumber' on a resultset containing one-to-many joins will return duplicate results. at /kohadevbox/koha/Koha/Objects.pm line 426
5 - Apply patch
6 - Repeat 3
7 - Error is gone

Signed-off-by: baptiste <baptiste.bayche@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b5388933b64b78ce22b058dd1e5b96e1c0ec78a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36534: Batch operations when using limit in report
Katariina Pohto [Thu, 2 May 2024 11:27:06 +0000 (14:27 +0300)]
Bug 36534: Batch operations when using limit in report

When report results number exceeds the result per page limit, batch
operations link reads "Batch operations with (page limit) records" even
if there are more or less shown records (more when using limit in SQL or
less in the last page of result). This patch fixes the link text to
actual shown records.

To test:
1) Create a report of items with a limit of e.g., 26.
2) Run report.
3) See that number of results shown exceeds 20 but the link says "Batch
   operations with 20 visible records".
4) See that the second page shows 6 results but the link is still for 20
   records.
5) Apply patch.
6) Run report again.
7) See that the link texts will show correctly 26 records on the first
   page and 6 records on the second.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e9356afd9f7e8ee16165341b8009282ff9ab3ff3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36687: (RM follow-up) Fix more unit tests
Martin Renvoize [Thu, 9 May 2024 07:58:46 +0000 (08:58 +0100)]
Bug 36687: (RM follow-up) Fix more unit tests

Use currency.active to test `int(1) DEFAULT NULL` now that itemtypes.notforloan
is `NOT NULL DEFAULT '0'`

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 26e7ed29af9ce233066d980136ee10ca0c5b8609)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36687: (RM follow-up) Fix unit tests
Martin Renvoize [Thu, 9 May 2024 07:40:18 +0000 (08:40 +0100)]
Bug 36687: (RM follow-up) Fix unit tests

Set notforloan to '0' as apposed to 'undef' for tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fba56f01781f407c4e6500a4305c1ef8cc1c7c22)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36687: DBIC schema update
Katrin Fischer [Wed, 8 May 2024 14:39:03 +0000 (14:39 +0000)]
Bug 36687: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 94e9bda510f2b8fe54845c7b55c6336a0ceed228)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36687: DBRev 23.11.05.006
Katrin Fischer [Wed, 8 May 2024 14:36:52 +0000 (14:36 +0000)]
Bug 36687: DBRev 23.11.05.006

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3f9551b0c63d160f96948fb94a8054154b210b7d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36687: Update itemtypes.notforloan to not allow NULL values and change to tinyint(1)
Lucas Gass [Wed, 24 Apr 2024 17:05:18 +0000 (17:05 +0000)]
Bug 36687: Update itemtypes.notforloan to not allow NULL values and change to tinyint(1)

To test:
1. Have some itemtypes.notforloan values set to NULL.
2. APPLY PACTH, updatedatabase, restart_all
3. When you updatedatabase those values should be set to 0.
4. Try updating an itemtypes.notforloan value to NULL. You cannot.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d267e2fe174506ed066b1810659bf9dcf87681b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36787: staticfines.pl add use Koha::DateUtils::output_pref
Fridolin Somers [Mon, 6 May 2024 10:08:02 +0000 (12:08 +0200)]
Bug 36787: staticfines.pl add use Koha::DateUtils::output_pref

misc/cronjobs/staticfines.pl is calling output_pref() but it is missing from module import :
use Koha::DateUtils qw( dt_from_string );

Test but running staticfines.pl

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 18ac387e6a706019bc5a6c9fadf266eb2b4bf05d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36796: (follow-up) Fix column descriptions for the statistics table
David Nind [Tue, 7 May 2024 05:41:54 +0000 (05:41 +0000)]
Bug 36796: (follow-up) Fix column descriptions for the statistics table

This follow-up to bug 32312 fixes the descriptions for the statistics
database columns, used in guided reports.

It removes the duplicate statistics section in Koha/Database/Columns.pm
so that descriptions are displayed for all columns, as originally
intended.

It also adds a description for the interface column (a new column added
after the original patch was pushed).

Test plan:
1. Go to Reports > Guided reports > Create guided report.
2. Choose 'Circulation' for the module to report on and select
   'Next'.
3. Choose 'Tabular' for the type of report and select 'Next'.
4. Scroll down to the statistics table section and note that some
   columns have descriptions and some don't:
     Statistics date and time / statistics.datetime
     Library / statistics.branch
     Value / statistics.value
     Type / statistics.type
     Item number / statistics.itemnumber
     Item type / statistics.itemtype
     statistics.other
     statistics.location
     Borrower number / statistics.borrowernumber
     statistics.ccode
     statistics.categorycode
     statistics.interface
5. Apply the patch.
6. Restart all the things (restart_all).
7. Repeat steps 1 to 4.
8. Scroll down to the statistics table section again and note that all
   columns now have descriptions:
     Statistics date and time / statistics.datetime
     Library / statistics.branch
     Value / statistics.value
     Transaction type / statistics.type
     SIP mode / statistics.other
     Item number / statistics.itemnumber
     Koha item type / statistics.itemtype
     Shelving location / statistics.location
     Borrower number / statistics.borrowernumber
     Collection / statistics.ccode
     Patron category / statistics.categorycode
     Interface / statistics.interface
9. Sign off :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7cc445e95cc7ba5130fc0efbca863f858d4269ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 31981: (follow-up) Fix typo in class name
Katrin Fischer [Fri, 24 May 2024 13:53:36 +0000 (13:53 +0000)]
Bug 31981: (follow-up) Fix typo in class name

.debt_gaurantors > .debt_guarantors

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 003cfc71ce4bdb83015c2dfeecb13b7d095459c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36730: (Bug 35428 follow-up) po files (sometimes) fail to update
Janusz Kaczmarek [Tue, 30 Apr 2024 10:18:12 +0000 (10:18 +0000)]
Bug 36730: (Bug 35428 follow-up) po files (sometimes) fail to update

Under some circumstances (e.g. non-standard disk latency) po files fail
to be generated.  The output from the gulp po:update --lang xx-XX task
is than like this:

[10:01:39] 'po_update_staff' errored after 6.41 s
[10:01:39] Error: ENOENT: no such file or directory, open '/tmp/koha-5WCc9s/Koha-staff-prog.pot'

This is due to the time dependencies inside the function flush (callback)
(in the function xgettext) in gulpfile.js.  It happens that the
/tmp/koha-NNNNNN folder gets deleted before the asynchronous callback
function called by fs.readFile is completed.  The callback should copy
the content of the .pot file from /tmp/koha- to its final destination,
while, in parallel in fact, the folder inside /tmp is being removed.
This creates a race condition.

Test plan:
==========
Hard to reproduce.  But the race condition found in the code should
be obvious.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 67b3cbd438f0cee378cfa5236f2673ab6ea32f33)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36554: Document languages from field 041 should be present in 'ln' search field...
Janusz Kaczmarek [Tue, 14 Mar 2023 13:22:27 +0000 (14:22 +0100)]
Bug 36554: Document languages from field 041 should be present in 'ln' search field and Languages facet (MARC 21)

In Elasticsearch, the field 041 (subfields: a, d, e, i, j)
is not indexed with 'ln' search field.  As a result, records cannot
be found when searching with languages present in 041 (but only
with the one from 008/35-37), and the languages are also missing
from the facet.

Subfields content (only relevant subfields):
$a - Language code of text/sound track or separate title
$d - Language code of sung or spoken text
$e - Language code of librettos
$i - Language code of intertitles
$j - Language code of subtitles

Test plan
=========
0. Have a test installation with Elasticsearch.
1. In ktd with its test data, make a biblio search for a language present
   in 041 a/d/e/i/j but not in 008/35-37, e.g. for Japanese (with ln:jpn
   or from Advance search).  You will get no results.
2. Apply the patch, reindex with:
   sudo koha-elasticsearch --rebuild -r -b kohadev
3. Repeat the test. You should get some records and also you should see
   the Japanese language in the Languages facet.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d90c2a44e7506ec47a4f9481a1b8693b99244ecb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36390: Two minor OPAC CSS fixes
Owen Leonard [Thu, 29 Feb 2024 16:36:34 +0000 (16:36 +0000)]
Bug 36390: Two minor OPAC CSS fixes

This patch makes corrections to OPAC CSS to address two small issues.

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

- Perform a catalog search which will return multiple results..
- In the table of search results, check the icon and text for the
  controls under each title: "Place hold", "Add tag", "Add to cart" etc.
  - The colors should be consistent, with a slightly darker blue for the
    icons.
- Scroll down until the table header "sticks" to the top of the
  viewport.
- There should be no gap between the header row with the pagination
  links and the row with the "Select all", "Clear all", etc. controls.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 09119cf9c51e098db891002035213f250f635077)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36074: Add classes to materials specfied message on check in and checkout when...
Lucas Gass [Mon, 12 Feb 2024 22:03:38 +0000 (22:03 +0000)]
Bug 36074: Add classes to materials specfied message on check in and checkout when CircConfirmItemParts is on.

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

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

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

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6f8ef2b0c0788f71e821f2c56fc87c5a7173e081)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 31981: Add classes to each NEEDSCONFIRM message in circ/circulation.tt
Lucas Gass [Thu, 21 Mar 2024 16:37:13 +0000 (16:37 +0000)]
Bug 31981: Add classes to each NEEDSCONFIRM message in circ/circulation.tt

This patch adds a 'needsconfirm' class and a unique class to each NEEDSCONFIRM message on circ/circulation.tt to make these easier to style individually.

To test:
1. APPLY patch
2. Review the diff to see each of the NEEDSCONFIRMATION messages.
3. Add some CSS to IntranetUserCSS like this:

.needsconfirm { padding: 1em; color: #fff; }

.reserved { background: blue; }
.debt { background: red; }
.reserve_waiting { background: orange; }
.rentalcharge { background: purple; }
.renew_issue { background: limegreen; }

4. Place a hold on an item for Patron A, do not trigger the hold, and check the item out to Patron B.  The message background is blue.
5. Then check the item in, confirm the hold, then check the item out to Patron B.  The message background is orange
6. Check something out that is already checked out to that patron, message background is lime green.
7. Have too much debt and check something out to a patron, message is red.

Note: There are plenty more NEEDSCONFIRMATION messages but I don't think we need to test every single one.
Note: These background colors are more testing purposes only.
Signed-off-by: Donna <donna@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2c8196cc077501d1b970f1077f94fd3f25b1385a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36393: Renewal with a specific date does not take the new date due that we pick
Hammat Wele [Thu, 21 Mar 2024 22:53:26 +0000 (22:53 +0000)]
Bug 36393: Renewal with a specific date does not take the new date due that we pick

When we renew a notice with a specific date and we have to override the limit, the new date due is not the date that we picked

To reproduce

1- Log in to the staff interface
     1-1. Make sure you have a ciculation rule that allows you to renew
     1-2. set the AllowRenewalLimitOverride system preference to Allow and SpecifyDueDate to Allow
2. Check out the item to a Borrower
5. Access the borrower's account and renew it until the limit is reached and note the due date.
6. Go to Circulation, click Renew
7. Enter the item barcode and choose a due date further than the due date from step 5 and submit
8. Click on Override limit and renew button
     ---> Note that the new date due is not the date that we picked in step 7
9. Apply the patch
10. Repeat step 6, 7 snd 8
     ---> Note that the new date due is the date that we picked

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c29e4ef1f1cda011867ba69207e4a0a0a74c829d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35954: Add --status to koha-plack
Magnus Enger [Mon, 5 Feb 2024 08:12:29 +0000 (08:12 +0000)]
Bug 35954: Add --status to koha-plack

This adds a --status switch to the koha-plack command.

To test on ktd:
- Copy the script to /usr/sbin, so you run the modified script,
  and not the one installed by Koha:
  $ sudo cp debian/scripts/koha-plack /usr/sbin/
- Stop and start Plack for kohadev like so:
  $ sudo koha-plack --stop kohadev
  $ sudo koha-plack --start kohadev
  And make sure this reports the correct status, both when Plack
  is running and when it is not running:
  $ sudo koha-plack --status kohadev
- Make sure --status is mentioned here:
  $ sudo koha-plack --help
- See https://wiki.koha-community.org/wiki/Testing_man_pages for
  details on how to check the manual page for the command

Signed-off-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ccd4738e26ef3c2e40bfa1dc1e74dfdb94a34239)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36137: Make update_totalissues cron always skip the holds queue
Lucas Gass [Wed, 10 Apr 2024 11:56:01 +0000 (11:56 +0000)]
Bug 36137: Make update_totalissues cron always skip the holds queue

To test:
1. Run the update_totalissues cron, the holds queue is updated.
2. APPLY PATCH, restart services
3. Run update_totalissues cron again, this time the holds queue should always be skipped.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 307acdf96b28c722a0027c1eeadb4c98ab38eeef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36574: Canceled/invalid ISBN not indexed by ES for MARC 21
Janusz Kaczmarek [Thu, 11 Apr 2024 09:21:42 +0000 (09:21 +0000)]
Bug 36574: Canceled/invalid ISBN not indexed by ES for MARC 21

For MARC 21, canceled/invalid ISBNs (subfield 020 $z) are not being
indexed in Elasticsearch (search fields identifier-standard and isbn),
but it is for UNIMARC (subfield 010 $z).  As a result, a user searching
for such an ISBN (e.g. with wrong checksum--and therefor put in 020 $z)
will not find the record in the catalogue.

A new isbn-all Elasticsearch search field 'isbn-all' has been created with
020az (MARC 21, and 010az for UNIMARC), 010z has been removed from isbn
search field for UNIMARC, and 020z has been added to identifier-standard
search field.

Test plan
=========
0. Have a test installation with Elasticsearch.
1. In ktd with its test data, make a biblio search for a cancelled ISBN
   e.g. 9780007269854.  You will get no results.
2. Apply the patch, reindex with:
   sudo koha-elasticsearch --rebuild -r -b kohadev
3. Repeat the test. You should get "The ice princess / Camilla Läckberg".

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 915d585b50868c878e492b2ce7d60f92fd3e8e87)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36567: Get rid of Datetime warning in Circulation.t and dateexpiry.t
Emmi Takkinen [Wed, 10 Apr 2024 11:50:04 +0000 (14:50 +0300)]
Bug 36567: Get rid of Datetime warning in Circulation.t and dateexpiry.t

Running either t/db_dependent/Circulation.t or t/db_dependent/Circulation/dateexpiry.t
cause following error to be dispalyed:

You are creating a DateTime object with a far future year (9999) and a time
zone (Europe/Helsinki). If the time zone you specified has future DST changes
this will be very slow.

Smallest allowed value is 4999, so we need to use that rather than 9999 in tests.

To test prove t/db_dependent/Circulation.t and t/db_dependent/Circulation/dateexpiry.t.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f5e9f9634fd0d3ea1d06ca24141cb10660a2cf66)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36673: Filter used categories and item types to current branch
Nick Clemens [Mon, 22 Apr 2024 18:12:47 +0000 (18:12 +0000)]
Bug 36673: Filter used categories and item types to current branch

To test:
1 - Define some circulation rules for default and specific branches
2 - Apply patch
3 - Confirm rules display as before

PA amended:
- bug->Bug in commit title
- squashed tidy

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f9effbfdb4a1221da4f05683a57946de01d0aa25)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36526: Remove circular dependency from Koha::Objects
Julian Maurice [Thu, 4 Apr 2024 14:26:00 +0000 (16:26 +0200)]
Bug 36526: Remove circular dependency from Koha::Objects

Koha::Objects depends on Koha::DateUtils, which depends on C4::Context,
which depends on Koha::Config::SysPrefs, which depends on Koha::Objects

Apart from the circular dependency, the dependency on C4::Context alone
is problematic as it loads a bunch of modules that are not needed at all
in Koha::Objects (YAML::XS and ZOOM for instance).
As Koha::Objects is used as a base for a lot of modules, we should take
care to only load the minimum required.

This patch removes uses of Koha::DateUtils from Koha::Objects.
It was only used in Koha::Objects::filter_by_last_update

filter_by_last_update now requires that the 'from' and 'to' parameters
must be DateTime objects. Previously it would also allow date and
datetime strings. This possibility was only used in two places:
* misc/cronjobs/cleanup_database.pl
* tools/cleanborrowers.pl

Now they call dt_from_string first and pass a DateTime object to
filter_by_last_update

Test plan:
1. Run `perl -cw Koha/Objects.pm`. It should only say:
   "Koha/Objects.pm syntax OK" without warnings
2. Run `prove t/db_dependent/Koha/Objects.t`
3. Verify that misc/cronjobs/cleanup_database.pl works as before,
   especially with the options --pseudo-transactions,
   --pseudo-transactions-from and --pseudo-transactions-to
4. Go to Tools » Batch patron deletion and anonymization, check "Verify
   you want to anonymize patron checkout history" and enter a date in
   the text input below. Then click Next and verify that the correct
   count of borrowers is shown. Click on the "Finish" button and verify
   that the circulation history has been correctly anonymized

See also bug 36432

Signed-off-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 675c8263b707c8e1987ac6084272b355deb1b05c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36122: Update unit test
Matthias Le Gac [Fri, 5 Apr 2024 14:12:37 +0000 (10:12 -0400)]
Bug 36122: Update unit test

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 24abc7c9973ce4b2b91a4b53375ef233faf59304)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36122: Add unit test
Matthias Le Gac [Fri, 8 Mar 2024 21:44:51 +0000 (16:44 -0500)]
Bug 36122: Add unit test

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 69d87031514bb108fb33c4791d6f5a1ff0c0d544)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36122: NEW_SUGGESTION is sent for every modification to the suggestion
Matthias Le Gac [Thu, 7 Mar 2024 21:55:37 +0000 (16:55 -0500)]
Bug 36122: NEW_SUGGESTION is sent for every modification to the suggestion

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4ab5e6d29d6a67320a2931e4b9f667879aaadb3d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35559: Correctly parse previous flatpickr date
Emily Lamancusa [Sun, 24 Mar 2024 20:07:16 +0000 (16:07 -0400)]
Bug 35559: Correctly parse previous flatpickr date

The Flatpickr configuration for futuredate and futuredateinclusive is
meant to allow the preexisting date, even if it is in the past, to avoid
data loss. As of Bug 30718 - Use flatpickr's alt option everywhere,
that incoming date is in yyyy-mm-dd format, not the configured
human-readable format, and needs to be parsed accordingly.

To test:
1. Place 2 holds on the same bib, both with an expiration date set
2. Set the expiration date for one of the holds to a date in the past
   (e.g., in Koha Testing Docker, use the commands:
   ktd --shell
   koha-mysql kohadev
   to access the database directly)
3. Reload the holds tab for that bib
--> Note that the future expiration date will be editable, and the past
    expiration date will not be editable
4. In a new tab, go to Administration > Patron Categories
5. Edit one patron category to have an enrolment period date in the future
6. Edit another patron category to have an enrolment period date in the
   past (e.g. by accessing the database directly, as above)
7. Reload the Edit pages for each of the above categories (in new tabs)
--> Note that the future enrolment period date will be retained in the
    date field, but the past enrolment period date will be blanked out
8. Apply this patchset
9. Refresh the holds tab from step 3
--> Note that both expiration dates are now editable
10. Refresh the 2 patron category tabs from step 7
--> Note that both enrolment dates are now retained correctly
11. Open the date picker on one of the date fields that has a past date
--> Note that other past dates, besides the existing date, are prevented

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 54d884819121ecb18930bbf250dfbb21fc7ecb93)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35559: Revert changes from bug 34634
Emily Lamancusa [Sun, 24 Mar 2024 19:58:47 +0000 (15:58 -0400)]
Bug 35559: Revert changes from bug 34634

This reverts commit fad3af0005c3a4234634ee477fafc85902540843

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 33465f2f7ae0d00775a207b793037fc15b89177d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36614: Restore 'phone' on the main patron search
Jonathan Druart [Wed, 17 Apr 2024 10:33:24 +0000 (12:33 +0200)]
Bug 36614: Restore 'phone' on the main patron search

It disappeared at some point (history is tricky here, I didn't manage to
track down what happened, it's a mess)

This patch adds a phone column after the "name and address" one. It's
hidden by default.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d4bea3f9c84d97225efc0e07d7f6b9390d86d0d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36678: Index fields with non-filing characters in both versions
Nick Clemens [Tue, 23 Apr 2024 18:57:54 +0000 (18:57 +0000)]
Bug 36678: Index fields with non-filing characters in both versions

Currently we only remove non-filing characters for sort fields, however, this can make searching difficult.
This patch adds the filing form to the index as well to aid in searching.

To test:
 0 - Setup Koha with Elasticsearch
 1 - Import the sample record on this report: "L'amour de l'art"
 2 - Search for "amour de l'art" - no results
 3 - Apply patch
 4 - Reindex
 5 - Search for "amour de l'art" - result!
 6 - Search for "title:amour de l'art" - result!

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@bsz-bw.de>
(cherry picked from commit 7c20263fd0930997a8da70b8798e0ada623ac2bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36678: Adjust unit tests
Nick Clemens [Tue, 23 Apr 2024 18:57:45 +0000 (18:57 +0000)]
Bug 36678: Adjust unit tests

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@bsz-bw.de>
(cherry picked from commit 93a647fa90b13bfc0bc13eb71c445b37498647e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32565: (follow-up) Tidy
Nick Clemens [Fri, 19 Apr 2024 11:25:58 +0000 (11:25 +0000)]
Bug 32565: (follow-up) Tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4da2e1444be2f80f9a9a87a73af55bec1fe52f98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32565: (QA follow-up) Fix tests
Pedro Amorim [Mon, 19 Feb 2024 10:45:50 +0000 (10:45 +0000)]
Bug 32565: (QA follow-up) Fix tests

Apply original tests patch + this follow-up. Run:
prove t/db_dependent/HoldsQueue.t
Notice tests fail.
Apply fix patch, run the above prove command again.
Notice tests pass.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c3eac3c8898759291011e9d5a3f2d25cd1112c1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32565: Unit tests
Nick Clemens [Thu, 25 Jan 2024 12:31:46 +0000 (12:31 +0000)]
Bug 32565: Unit tests

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 379481541f63cbdbadc3884052ef1d6b82be99e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32565: Add unallocated option to holds queue
Nick Clemens [Thu, 2 Mar 2023 17:01:07 +0000 (17:01 +0000)]
Bug 32565: Add unallocated option to holds queue

Add an unallocated option to CreateQueue and pass through as needed
Avoid deletion of the tmp_holdsqueue, and only check holds
and items that are not currently matched

A future hold with a higher priority will still fail here - because the
item may already be assigned, but on next change to the biblio it would
be corrected

To test:
1) Apply both patches
2) Enable RealTimeHoldsQueue and set HoldsQueueSkipClosed to "open"
3) Add a holiday to the calendar for all libraries for today, visit:
/cgi-bin/koha/tools/holidays.pl
-- Click today's day on the calendar and pick "Holiday repeated every same day of the week"
-- Click "Copy to all libraries". Hit "Save.
4) Place a biblio-level hold on a biblio record and set the pickup location to a library that has available copies, visit:
-- /cgi-bin/koha/reserve/request.pl?biblionumber=76&borrowernumber=51
-- Click the first "Place hold" button to place the biblio-level hold.
5) Verify that that hold got added to the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
6) Place a biblio-level hold on a biblio record where there are no other holds and copies are available at another location, but not the pickup location, visit:
-- /cgi-bin/koha/reserve/request.pl?biblionumber=437&borrowernumber=51
-- On the "pickup at" dropdown, pick something else other than "Centerville", e.g. "Fairfield".
-- Click the first "Place hold" button to place the biblio-level hold.
7) Check the holds queue again, notice that this 2nd hold was not added to the queue:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
8) Run the updated cronscript:
perl misc/cronjobs/holds/build_holds_queue.pl --force --unallocated
9) Notice nothing changed in the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
10) Remove the holiday we created previously, visit:
/cgi-bin/koha/tools/holidays.pl
-- Click today's day on the calendar and pick "Delete this holiday"
-- Click "Copy to all libraries". Hit "Save.
11) Run the updated cronscript:
perl misc/cronjobs/holds/build_holds_queue.pl --force --unallocated
12) Confirm the second hold is added to the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 939f1f389b848e06b7adcd7121ff7629a0ba4adf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 31345: Add ability to exit process_message_queue.pl early if any plugin before_se...
Kyle M Hall [Thu, 11 Aug 2022 19:43:15 +0000 (15:43 -0400)]
Bug 31345: Add ability to exit process_message_queue.pl early if any plugin before_send_messages hook fails

Sometimes it would be better for process_message_queue.pl to stop if a plugin hook fails rather than continue processing. It would be nice if that was a command line option.

Test Plan:
1) Install any plugin with a before_send_messages hook
2) Modify the plugin, add a 'die;' statement at the start of the
   before_send_messages method of the plugin.
3) Run process_message_queue.pl as usual
4) Note the exit code is 0
5) Run it again with the new -e setting
6) Note the exit code is 1

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 83f9535fabc37be46ab8154d940a7ff614617eb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35582: Supress possible warning
Kyle M Hall [Fri, 26 Apr 2024 18:41:42 +0000 (14:41 -0400)]
Bug 35582: Supress possible warning

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 615c7c5eafd207fdb1adc9a07a063ce83da668c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35582: Show advanced search languages with selected intranet language description...
lmstrand [Fri, 26 Jan 2024 08:36:00 +0000 (10:36 +0200)]
Bug 35582: Show advanced search languages with selected intranet language descriptions first

To test:

1. Check language dropdowns in advanced search, notice localized
   names of the languages are shown first in the menus, then the
selected ui language translations if available or the english translation
2. Apply patch
3. Check language dropdowns, notice the selected ui language's
   translations are shown first for the languages (if missing, english
translation), then the localized
language's name.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c445218deb8daa8704ae48433783e723d8e8649)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: (follow-up) Fix specification file
Martin Renvoize [Tue, 30 Apr 2024 06:31:15 +0000 (07:31 +0100)]
Bug 26297: (follow-up) Fix specification file

We had a duplicate 'description' key introduced in the patron category
specification file here which causes errors on bundling the specs.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c120975b7839f8d4b35f9ecb14f6b70ded66509a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: (QA follow-up): Update tests
Pedro Amorim [Wed, 24 Apr 2024 11:01:08 +0000 (11:01 +0000)]
Bug 26297: (QA follow-up): Update tests

prove t/db_dependent/api/v1/patron_categories.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 593c3673f276fe18446131a62c95b85727bb7e46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: (QA follow-up) Spec fixes
Tomas Cohen Arazi [Tue, 23 Apr 2024 13:04:06 +0000 (10:04 -0300)]
Bug 26297: (QA follow-up) Spec fixes

This patch fixes some spec misses. To test:

1. Run:
   $ ktd --shell
  k$ prove xt/api.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 456f47cad4060dcd0b003a9ac3d1b67aa378866c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: Add tests
Pedro Amorim [Tue, 12 Dec 2023 10:57:50 +0000 (10:57 +0000)]
Bug 26297: Add tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a43303b88bea5d7fbd0229df1870b9e4f15e6f47)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: API specs
Pedro Amorim [Mon, 11 Dec 2023 17:30:37 +0000 (17:30 +0000)]
Bug 26297: API specs

Test plan, k-t-d:
1) Access /api/v1/patron_categories
2) Verify the patron categories are correctly listed

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Bug 26297: (QA follow-up) Move to REST::V1::Patrons::Categories

Bug 26297: (QA follow-up) Use search_with_library_limits

JD amended-patch: squashed + tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0e593e59e2a39819e5384f03445a138aa79a7f34)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: Add patron categories to_api_mapping
Pedro Amorim [Mon, 11 Dec 2023 17:31:09 +0000 (17:31 +0000)]
Bug 26297: Add patron categories to_api_mapping

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5b205969a91d325378945cad4e2730152f2417a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30598: remove all the console.log redundancies
Phan Tung Bui [Thu, 18 Apr 2024 13:49:59 +0000 (09:49 -0400)]
Bug 30598: remove all the console.log redundancies

Please test the patch. Thank you!

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e0d38c77e6c9fff2d7c39cf523c1517b322ca9c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30598: Replacement cost is not copied from retail price when ordering from file
Phan Tung Bui [Fri, 12 Apr 2024 20:53:24 +0000 (16:53 -0400)]
Bug 30598: Replacement cost is not copied from retail price when ordering from file

Test plan :
To test :
1- In Acquisitions, create a basket
2- Add an order from a new (empty) record
 --> Note that when you enter the "vendor price", it is copied in the "replacement cost" field
3- Add an order from a new file
 --> Note that when you enter the "price", the "replacement price" field stays empty
4- Apply the batch
5- Redo step 3 and notice that when you change the 'price', the
'replacement price' syncs with it

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bed0563e568c4ee13a851d22025d66f36651beec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35903: In cataloguing authority plugin using autocomplete must set operator exact
Fridolin Somers [Thu, 25 Jan 2024 08:50:28 +0000 (09:50 +0100)]
Bug 35903: In cataloguing authority plugin using autocomplete must set operator exact

When cataloguing and using authority plugin, there is auto-completion on inputs and default operator is "contains".
When using auto-completion and selecting a result it would be logical to set operator "exact".

See doc https://api.jqueryui.com/autocomplete/#event-select

This patch also adds auto-completion missing on "Search all headings".

Test plan:
1) Create a new authority Topical Term with heading "Cart"
2) Create a new authority Topical Term with heading "Carthage"
3) Create a new biblio record
4) Use authority plugin on field 650
5) You see current operator are "contains"
6) Enter "Car" in "Search main heading ($a only):"
7) You see auto-completion showing "Cart" and "Carthage"
8) Click on "Cart"
9) You see operator changes to "is exactly"
10) Submit form to see the results
11) Clear form and repeat 6-9 for the three other inputs

Signed-off-by: Michelle Spinney <mspinney@clamsnet.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 36d96180aea6e71d24da116343cd37bd723e808f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36605: Add update_lastseen to handle_patron_status for SIP
Nick Clemens [Tue, 16 Apr 2024 03:50:21 +0000 (03:50 +0000)]
Bug 36605: Add update_lastseen to handle_patron_status for SIP

This patch extends the TrackLastPatronActivity trigger to cover SIP status messages as well.
Other SIP messages like Checkin/Checkout should be covered by those values in system preference, so
should not need adjustment.

To test:
prove -v t/db_dependent/SIP/Message.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cca7ede28ccd37a56f88b4953aed54304b88833d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35689: Add id and classes to each MARC note in OPAC bibliographic details
Owen Leonard [Wed, 3 Jan 2024 16:01:56 +0000 (16:01 +0000)]
Bug 35689: Add id and classes to each MARC note in OPAC bibliographic details

Building on Bug 14156, this patch updates the OPAC bibliographic
detail page's display of MARC notes to add 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:

- As a quick test for custom CSS, go to Administration -> System
  preferences and locate the OPACUserCSS 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: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dfd4894acbab3af5355b72c859a0a17deef70af5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35996: Make it clear that --category-code can not be used alone
Matt Blenkinsop [Mon, 5 Feb 2024 16:50:32 +0000 (16:50 +0000)]
Bug 35996: Make it clear that --category-code can not be used alone

This patch adds a clarification to writeoff_debts.pl to make it clear that --category-code can't be used as the only filter when running the script. If this is the case, the script just displays the help menu as it is expecting one of the other filters

Test plan:
1) Run perl misc/cronjobs/writeoff_debts.pl --category-code TEST --confirm
2) Observe that the help menu is displayed instead of running the script
3) Check the help menu for the text added in this patch

WNC amended patch - added same warning in the option section

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 875809d66d4e6bde5385d88aad9f05f472a67b6b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30324: (follow-up) Remove stray comments
Nick Clemens [Fri, 26 Apr 2024 16:04:35 +0000 (16:04 +0000)]
Bug 30324: (follow-up) Remove stray comments

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b4e36c1bcd26a1f8b3187de3f8e160e8b5c78844)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30324: Don't use default rule if we have a parent rule
Nick Clemens [Thu, 11 Jan 2024 16:21:48 +0000 (16:21 +0000)]
Bug 30324: Don't use default rule if we have a parent rule

Currenty, if we find only a defult rule for a checkout we are ignoring the parent rule.
We should not use the default if there is a parent rule

To test:
 1: have an itype BK
 2: create an itype BK2, set BK as the parent to BK2
 3: create a circ rule for All Patrons, item type BK (displays as "Books (All)" in the circ rules interface), setting total checkouts to 1
 4: do not create any rule specifically for the BK2 itype
 5: have some BK items and some BK2 items
 6: check a BK item out to a patron
 7: check a BK2 item out to the same patron, observe you are not blocked from doing so
 8: try to check out a second BK2 item to the same patron, get message "Too many checked out. 1 checked out, only 1 are allowed."
 9: try to check out a second BK item to the same patrons, get message "Too many checked out. 2 checked out, only 1 are allowed."
10: return both items
11: check a BK2 item out to your patron
12: try to check a BK item out to your patron, get message "Too many checked out. 1 checked out, only 1 are allowed."
13: Apply patch
14: Repeat 7, you are now blocked
15: Other results should be the same

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Michael Adamyk <madamyk@ckls.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d7afd1ca30231dfc5752ddeece123b8471d8b4a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30324: Unit tests
Nick Clemens [Thu, 11 Jan 2024 14:50:35 +0000 (14:50 +0000)]
Bug 30324: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit afe8869d792c3e44fb38b85577b3fa21f7bf32c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 22613: Add GET endpoint /patrons/{patron_id}/checkouts
Alex Arnaud [Wed, 10 Apr 2024 12:03:14 +0000 (14:03 +0200)]
Bug 22613: Add GET endpoint /patrons/{patron_id}/checkouts

This patch adds a new endpoint, for fetching checkouts from a specific
patron.

Test plan:

1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/patrons_checkouts.t
=> SUCCESS: Tests pass!
3. Run:
   $ curl -v -s -u koha:koha --request GET \
        http://kohadev.local/api/v1/patrons/{id}/checkouts
test with query parameters (they are the same as for /patrons/{id}/holds
=> SUCCESS: The API works!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 914afffd56b861727aff1309abc54b2950bdca0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36482: Add embed tests
Pedro Amorim [Thu, 4 Apr 2024 11:14:11 +0000 (11:14 +0000)]
Bug 36482: Add embed tests

prove t/db_dependent/api/v1/libraries.t

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 39879cd5cf1d46ee57e5ab22e1770c9d5c98b6ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36482: Make embedding work for GET /libraries/:library_id
Tomas Cohen Arazi [Mon, 1 Apr 2024 21:08:46 +0000 (18:08 -0300)]
Bug 36482: Make embedding work for GET /libraries/:library_id

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8cd64b5dd689175a68a8a4b7f6f843cad2d271f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36482: Allow embedding desks and cash_registers on libraries endpoints
Tomas Cohen Arazi [Mon, 1 Apr 2024 21:08:13 +0000 (18:08 -0300)]
Bug 36482: Allow embedding desks and cash_registers on libraries endpoints

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 588ef525f3283fc49661597775b7dbfea1b08753)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36481: (QA follow-up) Rename branch_default to library_default
Martin Renvoize [Wed, 1 May 2024 12:48:35 +0000 (13:48 +0100)]
Bug 36481: (QA follow-up) Rename branch_default to library_default

Use agreed terminology

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 67abe6410631af52184c75b08742c6c197ef853b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36481: Add GET /libraries/:library_id/cash_registers
Tomas Cohen Arazi [Mon, 1 Apr 2024 20:52:46 +0000 (20:52 +0000)]
Bug 36481: Add GET /libraries/:library_id/cash_registers

This patch adds the mentioned route. For the task it:

* Adds Koha::Cash::Register->to_api_mapping with trivial mappings
* Adds a cash_register object definition on the API spec
* Adds a controller to handle requests
* Adds tests for the new endpoint

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ qa
=> SUCCESS: All green! Tests pass!
3. Play with Postman!
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ee52b5c252c4fc5defadc28922c422ffd85b1877)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36480: Add GET /libraries/:library_id/desks
Tomas Cohen Arazi [Mon, 1 Apr 2024 20:24:35 +0000 (20:24 +0000)]
Bug 36480: Add GET /libraries/:library_id/desks

This patch adds the mentioned endpoint. For it, it does:

* Add Koha::Desk->to_api_mapping
* Add desk.yaml with the correct data structure for desks
* Add the route to the spec
* Add tests

Note: Lucas and I had doubts about the right return value for when the feature is disabled.
I opted for returning 404 with a message telling the feature is disabled. This can be discussed.

To test:
1. Apply this patches
2. Run:
   $ ktd
  k$ qa
=> SUCCESS: All green, all tests pass!
3. Play with this using Postman.
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit afd83c134e2ef4759d0512f713d4f4911f0190f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36480: Add Koha::Library->desks
Tomas Cohen Arazi [Mon, 1 Apr 2024 20:22:22 +0000 (20:22 +0000)]
Bug 36480: Add Koha::Library->desks

We add an accessor for the related desks. Tests are added.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Library.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7f7f486d94e52eb50d070ccead61c94928aeff28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35353: Add REST API endpoint to retrieve old holds
Jonathan Druart [Mon, 25 Mar 2024 15:42:18 +0000 (16:42 +0100)]
Bug 35353: Add REST API endpoint to retrieve old holds

Same as checkout but for holds, we need to provide a way to retrieve old
holds for a patron.

Test plan:
Create some holds for a patron, cancel and fulfill some, then use the
REST API endpoint with the new 'old' flag set to 1
  /api/v1/patrons/42/holds?old=1

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7a32231a52d9d1d5007ad574b8e3b48fd4c99878)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35353: DBIC specific
Jonathan Druart [Wed, 20 Dec 2023 10:23:52 +0000 (11:23 +0100)]
Bug 35353: DBIC specific

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6fb82fd6e32d0f38f24463c31adf546efe153bc3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35558: Do not retrieve the local image if none exists - OPAC
Jonathan Druart [Thu, 14 Mar 2024 14:01:39 +0000 (15:01 +0100)]
Bug 35558: Do not retrieve the local image if none exists - OPAC

Test plan:
 1 - Enable system preferences:
     LocalCoverImages
     OPACLocalCoverImages
 2 - open browser tools network page
 3 - Perform an intranet search
 4 - Note a request for each bib like:
    http://localhost:8081/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=35
 5 - Repeat on opac, same requests
 6 - Apply patches
 7 - Restart all
 8 - Repeat searches, note no fetches
 9 - Add local cover images to several biblios in the results
10 - Repeat searches
11 - Note the fetches are only for those records with images
12 - Confirm images still load correctly

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 747c9b573b828ee6d38f5085ac6bdbb82f0e3305)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35558: Do not retrieve the local image if none exists
Jonathan Druart [Wed, 13 Dec 2023 10:10:24 +0000 (11:10 +0100)]
Bug 35558: Do not retrieve the local image if none exists

On the search results we are fetching the thumbnails of the local cover
images using catalogue/image.pl
Which means 1 GET per results on the page.

This patch suggests to have this information beforehand in order to
reduce the number of hits and network traffic?

However the page load will be slightly slower ofc.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8cde45e0723a4b34bdf26c7ef4cfd2d8e767c837)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36295: Space out content blocks in batch record modification
Brendan Lawlor [Fri, 12 Apr 2024 16:40:41 +0000 (16:40 +0000)]
Bug 36295: Space out content blocks in batch record modification

This patch adds a float clearing class to a line break in the batch record modification template to fix a spacing issue in Chrome.

To test apply the patch and go to Cataloging -> Batch record modification

There should be space between the two sections.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 566894f058759c05922ec3399ba4ca96d27978f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36295: Space out content blocks in batch record deletion
Owen Leonard [Tue, 9 Apr 2024 12:02:40 +0000 (12:02 +0000)]
Bug 36295: Space out content blocks in batch record deletion

This patch adds a float-clearing line break to the batch record deletion
template so that the "Record type" section has visual separation from
the record number submission tabs.

To test, apply the patch and go to Cataloging -> Batch record deletion.

There should be padding between the two sections.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 55fbfffa0efe2efc09baa3a5e4d01595152165e7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35977: (follow-up) Cleaner working approach
Martin Renvoize [Tue, 30 Apr 2024 15:13:25 +0000 (16:13 +0100)]
Bug 35977: (follow-up) Cleaner working approach

This patch removes the Date_from_syspref recently added and replaces it
with the correct parseDate call as per bug 35559. We also clean up the
code around setting the input value in the first place and use iso which
is what the rest of flatpickr expects and now is handled correctly in
futuredate pickers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1ff3d65c7073e5d93502d329b917d886a3665e0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35977: Nuke value if setting required
Martin Renvoize [Thu, 25 Apr 2024 12:39:40 +0000 (13:39 +0100)]
Bug 35977: Nuke value if setting required

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 47400c327394a449b6bcb0998eba0e7840a9e6d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35977: Set holddatefrom default to today
Martin Renvoize [Wed, 7 Feb 2024 15:21:04 +0000 (15:21 +0000)]
Bug 35977: Set holddatefrom default to today

This patch sets the holddatefrom date to today by default on the opac.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c341b2d37584aca52fcac7243f7ab68f324d002c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 16567: Correct RSS feed validity errors
Owen Leonard [Mon, 15 Apr 2024 14:21:03 +0000 (14:21 +0000)]
Bug 16567: Correct RSS feed validity errors

This patch corrects a few markup errors in the XML feeds to make the
feeds validate correctly. The template has been largely re-indented to
improve readability and eliminate tab characters.

To test, apply the patch and perform a search in the OPAC.

- Open the RSS link appearing after the "Your search returned..."
  header.
- Depending on how your browser handles XML documents you may need to
  view source on the page to see the actual XML markup.
- Copy the source and paste it into the W3C feed validator:
  https://validator.w3.org/feed/#validate_by_input
- The feed should be found to be valid.
  - In my tests you'll get a "Recommendation" about "Self reference
    doesn't match document location." I think this recommendation
    doesn't apply.

Perform the same test with the other two available formats: Atom and
OpenSearch:

- Change the end of the RSS feed url from '&format=rss' to
  '&format=atom' and validate the result.
   - The same "self reference" recommendation will come up, and again I
     think we can ignore it.
   - There is another recommendation about "Two entries with the same
     value for atom:updated." The updated time is set to the same time
     as the feed itself (the time when the feed was generated. Maybe
     this is incorrect. If so we need a follow-up that exposes a
     different value to the template. biblio.datecreated maybe?
- Change the end of the feed url from '&format=atom' to
  '&format=OpenSearchDescription' and validate that result.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ee960bd45f7535aec058d3984891e21b255ace12)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36160: Use $builder->build_object for patron objects in Circulation.t
David Gustafsson [Fri, 23 Feb 2024 18:41:26 +0000 (19:41 +0100)]
Bug 36160: Use $builder->build_object for patron objects in Circulation.t

1) Set TrackLastPatronActivityTriggers to at least "Checking out an item"
2) Run tests in t/db_dependent/Circulation.t and verify that
   failes with "Invalid value passed, borrowers.updated_on..."
3) Apply patch
4) Run Circulatoint.t tests again and verify that no longer
   produces this error

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f44e4a72a3bb14fd1cefb7ef94cb700700521eb8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35979: (follow-up) Add check in ->enqueue
Marcel de Rooy [Tue, 23 Apr 2024 12:47:11 +0000 (12:47 +0000)]
Bug 35979: (follow-up) Add check in ->enqueue

Foundation for removing same check elsewhere (later on).

Test plan:
Run t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
PA amended: Fix bug # in commit message

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c317bb34c0bb59fd0f52b4e7c5c0d3326b0030ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35979: Check pref before inserting holds_queue background jobs
Marcel de Rooy [Tue, 23 Apr 2024 11:42:50 +0000 (13:42 +0200)]
Bug 35979: Check pref before inserting holds_queue background jobs

Test plan:
Confirm that modrequest does no longer insert when pref is off :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 310ba95efa7e83559134c7660f7739a6d1314524)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36649: Correctly embed biblio when retrieving items when adding to a train
Jonathan Druart [Mon, 22 Apr 2024 12:33:33 +0000 (14:33 +0200)]
Bug 36649: Correctly embed biblio when retrieving items when adding to a train

I didn't find when this regression has been introduced but the third
parameter here is the headers, not parameters, we should not repeat
"headers".

Test plan:
1. Add a new processing that contains columns from the database, for example biblio.title and biblio.author.
2. Create a new train.
3. Add items to the waiting list.
4. Click on "Add last x items to the train" button.
5. Choose the train you created on number 2.
6. Choose the processing you added on number 1.
7. Try to click the Submit button.
=> Without the patch nothing happens and there is a JS error in the
console: Uncaught TypeError: item.biblio is undefined
=> With this patch applied the item is correctly added to the train and
the attribute is properly populated.

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 63612311e32a546a6ea1067e0c65ac3199f2f292)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32695: Fix search strings for 775, 780, 785 and 787
Nick Clemens [Fri, 26 May 2023 19:00:13 +0000 (19:00 +0000)]
Bug 32695: Fix search strings for 775, 780, 785 and 787

In the past due to some misunderstanding of the MARC standard
we built the search links for these fields using $a and $t with
the title index. But we actually need to search $t as title
and $a as author.
This patch fixes the templates for the MARC 7xx fields:
* 775
* 780
* 785
* 787

To test:
* Ensure systme preference 'UseControlNumber' is set to don't
* Create a record with the linking fields above
* Look at the OPAC and staff interface detail views
* Verify the content of your fields shows and the links combine a+t as a title search
* Apply patch
* Verify you have nicely formatted links now

Example:
775 _ _ ‡asomeone‡ttitle775
780 0 2 ‡asomeone‡ttitle780
785 0 2 ‡asomeone‡ttitle785
787 _ _ ‡ilabel:‡ttitle787‡asomeone

Signed-off-by: Sabrina Kiehl <kiehl@mpis.mpg.de>
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@bsz-bw.de>
(cherry picked from commit b2b3d88b7335c542035fbdf11637fa2a31ea22bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36652: Pass copy_form template variable
Lucas Gass [Fri, 19 Apr 2024 17:22:15 +0000 (17:22 +0000)]
Bug 36652: Pass copy_form template variable

To test:

1. Go to Tools > Notices and slips
2. Pick any notice and try to copy it to another library using the 'Copy notice' column.
3. You are redirected to a blank screen and if you go back to the Notices and slips page the notice has not been copied.
4. APPLY PATCH
5. Try steps 1 - 3 again, but this time you should be correctly directed.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0e7d2c3db4727c629ab76e01a3f42d6810c89916)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30318: Don't reset messaging preferences when form is empty
Nick Clemens [Fri, 19 Apr 2024 12:29:31 +0000 (12:29 +0000)]
Bug 30318: Don't reset messaging preferences when form is empty

In testing, the messaging preferences are set in the form when EnhancedMessagingPreferences is enabled.
Switching categories silently updates the preferences unless you have made changes, in which case the
user is warned and can confirm if they want to reset or not. The code only applies to patron creatoin, and
does not seem to be taken into account during OPAC self-registration.

It seems the silent defaulting when saving can be removed in favor of the current updates/warns in the actual
form.

To test:
 1 - Set some messaging preferences for at least two categories
 2 - Enter a new patron
 3 - Confirm switching categories correctly defaults the messaging preferences
 4 - Edit the preferences and switch to another category with defaults
 5 - Confirm the warning appears, and preferences are set if confirmed and ignored if not
 6 - Set to a category with defaults, uncheck all, and save
 7 - Ooof, patron is defaulted
 8 - Apply patch
 9 - Repeat 1-5 and confirm nothing has changed
10 - Set to a category with defaults, uncheck all, save
11 - Confirm patron is saved with no preferences

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 70fde44d4f6eef25e177012318e7acaa0ce740c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>