]> git.koha-community.org Git - koha.git/log
koha.git
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>
3 years agoBug 26594: Fix patrons merge problem with restrictions
Fridolin Somers [Thu, 1 Oct 2020 12:19:05 +0000 (14:19 +0200)]
Bug 26594: Fix patrons merge problem with restrictions

When merging a patron A with restriction(s) into an other patron B,
the entries of borrower_debarments are OK but the value of borrowers.debarred for patron B need to be updated.
An effect of this strange storage of restrictions in both places.

Test plan :
1) Create a patron A with a manual restriction with some date and
   comment
2) Create a patron B with no restriction
3) Merge patron A and B, keeping patron B
4) Look at patron B details page
=> Without patch you see no restriction
=> With patch you see the restriction from patron A

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26594: add Unit Test
Fridolin Somers [Fri, 2 Oct 2020 07:22:36 +0000 (09:22 +0200)]
Bug 26594: add Unit Test

Run prove t/db_dependent/Patron/Borrower_Debarments.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: DBRev 20.06.00.065
Jonathan Druart [Tue, 10 Nov 2020 13:32:09 +0000 (13:32 +0000)]
Bug 23916: DBRev 20.06.00.065

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: Allow embedding the issuer object
Tomas Cohen Arazi [Tue, 10 Nov 2020 11:53:16 +0000 (08:53 -0300)]
Bug 23916: Allow embedding the issuer object

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (follow-up) Adapt all the things to the new column and accessor names
Jonathan Druart [Tue, 10 Nov 2020 13:45:57 +0000 (14:45 +0100)]
Bug 23916: (follow-up) Adapt all the things to the new column and accessor names

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (QA follow-up) Adapt all the things to the new column and accessor names
Tomas Cohen Arazi [Tue, 10 Nov 2020 11:47:29 +0000 (08:47 -0300)]
Bug 23916: (QA follow-up) Adapt all the things to the new column and accessor names

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: Add new attribute to API
Tomas Cohen Arazi [Tue, 10 Nov 2020 11:46:43 +0000 (08:46 -0300)]
Bug 23916: Add new attribute to API

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (QA follow-up) Rename issuer => issuer_id [DB]
Tomas Cohen Arazi [Tue, 10 Nov 2020 11:46:18 +0000 (08:46 -0300)]
Bug 23916: (QA follow-up) Rename issuer => issuer_id [DB]

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (follow-up) Add unit tests
Jonathan Druart [Mon, 9 Nov 2020 13:24:22 +0000 (14:24 +0100)]
Bug 23916: (follow-up) Add unit tests

Fix perlcritic error
Subroutine "new" called using indirect syntax at line 128, column 14.  See page 349 of PBP.  (Severity: 4)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (QA follow-up) Remove stray changes and fix typo
Nick Clemens [Sat, 24 Oct 2020 02:56:15 +0000 (02:56 +0000)]
Bug 23916: (QA follow-up) Remove stray changes and fix typo

There were a couple changes that had no effect, so cleaned those up

Typo 'is' for 'if'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (follow-up) Fix unit test
Andrew Isherwood [Fri, 23 Oct 2020 10:55:44 +0000 (11:55 +0100)]
Bug 23916: (follow-up) Fix unit test

This commit responds to the comment made by Katrin in comment #73. I
have removed the lines cited as causing the contraint violation. The
were added in the original iteration of the bug patches and, despite
spending time trying to get to the bottom of it, I cannot figure out
why. There are no changes in the patchset relating to Koha/Patron.pm and
removing the lines does not cause any of the tests in files that *are*
affected by this patchset to fail. I do not know why these lines were
ever added in the first place, unfortunately I did not add comments
explaining (lesson learned)!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (follow-up) Rebase unit tests
Andrew Isherwood [Mon, 19 Oct 2020 11:55:18 +0000 (12:55 +0100)]
Bug 23916: (follow-up) Rebase unit tests

This commit is a response to Katrin's comments in comment #62:

- Fixed merge conflict

It also fixes a test which now fails due to an upstream change in
C4::Circulation

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (follow-up) Fix terminology, use patron-title and make column consistent...
Andrew Isherwood [Mon, 12 Oct 2020 09:28:33 +0000 (10:28 +0100)]
Bug 23916: (follow-up) Fix terminology, use patron-title and make column consistent in issues and old_issues

This commit makes the changes suggested by Katrin in comment #50:

- Changed syspref from RecordIssuer to RecordStaffUserOnCheckout
- Changed terminology from "issue" to "check out" and variations
- Fixed name display to use patron-title.inc
- Made issuer column DEFAULT NULL consistently between issues and
old_issues and between the DB update and kohastructure.sql

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (follow-up) Don't anonymise issuer and don't update action_logs on upgrade
Andrew Isherwood [Thu, 24 Sep 2020 12:55:55 +0000 (13:55 +0100)]
Bug 23916: (follow-up) Don't anonymise issuer and don't update action_logs on upgrade

This commit implements the two suggestions made by Nick in comment #41:

- Removes the attempted retrospective addition of issuers to old issues.
It was not particularly reliable, it also is not appropriate if the user
does not wish to make use of this functionality

- Removes the conversion of a NULL issuer to the anonymous borrowernumber when
anonymising checkouts

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: (follow-up) Fix column name collision
Andrew Isherwood [Mon, 18 Nov 2019 12:30:27 +0000 (12:30 +0000)]
Bug 23916: (follow-up) Fix column name collision

Seems that joining 'borrowers' into the query run in
C4::Members::GetAllIssues caused a column name collision, which blatted
the retrieval of issues.branchcode. So we now are being a bit more
specific in what is coming from where in the query.

Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: Add unit tests
Andrew Isherwood [Thu, 31 Oct 2019 14:26:18 +0000 (14:26 +0000)]
Bug 23916: Add unit tests

This patch adds unit tests for the new functions

Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: Anonymise 'issuer' when required
Andrew Isherwood [Thu, 31 Oct 2019 10:45:41 +0000 (10:45 +0000)]
Bug 23916: Anonymise 'issuer' when required

This patch adds the anonymisation of 'old_issues.issuer' alongside the
existing anonymisation of 'old_issues.borrowernumber'

Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: Record and display item issuer
Andrew Isherwood [Mon, 2 Mar 2020 11:04:59 +0000 (11:04 +0000)]
Bug 23916: Record and display item issuer

This patch adds the recording and display of the item issuer. This
behaviour is governed by the RecordIssuer syspref, if disabled (the
default), no recording or display of issuer will take place.

Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: Add "RecordIssuer" syspref
Andrew Isherwood [Thu, 31 Oct 2019 10:22:24 +0000 (10:22 +0000)]
Bug 23916: Add "RecordIssuer" syspref

This patch adds the "RecordIssuer" syspref, which is disabled by default

Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23916: Add issues.issuer column and FK
Andrew Isherwood [Thu, 31 Oct 2019 10:08:42 +0000 (10:08 +0000)]
Bug 23916: Add issues.issuer column and FK

This patch adds the issues.issuer column which is a foreign key to
borrowers.borrowernumber

Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26697: Make account.inc consistent between staff and opac
Martin Renvoize [Fri, 16 Oct 2020 14:57:30 +0000 (15:57 +0100)]
Bug 26697: Make account.inc consistent between staff and opac

Test plan - Regression
1/ Login to the OPAC as a user with various account charges and payments.
2/ Navigate to the 'Your charges' page.
3/ Compare the display of the table before and after applying the
patchset. They should match.

Test plan - Sync
1/ Compare koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc with
koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc.
2/ They files should match after the patch is applied.

Test plan - Translation
1) ./translate update fr-CA
2) Open fr-CA-opac-bootstrap.po and translated this part

msgid ""
"%s %s %sPayment %sWriteoff %sForgiven %sCredit %sLost item fee refund "
"%sRefund %s%s %s %s %s %sAccount creation fee %sAccount renewal fee
%sLost "
"item %sManual fee %sNew card %sFine %sLost item processing fee %sRental
fee "
"%sDaily rental fee %sRenewal of rental item %sRenewal of daily rental
item "
"%sHold fee %sHold waiting too long %s%s %s %s %s "

3) ./translate install fr-CA
4) Login to the OPAC as a patron with various charges
5) Check 'My charges' (in fr-CA) to confirm the translations have been
   picked up.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.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 24603: DBRev 20.06.00.064
Jonathan Druart [Tue, 10 Nov 2020 13:32:09 +0000 (13:32 +0000)]
Bug 24603: DBRev 20.06.00.064

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24603: Simplify tests using TestBuilder
Jonathan Druart [Thu, 5 Nov 2020 13:40:29 +0000 (14:40 +0100)]
Bug 24603: Simplify tests using TestBuilder

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24603: Adjust permissions for cancel-charge.pl
Jonathan Druart [Thu, 5 Nov 2020 13:39:53 +0000 (14:39 +0100)]
Bug 24603: Adjust permissions for cancel-charge.pl

members/cancel-charge.pl should have the same permissions check than boraccount
(borrowers => edit_borrowers was missing)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24603: (QA follow-up) Add translation to OPAC
Martin Renvoize [Fri, 16 Oct 2020 15:23:10 +0000 (16:23 +0100)]
Bug 24603: (QA follow-up) Add translation to OPAC

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24603: (QA follow-up) Make the new credit type translatable and shorten descripti...
Katrin Fischer [Mon, 5 Oct 2020 13:24:40 +0000 (13:24 +0000)]
Bug 24603: (QA follow-up) Make the new credit type translatable and shorten description a bit

Adding the new offset type and credit type to the include so it can be translated.

Also suggest shortening the db description a bit.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=24063

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24603: (follow-up) Update to double entry accounting
Martin Renvoize [Fri, 10 Jul 2020 13:49:35 +0000 (14:49 +0100)]
Bug 24603: (follow-up) Update to double entry accounting

This patch updates the logic to create a cancellation accountline and
apply it to the charge line so we correction record the transaction in
terms of double entry accounting standards.

Test plan:
1. Go to a patron's accounting section
2. Create a manual invoice
3. In Transactions tab, you should see a 'Cancel charge' button. Click
   on it. It should now be marked as cancelled
4. A cancellation line should be associated with the original charge.
5. Create another manual invoice
6. Pay it (partially or fully)
7. Notice that the 'Cancel charge' button is not available
8. Void the payment
9. 'Cancel charge' button is available again. Click on it and verify
   that it still works
10. prove t/db_dependent/Koha/Account/Lines.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=24063

Bug 24603: Fix number of unit tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=24063

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24603: Allow to cancel charges in patron accounting
Julian Maurice [Thu, 6 Feb 2020 13:13:44 +0000 (14:13 +0100)]
Bug 24603: Allow to cancel charges in patron accounting

There is already a button to void a payment. It should be possible to
cancel a charge too.

This patch adds a button in patron's accounting section (Transactions
tab) that allow to cancel charges.
Charges that have been fully or partially paid cannot be cancelled.

It also fixes Koha::Account::Line::is_credit by looking at
credit_type_code instead of amount (amount can be 0 for voided payments)

It also fixes the tests for Koha::Account::Line::void when database does
not contain the borrowernumber 51 (the default in
t::lib::Mocks::mock_userenv)

Test plan:
1. Go to a patron's accounting section
2. Create a manual invoice
3. In Transactions tab, you should see a 'Cancel charge' button. Click
   on it. It should now be marked as cancelled
4. Create another manual invoice
5. Pay it (partially or fully)
6. Notice that the 'Cancel charge' button is not available
7. Void the payment
8. 'Cancel charge' button is available again. Click on it and verify
   that it still works
9. prove t/db_dependent/Koha/Account/Lines.t

Signed-off-by: David Nind <david@davidnind.com>
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>
3 years agoBug 26904: OPAC password recovery allows regexp in email
Fridolin Somers [Tue, 3 Nov 2020 08:19:34 +0000 (09:19 +0100)]
Bug 26904: OPAC password recovery allows regexp in email

When using OPAC password recovery form, opac/opac-password-recovery.pl :
if one provides correct login and an email, there is a check that this email is one of patron's.

This check uses RegExp with case insensitive :
  if ( $email && !( any { /^$email$/i } @emails ) )

This is a security issue since one can simply enter '.*'.
Severity is normal because the login must be a correct.

I propose to use simple string compare with lowercase to be case insensitive.

Test plan :
1) Don't apply patch
2) Enable system preference 'OpacResetPassword'
3) Go to 'OPAC > Log in to your account > Forgot your password?'
4) Enter an existing userid or cardnumber and '.*' in 'Email'
5) The password recovery is created ! (check table 'borrower_password_recovery')
6) Apply patch
7) Enter an existing userid or cardnumber and '.*' in 'Email'
8) You get the message 'No account was found with the provided information.'
9) Enter an existing userid or cardnumber and in 'Email' the corresponding email but with different case
10) The password recovery is created (check table 'borrower_password_recovery')

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26971: Remove obsolete test file translatable-templates.t
Jonathan Druart [Mon, 9 Nov 2020 10:20:43 +0000 (11:20 +0100)]
Bug 26971: Remove obsolete test file translatable-templates.t

After bug 25067 we found that this test file is failing with

 #   Failed test 'opac_bootstrap templates are translatable'
 #   at xt/author/translatable-templates.t line 91.
 # Unknown action specified.

The original patches forgot to update this file.
However when we tried to adjust it, we found that those tests are never working.

Tried on 18.11.00 with a very ugly modified intranet-main.tt, the test was still passing.

No idea how we can make it display warnings and so hard to fix the expected behaviour.

I decided to remove it for now and see later if we need an updated test for the translate script.

See also 25067 comment 84

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24665: (QA follow-up) Add tests for 'selected'
Martin Renvoize [Fri, 6 Nov 2020 16:27:47 +0000 (16:27 +0000)]
Bug 24665: (QA follow-up) Add tests for 'selected'

Add a unit test to prove the 'selected' param passed to
Koha::Template::Plugin::Registers is adhered to.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Mock UseCashRegister in tests
Martin Renvoize [Fri, 6 Nov 2020 16:19:15 +0000 (16:19 +0000)]
Bug 24786: (QA follow-up) Mock UseCashRegister in tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25067: Fix perlcritic errors
Jonathan Druart [Fri, 6 Nov 2020 16:06:44 +0000 (17:06 +0100)]
Bug 25067: Fix perlcritic errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: Fix Script_cron.t and t/Koha/Script.t
Jonathan Druart [Fri, 6 Nov 2020 16:03:33 +0000 (17:03 +0100)]
Bug 24786: Fix Script_cron.t and t/Koha/Script.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25067: Adjust paths in tests
Jonathan Druart [Fri, 6 Nov 2020 15:59:40 +0000 (16:59 +0100)]
Bug 25067: Adjust paths in tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26627: (QA follow-up) Remove barcode input by id
Kyle M Hall [Thu, 5 Nov 2020 11:40:42 +0000 (06:40 -0500)]
Bug 26627: (QA follow-up) Remove barcode input by id

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14866: DBRev 20.06.00.063
Jonathan Druart [Fri, 6 Nov 2020 12:03:17 +0000 (12:03 +0000)]
Bug 14866: DBRev 20.06.00.063

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14866: Trivial code simplification
Jonathan Druart [Tue, 3 Nov 2020 15:57:52 +0000 (16:57 +0100)]
Bug 14866: Trivial code simplification

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14866: (QA follow-up) Add hint to system preferences
Katrin Fischer [Thu, 22 Oct 2020 12:15:51 +0000 (12:15 +0000)]
Bug 14866: (QA follow-up) Add hint to system preferences

Adds a hint about the new configuration option to the existing
system preference sectoin.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14866: Make high holds work with different item types
Aleisha Amohia [Mon, 20 Apr 2020 14:31:27 +0000 (14:31 +0000)]
Bug 14866: Make high holds work with different item types

To test:
1) Apply patch, update database, restart services
2) Enable decreaseLoanHighHolds sysprefs if not already active
3) Go to circulation rules and set a value under 'Decrease loan holds
(day)' that is DIFFERENT from decreaseLoanHighHoldsDuration
4) Check out an item with holds and confirm that the value from the rule
is used instead of the system preference
5) Confirm tests pass before and after the patch
t/db_dependent/DecreaseLoanHighHolds.t

Sponsored-by: Catalyst IT
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Henry Bolshaw <bolshawh@parliament.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 23091: DBRev 20.06.00.062
Jonathan Druart [Fri, 6 Nov 2020 12:03:17 +0000 (12:03 +0000)]
Bug 23091: DBRev 20.06.00.062

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23091: (QA follow-up) POD fixes
Tomas Cohen Arazi [Mon, 19 Oct 2020 11:47:50 +0000 (08:47 -0300)]
Bug 23091: (QA follow-up) POD fixes

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>
3 years agoBug 23091: Simplify tests by turning off AccountAutoReconcile
Tomas Cohen Arazi [Fri, 16 Oct 2020 19:51:07 +0000 (16:51 -0300)]
Bug 23091: Simplify tests by turning off AccountAutoReconcile

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>
3 years agoBug 23091: Add tests for \->credits and \->debits
Tomas Cohen Arazi [Fri, 16 Oct 2020 19:30:49 +0000 (16:30 -0300)]
Bug 23091: Add tests for \->credits and \->debits

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>
3 years agoBug 23091: Unit Tests
Martin Renvoize [Wed, 15 Jul 2020 10:23:38 +0000 (11:23 +0100)]
Bug 23091: Unit Tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23091: Move _Restore to Koha::Item store trigger
Martin Renvoize [Thu, 3 Sep 2020 16:12:47 +0000 (17:12 +0100)]
Bug 23091: Move _Restore to Koha::Item store trigger

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23091: Add template handling for new messages
Martin Renvoize [Fri, 5 Jun 2020 08:19:48 +0000 (09:19 +0100)]
Bug 23091: Add template handling for new messages

This patch adds handling for the display of the two new messages added
by this patchset in the returns screen.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23091: Make relations more explicit
Martin Renvoize [Tue, 14 Jul 2020 12:59:06 +0000 (13:59 +0100)]
Bug 23091: Make relations more explicit

This patch simply makes the queries built for the ->debits and ->credits
relations in Koha::Account::Line more explicit.

Test plan
1/ Ensure tests continue to pass
2/ Run tests with DBIC_TRACE=1 DBIC_TRACE_PROFILE=console and note that
the related queries not include 'credit.' and 'debit.' as appropriate.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23091: Add tests for _RestoreOverdueForLostAndFound
Martin Renvoize [Mon, 13 Jul 2020 14:51:24 +0000 (15:51 +0100)]
Bug 23091: Add tests for _RestoreOverdueForLostAndFound

This patch adds unit tests for the newly introduced
_RestoreOverdueForLostAndFound method in C4::Circulation.

Test plan
1/ Read the new tests added to t/db_dependent/Circuation.t to ensure
they make sense
2/ Run the tests and verify they pass
3/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23091: Add handling for new lostreturn rules
Martin Renvoize [Wed, 23 Oct 2019 10:32:28 +0000 (11:32 +0100)]
Bug 23091: Add handling for new lostreturn rules

This patch adds handing for the new values available for the lostreturn
policy settings.

* undef - Do nothing, leave fees and fines as they were at the point of
  lose.
* refund - Refund the lost item fee only
* charge - Refund the lost item fee and charge a fresh overdue fine
  dated for a return on the date the item is 'found'
* restore - Refund the lost item fee and restore the original overdue
  fine (dated for a 'return' on the date the item was 'lost'

Test plan
1/ apply patch
2/ updatedatabase, restart_all
3/ verify finesmode and CalculateFinesOnReturn and WhenLostChargeReplacementFee are on
4/ verify WhenLostForgiveFine is set to "Forgive"
5/ verify circ rules include fines
6/ set Default lost item fee refund on return policy to "Refund lost item charge"
7/ create 4 overdue checkouts that will incur fines
8/ run fines.pl
9/ confirm 4 items checked out with accruing fines
10/ confirm all 4 items have a replacement price

Item 1
11/ mark the first item lost
12/ verify that fine is gone and lost fee has been charged
13/ check item in
14/ verify that lost fee is gone and overdue charge has not returned

Item 2
15/ set Default lost item fee refund on return policy to "Refund lost item charge and charge new overdue fine"
16/ mark second item lost
17/ verify that fine is gone and lost fee has been charged
18/ check item in
19/ verify that lost fee is gone and a new overdue charge has been made

Item 3
20/ set Default lost item fee refund on return policy to "Refund lost item charge and restore overdue fine"
21/ mark third item lost
22/ verify that fine is gone and lost fee has been charged
23/ check item in
24/ verify that lost fee is gone and the old overdue charge has been restored

Item 4
25/ set Default lost item fee refund on return policy to "Leave lost item charge"
26/ mark fourth item lost
27/ verify that fine is gone and lost fee has been charged
28/ check item in
29/ verify that lost fee remains and the overdue charge is still gone

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23091: Update unit test
Martin Renvoize [Wed, 3 Jun 2020 15:25:31 +0000 (16:25 +0100)]
Bug 23091: Update unit test

This patch updates the unit test for get_lostreturn_policy to reflect
the rule_name and return code changes.

Test plan:
1/ Read the code changes in t/db_dependant/Koha/CirculationRules and
t/db_dependant/Koha/IssuingRules and confirm they make sense.
2/ Run the updated tests and ensure they pass.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23091: Database update
Martin Renvoize [Wed, 3 Jun 2020 15:01:39 +0000 (16:01 +0100)]
Bug 23091: Database update

This patch updates the 'refund' circulation rule to be called
'lostreturn' and populates the value with 'refund' where appropriate.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: DBRev 20.06.00.061
Jonathan Druart [Fri, 6 Nov 2020 12:03:17 +0000 (12:03 +0000)]
Bug 24412: DBRev 20.06.00.061

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: DBIC schema changes
Jonathan Druart [Fri, 6 Nov 2020 11:01:11 +0000 (12:01 +0100)]
Bug 24412: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: (follow-up) prevent js injection
Nicolas Legrand [Thu, 5 Nov 2020 13:52:02 +0000 (14:52 +0100)]
Bug 24412: (follow-up) prevent js injection

Some js variables are not properly escaped and can be executed if
containing javascript.

1. have some waiting reserve attached to a desk
2. change this desk name to : <script>alert("❤");</script>
3. go to user's checkout page (circulation.pl) and click on the
Hold(s) tab
4. you should see some popup with a ❤ in it.
5. apply patch and refresh page
6. now you should see the desk name printed properly in the page:
<script>alert("❤");</script>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: (follow-up) prevent request.pl from failing
Nicolas Legrand [Thu, 5 Nov 2020 13:10:09 +0000 (14:10 +0100)]
Bug 24412: (follow-up) prevent request.pl from failing

When no desk is defined request.pl returns an internal server
error. Check a desk is defined before asking for reservation deskname.

Plan test:

1. log in with a library with no desk
2. check in a reserved book so it'll be switch to “waiting reserve”
3. go to the book notice and click the Holds tab (request.pl page)
4. boum
5. apply patch, restart plack
6. refresh page
7. now loading properly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: (QA follow-up) Change CASCADE DELETE to SET NULL
Martin Renvoize [Fri, 23 Oct 2020 14:46:03 +0000 (15:46 +0100)]
Bug 24412: (QA follow-up) Change CASCADE DELETE to SET NULL

I don't believe waiting reserves should be removed if a desk is deleted,
we should instead simply unset the desk.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: (follow-up) prevent error in svc/holds
Nicolas Legrand [Thu, 22 Oct 2020 16:17:47 +0000 (18:17 +0200)]
Bug 24412: (follow-up) prevent error in svc/holds

don't fail if a hold has no desk attached.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: (follow-up) bad desk printing
Nicolas Legrand [Thu, 22 Oct 2020 11:31:15 +0000 (13:31 +0200)]
Bug 24412: (follow-up) bad desk printing

forgot to update two pages when I wrote Hold->desk to replace
Desks.GetName.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: (follow-up) qa-tools
Nicolas Legrand [Wed, 21 Oct 2020 11:29:00 +0000 (13:29 +0200)]
Bug 24412: (follow-up) qa-tools

fix obvious problems:

    1. qa -c 8 -v 2
    2. should be green

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: (follow-up) tests
Nicolas Legrand [Wed, 21 Oct 2020 10:10:19 +0000 (12:10 +0200)]
Bug 24412: (follow-up) tests

Add some test for Koha::Hold->desk and Koha::Hold->set_waiting.

Test plan:

    1. prove t/db_dependent/Koha/Holds.t
    2. should be green!

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: Attach waiting reserve to desk
Nicolas Legrand [Mon, 13 Jan 2020 16:56:41 +0000 (17:56 +0100)]
Bug 24412: Attach waiting reserve to desk

When an item is checked in and marked 'Waiting' or already 'Waiting'
and there is a desk attached to the session, the item is marked
waiting at the current desk of the current library.

The information is displayed on the OPAC and on the intranet. The
patron can then know at which desk he can retrieve his document.

Desk Management (Bug 13881) is now useful.

Test plan :

1. apply Bug 24201
2. $KOHA_PATH/installer/data/mysql/updatedatabase.pl
3. Check out some document to someone
4. make another one reserve this document
5. check in the document
6. you can see the document is attach to the current library
7. create some desks and attach one to your session (see Bug 13881 and
Bug 24201)
8. cancel the preceding reserve and redo steps 3 to 5
9. you should see the document is waiting at the current library and
current desk on:
  a. the intranet document request page
  b. the intranet borrower holds tab
  c. the item list where the document is listed on the bibliographic
    details
  d. the borrower's OPAC holds tab.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 24412: (follow-up) QA

Following Josef Moravec QA comments :

- rewrite Koha::Hold->desk according to Object Oriented Koha
Guidelines and use it to fetch desk name in various templates
- remove unused Desks.GetName
- Check for columns existence in db update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 24412: (follow-up) QA: useless change

Maybe it was a relic of something usefull... anyway
not anymore.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 24412: (follow-up) Fix POD

Koha::Desk and not Koha::Library...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24412: kohastructure and atomic update
Nicolas Legrand [Mon, 13 Jan 2020 16:55:46 +0000 (17:55 +0100)]
Bug 24412: kohastructure and atomic update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24633: (follow-up) Tweak sample plugin targets
Tomas Cohen Arazi [Tue, 20 Oct 2020 17:36:22 +0000 (14:36 -0300)]
Bug 24633: (follow-up) Tweak sample plugin targets

Sponsored-by: Theke Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 24633: Add support for gitlab searching of plugins
Tomas Cohen Arazi [Tue, 20 Oct 2020 17:29:38 +0000 (14:29 -0300)]
Bug 24633: Add support for gitlab searching of plugins

This patch adds the option to add Gitlab repositories to look for
Koha plugins. As with Github, plugin projects need to be named
koha-plugin-* and the release file needs to be named with the .kpz
extension.

To test:
1. Apply this patchset
2. Check either koha-conf.xml or koha-conf.site.xml.in for sample
   configurations of gitlab targets.
3. Tweak your koha-conf.xml accordingly. You could have:

 <plugin_repos>
     <repo>
         <name>ByWater Solutions</name>
         <org_name>bywatersolutions</org_name>
         <service>github</service>
     </repo-
     <repo>
         <name>Theke Solutions</name>
         <org_name>thekesolutions</org_name>
         <service>gitlab</service>
     </repo>
     <repo>
         <name>PTFS Europe</name>
         <org_name>ptfs-europe</org_name>
         <service>github</service>
     </repo>
  </plugin_repos>

4. Flush memcached and restart plack:
   $ flush_memcached
   $ koha-plack --restart kohadev
5. Open the plugins page, search for anything, like 'gobi' or 'a'
=> SUCCESS: You get Theke results!
6. Pick a gitlab plugin for install
=> SUCCESS: It is installed!
7. Sign off :-D

Sponsored-by: Theke Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 24665: (QA follow-up) Fix selection default
Martin Renvoize [Fri, 6 Nov 2020 12:48:28 +0000 (12:48 +0000)]
Bug 24665: (QA follow-up) Fix selection default

This patch updates the html_helper for the cash register selection block
to remove the 'empty option' such that it can be correclty set for each
select case and updates all existing cases where we used the process
block previously to include the relevant blank option '-- Select an
option --', '-- None --', 'Library default' and finally the new '-- All
--' options introduced with this bug.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24665: Add support for filtering by cash register
Martin Renvoize [Tue, 21 Jul 2020 13:54:09 +0000 (14:54 +0100)]
Bug 24665: Add support for filtering by cash register

This patch makes it possible to filter on cash register
on the cash register statistics page.

To test:
- Activate UseCashRegisters
- Create a cash register or more to use
- Create some manual fees and fines
- Pay some of them off
- Go to Tools > Cash register statistics
- Test if the new filter for cash registers works as it should

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.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 24786: (QA follow-up) Ensure tests pass with existing data
Martin Renvoize [Fri, 6 Nov 2020 14:42:42 +0000 (14:42 +0000)]
Bug 24786: (QA follow-up) Ensure tests pass with existing data

The tests for Koha::Template::Plugin::Registers assumed that no
registers were pre-set in the database. This patch updates the test to
ignore pre-existing data or take it into account in totals.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Reset beenSubmitted on validation failure
Martin Renvoize [Fri, 6 Nov 2020 14:04:49 +0000 (14:04 +0000)]
Bug 24786: (QA follow-up) Reset beenSubmitted on validation failure

When the form submision fails due to validation errors we need to also
reset the preventFormDoubleSubmit state to allow for a second submission
with corrected form fields.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Do not use 'hidden' attribute
Martin Renvoize [Fri, 6 Nov 2020 11:51:30 +0000 (11:51 +0000)]
Bug 24786: (QA follow-up) Do not use 'hidden' attribute

The hidden attribute for loading an element hidden is known to have
issues and inconsistencies accross browsers.

This patch instead updates the relevent input options to use an inline
style of 'display: none' to hide the elements on page load and then
.show, .hide for subsquent changes linked to the library branch picker
change.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Hide archived registers
Martin Renvoize [Fri, 6 Nov 2020 10:55:13 +0000 (10:55 +0000)]
Bug 24786: (QA follow-up) Hide archived registers

This patch hides archived registers from the list when useing the
Registers template plugin.  It also includes a check for
UseCashRegisters so that if the preference is disabled after some
registers have been defined then the plugin will no longer return the
list regardless.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Handle no defined registers
Martin Renvoize [Fri, 6 Nov 2020 10:53:56 +0000 (10:53 +0000)]
Bug 24786: (QA follow-up) Handle no defined registers

This patch hides the register selection option from the login page if no
registers have yet been defined on the system.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Remove trailing space in classes
Martin Renvoize [Wed, 4 Nov 2020 12:53:59 +0000 (12:53 +0000)]
Bug 24786: (QA follow-up) Remove trailing space in classes

The trailing space after branch in the class attribute for the register
select options cause issues in the 'hasClass' javascript selector

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) String fix
Martin Renvoize [Wed, 4 Nov 2020 11:52:06 +0000 (11:52 +0000)]
Bug 24786: (QA follow-up) String fix

This patch updates 'Branch default' to 'Library default' on the login
page to match the coding terminology guidelines.

We also update the table heading on the cash registers management page
to match the terminology above for clarity.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Unit tests for Registers plugin
Martin Renvoize [Thu, 15 Oct 2020 16:03:04 +0000 (17:03 +0100)]
Bug 24786: (QA follow-up) Unit tests for Registers plugin

To test:
1. Run the new unit test: t/db_dependent/Koha/Template/Plugin/Registers.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Add validation to paycollect
Martin Renvoize [Thu, 15 Oct 2020 12:41:16 +0000 (13:41 +0100)]
Bug 24786: (QA follow-up) Add validation to paycollect

This patch adds conditional validation to the cash register field on
paycollect such that if 'CASH' is selected as the payment type and cash
registers are enabled, then a cash register will be required.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) Fix Registers Plugin
Martin Renvoize [Wed, 14 Oct 2020 12:42:32 +0000 (13:42 +0100)]
Bug 24786: (QA follow-up) Fix Registers Plugin

For the QA script we do not set a userenv, so we result in a failure due
to a lack of checking for userenv prior to using 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 24786: (QA follow-up) Make QA script happy with html_helpers
Martin Renvoize [Wed, 14 Oct 2020 12:08:45 +0000 (13:08 +0100)]
Bug 24786: (QA follow-up) Make QA script happy with html_helpers

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: (QA follow-up) POD Fixes
Martin Renvoize [Wed, 14 Oct 2020 12:01:38 +0000 (13:01 +0100)]
Bug 24786: (QA follow-up) POD Fixes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24786: Add validation to point of sale
Martin Renvoize [Fri, 2 Oct 2020 09:19:14 +0000 (10:19 +0100)]
Bug 24786: Add validation to point of sale

The Point of Sale page relied upon serverside validation prior to this
patch; As such with the introduction of the ability to select '--None--'
at the session register level (to require the librarian to pick their
register for every transaction) we could result in a server error page.

This patch introduced clientside validation to add checks for both the
'collected' and 'registerid' form fields.

Test plan:
1/ Select a branch with cash registers available
2/ Select the '--None--' option for the session cash register
3/ Navigate to the point of sale page
4/ Attempt to make a sale without having picked your cash register
5/ Note that the submission was prevented and the fiedl is highlighted
as required in red.
6/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 24786: Default to 'branch default' on auth.
Martin Renvoize [Tue, 11 Aug 2020 13:24:19 +0000 (14:24 +0100)]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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 24786: (follow-up) Cache the register_name in the session
Martin Renvoize [Tue, 4 Aug 2020 12:27:06 +0000 (13:27 +0100)]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>