]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 27726: DBIC schema changes
Jonathan Druart [Mon, 12 Apr 2021 13:27:36 +0000 (15:27 +0200)]
Bug 27726: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a10d45ea18e94c532614b5480fdd8ab8897a2f60)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27726: DBRev 20.12.00.029
Jonathan Druart [Mon, 12 Apr 2021 13:25:56 +0000 (13:25 +0000)]
Bug 27726: DBRev 20.12.00.029

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 611d3aa4836c2810159937c3bc32f4228a9359e5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27726: Increase 'content' field size
Martin Renvoize [Thu, 25 Mar 2021 14:29:06 +0000 (14:29 +0000)]
Bug 27726: Increase 'content' field size

This alternate patch increases the field size from a 255 character
varchar to a 65535 character text field. This allows for more detailed
problem reports to be submitted.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c854a87d221a92051411d822121398f2440ae1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28094: Deal with encoding for overriden sysprefs
Jonathan Druart [Tue, 6 Apr 2021 14:26:23 +0000 (16:26 +0200)]
Bug 28094: Deal with encoding for overriden sysprefs

The string we retrieved is UTF-8 encoded, to prevent encoding issue we
must decode it first.

Test plan:
Easily testable with LibraryName:
1. edit /etc/apache2/sites-available/kohadev.conf
2. Add
  RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Library of ❤️"
3. restart_all
4. Hit the mainpage and look at the source (or title) and confirm that
the string is displayed correcty

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c32d46b854a73e636b1568eab758868ea9d74a13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28097: Mock finesModes to disable recalculation
Martin Renvoize [Wed, 7 Apr 2021 11:10:38 +0000 (12:10 +0100)]
Bug 28097: Mock finesModes to disable recalculation

Since bug 8338 the recalcuated zero amount fine is subsequently removed
in _FixOverduesOnReturn which causes this test to fail if finesMode is
'production' and 'CalculateFinesOnReturn' is enabled.

Perhaps we should be 'VOID'ing fines rather than completely deleting
them, but that's a question for another day.

Test plan
1/ Enable finesMode in the staff client
2/ Run the test and watch it fail
3/ Apply the patch
4/ Run the test and watch it pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f3e81738c83f6f2bae869f056ba934fc45315c1f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26970: Add row highlight on drag in Elasticsearch mapping template
Fridolin Somers [Mon, 9 Nov 2020 08:36:28 +0000 (09:36 +0100)]
Bug 26970: Add row highlight on drag in Elasticsearch mapping template

In Elasticsearch mapping tables :
In order to better see which row is currently in drag-an-drop,
add an highlight color like in circulation and fine rules when editing a row.

Test plan :
1) Go to Administration > Search engine configuration (Elasticsearch)
2) In each table : biblio, authorities, facets
3) Clik on a row to start a drag => See row turning orange
4) Release to drop => See row turning back to original color

https://bugs.koha-community.org/show_bug.cgi?id=26970
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f470bee2e5467b19dd9cea7ef09466fd578248a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26459: (follow-up) Clarify language and remove duplicated code
Nick Clemens [Mon, 29 Mar 2021 18:51:59 +0000 (18:51 +0000)]
Bug 26459: (follow-up) Clarify language and remove duplicated code

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cc587182632030c25eccbf771c765a8f301f2eb9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26459: Add hold-mode option to sip_cli_emulator
Nick Clemens [Mon, 14 Sep 2020 17:02:20 +0000 (17:02 +0000)]
Bug 26459: Add hold-mode option to sip_cli_emulator

To test:
1 - Apply patch
2 - Restart all
3 - Place an item level hold for a patron via the staff client
4 - Cancel the hold using the sip_cli_emulator with hold-mode: -
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 --patron {cardnumber} --item {BARCODE}  -m hold -l CPL --hold-mode -
5 - Run the sip_cli_emulator with no params
6 - Verify help text is understandable

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>
(cherry picked from commit 9ff8bb69e1e91596dec7b21cb75aeaaa04c6b097)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28046: Add "Additional fields" link on acquisition navigation menu
Owen Leonard [Mon, 29 Mar 2021 11:35:02 +0000 (11:35 +0000)]
Bug 28046: Add "Additional fields" link on acquisition navigation menu

This patch adds a link to the "Additional fields" page in Administration
to the sidebar menu shown on Acquisitions pages.

To test, apply the patch and go to Acquisitions.

- In the sidebar menu you should see a "Manage order basket fields"
  link.
- The link should take you directly to the "Additional fields for
  'aqbasket'" page.

Signed-off-by: Séverine QUEUNE <severine.queune@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b258a0684473da3f04c3b0835c821de3a03b1ad3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28006: Restore "Additional fields" on navigation menu
Owen Leonard [Fri, 26 Mar 2021 14:01:40 +0000 (14:01 +0000)]
Bug 28006: Restore "Additional fields" on navigation menu

This patch adds a link to the "Additional fields" page in Administration
to the sidebar menu shown on Serials pages.

To test, apply the patch and go to Serials.

- In the sidebar menu you should see a "Manage subscription fields"
  link.
- The link should take you directly to the "Additional fields for
  'subscription'" page.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9fae22c77efa15ced2dc05c07cdfcfeef401cd94)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27991: Message field for OPAC problem reporting should have a maxlength set
Owen Leonard [Thu, 18 Mar 2021 17:59:15 +0000 (17:59 +0000)]
Bug 27991: Message field for OPAC problem reporting should have a maxlength set

This patch adds a maxlength attribute to the form field for entering
checkout notes in the OPAC, matching the character limit of the database
column. A note is added to show the 255 character limit.

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

 - Log in to the OPAC as a user who has checkouts.
 - On the "Your summary" page, the "Report a problem" fields should
   have a hint below them, "255 characters maximum."
 - Try entering text in one of the fields. You should not be able to
   enter more than 255 characters:

   Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
   nunc mi, fringilla in mauris quis, hendrerit feugiat mi. Sed ultrices
   mollis nulla sit amet faucibus. Sed volutpat augue risus, eu rutrum
   eros commodo eu. Proin rhoncus nisi vitae magna_

 - Test that your submission is saved correctly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8bb9cb649bf36a650d3b84c29c5c9ddd3b01caa5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27748: Encoding problem in link to OverDrive results
Magnus Enger [Tue, 23 Feb 2021 09:39:33 +0000 (10:39 +0100)]
Bug 27748: Encoding problem in link to OverDrive results

If you have OverDrive enabled and do a search for e.g. "Göteborg",
you will get a link above the regular Koha search results that
says e.g. "Found 1 results in the library's OverDrive collection".
If you follow this link, a search will be made in OverDrive, but only
for "G", because the search term is cut off at the first non-ASCII
char.

To test:
- Make sure OverDrive is enabled
- Do a search that contains a non-ASCII char, like "Göteborg"
- Click on the link "Found x results in the library's OverDrive
  collection"
- Verify the query string is cut off at the first non-ASCII char,
  and that the number of hits is different from the number given
  in the link on the previous page
- Apply the patch, restart all the things
- Repeat the search, and verify that the numbers match and that the
  query string is intact after clicking on the OverDrive link

Lookin at the code, the same problem seems to be shared between
OverDrive and RecordedBooks. I have applied the same fix to both,
but I do not have access to RecordedBooks, so I have not been able
to verify that the problem exists there and is fixed by my patch.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b9a3ac31919794e3d892ba3735a7051c411fccb1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28077: Add a colon after the 'Reason' label on edit suggestion page
Séverine QUEUNE [Fri, 2 Apr 2021 12:13:28 +0000 (14:13 +0200)]
Bug 28077: Add a colon after the 'Reason' label on edit suggestion page

This patch corrects the missing colon on the 'Edit purchase suggestion'
page.
To test :
- go to Acquistions > Suggestions
- edit a suggestion
- on 'Suggestion management' bloc, see the colon missing after the
'Reason' label
- apply patch
- refresh the page
- colon should now be displayed

Happy sign off !

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dad0a18c7a8a95c3bca7bf97d010953c5a41a0f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28044: Increase specificity of calendar tables CSS
Owen Leonard [Mon, 29 Mar 2021 10:33:13 +0000 (10:33 +0000)]
Bug 28044: Increase specificity of calendar tables CSS

This patch adds increased specificity to the CSS which should add colors
to the tables of holidays. The default DataTable CSS was overriding the
custom color-coding.

This patch also moves the calendar CSS into a separate file.

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

If necessary, add at least one of the following:
- Unique holiday
- Holiday repeating weekly
- Holiday repeating monthly
- Holiday exception

In the table listing each kind of holiday, the color of the table header
should match the colors in the "Key" section under Hints. The color
should be correct regardless of how the table is sorted.

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>
(cherry picked from commit 4df8e3ef02b4490dc813b76b853e3fb706d4a301)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24000: Some modules do not return 1
James O'Keeffe [Tue, 19 Jan 2021 03:16:45 +0000 (03:16 +0000)]
Bug 24000: Some modules do not return 1

This patch adds "1;" to the end of the following perl files:
Koha/Filter/MARC/EmbedItemsAvailability.pm
Koha/Filter/MARC/EmbedSeeFromHeadings.pm
Koha/Filter/MARC/Null.pm
Koha/Item/Search/Field.pm
Koha/SearchEngine.pm
misc/translator/VerboseWarnings.pm
t/lib/Koha/Plugin/Test.pm

This indicates the succesful execution of the initialization code.

Test plan:
Ensure that there are no other perl files that need "1;", but dont have
it.

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>
(cherry picked from commit 2b607d84140e5870a641c845d8bd3f79448bf714)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24000: Koha::Item::Search::Field does not return 1
Marcel de Rooy [Fri, 8 Nov 2019 11:06:52 +0000 (11:06 +0000)]
Bug 24000: Koha::Item::Search::Field does not return 1

Test plan:
Run t/db_dependent/Koha/Item/Search/Field.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
(cherry picked from commit 6016791fc0bc589dfe70db7e2c25cab8410c88ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27738: Fix wording
Jonathan Druart [Tue, 6 Apr 2021 12:39:32 +0000 (14:39 +0200)]
Bug 27738: Fix wording

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 41ac4254257b96ba1742cf249fdab57fa2e2b9a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code"
Phil Ringnalda [Sun, 21 Feb 2021 18:41:04 +0000 (10:41 -0800)]
Bug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code"

Current code intended to set a fallback of xxu, an unknown state in the US,
but because the preference is always defined, just sometimes unset, it
actually falls back to three spaces, an invalid value. This patch instead
uses the fallback value ||| which means no attempt to code.

Test plan:
1. Without the patch, verify that the value of the system preference
DefaultCountryField008 is empty.
2. Cataloging - New record - Default framework (if you have the Advanced
editor enabled, Settings - Switch to basic editor, this only applies to the
basic editor)
3. On tab 0, click in the text input for field 008 which fills in default
values, then click the Tag editor button at the end of the field
4. In the popup window, verify that the value for 15-17 is shown as ###
indicating three spaces
5. Apply patch, repeat the steps above, verify that the value is now |||

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d5e7d37d8a0427f50d31d922df89ba4b16e15c98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27889: Compiled CSS
Fridolin Somers [Thu, 15 Apr 2021 10:48:37 +0000 (12:48 +0200)]
Bug 27889: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27889: (follow-up) Adjust width of OpacAddMastheadLibraryPulldown
Owen Leonard [Tue, 16 Mar 2021 17:46:33 +0000 (17:46 +0000)]
Bug 27889: (follow-up) Adjust width of OpacAddMastheadLibraryPulldown

This patch adds some responsive classes to the
OpacAddMastheadLibraryPulldown container so that it will adjust better
at various browser widths.

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>
(cherry picked from commit 147b1ced1dee259c4f210d88a5ec902b549d2836)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27889: Adjust responsive width of OPAC advanced search form
Owen Leonard [Tue, 16 Mar 2021 16:00:57 +0000 (16:00 +0000)]
Bug 27889: Adjust responsive width of OPAC advanced search form

This patch tweaks the CSS for the advanced search form in the OPAC so
that it adjusts well at various browser widths, including preventing the
form from taking up the whole width of the page at higher browser
widths.

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

- In the OPAC, go to the advanced search page.
- Test the appearance of the fields in the first "Search for" section,
  confirming that everything adjusts well at all widths large and small.
- Click the "More options" button and test that configuration as well.

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>
(cherry picked from commit cd6ccd828a0578b0d1558e2d79916d2823a9a926)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27926: (QA follow-up) Switch to using data-order
Martin Renvoize [Fri, 12 Mar 2021 08:48:59 +0000 (08:48 +0000)]
Bug 27926: (QA follow-up) Switch to using data-order

This patch switches away from using the title attribute for ordering and
instead uses data-order which is supported in modern DataTables.  This
has the effect of allowing our ordering to continue to work but without
adding the unwanted tooltip on hover.

Test plan
1/ Ensure sorting is still working as expected
2/ Hover over any of the date of birth fields and note that you are not
longer faced with a tooltip.
3/ Signoff

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit af0fc2f0f0f58f8caf80ae965ecf6024f3e915e8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27926: Add 'title-string' for dates on circ-patron-results
Martin Renvoize [Thu, 11 Mar 2021 12:15:25 +0000 (12:15 +0000)]
Bug 27926: Add 'title-string' for dates on circ-patron-results

This patch adds the title string sorting for the data of birth field in
the circulation patron results table.  This has the side effect of
adding a tooltip that displays the date of birth in ISO format, so I'm
not entirely sure it's the right approach.

Test plan
1/ Set your date format preferences to British English (dd-mm-yyyy)
2/ Do a search that will yield multiple patrons via "Check out"
3/ Try sorting on date of birth and not the order is incorrect.
4/ Apply the patch
5/ Refresh the page and try sorting on date again
6/ The order should now be correct
7/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a1f5f363bc8c29f3374e4751599c420caa43ef9a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28074: Make current_search.offset an integer instead of string
Lucas Gass [Thu, 1 Apr 2021 22:51:07 +0000 (22:51 +0000)]
Bug 28074: Make current_search.offset an integer instead of string

To test:
1. Do a search with 3-4 results, go to the record and use the browse
   controls, when you get to the last record if you attempt to go to the
   'next' you'll end up on a page which says 'record not found.'
2. Do a search with exactly 10 results. Click on the first record, the
   'next' arrow is not a link, you cannot move to the next result.
3. Apply patch
4. Repeat steps 1-2 and the problems should be gone.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5787203a708429bfb746dfa16cfa6fee75a8714a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27900: (QA follow-up) Rephrase link text
Katrin Fischer [Mon, 29 Mar 2021 18:17:37 +0000 (18:17 +0000)]
Bug 27900: (QA follow-up) Rephrase link text

See discussion on IRC from today :)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8a6bb8c6cddbb5b9e7458d6c923f6818794528bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27900: (QA follow-up) Add missing filter
Katrin Fischer [Mon, 29 Mar 2021 17:53:53 +0000 (17:53 +0000)]
Bug 27900: (QA follow-up) Add missing filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6f9d888942b134458796bf9d8a389238492b915d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27900: Add a link back to the basket view if no result
Jonathan Druart [Thu, 11 Mar 2021 14:03:07 +0000 (15:03 +0100)]
Bug 27900: Add a link back to the basket view if no result

Since bug 24347 the neworderbiblio view has been removed and we now
display the usual search result.
When adding a new order from a search, if there is no result we should
let the user get back to the basket view.

Test plan:
Add to basket from an existing record
Do a search with no results and confirm that there is a new "Go to the
basket view" link

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 191184f28a5efd95994f42cafbe1e94ffff38475)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28004: Fix breadcrumbs on authorised_values.tt
Lucas Gass [Tue, 23 Mar 2021 23:08:51 +0000 (23:08 +0000)]
Bug 28004: Fix breadcrumbs on authorised_values.tt

To Test:
  - go to a category with at least one value, see the complete breadcrumb "Home › Administration › Authorized values › Authorized values for category" with link on the 3 first menus
  - create a new category / go to an empty category ; see the incomplete breadcrumb "Home › Administration › Authorized values" with link only on the 2 first menus
  - Apply patch
  - go to category with at least one value, breadcrumbs should look like Home › Administration › Authorized values › Authorized values for category CATEGORY
  - got to category with no values, breadcrumbs should look the same as category with values

Signed-off-by: Amit Gupta <amitddng135@gmail.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 62848497033c601ea928890f903acf32c72d08d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27936: Clarify AllowItemsOnHoldCheckoutSIP syspref help text
Joonas Kylmälä [Wed, 17 Mar 2021 11:27:27 +0000 (13:27 +0200)]
Bug 27936: Clarify AllowItemsOnHoldCheckoutSIP syspref help text

The waiting reserves have always been impossible to checkout via
SIP2. There was some confusion whether this is actually true but if
you check the commit "Bug 25690: Remove duplicated logic in SIP2
checkouts" (338ba1d769) and the removed code around line

  $self->screen_msg("Item is on hold for another patron.");

you will be sure that it has been impossible to checkout waiting holds.

Signed-off-by: Andrew Fuerste-Henry <andrew@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 3aee4f4eca0a7dfbcb4704416f646dfaef39da70)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28052: Do not check SYSENV values only keys in loop
Colin Campbell [Tue, 30 Mar 2021 11:13:27 +0000 (12:13 +0100)]
Bug 28052: Do not check SYSENV values only keys in loop

Loop is only interested in key values, because 'keys' is omitted
it is checking values as well. This can lead to misleading errors
being logged (e.g. key is undefined)
Extract keys only to loop array as in the other loops below this

Testing:
1 - tail /var/lib/koha/kohadev/sip-output.log
2 - in another tab use the sip cli tester:
   perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m checkin --item CHESS1
3 - Note errors:
Use of uninitialized value $key in index at /kohadevbox/koha/C4/SIP/Sip/MsgType.pm line 337, <STDIN> line 1.
Use of uninitialized value $key in index at /kohadevbox/koha/C4/SIP/Sip/MsgType.pm line 337, <STDIN> line 2.
4 - Apply patch and restart all the things
5 - Repeat 2
6 - Errors mentioned are gone

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cd40febe67b4d75e57311ff1673d0c34299b58fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27397: The description input field when defining numbering patterns is too short
Catherine Ma [Tue, 19 Jan 2021 02:26:54 +0000 (02:26 +0000)]
Bug 27397: The description input field when defining numbering patterns is too short

Test Plan:
1. go to the serials module
2. click on manage numbering patterns in the left hand navigation
3. add or edit a pattern
4. check the description field is as short as the name field, but can
take much more text
5. add patch
6. repeat steps 1-3
7. check the description field is larger than the name field (it should)

Sponsored by Catalyst IT

Works OK!

Signed-off-by: Amit Gupta <amitddng135@gmail.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 607d7f0a60d8c002dbac7ce22e7bcc128062f208)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28042: Button corrections in OAI set mappings template
Owen Leonard [Fri, 26 Mar 2021 12:05:44 +0000 (12:05 +0000)]
Bug 28042: Button corrections in OAI set mappings template

This patch makes minor markup changes in the OAI set mappings template
so that the "Add" button looks consistent with other buttons in the
table.

Also changed: Removed unnecessary inline style attributes.

To test, apply the patch and go to Administration -> OAI sets
configuration

- If necessary, create an OAI set.
- Click the "Actions" button and choose "Define mappings."
- In the table of form fields, confirm that the "Add" button is styled
  similarly to the "Delete" button.
- Confirm that the "Add" button works as expected.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0053cc6c3e5a8a5791f96fbcd61a29f92d36fc61)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28032: Button corrections in point of sale pages
Owen Leonard [Thu, 25 Mar 2021 15:08:03 +0000 (15:08 +0000)]
Bug 28032: Button corrections in point of sale pages

This patch corrects some markup inconsistencies in some templates
related to point of sale:

- Point of sale -> Library details. The "btn-xs" class has been added to
  "Record cashup" and "Cashup all" buttons.
- Administration -> Debit types and Administration -> Credit types:
  - Font Awesome icons are removed from the "save" and "cancel" controls
    in order to keep them consistent with other templates.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d156d5a9fe3b30a0e65f70a5203a8a99bc30e651)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27881: Markup error in masthead-langmenu.inc
Owen Leonard [Fri, 5 Mar 2021 15:33:02 +0000 (15:33 +0000)]
Bug 27881: Markup error in masthead-langmenu.inc

Some markup errors were introduced into the masthead-langmenu include
file by Bug 20168, presumably during the update to the dropdown menu
markup:

'<a class="dropdown-item" <a href="'

...resulting in validation errors like "Attribute <a not allowed on
element a at this point." This patch correct the errors.

To test you should have at least two languages enabled in the
OPACLanguages system preference, opaclanguagesdisplay set to "allow,"
and OpacLangSelectorMode set to "top" or "both top and footer."

- Apply the patch and view the OPAC.
- The "Languages" menu at the top of the page should look correct and
  work correctly.
- Validating the source of the page should return no errors related to
  the language menu's markup.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 367f19f6273fa26af9e653625156da0dba9dfc17)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28053: Squash warning in C4::Members
Martin Renvoize [Tue, 30 Mar 2021 11:15:22 +0000 (12:15 +0100)]
Bug 28053: Squash warning in C4::Members

This patch sets guarantess_non_issues_charges to '0' upon creation of
the variable and thus prevents 'Use of uninitialized value
$guarantees_non_issues_charges in numeric gt (>) at
/home/martin/kohaclone/C4/Members.pm line 183.' being thrown when the
patron has guaruntees without any charges.

Test plan
1. Run t/db_dependant/SIP/SIPServer.t and note the warning above is
   thrown at least once.
2. Apply the patch
3. Run the test again and note the warning has gone.

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 297dbf4a5935931cdb8ebf6b9f00f60e291699df)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27940: Fix missing email in OpacMaintenance page
Magnus Enger [Fri, 12 Mar 2021 10:28:02 +0000 (11:28 +0100)]
Bug 27940: Fix missing email in OpacMaintenance page

To reproduce:

KohaAdminEmailAddress = Some valid email address
OpacMaintenance = Show

OPAC/cgi-bin/koha/maintenance.pl shows this text:

"Koha online catalog is offline for system maintenance. We'll be back
soon! If you have any questions, please contact the site administrator."

"site administrator" is a link, but it only links to "mailto:", the
actual email address from KohaAdminEmailAddress is missing.

To test:
- Apply the patch
- Reload the maintenance page
- Click on the "site administrator" link and verify it contains the
  address from KohaAdminEmailAddress

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 df3a8d25482e10c748a52cb0a7e66ecf9b854364)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28054: Reinstate the shebang in SIPServer.pm
Colin Campbell [Tue, 30 Mar 2021 11:49:00 +0000 (12:49 +0100)]
Bug 28054: Reinstate the shebang in SIPServer.pm

Bug 26673 renoved the shebang from SIPServer.pm. This was an error
SIPServer.pm is a program not a perl module, and needs the shebang
for the OS to assign an interpreter unless the command line
calls it as an argument to perl. Restore the shebang

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 dfe3753deeddb40610a27ccc48ad71110c2bb350)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27921: Log correct timestamp for HOLD MODIFY when set waiting
Jonathan Druart [Thu, 11 Mar 2021 15:11:15 +0000 (16:11 +0100)]
Bug 27921: Log correct timestamp for HOLD MODIFY when set waiting

The HOLD MODIFY log at the end of ModReserveAffect is not using an
up-to-date $hold object.

$hold is modified at
1201         $hold->set_waiting($desk_id);
But not refreshed before logged (and so the timestamp is not logged
correctly).

Test plan:
Turn on HoldsLog
Place an item on hold
Check it in to mark it waiting

Confirm that the timestamp logged is the one from the check in, not when
you created the hold

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 cb03909af62585aa7a280cd49b2008b0e7b2cbb8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28017: (follow-up) Fix Letters.t
Tomas Cohen Arazi [Tue, 6 Apr 2021 11:16:37 +0000 (08:16 -0300)]
Bug 28017: (follow-up) Fix Letters.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 789a7a863426c7887055095ca58e09fd46f67972)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28017: Test IPs are supported
Tomas Cohen Arazi [Tue, 23 Mar 2021 15:19:48 +0000 (12:19 -0300)]
Bug 28017: Test IPs are supported

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>
(cherry picked from commit 6840e8d6fb05dd8c4915f30b925f5a229ded13c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28017: Allow non-FQDN (@localhost) addresses
Tomas Cohen Arazi [Mon, 22 Mar 2021 17:47:33 +0000 (14:47 -0300)]
Bug 28017: Allow non-FQDN (@localhost) addresses

This patch makes Koha::Email support using @localhost addresses.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> FAIL: Koha::Email doesn't support non-fqdn addresses
3. Apply this patch
4. Repeat 2
=> SUCCESS: All tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4413557b0074bc7b7fc6b2614889f23521ecb0ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28017: Regression tests
Tomas Cohen Arazi [Mon, 22 Mar 2021 17:47:11 +0000 (14:47 -0300)]
Bug 28017: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d949c4fc20882397b24cbb28fd6f20c7ecb102be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26999: (follow-up) Simplify code
Tomas Cohen Arazi [Mon, 15 Mar 2021 11:33:49 +0000 (08:33 -0300)]
Bug 26999: (follow-up) Simplify code

Doing
$ git grep pickup_locations_code

shows there's some calculated data that is not actually used anywhere.
We can get rid of it.

This patch also reuses $item_object (which is in the same loop scope) to
avoid an extra DB call.

To test:
1. Run:
   $ git grep pickup_locations_code
=> FAIL: It is only used/set as a comma separated string, inside
request.pl
2. Apply this patch
3. Repeat 1
=> SUCCESS: The unused stuff is not there anymore
4. Open the page for placing some holds
=> SUCCESS: It doesn't explode
5. Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 0fd2be61e8376ad0db0f8ecf1eacde706cec6816)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26999: Make 'Any library' translatable when placing a hold
Tomas Cohen Arazi [Mon, 15 Mar 2021 11:05:02 +0000 (08:05 -0300)]
Bug 26999: Make 'Any library' translatable when placing a hold

This patch makes the 'Any library' string translatable, by converting it
into a flag and using it accordingly on the request.tt template.

To test:
1. Have the 'Hold pickup library match' set to 'any library' on the
   circultation rules.
2. Open the page to place a hold on a biblio with some items
=> SUCCESS: The item says 'Any library' on the 'Allowed pickup
locations' column.
3. Apply this patch
4. Repeat 2
=> SUCCESS: No behavior change
=> SUCCESS: The string is on the template
5. Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 13bb39f4c670d72686dd6b76cc0757c2f07b04d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28043: Some patron clubs operations don't work from later pages of results
Owen Leonard [Fri, 26 Mar 2021 18:36:19 +0000 (18:36 +0000)]
Bug 28043: Some patron clubs operations don't work from later pages of results

This page changes the way event handlers are defined for some operations
on the patron clubs page. These changes make it possible for the
controls to work on multi-page tables of clubs.

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

- If necessary, add enough patron club templates and patron clubs that
  there are more than 10 of each.
- Click to the second page of club templates and try to delete a
  template. It should work correctly.
- Click to the second page of clubs and try to delete a club. It should
  work correctly.
- Add one or more patrons to a club (from the checkout or patron details
  page).
- Click to the second page of clubs and try the "Search to hold" menu
  item. It should redirect you to the search page.
- After entering a search, the results page should include "Place hold
  for <club>" links with each result.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 20d5a458f38ef622920f083cac97ef753cf41d95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27999: Display the description of authorized values category
Owen Leonard [Fri, 19 Mar 2021 13:00:32 +0000 (13:00 +0000)]
Bug 27999: Display the description of authorized values category

This patch corrects a parameter in the authorized values template so
that the right value is passed for displaying the description of an
authorized value category.

To test, apply the patch and go to Administration -> Authorized values.

- In the table of authorized values, click on one which has a
  description in the "Description" column.
- On the page titled "Authorized values for category XXX," you should
  see that description under the heading.
- Use the "Show category" dropdown to try some other categories.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 07bf1726e8bb0c35e60ca0a742f4edfb69f0c32b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28003: Invoice adjustments using inactive budgets do not indicate that status
Nick Clemens [Fri, 19 Mar 2021 15:02:12 +0000 (15:02 +0000)]
Bug 28003: Invoice adjustments using inactive budgets do not indicate that status

This patch affects the display of existing invoice adjustments to indicate when using an inactive budget

To recreate
1 - In acquisitions go to a vendor
2 - Click 'Receive'
3 - Create an invoice
4 - Finish receiving
5 - Go to Admin->budgets
6 - Duplicate your current budget
7 - Mark the original budget inactive
8 - View the invoice you created
9 - No indication the budget is inactive
10 - Apply patch
11 - Reload the page
12 - The fund shows '(inactive)'
13 - The dropdown to edit the funds also indicates which funds are inactive

Note that adding new adjustments does show only the active budget unless you request to see inactive.

Signed-off-by: Amit Gupta <amitddng135@gmail.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 7dcb4287e0642b87b3f66b421ea64ad712e49661)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27937: Set datepicker when date is valid
Nick Clemens [Tue, 16 Mar 2021 13:13:57 +0000 (13:13 +0000)]
Bug 27937: Set datepicker when date is valid

When validating dates in JavaScript it is acceptable to have single digit days or months e.g,:
2011-6-16

When parsing in Koha::DateUtils->dt_from_string we die on these

This patch uses JS to set the datepicker which normalizes the date as Koha expects

To test:
 1 - Add new patron
 2 - Enter birthdate as 2/11/1986
 3 - Complete required fields
 4 - Save
 5 - Get ISE
     The given date (2/11/1986) does not match the date format (us) at /kohadevbox/koha/Koha/DateUtils.pm line 175
 6 - Apply patch
 7 - Repeat 1-2
 8 - Note that when you change focus (click on another field) the date is formatted as '02/11/1986'
 9 - Save patron, success!
10 - Edit patron, try setting DOB to 2/1/1986
11 - Change focus and note date is formatted as '02/01/1986', save
12 - Repeat with other settings of system preference 'dateformat'

Signed-off-by: Donna <donna@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 27937: (QA follow-up) Fix indentation

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 08c6e629de50ba0f54cc9550d24b575cd7d820dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27928: FindDuplicate should use simple_search_compat
Nick Clemens [Thu, 11 Mar 2021 13:33:43 +0000 (13:33 +0000)]
Bug 27928: FindDuplicate should use simple_search_compat

This patch switches from calling SimpleSearch directly to using the compat
method so that Elastic is used when it is the chosen search engine

To test:
 1 - Set SearchEngine syspref to 'Zebra'
 2 - Add a suggestion with an existing title, e.g.:
   'E street shuffle'
 3 - Confirm you get a duplication warning
 4 - Change SearchEngine to ES
 5 - Repeat get same warning
 6 - sudo koha-zebra --stop
    'ps aux | grep zebra'  to confirm they are stoped
    'sudo pkill -9 zebra' if they arent;
 7 - Repeat suggestion - no duplication warning (because zebra returns nothing)
 8 - Delete the suggestion
 9 - Apply patches
10 - Restart all the things, stop zebra
11 - Repeat suggestion
12 - Successful warning from ES
13 - prove -v t/db_dependent/Search.t

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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 93a297a7a2de41df699d59107e43862518048d6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27807: (QA follow-up) Unique values only
Martin Renvoize [Tue, 2 Mar 2021 11:19:42 +0000 (11:19 +0000)]
Bug 27807: (QA follow-up) Unique values only

This patch filters the final _order_by clause such that we only have
unique data fields present and we take the first occurence of a field.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8424f402bed2e71d9080d3adabf5e3255bc79629)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27807: Add multi-column ordering support to datatables wrapper
Martin Renvoize [Tue, 2 Mar 2021 10:36:06 +0000 (10:36 +0000)]
Bug 27807: Add multi-column ordering support to datatables wrapper

This patch add mutli-column ordering support to the datatables api
wrapper.

Test plan
1/ Add a series of cities to the system with various combinations of
city and state such that you can distinguish sorting on city + state in
city ascending + state ascending, city ascending + state descending etc.
2/ Attempt to sort on the two fields in the table (Click the 'City'
heading to sort on city name, then Shift Click on 'State' to add 'state'
ordering on top.. Shift click again on state to reverse the 'state'
ordering but maintain the 'City' ordering.
3/ Confirm the various ordering comes out correctly.
4/ Signoff

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 548562ca17ae06088e84d8fe9287a9f4043ce80e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26942: Allow style and link tags in NewsEditor TinyMCE
Lucas Gass [Fri, 22 Jan 2021 22:50:51 +0000 (22:50 +0000)]
Bug 26942: Allow style and link tags in NewsEditor TinyMCE

To Test:
-Make sure the sys pref 'NewsToolEditor' is set to TinyMCE
-Go to any news item and add this line:  <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
-Save the news item
-Re-open the same news item again in TinyMCE.
-The editor has removed that line. Annoying!
-Apply patch
-Try again, the <link> should stay now

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 27fce8b0c2575021400023d9a7460adef20dadd6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27963: (bug 23463 follow-up) Fix touch_all_items.pl
Jonathan Druart [Tue, 16 Mar 2021 10:36:17 +0000 (11:36 +0100)]
Bug 27963: (bug 23463 follow-up) Fix touch_all_items.pl

This script is used to fix inconsistencies in the items table. Prior to
bug 23463, ModItem dealt with that.

We need to make some attributes as dirty to make sure the
Koha::Item->store method will fix them.

Test plan:
Be familiar with how touch_all_items is supposed to work and confirm
that the different inconsistencies are fixed.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
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 8f071b01f5c851a6b066e7084643bd6430e6e8d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28023: Fix Reply-To typo
Tomas Cohen Arazi [Tue, 23 Mar 2021 14:14:43 +0000 (11:14 -0300)]
Bug 28023: Fix Reply-To typo

This patch fixes a typo making the header useless.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> FAIL: The Reply-To header is not being set!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! the header is set!
5. Sign off :-D

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 9f79cdf9925c86856775a28bede9fec0dabfcd99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28023: Regression tests
Tomas Cohen Arazi [Tue, 23 Mar 2021 14:14:37 +0000 (11:14 -0300)]
Bug 28023: Regression tests

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>
(cherry picked from commit ad55a2b4d820d914ad398224a62633f6df1e1d8a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26705: (QA follow-up) Do not rely on latest Email::MIME
Tomas Cohen Arazi [Tue, 23 Mar 2021 19:58:04 +0000 (16:58 -0300)]
Bug 26705: (QA follow-up) Do not rely on latest Email::MIME

This patch makes the implementation use lower-level methods to deal with
headers. So the Email::MIME library in Debian 9 works.

Params are sorted for testing purposes.

To test:
1. Apply this patch
2. Run the tests
=> SUCCESS: Things pass in D9+
3. Sign off :-D

Thanks Kyle!

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>
(cherry picked from commit 539c9e5c9b04ac6e6151de839dd5e08bd603c371)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26705: (QA follow-up) Clarify test result
Martin Renvoize [Tue, 23 Mar 2021 14:26:02 +0000 (14:26 +0000)]
Bug 26705: (QA follow-up) Clarify test result

Simple output string improvement to fix the copy/paste of the previous
tests comment string.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8d7bd9a8e7a62d01e0cec5095f5641fe87dfbeb3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26705: Make Koha::Email->send_or_die handle Bcc
Tomas Cohen Arazi [Tue, 23 Mar 2021 13:57:13 +0000 (10:57 -0300)]
Bug 26705: Make Koha::Email->send_or_die handle Bcc

Koha used to rely on Mail::Sendmail for sending emails. As an SMTP
client, the library took the job of extracting Bcc headers (and removing
them) to pass them along with the recipients listed on To: and Cc: to
the SMTP protocol in the form of RCPT TO: lines. [1]

This was overlooked when we moved to Email::Stuffer/Email::Simple and
there's a different behavior, that is a design decision [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 {to} parameter is passed, it extracts the recipients
from the headers, as Mail::Sendmail does, and calls
$self->SUPER::send_or_die with the right parameters.

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

[1] https://metacpan.org/release/Mail-Sendmail/source/lib/Mail/Sendmail.pm#L331
[2] https://metacpan.org/pod/Email::Sender::Manual::QuickStart#Hey,-where's-my-Bcc-support

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ebf9c134d160ab9dfd905a0b26fe7db6ad04d093)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26705: Regression tests
Tomas Cohen Arazi [Tue, 23 Mar 2021 13:56:59 +0000 (10:56 -0300)]
Bug 26705: Regression tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 58a5a040661c150d455c5942bc56cecbb1a0e2d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25946: (QA follow-up) Add Unit tests
Martin Renvoize [Tue, 30 Mar 2021 14:47:12 +0000 (15:47 +0100)]
Bug 25946: (QA follow-up) Add Unit tests

Add a unit test for the empty relationship availability.

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 f744dfe60cea1aca2883b02c8c33c4467bc81c30)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25946: borrowerRelationship can be empty
Petro Vashchuk [Tue, 30 Mar 2021 11:42:11 +0000 (14:42 +0300)]
Bug 25946: borrowerRelationship can be empty

Do not show the empty dropdown with no options if borrowerRelationship
is disabled (empty) in the syspref.

To reproduce:
    1) Go to system preferences and disable borrowerRelationship.
    2) Create a new patron or modify the existing one.
    3) Under "Guarantor Information" click on "Search to add" button.
    After performing the search, select different patron to act as
    guarantor.
    4) Observe that there's empty dropdown for the relation type.
    5) Apply the patch.
    6) Repeat steps above.
    7) Observe that dropdown is no longer there.

Signed-off-by: Andrew Fuerste-Henry <andrew@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 8245bc6f2de7276d7e98788b115e3b983c915941)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25946: borrowerRelationship can be empty
Petro Vashchuk [Mon, 29 Mar 2021 13:59:32 +0000 (16:59 +0300)]
Bug 25946: borrowerRelationship can be empty

When borrowerRelationship is empty in system preferences, Relationship
dropdown is not required and we accept empty value.

Also fixes bug that didn't let you to pick empty value even when you
specified that it should be possible in system preferences but in the
end of the string (i.e. "|father|mother" worked,
but "father|mother|" don't).

To reproduce (borrowerRelationship can be empty):
    1) Go to system preferences and make borrowerRelationship empty.
    2) Create a new patron who is assumed to have a guarantor or modify
    the existing one.
    3) Under "Guarantor Information" click on "Search to add" button.
    After performing the search, select a user to act as guarantor. Try to save your changes.
    4) Observe that relationship field is required in order to save but
    you can't actually choose anything as it doesn't contain anything.
    5) Apply the patch.
    6) Repeat steps above.
    7) Observe that it allows you to save the form now.

To reproduce (can't choose empty value bug):
    1) Go to system preferences and set borrowerRelationship exactly
    to "father|mother|".
    2) Create a new patron who is assumed to have a guarantor or modify
    the existing one.
    3) Under "Guarantor Information" click on "Search to add" button.
    After performing the search, select a user to act as guarantor.
    4) Observe that there's no option to leave relationship field empty.
    5) Apply the patch.
    6) Repeat steps above.
    7) Observe that it has empty option that you can choose and save
    the form.

Mentored-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@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 d0cc5fa97a529d9f59562ce9969d26a6fb5ef01e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25946: borrowerRelationship can be empty
Petro Vashchuk [Mon, 29 Mar 2021 13:58:25 +0000 (16:58 +0300)]
Bug 25946: borrowerRelationship can be empty

Do not split the config using comma.

From syspref description of borrowerRelationship preference:

> Guarantors can be the following of those they guarantee:
> (input multiple choices separated by |). Leave empty to deactivate.

As it doesn't mention comma at all, I removed ',' from split.
Of course if comma is actually a viable way to split separate choices,
I can obsolete this patch and append to the syspref description that it
also can be separated by comma.

Signed-off-by: Andrew Fuerste-Henry <andrew@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 4490dfdf089c1e1eef44bfd4c71b84e7e9c8610a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26517: Add unit test
Fridolin Somers [Thu, 24 Sep 2020 07:08:43 +0000 (09:08 +0200)]
Bug 26517: Add unit test

Run prove t/db_dependent/Members.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7697cc23b2efb58547b91abcfe85e5729b90be36)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26517: Avoid deleting patrons with permission
Fridolin Somers [Wed, 23 Sep 2020 14:50:09 +0000 (16:50 +0200)]
Bug 26517: Avoid deleting patrons with permission

The patron deletion script misc/cronjobs/delete_patrons.pl uses C4::Member::GetBorrowersToExpunge() to get patrons that may be deleted.
This method filters patrons from a staff category.
I propose to also filter patrons having permission, so a staff member.
Some small libraries do not define a "staff" category and give permissions to regular patrons.

Test plan :
1) Create a patron on adult type category with expiry date in the past and permission to access staff interface
2) Without patch
3) Run delete script : ./src/misc/cronjobs/delete_patrons.pl -v --expired_before='$(date -I)'
4) You see the patron will be deleted
5) Apply patch
6) Run delete script : ./src/misc/cronjobs/delete_patrons.pl -v --expired_before='$(date -I)'
7) You dont see the patron

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c4c33e532d4abeb66bbbafe0ab75797a8e801349)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27969: Change wording on returns page
Andrew Fuerste-Henry [Tue, 16 Mar 2021 18:59:11 +0000 (18:59 +0000)]
Bug 27969: Change wording on returns page

To test:
1- go to /cgi-bin/koha/circ/returns.pl, click Checkin settings to show options
2- it says "Remember due date ..."
3- apply patch, reload
4- it says "Remember return date ..."

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ec4bb0539a2b2479130159408c33ccfb82292888)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoUpdate release notes for 20.11.04 release v20.11.04
Fridolin Somers [Wed, 24 Mar 2021 11:30:18 +0000 (12:30 +0100)]
Update release notes for 20.11.04 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoFix translations for Koha 20.11.04
Fridolin Somers [Tue, 23 Feb 2021 15:29:01 +0000 (16:29 +0100)]
Fix translations for Koha 20.11.04

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoMerge remote-tracking branch 'translate/20.11.04-translate-20210324' into 20.11.x
Fridolin Somers [Wed, 24 Mar 2021 11:03:15 +0000 (12:03 +0100)]
Merge remote-tracking branch 'translate/20.11.04-translate-20210324' into 20.11.x

3 years agoIncrement version for 20.11.04 release
Fridolin Somers [Wed, 24 Mar 2021 11:03:05 +0000 (12:03 +0100)]
Increment version for 20.11.04 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoTranslation updates for Koha 20.11.04
Koha translators [Wed, 24 Mar 2021 11:01:20 +0000 (08:01 -0300)]
Translation updates for Koha 20.11.04

3 years agoBug 27816: "Click to edit" in Point of sale is untranslatable
Owen Leonard [Mon, 15 Mar 2021 17:06:16 +0000 (17:06 +0000)]
Bug 27816: "Click to edit" in Point of sale is untranslatable

This patch adds an option to the Point of sale jEditable configuration
to explicitly set the title attribute to "Click to edit." This will
allow the string to be picked up for translation.

To test, apply the patch and test that the correct string is
translated. In this example I'm testing fr-FR:

  - Update a translation:

    > cd misc/translator
    > perl translate update fr-FR

  The "Click to edit" string should already have been translated, so
  it's not necessary to update the .po file.

  - Install the updated translation:

    > perl translate install fr-FR

In the staff interface, switch to the language you're testing and open
the point of sale page. Add some items for purchase. They should appear
in the "This sale" table. Hover your mouse over the values in the "Coût"
and "Quantité" columns. You should see the translated string, "Cliquer
pour modifier."

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 126326b8b3933cd64f8ddf34ad96fd69f3db3d0e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27933: Fix patron search result ordering
Jonathan Druart [Wed, 17 Mar 2021 09:14:43 +0000 (10:14 +0100)]
Bug 27933: Fix patron search result ordering

On bug 27715 we restrict the order by dt params for security reasons.
However in some cases the param passed is "columnname" instead of
"table.columnname".
We should make sure the table is part of the sort fieldname.

Test plan:
Do a "normal" patron search (from the patrons home page) and another
patron search (guarantor for instance).
Sort by cardnumber, date of birth, expiration date, asc, desc and
confirm it works as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1b32e66380d5d7701b3f252e8d2be1cbf1622388)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27835: DBRev 20.12.00.025
Jonathan Druart [Thu, 18 Mar 2021 14:04:47 +0000 (15:04 +0100)]
Bug 27835: DBRev 20.12.00.025

(cherry picked from commit 4e177268294ebb8a9c7430cfaca16a0724d73a6a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27835: Turn off by default
Jonathan Druart [Wed, 17 Mar 2021 09:34:16 +0000 (10:34 +0100)]
Bug 27835: Turn off by default

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 675088752afcee77ddfd3279e617f0d657f1f81d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27835: (follow-up) Update language, remove warn, add feedback
Nick Clemens [Tue, 16 Mar 2021 13:22:26 +0000 (13:22 +0000)]
Bug 27835: (follow-up) Update language, remove warn, add feedback

This patch:
 - Updates lanugage to be clearer 'ChargeFinesOnClosedDays' vs 'ChargeFinesOnCloseDay'
 - Removes a stary warn
 - Add an 'updated' counter and provides feedback in fines.pl

Test plan:
 0 - Apply patches, updatedatabase
 1 - set finesCalendar to 'ignore', ChargeFinesOnClosedDays to "Don't charge"
 2 - Checkout an item due yesterday
 3 - Ensure circ rules have a fine amount and interval set
 4 - Make today a holiday
 5 - perl misc/cronjobs/fines.pl -v
 6 - 0 updated
 7 - ChargeFinesOnClosedDays to "Charge"
 8 - perl misc/cronjobs/fines.pl -v
 9 - 1 updated
10 - set fines calendar to 'use'
11 - perl misc/cronjobs/fines.pl -v
12 - 1 updated (NOTE: This is wrong maybe, but handle on another bug)
13 - set ChargeFinesOnClosedDays to "Don't charge"
14 - perl misc/cronjobs/fines.pl -v
12 - 0 updated

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit deb2f6317a10ec202b2c45dbab663d7a61a43de2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27835: Add a syspref to control fines calculation on closed days
Jonathan Druart [Tue, 16 Mar 2021 09:16:55 +0000 (10:16 +0100)]
Bug 27835: Add a syspref to control fines calculation on closed days

Bug 27180 added a patch to not update fines on holidays if finesCalendar was set to ignore.
At least it's what it advertised, but not what it did.

It seems that we need to add a new pref to control the calculation of
fines on closed days to answer the different use cases.

Test plan:
With this patch applied you can run the fines.pl cronjob and play with
the new pref ChargeFinesOnCloseDay to generate fines on close days.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 151966d0967786ab235158b4c1a84e19788610b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27835: Add new syspref ChargeFinesOnCloseDay
Jonathan Druart [Tue, 16 Mar 2021 09:16:51 +0000 (10:16 +0100)]
Bug 27835: Add new syspref ChargeFinesOnCloseDay

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5007e24e90efeb76fe3d86a8fa832d52af30abc0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27835: Revert "Bug 27180: (follow-up) Remove unused %is_holiday"
Jonathan Druart [Tue, 16 Mar 2021 08:55:10 +0000 (09:55 +0100)]
Bug 27835: Revert "Bug 27180: (follow-up) Remove unused %is_holiday"

This reverts commit a26d529a2bc7faee3743b4cd1e603ba29411a0b9.

Revert "Bug 27180: Update fines on holidays"

This reverts commit 80e1b4e66f01a07cad9bf37625d879f649edf52a.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c4b4cbd91cc9888e9cdbdf1fe43a10c91bd157b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27366: Add controller
Tomas Cohen Arazi [Fri, 8 Jan 2021 16:16:35 +0000 (13:16 -0300)]
Bug 27366: Add controller

Add a patron holds controller for the REST api and impliment the #list
methods.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 da233f82d086ca046f00d1802d1dd8fc14666763)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27366: Unit tests
Tomas Cohen Arazi [Fri, 8 Jan 2021 16:16:19 +0000 (13:16 -0300)]
Bug 27366: Unit tests

Addd unit tests for the new patrons/{patron_id}/holds api route.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 b5c5d0cdc825b7cefbb5e3cfe240f33442dc9c06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27366: Spec changes
Tomas Cohen Arazi [Fri, 8 Jan 2021 16:15:58 +0000 (13:15 -0300)]
Bug 27366: Spec changes

Add /api/v1/patrons/{patron_id}/holds route and holds object description
to the OpenAPI specification.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 e32b2a944962286da97472ab136b2d6a782af65a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27716: Update permissions for patroncards creator
Martin Renvoize [Fri, 19 Feb 2021 10:12:32 +0000 (10:12 +0000)]
Bug 27716: Update permissions for patroncards creator

The various subpages of the label creator tool we're under the
'catalogue' permission. There is however a 'label_creator' subpermission
of tools which is more appropriate.

Test plan
1/ Setup a user with just the 'catelogue' permission (to enable logging
into the staff interface)
2/ With the patch applied you should not be able to access the following
pages (either via navigation in the UI or by typing them into the
browser address bar directly)
  - /patroncards/add_user_search.pl
  - /patroncards/edit-batch.pl
  - /patroncards/edit-layout.pl
  - /patroncards/edit-profile.pl
  - /patroncards/edit-template.pl
  - /patroncards/home.pl
  - /patroncards/image-manage.pl
  - /patroncards/manage.pl
  - /patroncards/print.pl
3/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bc5decc913b34468b1355925dc8ba260b060365c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27860: Fix password recovery
Jonathan Druart [Fri, 5 Mar 2021 09:14:08 +0000 (10:14 +0100)]
Bug 27860: Fix password recovery

Same as the previous patch but for the password recovery feature.

Test plan:
1. Do not apply the patches
2. Set KohaAdminEmailAddress to an invalid email (root@localhost for
instance)
3. Use the password recovery feature
5. Boom (that must be fixed on a separate bug report)
6. Set KohaAdminEmailAddress to a valid email (root@example.org)
7. Use again the password recovery for a different user
8. Still Boom! (because it's processing the first invalid email)
9. Apply the patches, restart_all
10. Try again the password recovery
=> The email is sent!
Notice the change in DB, the first email is still there with status
"pending" and second email is sent!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 510958d90b6b99bd808ecffa8ded1fc85771f1f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27860: Fix self-registration if messages with incorrect email are inqueued
Jonathan Druart [Fri, 5 Mar 2021 09:04:14 +0000 (10:04 +0100)]
Bug 27860: Fix self-registration if messages with incorrect email are inqueued

If the pref KohaAdminEmailAddress was not set correctly (invalid email)
and has been used to generate message, the message_queue table can contain
some messages that are not sent (pending) and will be processed each
time a new self-reg is done.
The PatronSelfRegistrationVerifyByEmail feature must send only the
notice we just generated, not the whole pending queue.

Test plan:
1. Do not apply the patches
2. Set KohaAdminEmailAddress to an invalid email (root@localhost for
instance)
3. Turn on PatronSelfRegistrationVerifyByEmail
4. Self-reg a patron
5. Boom (that must be fixed on a separate bug report)
6. Set KohaAdminEmailAddress to a valid email (root@example.org)
7. Self-reg a patron
8. Still Boom! (because it's processing the first invalid email)
9. Apply the patches, restart_all
10. Self-reg a patron
=> The email is sent!
Notice the change in DB, the first email is still there with status
"pending" and second email is sent!

QA: at step 10. TODO first email must be 'failed' (highlight in tests)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 87eaaf302c5f228598bdbb055bd6bcdccf9883d9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27860: Add message_id param to SendQueuedMessages
Jonathan Druart [Fri, 5 Mar 2021 09:01:30 +0000 (10:01 +0100)]
Bug 27860: Add message_id param to SendQueuedMessages

We could use C4::Letter::GetMessage, but the query in
_get_unsent_messages join on borrowers and return the branchcode.
To prevent any regressions it's preferable to not modify
SendQueuedMessages.

Ideally we obviously need a Koha methods to have better and clean code..

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2bad23f1c1dbd74b81fefb1939b2bcefd914b3d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27597: Remove leading colon in ES query
Jonathan Druart [Wed, 3 Feb 2021 09:33:35 +0000 (10:33 +0100)]
Bug 27597: Remove leading colon in ES query

If we are searching on kw there is a leading colon at the beginning of
the generated query:
  kw:foo becomes :foo

Note that it only happens when there is no other terms before.

Test plan:
0. Don't apply the patch
1. Search for kw:foo
2. Notice the error
  Error: Unable to perform your search. Please try again.
and the logs say
  Failed to parse query [(:foo*)]
3. Apply the patch
4. Repeat the search and notice that you know get:
   "12 result(s) found for 'kw:foo'."

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1ff9160a620519e1626044ff7d9205a0015ac1e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27737: (follow-up) Minimal CSS changes to avoid regressions
Phil Ringnalda [Tue, 9 Mar 2021 03:33:06 +0000 (19:33 -0800)]
Bug 27737: (follow-up) Minimal CSS changes to avoid regressions

To keep the specificity of the rules we want to have apply to both the
biblio editor and also the authorities editor, we need to add the ID for
the authorities editor, rather than remove the ID for the biblio editor.

Also, the removal of the selectors for #authoritiestabs descendents was
regressing the display of authority record details, which is where that
plural authoritiestabs element lives.

Test plan:

1.  With neither patch from this bug applied, Cataloging - New record -
    Default framework.
2.  Shrink and widen your browser window, noticing how the input fields
    flex to remain the full width, keeping the controls to duplicate and
    delete a subfield out directly to the right of the input.
3.  Authorities - search for Perl (or any term that will match a record),
    click the linked authority term to open the Authority detail display
4.  Note how the field number, field description, and subfield descriptions
    are all different colors, and subfield codes are on the same line as
    the subfield contents.
5.  Apply both patches from this bug.
6.  Cataloging - New record - Default framework
7.  Verify that the input fields still behave the same as you widen and
    shrink your browser window
8.  Authorities - New authority - Chronological Term
9.  Verify that the input fields now behave like the ones in the biblio
    editor, shrinking and widening to fill the width of the page, keeping
    the controls to duplicate and delete subfields immediately to the
    right of the field
10. Authorities - search for Perl, click the linked authority term to open
    the Authority detail display
11. Verify that the tag number, field description and subfield descriptions
    are still properly colored and subfield codes are still on the same
    line as the subfield contents.

Signed-off-by: David Nind <david@davidnind.com>
Trivial fixup for a copy-paste failure, missed the y on
subfield_loop_mandator

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 41d33deba40622ca132560d6827157fb11322e79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27737: Tag editor for authority lookup broken in authority editor
Owen Leonard [Tue, 2 Mar 2021 17:44:35 +0000 (17:44 +0000)]
Bug 27737: Tag editor for authority lookup broken in authority editor

This patch changes the markup structure for the authorities
editor so that it better matches that of the basic bibliographic
record editor. This allows the authority-linking JavaScript to
correctly target fields on both pages.

To test, apply the patch and go to Authorities in the staff client.

 - Create or edit an authority record.
 - Switch to tab 5 and if necessary click one of the tag names (e.g.
   "SEE ALSO FROM TRACING--PERSONAL NAME") to expand the subfields.
 - Click the "..." plugin link next to subfield a ("Personal name" in
   this example).
 - In the popup window, search for an authority record.
 - Click "Choose" next to one of the results.
 - The popup window should close and the authority editor should contain
   data from the record you chose, including a value in $9 and $a.
 - Test with various records to confirm that data in other fields is
   copied correctly, for instanct $d, dates associated with a name, $t
   title of a work.
 - Test other JavaScript-driven interactions in the editor:
   - Duplicate repeatable tag
   - Remove repeatable tag
   - Empty tag
   - Reorder sortable tags (e.g. multiple 500 tags)
   - Reorder sortable subfields
   - Duplicate repeatable subfield
   - Remove repeatable subfield
   - Empty repeatable subfield

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a2ef47a49860902e7ff441ab3343475958c80efb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27930: [stables] Move _escape_* from acqui/parcel.tt to js/staff-global.js
Martin Renvoize [Thu, 11 Mar 2021 14:22:54 +0000 (14:22 +0000)]
Bug 27930: [stables] Move _escape_* from acqui/parcel.tt to js/staff-global.js

This patch moves the _escape_str and _escape_price functions into the
staff-global.js include

Test plan
1/ The acquisitions parcel page should look the same before and after
the patch.
2/ Signoff

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Note: For stable branch the functions didn't exist.

3 years agoBug 8426: Diacritics not being mapped for searching
Kyle M Hall [Thu, 12 Jul 2012 11:07:07 +0000 (07:07 -0400)]
Bug 8426: Diacritics not being mapped for searching

Add mappings for ︡a to a, and for t︠ to t.

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>
(cherry picked from commit 9140ea69150520f7a9b4fcc453020af91bd6ed38)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27813: Restore default order on suggestion list view
Jonathan Druart [Tue, 2 Mar 2021 11:22:27 +0000 (12:22 +0100)]
Bug 27813: Restore default order on suggestion list view

Prior to 20.05, suggestions on /cgi-bin/koha/suggestion/suggestion.pl sorted by
suggesteddate by default. On 20.05 and later, they're sorting by title instead.
We should go back to the previous behavior.

Test plan:
Create some suggestions
Edit the suggestions.suggesteddate in the DB
List the suggestions and confirm that there are sorted by oldest first

Signed-off-by: Andrew Fuerste-Henry <andrew@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 25f391b00df34f452e341039abf448c780df1d7d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27815: "Remove" in point of sale untranslatable
Owen Leonard [Mon, 1 Mar 2021 12:24:41 +0000 (12:24 +0000)]
Bug 27815: "Remove" in point of sale untranslatable

This patch modifies the Point of Sale template so that the "Remove"
button can be translated. The string in the JavaScript block wasn't
wrapped in the correct function.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

- Update a translation:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  the template: e.g. misc/translator/po/fr-FR-staff-prog.po
- Locate strings pulled from pos/pay.tt for translation to confirm the
  update, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt:189
  #, c-format
  msgid "Remove"
  msgstr "Enlever"

- Install the updated translation:

  > perl translate install fr-FR

- In the staff client, go to Point of Sale.
- Switch to the French translation and click the "Ajouter" button next
  to one of the items for purchase.
- In the "This sale" table, the item you added should have a
  corresponding "Enlever" button.

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>
(cherry picked from commit 0381d9e52407fa7172ac18a85e0db8e62edc6c90)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26199: Include LDR for match check/match point
David Cook [Thu, 17 Dec 2020 04:05:39 +0000 (04:05 +0000)]
Bug 26199: Include LDR for match check/match point

This patch adds the ability to specify the LDR instead of a numeric tag
when defining match checks in record matching rules. This is particularly
useful for checking LDR6 "Type of record" when importing records.

Test plan:
0. prove t/Matcher.t

1. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=1
2. Click "Save" and choose "MARCXML"
3. Copy bib-1.marcxml to bib-1-mod.marcxml
4. Change "01344cam a22003014i 4500" to "01344cmm a22003014i 4500"
5. Go to http://localhost:8081/cgi-bin/koha/admin/matching-rules.pl?op=edit_matching_rule&matcher_id=3
6. Click "Add match check"
7. Fill out the match checks:
Source:
Tag: LDR
Offset: 6
Length: 1
Target:
Tag: LDR
Offset: 6
Length: 1

8. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
9. Choose "bib-1-mod.marcxml" and click "Upload file"
10. Choose "KohaBiblio (999$c)" for "Record matching rule"
11. Click "Stage for import"
12. Click "Manage staged records" on resulting page
13. Note the "Match type" says "No match"

14. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
15. Choose "bib-1.marcxml" and click "Upload file"
16. Choose "KohaBiblio (999$c)" for "Record matching rule"
17. Click "Stage for import"
18. Click "Manage staged records" on resulting page
19. Note the Match type says "Match found"

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit baa2260503356af15ad4df835a24abf084ec41a2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27820: add all missing use in misc/cronjobs/plugins_nightly.pl
Fridolin Somers [Mon, 1 Mar 2021 10:40:56 +0000 (11:40 +0100)]
Bug 27820: add all missing use in misc/cronjobs/plugins_nightly.pl

Koha::Plugins and C4::Context where missing.
Try::Tiny was missing for try/catch.

Test plan :
1) Use a plugin using hook 'cronjob_nightly'
2) Run script : misc/cronjobs/plugins_nightly.pl

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 5a2dfc5ea36d45d7af9c0e4102f92a601e192b46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27820: fix missing import in plugins_nightly.pl
Samir Shah [Mon, 1 Mar 2021 07:49:03 +0000 (10:49 +0300)]
Bug 27820: fix missing import in plugins_nightly.pl

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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 3267648dedd04085f0adaa0bd70979cd839e7344)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24359: (QA follow-up) Fix tests
Tomas Cohen Arazi [Mon, 1 Mar 2021 18:41:21 +0000 (15:41 -0300)]
Bug 24359: (QA follow-up) Fix tests

This patch fixes a rebase issue, and also makes sure the tests do not
rely on any prior data. The query on tmp_holdsqueue is done against the
actual reserve_id so no need to delete all the data from the
tmp_holdsqueue and hold_fill_targets table.

I also noticed the previous subtest wasn't run inside a transaction even
if the code was designed to not depend on prior data as well.

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

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>
(cherry picked from commit ac7d1124ab0db1a532496b2b3f5c0c75a781a20f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24359: Remove hold from holds queue when captured
Agustin Moyano [Wed, 28 Oct 2020 13:48:18 +0000 (10:48 -0300)]
Bug 24359: Remove hold from holds queue when captured

This patch removes a hold from holds queue when captured by check in.

To test:

1. check out an item from a book with multiple items for patron_1
2. place a biblio level hold for patron_2
3. perl misc/cronjobs/holds/build_holds_queue.pl
CHECK => holds queue shows the placed hold
4. check in the item from step 1 and confirm hold for patron_2
SUCCESS => hold for patron_2 is no longer in holds queue
5. prove t/db_dependent/HoldsQueue.t

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>
(cherry picked from commit 445ca21ff06ca2e4f3a59d0a70c8bce6533168db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24359: Add test
Agustin Moyano [Wed, 28 Oct 2020 13:48:09 +0000 (10:48 -0300)]
Bug 24359: Add test

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>
(cherry picked from commit cdc668764cefde4924291b8d51bd97ec8a4157d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26964: Newly created macros should be selected in the Advanced editor
Phil Ringnalda [Fri, 26 Feb 2021 21:39:37 +0000 (13:39 -0800)]
Bug 26964: Newly created macros should be selected in the Advanced editor

The problem is that the newly created macro isn't selected, because the
return values from the call to create it are accidentally thrown away. There
isn't actually any option to save, just a timeout that automatically saves,
but you can tell you are in this broken state because the Delete macro
button is disabled.

Test plan:

1. Prior to applying the patch, Administration - set the preference
   EnableAdvancedCatalogingEditor to Enable
2. Cataloging - Advanced editor - Macros... - New macro...
3. Give it a name, click OK, notice that the Delete macro button is disabled
4. Apply patch, shift+reload
5. Macros... - New macro...
6. Give it a name, click OK, notice that the Delete macro button is enabled
7. Type something in the editor, delete 999 will do nicely, wait half a
   second to see Saved appear at the far right, close the macro popup
8. Macros..., click the name of your macro, verify it really was saved

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>
(cherry picked from commit f17d3dd62cfcbe7de3b74573b48e09e42e6b0eab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>