koha.git
2 years agoBug 24224: Convert OpacNavBottom system preference to additional content
Owen [Fri, 5 Nov 2021 10:45:45 +0000 (10:45 +0000)]
Bug 24224: Convert OpacNavBottom system preference to additional content

This patch builds on Bug 22318 to move the OpacNavBottom system
preference into the "Additional contents" system, making it possible to
have language- and library-specific content.

To test you should have some content in the OpacNavBottom system
preference. To make testing easier it's also a good idea to have content
in the OpacNav preference.

- Apply the patch and run the database update process.
- In the staff client, go to Tools -> HTML customizations and verify
  that the content from OpacNavBottom is now stored there. When you
  edit the entry you should see content from the OpacNavBottom system
  preference under the "default" tab.
  - The publication date for the entry should be today's date.
  - Confirm that the previous contents of OpacNavBottom were added
    correctly.
- Go to Administration -> System preferences -> OPAC and verify that
  the OpacNavBottom preference has been removed.
- Update and reinstall active translations (for instance fr-FR):
  - cd misc/translator/
  - perl translate update fr-FR
  - perl translate install fr-FR
- View the OPAC and confirm that the contents of the OpacNavBottom
  system preference displays in the left-hand sidebar.
- Test as many pages as possible to confirm that wherever the
  OpacNavBottom content is displayed, OpacNavBottom is also displayed.
- Test also using the updated translation.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24223: DBRev 21.06.00.045
Jonathan Druart [Mon, 8 Nov 2021 10:31:10 +0000 (11:31 +0100)]
Bug 24223: DBRev 21.06.00.045

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24223: (QA follow-up) Do not copy to other languages
Marcel de Rooy [Tue, 19 Oct 2021 11:36:11 +0000 (11:36 +0000)]
Bug 24223: (QA follow-up) Do not copy to other languages

By majority on Bugzilla, we dont want to have the existing text in all
translatable languages.

Note: Removing the news_123 as code here, switching to OpacNav now.
Another report should handle/improve the use of code, assuming that
it is meant to provide some form of grouping. There is now confusion
between the fields code and location.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24223: Get languages for OPAC
Jonathan Druart [Wed, 13 Oct 2021 08:36:51 +0000 (10:36 +0200)]
Bug 24223: Get languages for OPAC

There were 2 warnings

Use of uninitialized value $interface in concatenation (.) or string at /kohadevbox/koha/C4/Languages.pm line 121.
Use of uninitialized value $theme in concatenation (.) or string at /kohadevbox/koha/C4/Languages.pm line 121.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24223: (follow-up) Do not add id 'opacnav' in navigation.inc
Fridolin Somers [Sat, 25 Sep 2021 06:38:46 +0000 (20:38 -1000)]
Bug 24223: (follow-up) Do not add id 'opacnav' in navigation.inc

Id attribut will be defined by 'koha_news_block'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24223: Convert OpacNav system preference to additional content
Owen Leonard [Mon, 4 May 2020 19:33:33 +0000 (19:33 +0000)]
Bug 24223: Convert OpacNav system preference to additional content

This patch builds on Bug 22318 to move the OpacNav system
preference into the "Additional contents" system, making it possible to
have language- and library-specific content.

To test you should have some content in the OpacNav system
preference. To make testing easier it's also a good idea to have content
in the OpacNavBottom preference.

 - Apply the patch and run the database update process.
 - In the staff client, go to Tools -> HTML customizations and verify
   that the content from OpacNav is now stored there. When you
   edit the entry you should see content for each of the enabled
   translations in your system under each tab.
   - Confirm that the previous contents of OpacNav were added
     correctly.
 - Go to Administration -> System preferences -> OPAC and verify that
   the OpacNav preference has been removed.
 - Update and reinstall active translations (for instance fr-FR):
   - cd misc/translator/
   - perl translate update fr-FR
   - perl translate install fr-FR
 - View the OPAC and confirm that the contents of the OpacNav system
   preference displays in the left-hand sidebar.
 - Test as many pages as possible to confirm that wherever the
   OpacNavBottom content is displayed, OpacNav is also displayed.
 - Test also using the updated translation.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 24223: (follow-up) Add date to OpacNav additional content entries

This follow-up modifies the atomic update so that it inserts today's
date as the "Published on" date. Without that information the system
considers the item unpublished and will not display the content.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 24223: (follow-up) Make logged-in user's branchcode available to template

This patch makes a couple of corrections for problems I discovered
while working on Bug 24224: The variables required for correct display
of news items by branch and language were not consistently available to
the templates.

In opac-readingrecord.pl, the "lang" variable was being overwritten. On
this and other pages the logged-in patron's brachcode was not made
available. I've corrected instances of KohaNews.get() to use the
globally-available "logged_in_user.branchcode" instead.

To test, apply the patch and follow the original test plan, with the
addition of instances of the OpacNav additional contents item which
have a specific library selected.

Confirm that such items are correctly displayed according to the
logged-in user's home library. If there is no logged-in user the
library-specific OpacNav should not display.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 24223: (follow-up) Updates to conform to new practices

- The patch now works with new "Additional contents" system
- The database update follows new skeleton.pl
- Add "OpacNav" option to the additional contents template

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 24223: (follow-up) Add missing "return" to atomicupdate

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 24223: (QA follow-up) Link OpacNav to HTML customizations now

In the pref description of OpacNavBottom. (Before obsoleting that
one too somewhere soon.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
2 years agoBug 24674: (follow-up) Simpler regex
Marcel de Rooy [Tue, 21 Sep 2021 12:45:46 +0000 (12:45 +0000)]
Bug 24674: (follow-up) Simpler regex

The 'Polish notation' actually simplifies things.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24674: Adjust tests and add new ones to cover changes
Jonathan Druart [Tue, 18 Feb 2020 13:49:46 +0000 (14:49 +0100)]
Bug 24674: Adjust tests and add new ones to cover changes

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Rebased 21-09-21.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24674: Uncertain years for publicationyear/copyrightdate -- corrected
Janusz Kaczmarek [Mon, 17 Feb 2020 11:58:46 +0000 (12:58 +0100)]
Bug 24674: Uncertain years for publicationyear/copyrightdate -- corrected

This is a correction to Bug 11046: YYY-, YY--, Y---, are also
correct according to ISBD: uncertain year, but certain decade/century
(cf. n. 4.3.8 in ISBD Consolidated Edition of 2011).
(Question mark is not mandatory.)

In addition, in Poland a form with one only dash is quite common,
like YY- (== YY--).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
See last follow-up.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28413: Reduce background job worker memory footprint
Jonathan Druart [Fri, 21 May 2021 09:57:20 +0000 (11:57 +0200)]
Bug 28413: Reduce background job worker memory footprint

It's loading the modules in RAM then forks.
Then do not need it to have them loaded in the parent process (the worker/daemon).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
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>
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>
2 years agoBug 29411: Redirect to circulation if circsearch is true
Nick Clemens [Thu, 4 Nov 2021 06:50:46 +0000 (06:50 +0000)]
Bug 29411: Redirect to circulation if circsearch is true

TO test:
 1 - Have a patron with a unique surname i.e. Acosta
 2 - Enter the surename into 'Search patrons' box on staff homepage
 3 - You are redirected to 'members/moremember.pl'
 4 - Enter the surname into 'Check out' box at top of page
 5 - You are redirected to 'members/moremember.pl'
 6 - Apply patch
 7 - Enter the surename into 'Search patrons' box on staff homepage
 8 - You are redirected to 'members/moremember.pl'
 9 - Enter the surname into 'Check out' box at top of page
10 - You are redirected to 'circ/circulation.pl'

Signed-off-by: Owen <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
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>
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>
2 years agoBug 29180: DBRev 21.06.00.044
Jonathan Druart [Fri, 5 Nov 2021 11:16:53 +0000 (12:16 +0100)]
Bug 29180: DBRev 21.06.00.044

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29180: (QA follow-up) Don't alter old DB up date
Nick Clemens [Fri, 5 Nov 2021 10:03:34 +0000 (10:03 +0000)]
Bug 29180: (QA follow-up) Don't alter old DB up date

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29180: (QA follow-up) Alphabetize sysprefs.sql
Nick Clemens [Fri, 5 Nov 2021 10:02:32 +0000 (10:02 +0000)]
Bug 29180: (QA follow-up) Alphabetize sysprefs.sql

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29180: Rename syspref RequestOnOpac with OPACHoldRequests
Jonathan Druart [Thu, 4 Nov 2021 13:39:28 +0000 (14:39 +0100)]
Bug 29180: Rename syspref RequestOnOpac with OPACHoldRequests

It is a confusing name because we have 'Article Request' as a feature,
and this does not follow Koha terminology.

Test plan:
`updatedatabase` and confirm that the syspref has been renamed
`git grep RequestOnOpac` => No occurrence in the code

QA: The syspref's value is always retrieved using Koha.Preference from
.tt files, we don't need to send it from controllers or C4::Auth

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29386: DBIC schema changes
Jonathan Druart [Fri, 5 Nov 2021 11:12:52 +0000 (12:12 +0100)]
Bug 29386: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29386: DBRev 21.06.00.043
Jonathan Druart [Fri, 5 Nov 2021 11:10:30 +0000 (12:10 +0100)]
Bug 29386: DBRev 21.06.00.043

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
2 years agoBug 29265: Add missing category parameter
Jonathan Druart [Fri, 5 Nov 2021 10:50:09 +0000 (11:50 +0100)]
Bug 29265: Add missing category parameter

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 26326: Add missing +x flag
Jonathan Druart [Thu, 4 Nov 2021 08:25:34 +0000 (09:25 +0100)]
Bug 26326: Add missing +x flag

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29261: Add missing html filters
Jonathan Druart [Thu, 4 Nov 2021 08:24:59 +0000 (09:24 +0100)]
Bug 29261: Add missing html filters

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29265: Add option to pick editor when creating a new content entry
Owen Leonard [Mon, 25 Oct 2021 18:55:53 +0000 (18:55 +0000)]
Bug 29265: Add option to pick editor when creating a new content entry

This patch changes the "New entry" button on the additional contents
page to be a split button which offers the alternative of the
non-default editor (as defined by AdditionalContentsEditor).

Also changed: I moved some of the template logic around to consolidate
handling of the editor variables.

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

 - At the top of the page there should be a split button. The dropdown
   option should offer the non-default editor.
 - If AdditionalContentsEditor is set to "text editor," clicking the
   "main" part of the button should take you to an entry page which uses
   the text editor.
   - The dropdown part of the button should say "New entry using
      WYSIWYG editor."
 - Switch the AdditionalContentsEditor preference and confirm that the
   button reflects the change.
 - Confirm that the individual "Edit" buttons for each existing content
   entry still works correctly according to the system preference.

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>
2 years agoBug 29201: Add option to insert biblio_framework runtime parameter in SQL report
Owen Leonard [Thu, 28 Oct 2021 11:00:29 +0000 (11:00 +0000)]
Bug 29201: Add option to insert biblio_framework runtime parameter in SQL report

This patch modifies the SQL report creation process so that the list of
runtime parameters includes an option for bibliographic framework.

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

- Click the "Insert runtime parameter" menu button and select
  "Bibliographic framework."
- You should be shown a modal dialog in which you can change the label
  on the framework input.
- Click "Insert parameter." The SQL field should now contain the correct
  parameter, e.g. <<Framework|biblio_framework>>
- Use the parameter to define an SQL query, e.g.

  "SELECT * FROM biblio WHERE frameworkcode =
  <<Framework|biblio_framework>> LIMIT 10"

- Run the report. You should be asked to choose a framework. Confirm
  that the report runs correctly.

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>
2 years agoBug 29369: Use Flatpickr in dateaccessioned cataloging plugin
Owen Leonard [Fri, 29 Oct 2021 10:47:03 +0000 (10:47 +0000)]
Bug 29369: Use Flatpickr in dateaccessioned cataloging plugin

This patch udpates the dateaccessioned cataloging plugin to use the
Flatpickr date picker instead of jQueryUI.

To test, apply the patch and open an item for editing in Cataloging.

- The date acquired field (952$d) should have flatpickr styling.
- Clicking in the field should populate the field with today's date and
  trigger the calendar popup.
- Clicking the "..." next to the field should populate the field (when
  empty) with today's date.
- Verify that tabbing from a different field into the date acquired
  field behaves the same as a click.

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>
2 years agoBug 28982: Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 14:02:59 +0000 (15:02 +0100)]
Bug 28982: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28982: (follow-up) Ensure that date format is correctly checked
Owen Leonard [Mon, 4 Oct 2021 17:33:31 +0000 (17:33 +0000)]
Bug 28982: (follow-up) Ensure that date format is correctly checked

This patch modifies the global calendar include so that it doesn't use
the potentially-undefined template variable "dateformat."

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28982: Use Flatpickr on onboarding pages
Owen Leonard [Thu, 9 Sep 2021 14:10:57 +0000 (14:10 +0000)]
Bug 28982: Use Flatpickr on onboarding pages

This patch replaces the use of jQueryUI's datepicker in the onboarding
templates. The addition of calendar.inc to the template requires that
some additions be made to the installer's header files, adding the i18n
JavaScript assets.

jQueryUI-specific CSS is removed from installer.scss, and inclusion of
Flatpickr's SCSS is added.

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

- Start the installation process.
- Continue through the installation process until you reach the stage in
  onboarding where you are creating a patron category.
- The "Enrollment period -> Until" field should be a Flatpickr calendar
  widget. The widget should look and work correctly.

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>
2 years agoBug 28816: Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 14:02:46 +0000 (15:02 +0100)]
Bug 28816: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28816: Improve the display of multiple holds during hold process
Owen Leonard [Thu, 5 Aug 2021 18:02:29 +0000 (18:02 +0000)]
Bug 28816: Improve the display of multiple holds during hold process

This patch updates the appearance of the "confirm holds" page, shown
during the process of placing a hold for someone in the staff interface.

Most of the changes affect the appearance of the page when placing
multiple holds on titles which have one or more holds on them already.

The changes are intended to make the page clearer and easier to scan,
especially when placing multiple holds at once.

Also changed: The page heading when placing multiple holds now changes
based on whether you've selected a patron or not. It says "Search
patrons or clubs" when it's waiting for a patron/club selection. It says
"Place holds" after the patron/club has been selected. This is instead
of "Confirm holds" on both pages.

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).

- Go to Administration -> System preferences and set HoldsSplitQueue to
  "nothing."
- Perform a search in the staff client catalog and place multiple holds
  titles from that result set on hold for a patron.
- Perform the same search and select one or more of the titles you
  selected before in addition to one or more titles with no holds.
- After clicking the "Place hold" button you should see a page with the
  heading "Search patrons or clubs" showing information about existing
  holds. This section of the page should be clear and readable, with
  clear distinction between each section of information about each hold.
- Test this page again under each different option for the
  "HoldsSplitQueue" system preference by changing the preference and
  reloading the page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28694: Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 14:02:35 +0000 (15:02 +0100)]
Bug 28694: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28694: Check alert in cataloguing should be a static message
Owen Leonard [Fri, 8 Oct 2021 15:31:46 +0000 (15:31 +0000)]
Bug 28694: Check alert in cataloguing should be a static message

This patch modifies the basic cataloging interface so that form
validation errors are collected in a static "dialog" at the top of the
page instead of showing in a transient JavaScript alert.

The text of the message is roughly the same as it was in the alert, and
links have been added so that the user can click to jump directly to the
field referenced.

If the user scrolls down away from the static error message, a button
appears in the floating toolbar to jump back to the message.

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).

- Go to Cataloging and create a new record using the basic cataloging
  editor and a framework which has multiple mandatory fields defined
  (e.g. an unmodified default framework)
- Without entering anything in mandatory fields, click the "Save"
  button.
- You should see a message box appear at the top of the page.
  - It should list each missing mandatory subfield and tag, each with a
    "Go to field" link next to it.
  - Clicking the "Go to field" link should switch you to the correct tab
    and scroll the mandatory field into view.
- When you have scrolled down far enough for the error messages to be
  offscreen, an "Errors" button should appear in the floating toolbar.
  Clicking it should scroll the box back into view.
- The JS function for scrolling to a particular element on the screen
  has been modified, so test that the links in the toolbar for
  individual tags still work correctly.

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>
2 years agoBug 28537: (follow-up) Correct and improve OverDrive checkout modal
Owen Leonard [Fri, 17 Sep 2021 15:15:55 +0000 (15:15 +0000)]
Bug 28537: (follow-up) Correct and improve OverDrive checkout modal

This patch corrects the markup of the modal which is displayed when the
user clicks the "Download as" button in their list of OverDrive
checkouts. The modal markup had not been updated in the conversion to
Bootstrap 4.

I have also modified the markup generated when listing the download
format options so that they use some standard Bootstrap 4 classes,
improving the layout a little.

To test you must have valid credentials entered in system preferences
for the OverDrive API. You should test using a patron who has holds and
current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - In the list of current checkouts, click the "Download as" button for
    one of the titles.
    - A modal window should display with a list of radio buttons for
      each available format.
      - Confirm that the format text acts as the label for the radio
        button.
      - Confirm that closing the modal without making a selection works
        correctly.
      - Confirm that making a selection and submitting the form closes
        the modal and submits your choice.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28537: Improve HTML generated by OverDrive integration
Owen Leonard [Wed, 9 Jun 2021 15:43:50 +0000 (15:43 +0000)]
Bug 28537: Improve HTML generated by OverDrive integration

This patch makes changes to the way HTML is generated when showing
output from OverDrive integration:

- Buttons have Bootstrap button classes
- Layout of information is improved.
- Handling of cover image thumbnails is improved, especially in cases
  where images were much larger than expected.
- An OverDrive-specific CSS file is added.

To test you must have valid credentials entered in system preferences
for the OverDrive API. You should test using a patron who has holds and
current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - The contents of the tab should display well, with item
    thumbnails showing in a column to the left, and item information
    showing to the right.
  - Controls should be styled with standard Bootstrap style.
  - Confirm that operations work correctly: Acessing titles, checking
    in, canceling holds, etc.

- Perform a catalog search which will return results also found in your
  OverDrive collection.
  - Open the OverDrive results page.
  - The page should display correctly, especially thumbnails.
  - Confirm that operations work correctly: Checking out and placing
    holds.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28450: Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 14:02:16 +0000 (15:02 +0100)]
Bug 28450: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28450: Make Account summary print tables configurable
Owen Leonard [Tue, 12 Oct 2021 10:32:05 +0000 (10:32 +0000)]
Bug 28450: Make Account summary print tables configurable

This patch adds table settings for the three tables which appear on the
patron's "Print summary" view. This will allow the administrator to
set a default configuration for columns on the print summary page.

To test, apply the patch and restart-all to load the revised columns
settings YAML. Rebuild the staff interface SCSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Go to Administration -> Table settings -> Circulation.
- Under the "Circulation tables" heading you should see a "Jump to" link
  to "print_summary."
- In the settings for the print_summary page you should see three
  tables: print-summary-checkouts, print-summary-fines, and
  print-summary-holds.
- Locate a patron account which has checkouts, fines, and holds.
  - From the patron detail view click "Print -> Print summary."
  - A new window should open with the print summary view. All tables
    should display correctly.
  - Test that the "Columns" buttons work correctly to show and hide
    columns.
- Make changes to the default settings for these tables to confirm that
  they work on the print summary page.

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>
2 years agoBug 27823: Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 14:01:46 +0000 (15:01 +0100)]
Bug 27823: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27823: List upcoming steps during installation process
Owen Leonard [Fri, 15 Oct 2021 12:26:16 +0000 (12:26 +0000)]
Bug 27823: List upcoming steps during installation process

This patch adds text to each step of the installation process showing
which steps have been completed, which step is current, and which steps
come next. This helps the user know where they are in the process.

To test, apply the patch and begin the process of installing Koha. In my
testing environment I drop the Koha database and create it again.

On each step of the installation process, confirm that the list of steps
is correct, showing the right stage in the process.

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>
2 years agoBug 27296: Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 14:01:21 +0000 (15:01 +0100)]
Bug 27296: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27296: Return claims should be filtered by default to show unresolved claims
Owen Leonard [Mon, 9 Nov 2020 19:36:22 +0000 (19:36 +0000)]
Bug 27296: Return claims should be filtered by default to show unresolved claims

This patch modifies the DataTables configuration of the return claims
table on the checkout and patron detail pages. Using the footerCallback
function, the count of resolved and unresolved claims is calculated and
used to filter the list of claims to show only unresolved claims by
default.

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).

- If necessary, Enable claims returned functionality by defining a value
  in the ClaimReturnedLostValue system preference.
- Open for checkout a patron who has items checked out.
- From the table of checkouts, click "Claim returned" for one or more
  items.
  - As you mark items "Clamed returned," the the items should appear
    under the "Claims" tab. The corresonding filter links should be
    updated accordingly, "Show all X claims."
  - Mark one or more claims resolved. As you do so they should disappear
    from the list of claims. The filter links should be updated to
    reflect that there are some resolved and some unresolved claims.
  - Clicking each filter link should trigger the correct filter.
  - Test this process when the count of unresolved claims is zero and
    when the cound of resolved claims is zero.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

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

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/checkouts.js for
  translation, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:1086
  msgid "Show 1 claim"
  msgid_plural "Show all {count} claims"
  msgstr[0] ""
  msgstr[1] ""

- Edit the "msgstr" strings however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client and
  repeat the test plan above. The translated strings should appear.

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>
2 years agoBug 29015: Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 14:01:06 +0000 (15:01 +0100)]
Bug 29015: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29015: (QA follow-up) Change collection code to be just collection
Katrin Fischer [Wed, 27 Oct 2021 14:09:52 +0000 (14:09 +0000)]
Bug 29015: (QA follow-up) Change collection code to be just collection

We did some clean-up in that area a little while ago, agreeing that
as we acutally display the descriptions, the label should be just
"collection".

This patch also removes some ():

Before:
4 items found for Centerville and item type:(Books) and collection: (Reference) and shelving location: (General Stacks)

Now:
4 items found for Centerville and item type: Books and collection: Reference and shelving location: General Stacks

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29015: (follow-up) Default to logged in branch unless viewing queue
Nick Clemens [Wed, 15 Sep 2021 17:17:28 +0000 (17:17 +0000)]
Bug 29015: (follow-up) Default to logged in branch unless viewing queue

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>
2 years agoBug 29015: (follow-up) Show sidebar filter form with results
Owen Leonard [Wed, 15 Sep 2021 12:14:19 +0000 (12:14 +0000)]
Bug 29015: (follow-up) Show sidebar filter form with results

This patch adds the new filter form in the sidebar when showing results.
To do so the form markup is moved into a BLOCK so that it can be reused.

This patch also adds pre-selection of submitted options on the filter
form so that it reflects the user's choices.

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

- Go to Circulation -> Holds queue.
- Submit the form with one or more filters selected.
- On the results page the queue should be correctly filtered and the
  sidebar should show your search fields preselected.
- Test with the CircSidebar preference enabled and disabled. The
  circulation menu should appear correctly, with the filter form only
  displaying in the sidebar after submitting the form.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29015: Unit tests
Nick Clemens [Wed, 15 Sep 2021 10:34:15 +0000 (10:34 +0000)]
Bug 29015: Unit tests

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD Amended patch: perltidy!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29015: Add options for itemtype, collection, and shelving location to view_holdsq...
Nick Clemens [Tue, 14 Sep 2021 19:29:27 +0000 (19:29 +0000)]
Bug 29015: Add options for itemtype, collection, and shelving location to view_holdsqueue.pl

This patch makes the code for itemtypeslimit work, and adds options for shelving location and collection code

This also remove the 'post' method from the form to allow easy bookmarking

To test:
1 - Add holds to your system
2 - Run the holds queue builder
3 - Browse to Circulation->Holds queue
4 - Note the library dropdown
5 - Apply patch
6 - Reload and note new options
7 - Test that both limits and 'All' options work as expected
8 - Note that description at top includes options when selected
    "### items found for All libraries and item type:(Books)"

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>
2 years agoBug 26326: DBRev 21.06.00.042
Jonathan Druart [Wed, 3 Nov 2021 14:07:07 +0000 (15:07 +0100)]
Bug 26326: DBRev 21.06.00.042

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 26326: DBIC Schema changes
Nick Clemens [Wed, 19 May 2021 12:54:16 +0000 (12:54 +0000)]
Bug 26326: DBIC Schema changes

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>
2 years agoBug 26326: (follow-up) Add ability to check for existence of any primary key
Nick Clemens [Tue, 30 Mar 2021 15:08:09 +0000 (15:08 +0000)]
Bug 26326: (follow-up) Add ability to check for existence of any primary key

Before dropping a primary key we need to see if one exists - this updates
the installer method to allow searching for existence of key

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 26326: (follow-up) Address qa script failures

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 26326: Add Koha Objects for Import Records and Import Record Matches
Nick Clemens [Mon, 31 Aug 2020 16:47:51 +0000 (16:47 +0000)]
Bug 26326: Add Koha Objects for Import Records and Import Record Matches

To test:
1 - Apply patches
2 - Update database
3 - Generate schema files (dbic)
4 - prove -v t/db_dependent/Koha/Import/Records.t
5 - prove -v t/db_dependent/Koha/Import/Record/Matches.t

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD Amended patch: remove unused unset_chosen method

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27360: DBRev 21.06.00.041
Jonathan Druart [Wed, 3 Nov 2021 14:04:06 +0000 (15:04 +0100)]
Bug 27360: DBRev 21.06.00.041

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27360: Prevent crash if branchcode does not exist
Jonathan Druart [Wed, 3 Nov 2021 13:39:17 +0000 (14:39 +0100)]
Bug 27360: Prevent crash if branchcode does not exist

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27360: Add hint to input field
Katrin Fischer [Wed, 27 Oct 2021 04:37:19 +0000 (04:37 +0000)]
Bug 27360: Add hint to input field

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27360: (follow-up) Mark public as boolean
Martin Renvoize [Mon, 1 Nov 2021 08:21:09 +0000 (08:21 +0000)]
Bug 27360: (follow-up) Mark public as boolean

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27360: Use 'public' to filter libraries for opac display
Martin Renvoize [Wed, 27 Oct 2021 13:54:43 +0000 (14:54 +0100)]
Bug 27360: Use 'public' to filter libraries for opac display

This patch adds the ability to set a library as 'public' or not; this
allows librarians to hide back office library branches from the opac.

Test plan
1/ Set a library as public from `admin > libraries`.
2/ Navigate to the `Libraries` page in the OPAC
3/ Note that only `public` libraries are displayed.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27360: DBIC Build
Martin Renvoize [Wed, 27 Oct 2021 13:49:01 +0000 (14:49 +0100)]
Bug 27360: DBIC Build

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27360: Add public field to branches table
Martin Renvoize [Wed, 27 Oct 2021 13:48:16 +0000 (14:48 +0100)]
Bug 27360: Add public field to branches table

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 25883: (follow-up) Update columns_settings
Martin Renvoize [Mon, 1 Nov 2021 08:30:44 +0000 (08:30 +0000)]
Bug 25883: (follow-up) Update columns_settings

Replace 'holdinglibrary' with 'transferlibrary' in checkedin
columns_settings description.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 25883: Replace 'holdingbranch' with 'transfer to' in returns
Martin Renvoize [Tue, 27 Apr 2021 13:10:27 +0000 (14:10 +0100)]
Bug 25883: Replace 'holdingbranch' with 'transfer to' in returns

This patch replaces the "Holding library" column in the returns table
with a 'Transfer to' column that displays the destination for the item
awaiting transfer if a transfer exists.

Signed-off-by: Ben Daeuber <bdaeuber@fargolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
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>
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>
2 years agoBug 24406: Wrap patron category type code in a span on patron search results
Katrin Fischer [Sun, 22 Aug 2021 14:20:55 +0000 (14:20 +0000)]
Bug 24406: Wrap patron category type code in a span on patron search results

The patron category type code (A, C, O, ...) is currently displayed in the
patron module search and the patron card creator and acquisition patron searches.

This information is not useful for most users, as these are internal codes
that cannot be easily "decoded". And while you might be able to guess A as
Adult in English, it doesn't translate to other languages.

This patch wraps a span around the patron category type code shown
in () after the patron category.

To test:
- Verify for each of the following three searches, that the patron category code
  displays in the search results, but is wrapped in a span with the class
  patron_category_type
- Tools > Patron card creator
  - New > New card batch > Add patrons
  - Search for patrons
- Patrons
  - Search for patrons
- Acquisitions
  - Add a budget
  - Add a fund for the budget
  - Search for a user or owner to add

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>
2 years agoBug 28417: Don't require C4::Auth_with_cas from opac-user if not needed
Jonathan Druart [Wed, 3 Nov 2021 12:43:11 +0000 (13:43 +0100)]
Bug 28417: Don't require C4::Auth_with_cas from opac-user if not needed

Note that without the use URI::QueryParam statement in C4::Auth we get:
Can't locate object method "query_param_delete" via package "URI::_generic" at /kohadevbox/koha/C4/Auth.pm line 1254

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28417: (follow-up) Fix typo
Tomas Cohen Arazi [Fri, 29 Oct 2021 19:17:17 +0000 (16:17 -0300)]
Bug 28417: (follow-up) Fix typo

- There are CAS demo servers, pick one [1]
- They all seem to have the same user/pass as of writing this:
  User: casuser
  Password: Mellon

To test:
1. Enable CAS and all related preferences. I chose v3 or higher, it only affects the logout action.
2. Set the CAS URL: https://casserver.herokuapp.com/cas (note that if you click on any of the examples, they include a trailing /login, don't put it).
3. Generate a Koha user, with userid: casuser (I also used that for cardnumber, just in case). Set no password to the user, or its irrelevant anyway. Add it stff permissions.
4. Open your Koha OPAC, I use KTD thus:
   http://kohadev.myDNSname.org:8080
5. Try to login using CAS
=> SUCCESS: You are redirected to the right login page
6. Login using casuser/Mellon as advertised in the 'demos' site.
=> SUCCESS: You are logged in!
7. Now logout
=> SUCCESS: You are sent to CAS so they know you wanted to logout (if you enabled CAS logout)
8. Repeat on the staff interface.
=> SUCCESS: Things work!
9. Apply this patches, restart all the things:
   $ restart_all
10. Repeat all in OPAC and admin interfaces
=> SUCCESS: Things work!
11. Sign off :-D

[1] https://apereo.github.io/cas/Demos.html

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28417: Don't use C4::Auth_with_cas if CAS is not used
Jonathan Druart [Fri, 21 May 2021 12:26:29 +0000 (14:26 +0200)]
Bug 28417: Don't use C4::Auth_with_cas if CAS is not used

We should follow the same pattern as ldap and not use C4::Auth_with_cas
if the cas syspref is not turned on.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27375: Set YAML file settings in .editorconfig
Johanna Raisa [Mon, 11 Jan 2021 07:49:45 +0000 (09:49 +0200)]
Bug 27375: Set YAML file settings in .editorconfig

To test:
1) Start an editor that supports .editorconfig.
2) Open YAML file mappings.yaml for example.
3) Format the file.
4) Observe that nothing changes.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28879: Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 12:36:27 +0000 (13:36 +0100)]
Bug 28879: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28879: Fix display of request metadata
Andrew Isherwood [Wed, 18 Aug 2021 14:07:54 +0000 (15:07 +0100)]
Bug 28879: Fix display of request metadata

This commit adjusts the CSS surrounding the display of request
metadata, it improves the display for metadata with long key names.

Test plan:

- Do not apply patch
- Create a FreeForm ILL request with a custom metadata field with a long
  name
- View the created request
- Observe that the long metadata name breaks the display of the metadata
- Apply the patch
- View the created request
  => TEST: Observe that the display is no longer broken

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>
2 years agoBug 26402: Add --framework parameter to commit_file.pl
Andreas Jonsson [Mon, 7 Sep 2020 09:31:58 +0000 (09:31 +0000)]
Bug 26402: Add --framework parameter to commit_file.pl

This patch adds the option to pass a frameworkcode to the commit_file.pl
script.

To test:
1. Stage a MARC file using stage_file.pl.  For instance using the devbox:

   cd ~/kohaclone
   sudo koha-shell -c 'perl misc/stage_file.pl --file t/db_dependent/www/data/marc21record.mrc' kohadev

2. Note the assigned batch number and commit the batch using --framework parameter to commit_file.pl.  For example using the devbox:

   sudo koha-shell -c 'perl misc/commit_file.pl --batch-number 1 --framework ACQ' kohadev

3. Verify that the framework code was correctly assigned:

   sudo koha-mysql kohadev -e 'SELECT frameworkcode FROM biblio ORDER BY timestamp DESC LIMIT 1;'
=> SUCCESS: It picked it

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
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>
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>
2 years agoBug 29380: Correct table name in joins to prevent errors
Joonas Kylmälä [Sat, 30 Oct 2021 19:02:39 +0000 (19:02 +0000)]
Bug 29380: Correct table name in joins to prevent errors

The commit "Bug 29290: Rename relationships borrower =>
patron" (d46492ac23) renamed the relation for the borrowers table from
'borrower' to 'patron' but the joins were not updated accordingly so a
few scripts got broken.

To test:
 1) Notice that
    $ perl misc/cronjobs/automatic_renewals.pl -c -s -v
    returns 255 error code on exit
 2) Apply patch
 3) Notice the automatic_renewals.pl works now and exit code is 0
 4) Make sure /cgi-bin/koha/tools/batch_extend_due_dates.pl works.
 5) Try to grep for 'borrower' in Koha source code and see if there
    are any other join done using the Koha::Checkout or
    Koha::Old::Checkout objects.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29380: (follow-up) Fix renewal feature in staff interface

The commit "Bug 29290: Rename relationships borrower =>
patron" (d46492ac23) renamed the relation for the borrowers table from
'borrower' to 'patron' but the usage in the renew.pl script was not
updated.

To test:
 1) Try to renew a book in intranet through the renewal tab
 2) Notice it gives error
 3) Apply patch
 4) Notice the error is now gone

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28236: Allow access to json files from apache config
Johanna Raisa [Thu, 2 Sep 2021 09:22:51 +0000 (12:22 +0300)]
Bug 28236: Allow access to json files from apache config

This patch grants json files from koha-tmpl. Otherwise systempreferences won't be able to fetch them.

TEST PLAN:

1) Try to set systempreference BorrowerUnwantedField.
2) The modal is empty.
3) Modify Apache configurations like in this patch.
4) Try again set the systempreference.
5) The modal should show list of parameters.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD Amended patch: replace tab characters and reword commit title

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24850: Correctly handle suspended_until for PUT
Jonathan Druart [Wed, 3 Nov 2021 11:05:42 +0000 (12:05 +0100)]
Bug 24850: Correctly handle suspended_until for PUT

if we are passing suspended_until to the body, it should be a rfc3339 (what the spec is expecting)
but $hold->suspend_until will be iso

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24850: Date only are not RFC3339
Jonathan Druart [Wed, 3 Nov 2021 09:06:35 +0000 (10:06 +0100)]
Bug 24850: Date only are not RFC3339

We removed the fallback on 'Bug 24850: Don't fallback when date_format
is passed', and the dates passed for date only (YYYY-MM-DD) are not
RFC3339 formatted but ISO8601.
We must assume that all dates will be YYYY-MM-DD, without fallback.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24850: suspended_until is a date-time
Tomas Cohen Arazi [Wed, 3 Nov 2021 09:55:19 +0000 (06:55 -0300)]
Bug 24850: suspended_until is a date-time

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>
2 years agoBug 24850: Fix api/v1/holds.t
Jonathan Druart [Wed, 3 Nov 2021 09:44:14 +0000 (10:44 +0100)]
Bug 24850: Fix api/v1/holds.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29395: use EXPORT_OK from Koha::Patron::Debarments
Jonathan Druart [Wed, 3 Nov 2021 08:55:54 +0000 (09:55 +0100)]
Bug 29395: use EXPORT_OK from Koha::Patron::Debarments

Missed from bug 17600.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29261: (bug 15812 follow-up 3) Fix translation issue in include file
Jonathan Druart [Tue, 2 Nov 2021 08:42:05 +0000 (09:42 +0100)]
Bug 29261: (bug 15812 follow-up 3) Fix translation issue in include file

This is getting messy. No idea how I tested the previous patches but it
was not working, the problem still persisted.

This patch is using the I18N TT plugin to make things easier and fix the
original problem.

Test plan:
Apply the patch
perl translate update fi-FI
Edit misc/translator/po/fi-FI-messages.po
Locate and translate "Check out"
 61 #: koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt:20
 62 msgid "Check out"
 63 msgstr "Laina"
Locate and transate "View"
 182 #: koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt:22
 183 msgid "View"
 184 msgstr "Nayta"
Apply the change to the fi-FI templates
perl translate install fi-FI

Now enable the fi-FI in the lang syspref, search for patron and confirm
that the result view is displayed correctly.
Note that the "Check out" and "View" strings are correctly translated
(when you hover the cardnumbers or patron's names)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28901: (follow-up) Compiled CSS
Jonathan Druart [Wed, 3 Nov 2021 12:36:04 +0000 (13:36 +0100)]
Bug 28901: (follow-up) Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
2 years agoBug 28263: DBRev 21.06.00.040
Jonathan Druart [Tue, 2 Nov 2021 15:49:37 +0000 (16:49 +0100)]
Bug 28263: DBRev 21.06.00.040

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28263: (QA follow-up) Use new atomicupdate code style
Joonas Kylmälä [Sat, 30 Oct 2021 20:19:39 +0000 (20:19 +0000)]
Bug 28263: (QA follow-up) Use new atomicupdate code style

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>