koha.git
4 years agoBug 23822: Fix deletion of patrons with credit
Jonathan Druart [Mon, 11 Nov 2019 11:35:30 +0000]
Bug 23822: Fix deletion of patrons with credit

There are bugs in both master and 19.05, but different.

Anyway we should have this check to make sure a negative value will have
the same behavior: trigger the confirmation message (instead of a blank
page).

If we want to reject the deletion of a patron with credit we should
handle it on a separate bug report (behavior change)

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

4 years agoBug 23985: (bug 21206 follow-up) Fix checkout list when "Hold pickup library match...
Jonathan Druart [Tue, 12 Nov 2019 17:00:02 +0000]
Bug 23985: (bug 21206 follow-up) Fix checkout list when "Hold pickup library match" not set

This patch restores the behavior prior to bug 21206.
If "Hold pickup library match" is "Not set", then
hold_fulfillment_policy equals an empty string.

Test plan:
1. Go to "Circulation and fines rules"
2. Under "Default checkout, hold and return policy", unset "Hold pickup
library match" and Save
3. Place a hold on one item for one patron
4. Try to checkout the same item with another patron

=> Without this patch you the checkout list do not show, and the logs
contain "The method Koha::Item-> is not covered by tests!"
=> With this patch applied you see the checkout list

QA will take care of comparing the statement with the one before bug 21206
and make sure they are equivalent

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

4 years agoBug 24026: (bug 22847 follow-up) Display correctly max[onsite]issueqty (not the propa...
Jonathan Druart [Wed, 13 Nov 2019 11:35:45 +0000]
Bug 24026: (bug 22847 follow-up) Display correctly max[onsite]issueqty (not the propagated ones)

See bug 22847. We should never call ->Get in this template, we want
to display the values in the DB, not the calculated ones

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

4 years agoBug 24026: (bug 22847 follow-up) Remove c/p issues
Jonathan Druart [Wed, 13 Nov 2019 11:35:39 +0000]
Bug 24026: (bug 22847 follow-up) Remove c/p issues

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

4 years agoBug 23765: Do not display localized templates if TranslateNotices is off
Jonathan Druart [Thu, 7 Nov 2019 10:41:29 +0000]
Bug 23765: Do not display localized templates if TranslateNotices is off

To test:
1. Enable multi-languages
2. Set the preference 'TranslateNotices' on  'Allow'
3. Go to: tools==>Notices & slips==>Edit, make sure it has multilingual
email templates.
4. Set the preference TranslateNotices on 'Don't allow'.
5. Go to: tools==>Notices & slips==>Edit, the template shows several tab
for the same transport type.
6. Apply the patch.
7. Repeat the steps 4 and 5
8. Success. It only shows the default template when TranslateNotices is
'Dont allow'.

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

4 years agoBug 24030: Fix GetItemsForInventory under MySQL 8
Jonathan Druart [Wed, 13 Nov 2019 10:09:37 +0000]
Bug 24030: Fix GetItemsForInventory under MySQL 8

t/db_dependent/Items/GetItemsForInventory.t .. 1/9 DBD::mysql::st execute failed: Expression #1 of ORDER BY clause is not in SELECT list, references column 'koha_kohadev.items.cn_sort' which is not in SELECT list; this is incompatible with DISTINCT [for Statement "
        SELECT DISTINCT(items.itemnumber), barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber

        FROM items
        LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber
        LEFT JOIN biblioitems on items.biblionumber = biblioitems.biblionumber
     ORDER BY items.cn_sort, itemcallnumber, title"] at /kohadevbox/koha/C4/Items.pm line 838.

We simply follow what the error says, and add items.cn_sort to the SELECT list

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

4 years agoBug 24030: Remove OldWay comparaison from GetItemsForInventory.t
Jonathan Druart [Wed, 13 Nov 2019 10:09:43 +0000]
Bug 24030: Remove OldWay comparaison from GetItemsForInventory.t

This has been introduced to make sure there were no regression at a
given point. But now we are fixing the "old way" so it does not make
sense to keep it any longer

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

4 years agoBug 24029: Remove "Truncated incorrect DOUBLE value: '01e'" from marcrecord2csv.t
Jonathan Druart [Wed, 13 Nov 2019 09:50:41 +0000]
Bug 24029: Remove "Truncated incorrect DOUBLE value: '01e'" from marcrecord2csv.t

marc_subfield_structure.tagfield is a varchar(3)

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

4 years agoBug 24022: Try to fix 'connect failed'
Jonathan Druart [Tue, 12 Nov 2019 16:34:42 +0000]
Bug 24022: Try to fix 'connect failed'

I am assuming that the tests fail on Jenkins's nodes because they are
too slow. The server is not setup yet when we are trying to access it.
Just a guess...

Note that sleep is usually a bad idea...

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

4 years agoBug 24022: Remove unecessary delete from authorised_values
Jonathan Druart [Tue, 12 Nov 2019 16:16:44 +0000]
Bug 24022: Remove unecessary delete from authorised_values

Why do we need that exactly?
The cache is not flushed so it should not be needed.

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

4 years agoBug 24022: Prevent Session2.t to fail if run after Session.t
Jonathan Druart [Tue, 12 Nov 2019 16:15:35 +0000]
Bug 24022: Prevent Session2.t to fail if run after Session.t

Cache must be cleaned!

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

4 years agoBug 23983: Remove comment
Katrin Fischer [Wed, 13 Nov 2019 11:19:42 +0000]
Bug 23983: Remove comment

I think we can do without the comment - suggesting removal with
this patch.

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

4 years agoBug 23983: Contextualization of 'Order' (verb) vs 'Order' (noun)
Caroline Cyr La Rose [Wed, 6 Nov 2019 23:24:13 +0000]
Bug 23983: Contextualization of 'Order' (verb) vs 'Order' (noun)

This patch adds context (word class, either verb or noun) to the word
'Order' when it is displayed alone in the acquisitions module.

The following files have been modified:
basket.tt
neworderbiblio.tt
newordersubscription.tt
newordersuggestion.tt
ordered.tt
parcel.tt
spent.tt
transferorder.tt
uncertainprice.tt
z3950_search.tt

To test, check all those pages in English to make sure there is
no change.
1- Go to Acquisitions
2- Create a basket
3- Add to basket from an existing record (neworderbiblio)
4- Add to basket from a subscription (newordersubscription)
5- Add to basket from a suggestion (newordersuggestion)
6- Add to basket from an external source (z3950_search)
7- In one of the orders, check the uncertain price box
8- Check the basket display table (basket)
9- Click transfer on one of the orders (transferorder)
10- Go to the vendor page and click on 'Uncertain prices' (uncertainprice)
11- Click on 'Receive parcel' (parcel)
12- Go to the Acquisitions home page and click on the
amount for 'ordered' (ordered)
13- Go to the Acquisitions home page and click on the
amount for 'spent' (spent)

Next, install a new language (fr-CA used as example)
1- translate create fr-CA
2- open fr-CA-messages.po and add a translation for Order
(verb) and Order (noun) (it doesn't have to be real, just
write something different for each)
3- translate install fr-CA
4- in the system preferences, enable the french language in
'language'
5- change interface language to french

Redo the tests above to make sure the word you put in the translation
for the verb is in the places where 'Order' should be a verb and that
the translation you put in for the noun is in the places where 'Order'
should be a noun

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23932: Typo on 'aqinvoice_adjustments.encumber_open' description in Koha Schema
Séverine QUEUNE [Fri, 8 Nov 2019 13:22:18 +0000]
Bug 23932: Typo on 'aqinvoice_adjustments.encumber_open' description in Koha Schema

Correct a typo in Koha Schema comment. finds --> funds

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23846: Handle exception gracefully at the OPAC
Jonathan Druart [Tue, 12 Nov 2019 17:18:23 +0000]
Bug 23846: Handle exception gracefully at the OPAC

I do not think we should have the same trick as the intranet, and
display a message. This should be enough.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23846: Add a check to the data inconsistencies script
Jonathan Druart [Tue, 12 Nov 2019 10:15:46 +0000]
Bug 23846: Add a check to the data inconsistencies script

This may be quite long for big catalogue, but I think it is a good one
to have.

Test plan:
Same as first patch, then execute search_for_data_inconsistencies.pl
Notice the error.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23846: Display degraded view when MARCXML is invalid (staff detail)
Jonathan Druart [Tue, 12 Nov 2019 10:04:42 +0000]
Bug 23846: Display degraded view when MARCXML is invalid (staff detail)

When an invalid bibliographic record is imported into the catalogue
there is not warning or error. However the bibliographic record detail
page will explode (Koha::Biblio::Metadata->record will raise an
exception).

This patch proposes to catch the exception on this view and display a
warning about the situation.
Note that editing/saving the record will fix the MARCXML data and so
removes the warning (some black magic we should get rid of I suspect).

Test plan:
- Import a bibliographic record with invalid XML, you can add non
printable characters, like 0x1F (CTRL-V 1F with vim)
- Go to the detail page
=> Without this patch you get a 500
=> With this patch applied you get a "degraded view" with a warning
message, telling you what the error is.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24002: One more occurrence of datecancellationprinted
Jonathan Druart [Fri, 8 Nov 2019 14:44:49 +0000]
Bug 24002: One more occurrence of datecancellationprinted

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

4 years agoBug 24002: Incorrect DATE value: '' in C4/Acquisition.pm
Jonathan Druart [Fri, 8 Nov 2019 13:49:48 +0000]
Bug 24002: Incorrect DATE value: '' in C4/Acquisition.pm

DBD::mysql::st execute failed: Incorrect DATE value: '' [for Statement "
    SELECT aqbasket.basketno,
        aqorders.ordernumber,
        DATE(aqbasket.closedate)  AS orderdate,
        aqbasket.basketname       AS basketname,
        aqbasket.basketgroupid    AS basketgroupid,
        aqbasketgroups.name       AS basketgroupname,
        aqorders.rrp              AS unitpricesupplier,
        aqorders.ecost            AS unitpricelib,
        aqorders.claims_count     AS claims_count,
        aqorders.claimed_date     AS claimed_date,
        aqbudgets.budget_name     AS budget,
        borrowers.branchcode      AS branch,
        aqbooksellers.name        AS supplier,
        aqbooksellers.id          AS supplierid,
        biblio.author, biblio.title,
        biblioitems.publishercode AS publisher,
        biblioitems.publicationyear,
        ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate,

        aqorders.quantity - COALESCE(aqorders.quantityreceived,0)                 AS quantity,
        (aqorders.quantity - COALESCE(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
        DATEDIFF(CAST(now() AS date),closedate) AS latesince

    FROM
        aqorders LEFT JOIN biblio     ON biblio.biblionumber         = aqorders.biblionumber
        LEFT JOIN biblioitems         ON biblioitems.biblionumber    = biblio.biblionumber
        LEFT JOIN aqbudgets           ON aqorders.budget_id          = aqbudgets.budget_id,
        aqbasket LEFT JOIN borrowers  ON aqbasket.authorisedby       = borrowers.borrowernumber
        LEFT JOIN aqbooksellers       ON aqbasket.booksellerid       = aqbooksellers.id
        LEFT JOIN aqbasketgroups      ON aqbasket.basketgroupid      = aqbasketgroups.id
        WHERE aqorders.basketno = aqbasket.basketno
        AND ( datereceived = ''
            OR datereceived IS NULL
            OR aqorders.quantityreceived < aqorders.quantity
        )
        AND aqbasket.closedate IS NOT NULL
        AND aqorders.datecancellationprinted IS NULL
     AND (closedate <= DATE_SUB(CAST(now() AS date),INTERVAL ? DAY))  AND aqorders.quantity - COALESCE(aqorders.quantityreceived,0) <> 0 AND orderstatus <> 'cancelled'
ORDER BY latesince, basketno, borrowers.branchcode, supplier" with ParamValues: 0=0] at /kohadevbox/koha/C4/Acquisition.pm line 2248.

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

4 years agoBug 24002: Incorrect DATE value: '0000-00-00' in C4/Acquisition.pm
Jonathan Druart [Fri, 8 Nov 2019 13:46:38 +0000]
Bug 24002: Incorrect DATE value: '0000-00-00' in C4/Acquisition.pm

t/db_dependent/Acquisition/close_reopen_basket.t .. DBD::mysql::st execute failed: Incorrect DATE value: '0000-00-00' [for Statement "
        SELECT COUNT( DISTINCT( biblionumber ) )
        FROM   aqorders
        WHERE  basketno = ?
            AND (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00')
        " with ParamValues: 0='2'] at /kohadevbox/koha/C4/Acquisition.pm line 3012.
DBD::mysql::st execute failed: Incorrect DATE value: '0000-00-00' [for Statement "
        SELECT COUNT( DISTINCT( biblionumber ) )
        FROM   aqorders
        WHERE  basketno = ?
            AND (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00')
        " with ParamValues: 0='2'] at /kohadevbox/koha/C4/Acquisition.pm line 3012.

And anticipating other failures

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

4 years agoBug 24002: Incorrect DATE value: '00-00-0000' in C4/Serials.pm
Jonathan Druart [Fri, 8 Nov 2019 13:44:28 +0000]
Bug 24002: Incorrect DATE value: '00-00-0000' in C4/Serials.pm

t/db_dependent/Biblio.t .. 2/12 DBD::mysql::st execute failed: Incorrect DATE value: '00-00-0000' [for Statement "
  SELECT    serial.serialid,
            serial.serialseq,
            serial.planneddate,
            serial.publisheddate,
            serial.publisheddatetext,
            serial.status,
            serial.notes as notes,
            year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year,
            biblio.title as bibliotitle,
            subscription.branchcode AS branchcode,
            subscription.subscriptionid AS subscriptionid
  FROM      serial
  LEFT JOIN subscription ON
          (serial.subscriptionid=subscription.subscriptionid)
  LEFT JOIN aqbooksellers on subscription.aqbooksellerid=aqbooksellers.id
  LEFT JOIN biblio on biblio.biblionumber=subscription.biblionumber
  WHERE     subscription.biblionumber = ?
  ORDER BY year DESC,
          IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate) DESC,
          serial.subscriptionid
          " with ParamValues: 0='446'] at /kohadevbox/koha/C4/Serials.pm line 482.

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

4 years agoBug 24002: Incorrect DATE value: '0000-00-00' in C4/Serials.pm
Jonathan Druart [Fri, 8 Nov 2019 13:03:37 +0000]
Bug 24002: Incorrect DATE value: '0000-00-00' in C4/Serials.pm

DBD::mysql::st execute failed: Incorrect DATE value: '0000-00-00' [for Statement "SELECT   serialid,serialseq, status, planneddate, publisheddate,
        publisheddatetext, notes, routingnotes
       FROM     serial
       WHERE    subscriptionid = ?
       AND      status IN ( 2,4,41,42,43,44,5 )
       ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC
      " with ParamValues: 0=8] at /kohadevbox/koha/C4/Serials.pm line 688.

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

4 years agoBug 24002: Incorrect DATE value: '' in C4/Bookseller.pm
Jonathan Druart [Fri, 8 Nov 2019 13:00:43 +0000]
Bug 24002: Incorrect DATE value: '' in C4/Bookseller.pm

t/db_dependent/Bookseller.t .. 3/86 DBD::mysql::st execute failed: Incorrect DATE value: '' [for Statement "
        SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
        FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
        LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
        WHERE
            ( datereceived = ''
            OR datereceived IS NULL
            OR aqorders.quantityreceived < aqorders.quantity
            )
            AND aqorders.quantity - COALESCE(aqorders.quantityreceived,0) <> 0
            AND aqbasket.closedate IS NOT NULL
    "] at /kohadevbox/koha/C4/Bookseller.pm line 100.

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

4 years agoBug 24002: Incorrect DATE value: '00-00-0000' in NewsChannels.pm
Jonathan Druart [Fri, 8 Nov 2019 12:58:32 +0000]
Bug 24002: Incorrect DATE value: '00-00-0000' in NewsChannels.pm

% prove  xt/author/valid-templates.t

DBD::mysql::st execute failed: Incorrect DATE value: '00-00-0000' [for Statement "
     SELECT opac_news.*,timestamp AS newdate,
     borrowers.title AS author_title,
     borrowers.firstname AS author_firstname,
     borrowers.surname AS author_surname
     FROM   opac_news
     LEFT JOIN borrowers on borrowers.borrowernumber = opac_news.borrowernumber
     WHERE   (
        expirationdate >= CURRENT_DATE()
        OR    expirationdate IS NULL
        OR    expirationdate = '00-00-0000'
     )
     AND   DATE(timestamp) < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
     AND   (opac_news.lang = '' OR opac_news.lang = ?)
     AND   (opac_news.branchcode IS NULL OR opac_news.branchcode = ?)
     ORDER BY number
    " with ParamValues: 0='OpacNavRight_', 1=''] at /kohadevbox/koha/C4/NewsChannels.pm line 216.

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

4 years agoBug 23788: Recalculate ammount due for selected accountlines
Kyle M Hall [Wed, 9 Oct 2019 17:08:10 +0000]
Bug 23788: Recalculate ammount due for selected accountlines

Individual fees cannot be overpaid of over-written off, but it's possible to 'overpay' a writeoff of selected fees.

Test Plan:
1) Create 3 fees
2) Pick 2 and choose "Write off selected"
3) Write off more than the total amount of those fees
4) Apply this patch set
5) Restart all the things!
6) Try again, you should no longer be able to!

Signed-off-by: Sean McGarvey <seanm@pascolibraries.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23788: Rename $select_lines to $selected_lines
Kyle M Hall [Wed, 9 Oct 2019 16:45:33 +0000]
Bug 23788: Rename $select_lines to $selected_lines

Signed-off-by: Sean McGarvey <seanm@pascolibraries.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23788: Rename $select to $selected_accts
Kyle M Hall [Wed, 9 Oct 2019 16:43:54 +0000]
Bug 23788: Rename $select to $selected_accts

Signed-off-by: Sean McGarvey <seanm@pascolibraries.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23986: Pass strings to Catmandu for deletion
Nick Clemens [Thu, 7 Nov 2019 19:38:24 +0000]
Bug 23986: Pass strings to Catmandu for deletion

The deletion subroutine expects to get a string, this is fine in most places, but when
we sort our records for batch deletion they are cast to numbers and the delete is not processed.

This patch quotes the biblionumbers as strings before passing them to Catmandu

To aid in detecting orphaned records you can use the patches on bug 22831

To test:
 1 - Have or create a bib
 2 - Go to Tools->Batch record deletion
 3 - Click 'Enter a list of record numbers'
 4 - Enter the biblionumber'
 5 - Confirm deletion
 6 - Search for the record, it still appears
 7 - Apply patch, restart all the things
 8 - Repeat 1-6
 9 - This time the record is deleted
10 - Test other methods of record deletion to confirm the record is removed

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

4 years agoBug 23851: Add the homebranch prefix to the barcode when adding multiple copies of...
Jonathan Druart [Tue, 22 Oct 2019 09:36:28 +0000]
Bug 23851: Add the homebranch prefix to the barcode when adding multiple copies of an items

See the comment in the code for more information.

Test plan:
- Set autoBarcode to hbyymmincr
- Create an item and click on the barcode field
- A barcode prefixed by the homebranch is generated
- Click the "Add multiple copies of this item" and enter 4
- Save
=> Without this patch only the first item has the homebranch prefix
=> With this patch applied they all have a barcode in the same format

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

4 years agoBug 23847: Fix custom item search fields if subfield is '0'
Jonathan Druart [Mon, 21 Oct 2019 07:37:25 +0000]
Bug 23847: Fix custom item search fields if subfield is '0'

The subfield is not used if is false, so if 0. We want to test if the
subfield is defined and not an empty string.

Test plan:
- Define a new custom item search fields using a subfield '0'
(withdrawn=952$0 for instance)
- Define one which does not have a subfield (control field)
- Search items using those newly created fields.

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

4 years agoBug 23933: (bug 10132 follow-up) Fix commit_file.pl
Jonathan Druart [Mon, 4 Nov 2019 11:25:33 +0000]
Bug 23933: (bug 10132 follow-up) Fix commit_file.pl

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

4 years agoBug 5365: Make more clear how to reopen a basket in a basket group
Jonathan Druart [Wed, 6 Nov 2019 09:45:56 +0000]
Bug 5365: Make more clear how to reopen a basket in a basket group

The "reopen basket" button will be visible but disabled if the basket
cannot be reopened. A tooltip is attached to the button to add more
information.

Note that the export button is still hidden, would it makes sense to
display it (visible and active)?

Test plan:
- Create a basket
- Close it
- Go to the basket detail view
=> The reopen button should be displayed and enabled

- Attach it to a basket group
- Go to the basket detail view
=> The reopen button should be displayed but disabled

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

4 years agoBug 22857: (QA follow-up) Cosmetic changes: typo, whitespace
Marcel de Rooy [Fri, 8 Nov 2019 09:00:32 +0000]
Bug 22857: (QA follow-up) Cosmetic changes: typo, whitespace

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

4 years agoBug 22857: Sync koha-conf.xml files
Jonathan Druart [Tue, 5 Nov 2019 10:23:04 +0000]
Bug 22857: Sync koha-conf.xml files

Missing entries are added to those files.

Test plan:
Search for typos
Compare the two files and comfirm the entries are the same in both.
Exception: supportdir exists in etc/koha-conf.xml only, but I think it's
obsolete.

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

4 years agoBug 23949: Add z3950 directory to koha-common.install
Tomas Cohen Arazi [Wed, 6 Nov 2019 19:09:15 +0000]
Bug 23949: Add z3950 directory to koha-common.install

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 23949: Update documentation
Jonathan Druart [Tue, 5 Nov 2019 17:34:28 +0000]
Bug 23949: Update documentation

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 23949: Add missing actions for koha-z3950-responder in koha-common.init
Tomas Cohen Arazi [Fri, 1 Nov 2019 18:51:00 +0000]
Bug 23949: Add missing actions for koha-z3950-responder in koha-common.init

This patch makes the init script deal with koha-z3950-responder in --stop
and --restart actions. Currently, only --start calls the script.

To test:
- Enable the server:
  $ koha-z3950-responder --enable kohadev
- Stop koha-common
  $ service koha-common stop
=> SUCCESS: No koha-z3950-responder running
- Start koha-common
  $ service koha-common start
=> SUCCESS: It is loaded (even if failing because of config issues)
- Stop koha-common
  $ service koha-common stop
=> FAIL: It is still running (no --stop issued)
- Repeat for restart
- Apply this patch
- Redo
=> SUCCESS: Things behave as expected!
- 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: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23398: Disable the XML import/export format for biblio framework
Jonathan Druart [Thu, 24 Oct 2019 16:21:04 +0000]
Bug 23398: Disable the XML import/export format for biblio framework

It gives incomplete results and not sure it ever worked.
To prevent data loss it is better to remove this option.

Note that the code in C4/ImportExportFramework.pm is too complex to
attach with this patch to deletion of the code related to the XML
import/export. Safer to keep it for a separate bug report.

Test plan:
Import/export biblio frameworks and confirm that there is no more
reference to the xml format.

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

4 years agoBug 23997: Escape z3950servers.rank as it's a new MySQL 8 kw
Jonathan Druart [Fri, 8 Nov 2019 10:46:58 +0000]
Bug 23997: Escape z3950servers.rank as it's a new MySQL 8 kw

This patch will fix installation of Koha on MySQL 8
DBD::mysql::st execute failed: 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, syntax, encoding,recordtype) VALUES
('lx2.loc.gov',210,'LCDB','','','LIBRA' at line 2 at /usr/share/perl5/DBIx/RunSQL.pm line 273.

https://dev.mysql.com/doc/refman/8.0/en/keywords.html
=> RANK (R); added in 8.0.2 (reserved)

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

4 years agoBug 23995: Remove CHECK constraints from kohastructure
Martin Renvoize [Fri, 8 Nov 2019 10:27:06 +0000]
Bug 23995: Remove CHECK constraints from kohastructure

MySQL8 and MariaDB10.3 impliment check constraints but utilise
different, incompatible, syntaxes to do so.

This patch removes the check constraints entirely whilst we work on a
better solution to work around the incompatabilities of the two DBs.

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 23994: Fix random failure from AdditionalFields.t (U18)
Jonathan Druart [Fri, 8 Nov 2019 09:28:01 +0000]
Bug 23994: Fix random failure from AdditionalFields.t (U18)

t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t .. 1/12
 #   Failed test '->additional_field_values should return the correct values'
 #   at t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t line 82.
 #     Structures begin differing at:
 #          $got->[0]{value} = 'bar value for basket2'
 #     $expected->[0]{value} = 'foo value for basket2'
 # Looks like you failed 1 test of 12.

We do not really know why, but the values are not returned in the order they
are stored in DB. Fixing this random failure for now at test level.

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

4 years agoBug 23049: (RM follow-up) remove 'IGNORE' from ALTER TABLE
Martin Renvoize [Fri, 8 Nov 2019 08:06:10 +0000]
Bug 23049: (RM follow-up) remove 'IGNORE' from ALTER TABLE

We have updated the update to use our column_exists method, but had
forgotten to remove the corresponding IGNORE keyword from the SQL
itself.

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

4 years agoBug 23806: FinePaymentAutoPopup does not trigger pop-up for writeoff by "Write off...
Kyle M Hall [Fri, 11 Oct 2019 16:07:14 +0000]
Bug 23806: FinePaymentAutoPopup does not trigger pop-up for writeoff by "Write off" button

Test Plan:
1) Enable reciept popups for payments and writeoffs
2) Test the "Write off" button, no popup
3) Apply this patch
4) Restart all the things!
5) Test again, you should get the popup!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Sean McGarvey <seanm@pascolibraries.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 23427: Simplify sort logic
Jonathan Druart [Thu, 7 Nov 2019 12:34:31 +0000]
Bug 23427: Simplify sort logic

This is the usual syntax.

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

4 years agoBug 23427: Better sorting of previous checkouts
Fridolin Somers [Mon, 5 Aug 2019 13:25:02 +0000]
Bug 23427: Better sorting of previous checkouts

In patron circulation or details page, previous checkouts are displayed sorted by due date.
Many checkouts may have same due date so it would be better to sort on timestamp as second sort criteria, like todays's checkouts.

Test plan :
1) Create for a patron two issues with same due date and a few seconds between them
2) Create another issue with a different due date
3) Come back a day later
4) Set preference previousIssuesDefaultSortOrder = "latest to earliest"
5) Go to patron circulation page and check sort order is OK : sorted by "Due date" then "Cheked out on"
6) Go to patron details page and check sort order is OK : sorted by "Due date" then "Cheked out on"
7) Set preference previousIssuesDefaultSortOrder = "earliest to latest"
8) Go to patron circulation page and check sort order is OK : sorted by "Due date" then "Cheked out on"
9) Go to patron details page and check sort order is OK : sorted by "Due date" then "Cheked out on"

Signed-off-by: Michal Denar <black23@gmail.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 23427: Fix previous checkouts sort order
Fridolin Somers [Mon, 5 Aug 2019 13:11:49 +0000]
Bug 23427: Fix previous checkouts sort order

In patron circulation or details page, previous checkouts are displayed sorted by due date.
Actual sort order is not honoring system preference "previousIssuesDefaultSortOrder". Todays's checkouts is correct thanks to Bug 13908.

Patch adds comments that refer to the text of system preferences "previousIssuesDefaultSortOrder" and "TodayIssuesDefaultSortOrder" :
  latest to earliest = asc
  earliest to latest = desc

Test plan :
1) Create for a patron two old issues with a few days between them
2) Set preference previousIssuesDefaultSortOrder = "latest to earliest"
3) Go to patron circulation page and check sort order is OK
4) Go to patron details page and check sort order is OK
5) Set preference previousIssuesDefaultSortOrder = "earliest to latest"
6) Go to patron circulation page and check sort order is OK
7) Go to patron details page and check sort order is OK

Signed-off-by: Michal Denar <black23@gmail.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 21939: Fix permissions for holds history tab
Katrin Fischer [Sat, 2 Nov 2019 06:54:31 +0000]
Bug 21939: Fix permissions for holds history tab

The tab will show when the staff user has edit_borrowers
permission, but the page itself will not be accessible.
This patch fixes the page permissions to allow access
with the edit_borrowers permission as suggested by the
comments on the original bug report.

To test:
- Create a staff user with only "edit_borrowers" permission
  from the borrowers module
- Try to access the holds history tab from any patron account
- Verify you are blocked
- Apply patch
- Try again and verify the page is accessible now
- Repeat with superlibrarian and full borrowers permission.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.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 23293: DBRev 19.06.00.050
Martin Renvoize [Thu, 7 Nov 2019 13:20:08 +0000]
Bug 23293: DBRev 19.06.00.050

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

4 years agoBug 23293: (QA follow-up) Minor fix for tests
Tomas Cohen Arazi [Wed, 6 Nov 2019 18:40:57 +0000]
Bug 23293: (QA follow-up) Minor fix for tests

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

4 years agoBug 23293: (follow-up) Add tests for C4::Circulation change
Martin Renvoize [Wed, 25 Sep 2019 09:59:03 +0000]
Bug 23293: (follow-up) Add tests for C4::Circulation change

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

4 years agoBug 23293: Apply OPACFineNoRenewalsIncludeCredit preference
Martin Renvoize [Wed, 10 Jul 2019 13:50:06 +0000]
Bug 23293: Apply OPACFineNoRenewalsIncludeCredit preference

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

4 years agoBug 23293: Add system preference
Martin Renvoize [Wed, 10 Jul 2019 13:34:47 +0000]
Bug 23293: Add system preference

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

4 years agoBug 23751: Make staffaccess permission description more precise
Katrin Fischer [Sat, 2 Nov 2019 11:30:58 +0000]
Bug 23751: Make staffaccess permission description more precise

The permission description was missing 'username' from the description.

To test:
- Look at the permissions of a patron
- Verify the staffaccess permission is labelled:
  Allow staff members to modify permissions and passwords for other staff members
- Apply patch
- Check description again:
  Allow staff members to modify permissions, usernames, and passwords for other staff members

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23952: Fix body tag on OPAC course details page
Katrin Fischer [Sat, 2 Nov 2019 01:58:00 +0000]
Bug 23952: Fix body tag on OPAC course details page

The id was not changed, when the page was added and
remained opac-main. The patch changes it to
opac-course-details so the page has its own unique id.

To test:
- Add a course reserve to your installation
- Go to the course reserves page in the OPAC
- Click on the course to see its details
- Look at the source code, the <body> tag should show:
  Without patch: opac-main
  with patch applied: opac-course-details

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23954: Format notes in suggestion management
Owen Leonard [Sun, 3 Nov 2019 21:41:04 +0000]
Bug 23954: Format notes in suggestion management

This patch makes minor CSS and markup changes in order to deliniate
suggestion notes from the other data in the suggestions list view.

To test you should have at least one suggestion with a note. Apply the
patch and go to Acquisitions -> Suggestions.

In the table of suggestions, check that the notes display clearly.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 13749: On loading holds in patron account 'processing' is not translatable
Owen Leonard [Tue, 8 Oct 2019 17:11:17 +0000]
Bug 13749: On loading holds in patron account 'processing' is not translatable

This patch updates the DataTables configuration for two tables: The
checkouts and holds lists shown on the checkout and patron details
screen.

The tables lacked the standard application of a custom set of
defaults defined in js/datatables.js. It is in this file that custom
language strings are defined for DataTable interface elements, pulling
in the translated values from datatables.inc.

Without our custom defaults applied, DataTables used its own defaults,
which are not translated.

To test, apply the patch and check out to a patron who has both
checkouts and holds. The more the better to give you more time to
observer the loading state of the tables.

 - Checkouts: This table doesn't exhibit any visible problems because
   page-specific text is defined for the table's "Loading" message.
   However, it still makes sense to apply the defaults to the table for
   consistency's sake. There should be no visible changes to the table.

 - Holds: From the checkout or patron details page click the "Holds"
   tab. While the table loads there should be a "Processing" message. If
   you switch to another translation the message should appear in that
   language.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23768: Adjust the test for invalid ISBN
Jonathan Druart [Thu, 7 Nov 2019 10:48:59 +0000]
Bug 23768: Adjust the test for invalid ISBN

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

4 years agoBug 23768: Return invalid ISBN when searching with variations
Nick Clemens [Mon, 7 Oct 2019 17:46:30 +0000]
Bug 23768: Return invalid ISBN when searching with variations

To test:
1 - Enable SearchWithISBNVariations and  IntranetCatalogSearchPulldown
2 - Refresh page and click on 'Search the catalog' tab
3 - Search for 'ISBN' 0385299209
4 - Note no results
5 - Note the search says if searched 'kw,wrdl: (nb=)'
6 - Apply patch, restart all the things
7 - Repeat search
8 - Search looks correctly formed
9 - Add the isbn above to a record, confirm it is returned by search
10 - Confirm searches for valid ISBNs still work as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23813: (bug 18925 follow-up) Remove invalid circ rules to avoid FK constraints...
Jonathan Druart [Tue, 22 Oct 2019 10:42:09 +0000]
Bug 23813: (bug 18925 follow-up) Remove invalid circ rules to avoid FK constraints to fail

There is not FK constraints on the itemtype, categorycode and branchcode
columns of the issuingrules table, because of the '*' value we use for
default.
We created the new table circulation_rules with those constraints, and
when we moved the rules for maxissueqty, the INSERT failed.

To avoid the FK constraints to fail we are going to delete the invalid
rows before.

It could lead to data lost, but this situation certainly comes from a
bad data manipulation at some point of the history of the installation.

Test plan:
git reset --hard 1e4f442442844cfaf17f5b06f122f6259d5fee92 # before 18.12.00.020
reset_all

insert into branches(branchcode, branchname) values('rmme', 'rmme');
insert into categories (categorycode, description) values ('rmme', 'rmme');
insert into itemtypes (itemtype, description) values('rmme', 'rmme');

Go to http://pro.kohadev.org/cgi-bin/koha/admin/smart-rules.pl
Create a new rule for the patron category
Create a new rule for the item type
Copy all the default rule to the new library
Create other rules for "Default checkout, hold policy by patron category" and "Default holds policy by item type" using this patron's category and itemtype.
Same for patrons' categories and itemtypes you will not delete.

delete from branches where branchcode="rmme";
delete from categories where categorycode="rmme";
delete from itemtypes where itemtype="rmme";

git checkout master
and execute the DB process.

=> With this patch applied you will not get the error and the rules will
be moved correctly.

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

4 years agoBug 13958: DBRev 19.06.00.049
Martin Renvoize [Thu, 7 Nov 2019 09:14:48 +0000]
Bug 13958: DBRev 19.06.00.049

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

4 years agoBug 13958: Use SuspensionsCalendar syspref for more granularity
Tomas Cohen Arazi [Mon, 27 May 2019 15:10:57 +0000]
Bug 13958: Use SuspensionsCalendar syspref for more granularity

This patch makes the calculation of suspension expiration configuration
detached from the finesCalendar syspref. This way libraries have more
flexibility when setting circ rules.

I wrote this path as a bugfix, because the recent change pushed by bug 19204
changed this behavior and libraries have been complaining since they got
upgraded.

It is a minor change, just adding the new syspref, and replacing the
single place in which it is used for debarment calculation for the new
one.

The tests are updated similarly, just adding the new mocked syspref as
it was with the old one.

To test:
- Apply this patches
- updatedatabase
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation.t
=> SUCCESS: Tests pass!
- Sign off :-D

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 13958: Add SuspensionsCalendar syspref
Tomas Cohen Arazi [Mon, 27 May 2019 14:30:33 +0000]
Bug 13958: Add SuspensionsCalendar syspref

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23868: Check if threshold is undefined in javascript block of opac-account.tt
Agustin Moyano [Mon, 4 Nov 2019 18:09:33 +0000]
Bug 23868: Check if threshold is undefined in javascript block of opac-account.tt

This patch fixes a bug introduced by checking payment plugins threshold

To test:
1. do not apply this patch
2. configure paypal options in intranet
3. create a manual invoice for a patron
4. in opac try to pay that invoice
CHECK => Make Payment button is disabled, even when invoices where checked.
5. apply this patch
6. repeat step 4
SUCCESS => Make Payment button is enabled when an invoice is checked.
7. Sign off

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23075: (RM follow-up) Update mock in tests
Martin Renvoize [Thu, 7 Nov 2019 07:54:53 +0000]
Bug 23075: (RM follow-up) Update mock in tests

To prevent GET request redirects we switched from ->request to
->simple_request. This patch updates the mock in the corresponding test
to mock simple_request rather than request.

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

4 years agoBug 22677: Include hint to OAI page path on OAI-PMH preference
Katrin Fischer [Mon, 14 Oct 2019 20:28:45 +0000]
Bug 22677: Include hint to OAI page path on OAI-PMH preference

This copies the way we are doing it for othe rprefs (ILSDI and similar)
and adds a hint to the description to make it easier to find the
right path for the OAI server.

To test:
- Apply patch
- Verify that the system preference for OAI-PMH includes
  now a hint to: /cgi-bin/koha/oai.pl?verb=Identify
- Verify the hint is correct (add OPAC base URL)

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

4 years agoBug 23414: Replace delimiter of regexs to ease readability
Jonathan Druart [Wed, 6 Nov 2019 09:10:00 +0000]
Bug 23414: Replace delimiter of regexs to ease 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 23414: Add tests for previous effective_itemtype change
Jonathan Druart [Wed, 6 Nov 2019 09:06:46 +0000]
Bug 23414: Add tests for previous effective_itemtype change

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

4 years agoBug 23414: Unit tests
Nick Clemens [Mon, 4 Nov 2019 14:22:44 +0000]
Bug 23414: Unit tests

To test:
1 - Apply this patch alone
2 - prove -v t/db_dependent/XSLT.t
3 - All pass
4 - Apply other patches
5 - prove -v t/db_dependent/XSLT.t
6 - All pass

Signed-off-by: Liz Rea <wizzyrea@gmail.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 23414: Use effective_itemtype
Jonathan Druart [Mon, 4 Nov 2019 15:34:35 +0000]
Bug 23414: Use effective_itemtype

We should use effective_itemtype instead of itype to take
the item-level_itypes pref into account.
Note that we should not need to test for the existence of the key as we
now assume that item types are correctly set to a valid item type.

Signed-off-by: Liz Rea <wizzyrea@gmail.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 23414: Easy readability and simplify logic in buildKohaItemsNamespace
Jonathan Druart [Mon, 4 Nov 2019 15:29:23 +0000]
Bug 23414: Easy readability and simplify logic in buildKohaItemsNamespace

This patch improves true/false logic and avoid autovivication.
Also note that xml_escape already deals with empty string.

An unecessary call to GetReserveStatus is removed.

Signed-off-by: Liz Rea <wizzyrea@gmail.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 23414: Prefetch transfers, use only default framework, use elsif
Nick Clemens [Thu, 1 Aug 2019 17:01:28 +0000]
Bug 23414: Prefetch transfers, use only default framework, use elsif

This further cleans up the code, before we tested each condition though we return only one status line.

Koha mappings can no longer differ by framework so we don't need to fetch the biblio framework

Prefetching should offer a boost

To test:
Same as before - there is not as big a boost form this, but there shouldn't be a hit

Signed-off-by: Liz Rea <wizzyrea@gmail.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 23414: Use Koha Item objects in buildKohaItemsNamespace
Nick Clemens [Thu, 1 Aug 2019 15:42:16 +0000]
Bug 23414: Use Koha Item objects in buildKohaItemsNamespace

Removing the use of C4::GetItemsInfo cuts down on the number of DB requests and speeds things up

To test I added 100 items to each of the first 20 records returned by a search for 'a'
I saw a reduction from ~30 seconds to ~26 seconds

This also makes the code a little cleaner and moves us toward the Koha namespace

To test:
1 - Perform a search in the OPAC and STaff Client with the Browser Console opened (F12)
2 - View the netwrok tab and see how long the pages take to load
3 - Apply the patches, restart all the things
4 - Repeat and note if the results are returned faster

Signed-off-by: Liz Rea <wizzyrea@gmail.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 23483: Show the description, not the patron's title when writing off an individua...
Katrin Fischer [Sun, 3 Nov 2019 22:48:04 +0000]
Bug 23483: Show the description, not the patron's title when writing off an individual fine/fee

When writing off an individual fine, the description shown
was the patron's title, instead of the fine description.
Fixing it by changing it to the same template variable used for
paying individuals so they match up.

To test:
- Pick a patron and make sure salutation is set (Mr, Mrs, ...)
- Create a manual fine
- For the fine, compare the description shown when using the Writeoff
  and Pay buttons next to the fine
- Verify the display is different and writeoff displays the salutation
- Apply patch
- Repeat, descriptions now should match up

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23467: Exit after output_html - opac-reserve.pl
Jonathan Druart [Wed, 6 Nov 2019 09:59:26 +0000]
Bug 23467: Exit after output_html - opac-reserve.pl

To avoid double screen

There are several ways to recreate the issue, the easiest is:
  /cgi-bin/koha/opac-reserve.pl?biblionumber=

You should see "ERROR: No record id specified."

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

4 years agoBug 23774: Server-side confirmation for hold pickup location in OPAC
Lari Taskula [Mon, 4 Nov 2019 16:32:58 +0000]
Bug 23774: Server-side confirmation for hold pickup location in OPAC

While placing a hold on a book, if a user opens up Inspect Element on the
Pick up location drop down box they can change the pick up location in
the code to a library that is not listed as a pick up location.

How to replicate:
Search for a book
Select book
Click Place Hold

On the screen Home > Placing a hold

Right click on Pick up location
Select 'Inspect Element'

Under
<!-- HOLDABLE -->

<li class="Branch">
<select name="Branch ******"> Pick Up location:</label>=$0

Option values are listed that relate to the pick up location, this value
can be changed to another new location and when the hold is placed
the hold will be placed for this new location instead of the listed options
in the Pick up location drop down list.

To test:
1. Apply patch
2. Repeat "How to replicate"
3. Observe it is no longer possible to place holds on libraries not defined
   as pickup location by changing option value via Inspect Element tool

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 23719: (follow-up) Add warn when passed invalid search field in marclist
Nick Clemens [Thu, 31 Oct 2019 14:34:53 +0000]
Bug 23719: (follow-up) Add warn when passed invalid search field in marclist

Note: I also remove warnings for undefined operation in this patch, is a trivial fix

To test:
prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

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

4 years agoBug 23719: Allow searching specific fields for matching authorities in ES
Nick [Wed, 2 Oct 2019 11:17:13 +0000]
Bug 23719: Allow searching specific fields for matching authorities in ES

To test:
1 - Export your authorities via Tools->Export data
2 - Define a record matching rule in Admin->Record matchign rules
    Use index: LC-card-number
    field: 010$a
3 - Stage the exported records for import and use the rule created above for matching
4 - The process does not complete
5 - Check intranet error logs - exception on unknown marclist
6 - Apply patch
7 - Repeat
8 - Success!
9 - prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

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 23075: Correct indendation
Jonathan Druart [Wed, 6 Nov 2019 08:50:01 +0000]
Bug 23075: Correct indendation

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

4 years agoBug 23075: Do not 'Send' if the url is not correct
Jonathan Druart [Mon, 4 Nov 2019 14:09:34 +0000]
Bug 23075: Do not 'Send' if the url is not correct

Just in case.

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 23075: (follow-up) Dissallow transparent redirects
Martin Renvoize [Mon, 4 Nov 2019 13:13:16 +0000]
Bug 23075: (follow-up) Dissallow transparent redirects

GET request redirects were causing the http URL to 'pass' our 'good url'
test for http => https redirected mana servers. However, on the
subsquent POST request to get a mana security token we would fail as the
POST was not transparently redirected.

This patch changes the request to be a simple_request so we will catch
bad urls earlier and it also prevents submissions for security tokens if
the configured URL is identified as bad.

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 23075: Report if mana-kb server is not found
Martin Renvoize [Mon, 17 Jun 2019 17:24:04 +0000]
Bug 23075: Report if mana-kb server is not found

This patch adds a status check into the mana configuration page and
prompts the user to ask an adminstrator to check the configured mana
service url.

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 17359: Use a unicode character in tests
Jonathan Druart [Tue, 5 Nov 2019 09:25:50 +0000]
Bug 17359: Use a unicode character in tests

And remove an unused variable.

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

4 years agoBug 17359: Correct encoding when displaying patron import summary
Jonathan Druart [Wed, 16 Oct 2019 08:47:28 +0000]
Bug 17359: Correct encoding when displaying patron import summary

There is an encoding issue when the patron import summry, the string
must be UTF8 decoded before being sent to the template.

Test plan:
- Create a patron import CSV file with import issues. Use UTF8 characters.
See file attached to the bug report 'patron_import.csv'
=> The screen should display the line correctly
- Correct the import issue (add a surname for Chloé)
=> The imported patrons should contain the correct values.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17359: Add tests
Jonathan Druart [Wed, 16 Oct 2019 08:22:38 +0000]
Bug 17359: Add tests

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23968: Add div this id around OPACMySummaryNote content
Fridolin Somers [Tue, 5 Nov 2019 08:55:25 +0000]
Bug 23968: Add div this id around OPACMySummaryNote content

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

4 years agoBug 23968: fix OPACMySummaryNote feature
Fridolin Somers [Tue, 5 Nov 2019 08:52:59 +0000]
Bug 23968: fix OPACMySummaryNote feature

The system preference OPACMySummaryNote is used to display on the logged-in patron summary page at OPAC.
It does not display anymore.

Looks like it comes from code :
[% IF OPACMySummaryNote %][% Koha.Preference('OPACMySummaryNote') | $raw %][% END %]
OPACMySummaryNote used to be a provided variable.

Test plan:
1) Enable system preference OPACMySummaryNote
2) Enter some HTML into it
3) Go to OPAC and loggin
4) Check you see the HTML in opac-user.pl
5) Disable the preference
6) Check you dont see the HTML anymore

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

4 years agoBug 11514: Untranslatable "Uncertain" text in acq
Owen Leonard [Wed, 17 Apr 2019 18:44:27 +0000]
Bug 11514: Untranslatable "Uncertain" text in acq

This patch modifies two pages so that the "Uncertain price" information
is shown by the template rather than the Perl script, making the text
translatable.

To test, apply the patch and go to Acquisitions.

 - Locate or create an order in a basket which has an uncertain price.
 - When viewing the contents of that basket the order which was marked
   as having an uncertain price should be labeled "Uncertain."
 - The same should be true for the invoice page. If you don't have an
   existing invoice with an "uncertain" order,
   - Go to "Receive shipments" for the vendor your "uncertain" order is
     with.
   - Create a new invoice.
   - Receive one or more orders which has an uncertain price.
   - Press the "finish receiving" button.
   - In the "Invoice details" section of the invoice page you should
     see the "Uncertain" label on the correct order.

Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
For the invoice view: close, receive, reopen, mark prices uncertain, go
to the invoice page (not sure it's expected however)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23382: (RM follow-up) Ensure tests pass on Wednesdays
Martin Renvoize [Wed, 6 Nov 2019 14:45:12 +0000]
Bug 23382: (RM follow-up) Ensure tests pass on Wednesdays

Koha::Calendar assumes we never issue an item on a closed day.. this is
a fair assumption but the hardcoded closed day in our tests means it
does not hold true in this case.

This patch sets the closed day dynamically to prevent such a case.

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

4 years agoBug 23523: (follow-up) Clarify meaning configurations in tests
Nick Clemens [Wed, 6 Nov 2019 12:12:31 +0000]
Bug 23523: (follow-up) Clarify meaning configurations in tests

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

4 years agoBug 23523: (follow-up) Adjust tests for new expectations
Nick Clemens [Wed, 6 Nov 2019 12:09:11 +0000]
Bug 23523: (follow-up) Adjust tests for new expectations

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

4 years agoBug 23068: (RM follow-up) Make Net::Netmask required
Martin Renvoize [Wed, 6 Nov 2019 12:09:49 +0000]
Bug 23068: (RM follow-up) Make Net::Netmask required

Net::Netmask is used in the new Plack::Middleware::RealIP module, which
is in turn used in the psgi plack startup script.  We don't have access
to C4::Context inside the startup script and as such don't have access
to the config to work out if loading this module should be optional.

As such, I'm taking the easy route and just making the dependancy a
required one. It's small and already packaged for debian and as such
should not cause anyone any issues.

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

4 years agoBug 23382: (RM follow-up) Revert "hours_between should match..."
Martin Renvoize [Tue, 5 Nov 2019 14:18:28 +0000]
Bug 23382: (RM follow-up) Revert "hours_between should match..."

This reverts commit a693c7243c23f888e2fad38a4fff9f37ff4a9301 which
caused regressions.

The original loop compared start date to end date and iterated all the
way to start date equals end date. The alternate implimentation
inadvertantly looped from start date, skipped the first day then
iterated up to one day beyond end date.

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

4 years agoBug 23050: (RM follow-up) Add Try::Tiny to controller
Martin Renvoize [Tue, 5 Nov 2019 13:53:06 +0000]
Bug 23050: (RM follow-up) Add Try::Tiny to controller

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

4 years agoBug 23050: (QA follow-up) Add Koha::Plugins::Tab class
Tomas Cohen Arazi [Mon, 4 Nov 2019 14:52:33 +0000]
Bug 23050: (QA follow-up) Add Koha::Plugins::Tab class

This minimal class encapsulates the tabs to be passed around to the
templates, so error checking on missing bits is done in a single place.

It throws exceptions on errors

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23050: Fix creation of biblio tab's id
Julian Maurice [Mon, 30 Sep 2019 08:10:17 +0000]
Bug 23050: Fix creation of biblio tab's id

(Too much javascript in my head...)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23050: Fix tab's id to avoid compatibility issues
Julian Maurice [Mon, 15 Jul 2019 12:28:47 +0000]
Bug 23050: Fix tab's id to avoid compatibility issues

MDN says:

  Using characters except ASCII letters, digits, '_', '-' and '.' may
  cause compatibility problems, as they weren't allowed in HTML 4.
  Though this restriction has been lifted in HTML5, an ID should start
  with a letter for compatibility.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23050: Add missing template filters
Julian Maurice [Mon, 15 Jul 2019 12:10:25 +0000]
Bug 23050: Add missing template filters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23050: Plugin hook to add tabs in intranet biblio details page
Julian Maurice [Wed, 5 Jun 2019 14:26:34 +0000]
Bug 23050: Plugin hook to add tabs in intranet biblio details page

Test Plan:
1) Enable plugins
2) Download and install the latest version of this plugin
https://git.biblibre.com/biblibre/koha-plugin-intranet-detail-hook
3) Browse to catalogue/detail.pl for a record
4) Note you see two new tabs with content

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23522: (QA follow-up) Typo fix in comment
Martin Renvoize [Mon, 4 Nov 2019 20:25:11 +0000]
Bug 23522: (QA follow-up) Typo fix in comment

Tiny typo fix in a new code comment

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

4 years agoBug 23522: Show actual price on in baskets
Nick Clemens [Thu, 29 Aug 2019 14:51:16 +0000]
Bug 23522: Show actual price on in baskets

To test:
 1 - Create a new basket in acq, mark it as 'standing'
 2 - Add an item, leave the RRP and Vendor price as 0
 3 - Receive shipments for the vendor
 4 - Select the title from this basket
 5 - On receipt enter an actual cost
 6 - Finsih receiving
 7 - Go to the basket
 8 - Note the total for the order and the basket are 0, keep this browser tab open
 9 - Open a new browser tab and create a new non standing basket
10 - Add to basket, again with no RRP or vendor price
11 - Close the basket, receive the item
12 - Enter an actual cost on receipt
13 - Return to view the basket
14 - Total and order are $0
15 - Apply patch
16 - Refresh the basket in both tabs
17 - You now see the actual price for the orders

Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>