Commit Graph

31058 Commits

Author SHA1 Message Date
Jonathan Druart aa0bd18ff1 Bug 21931: Do not reset the ES mapping on 3.23.00.050
This update DB entry uses DBIx schema which does not make it crashes if
the table structure is changed.
Which happens on 18.06.00.054, that added search_field.weight

The entry 3.23.00.050 fails with
  Unknown column 'me.weight' in 'field list'

This patch removes the reset of the mapping and display a warning to
tell the administrator the mapping must be reset/inserted

Test plan:
Use a 3.22 dump and upgrade it

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e29f0bce40)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1fdc679955)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b89e7f3a27)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 11:02:50 +01:00
Julian Maurice b74f4e9cce Bug 21908: (QA follow-up) Remove useless parentheses in query
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 875f3162c8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0c99c3a30a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 247b57388a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:24:58 +01:00
Fridolin Somers 43e626493b Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl
Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
When using table=items we should use DISTINCT(biblionumber) to avoid indexing several times the same biblio record when it has several items.
This patch adds DISTINCT(biblionumber) in all cases it does not harm if its already unique.

Test plan :
1) Be sur you have a biblio record with biblionumber 1 with 3 items
2) Run misc/migration_tools/rebuild_zebra.pl -v -b --table items --where="biblionumber=1"
3) Without patch you see "Records exported: 3", with patch only one
4) Check indexing works well

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a1b08269a7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 397f2e850c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7008d6ae03)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:24:52 +01:00
Fridolin Somers e55b5f9bac Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables
Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
It is missing biblio_metadata to allow filtering on MARCXML with ExtractValue.

Test plan :
1) Be sur you have a biblio record with biblionumber 1
2) Run misc/migration_tools/rebuild_zebra.pl -h
3) You see : --table specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
4) Run misc/migration_tools/rebuild_zebra.pl -v -b --table biblio_metadata --where="biblio_metadata.biblionumber=1"
5) Check you dont have SQL errors

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c36597bc0c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 33b8f3ff1d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2f7868e9c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:24:46 +01:00
Kyle M Hall d2d640a55a Bug 21849: Two useless Koha::Account::Offset->new calls need attention
Came across those calls in bug 20598 in _FixOverduesOnReturn

        Koha::Account::Offset->new(
            {
                debit_id => $accountline->id,
                type => 'Forgiven',
                amount => $amountoutstanding * -1,
            }
        );

This does nothing if you don't store data.

Test Plan:
1) Apply this patch
2) Set up 2 items with overdue fines
3) Return one with dropbox mode
4) Note the dropbox account offset is created
5) Return one with full fine forgiveness
6) Note the forgiven account offset is created

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a2b5407ba5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ff3d3776a4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 56cbc940ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:23:04 +01:00
Kyle M Hall e2e7dc6220 Bug 21849: Add unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2dbaaa3008)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit aa565b8e99)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0a6c0c3260)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:22:36 +01:00
Nick Clemens 172fed8521 Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons
To test:
1 - Create four users:
    1 superlibrarian (or with both edit patrons and manage patron
            lists)
    1 with only edit patrons and catalogue
    1 with only add to list and catalogue
    1 with catalogue but neither edit patrons or manage patron lists
2 - Search patrons signed in as each user
3 - Note different sorting
4 - Apply patch
5 - Try searching with each patron
6 - Results should always be sorted by surname, firstname
7 - Only in the case of neither extra permission should the checkboxes
be absent

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 96b3889390)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f228847155)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit f0b6ec9e39)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:18:23 +01:00
Jesse Maseto a704b28c49 Bug 21962: (RMaint follow-up) Fixed bad rebase.
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
(cherry picked from commit b60fa7296b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:07:45 +01:00
Nick Clemens a0653c28f0 Bug 21962: Fix authority search using 'all'
To test:
1 - Set search engine to Zebra
2 - Have some authorities and indexes up to date
3 - Search authorities with option 'search entire record'
4 - No results
5 - Apply patch
6 - Run unit tests, they pass!
7 - Repeat search
8 - Results!

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3adf7708d5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a110125338)
(cherry picked from commit f6f5de147a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:06:21 +01:00
Nick Clemens cdeb4c8051 Bug 21962: Unit tests
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 39c93e87f6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d6b7e00b9c)
(cherry picked from commit f9a4e36561)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-01-02 10:04:55 +01:00
Fridolin Somers eac6010831 Update release notes for 17.11.13 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-21 09:55:41 +01:00
Fridolin Somers 256253daed Increment version for 17.11.13 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-21 07:50:06 +01:00
Koha translators 8ae67039e2 Translation updates for Koha 17.11.13 2018-12-21 03:45:57 -03:00
Nightly Build Bot 6b7f6d668c Bug 20952 - Automatic debian/control updates (oldoldstable/17.11.x)
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 17:17:41 +01:00
Jonathan Druart 061ce3bf0d Bug 21955: Remove Cache::Memory as fallback for L2 cache
If Plack is running with several workers we must not use Cache::Memory
as L2 cache.

If a value is set from a worker, it will not be available from other
workers as the Cache::Memory instance is not shared (of course!)

Moreover we now have Koha::Cache::Memory::Lite that does the same job,
so we should not expect performance regressions by removing it.

See also the email sent to koha-devel for more info
http://lists.koha-community.org/pipermail/koha-devel/2018-December/045004.html

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4bf033c6d6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6039f64e53)
(cherry picked from commit 7ffd1602a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 14:09:23 +01:00
Jesse Maseto 7cb565d360 Bug 21730: DBRev 18.05.06.001
Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit bdbb3103f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 13:51:42 +01:00
Jonathan Druart 04187ee909 Bug 21730: Add missing PA_CLASS authorized values categories
PA_CLASS is missing from the list of AV category

Test plan:
Execute the update DB entry
Confirm that you now have PA_CLASS in the AV category list

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 6ed6c341a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 13:49:38 +01:00
Fridolin Somers bd07cbd7dd Bug 21644: better UNIMARC XSLT display of 210 in intranet
In intranet default UNIMARC XSLT display of 210 is tricky.
It tests each subfield with a complex conditional prefix.
In OPAC default UNIMARC XSLT display 210 is simply displayed with a loop on all subfields.

I propose to use the same code as OPAC in intranet.
It allows to display $f and removes strange middle-score character.

Test plan:
1) Doni't apply patch
2) Use an UNIMARC database
3) Use default XSLT in all displays
4) Configure a framework to allow 210 subfields from 'a' to 'h'
5) Edit a record with this framework
6) In each 210 subfield enter its letter : $a a, $b b ...
7) Save record
8) Look at record in OPAC, you see : "Publication: a, b : c, d, e, f : g, h"
9) Look at record in intranet
10) You see : ""Publication: a, b : c, d - e : g, h
11) Apply patch
12) Look at record in intranet
13) You see : "Publication: a, b : c, d, e, f : g, h"

Signed-off-by: Andreas Roussos <arouss1980@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This patch makes intranet consistent with staff again on this area.
Note that we loose some punctuation like "- e".

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7b16603b31)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit d6838df1cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 13:47:09 +01:00
Marcel de Rooy 7b67ac6ce5 Bug 21874: (QA follow-up) Fix intranet sendshelf
Move encode line below regex line.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c1ec452e5c)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 22b4729180)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 13:45:44 +01:00
Katrin Fischer ed654e9a89 Bug 21874: Fix encoding of cart and list email subjects
The subject of the cart and list emails is not correctly
encoded and displays incorrectly in some email clients.

To test:

Lists:
- Create a list, name it using umlauts or other diacritics
  Example:  Jugendbücher (books for youths in German)
- Add some items to your list
- Email yourself the list
- Verify that the email subject is broken

Cart:
- Install another language with non-latin characters like Greek
- Fill the cart with some titles
- Send yourself the cart
- Verify that the email subject is broken

Note: Some email clients display correctly, others not.
      It's known to be incorrect in Outlook and web.de,
      displaying nicely in Thunderbird.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested all four scripts by manipulating the cart text too in templates.
Follow-up handles intranet sendshelf.

Note: I asked Katrin to remove the encode UTF-8 statements, since we
convert to MIME and the subject line should never be UTF-8.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e40bb00ab8)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit c58f6e5a12)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 13:45:31 +01:00
Andreas Roussos aaa26d83a9 Bug 21861: (follow-up) replace onchange() with jQuery equivalent
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f44a4f1d2a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cc0833fec6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1280bace7d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 10:58:33 +01:00
Andreas Roussos 727830e5ad Bug 21861: The MARC modification template actions editor does not always validate user input
The MARC modification template actions editor does not validate
user input when adding a conditional clause, making it possible
to save a modification action without filling in all necessary
fields.

This patch fixes that.

Test plan:
1) Create a MARC modification template and add a new action,
   e.g. "Copy All field(s) 200$a to field 600$a".
   Add a condition ("if" or "unless") but leave the relevant
   field and subfield textboxes empty.
   Add "matches" or "doesn't match" as a comparison operator.
   Check the "RegEx" checkbox, leave the regex textbox empty.
2) Click on "Add action" and notice how it accepts your input.
   Also notice the extra space in the Action column RegEx.
3) Edit your modification action and notice the missing "m/"
   before the conditional RegEx.

4) Apply the patch and hit CTRL-F5 to reload the relevant JS.

5) Edit the modification action you added previously (or add
   a new one). Try leaving the textboxes mentioned above empty
   and then submit your changes. You should get pop-up windows
   informing you about missing fields.
6) Now try typing a value in the conditional regex textbox and
   Update your action. In the Action column, there should be
   no spaces between the delimiters of the matching operator
   and the value you just entered.
7) Edit your action: notice how the "m/" before the regular
   expression and the "/" after it are now showing correctly.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3e1e1448e9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a616b9fc02)

Conflicts:
	koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4baf83a09a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 10:55:54 +01:00
Marcel de Rooy d31d563751 Bug 21867: Replace remaining document.element.onchange calls in marc_modification_templates.js
Replace onchange() by jQuery change().

Test plan:
Go to marc mod templates. Add, edit and delete. Check if works and no js
errors.
git grep -l -E "onchange\(" should not have occurrences outside lib.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Andreas Roussos <arouss1980@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit be78d3177e)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 99436fa499)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 10:51:05 +01:00
Marcel de Rooy 14a71ef32d Bug 21819: (QA follow-up) Replace onchange() in touched code
AFAIK we should not call document...onchange() and assume that it works.
Apparently, it does at least in some browsers. But we are not sure.
We could easily replace them here by the documented jQuery counterpart.

Note: If you try git grep -l -E "onchange\(" you will find some
occurrences in two libraries and only in one js file (this one).
We should replace all occurrences here; will open a new report for that.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified that the change event was triggered: span should expand/collapse.

Signed-off-by: Andreas Roussos <arouss1980@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit aeaf74b7cc)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 45b7f17038)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 10:48:12 +01:00
Andreas Roussos ea47f28398 Bug 21819: Marc modification templates action always checks Regexp checkbox
When editing a MARC modification template action, the 'RegEx'
checkbox to the right of the 'to field' textboxes will always
appear checked, even if no regular expression has been added.

This patch fixes that.

Test plan (steps 1-5 are copied from the original report -- thanks Pasi!):
1) Go to Tools > Marc modification templates, and create a new template
2) Add a new action to the template
3) Edit the action so it's "Move" field to another field.
   Do not check the RegEx checkbox after the "To" field.
4) Save the action.
5) Edit the same action again. The checkbox is now checked.
6) Apply the patch and hit Ctrl-F5 to do a hard refresh in your browser.
7) Edit the action you saved in 4): this time the 'RegEx' checkbox
   should be unchecked.
8) For completeness, add a regular expression to the "Move" action
   created in 3) and click on 'Update action'. When you re-edit this
   action the 'RegEx' checkbox should be checked.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a9fc00db03)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 57e031929d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 10:47:52 +01:00
Nick Clemens 54e1078dec Bug 21854: Use template plugin to display category description
Rather than getting the description in the script and passing, we should
just use the tmeplate plugin to get the description from the category
code.

To test:
1 - Find a patron, note their category
2 - Visit Tools - Batch patron modification
3 - Enter barcode of patron above
4 - Note category does not show in the display of patrons to be modified
5 - Apply patch
6 - Reload the page, note the patron category displays
7 - Modify the patron (anything but category)
8 - Check that category still diplays correctly in results

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Andreas Roussos <arouss1980@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit df68391a5e)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 391e7f7188)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 10:18:15 +01:00
Nick Clemens 128b073685 Bug 21837: Don't set holdingbranch filter using selected homebranch filter
To recreate:
1 - Open the overdues report (don't worry if you don't have results)
2 - Choose to filter by homebranch
3 - Note the holdingbranch filter is set to the selected homebranch
4 - Apply patch
5 - Clear filters
6 - repeat
7 - only homebranch is set

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 81ac96abec)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit cf8a03db2c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 10:02:17 +01:00
Nightly Build Bot 4e7e41f2a9 Bug 20952 - Automatic debian/control updates (oldoldstable/17.11.x)
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 09:09:04 +01:00
Mark Tompsett 8e15f71daf Bug 21853: (follow-up) to solve printpdf error
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Theoretically this follow-up makes no difference. All modules only export
printpdf and now we are just asking explicitly for printpdf. But if it
resolves some exception on the rule..

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5b62714e47)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 21536e3314)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 08:11:20 +01:00
Julian Maurice e47d9fd8b6 Bug 21853: Fix PDF export of basketgroups
In recent versions of Perl, '.' is not included by default in @INC. This
breaks PDF export of basketgroups.

This patch moves acqui/pdfformat/*.pm files in Koha namespace so that
they can be 'require'd without manipulating @INC

Test plan:
1. Turn off Plack/Starman and test PDF export for every value of
   OrderPdfFormat system preference
2. Turn on Plack/Starman and test PDF export for every value of
   OrderPdfFormat system preference
3. Test on a dev install and a standard/package install

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3c18d4c18f)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 320f9bf3d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-19 08:10:55 +01:00
Nick Clemens 516f58008c Bug 20598: Update number of tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 119653a3a1)

Conflicts:
	t/db_dependent/Circulation.t
(cherry picked from commit 1d797a8e5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-05 09:14:39 +01:00
Marcel de Rooy 7e259683c8 Bug 20598: (QA follow-up) Tiny fixes
[1] Correct POD for _FixOverduesOnReturn
Is called by AddReturn, AddRenewal and LostItem.
Also tested in Circulation.t btw

[2] $dbh is not used in _FixOverduesOnReturn
[3] Moving all parameters to the first line.
[4] Variable $uquery is not used too.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 867f88076e)
(cherry picked from commit 2c77175467)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-05 09:14:03 +01:00
Kyle M Hall 0eedb1580c Bug 20598: Unit test
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b9ed7699e3)
(cherry picked from commit 25ea817edf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-05 09:13:09 +01:00
Kyle M Hall 5c42c2686c Bug 20598: Accruing fines not closed out by longoverdue.pl if WhenLostForgiveFine is not enabled
Test Plan:
1) Ensure WhenLostForgiveFine is disabled
2) Create an overdue with a fine
3) Mark it lost with longoverdue.pl
4) Note it is still marked as an accruing fine
5) Apply this patch
6) Repeat steps 1-3
7) Note it is no longer an accruing fine!

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 461a6f53b8)
(cherry picked from commit 180909e7a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-05 09:12:25 +01:00
Marcel de Rooy aaae83d1bf Bug 18677: (QA follow-up) Trivial fixes to Chargelostitem.t
Kind of funny that we did not touch this test here. But it passed!
Trivial fixes:
[1] Typo precessfee
[2] Typo the linked
[3] Add rollback

Test plan:
Run t/db_dependent/Circulation/Chargelostitem.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fab9936ddb)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 2d1332938c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-05 09:00:41 +01:00
Jonathan Druart 7c9b946994 Bug 18677: Remove new issue_id param from charlostitem
We have the itemnumber no need to pass the issue_id, we can retrieve it
from chargelostitem

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3475670881)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 8b02c6c3a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-05 09:00:10 +01:00
Jonathan Druart dc86427ca4 Bug 18677: Make the tests pass
Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit cd250dae36)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit 6adfbd33f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-05 08:59:24 +01:00
Kyle M Hall 5a4f634784 Bug 18677: issue_id is not added to accountlines for lost item fees
Test Plan:
1) Apply this patch
2) prove t/db_dependent/Accounts.t

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

[EDIT:]
Patch should have increased the number of tests obviously.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit cde7a8e72c)

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>
(cherry picked from commit b876d09e35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-12-05 08:58:58 +01:00
Fridolin Somers 93dc736ee2 Bug 21116: (RMaint follow-up) do not use Koha::Exceptions::Exception 2018-11-29 14:56:38 +01:00
Fridolin Somers bdb94784a9 Bug 21116: (RMaint follow-up) do not use Koha::Exceptions::Exception 2018-11-29 14:43:09 +01:00
Tomas Cohen Arazi 16e0a19daf Bug 21116: Add API routes through plugins
This patch adds plugins the capability of injecting new routes on the
API.

The plugins should provide the following methods to be considered valid API-generating plugins:

- 'api_routes': returning the 'path' component of the OpenAPI specification corresponding to the routes served by the plugin
- 'api_namespace': it should return a namespace to be used for grouping the endpoints provided by the plugin

otherwise, they will be just skipped.

All plugin-generated routes will be added the 'contrib' namespace, and
will end up placed inside /contrib/<namespace>, where <namespace> is what the 'api_namespace' returns.

A sample endpoint will be added to the Kitchen Sink plugin, and tests
are being written.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> SUCCESS: Tests pass!
- Install the (latest) KitchenSink plugin
- Point your browser to the API like this:
  http://koha-intra.myDNSname.org:8081/api/v1/.html
=> SUCCESS: The /contrib/kitchensink/patrons/:patron_id/bother endpoint
implemented by the plugin has been merged!
- Sign off! :-D

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3fedae85f2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ab79f3fc67)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 13:26:14 +01:00
Tomas Cohen Arazi 8a5f84725f Bug 21116: Unit tests
This path implements unit tests for the route-from-plugin development.
It adds the required methods to the Koha::Plugin::Test plugin
distributed along with the tests. A second plugin implementing invalid
OpenAPI specs is added (Koha::Plugin::BadAPIRoute).

Edit: I made terminology changes to make it less rude.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 46c992948e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f243f8f012)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 13:25:16 +01:00
Owen Leonard bfc7877185 Bug 21186: (follow-up) Incorrect Bootstrap modal event name in multiple templates
This patch addresses a few more instances of this problem which I didn't
catch in my first pass.

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

- Go to Circulation -> Check in and check in an item which has a hold.
  - When the 'Hold found' modal appears the checkin barcode field
    behind it should be disabled.
  - When the modal is dismissed the checkin field should be enabled
    again and focus should be on that field.

- Go to Administration -> Library groups.
  - Click the "Add group" button. The cursor focus should be on the
    title field.

- Go to Tools -> MARC modification templates.
  - Click the "New template" button. The cursor focus should be on the
    name field.

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b943991316)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5f7a2c9213)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 11:47:00 +01:00
Owen Leonard e6c6dff9f9 Bug 21186: Incorrect Bootstrap modal event name in multiple templates
Modals in the staff client which load data via AJAX require an "on
close" action in order to clear the modal of the loaded data. The
problem presents itself the second time the modal is opened: The
"loading" message doesn't appear, and the data from the previous link
is shown until the new data loads.

To test, apply the patch and test the following pages. In each case,
click multiple instances of the modal trigger link/button to confirm
that the "loading" message always appears between re-displays of the
modal.

- Acquisitions -> Vendor -> Add to basket -> From a staged file -> Add orders
  - Test the "MARC" and "Card" links
- Acquisitions -> EDIFACT messages
  - Test the "View message" button
- Acquisitions -> Vendor -> Add to basket -> From an existing record
  - Test "View MARC" link
- Acquisitions -> Vendor -> Invoices -> Invoice -> Receipt page
  - Test the "Order," "MARC," and "Card" links.
- Catalog -> Bibliographic record details
  - Test the MARC Preview link.
- Cataloging -> Cataloging search results
  - Test the Actions -> MARC preview and Actions -> Card preview menu
    items
- Cataloging -> Cataloging search results -> Merge
  - Test the "View MARC" linkscataloguing/merge.tt
- Tools -> Patron lists -> Actions -> Print patron cards
- Tools -> Batch record modification -> Results -> Show MARC
- Tools -> Staged MARC record management -> View batch
  - Test MARC preview shown when you click a staged title

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7b6107beaf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5d6eb1f67b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 11:44:41 +01:00
Andrew Isherwood 5b4e7813cd Bug 20968: (follow-up) Replace tabs with spaces
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9783773ada)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6b4410d967)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 11:12:51 +01:00
Kyle M Hall fb5bc30637 Bug 20968: Rename method get_intranet_catalog_toolbar_button to intranet_catalog_biblio_enhancements_toolbar_button
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e87fa069dc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2a899edbcc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 11:12:41 +01:00
Kyle M Hall 636bd0f195 Bug 20968: Add unit tests
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 60ca17c616)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit db0c642d9b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 11:11:35 +01:00
Andrew Isherwood 76edb4d9ae Bug 20968: (follow-up) Respond to feedback
This patch:

- Removes the unecessary testing for
intranet_catalog_biblio_enhancements method in detail.pl
- Renames get_toolbar_button to get_intranet_catalog_toolbar_button

Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7910a530b8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cd3af66cd4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 11:11:30 +01:00
Andrew Isherwood 2f1b848a5e Bug 20968: Add hooks into cat-toolbar.inc to display buttons
This commit adds hooks into cat-toolbar.inc to allow the display of
arbitrary buttons as supplied by plugins within the
intranet_catalog_biblio_enhancements class that provide the method
get_toolbar_button

To test:

1) Download the plugin from
https://github.com/PTFS-Europe/cla-permissions-check-plugin
2) Follow the installation instructions from:
https://github.com/PTFS-Europe/cla-permissions-check-plugin
3) TEST: Observe that the "CLA Check Permissions" button takes the user
to the Check Permissions page and a modal displays containing the
results of the query
4) Remove the API key from the plugin "Configuration" page
5) TEST: Ensure that the "CLA Check Permissions" button takes the user
to the Check Permissions page and message displays informing the user
that "Did not receive required request parameters"

https://bugs.koha-community.org/show_bug.cgi?id=20968

Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 741f17e916)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2c7724f3bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-29 11:11:25 +01:00
Fridolin Somers 42f56d918a Revert "Bug 21479: Add regression tests"
This reverts commit 37c5a82953.
2018-11-28 16:25:13 +01:00