koha.git
2 years agoBug 27873: Improve message consistency: checkout and patron detail pages
Owen Leonard [Thu, 1 Apr 2021 13:29:29 +0000 (13:29 +0000)]
Bug 27873: Improve message consistency: checkout and patron detail pages

This patch creates a new include for showing circulation and
patron-related messages on both the checkout page and the patron detail
page. This allows the two pages to be consistent with each other.

The patch also makes some minor CSS adjustments, including the addition
of an SVG to replace an old GIF, arrow-bullet.gif.

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

- View both the checkout and patron details page for patrons in the
  staff interface, confirming that the information is displayed in the
  same way, including:

  - Pending modifications
  - Pending expiration
  - Expired
  - Address in doubt
  - Card lost
  - Restricted (indefinite and with expiration)
  - Outstanding overdues
  - Outstanding return claims
  - Patron age incorrect for their category
  - Outstanding charges
  - Account credit
  - Waiting holds (at logged-in library or other library)
  - Circulation note (from borrowers.borrowernotes)
  - Messages (added at logged-in library or other library)

EDIT: Fixed merge error.

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 27445: Compiled CSS changes
Jonathan Druart [Mon, 12 Jul 2021 13:44:10 +0000 (15:44 +0200)]
Bug 27445: Compiled CSS changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27445: OPAC header tweaks for non-JavaScript users
Owen Leonard [Fri, 15 Jan 2021 19:15:06 +0000 (19:15 +0000)]
Bug 27445: OPAC header tweaks for non-JavaScript users

This patch makes some minor changes to the header menu in the OPAC
visible only to users with JavaScript support.

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

 - View the OPAC with JS disabled in your browser.
 - The "Cart" button should not be visible.
 - The "List," "Log in," and "Search history" links should be styled
   blue like other links.
 - Log in to the OPAC and confirm that the "Welcome <name>" link is also
   styled like other links.
 - Enable JavaScript and verify that the links appear and function just
   as they did before the patch.

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 28384: Add 'no_items' option to TransformMarcToKoha
Nick Clemens [Wed, 19 May 2021 10:19:33 +0000 (10:19 +0000)]
Bug 28384: Add 'no_items' option to TransformMarcToKoha

This patch adds a new option 'no_items' and uses it in the C4::Search::searchResults
routine. We don't use the item info fetched here, so skipping those lines saves us time.

Additionally, I fix an incorrect FIXME comment, and pass the ISBN returned by the routine above
into GetNormalizedISBN to save another lookup

TO test:
1 - Enable AmazonCoverImages system preference
2 - Search staff client with a term that returns books with covers
3 - Apply patch
4 - prove -v t/db_dependent/Biblio/TransformMarcToKoha.t
5 - Confirm searching works
6 - Confirm Amazon images display (normalized_isbn is used for these)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Amended, replacing a tab character.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27985: Add option to send a record to batch modification from details page
Nick Clemens [Thu, 18 Mar 2021 13:52:37 +0000 (13:52 +0000)]
Bug 27985: Add option to send a record to batch modification from details page

This patch adds an option to modify a single record using a marc modification
template to the 'Edit' menu on the details page

To test:
 1 - Apply patch
 2 - Browse to details page on the staff client
 3 - Be a user with permission to edit records and use batch record modification
 4 - Verify the option 'Modify record using template' appears in list
 5 - Click it
 6 - You should be sent to batch record modification screen
 7 - If you have no templates there will be a link prompting you to create on, do that
 8 - If oyu already had one, or created on above you shoudl now be able to select a template
 9 - Apply the template
10 - Browse to the record again
11 - Confirm changes were applied correctly

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.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 20472: DBRev 21.06.00.010
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 20472: DBRev 21.06.00.010

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20472: DBRev 21.06.00.009
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 20472: DBRev 21.06.00.009

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20472: DBIC schema changes
Jonathan Druart [Mon, 12 Jul 2021 13:41:45 +0000 (15:41 +0200)]
Bug 20472: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20472: Add kohastructure changes
Jonathan Druart [Mon, 12 Jul 2021 13:37:14 +0000 (15:37 +0200)]
Bug 20472: Add kohastructure changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20472: Make DB rev idempotent
Jonathan Druart [Mon, 12 Jul 2021 11:52:02 +0000 (13:52 +0200)]
Bug 20472: Make DB rev idempotent

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20472: (QA follow-up) Add few TT filters
Marcel de Rooy [Thu, 24 Jun 2021 11:50:05 +0000 (11:50 +0000)]
Bug 20472: (QA follow-up) Add few TT filters

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
No more warns from qa tools.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20472: Update translated AR notices
Marcel de Rooy [Wed, 29 Jul 2020 13:32:22 +0000 (13:32 +0000)]
Bug 20472: Update translated AR notices

Originally, we had:
de-DE/mandatory/sample_notices.sql
fr-CA/obligatoire/sample_notices.sql
fr-FR/1-Obligatoire/sample_notices.sql
it-IT/necessari/notices.sql
nb-NO/1-Obligatorisk/sample_notices.sql
pl-PL/mandatory/sample_notices.sql
ru-RU/mandatory/sample_notices.sql
uk-UA/mandatory/sample_notices.sql

Obviously, the landscape changed in the meantime.
We still have: fr-CA, fr-FR, nb-NO.

Test plan:
Reinstall notices for one of the languages above.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Have run all sql files thru mysql on the command line.
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>
2 years agoBug 20472: Add format to sample notices
Marcel de Rooy [Wed, 29 Jul 2020 11:12:12 +0000 (11:12 +0000)]
Bug 20472: Add format to sample notices

NOTE: We are only changing English here. A follow-up will care for
the translated languages. (English is in yml format, the remainder
not yet.)

We need to change the following notices:
AR_SLIP, AR_CANCELED, AR_PROCESSING, AR_PENDING and AR_COMPLETED.
In AR_COMPLETED the last sentence about picking up has been modified
too.

Test plan:
Reinstall Koha. Choose English. Check notice text.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 20472: Edit URL field on staff form
Marcel de Rooy [Thu, 5 Apr 2018 12:22:42 +0000 (14:22 +0200)]
Bug 20472: Edit URL field on staff form

This patch makes the following changes:

Add menu option Edit URLs.
Edit modal form to edit URLs.
Save URLs via ajax call to svc/article_request (Add action update_urls).
Add URL column to pending and processing table.
Allow Edit URLs for pending table too (just as Complete).
Do not allow 'Complete request' if a scan request has no URL(s).

Test plan:
[1] Add a few scan and photocopy requests.
[2] Fill url-A and url-B in two separate scan requests.
[3] Verify that these two urls are really saved (refresh form).
[4] Check that you cannot complete a scan request without URL and that you
    cannot add a URL to a photocopy request.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 20472: Add format field to the interface
Marcel de Rooy [Tue, 3 Apr 2018 14:19:13 +0000 (16:19 +0200)]
Bug 20472: Add format field to the interface

We need to add the format to the forms entering new requests:
  opac/opac-request-article
  circ/request-article
If the pref contains multiple formats like SCAN|PHOTOCOPY, the first listed
format will be preselected on the request form. If there is only one option,
we should not disable the select however. (Possibly hide it.)

If we have no mandatory fields, we should not allow the submit of a complete
empty form (check on OPAC).

And we need to show the format of pending requests on forms:
  opac/opac-user
  circ/request-article (biblio detail tab)
  circ/article-requests (staff form to handle requests)
  members/moremember (Article requests tab at the bottom)
  circ/circulation (Checkout/Article requests tab)
Note: The last two forms use the same include file.

Test plan:
[1] Add an article request via opac or staff. Choose Scan.
[2] Verify that you see the Scan format on opac-user and the
    above-mentioned staff forms.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 20472: Db rev for new preference ArticleRequestsSupportedFormats
Marcel de Rooy [Mon, 26 Mar 2018 13:10:54 +0000 (15:10 +0200)]
Bug 20472: Db rev for new preference ArticleRequestsSupportedFormats

This preference controls which formats are actually offered to patrons of
the library via the Article Request feature.
By default, it only contains PHOTOCOPY. This is default behavior.

The request format SCAN will be made possible by this report and can be
added by changing the preference.

Test plan:
Run the dbrev. Check the new pref on Administration.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 20472: Add new fields article_requests.format and urls
Marcel de Rooy [Mon, 26 Mar 2018 12:41:06 +0000 (14:41 +0200)]
Bug 20472: Add new fields article_requests.format and urls

The field 'format' will allow to make a distinction between requests for
photocopies and digital scans.
The field 'urls' will be used to save the URLs that allow the client to
download the scanned materials.

Test plan:
Run new install or upgrade existing install with atomic update.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 20310: DBRev 21.06.00.008
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 20310: DBRev 21.06.00.008

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20310: (QA follow-up) Add 'Opac' to pref and description
Nick Clemens [Fri, 9 Jul 2021 12:02:38 +0000 (12:02 +0000)]
Bug 20310: (QA follow-up) Add 'Opac' to pref and description

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20310: (follow-up) Rename method to get_marc_host
Martin Renvoize [Mon, 28 Jun 2021 13:13:07 +0000 (14:13 +0100)]
Bug 20310: (follow-up) Rename method to get_marc_host

This method is a mix of database relationship accessor and marc field
accessor. We have get_marc_notes already and other patches in the queue
are also starting to introduce get_marc_* named methods. This patch
updates the method name to conform with that scheme.

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>
2 years agoBug 20310: (follow-up) Move syspref check into controller
Martin Renvoize [Mon, 28 Jun 2021 13:07:53 +0000 (14:07 +0100)]
Bug 20310: (follow-up) Move syspref check into controller

I believe the syspref check is better placed in the controller. This way
the host_record method is not so closely tied to the articel requests
feature and may subsequently prove useful to future use cases.

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>
2 years agoBug 20310: (follow-up) Check if biblio exists; 755 host_record.t
Marcel de Rooy [Fri, 9 Apr 2021 07:39:49 +0000 (07:39 +0000)]
Bug 20310: (follow-up) Check if biblio exists; 755 host_record.t

In order to prevent an error like:
Can't call method "host_record" on an undefined value at opac/opac-request-article.pl

Also chmod's host_record.t to 755 (File must have the exec flag)

Test plan:
Change the URL so that the biblionumber does not exist.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 20310: Adding a pref to control behavior
Marcel de Rooy [Tue, 8 Sep 2020 13:29:45 +0000 (13:29 +0000)]
Bug 20310: Adding a pref to control behavior

If people want to control the redirection, we could add a pref
like ArticleRequestsHostRedirection. If it is not enabled,
the party is over.

Test plan:
Test if redirection stops on a child and host when you disable.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 20310: (follow-up) Add or remove orgcode in second try
Marcel de Rooy [Tue, 8 Sep 2020 12:59:53 +0000 (12:59 +0000)]
Bug 20310: (follow-up) Add or remove orgcode in second try

We did remove an orgcode, but we could also do the other way
around.

Note: Hard to include in the unit test since it mocks the whole
search engine part.

Test plan:
[1] Run t/db_dependent/Koha/Biblio/host_record.t
[2] Test host 001 = number and child 773 = (org)number
[3] Test host 001 = (org)number and child 773 = number

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 20310: Redirect article record without items for article requests
Marcel de Rooy [Mon, 19 Mar 2018 13:14:39 +0000 (14:14 +0100)]
Bug 20310: Redirect article record without items for article requests

If an article record has been catalogued separately, has no items and
contains a reference to its host via MARC21 field 773 (host item entry),
this patch makes an article request redirect to the host record while
copying title, author and page info (from 773$g).

This is accomplished by using the new Koha::Biblio->host_record method.

Note: Subfield 773$g may contain additional information on volume and
issue number etc. It will be very hard or perhaps impossible to parse $g
and copy these details into the corresponding fields of the article
request form for all possible variations used in libraries. A similar
remark can be made for selecting the correct item (when item level is
used). We could try this on a future report, but will probably need at
least a preference to define the expected format.

Test plan:
[1] Enable article requests. Add rules for an ART and a SER itemtype.
[2] Create a SER host biblio record.
[3] Create an ART biblio record, no items. Include a 773w pointing to the
    SER record with '(MARCorgcode)[recno]' (keep the parentheses, remove
    the square brackets when inserting the biblionumber).
    Include text in 773$g too.
[4] Place an article request on the ART record. Verify that it redirects
    you to the SER record while copying title, author, page info.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Hugo Agud <hagud@orex.es>
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>
2 years agoBug 27948: Remove unused branchcode var
Jonathan Druart [Mon, 12 Jul 2021 11:34:15 +0000 (13:34 +0200)]
Bug 27948: Remove unused branchcode var

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 20310: Introduce Koha::Biblio->host_record
Marcel de Rooy [Mon, 19 Mar 2018 13:14:39 +0000 (14:14 +0100)]
Bug 20310: Introduce Koha::Biblio->host_record

This is a more generic method that allows you to get to the host record
as defined in MARC21 field 773$w. This control number is looked up in the
search engine (MARC21 field 001).

Note: The current implementation is based on MARC21 and does not change
behavior for UNIMARC.
This includes the follow-up originally submitted separately on Bugzilla,
dealing with multiple 773 fields.

Test plan:
Run t/db_dependent/Koha/Biblio/host_record.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 27908: Add support for circulation status 1 ( other ) for damaged items
Kyle M Hall [Wed, 10 Mar 2021 15:45:18 +0000 (10:45 -0500)]
Bug 27908: Add support for circulation status 1 ( other ) for damaged items

Some libraries would like to transmit if an item is damaged via the
circulation status field. There is no specific code for a damaged item,
so we should use value 1 (other) along with an AF screen message to
describe the reason for the the circulation status of 1.

Test Plan:
1) Apply these patches
2) prove t/db_dependent/SIP/Transaction.t

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.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 27908: Add unit test
Kyle M Hall [Wed, 10 Mar 2021 15:45:15 +0000 (10:45 -0500)]
Bug 27908: Add unit test

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.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 27907: Add support for circulation status 2 ( on order )
Kyle M Hall [Wed, 10 Mar 2021 15:33:28 +0000 (10:33 -0500)]
Bug 27907: Add support for circulation status 2 ( on order )

In Koha, we represent on order items by giving those items a notforloan
value less then zero. We can use this to implement circ status 02 ( on
order ) in for SIP.

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.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 27907: Add unit test
Kyle M Hall [Wed, 10 Mar 2021 15:33:23 +0000 (10:33 -0500)]
Bug 27907: Add unit test

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.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 27906: Add support for circulation status 9 ( waiting to be re-shelved )
Kyle M Hall [Wed, 10 Mar 2021 15:24:16 +0000 (10:24 -0500)]
Bug 27906: Add support for circulation status 9 ( waiting to be re-shelved )

In Koha, we can support circ status 09 in SIP by checking if the item's
location is "CART".

Test Plan:
1) prove t/db_dependent/SIP/Transaction.t

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.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 27906: Add unit test
Kyle M Hall [Wed, 10 Mar 2021 15:22:54 +0000 (10:22 -0500)]
Bug 27906: Add unit test

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.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 27883: (follow-up) Make label match input id
Owen Leonard [Tue, 30 Mar 2021 15:04:24 +0000 (15:04 +0000)]
Bug 27883: (follow-up) Make label match input id

This change alters the list of columns under "Preserve existing values,"
changing the label for each checkbox can be clicked to trigger the
checkbox change.

To test, apply the patch and refresh the patron import page. Expand the
"Preserve existing values" section and click any label in the list. The
corresponding checkbox should be checked.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27883: Add ability to preserve patron field from being overwritten by import
Kyle M Hall [Fri, 5 Mar 2021 14:13:34 +0000 (09:13 -0500)]
Bug 27883: Add ability to preserve patron field from being overwritten by import

Some libraries would like to be able to preserve particular fields for
existing patrons when overwriting them via the patron import tool.
Effectively, this means the specified columns of the CSV are used for
new patrons, but ignored for existing patrons.

Test Plan:
1) Create a patron CSV with one new patron, make the surname and
   firstname "Test1". Add a cardnumber so we can upload it again later.
2) Import the file
3) Change the firstname and surname in the CSV to "Test2"
4) Return to the patron import tool, choose to match on cardnumber,
   overwrite existing patrons, and preserve exiting firstnames
5) Import the file with these settings
6) Referesh the patron details for this patron, the patron's surname
   should still be "Test" while the firstname should now be "Test2"

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 26760: Escape URI parameters in redirect URI to paycollect.pl
Julian Maurice [Wed, 12 May 2021 08:24:30 +0000 (10:24 +0200)]
Bug 26760: Escape URI parameters in redirect URI to paycollect.pl

Also remove useless '%.2f' formatting of amount and amountoutstanding

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 26760: Redirect to paycollect.pl when clicking on "Save and pay"
Julian Maurice [Wed, 21 Oct 2020 10:58:29 +0000 (12:58 +0200)]
Bug 26760: Redirect to paycollect.pl when clicking on "Save and pay"

Bug 14898 added the "Save and pay" button that redirects to "Make a
payment" tab after creating a manual invoice
This requires the user to click on another "Pay" button before being
taken to the real payment form.
By redirecting directly to paycollect.pl, this useless step will no
longer be needed.

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
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 26340: Code simplification
Jonathan Druart [Mon, 12 Jul 2021 12:53:38 +0000 (14:53 +0200)]
Bug 26340: Code simplification

And rename $range with $barcode_length

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 26340: (QA follow-up) Remove warns and set input fields hidden again
Katrin Fischer [Sat, 3 Jul 2021 20:22:35 +0000 (22:22 +0200)]
Bug 26340: (QA follow-up) Remove warns and set input fields hidden again

Removes traces of debugging.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 26340: When printing labels from a barcode range, keep zero padding
Ivan Dziuba [Mon, 14 Jun 2021 18:41:14 +0000 (14:41 -0400)]
Bug 26340: When printing labels from a barcode range, keep zero padding

TEST PLAN:

1. Go  Tools > Label creator
2. Click +New -> Barcode range
3. Print barcode range with zero(s) in the start (Ex. from 00011881 to 00012000 )
4. Select a template to be applied:: Code à barre 48467
Select a layout to be applied: Code à barres
5. Export
6. Open PDF

The prefix is not displayed. We should see 00011881 on the labels, but we see 11881, 11882, ... without zeros in the start of labels.
This patch fix it.

Signed-off-by: hakam <hakam@inlibro.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 11879: DBRev 21.06.00.007
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 11879: DBRev 21.06.00.007

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 11879: DBIC schema changes
Jonathan Druart [Mon, 12 Jul 2021 13:40:22 +0000 (15:40 +0200)]
Bug 11879: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 11879: Remove primary_contact_method from REST API
Jonathan Druart [Mon, 12 Jul 2021 13:04:56 +0000 (15:04 +0200)]
Bug 11879: Remove primary_contact_method from REST API

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 11879: Remove the 'unwanted' preferences from the main contact method pull-down...
Alexis Ripetti [Mon, 29 Mar 2021 14:03:40 +0000 (10:03 -0400)]
Bug 11879: Remove the 'unwanted' preferences from the main contact method pull-down menu in the OPAC

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 11879: (follow up) Some fixes and code cleanup
Maryse Simard [Tue, 20 Oct 2020 15:56:42 +0000 (11:56 -0400)]
Bug 11879: (follow up) Some fixes and code cleanup

- Display the value in the patron detail page
- Adds support for BorrowerUnwantedField (staff)
- Removes unecessary code in opac/opac-memberentry.pl

Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 11879: Add a new field to patron record: main contact method
Bin Wen [Wed, 18 Dec 2019 16:52:49 +0000 (11:52 -0500)]
Bug 11879: Add a new field to patron record: main contact method

This patch adds the "Main Contact Method" field in the borrower
modification form.

This field is useful for reporting purposes, or to
know which contact method to use first when trying to contact a borrower.

Test plan:
0) Apply patch
1) updatedatabase.pl
2) In the staff client, edit a patron's contact info. There should be a new dropdown select to choose the main contact method
3) In the opac page, edit the personal details.There should be a new dropdown select to choose the main contact method.
4) Save the form. It should work.

Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27948: (QA follow-up) Remove NewsChannels reference
Marcel de Rooy [Mon, 12 Jul 2021 07:47:34 +0000 (07:47 +0000)]
Bug 27948: (QA follow-up) Remove NewsChannels reference

We only need to remove the obsolete module here.
Note that the two NewsToDisplay calls were removed already.
Replaced by a KohaNews.get call.

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 27948: (QA follow-up) Correct empty branchcode
Marcel de Rooy [Fri, 2 Jul 2021 07:02:22 +0000 (07:02 +0000)]
Bug 27948: (QA follow-up) Correct empty branchcode

Let us just fix it here and leave the rest to bug 28650.

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 27948: (QA follow-up) Remove unused $disclaimer code
Marcel de Rooy [Fri, 2 Jul 2021 06:19:14 +0000 (06:19 +0000)]
Bug 27948: (QA follow-up) Remove unused $disclaimer code

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 27948: (follow-up) Use Koha.news and PROCESS koha_news_block to bring disclaimer
Agustin Moyano [Fri, 2 Jul 2021 00:00:31 +0000 (21:00 -0300)]
Bug 27948: (follow-up) Use Koha.news and PROCESS koha_news_block to bring disclaimer

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 27948: Add disclaimer to article request
Agustin Moyano [Wed, 26 May 2021 19:00:32 +0000 (16:00 -0300)]
Bug 27948: Add disclaimer to article request

If ArticleRequestsDisclaimerText news is set, a disclaimer text will appear before an article request can be made

To test:
1. apply patches
2. enable ArticleRequest syspref
3. in OPAC place an article request for a patron
CHECK => No disclaimer text should appear before placing article request
4. add a text in ArticleRequestsDisclaimerText news
5. repeat step 3
SUCCESS => A disclaimer text is shown before you can place an article request

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 14237: DBRev 21.06.00.006
Jonathan Druart [Mon, 12 Jul 2021 13:45:17 +0000 (13:45 +0000)]
Bug 14237: DBRev 21.06.00.006

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 14237: (follow-up) Make the routines exclusively take itemnumber, biblionumber...
Nick Clemens [Fri, 11 Jun 2021 19:17:27 +0000 (19:17 +0000)]
Bug 14237: (follow-up) Make the routines exclusively take itemnumber, biblionumber, or ci_id

This patch changes the parameters for several of the CourseReserves routines to take a single
identifier exclusively.

Following the existing pattern we simply return if the params are incorrect

This patch also:
removes an unused 'title' variable
adds a prefetch to save some db calls where we fetch related objects
adjusts tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 14237: Set course_items.biblionumber in the DBrev
Jonathan Druart [Fri, 7 May 2021 07:22:50 +0000 (09:22 +0200)]
Bug 14237: Set course_items.biblionumber in the DBrev

We need to create the new column without the NOT NULL clause, set the
correct values, then add the NOT NULL clause.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 14237: Tests
Aleisha Amohia [Sun, 14 Mar 2021 20:15:32 +0000 (09:15 +1300)]
Bug 14237: Tests

Confirm all tests pass: t/db_dependent/CourseReserves/CourseItems.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 14237: Schema updates
Aleisha Amohia [Tue, 2 Feb 2021 21:04:30 +0000 (10:04 +1300)]
Bug 14237: Schema updates

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 14237: Database updates
Aleisha Amohia [Tue, 2 Feb 2021 21:01:15 +0000 (10:01 +1300)]
Bug 14237: Database updates

This patch adds a biblionumber column to course_items, adds a
relationship between course_items.biblionumber and biblio.biblionumber,
and changes course_items.itemnumber to allow null values.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 14237: Add individual bibliographic records to course reserves
Aleisha Amohia [Wed, 3 Feb 2021 00:03:31 +0000 (13:03 +1300)]
Bug 14237: Add individual bibliographic records to course reserves

This feature allows a patron to add bibliographic records to course
reserves. They can be added individually or in a batch. The courses that
have reserved this record will also show on the record's detail page.

To test:
1) Update database, refresh schema, and restart services
2) Enable the system preference UseCourseReserves
3) Set up a couple of biblios and a couple of items (attached to
    different biblios)
4) Go to Course Reserves and add a new course
5) Click Add reserves and put something in both the barcode field and
biblionumber field. Click submit and confirm you get an error.
6) Add a barcode in the barcode field and submit. Confirm the item is
reserved for the course as expected.
7) Add a biblionumber in the barcode field and submit. Add notes and
Save. Confirm the record is reserved for the course as expected and the
notes are saved correctly.
8) Edit the record-level course reserve that you just added. Confirm the
correct record shows and any edits save as expected.
9) Go back to the course and try removing reserves. Use both the Remove
action button for individual reserves and the Remove all reserves
button. Confirm both work as expected.
10) Go to Batch add reserves and put something in both the barcodes
field and biblionumbers field. Click submit and confirm you get an
error.
11) Remove the barcodes and put some biblionumbers in the biblionumbers
field. Add notes and Submit. Confirm the records are all added as
expected.
12) Click on one of the biblios that has been reserved for the course.
Confirm that the course shows under 'Courses that have reserved this
title' on the biblio detail page.
13) Go back to the course and click Add reserves. Try and add a
biblionumber that is already reserved. Confirm it detects that the
biblio has already been reserved.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28644: Fix calling borrowernumber on undefined value
Marcel de Rooy [Thu, 1 Jul 2021 14:13:05 +0000 (14:13 +0000)]
Bug 28644: Fix calling borrowernumber on undefined value

If the hold is not found (e.g. already cancelled), we should
return earlier without crashing:
    Can't call method "borrowernumber" on an undefined value at /usr/share/koha/C4/Reserves.pm line 521
    (Note: line number from 19.11)

Test plan:
Run t/db_dependent/Reserves.t
Add a hold, go to user menu with holds in OPAC.
At the same time, cancel this hold from staff.
Now click the Cancel in OPAC.

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 28483: Remove warnings from Search.t
Tomas Cohen Arazi [Tue, 22 Jun 2021 19:41:55 +0000 (16:41 -0300)]
Bug 28483: Remove warnings from Search.t

There are too many warnings about uninitialized variables in Search.pm.
This patch deals with that, the same way it is dealt accross the file:
by setting an empty string when things are not defined.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Search.t
=> FAIL: Wow, too many warnings. Some related to this bug, some not.
2. Apply this patch
3. Repeat 1
=> SUCCESS: No more warnings!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28673: Add missing ampersand to amp; construction
Marcel de Rooy [Wed, 7 Jul 2021 12:38:48 +0000 (12:38 +0000)]
Bug 28673: Add missing ampersand to amp; construction

Super trivial one character fix ;)

Test plan:
Open Your Lists from the button on main page.
Click again on Your lists under Lists in the middle of the form.
Verify that the URL does no longer show something like:
    op=listamp;category=1

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 28561: Remove DBIC warning in opac-shelves
Jonathan Druart [Fri, 18 Jun 2021 10:36:00 +0000 (12:36 +0200)]
Bug 28561: Remove DBIC warning in opac-shelves

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 28561: Fix noisy warning about $direction too
Marcel de Rooy [Mon, 14 Jun 2021 12:51:13 +0000 (12:51 +0000)]
Bug 28561: Fix noisy warning about $direction too

Use of uninitialized value $direction in string ne at /usr/share/koha/opac/opac-shelves.pl line 265.

Bonus:
Use of uninitialized value $sortfield in string eq at /usr/share/koha/opac/opac-shelves.pl line 264.

Test plan:
While testing patch 1, check the logs for these warnings with and
without this patch.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28399: Remove txn error from batchRebuildItemsTables.pl
Jonathan Druart [Thu, 24 Jun 2021 13:11:18 +0000 (15:11 +0200)]
Bug 28399: Remove txn error from batchRebuildItemsTables.pl

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 22544: Restore newdate and timestamp for slip notices
Jonathan Druart [Wed, 17 Feb 2021 10:59:51 +0000 (11:59 +0100)]
Bug 22544: Restore newdate and timestamp for slip notices

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Fixed typo pubished_on

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Fix OpacLoginInstructions
Jonathan Druart [Wed, 17 Feb 2021 10:50:39 +0000 (11:50 +0100)]
Bug 22544: Fix OpacLoginInstructions

Moved recently

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: TT plugin should return hashref only if news exist
Jonathan Druart [Wed, 17 Feb 2021 10:48:36 +0000 (11:48 +0100)]
Bug 22544: TT plugin should return hashref only if news exist

It restore the header and fix the RSS feeds (see comment 103)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Use template plugin for news author display
Josef Moravec [Tue, 19 Jan 2021 08:42:02 +0000 (08:42 +0000)]
Bug 22544: Use template plugin for news author display

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Add default language value to KohaNews template plugin
Josef Moravec [Mon, 18 Jan 2021 12:41:31 +0000 (12:41 +0000)]
Bug 22544: Add default language value to KohaNews template plugin

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Enhance exception description
Josef Moravec [Mon, 18 Jan 2021 11:49:51 +0000 (11:49 +0000)]
Bug 22544: Enhance exception description

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Clarify documentation and change param 'type' to 'location'
Josef Moravec [Mon, 18 Jan 2021 09:33:21 +0000 (10:33 +0100)]
Bug 22544: Clarify documentation and change param 'type' to 'location'

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Fix filtering by location on tools -> news management
Josef Moravec [Thu, 1 Oct 2020 05:39:19 +0000 (05:39 +0000)]
Bug 22544: Fix filtering by location on tools -> news management

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Update search_for_display to be able to take more types
Josef Moravec [Thu, 1 Oct 2020 05:03:52 +0000 (05:03 +0000)]
Bug 22544: Update search_for_display to be able to take more types

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Update to current codebase
Josef Moravec [Wed, 30 Sep 2020 18:58:01 +0000 (18:58 +0000)]
Bug 22544: Update to current codebase

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: (QA follow-up) Fix spelling
Josef Moravec [Mon, 2 Mar 2020 07:04:54 +0000 (07:04 +0000)]
Bug 22544: (QA follow-up) Fix spelling

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Refactor searching of news items
Josef Moravec [Wed, 20 Mar 2019 11:07:22 +0000 (11:07 +0000)]
Bug 22544: Refactor searching of news items

Test plan:
1) Go to tools and define some news
2) Try different parameters, try to edit new items, and delete some
3) Go to all places where news are presented and ensure that there are
the right ones shown:
    opac main page - based on language
    opac righ column (formerly syspref OpacNavRight) - based on language
    opac news rss feed
    circulation slip (not quick slip)
    intranet main page
4) run tests:
prove t/db_dependent/Koha/News.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Add tests
Josef Moravec [Wed, 20 Mar 2019 10:20:29 +0000 (10:20 +0000)]
Bug 22544: Add tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Move GetNewsToDisplay to Koha namespace
Josef Moravec [Wed, 20 Mar 2019 07:36:53 +0000 (07:36 +0000)]
Bug 22544: Move GetNewsToDisplay to Koha namespace

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 22544: fix count call - to squash

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Move add_opac_item to Koha namespace
Josef Moravec [Tue, 19 Mar 2019 10:35:23 +0000 (10:35 +0000)]
Bug 22544: Move add_opac_item to Koha namespace

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Move upd_opac_new to Koha namespace
Josef Moravec [Tue, 19 Mar 2019 10:30:27 +0000 (10:30 +0000)]
Bug 22544: Move upd_opac_new to Koha namespace

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Move del_opac_new to Koha namespace
Josef Moravec [Tue, 19 Mar 2019 10:23:40 +0000 (10:23 +0000)]
Bug 22544: Move del_opac_new to Koha namespace

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Move get_opac_news to Koha namespace
Josef Moravec [Tue, 19 Mar 2019 10:17:31 +0000 (10:17 +0000)]
Bug 22544: Move get_opac_news to Koha namespace

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22544: Move get_opac_new to Koha namespace
Josef Moravec [Tue, 19 Mar 2019 09:14:47 +0000 (09:14 +0000)]
Bug 22544: Move get_opac_new to Koha namespace

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28597: Fetch the logged in branchcode for OpacSuggestioninstructions
Nick Clemens [Fri, 18 Jun 2021 13:09:29 +0000 (13:09 +0000)]
Bug 28597: Fetch the logged in branchcode for OpacSuggestioninstructions

To test:
 1 - Set two news items with location 'OpacSuggestioninstructions'
 2 - One should be for all libraries
 3 - One should be for a specific library
 4 - Sign in to opac with user from the specific library
 5 - Add a suggestion
 6 - The instructions only show the all libraries item
 7 - Apply patch
 8 - Reload
 9 - All libraries and specific library items are shown
10 - Allow anonymous suggestions:  AnonSuggestions - Allow
11 - Sign out of opac
12 - Add a suggestion
13 - Only all librares news is visible

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 28455: Update wording on TrackLastPatronActivity
Andrew Fuerste-Henry [Thu, 3 Jun 2021 21:11:56 +0000 (21:11 +0000)]
Bug 28455: Update wording on TrackLastPatronActivity

This patch updates the wording on TrackLackPatronActivity to maintain the corrections from bug 28467 and also reflect the change made in this bug. It should now read: The first time each day that a patron either logs into the OPAC, connects to Koha via SIP, or checks an item out, borrowers.lastseen will update with the current date and time.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28455: lastseen should be updated at checkout if TrackLastPatronActivity is enabled
Nick Clemens [Tue, 25 May 2021 18:20:25 +0000 (18:20 +0000)]
Bug 28455: lastseen should be updated at checkout if TrackLastPatronActivity is enabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28611: Fix width to 50% for additem form elements
Jonathan Druart [Tue, 22 Jun 2021 09:46:55 +0000 (11:46 +0200)]
Bug 28611: Fix width to 50% for additem form elements

This patch suggests to set the width of select and input to 50%

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 28299: Make buildKohaItemsNamespace accept Koha::Items
Tomas Cohen Arazi [Mon, 10 May 2021 08:01:02 +0000 (10:01 +0200)]
Bug 28299: Make buildKohaItemsNamespace accept Koha::Items

This patch makes buildKohaItemsNamespace (and its only caller,
XSLTParse4Display) accept a an optional Koha::Items resultset.

This way we don't need to calculate (from the DB) the list of hidden
itemnumbers, but solve it in one query.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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 28299: Take OpacHiddenItems into account on opac-shelves
Jonathan Druart [Fri, 7 May 2021 09:16:17 +0000 (11:16 +0200)]
Bug 28299: Take OpacHiddenItems into account on opac-shelves

hidden_items was not passed to XSLTParse4Display

2 things:
* Should we hide the biblio record if OpacHiddenItemsHidesRecord is set?
* allow_onshelf_holds is not working like in other scripts, what's the
expected behaviour? If hidden should we completely ignore the item?

Test plan:
1. Without the patch
2. fill OpacHiddenItems with «damaged: [1]»
3. find a record with several item
4. mark one of them as damaged
5. OPAC: go to the record, you shouldn't see the damaged item
6. add the record to a list
7. see the list
8. in Availability you see the damaged item mentioned, this is the issue
9. apply the patches and restart the services
10. the list should not mention the damaged item :D

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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 28299: Unit tests for buildKohaItemsNamespace
Tomas Cohen Arazi [Mon, 10 May 2021 14:17:57 +0000 (11:17 -0300)]
Bug 28299: Unit tests for buildKohaItemsNamespace

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 28462: Remove line breaks in TT tags
Jonathan Druart [Wed, 23 Jun 2021 07:50:55 +0000 (09:50 +0200)]
Bug 28462: Remove line breaks in TT tags

Same as previous patch for other files.
Looks like the problem exists only with IF.

== test plan ==
1. See the problematic strings in a given language
     git grep "\bIF\b" misc/translator/po | grep -v '#' | grep '\bzh-Hant-TW'
2. update the language
   misc/translator/translate update zh-Hant-TW
3. Recheck the problematic strings, they aren't here anymore
4. Check the diff: git diff
   and search the if's with «/-.* IF » to see how the deleted strings
   look like and that it makes sense.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28462: Remove TT tag on several lines - opac-advsearch.tt
Jonathan Druart [Wed, 26 May 2021 14:24:32 +0000 (16:24 +0200)]
Bug 28462: Remove TT tag on several lines - opac-advsearch.tt

It fixes the translation in case the operators have been translated

Test plan:
1. misc/translator/translate update pt-BR
2. In pt-BR-opac-bootstrap.po , find OpacAdvSearchMoreOptions
3. sabotage the translation part, like replacing IF with something else
4. misc/translator/translate install pt-BR
5. enable and use pt-BR and hit opac-advsearch.pl
6. Notice the error
   Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/pt-BR/modules/opac-advsearch.tt line 409: unexpected token (e)                                                    [% IF (OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size> 0 e extended_options) ou (OpacAdvSearchOptions and OpacAdvSearchOptions.size> 0 e n expandido_options) %] at /kohadevbox/koha/C4/Templates.pm
7. Apply the patch and redo update and install of the language
8. Note that it's now working

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28524: Escape 'rank' in cat_issues_top.pl
Jonathan Druart [Wed, 16 Jun 2021 12:51:08 +0000 (14:51 +0200)]
Bug 28524: Escape 'rank' in cat_issues_top.pl

It's a MySQL 8 keyword

Test plan:
Turn off strict_sql_modes (there are other problems in this script)
Hit Home Reports > Most-circulated items
Submit the form

Without this patch you got:
  You have an error in your SQL syntax; check the manual that
  corresponds to your MySQL server version for the right syntax to use
  near 'RANK, biblio.biblionumber AS ID, itemcallnumber as CALLNUM,
  ccode as CCODE, loca' at line 1

With this patch applied you see the report result view

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 28523: Escape 'rank' in bor_issues_top.pl
Jonathan Druart [Wed, 16 Jun 2021 12:54:47 +0000 (14:54 +0200)]
Bug 28523: Escape 'rank' in bor_issues_top.pl

It's a MySQL 8 keyword

Test plan:
Turn off strict_sql_modes (there are other problems in this script)
Hit Home Reports > Patrons with the most checkouts
Submit the form

Without this patch you got:
    You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to
    use near 'RANK, borrowers.borrowernumber AS ID FROM `old_issues`

With this patch applied you see the report result view

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 28409: Adjust regression test
Jonathan Druart [Thu, 24 Jun 2021 07:55:23 +0000 (09:55 +0200)]
Bug 28409: Adjust regression test

We are no longer expecting an URI escaped value but a corrected category
value, either 1 or 2.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28409: Simplify data validation
Jonathan Druart [Fri, 21 May 2021 07:09:53 +0000 (09:09 +0200)]
Bug 28409: Simplify data validation

Simplify the affectation then trust it.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
JD Amended patch: remove duplicate comma

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28409: Comprehensively validate category in opac-shelves.pl
David Cook [Fri, 21 May 2021 06:52:25 +0000 (06:52 +0000)]
Bug 28409: Comprehensively validate category in opac-shelves.pl

Default to a category of 1 (ie Private). Only allow input of 1
or 2 (ie Public)

== Test plan ==
1. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?category=function(){window.location.href%20=%20%27https://git.koha-community.org/stats/koha-master/authors.html%27}()
2. Note that you are redirected to another website
3. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=add&shelfname=foo&category=9
4. Note that you can't see this list in the Lists (but it has been added to the database)
5. Apply the patch & restart services
6. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?category=function(){window.location.href%20=%20%27https://git.koha-community.org/stats/koha-master/authors.html%27}()
7. Note that you are not redirected to another website
8. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=add&shelfname=bar&category=9
9. Note that "bar" has been added as a Private list

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28615: (follow-up) Disable strict mode explicitly
Tomas Cohen Arazi [Tue, 29 Jun 2021 15:24:52 +0000 (12:24 -0300)]
Bug 28615: (follow-up) Disable strict mode explicitly

So Debian 9's version of Test::MockModule doens't have ->redefine, and
Ubuntu 20.04's doesn't recognise qw(nostrict). So the only solution is
to just remove the keywords use completely and move back to using
->mock, as the rest of the codebase.

FIXME: using ->mock might be hiding some errors (like a method not being
defined/removed) and should be avoided. ->redefine will explode if the
method doesn't already exist, which is what we want, to catch this kind
of errors. That's why ->mock in strict mode is forbidden. We should try
packaging a newer Test::MockModule ourselves.

Tested on master-buster, master-stretch and master-focal.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28615: (follow-up) Newer Test::MockModule forbid ->mock
Tomas Cohen Arazi [Tue, 29 Jun 2021 14:18:12 +0000 (11:18 -0300)]
Bug 28615: (follow-up) Newer Test::MockModule forbid ->mock

In strict mode, ->mock is forbidden and ->redefine needs to be used
instead. I tested this on buster to see if it breaks something, but it
doesn't.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28615: Fix t/Auth_with_shibboleth.t
Tomas Cohen Arazi [Mon, 28 Jun 2021 18:28:49 +0000 (15:28 -0300)]
Bug 28615: Fix t/Auth_with_shibboleth.t

This patch makes t/Auth_with_shibboleth.t use the new
t::lib::Mocks::Logger tools

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: Tomas Cohen Arazi <tomascohen@theke.io>