]> git.koha-community.org Git - koha.git/log
koha.git
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 months agoBug 35331: CSRF follow-up
Pedro Amorim [Wed, 6 Mar 2024 10:25:08 +0000 (10:25 +0000)]
Bug 35331: CSRF follow-up

Update method to op

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35331: Add table actions hook to ILL table
Pedro Amorim [Mon, 13 Nov 2023 17:24:23 +0000 (17:24 +0000)]
Bug 35331: Add table actions hook to ILL table

Test plan, k-t-d, apply patches:
1) Install FreeForm backend, enable ILLModule sys pref, run:
   bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) Navigate to ILL requests, visit:
   /cgi-bin/koha/ill/ill-requests.pl
3) Click '+New ILL request', select a type, enter an existing cardnumber (e.g. '42') and pick a library. Click 'Create'.
4) Visit ILL requests again, repeat 2)
5) Notice the row for the created request has the already existing action button 'Manage request'
6) Install the ILL actions plugin, located at:
   https://github.com/PTFS-Europe/koha-plugin-ill-actions/releases/tag/v1.0.0
7) Restart plack, run:
   koha-plack --restart kohadev
8) Repeat 4) and 5). Notice the row for the created request now has a new custom action in addition to the already existing core one.

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>
7 months agoBug 26597: Update the description of the PrefillGuaranteeField system preference
Emily-Rose Francoeur [Tue, 31 Oct 2023 12:58:51 +0000 (08:58 -0400)]
Bug 26597: Update the description of the PrefillGuaranteeField system preference

I updated the system preference description so that we now know this option is working from both the guarantee and guarantor forms.

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 26597: (QA follow-up) Add missing filters
Hammat Wele [Wed, 31 May 2023 13:15:18 +0000 (13:15 +0000)]
Bug 26597: (QA follow-up) Add missing filters

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 26597: (Fix) remove REST API call and retrieve the patron's data from borrower_da...
Hammat Wele [Tue, 30 May 2023 21:41:14 +0000 (21:41 +0000)]
Bug 26597: (Fix) remove REST API call and retrieve the patron's data from borrower_data input

This patch remove the REST API call in select_user function and retrieve the patron's data from borrower_data

To test:
1) Apply patch
2) Search PrefillGuaranteeField preference and make sure some fields are selected
3) Select a user that can have a guarantor
4) In the edit form, click on "Search to add" in "Patron guarantor" fieldset
5) Choose a patron who has at least one of the fields in 1) set
6) Click Select
7) Confirm guarantee's information is filled from the guarantor's record
8) Check that any preexisting information is not overwritten

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 26597: (follow-up) Add disabling / enabled the save button while waiting from...
Hammat Wele [Wed, 22 Mar 2023 15:25:43 +0000 (15:25 +0000)]
Bug 26597: (follow-up) Add disabling / enabled the save button while waiting from api to respond

I've updated the test plan since the REST API route takes a little time to respond

To test:
1) Apply patch
2) Search PrefillGuaranteeField preference and make sure some fields are selected
3) Select a user that can have a guarantor
4) In the edit form, click on "Search to add" in "Patron guarantor" fieldset
5) Choose a patron who has at least one of the fields in 1) set
6) Click Select
7) Wait until save button is enabled
8) Confirm guarantee's information is filled from the guarantor's record
9) Check that any preexisting information is not overwritten

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 26597: Fixing the populate of fields when using the REST API route
Hammat Wele [Tue, 13 Dec 2022 22:27:29 +0000 (22:27 +0000)]
Bug 26597: Fixing the populate of fields when using the REST API route

This attachment correct the populate of fields by using the api mapping.
Now All fields are populated following the selected PrefillGuaranteeField options

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 26597: Transfer informations from guarantor when adding a guarantor to an existin...
Hammat Wele [Wed, 7 Dec 2022 16:51:20 +0000 (16:51 +0000)]
Bug 26597: Transfer informations from guarantor when adding a guarantor to an existing patron

When creating a new guarantee from the guarantor, the preference PrefillGuaranteeField dictates some fields to be transfered from guarantor to guarantee. This patch makes it so those informations are also transfered when adding a new guarantor relationship to an existing patron.

To test:
1) Apply patch
2) Search PrefillGuaranteeField preference and make sure some fields are selected
3) Select a user that can have a guarantor
4) In the edit form, click on 'Search to add' in 'Patron guarantor' fieldset
5) Choose a patron who has at least one of the fields in 1) set
6) Click 'Select'
7) Confirm guarantee's information is filled from the guarantor's record
8) Check that any preexisting information is not overwritten

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 29522: Unit test
Nick Clemens [Fri, 26 Jan 2024 13:15:12 +0000 (13:15 +0000)]
Bug 29522: Unit test

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 29522: [alternate] Skip relinking bibliographic records when merging authorities
Nick Clemens [Wed, 6 Sep 2023 15:48:12 +0000 (15:48 +0000)]
Bug 29522: [alternate] Skip relinking bibliographic records when merging authorities

If autolinking is enabled, there are scenarios where the authorities merge process
updates the record, then sends it to ModBiblio which then AutoLinks the record, undoing
the changes in the record (as the 'from' authority is not removed until the process is complete)

This patch simply disables the autolinking process when merging authorities

To test:

Set system preferences
    AutoCreateAuthorities = don't generate
    RequireChoosingExistingAuthority = don't require
    AutoLinkBiblios = Do
    CatalogModuleRelink = Do
    LinkerKeepStale = Don't
    LinkerModule = first match
    LinkerRelink = Do

1. Create an authority record
   1.1. Go to Authorities
   1.2. Click on "New authority" and choose an authority type (I chose Corporate name)*
   1.3. Fill in the mandatory fields (000, 003, 005, 008, 040)
   1.4. In tab 1, click on the label of the main heading (110 for Corporate name)
   1.5. Fill in subfield
   1.6. Copy content of subfield
   1.7. Click on "Save"
   1.8. Note the authority record number

2. Duplicate the authority record
   2.1. Click on "Edit" and choose "Edit as new (duplicate)"
   2.2. Click on "Save"
   2.3. Click on "No: Save as new authority"
   2.4. Note the authority record number (should be the number from step 1.8 +1)

3. Link one of the authority records to a bibliographic record
   3.1 In another tab, do a catalog search
   3.2. Click on "Edit record" under one of the search results
   3.3. Go to the relevant tab (for corporate name, I used field 710 in tab 7)
        3.3.a. If there are no empty fields for that tag, click the "Repeat this tag" button (two rectangles)
   3.4. Paste the text previously copied in subfield
   3.5. Click on "Link authorities automatically" at the top of the page
   3.6. Note the authority record number in subfield
        --> The linked authority record should be the first authority record (step 1.8)
   3.7. Click on "Save"

4. Merge the two authority records, keep the one that is not linked to the bibliographic record
   4.1. Go back to the tab with the authorities
   4.1. Go to Authorities
   4.2. Search for the aurhorities previous created
   4.2. Click on "Actions" and choose "Merge" for both records
   4.3. Select the record number that is NOT linked to the bibliographic record
   4.4. Click on "Next"
   4.5. Click on "Merge"

5. Check the bibliographic record
   5.1. Go back to the tab with the bibliographic record and refresh the page (Ctrl+F5)
   5.2. Hover the mouse cursor over the name or term, without clicking
   5.3. Note the record number that appears at the bottom of the screen
        --> The record number was not changed
6. Apply the patch
    6.1. Run prove t/AuthoritiesMarc_MARC21.t
    6.2. Repeat Previous steps 1, 2, 3, 4, 5
        --> The record number is change

Signed-off-by: Barbara Petritsch <barbara.petritsch@wienmuseum.at>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35944: (QA follow-up) Tidy
Nick Clemens [Fri, 15 Mar 2024 11:37:54 +0000 (11:37 +0000)]
Bug 35944: (QA follow-up) Tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35944: (QA follow-up) Check if there are bookings before other calculations
Nick Clemens [Fri, 15 Mar 2024 11:35:38 +0000 (11:35 +0000)]
Bug 35944: (QA follow-up) Check if there are bookings before other calculations

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35944: Add link to 'booked' biblio in checkouts table
Martin Renvoize [Mon, 26 Feb 2024 09:27:27 +0000 (09:27 +0000)]
Bug 35944: Add link to 'booked' biblio in checkouts table

This patch updates the checkouts table so handle 'booked' items
including linking to the biblio booking details page.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35944: Add message to SIP renewal attempt
Martin Renvoize [Mon, 26 Feb 2024 08:15:50 +0000 (08:15 +0000)]
Bug 35944: Add message to SIP renewal attempt

This patch adds a replacement for 'booked' to the SIP renewal handling
so we can display 'Item is booked for another borrower'.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35944: Add booking handling to CanBookBeRenewed
Martin Renvoize [Mon, 19 Feb 2024 12:31:07 +0000 (12:31 +0000)]
Bug 35944: Add booking handling to CanBookBeRenewed

This patch adds a bookings check to CanBookBeRenewed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35944: Unit tests
Martin Renvoize [Tue, 20 Feb 2024 18:04:49 +0000 (18:04 +0000)]
Bug 35944: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 36277: Avoid useless warnings
Tomas Cohen Arazi [Fri, 15 Mar 2024 12:05:55 +0000 (09:05 -0300)]
Bug 36277: Avoid useless warnings

As mentioned on bug 36329, this endpoint is only used with one of this
parameters:

* item_type
* collection_code

The other will be NULL both on the DB and the (deserialized) request
body. For the data from the DB, the author added `|| q{}` but missed to
do so on the incoming parameters when generates the hash key.

This generates the following warnings when using from the UI:

[2024/03/15 11:42:51] [WARN] Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/REST/V1/TransferLimits.pm line 146.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 36277: Improve algorithmic complexity of batch_add
Jonathan Druart [Thu, 14 Mar 2024 13:39:56 +0000 (14:39 +0100)]
Bug 36277: Improve algorithmic complexity of batch_add

The 2 nested loops are terrible in term of algorithmic complexity.
Especially if we are fetching from there.

The goal of this patch is to fetch all the limits outside of the loop.

If you have 100 libraries, it will remove 100^2 - 1 fetches!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 36277: Do not fetch the whole library list
Jonathan Druart [Thu, 14 Mar 2024 13:06:28 +0000 (14:06 +0100)]
Bug 36277: Do not fetch the whole library list

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35934: Correct missed case of switching items.transfer to transfer in detail.tt
Emily Lamancusa [Mon, 29 Jan 2024 20:25:19 +0000 (15:25 -0500)]
Bug 35934: Correct missed case of switching items.transfer to transfer in detail.tt

To test:
1. Put an item with no holds/recalls in transit (manually or by checking
  it in at a branch other than its homebranch to trigger a ReturnToHome)
2. Go to the item's bib record
--> Note that the item's status will display as something like,
    "In transit from X to Y since 01/29/2024 Available"
3. Apply patch and refresh the page
--> Note that item now shows only the transit status, but not "Available"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 36224: Remove unused spsuggest from templates
Lucas Gass [Tue, 5 Mar 2024 16:00:39 +0000 (16:00 +0000)]
Bug 36224: Remove unused spsuggest from templates

To test:
-APPLY PATCH
-Review the OPAC results and staff interface results pages.
-Nothing should change, it would be impossible to end up inside of the [% IF koha_spsuggest %] condition because there is nothing like that in the scripts!

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>
7 months agoBug 36292: Fixed 'See all charges' hyperlink for guarantees/guarantor linked charges
Laura Escamilla [Mon, 11 Mar 2024 14:43:26 +0000 (14:43 +0000)]
Bug 36292: Fixed 'See all charges' hyperlink for guarantees/guarantor linked charges

To test:
1. Add a guarantee / guarantor relationship for two patrons.
2. Add a manual fee to the guarantees' account.
3. Go to the guarantor's account and view the 'Details' tab. Under contact information there should be a Guarantees section. There you will see the charges for your guarantee. Click on ‘See all charges’. The link leads you no where.
4. Apply the patch and restart_all
5. Refresh the guarantor’s page and click on ‘See all charges’ again. This time it will take you down to the ‘Guarantees’ Charges’ panel.
6. Sign off and have a great day! :D

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>
7 months agoBug 36298: In patrons search fix road type with authorized value
Fridolin Somers [Tue, 12 Mar 2024 10:18:18 +0000 (11:18 +0100)]
Bug 36298: In patrons search fix road type with authorized value

In new patrons search via API, the road type code is displayed in patron address instead of authorized value description.

Also road type is missing a space separator in DE and FR format.

Test plan :
1) Create two entries in authorized value category "ROADTYPE" :
   R1 "Road"
   R2 "Street"
2) Edit a patron (ie Delgado, Floyd) to set road type to "Road"
3) Perform a search on patrons (click on letter D)
4) Check you see in address "Road" and not "R1"
5) Edit authorized value category "ROADTYPE" to delete entry "R1"
6) Perform a search on patrons (click on letter D)
7) Check you see in address "R1"

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>
7 months agoBug 35997: (QA follow-up) Number of tests
Marcel de Rooy [Fri, 15 Mar 2024 08:59:26 +0000 (08:59 +0000)]
Bug 35997: (QA follow-up) Number of tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35997: Cancelling a hold should remove the hold from the queue
Kyle M Hall [Mon, 5 Feb 2024 19:44:46 +0000 (14:44 -0500)]
Bug 35997: Cancelling a hold should remove the hold from the queue

Test plan:
1) Place a hold for a record for a patron
2) Build the holds queue
3) Note the holds queue contains a match for that patron and record
4) Cancel the holds queue
5) Reload the holds queue page, note the match for  that patron and
   record is gone!

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35997: Add tests
Kyle M Hall [Mon, 5 Feb 2024 19:44:46 +0000 (14:44 -0500)]
Bug 35997: Add tests

Test plan: see next patch

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 36332: Add missing semicolon in moremember.tt
Jonathan Druart [Fri, 15 Mar 2024 13:56:26 +0000 (14:56 +0100)]
Bug 36332: Add missing semicolon in moremember.tt

It's fixing a JS error
Uncaught ReferenceError: script is not defined

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35796: Properly set patron_expiration value
Lucas Gass [Fri, 8 Mar 2024 21:32:21 +0000 (21:32 +0000)]
Bug 35796: Properly set patron_expiration value

To test:
1) Set an expiration on the password in a patron account and save.
2) Go to patron details (moremember.pl) and confirm the password has an expiration.
3) Edit the patron account without touching anything and save the account.
4) Go back to patron details (moremember.pl) and note that the expiration on the password has been removed.
5) APPLY PATCH
6) Try 1 - 4 again except this time password expiration is not removed.

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>
7 months agoBug 36274: Correct links leading to purchase suggestion page
Lucas Gass [Thu, 7 Mar 2024 23:09:56 +0000 (23:09 +0000)]
Bug 36274: Correct links leading to purchase suggestion page

To test:
1. APPLY PATCH
2. As a logged in OPAC user go to 'Your account' > Purchase suggestion. The form should display.
3. Make a suggestion and confirm it works.
4. Try to make a suggestion using title, author, isbn information from an item that already exists.
5. See the "A similar document already exists:" warning. Confirm the suggestion anyways.
6. Set MaxTotalSuggestions to 4 and NumberOfSuggestionDays to 2. Make sure you can still navigate to the purchase suggestion form.
7. Do an OPAC search that will yield no results as a logged in user.
8. Click the "Make a purchase suggestion" link, making sure it works.
9. Turn on AnonSuggestions and log out of the OPAC.
10. Do an OPAC search that will yield no results. Again click the "Make a purchase suggestion", confirm it works.

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>
7 months agoBug 36305: (QA follow-up) Enforce op values in script
Marcel de Rooy [Fri, 15 Mar 2024 08:15:03 +0000 (08:15 +0000)]
Bug 36305: (QA follow-up) Enforce op values in script

Replacing a FIXME by TODO along the way.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 36305: Implement op paramters
Kyle M Hall [Wed, 13 Mar 2024 16:19:31 +0000 (12:19 -0400)]
Bug 36305: Implement op paramters

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>
7 months agoBug 36305: Tidy forms
Kyle M Hall [Wed, 13 Mar 2024 16:00:52 +0000 (12:00 -0400)]
Bug 36305: Tidy forms

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>
7 months agoBug 36190: Fix problems found by test
Nick Clemens [Wed, 13 Mar 2024 10:52:28 +0000 (10:52 +0000)]
Bug 36190: Fix problems found by test

opac-shelves           - forms were stateless - changed to GET
sco-main               - forms stateless - changed to GET
                         ** untested because sco + auth is broken
smart-rules.tt         - JS form template - added placeholder 'cud-' op
ill-requests           - added cud- tp ops
                         ** tested comments, but not checkout, simple changes
boraccount             - removed repeated op - updated script
patroncards/edit-batch - add placeholder 'cud-' op
patroncards/manage     - add placheholder 'cud-' op
elasticsearch/mappings - separate forms - this could use a style follow-up, but makes more sense separate I think
reports/dictionary      - stateless - changed to GET
guided_reports_start    - stateless - changed to GET
suggestion/suggestion   - add placeholder 'cud-' op
inventory               - filed bug 36305, needs more handling

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>
7 months agoBug 36190: (QA follow-up) Tidy
Nick Clemens [Wed, 13 Mar 2024 10:51:08 +0000 (10:51 +0000)]
Bug 36190: (QA follow-up) Tidy

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>
7 months agoBug 36190: To not assume op is invalid if it is a TT variable
Jonathan Druart [Wed, 28 Feb 2024 13:11:01 +0000 (14:11 +0100)]
Bug 36190: To not assume op is invalid if it is a TT variable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
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>
7 months agoBug 36190: Adjust the test
Jonathan Druart [Wed, 28 Feb 2024 13:06:12 +0000 (14:06 +0100)]
Bug 36190: Adjust the test

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>
7 months agoBug 35473: Also disable the plugin
Martin Renvoize [Mon, 15 Jan 2024 15:33:40 +0000 (15:33 +0000)]
Bug 35473: Also disable the plugin

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35473: Handle room reservations plugin conflict
Martin Renvoize [Thu, 11 Jan 2024 10:24:04 +0000 (10:24 +0000)]
Bug 35473: Handle room reservations plugin conflict

We now look for the existance of the room reservations 'bookings' table
prior to attempting to install the core bookings table and migrate it in
the same way the upstream plugin does before proceeding with installing
the core bookings tables.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 36308: Update sip login parameters
Nick Clemens [Wed, 13 Mar 2024 17:51:29 +0000 (17:51 +0000)]
Bug 36308: Update sip login parameters

To test:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m patron_information --patron=koha
Login fails
Apply patch, restart all
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m patron_information --patron=koha
Login succeeds

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>
7 months agoBug 35248: Add tests for Koha::Booking->_assign_item_for_booking
Martin Renvoize [Thu, 8 Feb 2024 11:52:09 +0000 (11:52 +0000)]
Bug 35248: Add tests for Koha::Booking->_assign_item_for_booking

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Refactor - Move assign_item_for_booking
Martin Renvoize [Wed, 7 Feb 2024 17:10:40 +0000 (17:10 +0000)]
Bug 35248: Refactor - Move assign_item_for_booking

This routine really belongs inside Koha::Booking rather than
Koha::Biblio. This patch moves it there, renames with _ to highlight
it's private nature.

Test plan
1) Confirm that t/db_dependant/Koha/Booking.t still passes, specifically
   the 'store' test.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add tests for Koha::Booking->store
Martin Renvoize [Wed, 7 Feb 2024 17:58:11 +0000 (17:58 +0000)]
Bug 35248: Add tests for Koha::Booking->store

This patch adds tests for the Koha::Booking->store method.

Test plan
1) Run t/db_dependent/Koha/Booking.t and confirm they all pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add unit tests for Koha::Bibilio->bookable_items
Martin Renvoize [Wed, 7 Feb 2024 16:38:20 +0000 (16:38 +0000)]
Bug 35248: Add unit tests for Koha::Bibilio->bookable_items

This patch adds basic unit tests for Koha::Biblio->bookable_items

Test plan
1) Run t/db_dependent/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add unit tests for Koha::Bibilio->check_booking
Martin Renvoize [Tue, 30 Jan 2024 16:38:08 +0000 (16:38 +0000)]
Bug 35248: Add unit tests for Koha::Bibilio->check_booking

This patch adds basic unit tests for Koha::Biblio->check_booking

Test plan
1) Run t/db_dependent/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add Koha::Biblio->bookings unit test
Martin Renvoize [Tue, 30 Jan 2024 14:00:17 +0000 (14:00 +0000)]
Bug 35248: Add Koha::Biblio->bookings unit test

This patch adds unit tests for the bookings relationship accessor on
Koha::Biblio objects.

Test plan
1) Run t/db_dependant/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add unit tests for Koha::Booking relations
Martin Renvoize [Tue, 30 Jan 2024 13:53:02 +0000 (13:53 +0000)]
Bug 35248: Add unit tests for Koha::Booking relations

This patch adds unit tests for the relations introduced in the new
Koha::Booking class.

Test plan
1) Run t/db_dependent/Koha/Booking.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Remove Koha::Booking->intersects
Martin Renvoize [Tue, 30 Jan 2024 11:09:17 +0000 (11:09 +0000)]
Bug 35248: Remove Koha::Booking->intersects

Another method left behind from an earlier iteration.. not actually
called anywhere in the final submission in Koha.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add test for Koha::Exceptions::Booking
Martin Renvoize [Tue, 30 Jan 2024 07:45:13 +0000 (07:45 +0000)]
Bug 35248: Add test for Koha::Exceptions::Booking

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Drop ->place_booking
Martin Renvoize [Tue, 30 Jan 2024 07:34:56 +0000 (07:34 +0000)]
Bug 35248: Drop ->place_booking

These methods were introduced and used in an earlier iteration of the
code, they are no longer called from anywhere (the code in
Koha::Booking->store handles all cases instead) and thus I choose to
remove them rather than add unit tests for them.. They are simple
methods that could be re-introduced as required at a future date.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add unit tests for Koha::Item->check_booking
Martin Renvoize [Mon, 29 Jan 2024 18:34:46 +0000 (18:34 +0000)]
Bug 35248: Add unit tests for Koha::Item->check_booking

This patch adds basic unit tests for the Koha::Item->check_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Unit tests for CanBookBeIssued
Martin Renvoize [Mon, 29 Jan 2024 16:32:09 +0000 (16:32 +0000)]
Bug 35248: Unit tests for CanBookBeIssued

Whilst writing the test, I found a minor flaw in the logic and fixed
that in CanBookBeIssued at the same time.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add unit tests for Koha::Item->find_booking
Martin Renvoize [Tue, 16 Jan 2024 12:47:18 +0000 (12:47 +0000)]
Bug 35248: Add unit tests for Koha::Item->find_booking

This patch adds basic unit tests for the Koha::Item->find_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35248: Add unit test for Koha::Item->bookings relation
Martin Renvoize [Tue, 16 Jan 2024 11:31:41 +0000 (11:31 +0000)]
Bug 35248: Add unit test for Koha::Item->bookings relation

This patch adds a simple unit test for the 'bookings' relation accessor
added to Koha::Item.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35788: Simplify code
Tomas Cohen Arazi [Mon, 15 Jan 2024 13:43:44 +0000 (10:43 -0300)]
Bug 35788: Simplify code

We should not load DateUtils and deal with DateTime objects and
formatting when we can use the DB for it, using \'NOW()' should be
enough.

This patch makes that change. To test:

1. Apply the previous patches
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Bookings.t
=> SUCCESS: Tests pass!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35788: Test for current day booking
Tomas Cohen Arazi [Mon, 15 Jan 2024 13:35:04 +0000 (10:35 -0300)]
Bug 35788: Test for current day booking

The implemented tests checked past and future dates for filtering
bookings. But `> NOW()` excludes the current date, and this case was not
covered. It is now.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35788: Remove Koha::Template::Plugin::Biblio::BookingsCount
Jonathan Druart [Fri, 12 Jan 2024 13:19:33 +0000 (14:19 +0100)]
Bug 35788: Remove Koha::Template::Plugin::Biblio::BookingsCount

We need a new method filter_by_future in Koha::Bookings.

Additionally this TT plugin's method was not covered by tests. Neither
is the whole Koha::Booking[s] objects btw.

Test plan:
Confirm that the number of bookings is displayed in the "Bookings" tab
in the left menu of the bibliographic record detail page.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35787: Add unit test for filter_by_bookable
Martin Renvoize [Tue, 16 Jan 2024 09:47:10 +0000 (09:47 +0000)]
Bug 35787: Add unit test for filter_by_bookable

Trivial test added for filter_by_bookable

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35787: Remove Koha::Template::Plugin::Biblio::CanBook
Jonathan Druart [Fri, 12 Jan 2024 13:02:29 +0000 (14:02 +0100)]
Bug 35787: Remove Koha::Template::Plugin::Biblio::CanBook

We can replace it with biblio.items.filter_by_bookable, no need to have this TT method.

Additionally there was no test for it.

Test plan:
Make sure the Bookings tab on the left of the biblio detail page is
displayed when needed.

Note that there is also a "Place booking" button that should appear in
the toolbar.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35782: DBRev 23.12.00.007
Katrin Fischer [Fri, 15 Mar 2024 07:36:44 +0000 (07:36 +0000)]
Bug 35782: DBRev 23.12.00.007

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 months agoBug 35782: Fix scoping problem with "biblio"
Jonathan Druart [Fri, 12 Jan 2024 14:22:52 +0000 (15:22 +0100)]
Bug 35782: Fix scoping problem with "biblio"

The "biblio" Koha::Biblio object we send from the controller needs to be
accessible from the include files.
To avoid a clash we rename it biblio_info

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>