Commit graph

43602 commits

Author SHA1 Message Date
bfd033c68a Bug 28926: Update cpanfile for Mojolicious::Plugin::OpenAPI v2.16
to test...
 - apply patch
 - build package
 - confirm in about.pl that minimum versions are updated

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:06:51 +01:00
0a324c66d8 Bug 29319: Use Business::ISBN to check ISBNs on addbooks.pl/cataloging search
To test:
1. Go to cataloging search and enter something like "7th Heaven".
2. Get an error when searching, Koha thinks you entered an ISBN
3. Apply patch
4. Try the same search, it should be a proper title search now
5. Find some stuff in the catalog with ISBN numbers in them.
6. The search should properly return ISBN13/ISBN10 searches, without with out the '-'.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 15:58:08 +01:00
b296b8ae23 Bug 29350: Don't need to escape the 'delete' TT methods
Will be needed by bug 22605.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 15:58:08 +01:00
Jérémy Breuillard
36d2111d70 Bug 29075: 'OPAC info' removed in branches.pl
In Administration › Libraries, we see content of OPAC info as escaped HTML.
This content may be long and seeing HTML tags is strange.

We should not show it in this table.
Or maybe create a modal preview of it (not escaped HTML).

To test :
1) Home > Administration > Libraries
2) In 'Address' column notice the 'OPAC info' field (if this one is
filled) with visible HTML tags
3) Apply patch
4) Repeat 1) and 'OPAC info' field should be gone

Signed-off-by: Owen <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 15:58:04 +01:00
0011eca7e6 Bug 28913: Note cronjob on automatic return settings in itemtypes
To test:
1 - go to itemtype config in Admin
2 - confirm it doesn't mention the automatic_return cron
3 - apply patch and restart
4 - confirm note now says "This feature requires the misc/cronjobs/automatic_checkin.pl cronjob. Ask your system administrator to schedule it."

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:25 +01:00
f0858a202b Bug 29223: Use patron's branchcode for digest if not sending digest per branch
To test:
 1 - Set system preference  AutoRenewalNotices to 'according to patron messaging preferences'
 2 - Set circ rule for auto renewal - 100 renewals allowed - no renewal before 100
    This shoud make a checkout eligible for many auto renewals for testing
 3 - Checkout an item to a patron, ensure item is from a different branch than patron
 4 - Ensure the patron has an email, and set an email for patron's branch and items branch
 5 - Set the patron messaging preferences for auto-renewal to 'email' and 'wants digest'
 6 - perl misc/cronjobs/automatic_renewals.pl --send-notices --confirm
 7 - Job dies:
    Can't call method "from_email_address" on an undefined value at /usr/share/koha/bin/cronjobs/automatic_renewals.pl line 286.
 8 - Apply patch
 9 - Repeat
10 - NO errors
11 - Check patron notices tab, should be a notice enqueued, check DB to see from address is patron's branch
12 - perl misc/cronjobs/automatic_renewals.pl --send-notices --confirm --digest-per-branch
13 - No errors
14 - Check patron notices tab, should be a notice enqueued, check DB to see from address is item's branch

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:21 +01:00
47a0e5e49e Bug 29152: Change default value for SearchLimitLibrary to 'homebranch'
Behvaiour before this option was added was 'homebranch'
We should preserve this rather than introduce a change

No atomic update added as liobraries may have already set/changed the value,
but safer to default to previous behvaiour

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:18 +01:00
afa594c73b Bug 24850: (follow-up) Add tests for invalid RFC3339 dates
Make this failure explicit, otherwise we get a "bad plan" failure.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:14 +01:00
b246e6de1b Bug 24850: (QA follow-up) Add more comments
To try and clarify the logic here I've added an addition comment to the
code.

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:14 +01:00
af3a612666 Bug 24850: Continue to handle default time and daylight saving
This patch prevents the call to set_time_zone if we are handling a
dateonly datetime string or a DST time

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:14 +01:00
ef882714e5 Bug 24850: Always return 'instance' local time
This patch adds handling to ensure we always convert a passed in time to
the instance configured timezone..

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:14 +01:00
c641589e44 Bug 24850: Don't fallback when date_format is passed
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:14 +01:00
911f9bcde5 Bug 24850: Add tests for invalid RFC3339 dates
We should die on invalidly formatted dates being passed.  This patch
adds such a test case.

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:14 +01:00
1059303f90 Bug 24850: Correct offset handling in dt_from_string
This patch adds correct handling for when an offset is passed within an
RFC3339 formatted datetime.

Test plan
1/ Run the DateUtils test and varify it now passes.

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:13 +01:00
d8d33c0e1b Bug 24850: Correct tests for offset handling in RFC3339 dates
The tests were incorrectly passing for RFC3339 dates passed with an
offset.  This patch corrects the test.

Test plan:
1/ Read the change
2/ Agree the change adheres to the RFC
3/ Run the test and varify it now fails
3/ Signoff

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:13 +01:00
Joonas Kylmälä
5095e0a954 Bug 29283: (QA follow-up) Remove code duplication
We have already a search filter for active orders.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:09 +01:00
1de960e7e3 Bug 29283: Don't attempt to cancel cancelled orders
When deleting a basket we cancel all the contained orders - when a
basket contains an order that was previously cancelled this can cause
an error if the biblio was deleted

When picking the orders to cancel, we should limit our search
to those not already cancelled.

To test:
- have a basket with at least one order
- click "Cancel order and delete catalog record", confirm cancellation of order and deletion of bib
- click "Delete basket", confirm deletion
- get error "Cannot insert order: Mandatory parameter biblionumber is missing at /kohadevbox/koha/acqui/basket.pl line 136.
 at /usr/share/perl/5.28/Carp.pm line 289"
- apply patch
- restart
- delete the basket
- success!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:09 +01:00
Joonas Kylmälä
90c577c06c Bug 26871: Flush SIP2 cache on every SIP request
SIP connections tend to be long lived, weeks if not months, in the
libraries I see. Basically the connection per SIP machine is initiated
once when the SIP machine boots and then never closed until
maintanance needs to be done. Therefore we need to reset the Koha's L1
caches on every SIP request to get the latest sysprefs and configs
from the memcached cache that is shared between all the Koha
programs (intranet, opac, sip, cronjobs) and is guaranteed to be up to
date.

To test:
 0. Have kohadevbox
 1. Enable IssueLog
 2. In one terminal run the command "perl C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml"
 3. Checkin and return a book using telnet:

    $ telnet localhost 6001
    9300CNterm1|COterm1|CPCPL|
    11YN20211010    10565320211010    105653AOCPL|AA1|AB3999900000001|ACterm1|BON|BIN|
    09N20211010    10564420211010    105644APCPL|AOCPL|AB3999900000001|ACterm1|BIN|

 4. Keep the telnet connection open and go to
    http://localhost:8081/cgi-bin/koha/tools/viewlog.pl and check that
    the *checkout* entry is in the circulation rules 5.
 6. Disable IssueLog
 7. Move back to the telnet prompt and check out and return a book again

    11YN20211010    10565320211010    105653AOCPL|AA1|AB3999900000001|ACterm1|BON|BIN|
    09N20211010    10564420211010    105644APCPL|AOCPL|AB3999900000001|ACterm1|BIN|

 8. Go check out the circulation logs and notice a new entry was added
    when it shouldn't have according to the IssueLog syspref!
 9. Apply patch and repeat steps to notice that the syspref is now
    followed correctly.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:07 +01:00
Joonas Kylmälä
ae84b13e48 Bug 14999: Make sure order prices are not mixed-up
We were shifting the price and replacement price for imported orders
only after the line:

> $duplinbatch = $import_batch_id and next if $duplifound;

This lead to the "replacementprice" and "price" query parameters not
being shifted/removed from the list if a duplicate record came across
and caused the prices be applied to the next record being imported.

To reproduce:
 1) Download two records from koha to marcxml file, then cat those:
   cat bib1.marcxml bib2.marcxml > bibs.marcxml
 2) Delete bib2 from koha
 3) Stage bibs.marcxml for import
 4) Create a new order basket, then "Add to basket" using "From a
    staged file" option
 5) Select both bib1 and bib2 and set price & replacement price for
    bib1 to be 99.00 and for bib2 to be 88.00
 6) Click save and notice bib2 was imported with the wrong prices, 99.00!
 7) Apply patch and notice the prices are now correctly set to 88.00.

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:06 +01:00
134e9715d2 Bug 24370: Allow resetting library to ANY
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:04 +01:00
153ff795ab Bug 24370: (QA follow-up) Make new suggestions default to the library you re viewing
It looks like this problem was caused by code from bug 25033, we were attempting to have the
dropdown either be the current branch filter, or the suggestion's branch code, but the variables here are confusing and it didn't work

This explicitly sets the branchcode when creating a new suggestion to allow fixing current behaviour and
show the correct value when creating new

To test:
1 - Be signed in as branch A
2 - Browse to suggestions and limit to branch "Any"
3 - Click 'New suggestion"
4 - Defaults to Any
5 - Cancel and limit to branch B
6 - New suggestion defaults to branch B

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:04 +01:00
Katrin Fischer
02adde9a43 Bug 24370: Don't reset library when editing a suggestion
When editing a suggestion, the library will be reset to the currently
logged in librarian's homebranch, no matter what the libray was before.

This fixes this, the library selection will remain at the db value when
edited.

To test:
- Create a suggestion with Any library.
- Edit the suggestion - it will show your homebranch as library
- Change to any library but your homebranch
- The summary should show the correct value after saving
- Edit the suggestoin again - it's set back to your homebranch again
- Apply patch
- Repeat the steps, the pull down should now show the correct library
  at all times.

Caveat: I think there is a somewhat separate issue/bug in that once a library
was saved, you cannot switch back to "Any". I haven't been able to fix this and
suggest to maybe file a separate bug.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:04 +01:00
George Veranis
ef335f252a Bug 28573: Replace authority record with Z39.50/SRU creates new authority record
When trying to replace an authority record with Z39.50/SRU then a new authority
record is created without deleting the old one and not link the new one with
any record.

This patch fixes that.

Test plan:

1) Try to catalogue a new authority record from cataloguing form.
2) Try to replace that authority record with Z39.50/SRU, then a new authority
record is created and also you have that one that you tried to replace.
3) Apply the patch.
4) Try to replace the authority from step1 with Z39.50/SRU, then is working as
expected.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:00 +01:00
1bfa981a5e Bug 17600: Fix imports for GetClassSources in guided_reports.pl
This will fix the broken option to use cn_source as a runtime
parameter, e.g. <<Call no. source|cn_source>>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:27:48 +01:00
Andrew Nugged
32ca2b2fd9 Bug 28959: (QA follow-up) One more lost 'category' to 'public' change
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:27:12 +01:00
145b26a272 Bug 28959: Fix occurrence in tools/batch_record_modification.pl
No method count found for Koha::Virtualshelves DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'category' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 601                                                                                                                                                                             at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt line 80.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:27:12 +01:00
20991feb62 Bug 29374: Don't crash if search engine returns a deleted record
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-29 15:46:17 +02:00
d895962994 Bug 29368: Fix remove_from_cart
Reusing what has been done previously.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-29 15:46:17 +02:00
4988c80905 Bug 29368: Correctly mock Zebra index from tests
This is just reusing what is done in Search.t (and that is correct).
But search_utf8.t and remove_from_cart.t are wrong as we want to use the
UI (and we cannot mock the zebra index, ie. koha-conf, from tests for
plack).

This still needs some work but improve a bit the existing code and make
tests pass (hopefully!)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-29 15:45:53 +02:00
d4f32c745f Bug 29364: Revert changes to framework visibility made by Search.t
To recreate run:

drop database koha_kohadev;
create database koha_kohadev;

restart_all

KOHA_TESTING=1 prove t/db_dependent/selenium/01-installation.t t/db_dependent/Search.t t/db_dependent/Koha/UI/Form/Builder/Item.t
        #   Failed test 'Item types should be sorted by description and an empty entries should be shown'
        #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 127.
        #     Structures begin differing at:
        #          $got = undef
        #     $expected = ARRAY(0x557716b68e98)
        # Itemtypes details: $VAR1 = undef;
        # $VAR2 = [
        #           'BK',
        #           'CF',
        #           'CR',
        #           'ihxGmo7',
        #           'MP',
        #           'MU',
        #           'MX',
        #           'REF',
        #           'VM'
        #         ];

        #   Failed test 'Labels should be correctly displayed'
        #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 130.
        #     Structures begin differing at:
        #          $got = undef
        #     $expected = HASH(0x557716e2e150)
        # Looks like you failed 2 tests of 2.

    #   Failed test 'itemtypes'
    #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 133.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-29 10:33:57 +02:00
42d1bc3d49 Bug 29363: Fix TestBuilder.t if bib 123 does not exist
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-29 09:59:29 +02:00
20078affb9 Bug 28959: DBIC update
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:47 +02:00
900bd815d1 Bug 28959: DBRev 21.06.00.039
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:46 +02:00
d821cf9c9c Bug 28959: Fix other cases
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:38 +02:00
35d03d6cf6 Bug 28959: (follow-up) Adjust more places in which 'category' was used
Some links still had category.

I propose we use explicit public=1 and public=0 when links to public/private are side by side.
Otherwise whe just use /cgi-bin/koha/opac-shelves.pl?op=list using default value 0.

Signed-off-by: David Nind <david@davidnind.com>
JK: Adjust commit title
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:38 +02:00
adc3772204 Bug 28959: (follow-up) Adjust all places in which 'category' was used
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:38 +02:00
0c72031539 Bug 28959: Add virtualshelves.public as a boolean
This patchset moves the 'category' attribute for virtual shelves, that
takes values of 1 and 2 (private and public respectively) into a boolean
for public.

The DBRev is trivial, and the changes to the code are as well.

To test:
1. have some known public and private lists
2. Apply this patches
3. Run:
   $ updatedatabase
=> SUCCESS: Public lists have public=1, private have public=0
4. Run:
   $ kshell
  k$ prove t/db_dependent/Utils/Datatables_Virtualshelves.t \
           t/db_dependent/Virtualshelves.t
=> SUCCESS: Tests pass!
5. Try the feature in staff and OPAC
=> SUCCESS: All good
6. Sign off :-D

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

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:38 +02:00
d38be59a48 Bug 28959: Move category => public
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
c9fc07aee3 Bug 29290: Unit tests
This patch adds unit tests for the new route. All behaviors are tested:

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
8fdd52b17c Bug 29290: Add GET /biblios/:biblio_id/checkouts
This patch adds the required controller method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
d46492ac23 Bug 29290: Rename relationships borrower => patron
This is a trivial change that is required to be able to embed patron
objects in the (old) checkout object.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
6ff32002da Bug 29290: Add spec changes
This patch adds the new route. It also tweaks the checkout object
definition to allow embedding the required related objects (for bug 29275).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
84f5167108 Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio
This patch adds helper methods for accessing current and past checkouts
for a given Koha::Biblio object.

To test:
1. Apply the unit tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> FAIL: Methods are not implemented
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: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
ca5781d795 Bug 29288: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
1f3b63261e Bug 29108: Add q parameters to items routes
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
f5ee8ced57 Bug 29107: Rename item_type => item_type_id
This simple change renames the attribute in the item object API
representation.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass
2. Run:
   $ git grep 'api/v1/items'
=> SUCCESS: The items routes are not (yet) used in Koha
3. Run:
   $ cd koha-tmpl
   $ git grep --name-only '"embed"'
=> SUCCESS: Only two templates are using embed.
4. Check:
   - register.tt uses it to embed the manager, good
   - parcel.tt uses it to embed items. Alert.
=> SUCCESS: parcel.tt only uses a count on items. No item_type involved.
5. Sign off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
9ef23bb642 Bug 27358: Add GET /public/biblios/:biblio_id/items
This patch introduces a route to fetch items belonging to a biblio. It
is expected to return the 'public' representation of the Koha::Item
objects.

It is also enforcing the visibility rules, by using
Koha::Items->filter_by_visible_in_opac.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Test pass and they cover all the cases!
3. Try your favourite REST tool against the new route.
4. Sign off :-D

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
f907070116 Bug 27358: Unit tests for public items retrieval
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
fde97d3969 Bug 28948: Fix random failure
This patch makes the query for randomly generated libraries
deterministic, thus getting rid of the random tests failures.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
4a1d841e44 Bug 28948: Don't require catalogue permission for public route, don't allow smtp server embed
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00