]> git.koha-community.org Git - koha.git/log
koha.git
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>
3 years agoBug 24786: Update borroaccount to use session register
Martin Renvoize [Tue, 21 Jul 2020 09:52:49 +0000 (10:52 +0100)]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.

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: Update paycollect to use session register
Martin Renvoize [Tue, 21 Jul 2020 09:30:09 +0000 (10:30 +0100)]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.

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: Update point of sale to use session register
Martin Renvoize [Tue, 21 Jul 2020 12:08:18 +0000 (13:08 +0100)]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ 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: Allow selection of cash register at login
Martin Renvoize [Tue, 21 Jul 2020 12:37:16 +0000 (13:37 +0100)]
Bug 24786: Allow selection of cash register 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: Allow setting a register for the session
Martin Renvoize [Mon, 20 Jul 2020 15:14:17 +0000 (16:14 +0100)]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ 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 25067: Move the tests to db_dependent
Jonathan Druart [Fri, 6 Nov 2020 14:30:39 +0000 (15:30 +0100)]
Bug 25067: Move the tests to db_dependent

To not break the package workflow

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25067: (QA follow-up) Add +x on test files
Katrin Fischer [Sun, 4 Oct 2020 18:07:08 +0000 (18:07 +0000)]
Bug 25067: (QA follow-up) Add +x on test files

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25067: Move PO file manipulation code into gulp tasks
Julian Maurice [Sun, 29 Mar 2020 12:56:20 +0000 (14:56 +0200)]
Bug 25067: Move PO file manipulation code into gulp tasks

misc/translator/translate was doing three different things:
- extract translatable strings
- create or update PO files
- install translated templates

This patch separates responsibilities by moving the string extraction
code into several 'xgettext-like' scripts and adds gulp tasks to
automate string extraction and PO files update

This has several benefits:

- gulp runs tasks in parallel, so it's a lot faster (updating all PO
  files is at least 10 times faster with my 4-cores CPU)

- there is no need for $KOHA_CONF to be defined
  LangInstaller.pm relied on $KOHA_CONF to get the different paths
  needed. I'm not sure why, since string extraction and PO update should
  work on source files, not installed files

- string extraction code can be more easily tested

This patch also brings a couple of fixes and improvements:

- TT string extraction (strings wrapped in [% t(...) %]) was done with
  Template::Parser and PPI, which was extremely slow, and had some
  problems (see bug 24797).
  This is now done with Locale::XGettext::TT2 (new dependency) which is
  a lot faster, and fixes bug 24797

- Fix header in 4 PO files

For backward compatibility, 'create' and 'update' commands of
misc/translator/translate can still be used and will execute the
corresponding gulp task

Test plan:
1. Run `yarn install` and install Locale::XGettext::TT2
2. Run `gulp po:update`
3. Verify the contents of updated PO files
4. Run `cd misc/translator && ./translate install <lang>`
5. Verify that all (templates, sysprefs, xslt, installer files) is
   correctly translated
6. Run `gulp po:create --lang <lang>` and verify that it created all PO
   files for that language
7. Run `prove t/misc/translator`

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Need to install yarn & gulp, no errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26727: (follow-up) More markup corrections
Owen Leonard [Tue, 3 Nov 2020 18:00:57 +0000 (18:00 +0000)]
Bug 26727: (follow-up) More markup corrections

This patch makes more markup changes to the templates previously
modified in order to try to arrive at some agreeable solutions.

- In the value_builder EXAMPLE template, the <p> is unnecessary and is
  removed. Also removed is the script "type" attribute and obsolete
  CDATA markers.
- In the article request template an unnecessary <p> is removed.
- In the merge patrons template the submit button is now in a <fieldset
  class="action"> as is consistent with other forms.
- In the MARC modifications template I've added <div>s around each
  "line" in the form to add the line break, along with some CSS to add
  margins.
- The submit button is now inside a <fieldset class="action"> and the
  "Cancel" link now has the "cancel" class.

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 26727: Fix <p/> appearing in the templates
Katrin Fischer [Sun, 18 Oct 2020 16:30:24 +0000 (16:30 +0000)]
Bug 26727: Fix <p/> appearing in the templates

The self-closing p is not valid in HTML5:

Error: Self-closing syntax (/>) used on a non-void HTML element.
Ignoring the slash and treating as a start tag.

To test:

1)
- Activate Article requests
- Search for a record to place an article request on in staff
- Look up the patron
- Verify the article request form looks ok
2)
- Search for a list of patrons
- Check 2 patrons and merge them using the button above the list
- Verify the distance between the button and the table looks ok
3)
- Create a new MARC modification template
- Create a new action
- Verify the distances between the first and second line of form
  elements looks ok
4)
- Place a hold in staff
- Click on the Suspend link in the holds table (not below)
- Verify the modal looks ok

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 14708: (QA follow-up) Add tests
Tomas Cohen Arazi [Thu, 5 Nov 2020 14:53:43 +0000 (11:53 -0300)]
Bug 14708: (QA follow-up) Add tests

This patch adds tests for the change. It also simplifies the delete()
method structure a bit. It fixes the error 500 the tests were raising.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass! The new behaviour (code 403) is tested!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14708: (QA follow-up) Use try/catch blocks when calling delete() on a patron
Kyle M Hall [Tue, 3 Nov 2020 13:55:04 +0000 (08:55 -0500)]
Bug 14708: (QA follow-up) Use try/catch blocks when calling delete() on a patron

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14708: (QA follow-up) Throw exception when deleting anonymous borrower
Kyle M Hall [Mon, 2 Nov 2020 13:11:58 +0000 (08:11 -0500)]
Bug 14708: (QA follow-up) Throw exception when deleting anonymous borrower

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14708: Don't allow merging of other patron records into Anonymous Patron
Kyle M Hall [Wed, 29 Apr 2020 11:22:26 +0000 (07:22 -0400)]
Bug 14708: Don't allow merging of other patron records into Anonymous Patron

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 14708: Don't allow merging of Anonymous Patron into other patron records
Kyle M Hall [Wed, 15 Apr 2020 17:48:09 +0000 (13:48 -0400)]
Bug 14708: Don't allow merging of Anonymous Patron into other patron records

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 14708: Skip AnonymousPatron in GetBorrowersToExpunge
Kyle M Hall [Wed, 15 Apr 2020 17:31:59 +0000 (13:31 -0400)]
Bug 14708: Skip AnonymousPatron in GetBorrowersToExpunge

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 14708: Prevent deletion of Anonymous Patron at Koha::Patron::delete
Kyle M Hall [Wed, 15 Apr 2020 16:48:02 +0000 (12:48 -0400)]
Bug 14708: Prevent deletion of Anonymous Patron at Koha::Patron::delete

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 14708: Enforce restriction in delete_patrons.pl
Kyle M Hall [Wed, 27 Feb 2019 17:00:03 +0000 (12:00 -0500)]
Bug 14708: Enforce restriction in delete_patrons.pl

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 14708: The patron set as the anonymous patron should not be deletable.
Kyle M Hall [Wed, 27 Feb 2019 11:59:08 +0000 (06:59 -0500)]
Bug 14708: The patron set as the anonymous patron should not be deletable.

Right now it's possible to delete the anonymous patron at any time. When this happens the system will break just as if anonymouspatron was unset but patrons still have an "always anonymize" privacy setting.

This issue occurs more frequently than one would expect.

We should make it so that the patron set in AnonymousPatron is not deletable.

Test Plan:
1) Apply this patch
2) Set a patron to by AnonymousPatron
3) Attempt to delete that patron from the members toolbar
4) Note the error message!

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
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 16696: Fix search_utf8.t
Jonathan Druart [Thu, 5 Nov 2020 15:27:29 +0000 (16:27 +0100)]
Bug 16696: Fix search_utf8.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25334: DBRev 20.06.00.060
Jonathan Druart [Thu, 5 Nov 2020 11:07:01 +0000 (11:07 +0000)]
Bug 25334: DBRev 20.06.00.060

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25334: MTT is itiva not talkingtech
Jonathan Druart [Thu, 5 Nov 2020 13:12:56 +0000 (14:12 +0100)]
Bug 25334: MTT is itiva not talkingtech

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25334: (QA follow-up) Update overduerules.tt
Kyle M Hall [Tue, 3 Nov 2020 18:21:24 +0000 (13:21 -0500)]
Bug 25334: (QA follow-up) Update overduerules.tt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25334: (QA follow-up) Update opac messaging
Kyle M Hall [Tue, 3 Nov 2020 18:13:28 +0000 (18:13 +0000)]
Bug 25334: (QA follow-up) Update opac messaging

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25334: Add generic 'phone' message transport type
Kyle M Hall [Thu, 30 Apr 2020 17:35:48 +0000 (13:35 -0400)]
Bug 25334: Add generic 'phone' message transport type

As bug 25333 changed the 'phone' transport type to 'talkingtech', we can
now re-add 'phone' as a transport type again, and allow it to behave and
support the same notices as the email transport type.

Test Plan;
1) Apply this patch
2) Run updatedatabase
3) Restart all the things!
4) Disable TalkingTechItivaPhoneNotificationi if enabled
5) Enable new PhoneNotification system preference
6) Go to a patron's messaging preferences, not you can select the
   'phone' option for all the same notices as the 'email' option
7) Enable the phone option for all the message types
8) Browser to the Notices and slips editor
9) Add a phone notice version for each notice you wish to test
10) Test some notices ( CHECKIN, CHECKOUT, etc )
11) Notices should show in the patron's messages as 'phone' notices

Signed-off-by: Christopher Zorn <Christofer.Zorn@ajaxlibrary.ca>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25650: Add location and itype descriptions in ILS-DI GetRecords
Julian Maurice [Tue, 2 Jun 2020 07:27:02 +0000 (11:27 +0400)]
Bug 25650: Add location and itype descriptions in ILS-DI GetRecords

Test plan:
1. Create a record with an item, and set the item's shelving location
and itemtype.
2. Go to
http://<OPAC>/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=<biblionumber>
3. Check that there is <itype_description> and <location_description>
and that their value is correct.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26148: OpenLibrary "Preview" link target is unclear to patrons
Owen Leonard [Mon, 2 Nov 2020 18:13:04 +0000 (18:13 +0000)]
Bug 26148: OpenLibrary "Preview" link target is unclear to patrons

This patch makes changes to the display of the Open Library "read" links
in the OPAC search results and detail page. The link is now grouped with
other details about the record ("Publisher," "Location(s)," etc. On the
detail page, the "Preview" link will no longer appear under the cover
image.

The label is changed to "Found in Open Library," and the link now opens
the Open Library reader in a new window.

The patch also changes the Open Library button image links so that they
use https and makes it so that the "Found in Open Library" information
is hidden until the availability information has loaded.

To test, apply the patch and enable the OpenLibrarySearch system
preference.

 - Perform a search in the OPAC which will return results found in Open
   Library, e.g. "poetry" in the sample data.
 - Confirm that the "Read now" images from Open Library appear on some
   search results.
 - View the detail page for one of these titles.
 - Confirm that the "Read now" button appears in the same format on the
   detail page.

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 26172: Compiled CSS
Jonathan Druart [Thu, 5 Nov 2020 11:06:33 +0000 (12:06 +0100)]
Bug 26172: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: Replace _result[set] calls
Jonathan Druart [Tue, 3 Nov 2020 10:40:57 +0000 (11:40 +0100)]
Bug 26172: Replace _result[set] calls

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: (QA follow-up) Add tests for previous cashups
Martin Renvoize [Thu, 15 Oct 2020 13:05:45 +0000 (14:05 +0100)]
Bug 26172: (QA follow-up) Add tests for previous cashups

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: Fix return value for ->register
Jonathan Druart [Thu, 15 Oct 2020 09:45:26 +0000 (11:45 +0200)]
Bug 26172: Fix return value for ->register

There is a ON DELETE CASCADE clause on this FK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: (QA follow-up) Add Unit Test
Martin Renvoize [Wed, 14 Oct 2020 16:15:30 +0000 (17:15 +0100)]
Bug 26172: (QA follow-up) Add Unit Test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: (QA follow-up) Fix order of summary
Martin Renvoize [Wed, 14 Oct 2020 16:14:47 +0000 (17:14 +0100)]
Bug 26172: (QA follow-up) Fix order of summary

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: (QA follow-up) Add missing filter
Katrin Fischer [Sun, 4 Oct 2020 15:54:31 +0000 (15:54 +0000)]
Bug 26172: (QA follow-up) Add missing filter

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: (follow-up) Add print option
Martin Renvoize [Fri, 21 Aug 2020 13:45:28 +0000 (14:45 +0100)]
Bug 26172: (follow-up) Add print option

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: (follow-up) Summary by payment_type
Martin Renvoize [Fri, 21 Aug 2020 13:09:46 +0000 (14:09 +0100)]
Bug 26172: (follow-up) Summary by payment_type

This patch alters the modal so that the totals are broken down by
payment type's available on the system.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26172: Add cashup summary view modal
Martin Renvoize [Fri, 7 Aug 2020 09:15:20 +0000 (10:15 +0100)]
Bug 26172: Add cashup summary view modal

This patch adds a cashup summary modal to the register details page.

Test plan
1/ Enable Cash Registers and Point of Sale
2/ Enable some debit_types as 'Sale items'
3/ Perform a series of transactions
4/ Perform a 'Cashup' on the register
5/ Note the new '(Summary)' link next to the last cashup on the register
page.
6/ Click the link and confirm the modal contains the pertinent
information

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26584: Remove unused C4::Acquisition::CloseBasket function
Tomas Cohen Arazi [Wed, 30 Sep 2020 18:39:05 +0000 (15:39 -0300)]
Bug 26584: Remove unused C4::Acquisition::CloseBasket function

This patch makes code use the new Koha::Acquisition::Basket->close
method and makes CloseBasket obsolete.

It then removes it, and adapts the few places in which it was used.

1. Apply this patch
2. Run:
   $ kshell
  k$ git diff origin/master --name-only | grep -e '\.t$' | xargs prove
=> SUCCESS: Tests pass!
3. Try playing with baskets, closing them
=> SUCCESS: All works as expected!
4. Sign off :-D

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 26582: (QA follow-up) Rename closed => is_closed
Tomas Cohen Arazi [Thu, 15 Oct 2020 14:33:33 +0000 (11:33 -0300)]
Bug 26582: (QA follow-up) Rename closed => is_closed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26582: Add Koha::Acquisition::Basket->close
Tomas Cohen Arazi [Wed, 30 Sep 2020 17:40:54 +0000 (14:40 -0300)]
Bug 26582: Add Koha::Acquisition::Basket->close

This patch adds two methods to Koha::Acquisition::Basket:
- 'closed': that tells if the basket is closed
- 'close': that closes the basket

It inherits the behaviour from CloseBasket (as it actually makes sense).
It improves CloseBasket by wrapping the action inside a transaction. It
uses the $orders->update call with no_trigger as there's no trigger to
trigger and the update can be done on a single DB call.

A new exceptions file is added for basket-related exceptions. The only
specific exception that gets added is
Koha::Exceptions::Acquisition::Basket::AlreadyClosed

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> SUCCESS: Tests pass!
3. Sign off :-D

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 26582: Unit tests
Tomas Cohen Arazi [Wed, 30 Sep 2020 17:40:36 +0000 (14:40 -0300)]
Bug 26582: Unit tests

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 26935: Don't use basket for claimacquisition and claimissues
Jonathan Druart [Thu, 5 Nov 2020 08:12:12 +0000 (09:12 +0100)]
Bug 26935: Don't use basket for claimacquisition and claimissues

Incorrect basketid is sent for claimacquisition and claimissues.

The basket info are not used in the default template of these notices, but if it
is used, a wrong basket may be passed to generate the notice.

This has been caught by a test failure after bug 26745.

 #   Failed test 'SendAlerts - claimissue'
 #   at t/db_dependent/Letters.t line 642.
 C4::Letters::_substitute_tables(): DBI Exception: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed [for Statement "SELECT * FROM aqbasket WHERE       basketno = ?" with ParamValues: 0=53] at /kohadevbox/koha/C4/Letters.pm line 679

This is a quick patch to fix the failing test, but more work would needed.

We are removing the basket info from those 2 notices and keeping it only
for orderacquisition.

Technically: the $externalid is coming from the parameter list of
SendAlerts, but it is a basketno only for orderacquisition. We must not
pass it for other notices.

Test plan:
Confirm that the failing test is now passing and that the changes make
sense.

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 26908: (follow-up) Alter template check
Martin Renvoize [Thu, 5 Nov 2020 12:42:47 +0000 (12:42 +0000)]
Bug 26908: (follow-up) Alter template check

This alters the template check to use the presence of the plugins
arrayref rather than requiring a second call to check for
plugins_enabled.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26908: Restore ability to view and select EDI plugins for a vendor account
Kyle M Hall [Tue, 3 Nov 2020 13:31:39 +0000 (08:31 -0500)]
Bug 26908: Restore ability to view and select EDI plugins for a vendor account

Test Plan:
1) Install an EDI plugin
2) Browse to edi_accounts.pl, create or edit an account
3) Note the plugins pulldown is missing
4) Apply this patch
5) Restart all the things!
6) Reload the page
7) Note the pulldown is back!

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 26911: (bug 18936 follow-up) Remove invalid data before copying the circ rules
Jonathan Druart [Tue, 3 Nov 2020 15:45:33 +0000 (16:45 +0100)]
Bug 26911: (bug 18936 follow-up) Remove invalid data before copying the circ rules

UPDATE: changed queries to not touch * values

To test:
 1 - Checkout 19.11.x and reset_all
 2 - Add a new patron category, itemtype, and branch to your system
 3 - Create issuing rules using thise 3 values, and others
 4 - Delete the new category, itemtype and branch
 5 - Checkout master
 6 - Restart_all
 7 - updatedatabase
 8 - you get errors
 9 - repeat 1-5
10 - apply patch
11 - restart_all
12 - updatedatabase
13 - no errors!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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 26915: Fix FinePaymentAutoPopup behaviour
Jonathan Druart [Wed, 4 Nov 2020 08:04:19 +0000 (09:04 +0100)]
Bug 26915: Fix FinePaymentAutoPopup behaviour

The behaviour of the syspref FinePaymentAutoPopup is broken, the popup
explodes with
    Can't call method "unblessed" on an undefined value at /home/vagrant/kohaclone/members/printfeercpt.pl line 64

It has been broken by
  commit a2449a81be55aa5b3710ca2c6df7884513f89540
  Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test
which modified the return value of Koha::Account->pay (from $payment_id
to a hashref)

Test plan:
- To test activate FinePaymentAutoPopup
- Create a manual fee
- Write it off using the write off button on the account line (not below table)
=> Without the patch you get the error
=> With the patch applied the popup is correctly displayed

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 7143: Update about page for new dev - Ivan Masár
Jonathan Druart [Wed, 4 Nov 2020 16:36:06 +0000 (17:36 +0100)]
Bug 7143: Update about page for new dev - Ivan Masár

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26132: (follow-up) Fix broken code in TooMany function
Joonas Kylmälä [Wed, 4 Nov 2020 15:05:28 +0000 (17:05 +0200)]
Bug 26132: (follow-up) Fix broken code in TooMany function

The $checkouts variable was not defined in the PatronLibrary case at
all and in the else case the SQL join was totally missing.

To test:
1) Without this patch notice prove
   t/db_dependent/Circulation/TooMany.t fails
2) With this patch notice prove
   t/db_dependent/Circulation/TooMany.t succeeds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26132: (follow-up) Add test to show errors in max issues amount calculation
Joonas Kylmälä [Wed, 4 Nov 2020 15:00:02 +0000 (17:00 +0200)]
Bug 26132: (follow-up) Add test to show errors in max issues amount calculation

If you set default branch limits for issue quantity circulation
rules you will get errors when calling TooMany function.

To reproduce the error:
1) Apply this patch
2) Run prove t/db_dependent/Circulation/TooMany.t and notice the
   following error:

No method count found for Koha::Checkouts DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'item.homebranch' in 'where clause' [...]

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23823: (QA follow-up) Fix filter in link
Nick Clemens [Fri, 16 Oct 2020 11:47:24 +0000 (11:47 +0000)]
Bug 23823: (QA follow-up) Fix filter in link

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>