koha.git
2 years agoBug 29488: make NumSavedReports work
Lucas Gass [Tue, 16 Nov 2021 00:17:38 +0000 (00:17 +0000)]
Bug 29488: make NumSavedReports work

1. Have a bunch of saved reports
2. Try to use the sys pref NumSavedReports to limit how many show by default
3. It doesn't work
4. Apply patch
5. Try again, now it should work

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 318467694da929ab484f29e70c5c67d8f34f16c0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29427: Make SMTP transport set debug mode correctly
Tomas Cohen Arazi [Fri, 5 Nov 2021 15:50:35 +0000 (12:50 -0300)]
Bug 29427: Make SMTP transport set debug mode correctly

This patch makes the _transport_ method in Koha::SMTP::Server pass the
debug flag correctly to the Email::Sender::Transport::SMTP->new
constructor.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/SMTP/Server.t
=> FAIL: Oh noes! debug is not passed to the constructor!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Hey! It is being set!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b0767f94d07950e7420deb901b208d131427c535)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29427: Regression tests
Tomas Cohen Arazi [Fri, 5 Nov 2021 15:50:01 +0000 (12:50 -0300)]
Bug 29427: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f6b6bdb96f4cab0677402194db7e6408feb6fca6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29521: Fix style of patron clubs table when in clubs management
Owen Leonard [Thu, 18 Nov 2021 19:17:48 +0000 (19:17 +0000)]
Bug 29521: Fix style of patron clubs table when in clubs management

This patch follows up Bug 24627 to add some additional template logic to
the table of clubs so that the interface is consistent whether you're
looking at clubs during the holds process or during the clubs management
view.

The ways Bug 24627 made the clubs list more consistent with patron
search results made it LESS consistent with the Clubs management
interface.

To test, apply the patch and go to Tools -> Patron clubs.

- Scroll down to the "Clubs" table, below the "Club templates" table.
  - In the table of clubs, the club name should not be a link.
  - Hovering your mouse over the table should not highlight each row.

Confirm the previous behavior of a clubs search when placing a hold:

- Search the catalog and start the process of placing a hold on an item.
- On the "Place hold" page, click the "Clubs" tab and perform a search
  which will return multiple clubs.
- In this view, the club name should be a link. Clicking it should
  select that club for the hold.
- You should also be able to click anywhere in the row to select the
  club for the hold.

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 623bae988442c9bdff5d34de23270e3f09f523bc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29513: (QA follow-up) Fix TT filters
Katrin Fischer [Tue, 16 Nov 2021 08:43:01 +0000 (08:43 +0000)]
Bug 29513: (QA follow-up) Fix TT filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b6a820c0ba0fed80cc652a3a2a2bc6ad07987be4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29513: Convert remaining breadcrumbs div blocks into nav
Andreas Roussos [Thu, 18 Nov 2021 08:37:01 +0000 (09:37 +0100)]
Bug 29513: Convert remaining breadcrumbs div blocks into nav

As per https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27846#c0,
breadcrumbs should adhere to the WAI-ARIA Authoring Practices. Most Staff
Client template files have already been fixed, but there were a few that
were missed.

This patch fixes that.

Test plan:
1) Apply this patch.
2) Visit these pages in the Staff Client:
   Home > Acquisitions > TestVendor > Basket TestBasket (1) for TestVendor (*)
   Home > Administration > Set library checkin and transfer policy (**)
   Home > Patrons > Merge patron records (***)
   ...and confirm that the breadcrumbs display correctly.

   (*) Can be accessed by creating a test basket for a test vendor
   (**) Can be found under Administration -> Patrons and circulation
   (***) Can be found by trying to merge two Patron records

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 51e2fad7d3c4281bdb05aa8bb32c50d76e4e57dd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29514: Remove extraneous HTML entity from breadcrumbs
Andreas Roussos [Thu, 18 Nov 2021 09:45:10 +0000 (10:45 +0100)]
Bug 29514: Remove extraneous HTML entity from breadcrumbs

The template file for ILL requests has a small typo in the breadcrumbs
section: there exists an extra &rsaquo; HTML entity after "Home".

This patch fixes that.

Test plan:
1) Access the ILL requests module, and notice how an extra character
   is displayed after "Home" in the breadcrumbs.
2) Apply this patch.
3) Refresh the page -- the extra character is no longer displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 592d2ece3e3c9d58a6577c2480d7094e75f2e7bd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoUpdate release notes for 21.05.07 release v21.05.07
Kyle M Hall [Tue, 30 Nov 2021 16:34:23 +0000 (11:34 -0500)]
Update release notes for 21.05.07 release

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoIncrement version for 21.05.07 release
Kyle M Hall [Tue, 30 Nov 2021 16:31:34 +0000 (11:31 -0500)]
Increment version for 21.05.07 release

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29564: Use List::MoreUtils so SIP U16/Xenial does not break
Mason James [Wed, 24 Nov 2021 01:57:51 +0000 (14:57 +1300)]
Bug 29564: Use List::MoreUtils so SIP U16/Xenial does not break

 - run prove t/00-load.t, see error
 - apply patch

    00:07:08.189 koha_1       | #   Failed test 'use C4::SIP::Sip::Configuration;'
    00:07:08.189 koha_1       | #   at t/00-load.t line 46.
    00:07:08.189 koha_1       | #     Tried to use 'C4::SIP::Sip::Configuration'.
    00:07:08.189 koha_1       | #     Error:  "uniq" is not exported by the List::Util module

 - run prove t/00-load.t, see tests pass :0)

https://bugs.koha-community.org/show_bug.cgi?id=29478

https://bugs.koha-community.org/show_bug.cgi?id=29564

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoUpdate release notes for 21.05.06 release v21.05.06
Kyle M Hall [Wed, 24 Nov 2021 19:34:20 +0000 (14:34 -0500)]
Update release notes for 21.05.06 release

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoIncrement version for 21.05.06 release
Kyle M Hall [Wed, 24 Nov 2021 19:21:28 +0000 (14:21 -0500)]
Increment version for 21.05.06 release

2 years agoFix translations for Koha 21.05.06
Kyle M Hall [Wed, 24 Nov 2021 19:19:35 +0000 (14:19 -0500)]
Fix translations for Koha 21.05.06

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoTranslation updates for Koha 21.05.06
Koha translators [Fri, 26 Nov 2021 11:32:51 +0000 (08:32 -0300)]
Translation updates for Koha 21.05.06

2 years agoBug 29524: (bug 28935 follow-up) Restore modification of some patron's attributes
Jonathan Druart [Mon, 22 Nov 2021 13:24:40 +0000 (14:24 +0100)]
Bug 29524: (bug 28935 follow-up) Restore modification of some patron's attributes

On
  commit 5f37d8d2f496ce3c9fd6dfd5a2efa7a9fe435af3
  Bug 28935: No filtering on patron's data on member entry pages
we restricted the list of the columns from the borrowers table that can
be modified from the patron edit view.
We were too restrictive, the following 3 attributes can be edited from
this form: privacy_guarantor_fines, privacy_guarantor_checkouts,
checkprevcheckout and lang

Test plan:
Turn on the following prefs:
- AllowStaffToSetFinesVisibilityForGuarantor
- AllowStaffToSetCheckoutsVisibilityForGuarantor
- CheckPrevCheckout (set to 'unless overridden *')
- TranslateNotices
Edit a patron and see the 4 different options are now displayed.
Change their value, save, edit again
Confirm that the values have been saved

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBump version to 21.05.05.005
Kyle M Hall [Tue, 23 Nov 2021 18:31:37 +0000 (13:31 -0500)]
Bump version to 21.05.05.005

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28847: Remove diag statements
Jonathan Druart [Mon, 25 Oct 2021 13:02:55 +0000 (15:02 +0200)]
Bug 28847: Remove diag statements

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28847: Remove dead code and make regex consistent
Nick Clemens [Mon, 13 Sep 2021 11:53:39 +0000 (11:53 +0000)]
Bug 28847: Remove dead code and make regex consistent

This updates the regex code to match throughout the routine and removes
code that would no longer be reached.

Note that the code to update library name in the query descruiption was
broken before this patch, so removal does not change behaviour

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28847: (follow-up) Handle branch_group_limit
Nick Clemens [Sat, 11 Sep 2021 15:12:31 +0000 (15:12 +0000)]
Bug 28847: (follow-up) Handle branch_group_limit

To test:
1 - Create a library group as an OPAC search group
2 - Enable OpacAddMastheadLibraryPulldown
3 - Browse to:
    http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=t&branch_group_limit=multibranchlimit-1&weight_search=1
4 - Confirm search works and returns correct results
5 - Confirm dropdown is correctly populated

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28847: Only apply JS to branch/multibranch selection if there are search groups
Nick Clemens [Fri, 13 Aug 2021 19:48:48 +0000 (19:48 +0000)]
Bug 28847: Only apply JS to branch/multibranch selection if there are search groups

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28847: Cleanup of branch limitsand fix OPAC_SEARCH_LIMIT
Nick Clemens [Thu, 12 Aug 2021 11:13:46 +0000 (11:13 +0000)]
Bug 28847: Cleanup of branch limitsand fix OPAC_SEARCH_LIMIT

The opac had 'branch_group_limit' parameters which can be simplified to more
closely match intranet code.

Adjust C4::Auth for chaneg above to ensure dropdowns correctly populate

Expand JS to prevent selection of single and multibranch limits

To test:
1 - Enable OpacAddMastheadLibraryPulldown system preference
2 - Ensure branches and groups show as before patch
3 - Ensure single and multibranch limits from masthead apply as expected
4 - Test advanced search page, ensure you cannot select both single and multibranch limit
5 - Follow test plan on 28845 - ensure multibranch limit still correctly pre-selected

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28847: Unit tests
Nick Clemens [Thu, 12 Aug 2021 11:11:54 +0000 (11:11 +0000)]
Bug 28847: Unit tests

Note: tests are very similar between ES and Zebra, however, ES requires the uppercase
OR and doesn't use '=' in the same way. I feel having test coverage in each module is fair and more future
proof in case of changes to search engine

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28847: Move SearchLimitLibrary code to QueryBuilder Modules
Nick Clemens [Thu, 12 Aug 2021 11:02:39 +0000 (11:02 +0000)]
Bug 28847: Move SearchLimitLibrary code to QueryBuilder Modules

This patch removes the code from the search scripts into QueryBuilder
modules.

To test:
1 - Have a library group defined as a search group for both staff and opac
2 - Search on staff client and opac with that group limit and a single branch limit
3 - Note your results/counts
4 - Note the visuals of the search description
5 - Apply patch
6 - Repeat searches
7 - All should work as before

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29330: (QA follow-up) Change to message/rfc822
Marcel de Rooy [Fri, 12 Nov 2021 08:55:42 +0000 (08:55 +0000)]
Bug 29330: (QA follow-up) Change to message/rfc822

This content-type might be more appropriated to use as a temporary
label for the serialized email message with attachments.

WARNING: perl -cw tells you that the constant is redefined. This has
to do with an already existing module dependency loop of Letters.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29330: (QA follow-up) Use passed MIME type
Tomas Cohen Arazi [Mon, 8 Nov 2021 11:10:38 +0000 (08:10 -0300)]
Bug 29330: (QA follow-up) Use passed MIME type

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: tidied.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29330: Restore handling of serialized MIME messages in message_queue
Tomas Cohen Arazi [Fri, 5 Nov 2021 19:05:48 +0000 (16:05 -0300)]
Bug 29330: Restore handling of serialized MIME messages in message_queue

This patch changes how multipart MIME messages are handled on the
message_queue table.

The email, with the required attachments, is now generated using
Koha::Email, and serialized using Koha::Email->as_string.

This bug also adds Koha::Email->new_from_string which is used to read
that data from the DB, and produce a Koha::Email object, that can be
further augmented/modified using regular Koha::Email methods.

This implementation should be considered a middle ground, with
backportability in mind. higher-level methods should encapsulate setting
the default headers and addresses, to clean the area a bit further.

Preparation:
- You need a valid SMTP configuration in koha-conf.xml. If you use Gmail
  you can generate an 'app password' and set things like this:

 <smtp_server>
    <host>smtp.gmail.com</host>
    <port>587</port>
    <timeout>5</timeout>
    <ssl_mode>STARTTLS</ssl_mode>
    <user_name>youraddress@gmail.com</user_name>
    <password>youpassword</password>
    <debug>1</debug>
 </smtp_server>
- Set KohaAdminAddress to your address.

To test:
1. Pick a patron. Make sure it doesn't have any email address (Acevedo?)
2. Set an overdue notice trigger for its category
3. Check something out, with due date in the past to force an overdue
4. Run:
   $ kshell
  k$ misc/cronjobs/overdue_notices.pl -v
  k$ exit
   $ koha-mysql kohadev
   > SELECT * FROM message_queue WHERE borrowernumber=the_borrowernumber;
=> SUCCESS: A notice has been created
5. Run:
   $ kshell
  k$ misc/cronjobs/process_message_queue.pl --verbose
=> SUCCESS: SMTP is ok => Email is sent
=> FAIL: Your inbox shows an email with weird content
6. Apply this patches
7. Run:
   $ koha-mysql kohadev
   > DELETE FROM message_queue;
8. Repeat 4 and 5
=> SUCCESS: You got an email with an attachment!
=> SUCCESS: The attachment contains an email that couldn't be delivered!
9. Try all the things that enqueue messages :-D
=> SUCCESS: No behavior change
10. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Edited the POD, restoring a few lines that describe the needed hash
keys of the attachments.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29330: Add Koha::Email->new_from_string
Tomas Cohen Arazi [Fri, 5 Nov 2021 18:22:25 +0000 (15:22 -0300)]
Bug 29330: Add Koha::Email->new_from_string

This patch introduces a new method to Koha::Email. This method allows us
to parse a MIME email to initialize the Koha::Email object. This is
particularly important when we are restoring emails from the DB. i.e.
from the *message_queue* table.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> SUCCESS: Tests pass! Koha::Email->new_from_string is the correct
counterpart for Koha::Email->as_string!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28803: (QA follow-up) Reinstate UNKNOWN_ERROR in templates
Martin Renvoize [Tue, 21 Sep 2021 16:08:22 +0000 (17:08 +0100)]
Bug 28803: (QA follow-up) Reinstate UNKNOWN_ERROR in templates

I can't see how this will ever get thrown, but as it's there we should
have the template handling included.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28803: (follow-up) Error details improvement
Martin Renvoize [Mon, 13 Sep 2021 09:18:46 +0000 (10:18 +0100)]
Bug 28803: (follow-up) Error details improvement

This patch updates the exceptions thrown by Koha::Email to include the
parameter that failed email validation and then updates the failure code
to include this parameter and finally display this field in the template.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28803: Add invalid email handling in _send_message_by_email
Martin Renvoize [Thu, 5 Aug 2021 07:00:19 +0000 (08:00 +0100)]
Bug 28803: Add invalid email handling in _send_message_by_email

This patch adds a try/catch block around the call to Koha::Email->create
to catch and handle invalid emails being passed in the parameters.

The message is marked as 'failed' with an error_code of 'INVALID_EMAIL'.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28803: Add unit tests
Martin Renvoize [Thu, 5 Aug 2021 07:43:32 +0000 (08:43 +0100)]
Bug 28803: Add unit tests

This patch updates Letters.t to confirm that invalid email addresses in
the message_queue should not throw an exception when sending mail but
instead set the status to failed and pass error details to the end user.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29437: (QA follow-up) Update TODO in Breeding.t
Marcel de Rooy [Fri, 19 Nov 2021 07:54:37 +0000 (07:54 +0000)]
Bug 29437: (QA follow-up) Update TODO in Breeding.t

We now have some tests for BreedingSearch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29437: (QA follow-up) Remove Business::ISBN from addbooks
Marcel de Rooy [Fri, 19 Nov 2021 07:53:26 +0000 (07:53 +0000)]
Bug 29437: (QA follow-up) Remove Business::ISBN from addbooks

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29437: Search reservoir for term as title, author, or variations of ISBN
Nick Clemens [Mon, 8 Nov 2021 19:24:36 +0000 (19:24 +0000)]
Bug 29437: Search reservoir for term as title, author, or variations of ISBN

The code in the script and the module attempt to determine whether a term is an isbn, or not. Rather
than try to do this, we can simply search it on the three fields: isbn, title, author

Additionally, we should search as any of the ISBN variations to broaden our matches

Note: Curently only an ISBN 10 is stored in import biblios, so for an ISBN13 that doesn't convert
the value will be blank - this is another bug

To test:
1 - Perform a cataloging search for a valid ISBN 13 with no ISBN10 counterpart:
    9798200834976
2 - 500 error
3 - Apply patch
4 - Repeat, no results
5 - Import some records
6 - Search by title/author/isbn
7 - Confirm searching works as expected

WNC amended to fix spelling

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
AMENDED: Useless call of ISBNs (plural) when you only pass one parameter.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29437: Unit tests
Nick Clemens [Wed, 10 Nov 2021 13:33:41 +0000 (13:33 +0000)]
Bug 29437: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29456: Add Hold_Reminder description to patron categories overview page
Katrin Fischer [Mon, 15 Nov 2021 16:29:49 +0000 (16:29 +0000)]
Bug 29456: Add Hold_Reminder description to patron categories overview page

This was missed when initially adding the notice.

To test:
- Go to Administraiton > patron categories
- Edit a patron category and check "Hold reminder" in messaging
  preferences, save.
- Go to the overview page and verify it shows as 'Unknown'.
- Apply patch.
- Descrpition should now display.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29456: (bug 18532 follow-up) handle Auto_Renewals messages in category
Jonathan Druart [Tue, 16 Nov 2021 13:57:21 +0000 (14:57 +0100)]
Bug 29456: (bug 18532 follow-up) handle Auto_Renewals messages in category

The new message appears in the list on the edit view, but the list view
is showing "unknown"

Test plan:
Set AutoRenewalNotices to "according to patron messaging prefs"
Edit a patron category
Tick all the checkboxes
On the category list view you should see a correct display in the
"Messaging" column

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29341: DBIC schema changes
Kyle M Hall [Fri, 19 Nov 2021 16:54:57 +0000 (16:54 +0000)]
Bug 29341: DBIC schema changes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29341: DBRev 21.05.05.005
Kyle Hall [Fri, 19 Nov 2021 16:52:54 +0000 (11:52 -0500)]
Bug 29341: DBRev 21.05.05.005

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29341: Remove foreign keys on pseudonymized_transactions
Jonathan Druart [Wed, 17 Nov 2021 11:25:35 +0000 (12:25 +0100)]
Bug 29341: Remove foreign keys on pseudonymized_transactions

Behave like the statistics table and don't remove the code even if the
branch or patron's category is removed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoRevert "Bug 29485: Trying to prevent administration_tasks.t to fail randomly"
Kyle Hall [Fri, 19 Nov 2021 16:40:55 +0000 (11:40 -0500)]
Revert "Bug 29485: Trying to prevent administration_tasks.t to fail randomly"

This reverts commit cf762b0be39c21d45b48a6fa783a0fde0ed0f6e7.

2 years agoBug 29485: Trying to prevent administration_tasks.t to fail randomly
Jonathan Druart [Mon, 15 Nov 2021 14:04:06 +0000 (15:04 +0100)]
Bug 29485: Trying to prevent administration_tasks.t to fail randomly

Since bug 19185, and Koha_Master running the tests after t/db_dependent/selenium/01-installation.t is ran, t/db_dependent/selenium/administration_tasks.t is failing randomly with:

12:32:59 koha_1       | STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
12:32:59 koha_1       |  /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
12:32:59 koha_1       |  (eval 1710):1 in Selenium::Remote::Driver::__ANON__
12:32:59 koha_1       |  (eval 1712):2 in Selenium::Remote::Driver::__ANON__
12:32:59 koha_1       |  /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
12:32:59 koha_1       |  /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:1340 in (eval)
12:32:59 koha_1       |  /kohadevbox/koha/t/lib/Selenium.pm:170 in Selenium::Remote::Driver::find_element
12:32:59 koha_1       |  t/db_dependent/selenium/administration_tasks.t:188 in t::lib::Selenium::click

I don't recreate it locally.

The screenshot of the failure shows that the screen is still on the authorised value list view.

This does not make a lot of sense, but I am failing to find a logic
here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29408: Add JSDoc documentation for kohaTable function
Martin Renvoize [Wed, 3 Nov 2021 16:52:57 +0000 (16:52 +0000)]
Bug 29408: Add JSDoc documentation for kohaTable function

This patch adds some JSDoc formatted parameter documentation for the
kohaTable function.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29408: Update all existing uses of .api to .kohaTable
Martin Renvoize [Wed, 3 Nov 2021 16:30:50 +0000 (16:30 +0000)]
Bug 29408: Update all existing uses of .api to .kohaTable

This patch goes through the codebase and updates existing revelant calls
to .api referencing the Koha REST dataTables wrapper to use the name
name 'kohaTable'.

Test plan.
1) Ensure the tables on the following pages all continue to work as
   expected
   a) acqui/parcel
   b) admin/branches
   c) admin/cities
   d) admin/smtp_servers
   e) pos/register
   f) tools/quotes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29408: Rename Koha dataTables wrapper
Martin Renvoize [Wed, 3 Nov 2021 16:29:21 +0000 (16:29 +0000)]
Bug 29408: Rename Koha dataTables wrapper

This patch renames the Koha REST JS dataTables wrapper from the
ambigious 'api' to the clearer 'kohaTable'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29405: Fix date_renewed attribute format in patron spec
Martin Renvoize [Wed, 3 Nov 2021 13:47:35 +0000 (13:47 +0000)]
Bug 29405: Fix date_renewed attribute format in patron spec

This patch just adds the 'date' format string to ensure we are
validating the input/output of the date_renewed field correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29452: remove unnecessary warns in the logs
Christophe Croullebois [Wed, 10 Nov 2021 15:23:54 +0000 (16:23 +0100)]
Bug 29452: remove unnecessary warns in the logs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29321: Remove a last without loop context
Marcel de Rooy [Fri, 5 Nov 2021 15:00:04 +0000 (15:00 +0000)]
Bug 29321: Remove a last without loop context

This reads better when converted to regular if.
Note that last within such a block is allowed in Perl, but it feels
better to use it only in a loop context.

Test plan:
Read the patch ;)
Bonus: Test if you enter the block by using pref OPACSuggestionMandatoryFields
when adding a suggestion from opac.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: Added a space between 'if' and '(' :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27145: Wrap delete and move_to_deleted in a transaction
Kyle M Hall [Fri, 4 Dec 2020 11:55:37 +0000 (06:55 -0500)]
Bug 27145: Wrap delete and move_to_deleted in a transaction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27145: Rethrow all other exceptions
Kyle M Hall [Thu, 3 Dec 2020 14:10:30 +0000 (09:10 -0500)]
Bug 27145: Rethrow all other exceptions

Bug 14708 introduced a try catch around $patron->delete in commit:
  "Bug 14708: (QA follow-up) Use try/catch blocks when calling"

However, in the catch block it only assumes the exception was from trying to
delete anonymous patron when it can be anything else as well, the code should
be modified so that it will handle the anonymous patron case and if it is
anything else we log the other exception.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 21105: Fix test if sample data missing
Jonathan Druart [Mon, 15 Nov 2021 13:34:03 +0000 (14:34 +0100)]
Bug 21105: Fix test if sample data missing

    #   Failed test 'Identify - earliestDatestamp in the right format'
    #   at t/db_dependent/OAI/Server.t line 182.
    # Compared $data->{"Identify"}{"earliestDatestamp"}
    #    got : '2021-11-15T13:16:09Z'
    # expect : '2014-05-07T13:36:23Z'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 21105: (follow-up) Regression tests
Jonathan Druart [Mon, 15 Nov 2021 10:44:14 +0000 (11:44 +0100)]
Bug 21105: (follow-up) Regression tests

Mock KohaAdminEmailAddress in case it differs from the default value

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 21105: (QA follow-up) Avoid MySQL-ism
Tomas Cohen Arazi [Fri, 12 Nov 2021 14:34:58 +0000 (11:34 -0300)]
Bug 21105: (QA follow-up) Avoid MySQL-ism

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 21105: (QA follow-up) Silence warning because of tests setup
Tomas Cohen Arazi [Fri, 12 Nov 2021 14:15:08 +0000 (11:15 -0300)]
Bug 21105: (QA follow-up) Silence warning because of tests setup

The tests are using 'http://localhost' and the regex is setting $baseURL
to empty in this case. It works on the oai.pl front-end.

This patch changes the regex.

To test:
1. Run:
   $ kshell
  k$ t/db_dependent/OAI/Server.t
=> FAIL: Boo! Warning!
2. Apply this patch
3. Repeat 2
=> SUCCESS: Oh, cool. No warning :-D
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 21105: Regression tests
Tomas Cohen Arazi [Fri, 12 Nov 2021 13:16:37 +0000 (10:16 -0300)]
Bug 21105: Regression tests

This patch introduces a regression test for the fixed behavior.
I also changed a oneliner regex we had for stripping query parameters
because it was causing a warning with the tests base URL
(http://localhost) because it was generating an empty baseURL.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/OAI/Server.t
=> FAIL: Tests fail, the response is incorrect!
3. Apply the bug's patch
4. Repeat 2
=> SUCCESS: Tests pass! Good response!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 21105: oai.pl returns invalid earliestDatestamp
Rudolf Byker [Thu, 15 Apr 2021 07:32:30 +0000 (09:32 +0200)]
Bug 21105: oai.pl returns invalid earliestDatestamp

For OAI-PMH, all date and time values must be in the format
"YYYY-MM-DDThh:mm:ssZ" and in UTC. Currently,
Identify.earliestDatestamp uses the SQL format "YYYY-MM-DD hh:mm:ss".
This patch fixes that.

To test:
1) Get a Koha instance with OAI-PMH enabled.
2) Visit /cgi-bin/koha/oai.pl?verb=Identify, view source for the page
   and observe that earliestDate is in the wrong format
   "YYYY-MM-DD hh:mm:ss"
3) Apply patch
4) Visit /cgi-bin/koha/oai.pl?verb=Identify, view the source for the page
   and observe that earliestDate is now in the correct format
   "YYYY-MM-DDThh:mm:ssZ"
5) Sign off

Sponsored-by: Reformational Study Centre
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29460: Fix typo 'pendin g approval'
Marcel de Rooy [Fri, 12 Nov 2021 07:47:48 +0000 (07:47 +0000)]
Bug 29460: Fix typo 'pendin g approval'

Test plan:
Apply and git grep for it.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28627: Calculate unitprice if not set
Nick Clemens [Fri, 12 Nov 2021 17:15:20 +0000 (17:15 +0000)]
Bug 28627: Calculate unitprice if not set

On bug 23376 the developer was too clever by half. Instead of passing
values to the template we moved to simply passing the order object.

The calculations that populated the unitprice, however, were simply dropped.

This patch restores the behaviour of setting unitprice to the estimated cost
by default. We do this conditionally in the template

To test:
 1 - Create a basket and adding items to it. Set the 'Vendor price' to
    '20', do not add an 'Actual cost'
 2 - Close the basket
 3 - Select 'Receive shipment'
 4 - Set a value for vendor invoice
 5 - Receive the order you created
 6 - Observe 'Actual cost' is = 0.00
 7 - Apply patch
 8 - Refresh the order receival page, and confirm the 'Actual cost' =
    20.00
 9 - Cancel receipt - reopen basket - edit order - add an actual cost - close
10 - Receive the order again
11 - Confirm the actual price is used
12 - Repeat this whole plan, but ensure the vendor has a different value for
     Invoice prices: Include tax

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29255: Built-in offline circulation broken with SQL error
Owen Leonard [Fri, 15 Oct 2021 18:27:16 +0000 (18:27 +0000)]
Bug 29255: Built-in offline circulation broken with SQL error

This patch makes a minor correction to one of the queries used when
synchronizing transactions in the built-in offline circulation system.
This fixes the error:

DBD::mysql::st execute failed: Column 'branchcode' in field list is
ambiguous at /kohadevbox/koha/offline_circ/download.pl line 84

To test you must be using a browser which still supports
applicationCache (Firefox before version 81, Chrome before version 94).

- Apply the patch and restart services.
- Enable the AllowOfflineCirculation system preference.
- Go to Circulation -> Built-in offline circulation interface.
- Click "Synchronize."
- Click the "Download records" button.
- After the page refreshes you should see updated dates where it lists
  "last synced" information.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29264: SIP config allows use of non-branchcode institution ids causes workers...
Kyle M Hall [Mon, 18 Oct 2021 12:28:27 +0000 (12:28 +0000)]
Bug 29264: SIP config allows use of non-branchcode institution ids causes workers to die without responding

If is entirely possible to create an SIP institution whose ID does not match a valid branchcode in Koha's SIP config. In fact, Koha's example SIP config contains an example of this ( kohalibrary / kohalibrary2 ).

If a SIP login uses an institution with an id that doesn't match a valid branchcode, everything will appear to work, but the SIP worker will die anywhere that Koha gets the branch from the userenv and assumes it is valid.

The repercussions of this are that actions such as the checkout message simply die and do not return a response message to the requestor.

At the very least, we should output a warning to the SIP log.

I think we should strongly consider disallowing institution ids in the SIP config that do not match valid branchcodes. In this scenario, attempting to start the SIP server should result in a error message with the SIP server exiting immediately.

Test Plan:
1) Apply this patch
2) Make a sip login that uses an instution whose id is *not* a valid branchcode
3) Start the SIP server
4) Check sip.log, you should see a warning similar to the following:
[2021/10/18 12:18:29] [2068079] [ERROR] ERROR: Institution kohalibrary does does not match a branchcode. This can cause unexpected behavior. C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (220)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29204: (QA follow-up) Fix variable name
Joonas Kylmälä [Sat, 6 Nov 2021 14:16:38 +0000 (14:16 +0000)]
Bug 29204: (QA follow-up) Fix variable name

The patch "Bug 29204: Fix reports/issues_stats.pl for MySQL 8"
accidentally changed the variable name from $strsth2 to $strsth

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29204: Fix reports/issues_stats.pl for MySQL 8
Jonathan Druart [Tue, 19 Oct 2021 09:08:29 +0000 (11:08 +0200)]
Bug 29204: Fix reports/issues_stats.pl for MySQL 8

Error was: Incorrect DATETIME value: ''

Test plan
Go to Reports -> Circulation
On Period select "Row" or "Column" and choose a date
Submit

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28994: Fix logical errors with amount vs amoutoutstanding
Magnus Enger [Tue, 9 Nov 2021 10:13:05 +0000 (10:13 +0000)]
Bug 28994: Fix logical errors with amount vs amoutoutstanding

The writeoff debts script contained an error whereby we could writeoff
more than the current outstanding debt of a charge.  This patch corrects
that mistake by passing amountoutstanding in place of amount in the
writeoff and offset creation lines.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29123: Add Dataly Tech to About page
Andreas Roussos [Mon, 27 Sep 2021 12:47:00 +0000 (14:47 +0200)]
Bug 29123: Add Dataly Tech to About page

This patch adds Dataly Tech to the list of "Contributing companies
and institutions" in the About page.

Test plan:
1) View the About page, notice how Dataly Tech is missing
2) Apply this patch
3) Reload the About page, this time "Dataly Tech, Greece" is listed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28870: non-FQDN addresses are valid
Jonathan Druart [Thu, 26 Aug 2021 15:21:32 +0000 (17:21 +0200)]
Bug 28870: non-FQDN addresses are valid

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28870: Use Email::Address->parse
Jonathan Druart [Thu, 26 Aug 2021 15:13:41 +0000 (17:13 +0200)]
Bug 28870: Use Email::Address->parse

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28870: Move email address validation to a specific class method
Jonathan Druart [Thu, 26 Aug 2021 15:12:58 +0000 (17:12 +0200)]
Bug 28870: Move email address validation to a specific class method

To ease testing and future changes if needed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28870: Remove traces of Email::Valid
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:37:37 +0000 (18:37 -0300)]
Bug 28870: Remove traces of Email::Valid

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28870: Use Email::Address to validate email addresses
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:23:30 +0000 (18:23 -0300)]
Bug 28870: Use Email::Address to validate email addresses

This patch adds a new dependency, Email::Address. It is used in
Koha::Email to replace the current use of Email::Valid, which proved to
be problematic when it comes to UTF-8 characters.

Email::Address provides suitable regexes that -when used- keep our
tests passing, but also deal better with UTF-8 data.

To test:
1. Apply the regression tests patch
2. Notice the only change is that it tweaks a couple addresses so they
   contain umlauts and also have the "Description <address>" format that
   is used when sending carts.
3. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> FAIL: Tests fail! Things die because Email::Valid doesn't like the
   from we passed.
4. Run:
   $ sudo apt install libemail-address-perl
5. Apply this patch
6. Repeat 3
=> SUCCESS: Tests pass!
7. Try what is described in comment 1
=> SUCCESS: Things are back to normal
8. Sign off :-D
9. Send cookies

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28870: Regression tests
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:22:58 +0000 (18:22 -0300)]
Bug 28870: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29195: Compiled CSS
Kyle Hall [Thu, 11 Nov 2021 12:37:24 +0000 (07:37 -0500)]
Bug 29195: Compiled CSS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29195: Fix highlighting on odd rows in circ-patron-search-results
Owen [Fri, 5 Nov 2021 12:22:07 +0000 (12:22 +0000)]
Bug 29195: Fix highlighting on odd rows in circ-patron-search-results

This patch adds "!important" to the CSS rule governing the background
color of table cells when hovered. It only applies to tables with the
"selections-table" class.

Although "!important" is not usually recommended, in this case the
appliation is narrow enough that I think it outweighs the complicated
selector that would be required to make it work otherwise.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Locate a record in the catalog and being the process of placing a
  hold.
- When you're asked to enter a card number or search by name, search
  using a name which will return multiple results.
- In the table of results, hovering the mouse over the table should
  highlight the row in yellow.
- Perform the same test when searching for a club by name.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29416: (bug 28941 follow-up) Restore suggestion prefill
Jonathan Druart [Fri, 5 Nov 2021 09:13:47 +0000 (10:13 +0100)]
Bug 29416: (bug 28941 follow-up) Restore suggestion prefill

From commit 586bed1319592e05f5dc3acf64a1dba8cae69d6b
     Bug 28941: Filter suggestion inputs at the OPAC

But later in the script we send { suggestion => %$suggestion } to the
template and so erase the variable previously passed.

Test plan:
Login at the OPAC
Go to the bibliographic detail page
Suggest for purchase
=> The form must be prefilled!

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27708: (QA follow-up) Add a few tests for Koha::Edifact::Order
Joonas Kylmälä [Tue, 2 Nov 2021 23:22:45 +0000 (23:22 +0000)]
Bug 27708: (QA follow-up) Add a few tests for Koha::Edifact::Order

1. This adds a simple regression test to make sure order_line() method
executes correctly with basket create_items set to "ordering" and
"receiving".

2. A simple test for the filename method is added

To test:
 1) prove t/db_dependent/Koha/Edifact/Order.t

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27708: Unify two item object creation blocks to be stored as hash
Petro Vashchuk [Wed, 3 Mar 2021 12:34:52 +0000 (14:34 +0200)]
Bug 27708: Unify two item object creation blocks to be stored as hash

Previously for existing item data was stored as an object reference and
then treated as one, but for not yet existing item data was stored as
keys in hash reference in the same variable and later it was treated
like an object, hence why it crashed with "no method".
This patch unifies that variable in both cases filled as hash and
treated as such.

To reproduce:
    1) Go to "Administration->System preferences" and change
"AcqCreateItem" to "receiving an order."
    2) Now, go to "Acquisitions" and create a new Vendor,
or use an existing one.
    3) Next, go to "Administration->EDI Account" and add EDI account
(pick that Vendor that you created recently, or the one that you will
use for this test).
    4) Also in "Administration->Library EANs" add EAN if you didn't
have one previously.
    5) Go back to "Acquisitions" and add a new basket to your Vendor
that you will use for this test.
    6) Press "Create EDIFACT order" button. It should throw
"Can't call method "homebranch" on unblessed reference..."
software error.
    7) Apply the patch.
    8) Reload the page that threw software error previously
(or repeat steps 5, 6 if you need another basket),
it should go through now.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28768: Fix borrowernumber from opac-readingrecord.tt
Jonathan Druart [Fri, 5 Nov 2021 08:30:31 +0000 (09:30 +0100)]
Bug 28768: Fix borrowernumber from opac-readingrecord.tt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28768: (QA follow-up) Remove unused variable
Nick Clemens [Fri, 30 Jul 2021 12:12:17 +0000 (12:12 +0000)]
Bug 28768: (QA follow-up) Remove unused variable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28768: remove unnessesary template variable
Lucas Gass [Tue, 27 Jul 2021 18:08:12 +0000 (18:08 +0000)]
Bug 28768: remove unnessesary template variable

To test:
1. Add some news that should display on opac-readingrecord.pl. For example: opacheader, OpacCustomSearch, opaccredits
2. Go to opac-readingrecord.pl, the news doesn't display
3. Apply patch, restart_all
4. Go to opac-readingrecord.pl, the news displays
5. Turn on 'opacreadinghistory' and test to make sure it still works

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoDBIC schema changes
Kyle Hall [Thu, 11 Nov 2021 12:24:54 +0000 (07:24 -0500)]
DBIC schema changes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoDBRev 21.05.05.004
Kyle Hall [Thu, 11 Nov 2021 12:16:34 +0000 (07:16 -0500)]
DBRev 21.05.05.004

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29386: Extend background_jobs.data to LONGTEXT
Jonathan Druart [Thu, 4 Nov 2021 09:44:28 +0000 (10:44 +0100)]
Bug 29386: Extend background_jobs.data to LONGTEXT

TEXT is too small, we must extend it to allow bigger jobs.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27173: Add tests
Marcel de Rooy [Tue, 28 Sep 2021 13:39:58 +0000 (13:39 +0000)]
Bug 27173: Add tests

Test plan:
Run t/db_dependent/Koha/Plugins/authority_hooks.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27173: Add plugin hooks for authority record changes
Marcel de Rooy [Tue, 8 Dec 2020 14:54:00 +0000 (15:54 +0100)]
Bug 27173: Add plugin hooks for authority record changes

2021-09-28 Updated version

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28474: Pass process_message_queue.pl params to before_send_messages plugin hooks
Kyle M Hall [Thu, 27 May 2021 13:53:01 +0000 (09:53 -0400)]
Bug 28474: Pass process_message_queue.pl params to before_send_messages plugin hooks

It would be useful to send most of the process_message_queue.pl script parameters to any plugin before_send_messages hooks. For example, the Twilio Voice plugin uses before_send_messages to send phone messages, but if the script is called with "-t email", it doesn't know and will make phone calls! If that info were passed in, the plugin could be made aware of it and only make calls if no "-t" or a "-t phone" were set in the parameters.

Test Plan:
1) Apply this patch
2) Install Kitchen Sink plugin v2.2.0 or later
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases/download/v2.2.0/dev-koha-plugin-kitchen-sink-2.2.0.kpz
3) Run misc/cronjobs/process_message_queue.pl with any or all non-email
   related paramters
4) Note the plugin output shows the parameters were passed to the plugin

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28973: Improve Koha::Patron::can_see_patron_infos efficiency
Kyle M Hall [Wed, 8 Sep 2021 12:31:47 +0000 (08:31 -0400)]
Bug 28973: Improve Koha::Patron::can_see_patron_infos efficiency

The method can_see_patron_infos looks up a row in the branches table by branchcode just to get the branchcode it already has. This seems inefficient.

Test Plan:
1) Apply this patch
2) No changes should be noted

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28365: (Bug 19873 follow-up) Make it possible to search on value 0
Fridolin Somers [Mon, 17 May 2021 14:20:41 +0000 (16:20 +0200)]
Bug 28365: (Bug 19873 follow-up) Make it possible to search on value 0

Bug 19873 fixed search with value 0.
It works in first page but not in other pages.

This patch fixes query_cgi var.

Test plan:
  - create a st-numeric index in zebra conf related to
    a numeric field
    i.e:
    yourindex 1=yourindex 4=109
  - fill a field with 0 in several biblio records,
  - reindex your biblios,
  - search yourindex=0 and go to second page of results,
  - should not work,
  - apply this patch,
  - test again,
  - should work

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28365: Add unit test
Fridolin Somers [Mon, 17 May 2021 14:15:19 +0000 (16:15 +0200)]
Bug 28365: Add unit test

Run prove t/db_dependent/Search.t

Without fix you get error :
    #   Failed test 'buildQuery should keep 0 value in query_cgi'
    #   at t/db_dependent/Search.t line 670.
    #          got: 'idx=su%2Cphr'
    #     expected: 'idx=su%2Cphr&q=0'

This patch also adds a test for query_desc in case it is broken in the
future.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28729: Additions to POD
Martin Renvoize [Fri, 29 Oct 2021 12:22:59 +0000 (13:22 +0100)]
Bug 28729: Additions to POD

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28729: Unit tests
Martin Renvoize [Tue, 19 Oct 2021 15:57:10 +0000 (16:57 +0100)]
Bug 28729: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28729: Make Koha::Email->send_or_die handle returnpath
Martin Renvoize [Tue, 19 Oct 2021 15:57:25 +0000 (16:57 +0100)]
Bug 28729: Make Koha::Email->send_or_die handle returnpath

Koha used to rely on Mail::Sendmail for sending emails. As an SMTP
client, the library would extract the from address from the Sender
header to pass along in the MAIL FROM: field of the SMTP protocol [1].

This was overlooked when we moved to Email::Stuffer/Email::Simple and
there's a different behavior as it expects the envelope to be passed and
falls back to extracting the 'From' header when said envelope is not
found [2].

This patchset re-introduces the behavior from Mail::Sendmail by
overriding the send_or_die method locally (in Koha::Email) and doing the
right thing.

Unless an explicit {from} parameter is passed, it extracts the MAIL FROM
envelope from the Sender header, as Mail::Sendmail did, and calls
$self->SUPER::send_or_die with the right parameters.

To test:
1. Apply the unit tests
2. Run:
   $ kshell
   k$ prove t/Koha/Email.t
   => FAIL: Sender is not handled correctly!
3. Apply this patch
4. Repeat 2
   => SUCCESS: Tests pass!
   The from parameter is correct!
   No Sender header sent!
5. Sign off :-D

[1] https://metacpan.org/dist/Mail-Sendmail/source/lib/Mail/Sendmail.pm#L284
[2] https://metacpan.org/pod/Email::Sender::Manual::QuickStart#envelope-information

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
AMENDED (SHORTENED)
-        my @headers = $self->email->header_str_pairs;
-        foreach my $pair ( pairs @headers ) {
-            my ( $header, $value ) = @$pair;
-            $args->{from} = $value if $header eq 'Sender';
-        }
-
-        # Remove the Sender header
-        $self->email->header_str_set('Sender');
+        $args->{from} = $self->email->header_str('Sender');
+        $self->email->header_str_set('Sender'); # remove Sender header

Tested with same results (scrambled domains):
From: noreply@mydevserver.com
Cc: marcel@email.nl
To: test@somewhere.nl
Reply-To: bieb@mydevserver.com
Return-Path: postmaster@mydevserver.com

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28904: Fix typo and display
Martin Renvoize [Mon, 1 Nov 2021 09:52:26 +0000 (09:52 +0000)]
Bug 28904: Fix typo and display

Fix typo in template: Newletter => Newsletter
Fix latest newsletter editor definition.. it's a has not an array.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28904: Update team list to include newsletter editors
Martin Renvoize [Wed, 27 Oct 2021 14:37:07 +0000 (15:37 +0100)]
Bug 28904: Update team list to include newsletter editors

It seems we stopped recording the newsletter editor as part of the team
for a while :(.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28904: Add newsletter editor to about page display
Martin Renvoize [Wed, 27 Oct 2021 14:27:45 +0000 (15:27 +0100)]
Bug 28904: Add newsletter editor to about page display

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29329: Remove stray character in opac-detail.tt
Lucas Gass [Tue, 26 Oct 2021 19:52:24 +0000 (19:52 +0000)]
Bug 29329: Remove stray character in opac-detail.tt

1. Have  OpacBrowseResults on.
2. Make search with many results.
3. Go to the record detail page
4. Click 'Browse results'
5. At the bottom of the container notice the stray "s".
6. apply patch
7. Try again, the "s" is gone!

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27884: Add tests
David Gustafsson [Wed, 15 Sep 2021 13:32:35 +0000 (15:32 +0200)]
Bug 27884: Add tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27884: Add html support for report mails
David Gustafsson [Thu, 4 Mar 2021 16:54:22 +0000 (17:54 +0100)]
Bug 27884: Add html support for report mails

To test:
1) Create a new notice, for example with Koha module "Patrons",
   name/code TEST and message body "<strong>testing<strong>".
2) Create a new sql report, the query could be someting like:
   SELECT "<number>" as `borrowernumber`, "to@example.com", as `email`, "from@example.com" as `from`;
   where "<number>" is a valid borrowernumber.
3) Run patron_emailer.pl --report=<id> --notice=TEST --module=members -commit
   where <id> is the report id.
4) Check the message_queue table that the content_type column has been
   set to text/html; charset="UTF-8".
5) Ideally process the message queue and veriy that the sent email is displayed
   as rendered html.
6) Run tests in t/db_dependent/Reports/Guided.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 25459: Makes barcode position respect units in patron cards layout
Maryse Simard [Mon, 11 May 2020 18:20:42 +0000 (14:20 -0400)]
Bug 25459: Makes barcode position respect units in patron cards layout

When using any unit besides postscript points, barcode positionning
doesn't work correctly. There is an error in the calculation: the unit
factor must be applied to the individual card part only and not to the
full page position.

This patch moves the unit part of the calculation to the right place.

To test :
1. Create a working patron card setup, using postscript points:
    card template, layout and card batch. Use barcode and at least
    one other element (text or images) in the layout.
    => Some tips for testing:
        - activate guides for the layout
        - use a template and a batch containing more than one card; the
        displacement will be different for each card and depend on the
        barcode position relative to the bottom left of the entire page.
2. Change units from postscript points to any other unit.
    => At least for the layout, but changing it in the template will
    scale the page as well.
4. Export the card batch.
3. Note the guides are scaled to fit the new unit and the lower left
corner of text and images are still correctly placed relative to the
guides, but the barcode is not.
    => In some cases, the barcode even seem to not print at all since
    it's new coordinates are out of screen.
4. Apply patch.
5. Generate the batch again.
6. Note the barcode now appears exactly where it should.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29352: Runtime parameter labels should not be said to be optional
Owen [Thu, 28 Oct 2021 14:46:00 +0000 (14:46 +0000)]
Bug 29352: Runtime parameter labels should not be said to be optional

This patch alters the form shown when using the "Insert runtime
parameter" button in SQL reports. It makes the label field required and
removes "optional" from the field hint.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select "Authorized
   value."
 - Clear the "parameter label" field and click "Insert parameter."
 - The form should display an error asking you to fill in the label
   field.
 - Test that the category field is also required.
 - Close the modal and select a different runtime parameter.
 - Test again that the label field is required.
 - Test that the form submits correctly when the label field is
   populated.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29328: Add missing list parameter to reports parameter menu
Owen [Thu, 28 Oct 2021 15:45:21 +0000 (15:45 +0000)]
Bug 29328: Add missing list parameter to reports parameter menu

This patch adds an option to insert "list" as a runtime parameter in SQL
reports (As added by Bug 27380).

To test, apply the patch and go to Reports -> Create from SQL.

- Click the "Insert runtime parameter" button and select
  "List."
- Customize the parameter label if you wish and click "Insert
  parameter."
- The parameter should be inserted like this:

  <<List of values|list>>

- Use it to create a valid SQL report, for example:

  SELECT * FROM borrowers WHERE categorycode IN  <<List of values|list>>
  LIMIT 10

- Confirm that upon running the report you are shown a textarea. Enter
  two or more values in the textarea, each on a separate line.
- Confirm that the report runs correctly. The SQL above would show you
  this when you click "Show SQL code":

  SELECT * FROM borrowers WHERE categorycode IN  ('A','S')  LIMIT 10

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28901: Compiled CSS
Kyle Hall [Fri, 5 Nov 2021 14:46:27 +0000 (10:46 -0400)]
Bug 28901: Compiled CSS

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