Commit graph

6007 commits

Author SHA1 Message Date
35165e5f13
Bug 30718: (follow-up) index_records is called more times than we thought
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-22 11:19:27 -03:00
a11633379f
Bug 31076: Handle year limits with equal sign or colon
To test:
1 - Enable ES and index
2 - Set expandedSearchOption to 'show'
3 - Advanced search on staff and opac using Year field on staff and Publication date range on OPAC for:
    2005
    2005-
    -2005
    <2005
    >2005
    2005-2010
4 - Confirm ranges don't work on staff side, but do on opac
5 - Apply patch
6 - Repeat searches - they work on both staff and opac
7 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-19 16:28:53 -03:00
7b645b0208
Bug 28327: (follow-up) Comma as default CSV delimiter
Looks like most of existing code wants comma as default value.

Also impact installer/data/mysql/mandatory/sysprefs.sql.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-19 15:53:17 -03:00
a2e9b44074
Bug 28327: Add unit tests
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-19 15:53:07 -03:00
Julian Maurice
b760eb4725
Bug 29955: Move populate_order_with_prices to Koha namespace
and split the subroutine into 2 smaller subroutines (one for ordering,
the other for receiving)

Test plan:
1. Create a vendor and an acquisition basket
2. In this basket, create new orders using all the different methods
   (from an existing record, from a suggestion, from a new record, ...)
   then close the basket and receive these orders.
   Make sure it works the same with and without the patch
3. Run tests in t/Prices.t,
   t/db_dependent/Acquisition/populate_order_with_prices.t, and
   t/db_dependent/Budgets.t

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-19 15:47:51 -03:00
48bf9b1d91
Bug 30718: Use flatpickr's altInput
The idea rely on the KohaDates TT plugin for the date formatting. We
should not have any output_pref calls in pl or pm (there are some
exceptions, for ILSDI for instance).

Also flatpickr will deal with the places where dates are inputed. We
will pass the raw SQL value (what we call 'iso' in Koha::DateUtils), and
the controller will receive the same value, no need to additional
conversion.
Note that DBIC has the capability to auto-deflate DateTime objects,
which makes things way easier. We can either pass the value we receive
from the controller, or pass a DT object to our methods.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-19 08:26:31 -03:00
b02b66acf5
Bug 30779: Remove _update_import_record_marc and update tests
This patch removes the now unused: _update_import_record_marc

Additionally, as items are already present in import biblio we no longer need to embed
them, so that parameter is removed and the option removed from the sub and pod and everywhere
it was used

In all cases, we were embedding, so we don't need a way to get without

Tests updated

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-18 09:02:04 -03:00
217e953ffb
Bug 31382: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-17 15:52:02 -03:00
089f5a4cf5
Bug 26632: Remove two more occurrences
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-17 09:24:09 -03:00
21e4995a31
Bug 27342: (QA follow-up) Fix test
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-16 10:50:47 -03:00
a433573054
Bug 27342: (QA follow-up) Remove dbh from new tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-16 10:45:42 -03:00
1b92fd78fd
Bug 27342: Remove dbh from C4::Auth
We must not pass $dbh but retrieve it when needed instead

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-16 10:45:41 -03:00
18211bf233
Bug 30901: Add Unit Tests
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-16 10:43:10 -03:00
6bc85707ba
Bug 31313: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-16 10:10:03 -03:00
70cb4e22c0
Bug 31313: Fix availability - OPAC opac-detail
Has to move some code to a method

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-16 09:23:54 -03:00
2f71ac6f77
Bug 28787: Fix misleading tests in two_factor_auth.t
We were having a "Patron is not authenticated yet" comment, but it was not correct,
we set 'number' and 'id' in session, and waiting-for-2FA was not set => the patron is fully authenticated.
The test returned 401 because we fully authenticated user cannot request
an otp token when not waiting for the second auth step.

This situation is already covered (last test of the subtest).

Test plan:
  prove t/db_dependent/api/v1/two_factor_auth.t
must return green

Sponsored-by: Rijksmuseum, Netherlands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:38:46 -03:00
12305c89d7
Bug 28787: (follow-up) Typo and additional test
Adding a test for a 403 status when lowering authorization.
The Auth mock for check_cookie_auth is not needed here.
Reading back the session after flush either.

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

Sponsored-by: Rijksmuseum, Netherlands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:38:45 -03:00
2568234cda
Bug 28787: Comment selenium test that will fail if no SMTP server is defined
This is a deadlock I think. Any ideas how we could continue to test that
in any conditions?

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

Sponsored-by: Rijksmuseum, Netherlands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:38:45 -03:00
2b4baae94a
Bug 28787: Mock send_or_die
To make the tests pass even if no SMTP server is defined.

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

Sponsored-by: Rijksmuseum, Netherlands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:38:44 -03:00
950cfa1173
Bug 28787: Don't send the notice if we are not waiting for 2FA
If we are fully logged-in or haven't pass the password phase, don't send
the notice!

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

Sponsored-by: Rijksmuseum, Netherlands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:38:44 -03:00
25c522fea1
Bug 28787: Rename the REST API route to /auth/otp/token_delivery
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Sponsored-by: Rijksmuseum, Netherlands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:38:44 -03:00
1d0eab9b94
Bug 28787: Fix t/db_dependent/api/v1/two_factor_auth.t
Changing flags to 20 to include the required Staff access for
intranet login.
This changes the http status. The API raises an exception now.

Test plan:
Run t/db_dependent/api/v1/two_factor_auth.t

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

Sponsored-by: Rijksmuseum, Netherlands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:38:43 -03:00
6e099d0bbd
Bug 28787: Send a notice with the TOTP token
Bug 28786 let librarians enable a Two-factor authentication but force them to use
an application to generate the TOTP token.

This new enhancement add the ability to send an email containing the token to the
patron once it's authenticaed

The new notice template has the code '2FA_OTP_TOKEN'

Test plan:
- Setup the two-factor authentication (you need the config entry and the
syspref ON)
- Enable it for your logged in patron
- Logout
- Login and notice the new link "Send the code by email"
- Click on it and confirm that you received an email with the code
- Use the code to be fully logged in

QA question: Is 400 the correct error code to tell the email has not
been sent?

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

Sponsored-by: Rijksmuseum, Netherlands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:38:43 -03:00
Andrew Isherwood
80e179edd7
Bug 28909: Allow illview to use backend template
This commit allows illview to use an intranet template supplied by the backend, as
per other stages. The template must be named illview.inc

Test plan:
- Apply the patch
- Install FreeForm backend (https://github.com/PTFS-Europe/koha-ill-freeform)
- Create a request
- On the resulting "Manage ILL request" note the display is normal
- Create a new file in the FreeForm backend directory: /intra-includes/illview.inc
  with the following content:

  [% BLOCK backend_jsinclude %]
  <script>(function() { alert("Working!"); })()</script>
  [% END %]

- Restart Plack if enabled
- Reload the page
=> TEST: Observe that the alert specified in the template is displayed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 13:21:39 -03:00
52d107bf5d
Bug 31306: (QA follow-up) Add comments to test
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 11:59:31 -03:00
116ac99d3c
Bug 31306: Add tests for search_ordered
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 11:59:30 -03:00
2c3aa214ef
Bug 29897: Remove 'linkage' leftover
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 10:58:48 -03:00
dd4ea16992
Bug 29897: Display author's identifiers
This new enhancement add the capability to list the different
identifiers of authors. It is helpful for research publications for
instance.

This patch will add a new "Author identifiers" tab on the detail page
(OPAC) of a bibliographic record, with the list of the authors and their
identifiers.
On the detail page of the authority record, the same identifier list
will be displayed.

Test plan:
Create some authority with
024
  $a source
  $2 number
  $6 link to the source
With the pref turned ON you will be able to see the new information.

Sponsored-by: Orex Digital

Signed-off-by: Orex Digital <info@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 10:58:44 -03:00
603d427607
Bug 29897: Move code to private method for reusability
Sponsored-by: Orex Digital

Signed-off-by: Orex Digital <info@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 10:58:44 -03:00
7b74bedd2d
Bug 29897: Rename get_marc_authors with get_marc_contributors
get_marc_authors actually return authors from 700..712, not the first
author from 200

Sponsored-by: Orex Digital

Signed-off-by: Orex Digital <info@orex.es>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 10:58:39 -03:00
Katrin Fischer
27fa89648e
Bug 28269: (QA follow-up) Fix typo in test description
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 09:00:52 -03:00
Slava Shishkin
bfc5c5eeff
Bug 28269: Add tests for Acquisitions Orders search by ISSN
also with SearchWithISSNVariations on and off

Signed-off-by: KIT Library Germany <michaela.sieber@kit.edu>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 09:00:52 -03:00
3ab8807d7e
Bug 31183: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 08:26:19 -03:00
f8865ecd43
Bug 27779: (QA follow-up) Fix unit test
I forgot to adapt the unit test for the new 'related_debit' key in the
outpur from the summary method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-09 07:37:03 -03:00
00f489de6d
Bug 31296: Add ability to disable demagnetizing items via SIP2 based on itemtypes
Some libraries have certain item types that can only do in house checkouts via SIP self check machines. In these cases, the items should not be demagnetized since the items cannot leave the library.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-08 13:13:26 -03:00
a26211d53d Revert "Bug 31104: Add a selenium test"
This reverts commit 56d79a483d.
2022-08-08 11:18:02 -03:00
dd3ba23f4a
Bug 29971: Add selenium tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-05 14:48:50 -03:00
fa22219a1f
Bug 31288: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-03 11:42:39 -03:00
12f42a5aaf
Bug 29579: (QA follow-up) Fix up t/db_dependent/Koha/Reports.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 14:37:09 -03:00
36d1f18bd5
Bug 30392: Set deleted_on when an item is (marked as) deleted
We could like to track down when an item has been moved to the
deleteditems table.

Test plan:
Created a new item, delete it
Not that the deleteditems.deleted_on value is set correctly

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 14:34:05 -03:00
Slava Shishkin
cdcccc9cbe
Bug 23919: Add tests for Items search by ISBN and ISSN with variations
(sysprefs SearchWithISBNVariations/SearchWithISSNVariations)

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 13:21:50 -03:00
Slava Shishkin
d5850d8ba4
Bug 23919: Add tests for biblioItems search by ISBN and ISSN with
variations (sysprefs SearchWithISBNVariations/SearchWithISSNVariations)

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 13:21:50 -03:00
6a3262de99
Bug 30612: Rename other occurrences
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 09:59:05 -03:00
5b7ec36b7f
Bug 30612: (QA follow-up) Rename accountlines method to account_lines
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 09:59:05 -03:00
58dfeff13a
Bug 30612: Add accountlines method to Koha::Checkout and Koha::Old::Checkout
It would be very useful to have an accountlines method on checkouts objects. In particular it would make fees related to a checkout available from the checkout objects in overdue notices.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Account/Line.t
3) prove t/db_dependent/Koha/Checkouts.t

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 09:59:05 -03:00
ad0aa754ee
Bug 27849: (follow-up) Add test
Compacting the code a bit too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 09:53:35 -03:00
28896d9c30
Bug 31223: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-01 09:03:47 -03:00
ba7153a762
Bug 14364: Fix spelling and tests
Moved the installer to pl file
Adjusted capitalization / reply-to
Fix tests by importing needed fuction and adjusting a wrong call

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-07-29 16:00:34 -03:00
6c75695542
Bug 14364: (QA follow-up) Generate message for transfers as well
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-07-29 16:00:22 -03:00
Kyle M Hall
6a770ace34
Bug 14364: Allow automatically canceled expired waiting holds to fill the next hold
Right now, if a library automatically cancels expired waiting holds, a
librarian must still re-checkin an item to trap the next available hold
for that item. It would be better if the next hold was automatically
trapped and the librarians receive an email notification so they can
make any changes to the item if need be ( hold area, hold slip in item,
etc ).

Test Plan:
 1) Apply this patch
 2) Run updatedatabase.pl
 3) Create a record with one item
 4) Place two holds on that record
 5) Check in the item and set it to waiting for the first patron
 6) Set ReservesMaxPickUpDelay to 1
 7) Enable ExpireReservesMaxPickUpDelay
 8) Enable ExpireReservesAutoFill
 9) Set an email address in ExpireReservesAutoFillEmail
10) Modify the holds waitingdate to be in the past
11) Run misc/cronjobs/holds/cancel_expired_holds.pl
12) Note the hold is now waiting for the next patron
12) Note a waiting hold notification email was sent to that patron
13) Note a hold changed notification email was sent to the library

Signed-off-by: Victoria Faafia <vfaafia29@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-07-29 16:00:17 -03:00