koha.git
3 months agoBug 35789: Remove Koha::Template::Plugin::Biblio::ArticleRequestsActiveCount
Jonathan Druart [Fri, 12 Jan 2024 13:34:18 +0000 (14:34 +0100)]
Bug 35789: Remove Koha::Template::Plugin::Biblio::ArticleRequestsActiveCount

Can be replaced with biblio.article_requests.filter_by_current.count

Test plan:
Turn on article requests (syspref + circ rule)
Request an article (detail page of a bib record)
On the left you see "Article requests" tab with the number of current
article requests.

It should show the correct number (same as before this patch).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35548: Test KitchenSink plugin
Marcel de Rooy [Thu, 14 Dec 2023 12:25:23 +0000 (12:25 +0000)]
Bug 35548: Test KitchenSink plugin

Removed from Plugins.t on bug 35507.
Restoring it here on its own.
Simplified a bit.

NOTE: The CREATE IF NOT EXISTS seems to commit even when the
table already exists. Therefore mocking install too.

Test plan:
Check number of records in plugin_data/methods.
Run t/db_dependent/Koha/Plugins/KitchenSink.t
Check again number of records in plugin_data/methods. Same?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35768: Show 'Used in' records link for results in cataloguing authority plugin...
Aleisha Amohia [Fri, 5 Mar 2021 01:05:09 +0000 (14:05 +1300)]
Bug 35768: Show 'Used in' records link for results in cataloguing authority plugin search

To test:

1. Edit a biblio record
2. Go to the 100 tab and click the plugin launcher icon for an author
   tag i.e. next to 100$a
3. Search for an authority and observe the results
4. Notice that the number of times this authority has been "Used" in a
   record is now a link, and clicking it does a search showing those
   records.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35857: Update authority search pop-up windows with consistent footer markup
Owen Leonard [Fri, 26 Jan 2024 18:35:50 +0000 (18:35 +0000)]
Bug 35857: Update authority search pop-up windows with consistent footer markup

This patch updates the cataloging authority finder template in order to
style submission and close buttons in a fixed footer at the bottom of
the pop-up window, with markup consistent with other pop-up windows.

Some inline CSS has been removed in favor of styling the "Clear" button
like a default button. Unrelated, "No results found" message has been
wrapped in a "dialog message" div for consistency's sake.

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

- In the "Add MARC record" form, locate a tag which is linked to an
  authority type, e.g. 100$a.
- Click the icon to the right of the field to trigger the authority
  search window.
- There should be a fixed footer in the pop-up window with buttons for
  "Submit," "Clear form," and "Close window." Test that each behave
  correctly.
  - The search results view should have the same footer.
  - Clicking "Choose" from the search results should close the window
    and populate the MARC tag with the correct authority data.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35536: Remove last two references to resultset PluginData
Marcel de Rooy [Tue, 19 Dec 2023 15:29:35 +0000 (15:29 +0000)]
Bug 35536: Remove last two references to resultset PluginData

Test plan:
Run t/db_dependent/Koha/Plugins/Plugins.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35536: Silence tests when run from koha-qa.pl
Marcel de Rooy [Tue, 19 Dec 2023 14:59:36 +0000 (14:59 +0000)]
Bug 35536: Silence tests when run from koha-qa.pl

Extending the regex in Plugins::_verbose.

Test plan:
Run qa tools on patch set.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35536: Refine verbose handling in some Koha::Plugins calls
Marcel de Rooy [Mon, 18 Dec 2023 08:52:20 +0000 (08:52 +0000)]
Bug 35536: Refine verbose handling in some Koha::Plugins calls

Three routines in Plugins got the verbose parameter on 35507.
We can refine this a bit further.
The idea here is report when you are installing plugins but not
report when just calling plugins (flooding logs).

[1] GetPlugins: Most callers do not expect (or check) results for
    failing plugins. This patch makes GetPlugins only return
    errors when passing the *errors* flag (in 2 cases).
    [a] The misc/devel script prints warnings now using verbose,
        so does not need the errors flag anymore.
    [b] plugins/plugins-home is the only case left. Tiny adjustment
        to keep current behavior. Fixed colspan in template.
        Does not need verbose in favor of 'errors' (passed to
        template).
    [c] For most calls we do not want verbose. New default is 0.

[2] InstallPlugins
    [a] Disabled verbose in plugin-upload. Not really needed.
        Added a FIXME; we need to improve individual install.
    [b] misc/devel: No warnings anymore when calling InstallPlugins
        after GetPlugins.

[3] get_enabled_plugins
    [a] Plugins->call does not need verbose.
    [b] Plugins->feature_enabled does not need it too.

Test plan:

[1] See previous plan. With TestMR data but without patch, run
misc script and go to plugins-home. Do you see load errors on
commandline or form?

[2] Run plugins/plugins-upload (uploading just some file is good
enough); verify that you do not see TestMR lines in logfile.

[3] Run t/db_dependent/Koha/Plugins/Plugins.t for the additional
test on verbose and errors flag.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35536: Reorder rollbacks
Marcel de Rooy [Thu, 14 Dec 2023 07:54:22 +0000 (07:54 +0000)]
Bug 35536: Reorder rollbacks

Time to move all RemovePlugins calls BEFORE rollbacks.
Broken.t did not even include a transaction! Some modules
are removed there as well.

Test plan:
Search for wrong order with:
  grep -Pzo "txn_rollback;\n.*RemovePlugins" $(git grep -l RemovePlugins)
  No occurrences left? Think of another grep :)
Check number of records in plugin_data/methods.
Repeat: prove $(git grep -l Koha::Plugin | grep -P "^t\/db")
And check number of records again. Same?

Bonus: Apply TestMR plugin patch (marked DO NOT PUSH).
Run perl -MKoha::Plugins -e"Koha::Plugins->new->InstallPlugins".
Check plugin records in database.
Keep those records but remove last patch from git.
Run previous prove and verify no data changes since last check.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35536: Add RemovePlugins calls in plugin unit tests
Marcel de Rooy [Thu, 14 Dec 2023 08:02:01 +0000 (08:02 +0000)]
Bug 35536: Add RemovePlugins calls in plugin unit tests

[1] Replace Methods->delete by RemovePlugins.
    git grep -l "Plugins::Methods->delete" | xargs sed -i -e's/Plugins::Methods->delete/Plugins->RemovePlugins/g'
[2] Replace $schema->resultset('PluginData')->delete by destructive parameter.
[3] Add RemovePlugins too in Handler->delete too. Note that this call
    might be better off with disable? Added a comment.

Test plan:
prove $(git grep -l Koha::Plugin | grep -P "^t\/db")

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35536: Add Koha::Plugins->RemovePlugins class method
Marcel de Rooy [Wed, 13 Dec 2023 15:12:30 +0000 (15:12 +0000)]
Bug 35536: Add Koha::Plugins->RemovePlugins class method

Test plan:
Run t/db_dependent/Koha/Plugins/Plugins.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35536: Add Koha object classes for plugin_data
Marcel de Rooy [Wed, 13 Dec 2023 15:03:39 +0000 (15:03 +0000)]
Bug 35536: Add Koha object classes for plugin_data

Test plan:
Read the patch.
The objects will be used in subsequent patches, and tested there.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35536: Reorganize Plugins.t
Marcel de Rooy [Wed, 13 Dec 2023 15:20:19 +0000 (15:20 +0000)]
Bug 35536: Reorganize Plugins.t

Move stuff in the middle into new subtest.
Add transaction around second set of subtests.

Test plan:
t/db_dependent/Koha/Plugins/Plugins.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36397: Quick fix for Koha/Plugins/authority_hooks.t
Marcel de Rooy [Fri, 22 Mar 2024 09:48:14 +0000 (09:48 +0000)]
Bug 36397: Quick fix for Koha/Plugins/authority_hooks.t

Lazy approach for now: just ignore the other warnings that are
logical when passing blank records to SearchEngine. Elastic is
a bit more sensitive than Zebra here..

Test plan:
Run t/db_dependent/Koha/Plugins/authority_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 18885: Specify due date behavior according to on-site checkbox
Thibaud Guillot [Tue, 31 Oct 2023 12:57:00 +0000 (13:57 +0100)]
Bug 18885: Specify due date behavior according to on-site checkbox

When a on-site checkout is performed a date is automatically added but
if you unchecked the date remains. Even with OnSiteCheckoutAutoCheck
syspref

Test plan:
1) Do an on-site checkout by clicking on checkbox and see date added
2) Unchecked and see that the date remains on input
3) Do another test with OnSiteCheckoutAutoCheck enabled
4) Apply this patch and repeat actions

Normally now its works correctly

Signed-off-by: tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36331: Don't check reserves that an item cannot fill when checking if it can...
Nick Clemens [Fri, 15 Mar 2024 13:45:58 +0000 (13:45 +0000)]
Bug 36331: Don't check reserves that an item cannot fill when checking if it can be renewed

Before this patch we get all holds on a record and see if we can fill them with available items.
This means we check to fill holds that the item in questoion may not be able to fill, especially
in the case where no holds are allowed on the item type, this is wrong

To test:
1 - Find or create a biblio with two items of different item types
2 - Make sure one item type allows holds, and the other has:
    "Default holds policy by item type"
    Set to "No holds allowed"
3 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Don't allow"
4 - Check out the unholdable item to a patron
5 - Set a hold for a different patron on the next available item
6 - Confirm the checked out item can be renewed (don't renew, just view the checkouts page)
7 - Checkout the other item to a third patron
8 - Confirm the first item can still be renewed
9 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Allow"
10 - Confirm the item cannot be renewed now
11 - Apply patch, restart all
12 - Confirm the item can be renewed
13 - Set the item type to a type that allows holds
14 - Confirm the item can no longer be renewed
15 - Restore the item type
16 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Don't allow"
17 - Confirm the item can be renewed
18 - Check in the item from the third patron
19 - Confirm the item can still be renewed
20 - prove -v t/db_dependent/Circulation.t - test still pass

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36326: Fix batch item mod/del access from biblio detail page
Jonathan Druart [Fri, 15 Mar 2024 12:51:02 +0000 (13:51 +0100)]
Bug 36326: Fix batch item mod/del access from biblio detail page

Allow both $op eq "show" and "cud-show".
We need to keep the POST when we upload a file, but we can simply allow
GET with "show".

Test plan:
Go to the biblio detail page, select an item and test both tools via the links
"Delete selected items" and "Modify selected items"

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>
3 months agoBug 35783: DBRev 23.12.00.011
Katrin Fischer [Fri, 22 Mar 2024 09:29:10 +0000 (09:29 +0000)]
Bug 35783: DBRev 23.12.00.011

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35783: Replace TT plugin's method Biblio::RecallsCount
Jonathan Druart [Fri, 12 Jan 2024 08:41:21 +0000 (09:41 +0100)]
Bug 35783: Replace TT plugin's method Biblio::RecallsCount

We can use biblio.recalls.search( completed => 0 ).count instead.

Test plan:
1. Go to the biblio detail view, click on the different entries in the menu
on the left. Confirm that the "Recalls" tab always has the correct number
of current recalls display in the parenthesis.

2. Run a search and confirm that the number of current recalls are still displayed
for each result.

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>
3 months agoBug 35062: Add class plugin-blocks-submit in addbiblio
Marcel de Rooy [Mon, 16 Oct 2023 10:08:25 +0000 (12:08 +0200)]
Bug 35062: Add class plugin-blocks-submit in addbiblio

Adding this condition in Check() allows you to prevent form submittal
during e.g. an ajax call in a framework plugin.
The plugin adds and removes the class on the corresponding html
element during processing.

Test plan:
Since we do not have a plugin using this class yet, nothing changes now.
Verify that you can still click Save in addbiblio while using standard
plugins. In other words: no change in behavior.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
3 months agoBug 35638: Upgrade Enquire JS library from v2.0.1 to v2.1.6
Owen Leonard [Fri, 22 Dec 2023 12:28:38 +0000 (12:28 +0000)]
Bug 35638: Upgrade Enquire JS library from v2.0.1 to v2.1.6

This patch upgrades enquire.js in the OPAC to the latest version,
v.2.1.6. The patch also moves the file (enquire.min.js) into its own
directory for consistency's sake.

Enquire.js lets us use CSS-like "breakpoints" to trigger JS actions. We
use it to in "mobile" views (narrower browser widths): Collapsing the
facets menu and triggering automatic scroll to "main content."

The patch also removes media.match.js which should have been removed in
Bug 29960. At that time Enquire.js required that we used Modernizr to
load media.match.js as a polyfill for older browsers.

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

- In the OPAC, perform a catalog search which will return results.
- At wider browser widths the facets menu will appear in the left-hand
  sidebar.
- When you narrow your browser until the viewport is less than 992
  pixels wide* the facets menu should collapse into a "Refine your
  search" button above the search results.
- If you narrow your browser width to below 600 pixels wide and reload
  the search results page, the browser should automatically scroll down
  so that the "Your search..." heading is at the top of the viewport.

* Use Firefox's Responsive Design Mode to get pixel-level control over
  viewport width: https://firefox-source-docs.mozilla.org/devtools-user/responsive_design_mode/
  In Chrome it's called "Device Mode."

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>
3 months agoBug 35640: Upgrade FileSaver JS library to v2.0.4
Owen Leonard [Fri, 22 Dec 2023 13:19:15 +0000 (13:19 +0000)]
Bug 35640: Upgrade FileSaver JS library to v2.0.4

This patch upgrades filesaver.js from an unknown version added in 2015
to v2.0.4 which was released in 2020. The patch also moves the asset to
its own directory for consistency's sake.

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

- Locate a bibliographic record in the staff interface and edit it.
- Switch to the advanced editor.
- Click the dropdown menu next to the "Save to catalog" button, and test
  both the "Save as MARC" and "Save as MARCXML" controls.
- In both cases the record should be downloaded correctly.

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>
3 months agoBug 35642: Upgrade Font Face Observer library from v2.0.3 to v2.3.0
Owen Leonard [Fri, 22 Dec 2023 15:15:20 +0000 (15:15 +0000)]
Bug 35642: Upgrade Font Face Observer library from v2.0.3 to v2.3.0

This patch upgrades the Font Face Observer library from v2.0.3 to the
latest release, v2.3.0. The file is moved to its own directory for
consistency's sake.

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

- Load any page in the OPAC.
- The custom font we supply for the OPAC (Noto Sans) should load
  correctly.
- If you want to see more about the functionality of the library, use
  your browser's developer tools to simulate a slow connection.
  - The page should load with a default sans-serif font first, and then
    the downloaded font will be applied.
  Note: If you throttle your connection speed *too* much, the loading of
  the custom font will time out and you'll only see the default
  sans-serif font.

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>
3 months agoBug 35540: Separate StaffListsHome block from the table block
Owen Leonard [Mon, 18 Dec 2023 18:39:36 +0000 (18:39 +0000)]
Bug 35540: Separate StaffListsHome block from the table block

This patch makes some minor changes to template markup and CSS so that
"page-section" divs have consistent margins.

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

- Go to Tools -> HTML customizations and create a new entry in
  StaffListsHome, StaffPatronsHome, and StaffPOSHome regions.
- Confirm that those customizations are displayed well on each of those
  corresponding pages: The lists home page, the patrons home page, and
  the Point of Sale home page.
- Confirm that other pages affected by the CSS change still display
  correctly. These pages have an added bottom margin on the main
  "container" of content. For example:
  - Patrons -> Patron search results
  - Catalog -> Catalog search results (especially results with multiple
    pages)
  - Circulation -> Circulation history
  - Reports -> Saved SQL reports

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35633: (follow-up) Custom style updates
Owen Leonard [Thu, 21 Dec 2023 19:07:00 +0000 (19:07 +0000)]
Bug 35633: (follow-up) Custom style updates

This patch adds custom CSS to the OPAC and staff interface to override
the default style of Chocolat controls (for left arrow, right arrow,
loading, and close window). These controls are given a green color
matching Koha's color scheme.

The bibliographic detail pages in the OPAC and staff interface have been
revised so that the inclusion of Chocolat CSS comes before the inclusion
of Koha's global CSS. We should do this with third-party CSS so that it
can be more easily overridden by ours.

The patch also makes a minor change to chocolat.js to correct a bug. See
commit 6ac89ca8558.

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

- Go to Administration -> System preferences and enable the
  AllowMultipleCovers, OPACLocalCoverImages, and LocalCoverImages
  system preferences.
- Add a local cover image to a bibliographic record:
  - Locate a bibliographic record.
  - From the detail page, click the "Images" tab and then "Upload."
  - Upload an image to attach to the record.
  - Upload another image.
- Return to the bibliographic detail page fro that record, and click the
  image you uploaded.
  - The full-page image viewer should appear, and the controls should
    look correct, with green matching Koha's color scheme:
    - The close button in the upper-right
    - The right-arrow, and then when you click through to the second
      image, the left-arrow.
    - In the footer, the "edit" link should work correctly.
    - Test that the "Full screen" control works too.
- Click the "OPAC view" link to load the record in the OPAC, and perform
  the same tests.

Signed-off-by: Phan Tung Bui <phan-tung.bui@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35633: Upgrade Chocolat JS library from v1.1.0 to v1.1.2
Owen Leonard [Thu, 21 Dec 2023 19:04:47 +0000 (19:04 +0000)]
Bug 35633: Upgrade Chocolat JS library from v1.1.0 to v1.1.2

This patch updates Chocolat JS library assets from v1.1.0 to v1.1.2 in
both the OPAC and staff interface. The new version uses SVG images
encoded as data-uris in CSS, so default images can now be overridden in
our CSS. For that reason the Chocolat-related images files are removed
by this patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27291: Reformat Zebra output logs
David Cook [Tue, 22 Dec 2020 00:15:02 +0000 (00:15 +0000)]
Bug 27291: Reformat Zebra output logs

This patch changes the Zebra output log time format from
the default "hh:mm:ss-DD/MM" to the more standard ISO 8601
"%FT%T".

This change makes the logs easier to read for both
humans and machines. One benefit includes easy searching
and sorting.

Test plan:

1. cp debian/scripts/koha-zebra /usr/sbin/koha-zebra
2. koha-zebra --stop kohadev
3. koha-zebra --start kohadev
4. ps -efww | grep "zebrasrv"
5. Note "-m %FT%T" in the grep output
6. tail -f /var/log/koha/kohadev/zebra-output.log
7. Run a few searches like http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=ccl%3Dargawarga%3D1 or http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e
8. Note that the timestamp in the Zebra log is formatted "2020-12-22T00:13:42" instead of like "00:13:42-22/12"

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>
3 months agoBug 30349: Add missing double dash (--delete) to POD
Jonathan Druart [Fri, 12 Jan 2024 10:06:48 +0000 (11:06 +0100)]
Bug 30349: Add missing double dash (--delete) to POD

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 30349: More double dashes
David Schmidt [Thu, 24 Mar 2022 12:02:16 +0000 (13:02 +0100)]
Bug 30349: More double dashes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 30349: Use double dash for multi character option names
David Schmidt [Thu, 24 Mar 2022 11:33:43 +0000 (12:33 +0100)]
Bug 30349: Use double dash for multi character option names

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 30349: Tidy bulkmarcimport.pl to fix indentations
David Schmidt [Thu, 24 Mar 2022 11:30:56 +0000 (12:30 +0100)]
Bug 30349: Tidy bulkmarcimport.pl to fix indentations

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36033: DBRev 23.12.00.010
Katrin Fischer [Fri, 22 Mar 2024 08:55:09 +0000 (08:55 +0000)]
Bug 36033: DBRev 23.12.00.010

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36033: Add more indexes to table pseudonymized_transactions
Fridolin Somers [Thu, 8 Feb 2024 09:25:12 +0000 (10:25 +0100)]
Bug 36033: Add more indexes to table pseudonymized_transactions

Table pseudonymized_transactions contains :
  KEY `pseudonymized_transactions_ibfk_1` (`categorycode`),
  KEY `pseudonymized_transactions_borrowers_ibfk_2` (`branchcode`),
  KEY `pseudonymized_transactions_borrowers_ibfk_3` (`transaction_branchcode`)

To improve SQL queries performance, it needs more indexes, specially on itemnumber.

Looking at table statistics :
  KEY `timeidx` (`datetime`),
  KEY `branch_idx` (`branch`),
  KEY `type_idx` (`type`),
  KEY `itemnumber_idx` (`itemnumber`),

So index is need on pseudonymized_transactions columns :
itemnumber => For join with table items
transaction_type => For filter on type issue, return ...
datetime => For filter on date, this will help cleanup script

Test plan :
1) Run updatedatabase.pl
2) Check indexes are created in table pseudonymized_transactions
3) Run SQL query :
   describe select * from pseudonymized_transactions join items using(itemnumber)
   where transaction_type='issue' and datetime < date_sub(curdate(), INTERVAL 30 DAY)
=> You see the 3 new indexes used in 'possible_keys'.

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>
3 months agoBug 36321: Problem when dateexpiry in BorrowerUnwantedField
Fridolin Somers [Thu, 14 Mar 2024 15:37:21 +0000 (16:37 +0100)]
Bug 36321: Problem when dateexpiry in BorrowerUnwantedField

hen dateexpiry is in BorrowerUnwantedField it is hidden in patron edition form.
The problem is when editing an existing patron the value is re-computed with category settings, as if it where empty.

This comes from all fields in BorrowerUnwantedField beeing removed from %newdata in memberentry.pl.
Whe must skip dateexpiry.

Test plan :
1) Be sure dateexpiry is not in BorrowerUnwantedField
2) Define a patron category with enrollment period 12 month
3) Create a new patron in this category
4) Its expiration date is in now + 12 month
5) Edit the patron category to set enrollment period 6 month
6) Add dateexpiry in BorrowerUnwantedField
7) Edit the patron and save
=> Without patch the expiration date is changed to now + 6 month
=> With patch the exporation date is unchanged

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Perl-tidied.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36336: (bug 34478 follow-up) Fix export from catalogue detail
Jonathan Druart [Wed, 20 Mar 2024 10:03:26 +0000 (11:03 +0100)]
Bug 36336: (bug 34478 follow-up) Fix export from catalogue detail

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36327: Update handling of item delete
Pedro Amorim [Fri, 15 Mar 2024 10:53:08 +0000 (10:53 +0000)]
Bug 36327: Update handling of item delete

This needs to be rewritten to .on('click') because the delete item link relevant to this patchset is appended to the dom, this is how we guarantee this event listener is attached to the appended link.
This also ensures the same item deletion logic is applied for both button: The delete button from the left 'Actions' dropdown and the 'Delete item' link that pops up when anywhere in the row is clicked

1) visit a biblio details view:
http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=230
2) Click anywhere on one of the items rows
3) Notice 2 actions show up "Edit item" and "Delete item"
4) Click "delete item"
5) Notice nothing happens in the UI
6) Notice console throws the following error:
cataloging_additem_23.1200007.js:29 Uncaught ReferenceError: confirm_deletion is not defined
    at HTMLAnchorElement.<anonymous> (cataloging_additem_23.1200007.js:29:17)
    at HTMLAnchorElement.dispatch (jquery-3.6.0.min_23.1200007.js:2:43064)
    at v.handle (jquery-3.6.0.min_23.1200007.js:2:41048)
7) Apply patches
8) Notice console error no longer shows
9) Notice delete confirmation is shown, notice clicking it deletes the correct item.
10) Notice the delete item link anywhere in the item row has the same behavior as the 'Delete' option under 'Actions' on the leftmost column of the table

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36327: Delete link is no longer a GET href
Pedro Amorim [Fri, 15 Mar 2024 10:50:50 +0000 (10:50 +0000)]
Bug 36327: Delete link is no longer a GET href

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36327: Clean-up old unused code that results in error
Pedro Amorim [Fri, 15 Mar 2024 10:50:12 +0000 (10:50 +0000)]
Bug 36327: Clean-up old unused code that results in error

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36327: Preparation: Update form
Pedro Amorim [Fri, 15 Mar 2024 10:47:43 +0000 (10:47 +0000)]
Bug 36327: Preparation: Update form

Each delete form now contains the itemnumber to better unambiguosly identify the the itemnumber it refers to
The delete button now carries the itemnumber it refers to

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36351: Pretty the api-client
Jonathan Druart [Wed, 20 Mar 2024 05:09:24 +0000 (06:09 +0100)]
Bug 36351: Pretty the api-client

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36351: Adjust saveRecord and _fromXMLStruct
Nick Clemens [Tue, 19 Mar 2024 15:33:28 +0000 (15:33 +0000)]
Bug 36351: Adjust saveRecord and _fromXMLStruct

Using the new API Client means we need to handle some calls differently.
the http-client is returning only the response, not the text, so we need to handle getting this out
with a new async function (or promises, but this works)

We also need to adjust _fromXMLStruct as we have reduced the levels in the response by the time it is called

This now adds a new 'update' function to the cataloguing client as well.

Eventually, this should all be using the REST API, but I think for now handling the non-standard responses gets it
working again

To test:
To test:
1 - Browse to Cataloguing->Advanced editor
2 - New Record
3 - Enter values and save - confirm it works
4 - Confirm url now ends in : editor.pl#catalog/{biblionumber} and not editor.pl#new
5 - Save the record again, confirm biblio is updated and not saved as new

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36351: Fix http-client when response is not JSON
Jonathan Druart [Tue, 19 Mar 2024 11:04:43 +0000 (12:04 +0100)]
Bug 36351: Fix http-client when response is not JSON

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36351: Add CSRF tokens to advanced cataloguing editor POST requests
Nick Clemens [Mon, 18 Mar 2024 17:28:56 +0000 (17:28 +0000)]
Bug 36351: Add CSRF tokens to advanced cataloguing editor POST requests

The editor uses ajax post requests to SVC api.
Becuase these apis are XML based requests, they must be handled in the simplest way, by
embedding the token as a header

To test:
1 - Browse to Cataloguing->Advanced editor
2 - Fill out needed values and save
3 - 403 error
4 - Apply patch
5 - Reload and try agian, success!
6 - Edit and save again, success!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36302: Get rid of defer_loading in patron-search
Pedro Amorim [Fri, 15 Mar 2024 11:33:42 +0000 (11:33 +0000)]
Bug 36302: Get rid of defer_loading in patron-search

Same test plan as the other patch, behavior is expected to be the same on both

But this alternative removes technical debt, whereas the other patch adds.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36355: Prevent csrf.ts to fail if DB has libraries with long name
Jonathan Druart [Tue, 19 Mar 2024 08:29:13 +0000 (09:29 +0100)]
Bug 36355: Prevent csrf.ts to fail if DB has libraries with long name

If one library has a long name the "Delete" button will not appear on
the screen and the cypress test will fail
 Timed out retrying after 10050ms: `cy.click()` failed because the center of this element is hidden from view

We can either increase the size of the screen or force the click even if
the button is not visible.

Test plan:
Edit a library and set info with long name, address, etc.
Run the cypress test:
  yarn cypress run --spec t/cypress/integration/Auth/csrf.ts
Note the failure, you can watch the video and notice that the delete
button is not on the screen (t/cypress/videos/csrf.ts.mp4)
Apply the patch, try again
=> Succes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35388: Add comment to 'Transfers to send'
Marcel de Rooy [Thu, 23 Nov 2023 09:00:59 +0000 (09:00 +0000)]
Bug 35388: Add comment to 'Transfers to send'

Test plan:
Read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34668: DBRev 23.12.00.009
Katrin Fischer [Tue, 19 Mar 2024 17:02:59 +0000 (17:02 +0000)]
Bug 34668: DBRev 23.12.00.009

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34668: (QA follow-up) Change file permission
Lucas Gass [Mon, 8 Jan 2024 23:38:33 +0000 (23:38 +0000)]
Bug 34668: (QA follow-up) Change file permission

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34668: pass whole waiting_holds rs
Shi Yao Wang [Fri, 3 Nov 2023 17:13:56 +0000 (13:13 -0400)]
Bug 34668: pass whole waiting_holds rs

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34668: remove binding/unbinding event for one submit event
Shi Yao Wang [Thu, 12 Oct 2023 19:51:55 +0000 (15:51 -0400)]
Bug 34668: remove binding/unbinding event for one submit event

Signed-off-by: Mia Kujala <mia.kujala@xamk.fi>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34668: Add popup warn librarians of waiting holds when checking out
Shi Yao Wang [Thu, 31 Aug 2023 17:31:16 +0000 (13:31 -0400)]
Bug 34668: Add popup warn librarians of waiting holds when checking out

When there are holds waiting for patrons, sometimes the librarian misses
the "Holds waiting here" display. This patch adds a modal popup warning
when checking out an item for a patron with waiting holds.

Test plan:
1) find a user (user1)
2) find a biblio (biblio1)
3) add a hold for biblio1 to user1
   (search biblio1 > Holds > find user1 > Place hold)
4) checkout biblio1 to another user if not already checked out
   and checkin through circulation page (not through the user page)
   > confirm hold
5) there should be a "Holds waiting here (1)" section added on user1 page

6) checkout any items that isn't the one on hold for user1
   -> notice it just checks out as normal
7) apply patch and update database
8) go to administration > system preferences > switch "WaitingNotifyAtCheckout" to "Notify"
9) refresh page and redo step 6
   -> notice there is now a modal to warn the librarian of a waiting hold
   click Ok to proceed with the checkout, click outside the modal to not do anything
10) additionnally, the popup shouldn't appear if we checkout any of
    user1's waiting hold

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Mia Kujala <mia.kujala@xamk.fi>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35328: Add a notes pop-up for authority records to authority search results
Aleisha Amohia [Tue, 14 Nov 2023 04:49:14 +0000 (04:49 +0000)]
Bug 35328: Add a notes pop-up for authority records to authority search results

This enhancement makes authority record notes (6xx) more accessible in a special Notes pop-up, available in all authority search result lists.

To test:
1) In the staff interface, go to the Authorities module and conduct a search. Any records with 6xx fields should show with an italicised Notes link under the heading. Click on the Notes link for each record and confirm the correct notes for that record show.
2) Test this in the following staff interface pages:
- authority plugin when cataloguing a biblio record
- batch authority record modification
- batch authority record deletion
3) Test the Notes pop-up is available in the OPAC authority search
4) Confirm the Notes link does NOT show if there is no 6xx field in the record

Sponsored-by: Education Services Australia SCIS
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36358: Fix typo in errorpage.tt: requets
Tomas Cohen Arazi [Tue, 19 Mar 2024 12:38:47 +0000 (09:38 -0300)]
Bug 36358: Fix typo in errorpage.tt: requets

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36329: (follow-up) Fix error message comparisson in testes
Tomas Cohen Arazi [Tue, 19 Mar 2024 15:11:54 +0000 (12:11 -0300)]
Bug 36329: (follow-up) Fix error message comparisson in testes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34611: Confirm run if pseudonymized transactions found and add verbose feedback
Nick Clemens [Wed, 25 Oct 2023 19:08:00 +0000 (19:08 +0000)]
Bug 34611: Confirm run if pseudonymized transactions found and add verbose feedback

Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34611: Add a script to pseudonymize statistics from before a given date
Nick Clemens [Fri, 25 Aug 2023 12:15:31 +0000 (12:15 +0000)]
Bug 34611: Add a script to pseudonymize statistics from before a given date

This script takes a date parameter in SQL format and pseudonymizes all statistics
found before this date.

Only values that can be found will be added, i.e. no deleted patron or item info
will be present.

Additionally - the values stored will be the current values from patrons and items, so
some info will be approximate, much as it is when joining from the statistics table for reporting.

To test:
 1 - Perform some issues/returns/renewals/on-site checkouts
 2 - Make sure Pseudonymization is disabled
 3 - perl misc/maintenance/pseudonymize_statistics.pl
 4 - Script ends and reports that preference is not active
 5 - Enable the pref, and choose some borrower and item fields
    NOTE: See bug 28911 if you need a bcrypt key for your koha-conf.xml
 6 - perl misc/maintenance/pseudonymize_statistics.pl
 7 - sudo koha-mysql kohadev
 8 - SELECT * FROM pseudonymized_transactions
 9 - Confirm data is correctly stored
10 - DELETE FROM pseudonymized_transactions;
11 - UPDATE statistics SET datetime = '2023-01-01 00:00:00';
12 - perl misc/maintenance/pseudonymize_statistics.pl -b "2022-12-31 23:59:59";
13 - SELECT * FROM pseudonymized_transactions;
14 - Confirm no entries were made
15 - Select different options in Pseudonmyization prefs, including borrower attributes
     This wil require defining an attribute that can be kept for pseudonymization
16 - Confirm options are correctly pseudonymized

Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34611: Add pseudonymize routine to Koha::Statistics
Nick Clemens [Fri, 25 Aug 2023 12:03:20 +0000 (12:03 +0000)]
Bug 34611: Add pseudonymize routine to Koha::Statistics

This patch adds a new routine to pseudonymize a statistic and adjusts
C4::Stats to use this new routine.

Additionally Koha::PseudonymizedTransaction->new_from_statistic is updated to check for
the existence of objects before using them (in the case of older stats where things may have been deleted)

Tests are added and can be run using:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/PseudonymizedTransaction.t \
           t/db_dependent/Koha/Pseudonymization.t
=> SUCCESS: New tests pass, old tests keep passing

Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34611: Unit tests
Tomas Cohen Arazi [Tue, 24 Oct 2023 18:17:33 +0000 (15:17 -0300)]
Bug 34611: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27595: DBRev 23.12.00.008
Katrin Fischer [Tue, 19 Mar 2024 09:07:21 +0000 (09:07 +0000)]
Bug 27595: DBRev 23.12.00.008

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27595: Place holds when ordering from a suggestion
Nick Clemens [Mon, 4 Dec 2023 14:05:43 +0000 (14:05 +0000)]
Bug 27595: Place holds when ordering from a suggestion

This patch updates the ordering code to place a hold when adding to a basket from a
suggestion if the new preference PlaceHoldsOnOrdersFromSuggestions is enabled.

To test:
1 - Apply all patches
2 - updatedatabase
3 - See new system preference PlaceHoldsOnOrdersFromSuggestions
4 - Create a new purchase suggestion, mark it accepted
5 - Go to acquisitions, find a vendor, find a basket, 'Add to basket' -> 'From a suggestion'
6 - Complete order, confirm no hold was placed
7 - Enable the new system preference
8 - Repeast 4-6
9 - Confirm a hold was placed

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27595: Add place_hold method to Koha::Suggestion
Nick Clemens [Mon, 4 Dec 2023 14:04:44 +0000 (14:04 +0000)]
Bug 27595: Add place_hold method to Koha::Suggestion

This patch adds anew method to allow placing a hold from a purchase suggestion

To test:
prove -v t/db_dependent/Suggestions.t

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27595: Add new system preference PlaceHoldsOnOrdersFromSuggestions
Nick Clemens [Mon, 4 Dec 2023 14:04:06 +0000 (14:04 +0000)]
Bug 27595: Add new system preference PlaceHoldsOnOrdersFromSuggestions

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36329: Make POST /transfer_limits/batch honor BranchTransferLimitsType
Tomas Cohen Arazi [Fri, 15 Mar 2024 12:56:22 +0000 (09:56 -0300)]
Bug 36329: Make POST /transfer_limits/batch honor BranchTransferLimitsType

This patch adds tests for the different cases of `BranchTransferLimitsType`.
It also adds tests for the situation of the consumer sending both limit
criterias on the request.

The controller gets adjusted for this new behavior and the spec gets
documentation added about this.

Bonus: tests are added the right guidelines code, and
BranchTransferLimitsType gets mocked to avoid failures due to existing
data.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ qa
=> SUCCESS: All green, and tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Fixed a typo in one of the return messages

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36329: Miscelaneous spec fixes
Tomas Cohen Arazi [Fri, 15 Mar 2024 12:55:34 +0000 (09:55 -0300)]
Bug 36329: Miscelaneous spec fixes

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>
3 months agoBug 36329: Add missing return codes
Tomas Cohen Arazi [Fri, 15 Mar 2024 12:18:32 +0000 (09:18 -0300)]
Bug 36329: Add missing return codes

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>
3 months agoBug 36356: Fix rollback from FrameworkPlugin.t
Jonathan Druart [Tue, 19 Mar 2024 08:16:52 +0000 (09:16 +0100)]
Bug 36356: Fix rollback from FrameworkPlugin.t

rollback ineffective with AutoCommit enabled at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1651.

I have not investigated more than that. Reaching this was already the
end of a long road... (see comment 0)

Test plan:
0. Do not apply this patch
1. select count(*) from branches
Note the value
2. Run
  prove t/db_dependent/FrameworkPlugin.t
=> There is a warning
3. Repeat 1.
=> There are too many libraries!
4. Apply the patch, retry 1, 2, 3
=> No warning, no library added by the tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 35921: Improve perfs of acqui-home.pl when there are many budgets
Julian Maurice [Thu, 25 Jan 2024 15:49:32 +0000 (16:49 +0100)]
Bug 35921: Improve perfs of acqui-home.pl when there are many budgets

When there are a lot of budgets with the same owner, most of the time of
acqui-home.pl is spent loading the same patron over and over.

This patch makes sure each borrower is loaded only once.

Test plan:
0. Do not apply the patch yet
1. Create a thousand budgets with the following command (make sure the
   budget_owner_id is an existing borrowernumber):
       perl -MKoha::Database -e '
           my $schema = Koha::Database->schema;
           my $period = $schema->resultset("Aqbudgetperiod")->create({
               budget_period_startdate => "2000-01-01",
               budget_period_enddate => "2999-12-31"
           });
           $schema->resultset("Aqbudget")->create({
               budget_owner_id => 1,
               budget_period_id => $period->id
           }) for (1..1000)
       '
2. Measure the time it takes to load acqui/acqui-home.pl (do it several
   times and keep the average time)
3. Apply the patch
4. Repeat step 2

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.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>
4 months agoBug 35539: (QA follow-up) Remove defer_marc_save from Elasticsearch.t
Katrin Fischer [Mon, 18 Mar 2024 16:58:21 +0000 (16:58 +0000)]
Bug 35539: (QA follow-up) Remove defer_marc_save from Elasticsearch.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 25539: Enable bulkmarcimport overlay context
David Gustafsson [Wed, 6 Apr 2022 13:42:10 +0000 (15:42 +0200)]
Bug 25539: Enable bulkmarcimport overlay context

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 25539: Strip items when adding new biblio to preserve previous behaviour of the...
David Gustafsson [Fri, 12 Nov 2021 22:42:30 +0000 (23:42 +0100)]
Bug 25539: Strip items when adding new biblio to preserve previous behaviour of the script

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 25539: Remove AddBiblio option "defer_marc_save"
David Gustafsson [Fri, 12 Nov 2021 22:16:55 +0000 (23:16 +0100)]
Bug 25539: Remove AddBiblio option "defer_marc_save"

Items are no longer embedded in the MARCXML and because of this the MARC data
does not need to be saved once more after changing record items data.
The "defer_marc_save" is no longer needed since bulkmarcimport.pl was the only
place this option was utilized in order to resave MARC data after possibly changing
items data. There is also a bug bulkmarcimport.pl where the record data is re-saved
without stripping items if duplicate items are found and the dedup barcodes
option is enabled that is resolved by this change.

This change enables MARC Overlay rules to be enabled for bulkmarkcimport.pl as using
the defer_marc option would previously effectively bypass any defined rules.

To test
1) Apply patch 29440 (which this depends on), but no not yet apply this
   patch
2) Remove comments around "bulkmarcimport: _("bulkmarcimport.pl"),"
   in koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt
   line 463
3) Enable MARC overlay rules and add a rule (with source => "*" or
   'bulkmarcimport') to protect some field.
4) Import a biblio using the bulkmarcimport script. Overlay rules will
   only be applied on updates so a match condition matching the
   record in Koha when bulkmarcimport.pl is run the next time for the same
   record needs to be supplied (for example -match "control-number,001")
5) Edit the imported biblio and change the value of the protected field
6) Run bulkmarcimport with the same parameters as in 4) and verify the
   the field that should have been protected has been overwritten
7) Revert changes for line 463 in marc-overlay-rules.tt (or will result in
   conflict applying the patch), apply the patch and repeat steps 4-5,
   verify that the field now was protected from being overwritten.

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 31988: Remove reports/itemtypes.plugin
Jonathan Druart [Fri, 15 Mar 2024 09:12:41 +0000 (10:12 +0100)]
Bug 31988: Remove reports/itemtypes.plugin

This "plugin system" is only used for the itemtypes report. We can
simply remove the reports/manager.pl script and this plugin in favor of
a dedicated report.

Test plan:
Same behaviour expected before and after this patch

Signed-off-by: David Nind <david@davidnind.com>
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>
4 months agoBug 36334: (follow-up) Restore selection of previous values in sidebar
Nick Clemens [Fri, 15 Mar 2024 18:17:29 +0000 (18:17 +0000)]
Bug 36334: (follow-up) Restore selection of previous values in sidebar

Before and after the first patch the values for category and library were not populated

To test:
1 - With nothing applied search in the top bar, clicking the 'settings' button
2 - Select a search field, search type, category, and library
3 - Perform search, note only search field and search type are populated
4 - Apply first path, repeat, same result
5 - Apply this patch, repeat
6 - Confirm all four fields now populate in sidebar

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 36334: Remove unnecessary JS code from member.tt
Jonathan Druart [Fri, 15 Mar 2024 14:38:18 +0000 (15:38 +0100)]
Bug 36334: Remove unnecessary JS code from member.tt

This was initially written to set the input/select in the form in the
left side of the main patron search page.

But this is now done in patron-search.inc:
koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:
  <input type="text" class="search_patron_filter" value="[% search_filter | html %]" class="focus" />

I don't see how/when this code is still used.

Additionally:
 #searchmember_filter
 => does not exist, it's .search_patron_filter

 $("searchfieldstype_filter").val("[% searchfieldstype | html %]");
 => Not a valid selector

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 35643: Upgrade HC Sticky library from v2.2.3 to v2.2.7
Owen Leonard [Fri, 22 Dec 2023 16:02:42 +0000 (16:02 +0000)]
Bug 35643: Upgrade HC Sticky library from v2.2.3 to v2.2.7

This patch upgrades the HC Sticky library in the OPAC and staff
interface to the latest version, 2.2.7. The file is moved to its own
directory for consistency's sake.

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

Test pages in the OPAC and staff interface which use the "sticky"
heading feature. As you scroll down the header should "stick" to the top
of the viewport. For example:

- Administration -> System preferences
- Catalog -> Search results
- Cataloging -> Basic MARC editor
- Patrons -> Add or edit patron
- Lists -> List contents

In the OPAC:

- Catalog search results
- Lists -> List contents

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: (QA follow-up) Fix tidy
Martin Renvoize [Wed, 3 Jan 2024 16:21:08 +0000 (16:21 +0000)]
Bug 29440: (QA follow-up) Fix tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: Fix AddBiblio/ModBiblio options args
David Gustafsson [Wed, 25 Oct 2023 12:43:21 +0000 (14:43 +0200)]
Bug 29440: Fix AddBiblio/ModBiblio options args

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: Replace removed syspref BiblioAddsAuthorities with AutoLinkBiblios
David Gustafsson [Mon, 7 Nov 2022 16:56:23 +0000 (17:56 +0100)]
Bug 29440: Replace removed syspref BiblioAddsAuthorities with AutoLinkBiblios

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: Only log items has been inserted if actually have been so, and remove...
David Gustafsson [Mon, 26 Sep 2022 14:55:36 +0000 (16:55 +0200)]
Bug 29440: Only log items has been inserted if actually have been so, and remove extra out of place logging of record insertion

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: Rename $modify_biblio_marc_options to $mod_bilbio_options
David Gustafsson [Mon, 26 Sep 2022 14:46:30 +0000 (16:46 +0200)]
Bug 29440: Rename $modify_biblio_marc_options to $mod_bilbio_options

This variable actually contains ModBibio options and
ModifyBiblioMarc accepts a subset of these

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: Remove pointless call to _strip_item_fields
David Gustafsson [Mon, 26 Sep 2022 14:09:30 +0000 (16:09 +0200)]
Bug 29440: Remove pointless call to _strip_item_fields

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: replace usage of removed GetMarcBiblio
David Gustafsson [Fri, 23 Sep 2022 15:32:51 +0000 (17:32 +0200)]
Bug 29440: replace usage of removed GetMarcBiblio

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: defer biblio autolinking until records are indexed
David Gustafsson [Wed, 21 Sep 2022 15:43:32 +0000 (17:43 +0200)]
Bug 29440: defer biblio autolinking until records are indexed

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: Fix QA-tool issues
David Gustafsson [Mon, 4 Apr 2022 14:41:00 +0000 (16:41 +0200)]
Bug 29440: Fix QA-tool issues

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: Make authorities import behavior consistent with biblios
David Gustafsson [Tue, 9 Nov 2021 11:52:03 +0000 (12:52 +0100)]
Bug 29440: Make authorities import behavior consistent with biblios

The current behavior for when importing authorities, when match
option is enabled, is to insert as a new authority fetching from db
fails. This is both a bit confusing and not consistent with the biblio
case where an error is generated. Also clean up error and log messages
so both messages/errors and when messages/errors are issued are more
consistent for the biblio and authority case.

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 29440: Refactor and clean up bulkmarcimport.pl
David Gustafsson [Wed, 15 Mar 2017 10:30:50 +0000 (11:30 +0100)]
Bug 29440: Refactor and clean up bulkmarcimport.pl

To test:
1) Import biblios using ./bulkmarcimport.pl -v -b -file biblios.mrc -insert -update -c=MARC21 -match "control-number,001" -n=1 -l "/tmp/import.log"
2) Verify in /tmp/import.log that one biblio has been inserted
3) Import again without the "-n" option, verify that one biblio has been
   updated and the rest inserted
4) In the staff interface search the catalog for some string appearing in
   the imported biblios to verify records have been indexed
5) View/edit some of the biblios the staff interface to very have been
   properly imported
6) Import authorities using ./bulkmarcimport.pl -v -m=MARCXML -a -file authorities.xml -insert -update -c=MARC21 -keepids="024a" -match "heading-main,100a" -l "/tmp/import.log" -yaml="/tmp/ids.yml"
7) Go to the authorities page and find the imported authority by for example search for a
   400 or 100 field value. Verify that the 001 field of the incoming record has been moved to 024a.
   Also check that the value of 024a appear as a key in /tmp/ids.yml.
8) Edit the authorities.xml file and change the value of field 400a
9) Import authorities again using the same options
10) Verify that the 400a field of the authority in Koha has not been
   updated (the import was skippped since revision did not change)
11) Edit authorities.xml, replace the value of field 005 in the file with field 005
    of the authority in Koha incremented by one
12) Import again with the same options
13) Verify that the 400a field of the authority in Koha now have been
    updated

Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 33036: (QA follow-up) Tidy code
Katrin Fischer [Mon, 18 Mar 2024 09:37:17 +0000 (09:37 +0000)]
Bug 33036: (QA follow-up) Tidy code

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 33036: Improve REST API controller
Jonathan Druart [Thu, 14 Dec 2023 10:08:37 +0000 (11:08 +0100)]
Bug 33036: Improve REST API controller

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 33036: Use Koha::Objects
Jonathan Druart [Thu, 14 Dec 2023 09:55:42 +0000 (10:55 +0100)]
Bug 33036: Use Koha::Objects

Better to use Koha::Objects everywhere and have the same pattern for the
different related objects.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 33036: Add more tests
Jonathan Druart [Thu, 14 Dec 2023 09:29:32 +0000 (10:29 +0100)]
Bug 33036: Add more tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 33036: Improve merge_with tests
Jonathan Druart [Thu, 14 Dec 2023 09:00:25 +0000 (10:00 +0100)]
Bug 33036: Improve merge_with tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 33036: REST API: Merge biblio records implements merging of records
Zeno Tajoli [Wed, 15 Nov 2023 07:41:17 +0000 (08:41 +0100)]
Bug 33036: REST API: Merge biblio records implements merging of records

+ attached items, subscriptions etc via the API as an alternative to the web interface: cgi-bin/koha/cataloguing/merge.pl

This is a slightly improved version of Zenos patch: I (domm) have converted the code in Koha::Biblio to a more DBICy style and packed it into a transaction (as requested in Comment 23)

Even the QA script is happy now!

To test:
    1) you need an API user with the permissions "editcatalogue"
    2) two records: one to be merged into (with biblio_id, eg 262) and another one from
       which to merge (with biblio_id_to_merge, eg 9) which will be deleted!
       both records may/should have items, subscription, subscriptionhistory, serial, suggestions
       orders and holds
    3) check both records via the web
    4) Apply patch
    5) Write a JSON file with inside the field 'biblio_id_to_merge' and the biblionumber from wihich to merge.
       As example:
       {
         "biblio_id_to_merge" : 9
       }
     6) Execute an API call with correct headers and location. For example:
        curl -s -u koha:koha --header "Content-Type: application/json" --header "Accept: application/marc-in-json"
                  --request POST "http://127.0.0.1:8080/api/v1/biblios/262/merge" -d @file.json
        You must to setup the headers and to use a json file with parameters
     7) The record with the id 9 is deleted now, the record with 262 has all items, etc attached,
        the return is: return code 200 and the changed record 262 in marc-in-json format
     8) It is possible to override biblio data with an external bib record. You need to put external bib record
        into the json file in marc-in-json format. To write use the json file uploaded as example
        You need to fill the fields 'rules' and 'datarecord'. The field 'rules' must contains 'override_ext'
        To do the call:
         curl -s -u koha:koha --header "Content-Type: application/json" --header "Accept: application/marc-in-json"
                  --request POST "http://127.0.0.1:8080/api/v1/biblios/XXX/merge" -d @file_with_recod.json
      9) The record in 'biblio_id_to_merge' is deleted now, in biblio XXX now there are the bibliographic data
         of field 'datarecord' of json file, the return is: return code 200 and the changed record XXX in marc-in-json format
      10) Go into intranet and do a search. Select two or (better) more record.
      11) Merge them; merge must be a success.
      12) Test with prove -v t/db_dependent/Koha/Biblio.t
      13) Test with prove -v t/db_dependent/api/v1/biblios.t

To test with curl the step 8 you can customize the json file attached in bugzilla.
The marc-in-json record inside follows the MAR21 standard

Sponsored-by: Technische Hochschule Wildau
Co-authored-by: Zeno Tajoli <ztajoli@gmail.com>
Co-authored-by: Thomas Klausner <domm@plix.at>
Co-authored-by: Mark Hofstetter <<mark@hofstetter.at>>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Bug 33036: Update of test number.

File ../biblios.t was update with a new subutest.
So we need this update to have a 'OK' after test running.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 33431: Fix remaining cases
Tomas Cohen Arazi [Thu, 6 Apr 2023 14:27:14 +0000 (11:27 -0300)]
Bug 33431: Fix remaining cases

This patch tweaks three remaining cases, that are not covered by tests.

To test:
1. Apply this patch
2. Make use of those places
=> SUCCESS: No behavior change

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>
4 months agoBug 33431: Make C4::Record use C4::Context->yaml_preference
Tomas Cohen Arazi [Thu, 6 Apr 2023 13:55:41 +0000 (10:55 -0300)]
Bug 33431: Make C4::Record use C4::Context->yaml_preference

This patch makes what the title says.

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

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>
4 months agoBug 33431: Make C4::Circulation use C4::Context->yaml_preference
Tomas Cohen Arazi [Thu, 6 Apr 2023 13:48:04 +0000 (10:48 -0300)]
Bug 33431: Make C4::Circulation use C4::Context->yaml_preference

This patch removes manual YAML handling for sysprefs in C4::Circulation.

It also makes C4::Context->yaml_preference not warn when undef is
retrieved from the sysprefs.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Circulation*
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
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>
4 months agoBug 33171: Fix missing price when mapped from MarcItemFieldsToOrder
Matt Blenkinsop [Wed, 29 Nov 2023 11:11:37 +0000 (11:11 +0000)]
Bug 33171: Fix missing price when mapped from MarcItemFieldsToOrder

This patch fixes an issue where the price is not passed to the UI when read from MarcItemFieldsToOrder.

Test plan:
1) In Administration, copy and paste the following into MarcItemFieldsToOrder:
quantity: 975$q
budget_code: 975$h
price: 975$p
itype: 975$y
coded_location_qualifier: 975$a
barcode: 975$b
enumchron: 975$c
2) Save
3) Navigate to Acquisitions and find a basket
4) Click Add to basket and select From a new file
5) Choose the file attached to this bug
6) Upload file and click Stage for import
7) Click Add staged files to basket once the job is finished
8) Check the box next to the record
9) The price should show 10.00 under Item record 1
10) coded location qualifier, barcode, enumchron should also have values as per the other commit on this bug
11) Save and import, the basket should not have a value of 0 as the price has been read correctly
12) Check the database, the newest item should have values for price, coded_location_qualifier, barcode and enumchron

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 33171: Add coded_location_qualifier, barcode, and enumchron to MarcItemFieldsToOrder
Kyle Hall [Wed, 8 Mar 2023 16:08:37 +0000 (11:08 -0500)]
Bug 33171: Add coded_location_qualifier, barcode, and enumchron to MarcItemFieldsToOrder

Some libraries would like to use the following item fields with the MarcItemFieldsToOrder system preference:
* coded_location_qualifier
* barcode
* enumchron

Test Plan:
1) Set up MarcItemFieldsToOrder, verify it is functioning
2) Test coded_location_qualifier, barcode, and enumchron
3) Note the fields are imported and set for the items

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 35331: Fix URL parmameter in unit test
Katrin Fischer [Mon, 18 Mar 2024 08:44:24 +0000 (08:44 +0000)]
Bug 35331: Fix URL parmameter in unit test

method => op

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
4 months agoBug 35331: (QA follow-up): Patron ILL history
Pedro Amorim [Thu, 16 Nov 2023 10:01:16 +0000 (10:01 +0000)]
Bug 35331: (QA follow-up): Patron ILL history

With the previous patches applied and successfull test plans, access the users ILL history page, visit:
/cgi-bin/koha/members/ill-requests.pl?borrowernumber=51

Notice you get an error.
Apply this patch, and try again, notice the error is gone and the custom plugin action is also in the patron's ILL history table

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>
4 months agoBug 35331: (QA follow-up): Avoid code pattern iterating on plugin responses
Pedro Amorim [Wed, 15 Nov 2023 15:26:33 +0000 (15:26 +0000)]
Bug 35331: (QA follow-up): Avoid code pattern iterating on plugin responses

(see bug 28010) Use plugin call pattern established in bug 28211.

Please utilize version 1.0.1 of the plugin to test this follow-up:
https://github.com/PTFS-Europe/koha-plugin-ill-actions/releases/tag/v1.0.1

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>
4 months agoBug 35331: Add plugin hook tests
Pedro Amorim [Tue, 14 Nov 2023 09:41:24 +0000 (09:41 +0000)]
Bug 35331: Add plugin hook tests

prove t/db_dependent/Koha/Plugins/Ill_hooks.t

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>