Commit Graph

55766 Commits

Author SHA1 Message Date
Marcel de Rooy 57aeb9679f
Bug 36603: (QA follow-up) Resolve two conditional declarations
QA tools reported:
 FAIL   authorities/blinddetail-biblio-search.pl
   FAIL   critic
                # Variables::ProhibitConditionalDeclarations: Got 2 violation(s).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:42:53 +01:00
Andreas Roussos b4e0a2ec7f
Bug 36603: Copy the ISNI number over automatically
When linking authorities with other authorities in UNIMARC
instances it would be good if Koha automatically copied the
contents of subfield 010$a [aka INTERNATIONAL STANDARD NAME
IDENTIFIER (ISNI)] into the corresponding 5xx$o subfield
(should such an ISNI number exist in the source record).

This patch enables the enhancement outlined above.

For more information, please see the offical IFLA UNIMARC
Authorities Format Manual (online ed., 1.0.0, 2023), pp. 350,
363, 385. This is actually where we got this idea from ;-)

Note #1: it only applies to the Personal Name, Corporate
         Body Name, and Family Name authority types.

Note #2: the default MARC Authorities framework that ships
         with UNIMARC Koha instances does *not* include a
         subfield $o for fields
         200 (Authorized Access Point - Personal Name),
         210 (Authorized Access Point - Corporate Body Name),
         220 (Authorized Access Point - Family Name).
         This is per the offical IFLA Manual, and effectively
         means we can push the ISNI number to the same array
         used for other subfields (@subfield_loop) without
         worrying about overwriting any previous value.

Test plan:

0) Have a UNIMARC Koha test instance up and running. Then,
   carry out the following steps in the Staff interface.

1) Stage for import the sample MARC authority data attached
   to this Bug report (filename: sample-auths.mrc, contains
   one Personal, one Corporate Body, and one Family Name).
   Go to 'Cataloging > Stage records for import' and upload
   the file. Make sure you select 'Authority' in the 'Record
   type' dropdown menu. Leave all other settings untouched at
   their default values. Click the 'Stage for import' button.

   Then, import the staged records into your Catalog. Go
   to 'Cataloging > Manage staged records'. Click on the
   filename link in the second column. At the bottom of the
   page, confirm you can see all three authorities included
   in the .mrc you uploaded, then click on the button named
   'Import this batch into the catalog'.

2) Enable the authority finder plugin for authority fields
   500, 510 and 520. This can be done as follows:

   a) Go to 'Administration > Authority types' and click on
      'Actions->MARC structure' for the 'NP' (Personal Name)
      authority type.
   b) Search for tag 500; then click on 'Actions->Subfields'
      for that tag.
   c) Click 'Edit' next to subfield 'a' (Entry element), then
      pick 'NP' from the 'Thesaurus' dropdown menu. Save your
      settings and you're good to go! When editing a Personal
      Name authority from now on, the 'Tag editor' button next
      to subfield 500$a will launch the authority finder.

   Repeat b) and c): search for tag 510, edit $a, pick 'CO'.
   Repeat b) and c): search for tag 520, edit $a, pick 'FAM'.

3) Go to Koha's 'Authorities' module. At the top search bar,
   filter on Personal Name authorities and perform a search.
   Pick any one of the results, and edit it. Go to tab '5',
   expand field 500 and use the button next to subfield $a
   to launch the authority finder. Type '0000' inside the
   'Search entire record:' text box, and click on 'Search',
   then 'Choose'.

   Notice that the ISNI number from the source record did
   *not* get copied to subfield 500$o. The same will happen
   if you try to Choose an authority for field 510 and 520.

4) Apply this patch.

5) Repeat step 3), this time the ISNI number from the source
   record will be copied to 500/510/520 $o automatically!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:42:52 +01:00
Tomas Cohen Arazi 608a6c2365
Bug 38166: Make core status graph strings translatable
This patch makes several strings translatable. I usually dealth with
this by adding my statuses like `NEW` to the status graph shippped by
the backend I was working with, and solved the translation step inside
of the plugin itself.

But really, the core status graph should be translatable so core
backends (like the to-be FreeForm) and backend authors can rest assured
they only need to care about their custom statuses.

To test:
1. Make sure you have 35570 applied so it is easier to test
2. Enable the ILLModule syspref.
3. Install a language you're familiar with. I pick es-ES for the sake of
   this testing steps to be readable:
   $ ktd --shell
  k$ koha-translate --install es-ES --dev kohadev && restart_all
4. Enable (language sysprefs) and switch to your language (click at the
   left bottom on the language name).
5. Create a new ILL request
=> FAIL: Notice some buttons are not in your language
6. Jump to the ILL requests list
=> FAIL: The status displays as 'New request'
7. Apply this patch
8. Generate the translation entries for the core status graph strings:
  k$ gulp po:extract
  k$ gulp po:update # I had to run it twice to complete, unrelated error
9. Edit the relevant -messages.po file. In my case:
  k$ vim misc/translator/po/es-ES-messages.po
Note: it is easier on VScode which shows you the changed lines in colors
on the scroll bar. The idea is to find the new strings that relate to
Koha::ILL::Request and translate them
10. Translate the strings that relate to this patch (at least 'New
    request' and some of the buttons in the ILL request detail).
11. Install the new translations:
  k$ koha-translate --update es-ES --dev kohadev && restart_all
12. Refresh the ILL requests list
=> SUCCESS: The request status is translated!
13. Manage the ILL request
=> SUCCESS: The buttons you translated, are translated!!
14. Sign off :-D
15. Grant tcohen some cookies next time

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:42:51 +01:00
Janusz Kaczmarek eab94d1213
Bug 36991: Add ability to scan call numbers index/search field
Some libraries ask for the ability to scan/browse the call numbers index.

Test plan:
==========
1. Have an installation with items with callnumbers (in ktd with standard
   test data set: add some callnumbers to the items).
2. Go to Advanced search > More options; choose Call number in the first
   drop list and mark Scan indexes.  Enter one of the call numbers you
   assigned to the items and perform the search.  You should get no
   results.
3. Apply the pach; restart all; when using ES:
   koha-elasticsearch --rebuild -r -d kohadev
4. Repeat p. 2.  You should get a list with at least one call number.
   The link should lead you to the record(s) with items with the selected
   call number.

This should work for ES and for Zebra, but for Zebra you would need to
replace /etc/koha/zebradb/ccl.properties with the repository version; and
you will get one token results on the list, like for other indexes.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:42:51 +01:00
Jonathan Druart c8a5bdffbe
Bug 38279: Remove unused C4::ImportBatch::EmbedItemsInImportBiblio
Last call removed from bug 30779 (I think)

Test plan:
  % git grep EmbedItemsInImportBiblio
should not return anything

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>
2024-11-08 16:42:50 +01:00
Tomas Cohen Arazi ae3c4ab009
Bug 28965: Unit tests
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>
2024-11-08 16:09:23 +01:00
Kyle M Hall 1de1bd8a34
Bug 28965: (QA follow-up) Fix misc qa issues
* Tidy code
* Fix number of unit tests
* Fix use of delete

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:22 +01:00
Tomas Cohen Arazi 9a0cc6ad2a
Bug 28965: Add /public/lists
This patch adds a route for publicly retrieving lists.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:21 +01:00
Tomas Cohen Arazi 9c5d7edf4f
Bug 28965: filter_by_public() and filter_by_readable()
This patch adds helper methods for lists resultsets. Tests are added for
their behavior.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:21 +01:00
Katrin Fischer d5cecc5a07
Bug 37577: (QA follow-up) Capitalization: ERM Packages, etc.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:20 +01:00
Nick Clemens 21c4338988
Bug 37577: (QA follow-up) Tidy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:19 +01:00
Jake Deery 6ece137123
Bug 37577: Add additional fields for ERM packages
This bug adds support for additional fields in the ERM module's
packages, similar to how Bug 35287 added support for additional fields
in the ERM module's licences, and Bug 37576 added support for additional
fields in the ERM module's agreements.

To test (k.t.d):
a)  APPLY PATCH
b)  Run cypress --spec t/cypress/integration/AdditionalFields_spec.ts
    1)  Note how the tests pass
c)  Add new additional fields for 'erm_packages'
    1)  Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_packages
    2)  Create field one called 'text non-repeatable'
    3)  Create field two called 'text repeatable', check 'repeatable'
    4)  Create field three called 'av non-repeatable', pick LANG authorised
        value
    5)  Create field four called 'av repeatable', pick LOC authorised value,
        check repeatable
d)  Create new local package
    1)  Go to /cgi-bin/koha/erm/eholdings/local/packages/add, notice the new
        additional fields section
    2)  Complete all mandatory fields for a new package
    3)  Experiment with the four different additional field types – it
        may be useful to watch the Cypress-generated test video for
        guidance
    4)  Select some AV options from the AV fields, deselect them, notice
        the repeatable one allows for multiple selection, the non-repeatable
        one does not
e)  Save the package, then view it
    1)  To view the package, click its name in the table list on
        /cgi-bin/koha/erm/eholdings/local/packages
    2)  notice the additional fields on display
    3)  also notice that the authorised values are in their human-readable
        form, and not their coded form
f)  Edit the package, then view it again
    1)  Go to /cgi-bin/koha/erm/eholdings/local/packages/edit/1
    2)  Play around again with the fields. Save.
    3)  Repeat step e, have the edits shown up?
g)  Test searchability
    1)  Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_packages
    2)  Edit one of the fields and make sure searchable is checked (ensure
        you choose a field that has some data in it)
    3)  Go to /cgi-bin/koha/erm/eholdings/local/packages
    4)  Notice that the searchable field(s) are now columns in the table
    5)  Notice that searchable AV fields contain a drop-down
    6)  Notice that searchable text fields have an input field
    7)  Perform a search on the additional field
    8)  Notice that the searching is working as expected
h) SIGN OFF

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:19 +01:00
Nick Clemens a87d525ffb
Bug 37576: (QA follow-up) Tidy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:18 +01:00
Jake Deery f6122cfab6
Bug 37576: (follow-up) fix missed cypress change
This patch fixes a single line in our cypress tests which didn't cause
the test to fail, but nonetheless should be addressed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:18 +01:00
Jake Deery f348afbae8
Bug 37576: Add additional fields for ERM agreements
This bug adds support for additional fields in the ERM module's
agreements, similar to how Bug 35287 added support for additional fields
in the ERM module's licences.

To test (k.t.d):
a)  APPLY PATCH
b)  Run cypress --spec t/cypress/integration/AdditionalFields_spec.ts
    1)  Note how the tests pass
c)  Add new additional fields for 'erm_agreements'
    1)  Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_agreements
    2)  Create field one called 'text non-repeatable'
    3)  Create field two called 'text repeatable', check 'repeatable'
    4)  Create field three called 'av non-repeatable', pick LANG authorised
        value
    5)  Create field four called 'av repeatable', pick LOC authorised value,
        check repeatable
d)  Create new agreement
    1)  Go to /cgi-bin/koha/erm/agreements/add, notice the new additional
        fields section
    2)  Complete all mandatory fields for a new licence
    3)  Experiment with the four different additional field types – it
        may be useful to watch the Cypress-generated test video for
        guidance
    4)  Select some AV options from the AV fields, deselect them, notice
        the repeatable one allows for multiple selection, the non-repeatable
        one does not
e)  Save the agreement, then view it
    1)  To view the licence, click its name in the table list on
        /cgi-bin/koha/erm/agreements
    2)  notice the additional fields on display
    3)  also notice that the authorised values are in their human-readable
        form, and not their coded form
f)  Edit the agreement, then view it again
    1)  Go to /cgi-bin/koha/erm/agreements/edit/1
    2)  Play around again with the fields. Save.
    3)  Repeat step e, have the edits shown up?
g)  Test searchability
    1)  Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_agreements
    2)  Edit one of the fields and make sure searchable is checked (ensure
        you choose a field that has some data in it)
    3)  Go to /cgi-bin/koha/erm/agreements
    4)  Notice that the searchable field(s) are now columns in the table
    5)  Notice that searchable AV fields contain a drop-down
    6)  Notice that searchable text fields have an input field
    7)  Perform a search on the additional field
    8)  Notice that the searching is working as expected
h) SIGN OFF

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:17 +01:00
Jonathan Druart af6b0510d7
Bug 38391: Redraw the filters row on table redraw
We used to adjust the filters row when the column visibility changed.
It was working, but at the initialization of the table this event if
fired once per columns. On the items table it means 36x.
When a filtering/sorting, the draw event is triggered once, but the
column-visibility.dt is called 36x

Test plan:
Try with and without this patch and compare the delay between the query
is received and the page is redrawn.

You can test with 1000 libraries on the items table.
"Show filters" then filters using the global search.
On Firefox you will notice that the response is received but the table
not redrawn directly.
With this patch it should be redrawn pretty fase.

Another test would be to add the following 2 lines:
+        let i = 0;
         table_dt.on("draw", function(){
+            console.log("redraw filters %s".format(i));
             if ( add_filters ) {
                 _dt_add_filters(this, table_dt, filters_options);
             }

Open the console and notice that "redraw filters" is logged only once.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:09:16 +01:00
Martin Renvoize 41363ae29c
Bug 17976: Unit tests
Add unit tests for the newly introduced overdue fines relation accessor.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:12 +01:00
Martin Renvoize e779b8924f
Bug 17976: Add overdue_fines accessor to Koha::Checkout
This patch adds a new filtered relation accessor to the Koha::Checkout
object to return just overdue fine type account lines related to the
checkout.

Whilst this is easy to chain in code, it's not available via TT and so
this accessor is useful for the notices case.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:11 +01:00
Martin Renvoize d11e4127ae
Bug 17976: Update test to include fines
This patch updates the existing test to include checking the alternative
to items.fine syntax.

We could use the account_lines relation, however that would include
other charges linked to the checkout, for example rental charges.

I opt to add a new accessor to give us more options and refine to just
overdue fines.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:11 +01:00
Katrin Fischer 8af58a2fc5
Bug 33462: DBIC schema udpate
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:10 +01:00
Katrin Fischer c9bccdcd70
Bug 22421: DBRev 24.06.00.057
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:09 +01:00
Emily Lamancusa 9ab9219a10
Bug 22421: (follow-up) Improve recoverability if dbrev fails in the middle
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:09 +01:00
Emily Lamancusa 45b1fd3cab
Bug 22421: (follow-up) Fix tests
Need to search by old_issue_id instead of issue_id when checking the
value of an accountline after calling AddReturn on the linked checkout

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:08 +01:00
Emily Lamancusa c55f3e69a3
Bug 22421: (follow-up) Use checkout accessor to get correct issue_id
In some cases, we may want to update an AccountLine that is linked to a
checkout without knowing whether it is a current or old checkout. In
these cases, use the AccountLines ->checkout accessor to ensure we get
the issue_id correctly, regardless of whether it is a current issue or
and old_issue.

This also applies when generating a new AccountLine based on an existing
AccountLine (for example, adding a credit to refund a previously charged
fine)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:08 +01:00
Emily Lamancusa e35ab15741
Bug 22421: (follow-up): Check issue during add_credit
Additional handling for the case where a credit is added with an
issue_id after the issue is returned.

add_credit will keep the same method signature, where the issue_id
parameter may now refer to a current issue or an old issue. It will then
internally determine whether it is a current or old checkout and handle
it appropriately.

If the caller is updating an account line, or adding a credit to refund
an existing debit, they may not need to know whether it is for a current
checkout or an old checkout. In this case, they can use the account
line's ->checkout accessor to pass in the appropriate issue_id
regardless of whether it is a current or old checkout.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:07 +01:00
Martin Renvoize 33b6aa466a
Bug 22421: (follow-up) Check issue during add_debit
We need additional handling for the case where a debt may be added with
an issue_id after the issue is returned.

This patch tries to fix that at a low level, but introduces new test
failures in t/db_dependent/Circulation.t to be investigated.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:07 +01:00
Martin Renvoize 5e5832eb70
Bug 22421: DBIC schema update
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:06 +01:00
Martin Renvoize 1b2e24659f
Bug 22421: (follow-up) Correct checkout relation
The Koha::Account::Line->checkout relationship accessor needed an update
to respect the new fields and foreign keys introduced here.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:05 +01:00
Martin Renvoize 57593e81de
Bug 22421: Ensure old_issue_id is populated in accountlines
Update C4::Circulation::MarkIssueReturned to handle moving issue_id to
old_issue_id in accountlines.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:05 +01:00
Martin Renvoize 5e1534f2d8
Bug 22421: Add missing constraints
DB update to add a new old_issue_id field to accountlines and set
foreign key constraints for both the new field and the existing issue_id
field.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:04 +01:00
Martin Renvoize 311d3be1c5
Bug 22421: Add tests for new constraints
Test plan:
* Read the updated tests and verify that they make sense and do not
remove anything previously tested for.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 12:42:04 +01:00
Paul Derscheid 48e7aad1f1
Bug 37998: (QA follow-up) Remove excess whitespace in catalogue/itemsearch_item.json.inc
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:51 +01:00
Janusz Kaczmarek d289ebf0b3
Bug 37998: Tabs and backslashes in the data break item search display
If the item data (e.g. callnumber) contains a tab or backslash OR the
title part contains a backslash, the DataTable displaying the item
search results stops throwing an error modal "Something went wrong when
loading the table. 200: OK." and a JS console log: "DataTables warning:
table id=results - Invalid JSON response. For more information about
this error, please see http://datatables.net/tn/1".

Test plan:
==========

1. Make an item search w/o any parameters.
2. From the first result page choose a record and modify the title (245 $a)
   to contain " \ " string. Repeat the item search. You should see a modal
   "Something went wrong when loading the table. 200: OK.".
3. Remove the " \ " from the title.  Verify that the problem no longer occurs.
4. In the same record, insert the string " \ " or a tab (copied from a text
   editor) into item data (itemcallnumber, enumchron, barcode etc.).
5. Repeat the item search. You should see again a modal "Something went wrong
   when loading the table. 200: OK.".
6. Apply the patch; restart_all.
7. Repeat p. 2, 3, 4, and 5.  Verify, that the problem is solved.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:51 +01:00
Paul Derscheid 8ee8453118
Bug 38100: (QA follow-up) Tidy changes in C4/XSLT.pm
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:50 +01:00
Janusz Kaczmarek af270fc239
Bug 38100: Unit tests
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:50 +01:00
Janusz Kaczmarek c3dc86286c
Bug 38100: Items with damaged status are shown in OPAC results as "Not available" even with AllowHoldsOnDamagedItems
Items with damaged status are shown on the OPAC results page as "Not
available" even with AllowHoldsOnDamagedItems set to 'Allow', which is
misleading for the users.  'other/Damaged' status should be assigned
only if AllowHoldsOnDamagedItems is set to 'Don't allow'.

Test plan:
==========

1. Check that AllowHoldsOnDamagedItems system preference is set to
   'Allow'.
2. In librarian interface, change the damaged status of an item by
   setting it to 'Damaged'.
3. In OPAC, make a search for the record with this item attached.  Use
   common words from title to get a list and not a single record.
4. Note that the item in question is labelled as 'Not available'
   (Damaged).
5. Apply the patch; restart_all.
6. Repeat p. 3.  Note that the item is now labelled as 'available for
   loan'.
7. Set AllowHoldsOnDamagedItems system preference is set to 'Don't
   allow'.
8. Repeat p. 3.  Note that the item is now labelled as 'Not available'.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:49 +01:00
Emmi Takkinen 5002a0dac9
Bug 37987: Speed up downloading reports in .tab format
Downloading SQL report in .tab format was significantly
slower after changes made in bug 37382. Apparently using
HTML::Scrubber to redeclare content variable after
mapping it is slow. Instead sending whole map function
as parameter to module speeds up downloading to couple
of seconds as it was before.

To test:
1. Find or create report that returns several thousand rows
(e.g. SELECT * FROM items LIMIT 4000).
2. Run report and attempt to download it as .tab file.
=> Notice that this takes a lot of time (around 20 seconds).
3. Apply this patch.
4. Download report again.
=> Dowloading should now take couple second.
=> Confirm that the content of .tab file still contains table
data.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:49 +01:00
Owen Leonard 4cdf12d462
Bug 38379: Remove obsolete Bootstrap classes from installer templates
This patch makes some minor markup changes to the installer and
onboarding templates so that obsolete Bootstrap grid classes are
removed. The patch also adds another breakpoint to the grid classes to
that the content adjusts well at smaller viewport sizes.

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

- Drop and recreate the Koha database. Run 'restart_all' if necessary.
- Navigate to the staff interface. You should be presented with the
  installer login. The form should be centered on the page.
- Log in and follow the installer and onboarding steps to confirm that
  the layout looks correct on each page.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:48 +01:00
Jonathan Druart 1f5e3b66f8
Bug 38130: Allow sorting and filtering on library id and name
On the item list of the bib detail page and the patron search we want
the library columns ('holding library', 'home library' and 'library') to
be sorted by library names and to make them searchable on library id and
name.

Concerns about this approach (comment #8):
"""
If we do it for the library names on this view, we need to do it for all the library columns (thinking about patrons right now but I am sure there are others). And to be consistent, for all the other coded values: "special AVs" (item types, cn source), regular AVs, patron category codes, etc.

We will introduce additional JOINs and so maybe performance problems. This needs to be investigated before we take this route IMO.
"""

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:47 +01:00
Jonathan Druart 4212da8180
Bug 38130: Add the ability to filter item by library name
On the item list of the bibliographic record page you actually can filter
items by library, either using the dropdown list on top of the column
or using the library_id (branchcode) in the global search.

But you cannot search using the library's name in the global search.

This patch add yet other embeds to allow this.

I am not sure this is needed, we won't be able to do the same for item
type and AV, so maybe it is not worth 2 additional JOINS.

Maybe we should tell people you should use the column filters when a
dropdown list is there, instead of: "it works, sometimes".

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:47 +01:00
Nick Clemens cfb72ca7fa
Bug 37478: Rename strict to skip_bad_records and add POD
Option name changed, POD updated.
The reason not to do this by default is that it is an extra record conversion
to check the validity, so may slow down the import.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:46 +01:00
Nick Clemens 43fd84508d
Bug 37478: (follow-up) Add MARC::Lint to cpanfile
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>
2024-11-08 11:23:46 +01:00
Nick Clemens 0306281e41
Bug 37478: Add strict mode to bulkmarcimport
This patch adds a conversion from MARC -> XML -> MARC to catch any parsing errors.
If errors are found, we then lint the record to catch any problems, output the
warnings, and skip the record.

To test:
1 - Download the sample records from this bug report
2 - perl misc/migration_tools/bulkmarcimport.pl -b --file=520_nosubfield.mrc -v
    fails!
3 - perl misc/migration_tools/bulkmarcimport.pl -b --file=003_subfielda.mrc -v
    fails!
4 - Apply patch
5 - Repeat 2 & 3 - no change
6 - Add -st switch to the commands:
    perl misc/migration_tools/bulkmarcimport.pl -b --file=520_nosubfield.mrc -v -st
    perl misc/migration_tools/bulkmarcimport.pl -b --file=003_subfielda.mrc -v -st
7 - The records are now skipped, and the script completes
8 - Confirm the warnings generated are useful
9 - Sign off!

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>
2024-11-08 11:23:45 +01:00
Tomas Cohen Arazi 431b2c4a5d
Bug 31224: Revert to $metadata->record in `marcrecord2csv`
This patch reverts the change for marcrecord2csv as
`$biblio->metadata_record` doesn't support a list of itemnumbers, and it
feels we should discuss in another context whether to add it as a
parameter, or make it a Koha::Items iterator. The Koha::Item object is
actually retrieved in marc2csv so there's room for easy improvements
without adding technical debt (i.e. bad method signatures for a single
use case).

This fixes a feature:

1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Exporter/Record.t
=> FAIL: Test fails because the 'items' are not being filtered on the
passed itemnumbers (i.e. all items are picked for generating the CSV).
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>
2024-11-08 11:23:45 +01:00
Tomas Cohen Arazi fd90de9e49
Bug 31224: Move item field removal up to $metadata->record
This patch addresse the fact Koha needs to strip out stray item field in
MARC records coming from the DB. While this is not ideal, it has worked
so far, limiting the negative effects of bad data to Koha users.

I put a FIXME because I think it deserves to be revisited colectively at
some point. I filed bug 38406 to track the discussion around this.

The `marcmarcrecord2csv.t` tests cover this behavior and I thought
removing it was not in the scope of this bug.

I decided to move the removal one step up in the call chain so it
applies to all calls to `$metadata->record`, not only those that ask to
include items. This is the right thing to do while we keep this
behavior.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Record/marcrecord2csv.t
=> FAIL: Item information gets extracted from more items than expected
(i.e. the item in the MARC record is not stripped out so 'Withdrawn'
shows 3 times instead of 2).
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Run:
  k$ prove t/db_dependent/Koha/Biblio/Metadata.t
=> SUCCESS: Tests pass! The behavior change in $metadata->record works
as intended!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 11:23:44 +01:00
Tomas Cohen Arazi dd79a55a34
Bug 38342: Pass the value to exception to avoid warnings
This patch makes the exception on bad enum values in Koha::Object->store
not print a warning in the event of stringifying the exception.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Booking.t
=> FAIL: You get this warnings:

```
Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/Exceptions/Object.pm line 84.
```
2. Apply this patch
3. Repeat 1
=> SUCCESS: No more uninitialized values warnings
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-07 18:49:40 +01:00
Owen Leonard fee196a0e5
Bug 30699: Fix various HTML validity errors in staff interface templates
This patch fixes several HTML validity issues in various staff
interface templates. Most of these changes won't be visible in the
interface.

- Advanced search:
  - Remove stray </a> tags
  - Fix duplicate IDs by adding loop.index to repeated dropdown menus
- Circulation
  - Fix mismatched label and form field id in checkouts table footer
  - Fix mismatched label and form field id claim returned modal
  - Remove invalid href attribute from button in claim returned modal
  - Wrap relatives' checkouts tab in conditional so that panel doesn't
    appear when tab has been hidden
  - Fix duplicate id attributes in patron messages-related markup
  - Remove redundant class attribute from patron messages-related markup
- Acquisitions -> Vendor -> Basket -> Add to basket -> From staged file
  - Remove invalid "size" attribute from hidden form fields
- Circulation -> Holds awaiting pickup
  - Fix mismatched label and form field id
- Patron -> Accounting -> Pay fine -> Submit cash amount higher than the
  charge
  - Remove invalid href attribute from button in confirmation modal
- Fix errors in tab markup WRAPPERs in html_helpers.inc to prevent
  mismatched aria-labelledby attributes
- Footer language selector:
  - Fix markup to correct errors in aria-controls
- Remove invalid href attribute from cookie consent modal

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-07 18:49:40 +01:00
Lari Taskula 8cfce49d14
Bug 35126: Remove onload from opac-addbybiblionumber.pl
To test:

Case a) Adding to a new list

1. Enable virtualshelves system preference
2. Search for any record and click it
3. On the right hand side of record view, click "Save to your lists"
4. A new pop up opens.
5. Under "Add to a new list", give any name to the list
6. Under "Add to a new list", click "Save"
7. Observe popup closing
8. Observe record view page reloading

Case b) Adding to an existing list

1. Enable virtualshelves system preference
2. Search for any record and click it
3. On the right hand side of record view, click "Save to your lists"
4. A new pop up opens.
5. Under "Add to a list", select an existing list
(it can be the same as the one you created in case a, it does not matter here)
6. Under "Add to a list", click "Save"
7. Observe popup closing
8. Unlike case a, observe record view page NOT reloading

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-07 18:49:39 +01:00
Phil Ringnalda c70946a0be
Bug 38329: Remove orphan confirm_deletion() in supplier.tt
The JavaScript function confirm_deletion() in supplier.tt has either
been an unused orphan since bug 28082 two years ago, or since the switch
from YUI to Bootstrap 12 years ago. Doesn't matter which, nothing calls
it, and if it was called, it would fail by trying to GET with
op="delete" rather than POST with op="cud-delete".

Test plan:
 1. Acquisitions - New vendor, enter a name and Save
 2. Click the name of your new vendor, so your URL is at supplier.pl
 3. Click Delete vendor to verify that deleting still works without this
    unused code which would fail

Sponsored-by: Chetco Community Public Library
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-07 18:49:39 +01:00
Ewa Gozd 099598d067
Bug 38283: fixed wrong ending tag in patron search modal
Fixed mis-matched a/button tags on "Close" button.

To test:
- Apply patch
- In staff interface: Go to acquisitions > suggestions
- Create a new suggestion
- Click on "Set to patron"
- Verify the close button in the modal looks correct and works

Signed-off-by: Jan Steinberg <jan.steinberg@gesis.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-07 18:49:38 +01:00