koha.git
3 years agoBug 25313: Add skip_merge to ModAuthority
Marcel de Rooy [Wed, 29 Apr 2020 14:19:00 +0000 (16:19 +0200)]
Bug 25313: Add skip_merge to ModAuthority

Sometimes you know that the merge is useless, since the reporting
tag did not change.
Might be handy in batch processing of authority records.

Test plan:
Pick an authority with a few linked biblio recs (so that it will
immediately merge; lower than MergeLimit).
Open authority record and save it.
Verify that a linked biblio record was merged. Check time in 005.
You proved that this patch does not break the regular process.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25313: Regression tests
Tomas Cohen Arazi [Tue, 11 Aug 2020 12:26:50 +0000 (09:26 -0300)]
Bug 25313: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26337: Pass skip_merge to DelAuthority when removing unsused authorities
Nick Clemens [Tue, 1 Sep 2020 13:32:46 +0000 (13:32 +0000)]
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities

This script checks that an authority is not being used before deleting it.
We do not need to check biblios for the authority id as we have already verified it is unused.

TO test:
 1 - Reset db to koha test database
 2 - perl misc/migration_tools/remove_unused_authorities.pl -t
 3 - Note a number of unsued authorities
 4 - perl misc/migration_tools/remove_unused_authorities.pl -c
 5 - Note authorities are removed
 6 - Reset db
 7 - Apply patch
 8 - perl misc/migration_tools/remove_unused_authorities.pl -t
 9 - Note results are the same
10 - perl misc/migration_tools/remove_unused_authorities.pl -c
11 - Note results are the same

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26944: Point help link to automatic item mod in manual
Andrew Fuerste-Henry [Thu, 5 Nov 2020 20:28:11 +0000 (20:28 +0000)]
Bug 26944: Point help link to automatic item mod in manual

To test:
1 - go to automatic item mod, click help, end up at manual homepage
2 - apply patch, restart, reload page
3 - click link again, go to auto item mod in manual

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26846: Fix regressions - Preselect expected and late serials
Jonathan Druart [Tue, 10 Nov 2020 11:32:04 +0000 (12:32 +0100)]
Bug 26846: Fix regressions - Preselect expected and late serials

This is a follow-up for bug 17674. Expected and late serials must be
checked by default.

Test plan:
Have some serial collection and notice that the checkboxes are checked
for expected and late serials
/serials/serials-collection.pl?subscriptionid=42

Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26939: Use AV description in sales table display
Martin Renvoize [Tue, 3 Nov 2020 09:57:32 +0000 (09:57 +0000)]
Bug 26939: Use AV description in sales table display

Content should use the description rather than the code

Test plan
1/ Enable 'UseCashRegisters'
2/ Make some payments against a cash register
3/ Navigate to the cash register summary page via tools > cashup
registers > register name
4/ Note that the payment type you selected at payment time appears as
the code of the authorized value as aposed to the description.
5/ Apply patch
6/ Refresh page
7/ The payment type should now contain the description

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26938: Prevent flash of unstyled sales table
Martin Renvoize [Tue, 3 Nov 2020 09:47:12 +0000 (09:47 +0000)]
Bug 26938: Prevent flash of unstyled sales table

On the registers page the table has come complex data structures
embedded to allow for all the functionality we bring into the datatable.

We should hide the table on page load and only display it at DataTables
init time once the weird content has been beautified by DataTables.

Test plan
1/ Enable 'UseCashRegisters' and 'EnablePointOfSale'
2/ Add a cash register and make some transactions against it.
3/ Navigate to the 'Register details' page
4/ Note that some 'funky' JSON strings appear in the table briefly
before it is restyled when DataTables loads.
5/ Apply the patch
6/ Rebuild the CSS from the SCSS files
7/ Reload the page (hard reload to get the CSS changes)
8/ Note that the table now only appears once the nice formatting that
DataTables adds is applied.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26986: Prevent Selenium's StaleElementReferenceException
Jonathan Druart [Tue, 10 Nov 2020 10:37:55 +0000 (11:37 +0100)]
Bug 26986: Prevent Selenium's StaleElementReferenceException

This is a follow-up bug for bug 26162

By finding the element before the click I hope to get the good element,
even if the page changed in the meanwhile.

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>
3 years agoBug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration
Jonathan Druart [Tue, 10 Nov 2020 11:55:17 +0000 (12:55 +0100)]
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration

The assumption on bug 26119 was wrong. We actually store patron's
attributes during self-registration if
PatronSelfRegistrationVerifyByEmail is not enabled.

Test plan:
Test the different combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
Confirm that the patron's attributes appears during self-registration if
PatronSelfRegistrationVerifyByEmail is not set.
Confirm that the patron's attributes are stored when they are displayed
on the self-registration form
Confirm that you can edit the patron's attributes in any cases (if they
are marked as editable at the OPAC)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26903: Pass record ids and records through to update_index when passed to index_r...
Nick Clemens [Fri, 13 Nov 2020 16:33:40 +0000 (16:33 +0000)]
Bug 26903: Pass record ids and records through to update_index when passed to index_records

When both a record and record_id are passed to index_records the data should be passed through
to update_index. We missed copying over the record ids to the variable we use as a check.

To test:
1 - Set searchEngine system preference to Elasticsearch
2 - Reindex your db
3 - Search authorities
4 - Edit a record and add 'testwaffle' to the main heading
5 - Search authorities for 'testwaffle' - no results
6 - Apply patch
7 - Edit the record again, change 'testwaffle' to 'testpancake'
8 - Search authorities for 'testpancake' - result!
9 - Confirm imported authorities and authorities added via Z39 are correctly indexed

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>
3 years agoBug 26903: Unit tests
Nick Clemens [Fri, 13 Nov 2020 16:33:12 +0000 (16:33 +0000)]
Bug 26903: Unit tests

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>
3 years agoBug 26988: (QA follow-up) Unit tests
Tomas Cohen Arazi [Mon, 16 Nov 2020 15:54:13 +0000 (12:54 -0300)]
Bug 26988: (QA follow-up) Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27002: Update callers for changed return
Martin Renvoize [Fri, 13 Nov 2020 13:53:15 +0000 (13:53 +0000)]
Bug 27002: Update callers for changed return

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27002: Update Koha::Biblio->pickup_locations to return a resultset
Martin Renvoize [Thu, 12 Nov 2020 08:09:56 +0000 (08:09 +0000)]
Bug 27002: Update Koha::Biblio->pickup_locations to return a resultset

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26516: Don't accept incorrect values for copyrightdate/publicationyear
Nick Clemens [Wed, 23 Sep 2020 14:42:40 +0000 (14:42 +0000)]
Bug 26516: Don't accept incorrect values for copyrightdate/publicationyear

The previous patch rejects incorrect values when saving to the db specifically for copyrightdate
An error is thrown for the int conversion when it fails

Rather than catching things when saving we can fix the value when generated, simply returning null when parsing
the record

To test:
1 - Add a new record to Koha making sure data is valid except 260$c:
    198-
2 - Save the record
3 - It fails
4 - Apply this patch
5 - Restart all the thigns
6 - Repeat
7 - Success!

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27021: Make chaining ->empty always return an empty resultset
Tomas Cohen Arazi [Fri, 13 Nov 2020 18:54:32 +0000 (15:54 -0300)]
Bug 27021: Make chaining ->empty always return an empty resultset

This patch borrows the implementation Martin did on bug 27002, to
woraround this issue, and implements it properly on the
Koha::Objects->empty method.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Objects.t
=> FAIL: Tests fail! The resultset should be empty and it isn't!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off!

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>
3 years agoBug 27021: Regression tests
Tomas Cohen Arazi [Fri, 13 Nov 2020 18:47:39 +0000 (15:47 -0300)]
Bug 27021: Regression 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>
3 years agoBug 18267: Refactored Edifact Price Calculations
Colin Campbell [Thu, 12 Nov 2020 11:42:05 +0000 (11:42 +0000)]
Bug 18267: Refactored Edifact Price Calculations

Refactored the price calculations for Quotes and Invoices
This takes in to account various combinations used by different
vendors. Makes the extraction of basic price, quantity and tax
information more reliable. Tests are in Edifact.t and EdiInvoice.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25761: (QA follow-up) Consistent flag names
Martin Renvoize [Fri, 13 Nov 2020 12:12:20 +0000 (12:12 +0000)]
Bug 25761: (QA follow-up) Consistent flag names

This follow-up updates the config flag to be consistent with bug 24449
and updates the debian template file to match too.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25761: Implementation of too_many_overdue has unintended consequences
Kyle M Hall [Mon, 15 Jun 2020 16:26:14 +0000 (12:26 -0400)]
Bug 25761: Implementation of too_many_overdue has unintended consequences

Bug 24449 implemented the too_many_overdue SIP flag ( position 6 of the
patron status flags ). This has had unintended consequences as
many library use SIP2 for validation to eresource vendors ( Overdrive,
Hoopla, etc ), but do not want overdue checkouts to block the
use of these resources.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Find a patron with overdue items
4) Run a SIP2 patron information request
5) Note the "too many overdue" flag is set
6) Set the new SIP config option "disable_too_many_overdue" for the
account you used for testing
7) Restart the SIP server
8) Run the same patron information request
9) Notice the "too many overdue" flag is no longer set!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27012: Fix incorrect SQL syntax in hold merging
Joonas Kylmälä [Fri, 13 Nov 2020 10:07:22 +0000 (12:07 +0200)]
Bug 27012: Fix incorrect SQL syntax in hold merging

If you merge two records with holds in them following error happens
without this patch:

[WARN] DBD::mysql::st execute failed: called with 4 bind variables when 3 are needed [for Statement "SELECT * FROM reserves WHERE biblionumber = ? AND (found <> ? AND found <> ? OR found is NULL) ORDER BY reservedate ASC" with ParamValues: 0=Null!, 1=Null!, 2=Null!] at /kohadevbox/koha/C4/Reserves.pm line 2002.

To test:
   1) Notice prove t/db_dependent/Reserves.t fails with above error
   2) Apply patch
   3) Notice prove t/db_dependent/Reserves.t passes

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27012: Add test for C4::Reserves::MergeHolds
Joonas Kylmälä [Fri, 13 Nov 2020 11:41:16 +0000 (13:41 +0200)]
Bug 27012: Add test for C4::Reserves::MergeHolds

This does a basic check whether a hold gets moved to another biblio
when MergeHolds() is called.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: Adjust for bug 26963
Nick Clemens [Fri, 13 Nov 2020 13:15:29 +0000 (13:15 +0000)]
Bug 26988: Adjust for bug 26963

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: No need to check if hold is linked to a patron
Jonathan Druart [Fri, 13 Nov 2020 10:07:53 +0000 (11:07 +0100)]
Bug 26988: No need to check if hold is linked to a patron

Holds are deleted along with patrons.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (follow-up) Change event to focus
Agustin Moyano [Wed, 11 Nov 2020 15:22:20 +0000 (12:22 -0300)]
Bug 26988: (follow-up) Change event to focus

Click event on select element if Firefox does not work as expected, so
this patch changes the event to focus for it to work seamlessly in both
browsers.

https://bugs.koha-community.org/show_bug.cgi?id=26899
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (follow-up) Fix filter and encode api values and escape rendered values
Nick Clemens [Wed, 11 Nov 2020 03:11:56 +0000 (03:11 +0000)]
Bug 26988: (follow-up) Fix filter and encode api values and escape rendered values

This patch makes the QA tools happy and follows correct procedures for passing data to
and rendering data from the api

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (follow-up) Adjust code to use api field names
Nick Clemens [Wed, 11 Nov 2020 02:53:46 +0000 (02:53 +0000)]
Bug 26988: (follow-up) Adjust code to use api field names

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (QA follow-up) Make the API return proper library objects
Tomas Cohen Arazi [Tue, 10 Nov 2020 20:38:26 +0000 (17:38 -0300)]
Bug 26988: (QA follow-up) Make the API return proper library objects

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: Make ->patron prefetchable
Tomas Cohen Arazi [Tue, 10 Nov 2020 20:37:21 +0000 (17:37 -0300)]
Bug 26988: Make ->patron prefetchable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: Add API route to fetch hold pickup locations and use it in the holds table
Nick Clemens [Tue, 10 Nov 2020 13:35:14 +0000 (13:35 +0000)]
Bug 26988: Add API route to fetch hold pickup locations and use it in the holds table

To test:
1 - Place a number of holds on a record
2 - Have different pickup locations for the holds
3 - Have some libraries that are not pickup locations
4 - Load the holds tab for the record and note libraries not pickup locations are not in dropdowns
5 - Apply patch and restart all things
6 - Reload the holds table
7 - Click on a dropdown, note the spinner, should load successfully
8 - Confirm the dropdown matches the options before the patch
9 - Confirm updating the hold location works

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: Ignore existing libraries
Jonathan Druart [Fri, 13 Nov 2020 08:23:51 +0000 (09:23 +0100)]
Bug 26963: Ignore existing libraries

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: (QA follow-up) Fix up tests and cover case of undefined ccode
Nick Clemens [Wed, 11 Nov 2020 13:26:58 +0000 (13:26 +0000)]
Bug 26963: (QA follow-up) Fix up tests and cover case of undefined ccode

While this technically shouldn't happen, if a library creates itemtype limits, then flips the pref, those rules are still in the db until a ccode rule is saved.

To be extra safe, when checking for rules of one type, we should make sure the other type is undef - i.e. if looking for ccode rules, we should confirm the itype is undef for those rules

Additionally, we shouldn't set the barcode now that we are not deleting all items, so we use copynumber for our item identification field as it doesn't need to be unique in the DB

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: (QA follow-up) Fix cases where we expected a list
Nick Clemens [Wed, 11 Nov 2020 14:09:24 +0000 (14:09 +0000)]
Bug 26963: (QA follow-up) Fix cases where we expected a list

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: (QA follow-up) Update mocked return of pickup_locations
Martin Renvoize [Wed, 11 Nov 2020 15:43:57 +0000 (15:43 +0000)]
Bug 26963: (QA follow-up) Update mocked return of pickup_locations

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: (QA follow-up) Don't delete existing data before tests
Nick Clemens [Wed, 11 Nov 2020 12:49:00 +0000 (12:49 +0000)]
Bug 26963: (QA follow-up) Don't delete existing data before tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: (QA follow-up) Migrate unit tests into pickup_location
Martin Renvoize [Wed, 11 Nov 2020 16:06:21 +0000 (16:06 +0000)]
Bug 26963: (QA follow-up) Migrate unit tests into pickup_location

We wrote unit tests for _can_pickup_locations as part of this patchset,
but then I inlined the method whilst golfing. This patch moves those
tests into the existing pickup_locations test so we more thoroughly
cover the case where branch transfer limits are in play.

NOTE: The tests all assume that all items have an effective_itemtype and
ccode. I'm pretty sure items all have a type at this point, but I'm less
sure we enforce collection codes?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: (QA follow-up) Convert to ResultSets
Martin Renvoize [Wed, 11 Nov 2020 08:57:21 +0000 (08:57 +0000)]
Bug 26963: (QA follow-up) Convert to ResultSets

This patch removes the previously introduced private method by
converting the arrayref returns to ResultSets appropriately and inlining
the filter search queries.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: (follow-up) Change subroutine name for QA tools
Nick Clemens [Wed, 11 Nov 2020 02:37:55 +0000 (02:37 +0000)]
Bug 26963: (follow-up) Change subroutine name for QA tools

It didn't like the ending _at

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: Don't call 'can_be_transferred' for each possible library for each item
Nick Clemens [Mon, 9 Nov 2020 13:53:51 +0000 (13:53 +0000)]
Bug 26963: Don't call 'can_be_transferred' for each possible library for each item

Currently When calling Koha::Template::Plugin::Branches::pickup_locations
we call pickup_location for each item of the bib, and for each item we get a list of possible
branches, we then check those branches against the transfer limits, this is inefficent

Given a system with 100 branches, and each branch having an item attached to one bib (100 items)
we will call can_be_transferred ~10000 times - and that will happen for each hold placed on the bib

For me this patch reduced load time from 77 seconds to 18 seconds

To test:
1 - Find a bib
2 - Place 4 title level holds
3 - Add some branches and items for this bib to your system:
  INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"A"),pickup_location FROM branches;
  INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"B"),pickup_location FROM branches;
  INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"C"),pickup_location FROM branches;
  INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"D"),pickup_location FROM branches;
  INSERT INTO items (biblionumber,biblioitemnumber,barcode,itype,homebranch,holdingbranch) SELECT 1,1,CONCAT("test-",branchcode),'BKS',branchcode,branchcode FROM branches;
4 - Set systempreferences:
    UseBranchTransferLimits = 'enforce'
     BranchTransferLimitsType = 'item type'
5 - Find the bib and click the holds tab
6 - Wait for a long time, it shoudl eventually load
7 - Apply patch and restart al the things
8 - Load the page again, it should be much faster

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: Unit tests
Nick Clemens [Wed, 11 Nov 2020 01:24:15 +0000 (01:24 +0000)]
Bug 26963: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: Fix the last_insert_id call
Jonathan Druart [Fri, 13 Nov 2020 07:14:40 +0000 (08:14 +0100)]
Bug 22818: Fix the last_insert_id call

DBI last_insert_id: invalid number of arguments: got handle + 3, expected handle + between 4 and 5
Usage: $h->last_insert_id($catalog, $schema, $table_name, $field_name [, \%attr ]) at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 23326.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26948: Regression tests
Martin Renvoize [Thu, 12 Nov 2020 13:36:00 +0000 (13:36 +0000)]
Bug 26948: Regression tests

We already mock the send_or_die method from Email::Stuffer; This patch
updates that mock to extract the internal representation of the email
encoded message and looks for a known double encoded representation of a
character in the sample body.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26948: Remove double encoding from sent emails
Joonas Kylmälä [Fri, 6 Nov 2020 11:35:39 +0000 (13:35 +0200)]
Bug 26948: Remove double encoding from sent emails

The sent emails from Koha were garbled / double encoded because
Koha::Email now after the refactoring and moving to use Email::Stuffer
handles the encoding itself. Previously the Koha::Email callee had to
handle the encoding. This patch removes the double encoding in the
email subject and content.

To test:
 1) Put some UTF-8 characters like ä in the HOLD template subject and body
 2) Create hold and check-in an item to make it Waiting and cause the
 email to be send
 3) Notice the email comes garbled / double encoded
 4) Apply patch
 5) Repeat step 2) and notice the email comes without any issues in
    encoding and look OK.
 6) Make sure "prove t/Koha/Email.t" and "prove
    t/db_dependent/Letters.t" and passes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26990: (bug 22284 follow-up) Prevent hold to be placed if cannot be transferred
Jonathan Druart [Wed, 11 Nov 2020 13:55:27 +0000 (14:55 +0100)]
Bug 26990: (bug 22284 follow-up) Prevent hold to be placed if cannot be transferred

There is a missing parameter to CanItemBeReserved, we need to know if
the hold can be placed at a given pickup library.

Test plan:
1 - Set preferences:
     UseBranchTransferLimits: enforce
     BranchTransferLimitsType: itype
     AllowHoldPolicyOverride: Don't allow
2 - Set Centerville 'Book' items to not be allowed to transfer to any other library
3 - Make sure Hold policy is set to 'any library'
4 - Find a record with a Centerville item and other items
5 - Attempt to place an item level hold on the Centerville item (with a
pickup library different than Centerville)
=> Without this patch you are taken to the holds list, but your hold is not placed
Nothing indicates why hold has failed
=> With this patch you cannot select the item from Centerville
"Cannot be transferred to pickup library"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Respond to feedback
Andrew Isherwood [Thu, 12 Nov 2020 11:30:33 +0000 (11:30 +0000)]
Bug 22818: (QA follow-up) Respond to feedback

This commit addresses the requests from Jonathan in comment #188

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: (QA follow-up) Fix DB upgrade
Andrew Isherwood [Thu, 12 Nov 2020 13:38:49 +0000 (13:38 +0000)]
Bug 24083: (QA follow-up) Fix DB upgrade

This commit makes the addition of the 'unseen_renewals_allowed'
circulation rule idempotent, as highlighted by Jonathan in comment #140

Bug 24083: (QA follow-up) Fix for previous

It helps if you don't commit commented out code...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: (QA follow-up) Fix failing tests
Andrew Isherwood [Thu, 12 Nov 2020 10:36:08 +0000 (10:36 +0000)]
Bug 24083: (QA follow-up) Fix failing tests

This commit fixes the failing tests mentioned by Jonathan in comment

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: Fix TestBuilder.t
Jonathan Druart [Wed, 11 Nov 2020 17:03:08 +0000 (18:03 +0100)]
Bug 22818: Fix TestBuilder.t

t/db_dependent/TestBuilder.t .. 12/13
 #   Failed test 'build_object() tests'
 #   at t/db_dependent/TestBuilder.t line 429.
Can't locate object method "_new_from_dbic" via package "Koha::MessageAttribute" (perhaps you forgot to load "Koha::MessageAttribute"?) at /kohadevbox/koha/Koha/Objects.pm line 98.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: DBRev 20.06.00.069
Jonathan Druart [Wed, 11 Nov 2020 14:38:12 +0000 (14:38 +0000)]
Bug 24083: DBRev 20.06.00.069

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: Compiled CSS
Jonathan Druart [Wed, 11 Nov 2020 14:36:26 +0000 (15:36 +0100)]
Bug 24083: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: DBIC schema changes
Jonathan Druart [Wed, 11 Nov 2020 14:34:51 +0000 (15:34 +0100)]
Bug 24083: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: (follow-up) Make requested changes
Andrew Isherwood [Wed, 11 Nov 2020 13:19:18 +0000 (13:19 +0000)]
Bug 24083: (follow-up) Make requested changes

This commit makes the changes requested in comment #120

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: Swap the column for "Unlimited" handling
Jonathan Druart [Mon, 9 Nov 2020 15:11:02 +0000 (16:11 +0100)]
Bug 24083: Swap the column for "Unlimited" handling

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: Delete the new rule when needed
Jonathan Druart [Mon, 9 Nov 2020 15:10:39 +0000 (16:10 +0100)]
Bug 24083: Delete the new rule when needed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: (follow-up) Squashed follow ups
Andrew Isherwood [Mon, 5 Oct 2020 11:39:48 +0000 (12:39 +0100)]
Bug 24083: (follow-up) Squashed follow ups

This squashed commit fixes:
-  a small error in the checkouts related JS

- GetRenewCount now returns 6 values when a call to it succeeds, a
failed call should also return the same number of values. This commit
adds these additional values.

- Some changes in issue.t had broken the tests for unseen renewals (the
unseen tests were using variables that had been moved out of the tests'
scope).

- Also now using Koha::CirculationRules::set_rules to set circ rules
rather than using SQL queries.

- Fixed expected number of return values from GetRenewCount

- Moved unseen tests in issue.t to the bottom of the file to remove the
risk of interference with other test circ rules.

- There was a real mess in C4/Circulation.pm due to a bad rebase back in
February. Frankly it's a wonder anything worked at all. This commit
fixes that problem and reinstates the correct patch for
C4/Circulation.pm

- Somehow I'd never noticed this before but the columns in smart-rules.tt
were misaligned when UnseenRenewals was turned off. This was due to the
display of a <td> not being conditional when it should have been. This
is now fixed.

- This commit also fixes items 1 & 2 descibed by Katrin in comment #74 ->
comment #76.

- Fixed missing check for too_unseen in opac-user.tt, this test did used
to exist but got lost during sizeable rebase a few weeks ago :-(
- Added test for too_unseen to all AUTO_RENEWAL notice templates apart
from de-DE (as previously requested by Katrin)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: (follow-up) Include SelfCheckInModule
Andrew Isherwood [Mon, 5 Oct 2020 11:37:01 +0000 (12:37 +0100)]
Bug 24083: (follow-up) Include SelfCheckInModule

As highlighted by Katrin, the selfcheckin module was not aware of this
work. This commits gives it awareness of the too_unseen renew error and
the "seen" argument that can be passed to AddRenewal

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: (follow-up) Respond to QA feedback
Andrew Isherwood [Thu, 5 Nov 2020 10:41:56 +0000 (10:41 +0000)]
Bug 24083: (follow-up) Respond to QA feedback

This patch implements changes requested by Katrin in QA feedback
(comment #38):

- Fix QA script failures
- Fix alter table column order mismatch
- Use new convention for JS strings
- Fix terminology

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: (follow-up) Fix params to AddRenewal
Andrew Isherwood [Mon, 9 Mar 2020 16:04:46 +0000 (16:04 +0000)]
Bug 24083: (follow-up) Fix params to AddRenewal

The merging of Bug 23051 has added a paramter that can be passed to
C4::AddRenewal. This bug does also, so the offset of this bug's new
paramter was wrong. This patch fixes it.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: Add unit tests
Andrew Isherwood [Thu, 28 Nov 2019 09:04:38 +0000 (09:04 +0000)]
Bug 24083: Add unit tests

This patch adds unit tests for unseen renewals

Signed-off-by: Sally Healey <sally.Healey@cheshirewestandchester.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: Add support for unseen_renewals
Andrew Isherwood [Fri, 22 Nov 2019 11:08:53 +0000 (11:08 +0000)]
Bug 24083: Add support for unseen_renewals

This patch adds support for unseen renewals.

Here we retrofit knowledge of unseen renewals and add the display of unseen
renewal counts and warnings, in addition to adding the ability to
specify a renewal as being "unseen".

The functionality added here is goverened by the UnseenRenewals syspref.

Signed-off-by: Sally Healey <sally.Healey@cheshirewestandchester.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: Add circ rules management
Andrew Isherwood [Thu, 21 Nov 2019 14:37:05 +0000 (14:37 +0000)]
Bug 24083: Add circ rules management

This patch adds the ability to set the "Unseen renewals allowed" value
in the circulation rules

Signed-off-by: Sally Healey <sally.Healey@cheshirewestandchester.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: Required atomic updates & DB update
Andrew Isherwood [Thu, 21 Nov 2019 14:35:41 +0000 (14:35 +0000)]
Bug 24083: Required atomic updates & DB update

This patch adds:

- An "UnseenRenewals" circulation syspref that enables/disables the
  functionality added in this bug

- Add unseen_renewals_allowed to circulation_rules

- A change to the issues & old_issues table schemas and corresponding
  database upgrades to add issues.unseen_renewals &
  old_issues.unseen_renewals

Signed-off-by: Sally Healey <sally.Healey@cheshirewestandchester.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable
Jonathan Druart [Tue, 10 Nov 2020 13:11:10 +0000 (14:11 +0100)]
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable

$serialitem is not a Koha::Item there, we need to fetch the item before.

Test plan:
Turn makePreviousSerialAvailable on
Create a subscription
Receive an serial item, mark it "arrived"
Without this patch Koha explodes with
No property notforloan for Koha::Serial::Item at /usr/share/perl5/Exception/Class/Base.pm line 88
Koha::Object::set('Koha::Serial::Item=HASH(0x55dd67c75700)', 'HASH(0x55dd672cec30)') called at /kohadevbox/koha/serials/serials-edit.pl line 273

With this patch applied the notforloan and itype values are correctly
set for the new serial item.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: DBRev 20.06.00.068
Jonathan Druart [Wed, 11 Nov 2020 14:38:12 +0000 (14:38 +0000)]
Bug 23019: DBRev 20.06.00.068

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: (follow-up) Fix test permissions and API definition bugs
Agustin Moyano [Tue, 10 Nov 2020 16:59:01 +0000 (13:59 -0300)]
Bug 23019: (follow-up) Fix test permissions and API definition bugs

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: (follow-up 2) set table name to import_batch_profiles
Jonathan Druart [Mon, 9 Nov 2020 13:46:49 +0000 (14:46 +0100)]
Bug 23019: (follow-up 2) set table name to import_batch_profiles

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: (follow-up) Fix other things
Agustin Moyano [Fri, 6 Nov 2020 17:50:29 +0000 (14:50 -0300)]
Bug 23019: (follow-up) Fix other things

This patch:
* Fixes table name change
* Adds schema file
* Changes api parameter name
* Fixes string escaping
* Fixes error handling

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: (follow-up) set table name to import_batch_profiles
Agustin Moyano [Fri, 6 Nov 2020 17:49:20 +0000 (14:49 -0300)]
Bug 23019: (follow-up) set table name to import_batch_profiles

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: (QA follow-up) fix test fiule permissions
Nick Clemens [Fri, 30 Oct 2020 15:34:24 +0000 (15:34 +0000)]
Bug 23019: (QA follow-up) fix test fiule permissions

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: (follow-up) Fix usability issues
Agustin Moyano [Thu, 27 Aug 2020 22:09:05 +0000 (19:09 -0300)]
Bug 23019: (follow-up) Fix usability issues

This patch place profile buttons in the bottom of the page, next to "Stage for import"

It removes the "Update profile" button, and changes "Add profile" to "Save profile". Save profile can be used to add and to update a profile.

It also adds feedback when a profile was saved or deleted.

Last, it also replaces input-batch-profile endpoint name for input_batch_profile, which is more aligned with other endpoint names.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: (QA follow-up) Fix typo Pre fill
Agustin Moyano [Wed, 1 Jul 2020 07:25:14 +0000 (07:25 +0000)]
Bug 23019: (QA follow-up) Fix typo Pre fill

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: Add profiles to stage-import-batch and magnage-import-batch pages
Agustin Moyano [Fri, 15 May 2020 14:09:49 +0000 (11:09 -0300)]
Bug 23019: Add profiles to stage-import-batch and magnage-import-batch pages

This patch adds the logic and the needed UI elements to be able to pre-load an import profile. It also displays which profile was used to stage an import in staged import manager.

To test:
1. Apply all patches
2. Updatedatabase
3. Go to Stage MARC records for Import tool in admin, and upload a file with MARC records.
CHECK => after uploading, there is a fieldset with the legend “Profile settings”
              => inside the fieldset there is a select labeled “Pre fill values with profile”. The only value it has is “Do not use profile”.

4. Change some settings, and set “profile 1” as profile name and click on “Add profile”
SUCCESS => The select now has the new profile selected

5. Change profile select to “Do not use profile”
SUCCESS => Default values are now displayed in the form

6. Reload the page and upload the file again
SUCCESS => the select still has the profile recently added

7. Select the profile, change some parameter in the form and set the profile name to “profile 2”, and click add profile
SUCCESS => there are two profiles now, and if you toggle between them, the parameter changes

8. Select profile 1, change one parameter and click on update profile
SUCCESS => if you toggle that profile with the other, the new parameter of the value is shown when you select profile 1

9. Select profile 2, change some parameter and click Add profile (leaving the name as profile 2)
SUCCESS => the page complains there is another profile with the same name, and asks if you want to replace it.

10. Click on accept
SUCCESS => profile 2 now has the new value in the parameter

11. Select profile 2 and change the name to profile 1
SUCCESS => the page complains there is another profile with that name, and asks if you want to replace it

12. Click on accept
SUCCESS => in profile select there is only one profile called profile 1 that has the values of profile 2

13. Select profile 1 and click remove profile
SUCCESS => there is no profile in profile select.

14. Create a profile and click on “Stage for import”
15. Go to Staged MARC management page
SUCCESS => Improt should have the name of the profile in profile column, and when you click on the file name, there should be the name of the profile in the details.

16. prove t/db_dependent/ImportBatch.t t/db_dependent/api/v1/import_batch_profiles.t
17. Sign off

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: Add tests
Agustin Moyano [Fri, 15 May 2020 14:09:56 +0000 (11:09 -0300)]
Bug 23019: Add tests

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: Add ImportBatchesProfile schema and set is_boolean to parse_items column
Agustin Moyano [Fri, 15 May 2020 14:09:51 +0000 (11:09 -0300)]
Bug 23019: Add ImportBatchesProfile schema and set is_boolean to parse_items column

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: Add koha_object_class and koha_objects_class methods to ImportBatch.pm...
Agustin Moyano [Fri, 15 May 2020 14:09:51 +0000 (11:09 -0300)]
Bug 23019: Add koha_object_class and koha_objects_class methods to ImportBatch.pm schema

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23019: Update database structure and add atomic update
Agustin Moyano [Fri, 15 May 2020 14:09:53 +0000 (11:09 -0300)]
Bug 23019: Update database structure and add atomic update

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20936: DBRev 20.06.00.067
Jonathan Druart [Wed, 11 Nov 2020 14:38:12 +0000 (14:38 +0000)]
Bug 20936: DBRev 20.06.00.067

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20936: (follow-up) add biblio and item relation to old holds and set a limit...
Agustin Moyano [Tue, 10 Nov 2020 22:23:49 +0000 (19:23 -0300)]
Bug 20936: (follow-up) add biblio and item relation to old holds and set a limit on search holds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20936: (QA follow-up) Use Branches template plugin
Nick Clemens [Fri, 30 Oct 2020 17:28:52 +0000 (17:28 +0000)]
Bug 20936: (QA follow-up) Use Branches template plugin

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20936: Add patron's hold history menu in OPAC
Agustin Moyano [Wed, 6 May 2020 22:38:19 +0000 (19:38 -0300)]
Bug 20936: Add patron's hold history menu in OPAC

This patch adds patron's hold history in OPAC.

To test:
1. apply this patch
2. Find a patron, place several holds and cancel or fulfill them
3. Go to patron's opac
CHECK => There is no 'your holds history' option in menu
4. In admin preferences enable OPACHoldsHistory
5. Go back to patron's opac
SUCCESS => There is a 'your holds history' menu option
        => Holds history displays all holds
6. Change order, and list limit
SUCCESS => All controls work as expected
7. Sign off.

Signed-off-by: Todd <tgoatley@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20936: Add OPACHoldsHistory syspref
Agustin Moyano [Sun, 9 Feb 2020 20:53:55 +0000 (17:53 -0300)]
Bug 20936: Add OPACHoldsHistory syspref

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: DBRev 20.06.00.066
Jonathan Druart [Wed, 11 Nov 2020 14:38:12 +0000 (14:38 +0000)]
Bug 22818: DBRev 20.06.00.066

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: DBIC schema changes
Jonathan Druart [Wed, 11 Nov 2020 14:35:33 +0000 (15:35 +0100)]
Bug 22818: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Add hint to new library ILL email setting
Katrin Fischer [Fri, 16 Oct 2020 15:13:48 +0000 (17:13 +0200)]
Bug 22818: (QA follow-up) Add hint to new library ILL email setting

Copies the hints on the other email fields highlighting the existing
global pref.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Add some punctuation and terminology fixes to pref descriptions
Katrin Fischer [Fri, 16 Oct 2020 15:07:26 +0000 (17:07 +0200)]
Bug 22818: (QA follow-up) Add some punctuation and terminology fixes to pref descriptions

Just branch => library and some ending punctuation.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Add sample ILL notices to it-IT installer
Katrin Fischer [Fri, 16 Oct 2020 14:51:09 +0000 (16:51 +0200)]
Bug 22818: (QA follow-up) Add sample ILL notices to it-IT installer

Run: prove xt/sample_notices.t

de-DE are missing on purpose because of bug 24972.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (follow-up) Respond to feedback
Andrew Isherwood [Fri, 16 Oct 2020 14:08:59 +0000 (15:08 +0100)]
Bug 22818: (follow-up) Respond to feedback

This commit implements the feedback from Katrin in comment #103 ->
comment #108:

- Fixed rebase issue mentioned in comment #103
- Fixed ILL notice display mentioned in comment #106
- Fixed bug with metadata display, though not the issue that was
mentioned in comment #107
- Fixed buttons display mentioned in comment #107, in addition to some
more buttons suffering the same issue

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (follow-up) Respond to feedback
Andrew Isherwood [Thu, 15 Oct 2020 13:57:19 +0000 (14:57 +0100)]
Bug 22818: (follow-up) Respond to feedback

This commit fixes this bug, it was broken in a number of ways.

Fixes include:

- Added necessary config block in C4::Letters to enable the TT notice
syntax introduced in an earlier commit to work
- Changed template variables to refer to singular objects rather than
multiple e.g. borrowers -> borrower
- Fixed missing / misnamed variables

This commit also implements the additional syspref checks suggested by
Katrin in comment #87

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Add mandatory data at install time
Martin Renvoize [Wed, 16 Sep 2020 13:57:36 +0000 (14:57 +0100)]
Bug 22818: (QA follow-up) Add mandatory data at install time

This patch adds the data from the update script into the mandatory sql
files such that it is also populated at install time.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Sample Notices
Martin Renvoize [Thu, 9 Jul 2020 10:18:26 +0000 (11:18 +0100)]
Bug 22818: (QA follow-up) Sample Notices

Convert the update notices to TT syntax and add them into the
sample_notices file.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Translation fix + Branch notices
Martin Renvoize [Thu, 9 Jul 2020 09:25:26 +0000 (10:25 +0100)]
Bug 22818: (QA follow-up) Translation fix + Branch notices

This patch removes the hard coded 'N/A' being passed to
GetPreparedLetter and passes in the branchcode of the ILLRequest so
notices can be branch specific.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Template CASE correction
Martin Renvoize [Thu, 9 Jul 2020 08:42:20 +0000 (09:42 +0100)]
Bug 22818: (QA follow-up) Template CASE correction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Licence and POD fixes
Martin Renvoize [Thu, 9 Jul 2020 08:14:57 +0000 (09:14 +0100)]
Bug 22818: (QA follow-up) Licence and POD fixes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: (QA follow-up) Email addressing corrections
Martin Renvoize [Thu, 9 Jul 2020 07:40:22 +0000 (08:40 +0100)]
Bug 22818: (QA follow-up) Email addressing corrections

This patch updates the patchset to use recnetly introduced methods for
obtaining the correct inbound and reply email addresses for branches.

We also move get_staff_to_address into Koha::Library alongside
inbound_email_address and rename it to inbound_ill_address.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: Unit tests
Andrew Isherwood [Thu, 9 May 2019 14:35:07 +0000 (15:35 +0100)]
Bug 22818: Unit tests

This patch adds unit tests for the new methods in Illrequest.pm

Sponsored-by: PTFS Europe
Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: Add MessageAttribut{e,es}.pm
Andrew Isherwood [Thu, 9 May 2019 11:21:27 +0000 (12:21 +0100)]
Bug 22818: Add MessageAttribut{e,es}.pm

We need to be able to access individual message attributes in tests, so
adding accessors for them

Sponsored-by: PTFS Europe
Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: Add generation and sending of notices
Andrew Isherwood [Wed, 8 May 2019 09:42:22 +0000 (10:42 +0100)]
Bug 22818: Add generation and sending of notices

This patch adds the ability for ILL to send notices, both triggered by
staff and triggered by events.

Staff can trigger notices to patrons from the "Manage ILL request" screen:
- ILL request ready for pickup
- ILL request unavailable
- Place request with partners

The following notices to staff are triggered automatically:
- Request has been modified by patron
- Request has been cancelled by patron

Branches can now specify an "ILL email" address to which notices
intended to inform staff of changes to requests by patrons can be sent.

The sending of notices is controlled by a few new sysprefs:
- "ILLDefaultStaffEmail" - Fallback email address for staff ILL notices
to be sent to in the absence of a branch address
- "ILLSendStaffNotices" - To specify which staff notices should be sent
automatically when requests are manipulated by patrons

Patron notices are also controlled by the patron's messaging
preferences

Sponsored-by: PTFS Europe
Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: Add support for ILL notices
Andrew Isherwood [Tue, 7 May 2019 16:37:02 +0000 (17:37 +0100)]
Bug 22818: Add support for ILL notices

Here we're just adding ILL notices to the existing "letters"
infrastructure so notices can be displayed and edited

Sponsored-by: PTFS Europe
Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22818: Add notices sysprefs and DB column
Andrew Isherwood [Tue, 7 May 2019 10:09:58 +0000 (11:09 +0100)]
Bug 22818: Add notices sysprefs and DB column

This patch adds two new sysprefs. 'ILLDefaultEmail', 'ILLSendStaffNotices' and a new column to the
branches table called 'branchillemail'. It also adds five ILL related
notices.

Here we are providing the ability for a branch to have a dedicated email
address for it's ILL staff, the idea being that any notices sent by ILL
to staff need to go to specific staff, rather than the general branch
email address. If no branch specific address is defined, the address
specified in the ILLDefaultEmail syspref is used.

We're also providing a syspref 'ILLSendStaffNotices' to allow the user to specify which
notices should be sent to staff upon certain events.

We are also providing patron messaging preferences for the two patron
bound notices

We are also providing five notices for various ILL related events.

Sponsored-by: PTFS Europe
Signed-off-by: Niamh Walker-Headon <Niamh.Walker-Headon@it-tallaght.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26594: (QA follow-up) Make _UpdateBorrowerDebarmentFlags a public method
Kyle M Hall [Thu, 5 Nov 2020 11:48:04 +0000 (06:48 -0500)]
Bug 26594: (QA follow-up) Make _UpdateBorrowerDebarmentFlags a public method

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>