Commit Graph

54729 Commits

Author SHA1 Message Date
Fridolin Somers 405ddad65b Bug 36317: Koha::Biblio->host_items must use me.itemnumber
Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause.
It must use me.itemnumber like in Koha::Biblio->items

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a9964bc8a9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-22 21:12:54 +00:00
Fridolin Somers a267e9a25d Bug 36317: Add unit test
If fails it shows :
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'itemnumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 399

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d193455ec2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-22 21:12:54 +00:00
David Cook 5e7e39e10d Bug 38030: (QA follow-up) Move csrf_token to POST body from URL
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit aec1ad5bab)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-21 14:34:53 +00:00
Janusz Kaczmarek f7dd1d21a8 Bug 38030: stocknumberAV.pl fails with CSRF protection
The value builder stocknumberAV.pl does not work after applying the CSRF
protection. In console, it generates entries like:

POST
http://localhost:8081/cgi-bin/koha/cataloguing/plugin_launcher.pl
[HTTP/1.1 403 Forbidden 188ms]

Test plan:
==========
1. Modify the MARC bibliographic framework for the default framework by
   choosing stocknumberAV.pl as plugin for subfield 952 $i.
2. In Authorized values, add a new category 'INVENTORY'.  Add a new
   entry there, e.g. 'ABC', with any number in Description (eg. 123).
3. Find any bibliographic record, make sure it uses the default framework.
   If not set the framework accordingly.
4. Edit an item linked to this record.  Go to the 'i - Inventory number'
   subfield.  You should see three dots on the right.  In the input field
   put ABC and click the three dots.
5. Nothing happens.  You can check in the browser console--there should
   be a message like:
   POST http://FQDN:8081/cgi-bin/koha/cataloguing/plugin_launcher.pl
   [HTTP/1.1 403 Forbidden 188ms]
6. Apply the patch; restart_all.  Refresh the browser window.
7. Repeat p. 4.  You should now get the next sequence number next to
   the 'ABC' (i.e. ABC 0000000124 or similar).

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bba164856c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-21 14:34:53 +00:00
Jonathan Druart 82ecc318f9 Bug 38085: Pick multiple_sortable options for translation
Bug 29948 added a "multiple_sortable" type for sysprefs, to have the
options sortable. But the options were not picked for translation.

This patch fixes it.

Test plan:
Run `cd misc/translator && perl translate update LANG` before and after
this patch. Notice that with this patch you see the different options of
OPACAuthorIdentifiersAndInformation in the LANG-pref.po file (eg.
"Associated group (373$a$s$t$u$v$0)")
Translate the options
Install the translated version of the templates and confirm that the
strings appear translated on the interface.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 738c641bcc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 23:30:45 +00:00
Kyle M Hall 400435d4fb Bug 36560: (QA follow-up) Tidy code
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5f2807b370)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 23:30:20 +00:00
David Cook b8214ffb4a Bug 36560: Add a CSRF exception for ILS-DI API
This change adds an exception for the ILS-DI API for CSRF prevention since there is no way to acquire a CSRF token
for the ILS-DI API.

1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI
2. Enable "ILS-DI"
3. curl -v localhost:8080/cgi-bin/koha/ilsdi.pl -d "service=AuthenticatePatron&username=REALUSER&password=REALPASSWORD"
4. Note the 403 response

5. Apply the patch
6. sudo koha-plack --restart kohadev

7. curl -v localhost:8080/cgi-bin/koha/ilsdi.pl -d "service=AuthenticatePatron&username=REALUSER&password=REALPASSWORD"
8. Note the 200 response

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 8472279d5c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 23:30:20 +00:00
Paul Derscheid be478eeb66 Bug 38272: Additionally fix typo in condition for acquisition orders permission
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3ff6ded868)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 23:21:55 +00:00
Paul Derscheid 8de5dd66e6 Bug 38272: Add permission check for erm permission to additional-fields.tt
To test:

1) Create a user with just erm and catalogue permissions.
2) Open additional-fields.pl
3) Notice that nothing is displayed
4) Change the permission of the user to just manage aquisition orders and catalogue
5) Navigate back to additional-fields.pl
6) Notice that nothing is displayed
7) Apply patch
8) Repeat 1-6 but notice this time that the respective entries are displayed
9) Sign off

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 48b938d35c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 23:21:55 +00:00
Tomas Cohen Arazi ec28414168 Bug 38249: Fix typo in koha-list --help
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 85239f0fbf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:42:39 +00:00
Nick Clemens 5bb19beff8 Bug 38117: Only show 'not checked in' message if item is checked out
To test:
 1 - Enable system preference 'ShowAllCheckins'
 2 - Set system preference 'BlockReturnOfWithdrawnItems' to 'Block'
 3 - Check in an item
 4 - Note 'Item was not checked in message'
 5 - Confirm it happens for any item that is not currently issued
 6 - Check out an item to a patron
 7 - Mark the item as withdrawn
 8 - Check the item in
 9 - Note message 'Item was not checked in' appears too
10 - Apply patch
11 - Confirm checking in an item not checked out only shows 'Not checked out'
12 - Confirm the withdrawn item still shows 'Item was not checked in'
13 - Confirm above message remains whne checking in more items that were not issued

Signed-off-by: Michelle Spinney <mspinney@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 91ba4fcfd7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:42:21 +00:00
Kevin Carnes 2d2e2bbb5a Bug 36171: Fix template toolkit tags split by HTML parser
It appears that the template parser parses HTML tags first and then template
toolkit tags. This can cause a template toolkit tag that contains an HTML tag
to have its start and end markers separated. This causes it to be treated as
text that can be translated instead of a template toolkit tag.

This patch searches for text sections that have a template toolkit end marker
without a start and then searches for the start in previous sections. It then
creates a new template toolkit section with the start and end markers.

The action buttons in the staff Lists view have been changed to allow
translation.

To test:
1. You will need to edit the staff-prog.po for a language and modify the
   the translation for "SET line_break". You can change SET to FOO.
2. Install the translation for the language.
3. View the details of a patron in the staff interface with the language.
4. The page will have an error.
5. Apply the patch.
6. Install the translation for the language.
7. View the details of a patron in the staff interface with the language.
8. The page should now display correctly.

If you want to, you can run "gulp po:update --lang LANGUAGE-CODE" to make sure
that the template tag is no longer included in .po file.

You can also add translations for "Edit", "Delete", and "Transfer" in
messages.po to make sure that the action buttons are translated in the Lists
view.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Amended-by: Jonathan Druart
Tidy

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 cf634fa014)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:42:06 +00:00
Nick Clemens 6264f861a3 Bug 38237: Add POD
This patch adds POD to the script and rpelaces the custom help script with pod2usage

TO test:
perl misc/cronjobs/erm_run_harvester.pl
Confirm you get helpful usage data

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0ff61ab9d9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:41:50 +00:00
Nick Clemens 3bdb9a9624 Bug 38237: Add logging to erm_run_harvester cronjob
This patch simply adds logging to the cronjob

To test:
1 - Enable CronjobLog
    http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CronjobLog
2 - Enable ERMModule
    http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ERMModule
3 - Home -> E-resource Management -> Data providers -> New data provider
    Fill from registry or create your own, but change the URL and put in any required numbers
    We don't need a real test, just to run the ob
4 - perl misc/cronjobs/erm_run_harvester.pl --begin-date 2024-01-01 --dry-run --debug
5 - View the logs, no log of the script
6 - Apply patches
7 - Run the job again
8 - Check logs
9 - Success!

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6ce5df7f8e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:41:50 +00:00
Phil Ringnalda e890457245 Bug 38200: Remove dead code to delete authorities in authorities/authorities.pl
It has probably never been used. There's no sign of any UI to delete from
the authority editor or auth_finder in the last 13 years of templates, and
it was unused when it landed; the patch that actually made the first patch
work, a month later, put deleting authorities in authorities_home.pl, where
it has been ever since.

It certainly hasn't been used since bug 17600 landed in 2021, since it
doesn't 'use C4::AuthoritiesMarc qw( DelAuthority );' and so if you try to
use it you just get an error for your trouble.

Sponsored-by: Chetco Community Public Library
Signed-off-by: Yanjun Li <yanjun.li@bywatersolutions.com>

Amended-by: Jonathan Druart
tidy

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 3fdf4ebcc1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:34:52 +00:00
Jonathan Druart c746a74674 Bug 38177: Fix lengthMenu by removing extend
$.extend is doing a deep copy of the objects.

```
var dataTablesDefaults = { "lengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, __('All')]] };
var mine = {lengthMenu: [[1, 2, 5, 10], [1, 2, 5, 10]]};
$.extend(true, {}, dataTablesDefaults, mine);
```
Returns:
```
[
  1,
  2,
  5,
  10,
  -1
]
```
Which is ugly and not what we want.

We only need to merge the first level. Using the spread operator (...) will do the trick here.

Note that we certainly want to adjust all the other occurrences of
extend for DT's options.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.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 b1cd9cccd2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:34:36 +00:00
Pedro Amorim b2823543f5 Bug 38177: Fix lengthMenu for components using KohaTable
EBSCO HoldingsIQ doesnt consider a "All" option so neither should we.
At the moment, if we pick 'All', only 100 are listed due to the logic in Providers/EBSCO/build_query_pagination.
The original code hints at trying to do this but its not working.
I think this got lost sometime during KohaTable.vue

This patch should also have the same entry for EHoldingsEBSCOTitlePackagesList but that isnt using KohaTable and for some reason its not picking up on either aLengthMenu or lengthMeny, always shows 'All'.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.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 ca0e745c1d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:34:36 +00:00
Jonathan Druart 8f96db1238 Bug 38177: Do not use stash to retrieve parameters
The pagination for EBSCO's titles, packages and resources is broken. We
shouldn't rely on $c->stash but use params from the request instead.

Test plan:
1) Setup all the system preferences in ERM:
<staff_url>/cgi-bin/koha/admin/preferences.pl?tab=erm
2) Enable EBSCO in ERMProviders. Set the ERMProviderEbscoApiKey and ERMProviderEbscoCustomerID prefs.
3) Do a search that returns more than 20 records. Click on a page other than 1. Notice the records do not change (Page is the same).
4) Apply patch. Repeat. Notice pagination now works.

Search titles, packages and resources
Use the pagination and modify the number of results per page

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.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 61b3aa2aa2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:34:36 +00:00
Magnus Enger 5c70224644 Bug 38173: Fix description of koha-dump --exclude-indexes
To test:
- Look at debian/scripts/koha-dump
- The description of --exclude-indexes reads:
  "Include Zebra indexes on the backup"
- Apply the patch
- Look at the file again. The description is now:
  "Exclude Zebra indexes from the backup"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0c23b98782)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:33:58 +00:00
Magnus Enger 193f5676bf Bug 37787: Remove mention of elastic_index from POD
After the introduction of misc/workers/es_indexer_daemon.pl,
misc/workers/background_jobs_worker.pl should not handle the
elastic_index queue. But the latter script still mentions this
queue in the POD. This patch removes that mention.

To test:
- Run perldoc misc/workers/background_jobs_worker.pl
- Verify "elastic_index" is mentioned under --queue
- Apply this patch
- Run perldoc again and verify the mention of "elastic_index"
  is gone

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 476ae27df0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:32:53 +00:00
Magnus Enger 30dc2f94f6 Bug 37787: Undocument koha-worker --queue elastic_index
To test:
- Copy the koha-worker script to the standard location:
  $ sudo cp debian/scripts/koha-worker /usr/sbin/koha-worker
- Check "sudo koha-worker --help" and verify elastic_index is
  not mentioned in the list of "current queues"
- See https://wiki.koha-community.org/wiki/Testing_man_pages for
  how to check the "man" page. elastic_index should not be
  mentioned in the list of "Current queues".
- Both places aboce should have a note about elastic_index not
  being active when koha-es-indexer is running.

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dba23e4da1)
2024-11-20 18:32:45 +00:00
Jonathan Druart 106e88f281 Bug 37395: Fix columns visibility on Vue tables
On bug 33066 we reworked a lot of datatables.js to make the JS function
reusable from the Vue component (and especially the KohaTable
component). I guess the regression comes from this change, but I am
surprised that we didn't catch it when testing.

The was a mistake for _dt_visibility, we didn't pass the node. Actually
we cannot pass it as we do not have it yet.

This "node" variable is only used when bKohaColumnsUseNames is passed
(ie. we do not rely on the order of the columns but we need to rely on
their data-colname attributes).

There is then a limitation here: we cannot use bKohaColumnsUseNames from
Vue, but we do not yet.

An ideal fix would be too big for now, especially for an hypothetic use
case.

Test plan:
Confirm that the "Columns" button are now back for the tables of the Vue
apps (ERM, Preservation) and that the settings are taken into account
(hide by default, etc.)

Signed-off-by: Olivier V <olivier.vezina@inLibro.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 1a8542f05d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:29:21 +00:00
Jonathan Druart 589cc320fa Bug 35769: Remove extra parenthesis
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 07cf21e6b9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:25:35 +00:00
Katrin Fischer b40117a31b Bug 35769: Fix untranslatable strings in request.tt
This fixes some strings in the JavaScript part of the
template that were missing from the po files.

This is one way to test:
* Apply patch
* Run gulp po:update --lang <language-code>
* Compare strings changed in the patch, with strings
  appearing in <language-code>-staff-prog.po
* Translate the strings and remove "fuzzy" line
* In k-t-d, run:
  sudo koha-translate --install <language-code> --dev <instance>
* Verify that now the translated version of the template contains
  your translated strings
* Verify the translated page works correctly, no errors

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 928b606083)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:25:35 +00:00
Jonathan Druart 006f94a718 Bug 31581: Remove zebra files for NORMARC
Those are leftovers, we should have removed them on bug 18984.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Looks good!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8e5774cdfe)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:25:06 +00:00
Janusz Kaczmarek f1c9a95c3a Bug 38082: Advanced editor does not save the selected framework
When creating a fresh record in the advanced editor, it does not
save the framework selected from the Settings dropdown.

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

1. Enable the advanced editor feature (EnableAdvancedCatalogingEditor).
2. Start editing a new record in the advanced editor.  Fill in the
   mandatory fields, select a framework (other than Default) from the
   Settings dropdown, save the record.
3. Select view -- note that the record has been saved with the Default
   framework.
4. Apply the patch; restart_all; refresh the browser window.
5. Repeat p. 2.
6. Select view -- you should now see that the record has been saved with
   the correct, selected framework.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 145bc398c1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:24:30 +00:00
David Cook 6bde7f52b9 Bug 38065: (QA follow-up) Move csrf_token to POST body from URL
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a369ace161)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:23:40 +00:00
Janusz Kaczmarek 9acd02725c Bug 38065: Auto control number (001) widget in advanced editor does not work under CSRF protection
Auto control number (001) widget in advanced editor does not work under
CSRF protection.  A token should be passed to POST ...
control_num_sequences call.

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

1. Verify that the CONTROL_NUM_SEQUENCE category in authorized values is
   present.
3. Add a new authorized value for CONTROL_NUM_SEQUENCE:
     b) authorised value: sprLib0001
     c) in Description - a short string indicating the type of control
     number i.e. "Springfield Library"
4. Create a new bib record using the advanced editor, insert a 001
   field, note that the 001 widget is there.  Click on "Assign next". There
   should be no effect (and you could see [HTTP/1.1 403 Forbidden 706ms] in
   the browser console).
5. Apply the patch ; restart_all ; reload the browser.
6. Repeat p. 4.  You should get the content of the 001 field generated
   by the widget.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bc1af60e1a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:23:40 +00:00
Lucas Gass 4ac03f9d87 Revert "Bug 36320: Clicking Edit items from catalogue/detail.pl leads to 'Add item' screen"
This reverts commit 71f0dd6ba9.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 18:20:17 +00:00
Matthias Meusburger 0acc0dffb1 Bug 18273: Do not insert authority if there already are duplicates in koha
Test plan:

1) Create an authority with a unique value in a searchable field, for instance a PERSO_NAME authority with 'BZ18273' in the 100$a field.

2) Create a second authority with the same value in the same field.

3) Export this second authority as iso2709 (Save -> MARC (Unicode/UTF-8))

4) Run bulkmarcimport.pl with the following parameters:
perl bulkmarcimport.pl -a --file=/kohadevbox/koha/auth-xxxx.utf8 --match='Heading,100$a' -l /kohadevbox/koha/bulk.log

5) Check in the log file and/or through search that a third authority has been added (despite using the --match option)

6) Apply the patch

7) Delete the 3 authorities and repeat step 1 to 4.

8) Check that a third authority has not been added (--match worked)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e2fba91bf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 17:54:43 +00:00
Owen Leonard 71f0dd6ba9 Bug 36320: Clicking Edit items from catalogue/detail.pl leads to 'Add item' screen
This patch updates the catalog toolbar so that the "Edit items"
choice under the "Edit" menu is replaced with a new option: "Manage
items," which takes you to the top of the add/edit items page. The "New
item" menu item has been modified to add the anchor so that the link
jumps the user directly to add item form (past the existing items).

The patch also adds a "Jump to add item form" link at the top of the
add/edit items page.

To test, apply the patch and search for a bibliographic record in the
staff interface.

- View the detail page for the record.
- Click the "Edit" menu button in the toolbar.
- You should see the new menu item, "Manage items."
- Clicking the "Manage items" button should take you to the top
  of the add/edit items page in cataloging.
  - You should see a "Jump to add item form" limk under the page
    heading.
  - Clicking it should jump you to the "Add item" form.
- Clicking the "New item" menu item from the bibliographic detail "New"
  menu should take you directly to the add item form, scrolling down
  past the existing items.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.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 119e5561a3)
2024-11-20 17:44:44 +00:00
Thomas Klausner ca526d63c7 Bug 35466: (follow-up) document skip_indexing parameter to bulkmarciport.pl
Add documentation for the new -si, --skip_indexing parameter

Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e200988cb8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 14:47:19 +00:00
Nick Clemens 9266f2b63f Bug 35466: (follow-up) Go to next if error, add to indexing call if not
Before the previous patch we were indexing with every AddAuthority/ModAuthority call and I assumed
we were also indexing during the commity, however, it appears we were not. This patch ensures we push
the record and ids into the arrays for indexing during commit.

Additionally I add a skip to next record on error, to match biblio behaviour.
I also correct a log referring to biblios during authority importing

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f522fbff32)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 14:47:19 +00:00
Nick Clemens 76c1387263 Bug 35466: Add skip_indexing parameter to bulkmarcimport.pl
This patch adds a new optoin to skip indexing to bulkmarcimport.
It also fixes a bug where authorities were being indexed multiple times
during import.

To test:
 1 - Apply patch
 2 - Download the sample files on this bug
 3 - Perform asearch engine search that should retrieve all records( 'a' in Zebra, '*' in ES)
 4 - Note the total (435 in KTD)
 5 - perl misc/migration_tools/bulkmarcimport.pl -b -v --file=bug_35466_b.mrc
 6 - Search again, note increaed by 100
 7 - perl misc/migration_tools/bulkmarcimport.pl -b -v --file=bug_35466_b.mrc --skip_indexing
 8 - Search again, no increase
 9 - perl misc/search_tools/rebuild_elasticsearch.pl -v
10 - Search again, increase, records were added but not initially indexed
11 - Browse to authorities and search as for biblios
12 - perl misc/migration_tools/bulkmarcimport.pl -a -v --file=bug_35466_a.mrc
13 - Search again, note increase
14 - perl misc/migration_tools/bulkmarcimport.pl -a -v --file=bug_35466_a.mrc --skip_indexing
15 - Search again, no increase
16 - perl misc/search_tools/rebuild_elasticsearch.pl -v
17 - Search again, increase, records were added but not initially indexed
18 - Sign off! Hi5!

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e01fb16455)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 14:47:18 +00:00
Phil Ringnalda 93d5737493 Bug 37977: Fix some issues with labels in inventory form
The inventory form has several issues with labels with a for attribute that
doesn't match the id of the input, so the label doesn't actually get linked
to anything.

Test plan:
 1. Without the patch, go to Cataloging - Inventory
 2. In the section for "Item location filters" click the label for "Shelving
    location (items.location) is", which will focus the select menu, then
    press the down arrow on the keyboard to see that it's focused by opening
    the select menu.
 3. Click in a blank spot to close the select menu, then click the label for
    "Collection" and press the down arrow key, which will scroll the page
    since the label didn't focus the menu, and repeat with "Call number
    classification scheme" which also will scroll the page when you press
    down arrow.
 4. In the section for "Optional filters for inventory list or comparing
    barcodes" click any of the labels below items.notforloan - clicking a
    checkbox label should toggle whether the checkbox is checked, but it
    will not
 5. Apply patch, refresh page
 6. Repeat steps 3 and 4, but this time you will get the proper behavior,
    focusing the select menus and toggling the checkboxes

Sponsored-by: Chetco Community Public Library
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fa5b7e8260)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-20 14:46:16 +00:00
Phil Ringnalda 6f02fffe11 Bug 38413: Batch operations from item search need to POST to not exceed URL length limits
Batch item modification and deletion accepts either op="show" or op="cud-show"
because sometimes you just have one item and it's saner to GET with one, but
sometimes you've selected 961 items from itemsearch and you need to POST to
not get hit by Apache's "too long" error.

Bug 36630 switched item search from using POST to GET because item search is
confusing. It uses a form with a dummy op and then empties out the form and
adds back contents, and the CSRF protection changed the dummy op to "cud-show"
so it could POST, but didn't notice that the op would be replaced by one that
was still "show." The form needs to go back to POST, the dummy contents need a
comment saying they are just dummies so nobody else gets fooled, and the JS
that replaces the form contents needs to insert a CSRF token and the correct op.

Test plan:
 1. Without the patch, Search - Item search, search with no criteria so you
    get hundreds of items
 2. Change to Show All entries, then Select visible rows
 3. Batch operations - Batch item modification
 4. Apache should give you an error about your overly long URL
 5. Apply patch and repeat steps 1-3
 6. After a long pause while Batch item modification swallows the POST, you
    should get the batch modification form with all your items.

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b2ea96e351)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 16:38:46 +00:00
Jonathan Druart db6915c009 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>
(cherry picked from commit 1f5e3b66f8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 16:32:52 +00:00
Jonathan Druart 67bba93fd1 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>
(cherry picked from commit 4212da8180)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 16:32:52 +00:00
Kyle M Hall cf0a222fb2 Bug 35508: (QA follow-up) Fix qa script issues
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 056abc5321)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 16:03:20 +00:00
Kyle M Hall e5ed5e05f9 Bug 35508: Don't update patron attributes if new list of attributes matches list of existing attributes
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit eed4b0940d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 16:03:20 +00:00
Kyle M Hall 2d340da8f8 Bug 35508: Move logic to Koha::Patron::Attribute::store()
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4624425bf8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 16:03:20 +00:00
Hammat Wele ac1172bf6a Bug 35508: Update borrowers.updated_on when modifying a patron's attribute
Currently, if you have patron attributes and modify the values in a patron's account, the patron's updated_on date is not updated. This patch makes the "Updated on" change when a patron attribute is updated.

To test:

1. Create a patron attribute type
   1.1. Go to Administration > Patron attribute types
   1.2. Click New patron attribute
   1.3. Fill out the code and description
   1.4. Click Save

2. Edit a patron (normal)
   2.1. Go to Patrons and find a patron account
   2.2. Click Edit
   2.3. Change a regular field (e.g. Middle name)
   2.4. Click Save

--> Notice the "Updated on" date in the left column has been updated to now

3. Edit a patron attribute
   3.1. In another patron account*, click Edit
   3.2. Change the value of an attribute
   3.3. Click Save

--> Notice the "Updated on" date did not change

4. Apply the patch
   4.1 Repeat step 3.1, 3.2, 3.3

--> Notice the "Updated on" date has now changed

Signed-off-by: Esther <esther@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 ac99bc6db2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 16:03:20 +00:00
Emily Lamancusa 3060f26131 Bug 37505: (QA follow-up) Adjust tests
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c4ac5eb8e8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 15:59:42 +00:00
Emily Lamancusa 5166fb9d3c Bug 37505: (QA follow-up) Don't log return stat if ignore_localuse and no checkout
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 42ba50e1eb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 15:59:42 +00:00
Lucas Gass 6bd354f74d Bug 37505: Remove onloan check when checking out to stats patron
To test:
1.  Create a Statistical Patron
2.  Set BlockReturnOfLostItems to Block.
3..  Mark an item as lost
4. Check it out to the Statistical Patron. You should see the message "Item was lost, cannot be returned."

5. Set BlockReturnOfWithdrawnItems to Block.
6.  Mark an item as withdrawn
7. Check it out to the Statistical Patron. You should see the message "Item was withdrawn, cannot be returned."
8. Turn off BlockReturnOfWithdrawnItems, check out the same item to the Statistical Patron. You should see a message "Item was withdrawn."

9. Place an item on hold.
10. Check it out to the Statistical Patron
11. See the message "Item on hold, please checkin."

12. Make sure  ClaimReturnedLostValue is set to a lost value
13. Claim a return, making sure it is not still checked out to the patron
14. Checkit it out to the Statistical Patron.
15. See the message "Item claimed returned, please checkin."

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

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5ee142c7f7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 15:59:41 +00:00
Andrew Fuerste Henry 40f8e3fb8c Bug 38012: Remove ispermanent from returns and branchtransfers
To test:
There should be no change in behavior, as this code is not referred to elsewhere in Koha. Make sure you can still do checkeckins and transfers.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6760de2d88)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 15:55:13 +00:00
Jonathan Druart 5d390464da Bug 37905: Fix parameter name
It's named enqueued_date on the API side, not enqueued_on (which is the DB
column's name)

No behaviour change expected here.

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 fac259d2b9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 15:55:13 +00:00
Jonathan Druart c2284dbaf9 Bug 37905: Use correct RFC3339 formatted date to the server
This patch suggests to revert the previous attempt to fix this problem.
The date was using the client-side's tz and so the "last hour" was not
matching the one from the server.

With bug 37831 with simply need to pass a rfc3339-formatted date and the
filtering will be done as expected.

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 caca6791ce)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 15:55:13 +00:00
Bo Gustavsson 26cbf2492d Bug 37836: Prevent submitting empty barcodes in Self check-in
This patch disbles the "Submit" button when the barcode field is empty.

To test this patch:

Add the patch to your koha clone
Enable the "SelfCheckInModule".
Open the page and the "Submit" button should be disabled when the barcode field is empty.

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 07d212c024)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 15:55:13 +00:00
Baptiste Wojtkowski 9cc99b3eaf Bug 37606: Fix framework export module to escape double quotes
When exporting a framework as csv, the exporter does not check the presence of double quote in the fields. Hence, if there is one double quote, the csv is broken.

TEST PLAN:
1 - Change a framework to add a field containing double quote in name
2 - Export it in csv
3 - Create a new framework
4 - Import the csv in the new framework -> every fields after the one
containing double quotes should be broke. Every other fields should have
no subfield
5 - APPLY PATCH
6 - Repeat 2-5 -> everything should be correctly exported

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5f45818cf7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-19 15:55:13 +00:00