koha-equinox.git
4 years agoBug 24647: Remove PDF::API2::Simple from cpanfile
Julian Maurice [Wed, 12 Feb 2020 20:24:58 +0000]
Bug 24647: Remove PDF::API2::Simple from cpanfile

It is not used anywhere.

Also, remove PDF::API2::Page and PDF::API2::Util from cpanfile.
These modules are included in PDF::API2 which is already in cpanfile.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23527: BakerTaylorBookstoreURL is converted to escaped characters by template...
David Kuhn [Sat, 31 Aug 2019 23:23:16 +0000]
Bug 23527: BakerTaylorBookstoreURL is converted to escaped characters by template, rendering it invalid

Changing the template toolkit filter for rendering the value of
BakerTaylorBookstoreURL in opac-detail.tt and opac-results.tt from uri
to url fixes the problem.

To test (requires a Baker & Taylor username and password):

1. Enter the B&T url into BakerTaylorBookstoreURL.
2. Set BakerTaylorEnabled to "add" and enter your username and password.
3. Look up a title in the OPAC.
4. Locate a title with a cover image.
5. Click on the cover image. You are not redirected to the url stored
   in BakerTaylorBookstoreURL.
6. Display the full record for the title
7. Click on the cover image. You are not redirected to the url stored
   in BakerTaylorBookstoreURL.
8. Apply the patch.
9. Refresh the OPAC display.
10. Click on the cover image. You are now redirected to the specified url.
11. Return to the results list.
12. Click on a cover image. You are now redirected to the specified url.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Although I don't have valid Baker & Taylor credentials I was able to use
dummy data to verify that the links in the template are correctly
encoded with this patch.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24640: DBRev 19.12.00.023
Martin Renvoize [Wed, 19 Feb 2020 11:09:41 +0000]
Bug 24640: DBRev 19.12.00.023

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24640: Allow quotes.timestamp to be NULL
Jonathan Druart [Wed, 12 Feb 2020 11:26:25 +0000]
Bug 24640: Allow quotes.timestamp to be NULL

It is broken with strict mode enable, timestamp is created without
default value.

Note that the .sql installer file init the value with NOW(), which is
wrong.

DBD::mysql::st execute failed: Field 'timestamp' doesn't have a default
value [for Statement "INSERT INTO quotes (source, text) VALUES (?, ?);"
with ParamValues: 0="poeut", 1="pouet"] at
/kohadevbox/koha/tools/quotes/quotes_ajax.pl line 49.

Test plan:
Create a new quote of the day
=> Without this patch you will get an error

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24654: Remove trailing quote in rda264 XSLT
Nick Clemens [Thu, 13 Feb 2020 15:43:30 +0000]
Bug 24654: Remove trailing quote in rda264 XSLT

To test:
1 - Find or add a recod with a 264 field
2 - Make sure there is a subfield b
3 - View the record in opac
4 - Right click on publisher link and copy and paste into a text editor
5 - Note the trailing " in the search
6 - Apply patch
7 - Refresh
8 - Link is correctly formed now

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 7611: (follow-up) Adjust tests
Jonathan Druart [Tue, 18 Feb 2020 09:37:58 +0000]
Bug 7611: (follow-up) Adjust tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24002: (follow-up) Incorrect DATE value: '00-00-0000' in C4/Serials.pm
Jonathan Druart [Mon, 17 Feb 2020 17:18:48 +0000]
Bug 24002: (follow-up) Incorrect DATE value: '00-00-0000' in C4/Serials.pm

Oops, wrong copy/paste here! The column order changes was not expected.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24530: (QA follow-up) Add missing filter
Marcel de Rooy [Mon, 17 Feb 2020 14:05:20 +0000]
Bug 24530: (QA follow-up) Add missing filter

Jenkins is complaining about a missing filter:
xt/find-missing-filters.t, koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt line 573

The variable is just filled in the template but lets make Jenkins happy.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24621: Phase out jquery.cookie.js: Basic MARC editor
Owen Leonard [Mon, 10 Feb 2020 19:04:57 +0000]
Bug 24621: Phase out jquery.cookie.js: Basic MARC editor

This patch removes the use of the jquery.cookie plugin by the basic MARC
editor for setting two interface preferences: Showing MARC tag numbers
and showing MARC documentation links.

To test, apply the patch and open the basic MARC editor.

 - From the "Settings" menu, select the "Show MARC tag documentation
   links" link. This should toggle the display of the "?" link next to
   MARC tag descriptions.
 - Reload the page to confirm that your selection has been saved.
 - Perform the same test with the "Show tags" menu item.

You can also follow the changes to the cookie using the browser's
developer console. Look for cookies named 'marcdocs_***' and
'marctags_***' (where *** is the borrowernumber of the logged-in
user) and confirm that the value of each flips from "show" to "hide" and
back.

https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector
https://developers.google.com/web/tools/chrome-devtools/storage/cookies

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24619: Phase out jquery.cookie.js: MARC Frameworks
Owen Leonard [Mon, 10 Feb 2020 17:58:04 +0000]
Bug 24619: Phase out jquery.cookie.js: MARC Frameworks

This patch removes the use of the jquery.cookie plugin on the MARC
Frameworks page and replaces it with a call to the new js-cookie
library.

To test, apply the patch and go to Administration -> MARC
bibliographic frameworks.

 - Choose the 'MARC structure' menu item for one of the frameworks
   listed.
 - On the page which lists the tags in the framework, check the box
   labeled "Display only used tags/subfields." The page should reload.
 - The checkbox should remain checked and the list of tags should now
   show only used tags.
 - Uncheck the checkbox and the page should reload again.

You can also follow the changes to the cookie using the browser's
developer console. Look for a cookie named
'marctagstructure_selectdisplay' and confirm that the value flips from 0
to 1 and back.

https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector
https://developers.google.com/web/tools/chrome-devtools/storage/cookies

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 21921: Add date publication year to biblio Z39.50 search form in acquisition
Josef Moravec [Tue, 11 Feb 2020 19:03:18 +0000]
Bug 21921: Add date publication year to biblio Z39.50 search form in acquisition

Test plan:

1) Apply the patch
2) Have a Z39.50 endpoint with attr 31 defined - Library of Congress
supports this
3) Try to find some biblio records through Z39.50 using the new field
"Publication year" in acquisition module

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 21921: Add date publication year to biblio Z39.50 search form
Josef Moravec [Fri, 30 Nov 2018 09:06:22 +0000]
Bug 21921: Add date publication year to biblio Z39.50 search form

Test plan:

1) Apply the patch
2) Have a Z39.50 endpoint with attr 31 defined - Library of Congress
supports this
3) Try to find some biblio records through Z39.50 using the new field
"Publication year"

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24389: Better error handle when claiming late orders
Jonathan Druart [Mon, 16 Dec 2019 16:15:19 +0000]
Bug 24389: Better error handle when claiming late orders

A successful message says that the email has been sent and the order has
been claimed, but nothing happened.

Test plan:
0. Do not apply this patch
1. Create a new vendor, does not create a contact
2. Create some orders, close the basket
3. Go to the late orders page and claims some orders
=> You get a successful message, but the claim has not been done!
4. Apply this patch
5. Claim the orders
=> You get an error
6. Set a contact for the vendor
7. Claim the orders
=> Success

In the docker container, you may need to:
% apt install postfix
% postfix start
Edit /etc/hosts
127.0.0.1       localhost localhost.localdomain

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19718: (follow-up) Make messages translatable
Nick Clemens [Fri, 14 Feb 2020 14:02:09 +0000]
Bug 19718: (follow-up) Make messages translatable

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19718: Show message if patron has existing holds on a title
Nick Clemens [Wed, 28 Aug 2019 11:51:18 +0000]
Bug 19718: Show message if patron has existing holds on a title

To test:
 1 - Set a rule to allow multiple holds on a title
 2 - Place a single hold in the opac for a patron
 3 - Return to record and attempt place a second hold
 4 - Note there is no message but that you must match the type placed before (item or record level)
 5 - Don't place the hold
 6 - Apply patch
 7 - Attempt to place second hold again
 8 - Note there is a message informing you of which level hold you may place
 9 - Test with both item/record level holds and placing a single request or multiple requests

Signed-off-by: Donna Bachowski <donna@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23592: Link to the bibliographic record from the suggestion
Jonathan Druart [Tue, 12 Nov 2019 20:24:24 +0000]
Bug 23592: Link to the bibliographic record from the suggestion

If there is a link between a suggestion and a bibliographic record (ie.
if suggestion.biblionumber is set), it makes sense to have an hyperlink
on the suggestion detail page.

Test plan:
- Create 2 suggestions
- Create an order from one of them
- Go to the detail page of the suggestion
=> The one with the order has a to the bibliographic record
=> The other one is not linked with a bibliographic record, and so the
title is displayed, without hyperlink

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24651: Add maxdays option to fines cronjob
Martin Renvoize [Thu, 13 Feb 2020 10:46:22 +0000]
Bug 24651: Add maxdays option to fines cronjob

This patch adds an optional maxdays parameter to the fines.pl cronjob.
The new parameter allows system administrators to set a maximum number
of days for the job to process overdues.  This can improve performance.

Signed-off-by: Sally Healey <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24576: `StoreLastBorrower` preference is in the wrong tab and is confusing
David Roberts [Fri, 14 Feb 2020 17:36:49 +0000]
Bug 24576: `StoreLastBorrower` preference is in the wrong tab and is confusing

This patch moves the preference from OPAC/Privacy to Circulation/Check
In

To Test:

1) Apply the patch
2) Check that the system preference no longer displays under the OPAC
Privacy tab
3) Check that it now displays in the Circulation tab, under the Check In
policy
4) Ensure that the system preference can be changed and saved correctly.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 18499: (QA follow-up) Add missing colon after label description
Katrin Fischer [Sat, 15 Feb 2020 01:15:35 +0000]
Bug 18499: (QA follow-up) Add missing colon after label description

To match the line above, a colon (:) was added after the description:

Callnumber classification scheme: [pull down]

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 18499: (follow-up) Add missing filters
Nick Clemens [Fri, 14 Feb 2020 17:59:38 +0000]
Bug 18499: (follow-up) Add missing filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 18499: Use items cn_source in cn_browser.pl
Nick Clemens [Thu, 6 Feb 2020 13:14:30 +0000]
Bug 18499: Use items cn_source in cn_browser.pl

This does a few things:
 * We fetch the cn_sort from the DB and use this rather than calculating based on DefaultClassificationSource
   We were already pulling based on the items source, so this should not change things
 * Rather than using JS to submit the form, it submits via html
 * Fix subtitle display and add barcode (it was retrieved in one query but not used)
 * Add option to apply different classification scheme to the search

To test:
 1 - Add cn_browser.pl to the 'plugin' field in a framework for 952$o
 2 - Edit an item on a record in that framework
 3 - Enter an itemcallnumber
 4 - Click the two dots to launch the callnumber browser
 5 - Note the results
 6 - Apply patch
 7 - Repeat
 8 - Note subtitles and barcodes are displayed in results
 9 - Note callnumbers are appropriate
10 - Try changing the class source used
11 - Try this with differing dewey,lcc, and other callnumbers
12 - Ensure results are as expected

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24530: (QA follow-up) Include Syndetics in notes count
Marcel de Rooy [Mon, 10 Feb 2020 08:05:50 +0000]
Bug 24530: (QA follow-up) Include Syndetics in notes count

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24530: Show a number for title notes on opac-detail
Marcel de Rooy [Wed, 29 Jan 2020 14:15:02 +0000]
Bug 24530: Show a number for title notes on opac-detail

A number (just as on most other tabs) tells more than a boolean (i.e. the
tab does not appear for zero marc notes). Intuitively, you might be misled
by "Holdings (1), Descriptions" and think there are none.

Test plan:
Verify that the number of title notes on opac detail page matches your
expectations.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 8643: Add sporsorship
Martin Renvoize [Mon, 17 Feb 2020 11:22:21 +0000]
Bug 8643: Add sporsorship

Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 7611: (follow-up) separate positive and negative statuses as in the past
Nick Clemens [Fri, 8 Nov 2019 15:49:08 +0000]
Bug 7611: (follow-up) separate positive and negative statuses as in the past

This patch preserves someting closer to previous functionality.

Negative not for loan are in the 'unavailable' section in red, positive ones are in the 'reference' section in green. Itemtype level will also be in green in reference

Item specific status will override an itemtype level.

The line break between 'reference' and 'unavailable' existed before and is preserved - negative not for loan and checked out items appear here

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 7611: (follow-up) Fix display of undefined statuses and add a class
Nick Clemens [Tue, 5 Nov 2019 16:32:45 +0000]
Bug 7611: (follow-up) Fix display of undefined statuses and add a class

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 7611: (follow-up) Add missing space
Nick [Tue, 15 Oct 2019 13:30:02 +0000]
Bug 7611: (follow-up) Add missing space

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 7611: Change negative notforloan as well
Nick [Thu, 29 Aug 2019 12:06:24 +0000]
Bug 7611: Change negative notforloan as well

This makes the changes apply to both positive and negative notforloan values

The extra line generated before is removed

Some spans are added and cleaned up and labels moved to CSS to allow for easier altering where needed

Itemtypes marked notforloan remain as reference, the label can be changed via css

To test:
 1 - Have a record with items in various statuses, ideally
   - 3 available, with 2 in one branch, 1 in another
   - 3 with itemtype not for loan, 2 in one branch, 1 in another
   - 3 in a positive not for loan status, 2 and 1 as above
   - 3 in a negative not for loan status, 2 and 1 as above
   - 1 in a different positive loan status, but with the same opac description as the negative above
 2 - Search the opac to include this record, take a screenshot
 3 - Apply patch
 4 - Restart all and refresh
 5 - Compare to screen shot
 6 - Differences include:
   - Positive statuses are now on separate line with opac description showing
   - Unavailable (not for loan items) now include callnumber and branch in display
   - Positive and negative notforloan with same description are combined where branches match
   - Inspect the elements, note new spans around 'Items available for
loan/reference'
 7 - Add to OPACUserCSS:
  .ItemSummary .ItemBranch{
    display:none;
  }
  .unavailable .ItemSummary .CallNumber,.unavailable .ItemSummary .LabelCallNumber{
    display:none;
  }
 8 - Note the branches are hidden, and callnumbe rhidden for unavailable
items

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search...
Mehdi Hamidi [Fri, 3 Mar 2017 19:33:29 +0000]
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results

Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 15850: Correct eslint errors in cataloging.js
Owen Leonard [Mon, 6 Jan 2020 16:26:33 +0000]
Bug 15850: Correct eslint errors in cataloging.js

This patch makes corrections to cataloging.js so that there are no
issues flagged by eslint. The fewer eslint warnings we have to see makes
it more likely that real problems will be noticed.

Some functions were unused have been removed.

To test, apply the patch and clear your browser cache if necessary.

 - Open a MARC record for editing in the basic cataloging editor.
 - Test the JavaScript-driven functionality affected by the changed
   file:
    - Open the authority browser from a field (e.g. 100a) which is
      linked to an authority type.
    - Clone a repeatable tag.
    - Clone a repeatable subfield
    - "Unclone" a tag or subfield: This should remove the tag or
      subfield (if possible) or clear the contents of the tag or
      subfield if not.
    - Clone a subfield on the item edit page (In my MARC21 installation
      I had to modify the default framework in order to have a
      repeatable item subfield to test with).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23084: Replace grep {^$var$} with grep {$_ eq $var}
Jonathan Druart [Thu, 20 Jun 2019 01:54:40 +0000]
Bug 23084: Replace grep {^$var$} with grep {$_ eq $var}

We certainly faced 3 similar bugs due to this syntax: bug 23006, bug
22941 and bug 17526.

To prevent other issues related to this syntax this patch suggests to
replace them all in one go.

Test plan:
Confirm that the 2 syntaxes are similar
Eyeball the patch and confirm that there is no typo!

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 20882: DBRev 19.12.00.022
Martin Renvoize [Mon, 17 Feb 2020 10:43:37 +0000]
Bug 20882: DBRev 19.12.00.022

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 20882: Move items.uri to mediumtext
Marcel de Rooy [Mon, 10 Feb 2020 14:28:51 +0000]
Bug 20882: Move items.uri to mediumtext

Applies to items and deleteditems.

Test plan:
Run new install or upgrade. Check field size.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24506: Multibranch limit does not work with ElasticSearch
Andreas Jonsson [Fri, 24 Jan 2020 10:13:05 +0000]
Bug 24506: Multibranch limit does not work with ElasticSearch

Test plan
1. Set up a system with ElasticSearch
2. Set up or make sure ther are at least two branches
3. create a group of branches
4. make sure there are items associated with any library in the group
5. make a search in opac limited by the library group
6. make an advanced search in intra limited by the library group
7. change SearchEngine system preference to Zebra and repeat 5. and 6.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 13574: Fix display of repeatable item subfields
Marcel de Rooy [Mon, 10 Feb 2020 15:17:38 +0000]
Bug 13574: Fix display of repeatable item subfields

Applies to OPAC and staff: opac-MARCdetail and catalogue/MARCdetail.

Test plan:
[1] Pick an item. Pick two fields say URI and copy number, and fill these
with a value like A | B. (The pipe char is important.)
[2] Verify that the display of the item block on opac-MARCdetail shows
both A and B in those columns. (Previously only B was shown.)
[3] Verify the same on catalogue MARC detail, items tab.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24649: Fix two other missing <li> tags for cloned subfields
Marcel de Rooy [Thu, 13 Feb 2020 09:27:26 +0000]
Bug 24649: Fix two other missing <li> tags for cloned subfields

Same problem as previous patch in Batch item modification as well as
serial-edit.pl.

Test plan:
[1] Go to Tools/Batch item modification.
    Test cloning subfield on batchMod-edit.
[2] Go to a serial with "Create item when receiving".
    Receive an issue. Click add item.
    Test cloning subfield.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24649: Fix missing <li> tag on item editor for cloned subfield
Marcel de Rooy [Thu, 13 Feb 2020 08:56:35 +0000]
Bug 24649: Fix missing <li> tag on item editor for cloned subfield

Instead of the parentNode (which is a div), we need the parent of the div
(which is a li).
So a simple fix.

Test plan:
To see the difference, test first without patch applied:
Mark item subfield, say URI, as repeatable.
Clone that subfield in item editor.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 22898: Fix failure since bug 19618
Jonathan Druart [Tue, 21 Jan 2020 11:57:01 +0000]
Bug 22898: Fix failure since bug 19618

See comment in the code, this is not the correct fix, but cannot find
something better for now.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 22898: Since bug 23957, submit element is now a button (no longer input)
Jonathan Druart [Tue, 21 Jan 2020 11:56:22 +0000]
Bug 22898: Since bug 23957, submit element is now a button (no longer input)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 22898: Add selenium tests placing holds (staff)
Jonathan Druart [Mon, 13 May 2019 16:31:14 +0000]
Bug 22898: Add selenium tests placing holds (staff)

Quick selenium tests to prevent regressions like bug 22895.

Test plan:
Make sure the selenium tests return green

You can also test the buggy branch:
% git checkout v18.11.05
% prove t/db_dependent/selenium/basic_workflow.t
=> Failure
% git bz apply 22895.
% prove t/db_dependent/selenium/basic_workflow.t
=> Success

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24531: Fix OAI-PMH sets for records with repeated fields
Magnus Enger [Wed, 29 Jan 2020 22:59:44 +0000]
Bug 24531: Fix OAI-PMH sets for records with repeated fields

Currently, an OAI-PMH set mapping will only match if the value it
is looking for occurs in the first instance of a repeated field.

To test:
- Apply the first patch with two new tests
- Run something like this:
  sudo koha-shell -c "prove -v t/db_dependent/OAI/Sets.t" kohadev
- Verify that the last test fails
- Apply this secind patch
- Rerun the test file above
- Verify that all tests now pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24531: Test for OAI-PMH sets and repeated fields
Magnus Enger [Wed, 29 Jan 2020 22:56:32 +0000]
Bug 24531: Test for OAI-PMH sets and repeated fields

This patch adds two tests related to OAI-PMH sets. It creates a
dummy record with a repeated field, with different values. It then
tests if the record is caught by mappings that match the value in
the first field, and then if it is caught by mappings that match
the second field.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24661: Fix inclusion of locale-related javascript files
Julian Maurice [Fri, 14 Feb 2020 08:46:01 +0000]
Bug 24661: Fix inclusion of locale-related javascript files

2 js files (Gettext.js, i18n.js) + 1 generated js file (locale_data.js)
were added by bug 21156. Their URL are broken and the files are not loaded.

Use Template::Toolkit plugin Asset to include these files, and exclude
locale_data.js when language is english, because obviously translations
are not needed in this case.

Test plan:
1. Just make sure the files mentioned above are loaded correctly when in
   English and in other languages as well

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 21156: (RM follow-up) Correction to added filters
Martin Renvoize [Fri, 14 Feb 2020 11:42:54 +0000]
Bug 21156: (RM follow-up) Correction to added filters

These lines required url filters rather than uri filters, my mistake :(

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 15352: (RM follow-up) Add missing filters
Martin Renvoize [Fri, 14 Feb 2020 10:59:20 +0000]
Bug 15352: (RM follow-up) Add missing filters

Damn, I missed a case in the first followup!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 15352: Do not display the link if item.uri does not exist
Jonathan Druart [Fri, 14 Feb 2020 08:48:48 +0000]
Bug 15352: Do not display the link if item.uri does not exist

Otherwise there is a "Link to ressource" that points to the current url

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 15352: (RM follow-up) Add missing filters
Martin Renvoize [Fri, 14 Feb 2020 08:38:56 +0000]
Bug 15352: (RM follow-up) Add missing filters

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 15352: Use URLLinkText instead of URL for item links
Aleisha Amohia [Thu, 13 Feb 2020 00:37:43 +0000]
Bug 15352: Use URLLinkText instead of URL for item links

Use the value in URLLinkText in 952$u, or if not set, use 'Link to
resource'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24592: DBRev 19.12.00.021
Martin Renvoize [Thu, 13 Feb 2020 16:00:35 +0000]
Bug 24592: DBRev 19.12.00.021

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24592: Reword LOST_RETURN to LOST_FOUND
Martin Renvoize [Wed, 5 Feb 2020 11:54:20 +0000]
Bug 24592: Reword LOST_RETURN to LOST_FOUND

This patch updates the wording in the 'lost and found' process to more
closely reflect what the process is achieving by replacing 'RETURNED'
with 'FOUND'

Test plan:
1) Grep codebase for _FixAccountForLostAndReturned and note there are no
   longer any instanced of it.
2) Run t/db_dependent/Circulation.t and note it passes
3) Test returning/renewing an item that has been marked as lost and note
   the updated values in the accountlines now use LOST_FOUND as
   credit_type_code and 'FOUND' as the status for the 'LOST' fee
   (debit_type_code 'LOST')

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24592: Database Update
Martin Renvoize [Wed, 5 Feb 2020 12:19:34 +0000]
Bug 24592: Database Update

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24643: Add test to cover the timezone
Jonathan Druart [Thu, 13 Feb 2020 13:24:52 +0000]
Bug 24643: Add test to cover the timezone

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24643: Add unit tests
Andrew Isherwood [Wed, 12 Feb 2020 16:28:58 +0000]
Bug 24643: Add unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24643: Support fractional seconds
Andrew Isherwood [Wed, 12 Feb 2020 16:04:07 +0000]
Bug 24643: Support fractional seconds

This patch allows dt_from_string to handle RFC3339 strings containing
fractional seconds up to one thousandth of a second.

Test plan:

- Apply patch
- prove t/DateUtils.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24611: Fix wrong budget_id query param in /acquisitions/orders
Tomas Cohen Arazi [Fri, 7 Feb 2020 12:51:10 +0000]
Bug 24611: Fix wrong budget_id query param in /acquisitions/orders

This patch fixes the wrong query parameter that slipped on rewriting the
patches for the voted RFC.

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> FAIL: Tests fail because fund_id is not a valid query parameter
3. Apply this patch
4. Repeat (2)
=> SUCCESS: Tests pass!
5. Sign off :-D

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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24611: Regression test
Tomas Cohen Arazi [Fri, 7 Feb 2020 12:53:32 +0000]
Bug 24611: Regression test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24361: Silent Items/GetItemsForInventory.t
Jonathan Druart [Thu, 13 Feb 2020 09:29:56 +0000]
Bug 24361: Silent Items/GetItemsForInventory.t

It was displaying hundreds of:
Use of uninitialized value in concatenation (.) or string at
/kohadevbox/koha/C4/Items.pm line 862.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19735: (RM follow-up) Update debian/control
Martin Renvoize [Thu, 13 Feb 2020 08:30:00 +0000]
Bug 19735: (RM follow-up) Update debian/control

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19735: Remove C4::Installer::PerlDependancies
Martin Renvoize [Wed, 12 Feb 2020 16:29:11 +0000]
Bug 19735: Remove C4::Installer::PerlDependancies

This patch does the actual removal of the PerlDependancies module.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19735: (RM follow-up) Final update of cpanfile at push
Martin Renvoize [Wed, 12 Feb 2020 16:28:15 +0000]
Bug 19735: (RM follow-up) Final update of cpanfile at push

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19735: Update cpanfile
Jonathan Druart [Wed, 12 Feb 2020 11:46:34 +0000]
Bug 19735: Update cpanfile

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19735: Add support for max_ver
Martin Renvoize [Fri, 7 Feb 2020 16:51:33 +0000]
Bug 19735: Add support for max_ver

This patchset adds support for extracting 'max_ver' from the cpanfile so
we can use version ranges properly and report errors if we have modules
installed that do not fit within that version range.

Test plan:
1) Manually modify the module version of a required module in the cpanfile
   to have a max version greater than the version you have installed.
2) Run through the install proceedure and note the new warning that a
   module needs upgrade for the module in question.
3) The module should also be reported in the about page

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19735: (QA follow-up) Drop references to 'usage'
Martin Renvoize [Fri, 7 Feb 2020 16:59:44 +0000]
Bug 19735: (QA follow-up) Drop references to 'usage'

The 'usage' key was dropped as part of this migration to cpanfile but
it was still refered to by the installed. This patch simply removes
references to it. After considering how we might add it back in I
decided that as it stands it wasn't a well maintained list and should be
re-implimented in the future in a more consistent form if we miss it.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19735: Move Perl deps definitions into a cpanfile
Julian Maurice [Thu, 26 Oct 2017 16:28:02 +0000]
Bug 19735: Move Perl deps definitions into a cpanfile

cpanfile is a format for describing CPAN dependencies for Perl
applications.
It is more concise - thus easier to read and maintain - than
C4::Installer::PerlDependencies, and allows to describe requirements
more accurately (using version ranges or features for instance)
Additionally it can be read by tools such as cpanm or carton for an
easy way to install dependencies on non-Debian-based systems.

For more information on cpanfile, see
http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod

This patch replace C4::Installer::PerlDependencies by an equivalent
cpanfile and update all scripts/modules that were using PerlDependencies
It also removes dead code from C4::Installer::PerlModules (some
subroutines were not used at all, except in unit tests)

Added dependencies:
 - Module::CPANfile
 - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent
   version than the one Module::CPANfile requires)

Test plan:
  1. Go to About page, tab Perl modules and keep this browser tab open
  2. Apply patch
  3. Install Module::CPANfile and CPAN::Meta
    a. On Debian-based systems:
       # will install libcpan-meta-perl as a dependency
       sudo apt install libmodule-cpanfile-perl
    b. Others:
       # will install CPAN::Meta as a dependency
       sudo cpanm Module::CPANfile
  4. In a new browser tab, go to About page, tab Perl modules and compare
     the table with the one in the previous browser tab
     They should be identical, except for newly added dependencies
     (Module::CPANfile and CPAN::Meta)
  5. Do a 'standard' install
    a. perl Makefile.PL (select 'standard')
    b. make
    c. sudo make install
    d. Configure your database, web server, ... and go through the web
       install process
  6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which
     should be /usr/share/koha/lib)
  7. Go to the about page of this fresh install and compare it with your
     dev install
  8. Verify that debian/list-deps still works
     This takes a lot of time and it may not be necessary to wait until
     the end. If you see some Debian package names that correspond to
     modules in cpanfile, it means it still works
     (you need apt-file for this script to work)
  9. Verify that koha_perl_deps.pl still works
 10. prove t/Installer_pm.t t/Installer_PerlModules.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24642: Make Cache::Memcached::Fast::Safe required
Jonathan Druart [Wed, 12 Feb 2020 14:24:35 +0000]
Bug 24642: Make Cache::Memcached::Fast::Safe required

There is something wrong between the logic in Koha::Cache->new and our
dependencies.

We are having Cache::Memcached required, but
Cache::Memcached::Fast::Safe is optional.
However, in Koha::Cache->new we are initializing the Memcached cache
only if Cache::Memcached::Fast::Safe is installed.

We could fix the logic in Koha::Cache, but it seems better to make
Cache::Memcached::Fast::Safe mandatory (especially after bug 13193).

Note that after bug 13193, you are loosing the Memcached cache, as
Cache::Memcached::Fast::Safe will not get installed by default.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24340: allow koha-sip --disable inst
Liz Rea [Fri, 3 Jan 2020 17:35:20 +0000]
Bug 24340: allow koha-sip --disable inst

To test:

- Enable sip for your testing instance
 sudo koha-sip --enable inst
- Start sip for your testing instance
 sudo koha-sip --start inst
- Verify it is running
 ps ax |grep sip -> you should see processes
- Disable sip for your testing intance
 sudo koha-sip --disable inst
- Verify that the following has happened:
 * SIP is no longer running for your instance - no SIP processes
 * SIP Cannot be started for the instance because it is not enabled.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19014: (QA follow-up) Update test for AddReserve change
Martin Renvoize [Tue, 11 Feb 2020 16:40:04 +0000]
Bug 19014: (QA follow-up) Update test for AddReserve change

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19014: on_reserve blocks auto_renew
Nick Clemens [Tue, 11 Feb 2020 13:18:10 +0000]
Bug 19014: on_reserve blocks auto_renew

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19014: Return auto_too_soon before on_reserve
Nick Clemens [Tue, 11 Feb 2020 12:46:42 +0000]
Bug 19014: Return auto_too_soon before on_reserve

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19014: Unit tests
Nick Clemens [Mon, 30 Dec 2019 19:27:26 +0000]
Bug 19014: Unit tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 8643: Fix IsMarcStructureInternal tests
Jonathan Druart [Tue, 11 Feb 2020 15:44:07 +0000]
Bug 8643: Fix IsMarcStructureInternal tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 8643: DBRev 19.12.00.020
Martin Renvoize [Tue, 11 Feb 2020 14:36:55 +0000]
Bug 8643: DBRev 19.12.00.020

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 8643: Code cleanup
Maryse Simard [Mon, 13 Jan 2020 16:21:09 +0000]
Bug 8643: Code cleanup

Merges "AreMandatoriesNotOk" and new "AreImportantsNotOk" into one
function "AreFieldsNotOk". It can search for mandatory or important
fields depending on the value of it's boolean "mandatory"
parameter.

To test:
This patch should not change current behavior.
Follow the test plan from previous patch and check that saving is
still prevented for unfilled mandatory fields.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 8643: Add important constraint to marc subfields
simith [Fri, 18 Dec 2015 14:40:02 +0000]
Bug 8643: Add important constraint to marc subfields

This fix permits to add an "Important" option to the marc structure pages.

Testing:

1) Apply the patch
2) Run updatedatabase.pl
3) Regenerate CSS
4) Define 100 as an "important" field ( Administration » MARC bibliographic framework » MARC structure ( Default Frameword) » Edit )
5) Define 100$a as an "important" subfield (Administration » MARC bibliographic framework » MARC structure (Default Frameword) » Subfield » Onglet a)
6) Edit a record to clear the field 100 (subfields are all blank)
7) Save the record.
8) Validate the following message:

A few important fields are not filled:

    * tag 100 subfield a Nom de personne in tab
    * Field 100 is important, at least one of its subfields should be filled.

Are you sure you want to save?

Sponsored by the CCSR ( http://www.ccsr.qc.ca )
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 14711: Change prototype for AddReserve - pass a hashref
Jonathan Druart [Thu, 16 Aug 2018 17:41:37 +0000]
Bug 14711: Change prototype for AddReserve - pass a hashref

The number of parameters of AddReserve makes it hard to read and
maintain.
This patch replace it with a hashref, which will make the calls more
readable.

Moreover the bibitems has been removed as it was not used by the
subroutine.

Test plan:
- Make sure the tests pass
- Read the diff and search for typos
- Place a hold on few items

Note for QA: reservation_date and expiration_date do not match the DB column's names,
should we?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 21156: (RM follow-up) Add missing filters
Martin Renvoize [Mon, 10 Feb 2020 14:13:04 +0000]
Bug 21156: (RM follow-up) Add missing filters

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24585: Add 'Managed on' and 'Suggested on' columns to pat_purchase_suggestions.tt
Lucas Gass [Wed, 5 Feb 2020 01:04:52 +0000]
Bug 24585: Add 'Managed on' and 'Suggested on' columns to pat_purchase_suggestions.tt

This patch adds 2 new columns on the suggestions table on purchase-suggestions.tt. These use the data-order attribute to allow for sorting.
TEST PLAN:
1. Have a patron with some suggestions that have been managed by staff. (accept or reject the request).
2. View that patrons suggestions from purchase-suggestions.pl.
3. No suggested on or managaed on columns.
4. Apply patch and reload the page.
5. The new columns are there, have multiple suggestions and make sure sorting by the date works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 21156: Add plural translation capabilities to JS files
Julian Maurice [Mon, 4 Jan 2016 20:08:29 +0000]
Bug 21156: Add plural translation capabilities to JS files

It adds Javascript equivalent of Koha::I18N's exported subroutines, and
they are used the same way.

String extraction is done only on *.js files and require gettext 0.19
(available in Debian jessie, and also in wheezy-backports)

It adds Javascript library Gettext.js for handling translation and a
Perl script po2json to transform PO file into JSON.

Gettext.js and po2json both come from Locale::Simple.
There are several tools named po2json. It's simpler to integrate this
one into Koha than to check if the good one is installed on the system.
Locale::Simple is not needed.

To avoid polluting the global namespace too much, this patch also
introduce a global JS object named Koha and add some stuff in Koha.i18n

Test plan:
1. Add a translatable string in a JS file. For example, add this:
     alert(__nx("There is one item", "There are {count} items", 3,
     {count: 3}));
   to staff-global.js
2. cd misc/translator && ./translate update fr-FR
3. Open misc/translator/po/fr-FR-messages-js.po, verify that your
   string is present, and translate it
4. cd misc/translator && ./translate install fr-FR
5. (Optional) Verify that
   koha-tmpl/intranet-tmpl/prog/fr-FR/js/locale_data.js exists and
   contains your translation
6. Open your browser on the staff main page, change language and verify
   that the message is translated
7. Repeat 1-6 on OPAC side

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works well, translation is OK and test message is displayed correctly.
Current qa-tool error is a false positive.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24526: Add the confirm flag to the cronjob files
Jonathan Druart [Thu, 6 Feb 2020 10:33:12 +0000]
Bug 24526: Add the confirm flag to the cronjob files

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24526: Set verbose if confirm not set
Jonathan Druart [Wed, 5 Feb 2020 15:05:19 +0000]
Bug 24526: Set verbose if confirm not set

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24526: Replace commit with confirm
Jonathan Druart [Wed, 5 Feb 2020 15:03:42 +0000]
Bug 24526: Replace commit with confirm

Usually commit takes a value

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24526: Use sprintf for readability
Jonathan Druart [Wed, 5 Feb 2020 15:02:25 +0000]
Bug 24526: Use sprintf for readability

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24526: (follow-up) clean up verbose conditional
Nick Clemens [Wed, 29 Jan 2020 13:48:09 +0000]
Bug 24526: (follow-up) clean up verbose conditional

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24526: Add verbose and commit options to automatic_renewals cronjob
Nick Clemens [Tue, 28 Jan 2020 14:27:06 +0000]
Bug 24526: Add verbose and commit options to automatic_renewals cronjob

To test:
 1 - Apply patch
 2 - Have some items marked for auto-renewal
 3 - Run the job with no parameters
 4 - It should print 'Test mode'
 5 - Provide -v
 6 - It should print 'Test mode' then a line for each item
 7 - Provide -v -c
 8 - It should not say test mode, but should provide a line for each item
 9 - Provide -c
10 - Shoudl run as expected with no output

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 21177: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl
Julian Maurice [Wed, 8 Aug 2018 13:40:09 +0000]
Bug 21177: Use koha-conf.xml in misc/devel/update_dbix_class_files.pl

It is annoying to have to specify database connection parameters each
time DBIx::Class files need to be updated.

This patch adds a new option --koha-conf that takes an optional <path>
which defaults to the value of KOHA_CONF environment variable, and use
the database connection parameters found in that file.
--db_* options override values from $KOHA_CONF

Test plan:
1. Run the script with the same parameters as before the patch and see
   that it still works.
   Example:
     misc/devel/update_dbix_class_files.pl --db_name koha_dev \
     --db_user koha --db_pass koha

2. Verify that KOHA_CONF is set and execute:
     misc/devel/update_dbix_class_files.pl --koha-conf
   Verify that Koha/Schema files were updated accordingly

3. Execute:
    misc/devel/update_dbix_class_files.pl --koha-conf \
    /path/to/another/koha-conf.xml
   Verify that Koha/Schema files were updated accordingly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 11281: Printing holds awaiting pickup prints both tabs
Owen Leonard [Fri, 22 Nov 2019 19:29:53 +0000]
Bug 11281: Printing holds awaiting pickup prints both tabs

This patch adds columns configuration to the holds awaiting pickup
tables. Doing so helps solve the printing issue by adding a "Print"
option to both tables. Using this print function will provide a
printable version of only that table.

To test you should have multiple holds in your system which are marked
"waiting" and some which have been waiting longer than the value
specified in the ReservesMaxPickUpDelay system preference.

Apply the patch and go to Circulation -> Holds awaiting pickup.

 - On both the "Holds waiting" and "Holds waiting over..." tabs the
   DataTable should display correctly and all the controls should work,
   including the columns settings and the choices in the export menu.
 - Confirm that the "Print" action creates a printable version of only
   the table you are viewing.

 - Go to Administration -> Columns settings -> Circulation.
 - Change some visibility controls for the tables under the
   "holds_awaiting_pickup" heading (id=holdso and id=holdst). Confirm
   that these changes are reflected in the "Holds waiting" interface.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24462: Adapt mapping to voted RFC (Invoices)
Tomas Cohen Arazi [Mon, 20 Jan 2020 14:29:11 +0000]
Bug 24462: Adapt mapping to voted RFC (Invoices)

This trivial patch changes the attribute names for API reprensentation
of Koha::Acquisition::Invoice objects.

To test:
1. Open https://wiki.koha-community.org/wiki/Acquisitions_invoices_endpoint_RFC
2. Check the mappings are correct
=> SUCCESS: The patch makes the right changes to the mappings
3. Sign off :-D

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: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 22860: Remove 1 remaining patron after authentication.t is ran
Jonathan Druart [Mon, 6 May 2019 20:37:38 +0000]
Bug 22860: Remove 1 remaining patron after authentication.t is ran

Test plan:
0/ Do not apply the patch
1/ select count(*) from borrowers;
2/ Run the tests
=> Notice that you have 1 more patron
3/ Apply the patch and repeat 1/ and 2/
=> Notice that you have the same number of patrons before and after the
tests

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24516: Add account_type to the columns settings on boraccount
Jonathan Druart [Mon, 3 Feb 2020 16:31:42 +0000]
Bug 24516: Add account_type to the columns settings on boraccount

The column was missing from the yml file.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 13305: Remove tabindex from PrepareItemsRecordDisplay
Marcel de Rooy [Mon, 20 Jan 2020 12:41:51 +0000]
Bug 13305: Remove tabindex from PrepareItemsRecordDisplay

Test plan:
Check the tab order of the item block on additem.pl (item editor),
Acquisition (neworderempty or addiso2709), serials-edit.pl.
You could also check services/itemrecorddisplay.pl and pass a
biblionumber; this script is used in additem.js for cataloguing and
acquisition.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 16719: (QA follow-up) Remove tabs
Nick Clemens [Fri, 7 Feb 2020 16:52:52 +0000]
Bug 16719: (QA follow-up) Remove tabs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 16719: (follow-up) Update check on password mapping
Oliver Behnke [Fri, 7 Feb 2020 12:35:21 +0000]
Bug 16719: (follow-up) Update check on password mapping

Change to allow for unmapped default passwords

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 16719: Pass through undef rather than empty string in LDAP mapping
Oliver Behnke [Fri, 7 Feb 2020 12:31:31 +0000]
Bug 16719: Pass through undef rather than empty string in LDAP mapping

Nullable DB fields should be passed null in cases where ldap fields are
empty and not replaced with empty strings.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24525: (QA follow-up) Make payment type required with cash registers
Martin Renvoize [Mon, 10 Feb 2020 09:15:51 +0000]
Bug 24525: (QA follow-up) Make payment type required with cash registers

The use of cash registers adds the requirement to enter a payment type,
this patch adds the required status when cash registers are configured.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24525: (follow-up) Factor out to an include
Martin Renvoize [Tue, 28 Jan 2020 14:05:35 +0000]
Bug 24525: (follow-up) Factor out to an include

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24525: Remove SIP payment types from point of sale
Martin Renvoize [Tue, 28 Jan 2020 14:05:35 +0000]
Bug 24525: Remove SIP payment types from point of sale

This patch removes the SIP payments types from displaying in the select
options on the point of sale payment page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23640: Flushing L1 on every SIP connection
Jonathan Druart [Thu, 14 Nov 2019 09:50:24 +0000]
Bug 23640: Flushing L1 on every SIP connection

This patch flushes the L1 cache on each SIP connection
(ie every invocation of process_request).

This means each SIP connection will fetch values from the
L2 cache (ie memcached) and persist the L1 cache (in Perl
memory cache) only until a new SIP connection comes in.

Without this patch, the L1 cache persists for the length
of the server process, which means the L1 cache will become
stale very quickly, which can lead to unexpected behaviour.

Test plan:
1. Enable IssueLog
2. Start SIP server
    2a. change to Koha git directory
    2b. koha-shell kohadev
    2c. perl C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
3. Issue book via SIP

    perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 1 --item 3999900000001 -m checkout

4. Check action_logs for "CIRCULATION ISSUE <borrowernumber> <biblionumber>" line

    http://localhost:8081/cgi-bin/koha/tools/viewlog.pl

5. Disable IssueLog

6. Check in the book and then check it out again

    perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 1 --item 3999900000001 -m checkin
    perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL --patron 1 --item 3999900000001 -m checkout

7. Check action_logs for "CIRCULATION ISSUE <borrowernumber> <biblionumber>" line

    http://localhost:8081/cgi-bin/koha/tools/viewlog.pl

8. Note results

Without the patch, you'll see a 2nd checkout.

With the patch, you won't see the 2nd checkout.

(Note: After applying the patch, you have to restart the SIP server.)

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24482: Fix for formatted price issue with value over 1000
Martin Renvoize [Mon, 27 Jan 2020 14:56:35 +0000]
Bug 24482: Fix for formatted price issue with value over 1000

This patch for the point of sale feature fixes an issue where items for
purchase with a value of $1,000 or more break the payment calculations.

Test plan:
1) Enable the point of sale feature
   (EnablePointOfSale + UseCashRegisters system preferences)
2) Add a cash register for a library
   (Home > Point of sale > Cash registers > New cash register)
3) Create a purchase item with a cost of $1000
   (Home > Point of sale >  Purchase items > New debit type)
4) Go to to the point of sale page and attempt to sell one of your items
   (Home > Point of sale > click 'Add' next to the item to purchase)
5) Note that Koha inserts a comma into the price in the list of items for
   purchase
6) Note that the 'Amount being paid' changes to 0.00 instead of $1,000,
   which affects the other calculations
7) Apply the patch
8) Repeat step 4
9) Amount being paid and other calculations should now be correct
10) Enter an amount for 'Collected from patron' and click 'Confirm'
    check that the change calculation is correct.
11) Sign-off the patch!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24602: Make get_onshelfholds_policy fallback to 0
Tomas Cohen Arazi [Thu, 6 Feb 2020 14:10:39 +0000]
Bug 24602: Make get_onshelfholds_policy fallback to 0

The onshelfholds circulation rules values are more of an ENUM type (as
opposed to other rules with integers like max*qty). In the
quantities cases, it makes sense to have undef mean unlimited. In the
enum type it is clearer to just set a default value (0) as the code
already expects (Note: undef and 0 both eval to false so there's no
behaviour problem, but warnings or we get forced to check for
defined when the rule is used. It seems trivial to just make the
rule fallback to a chosen default value).

This patch makes it fallback to 0.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/CirculationRules.t \
           t/db_dependent/Reserves.t
=> FAIL: CirculationRules.t fails and Reserves.t prints a warning
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests pass! No warning!
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24602: Tests for get_onshlefholds_policy
Tomas Cohen Arazi [Thu, 6 Feb 2020 14:09:12 +0000]
Bug 24602: Tests for get_onshlefholds_policy

Ths patch introduces tests for get_onshelf_policy.
To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/CirculationRules.t
=> FAIL: Tests fail because the current code returns undef instead of 0

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>