koha.git
4 years agoBug 18933: Allow OPAC messaging SMS number to be set to empty
Aleisha Amohia [Sun, 9 Feb 2020 21:55:01 +0000 (21:55 +0000)]
Bug 18933: Allow OPAC messaging SMS number to be set to empty

To test:
1) Ensure EnhancedMessagingPreferences is enabled and
EnhancedMessagingPreferencesOPAC is set to Show. Set SMSSendDriver to
Email
2) Log in to OPAC, go to your messaging tab
3) Set an SMS number if you havent already
4) Try to remove it (set to empty)
5) Notice that it says the number has been updated, but it has not
been set to empty
6) Apply patch and refresh page
7) Attempt to set the number to empty
8) Confirm this is successful

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24388: Remove uneeded test in lateorders.tt
Jonathan Druart [Mon, 16 Dec 2019 17:50:16 +0000 (18:50 +0100)]
Bug 24388: Remove uneeded test in lateorders.tt

The budget_lock is never set (and has never been).

Test plan:
For QAer only, make sure this never worked

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24549: Do not set "last patron" cookie if showLastPatron is disabled
Jonathan Druart [Wed, 12 Feb 2020 14:49:17 +0000 (15:49 +0100)]
Bug 24549: Do not set "last patron" cookie if showLastPatron is disabled

If the showLastPatron syspref is disabled, we should not store the 3
cookies we use for this feature.

Test plan:
0/ Do not apply this patch
1/ Turn off showLastPatron
2/ Search for a patron, click on a result
3/ Open the cookie list of your browser
=> You see 3 cookies named lastborrowercard, lastborrowername,
lastborrowernumber
4/ Remove them
5/ Apply the patch
6/ Reload the patron detail page
=> The 3 cookies are not created
7/ Turn the pref on
8/ Reload the patron detail page
=> The 3 cookies are created
9/ Eat one of them.

QA note: it's a bit dirty, we should do that JS side, but
staff-global.js is too widely used to make the change easy. Any other
suggestions welcomed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24725: (QA follow-up) Add missing spaces between elements on claims tab
Katrin Fischer [Mon, 24 Feb 2020 17:01:19 +0000 (17:01 +0000)]
Bug 24725: (QA follow-up) Add missing spaces between elements on claims tab

There was a missing space between the title and the barcode.
Also added a space between title and author.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24725: Remove ES template literals in checkouts.js
Jonathan Druart [Tue, 25 Feb 2020 13:40:06 +0000 (14:40 +0100)]
Bug 24725: Remove ES template literals in checkouts.js

From Julian on bug 24661 comment 6:
"""
It looks like xgettext does not like ES6 template literals.

https://savannah.gnu.org/bugs/?50920

From what I understand, support for template literals was added in gettext 0.20 (still not packaged in debian) but is still buggy in latest released version 0.20.1 and a fix is present in master.
"""

We should not use backticks ` in .js file, it breaks xgettext.

To replicate:
kohadev-koha@e1f3025cca60:/kohadevbox/koha/misc/translator$ perl translate update es-ES
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:569: warning: unterminated string
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:858: warning: unterminated string
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:904: warning: unterminated string
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:911: warning: unterminated string
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:1095: warning: RegExp literal terminated too early
/usr/bin/msgmerge: error while opening "/kohadevbox/koha/misc/translator/po/es-ES-messages-js.po" for reading: No such file or directory

(last error 'No such file or directory' is not related to this).

Test plan:
Make sure nothing is broken on the claims table
Confirm that the errors do not longer appear on `perl translate update LANG`

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24727: (bug 14697 follow-up) Replace link on title to bib detail page
Jonathan Druart [Tue, 25 Feb 2020 13:17:27 +0000 (14:17 +0100)]
Bug 24727: (bug 14697 follow-up) Replace link on title to bib detail page

903                               let title = `<a
class="return-claim-title strong"
href="/cgi-bin/koha/circ/request-rcticle.pl?biblionumber=[%
rc.checkout.item.biblionumber | html %]">

At first it seems like a typo:
request-rcticle.pl vs request-acticle.pl

But actually it does not make sense to link to request-article, we want
(I think) to link to the bibliographic record detail page.

Test plan:
- Have something in the claim table (cf bug 14697)
- Click on the title of the bibliographic record

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24664: Add missing *-messages-js.po
Bernardo Gonzalez Kriegel [Fri, 14 Feb 2020 14:33:44 +0000 (11:33 -0300)]
Bug 24664: Add missing *-messages-js.po

If you try to update some language translation files
translate script will complain of missing *-messajes-js.po
file.

This patch adds those missing files

To test:
1) Go to misc translation
2) Update some language, eg- fr-FR
Check error
/usr/bin/msgmerge: error while opening "/.../misc/translator/po/es-ES-messages-js.po" for reading: No such file or directory
3) Apply this patch
4) Repeat 2), no error message

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24677: (bug 24002 follow-up) Incorrect DATE value: '00-00-0000' in C4/Serials.pm
Jonathan Druart [Mon, 17 Feb 2020 17:18:48 +0000 (18:18 +0100)]
Bug 24677: (bug 24002 follow-up) Incorrect DATE value: '00-00-0000' in C4/Serials.pm

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

From bug 24002:
  commit 3d3336ed6607d80b72502075ebf9567cf48e1709
  Bug 24002: Incorrect DATE value: '00-00-0000' in C4/Serials.pm

The changes from this patch are like:
-            year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year,
+            year(IF(serial.publisheddate IS NULL,serial.publisheddate,serial.planneddate)) as year,

This is stilly, if publisheddate is null we do not want to return it.

It comes from a wrong copy/paste from the other commits:
-                        ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC";
+                        ORDER BY IF(publisheddate IS NULL,planneddate,publisheddate) DESC";

="00-00-0000" vs <>"0000-00-00"

Test plan:
Eyeball the previous patches from bug 24002 and notice that the changes in the commit listed previously are wrong

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24642: Make Cache::Memcached::Fast::Safe required
Jonathan Druart [Wed, 12 Feb 2020 14:24:35 +0000 (15:24 +0100)]
Bug 24642: Make Cache::Memcached::Fast::Safe required

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

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

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

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

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13193: (RM follow-up) Remove Cache::Memcached::Fast from PerlDependencies
Martin Renvoize [Fri, 7 Feb 2020 14:32:13 +0000 (14:32 +0000)]
Bug 13193: (RM follow-up) Remove Cache::Memcached::Fast from PerlDependencies

We replaced this module with Cache::Memcached::Fast::Safe and so do not
need to depend upon it any longer.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13193: (follow-up) Update debian/control file
Mason James [Fri, 7 Feb 2020 02:11:05 +0000 (15:11 +1300)]
Bug 13193: (follow-up) Update debian/control file

The dependancy has now been packaged, this patch adds it to the debian
control file for package installs.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13193: Make Memcached usage fork safe
Joonas Kylmälä [Mon, 16 Sep 2019 10:26:01 +0000 (10:26 +0000)]
Bug 13193: Make Memcached usage fork safe

When a high enough number of forks try to access for example system
preferences with Koha::Cache using memcached as backend the results of
different cache requests get mixed up.

The problem is fixed by using Cache::Memcached::Fast::Safe that is a
fork safe version of Cache::Memcached::Fast.

Sponsored-by: The National Library of Finland
Signed-off-by: David Cook <dcook@prosentient.com.au>
Works as described, and solves an insidious difficult to debug
problem in Koha.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24661: Fix inclusion of locale-related javascript files
Julian Maurice [Fri, 14 Feb 2020 08:46:01 +0000 (09:46 +0100)]
Bug 24661: Fix inclusion of locale-related javascript files

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

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

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24734: Fix paths in LangInstaller.pm for JS files
Julian Maurice [Wed, 26 Feb 2020 19:09:52 +0000 (20:09 +0100)]
Bug 24734: Fix paths in LangInstaller.pm for JS files

Use intrahtdocs and opachtdocs in order to get the correct paths for all
kind of installations

Test plan:
1. With a dev install, run ./translator create/update/install xx-XX and
   verify that there is no error message
2. With a standard install, run ./translator create/update/install xx-XX
   and verify that there is no error message

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested for dev/single/standard installs, no errors,
just a (normal) warn from po2json.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 21156: (RM follow-up) Correction to added filters
Martin Renvoize [Fri, 14 Feb 2020 11:42:54 +0000 (11:42 +0000)]
Bug 21156: (RM follow-up) Correction to added filters

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 21156: (RM follow-up) Add missing filters
Martin Renvoize [Mon, 10 Feb 2020 14:13:04 +0000 (14:13 +0000)]
Bug 21156: (RM follow-up) Add missing filters

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 21156: Add plural translation capabilities to JS files
Julian Maurice [Mon, 4 Jan 2016 20:08:29 +0000 (21:08 +0100)]
Bug 21156: Add plural translation capabilities to JS files

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

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

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

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

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

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works well, translation is OK and test message is displayed correctly.
Current qa-tool error is a false positive.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23527: BakerTaylorBookstoreURL is converted to escaped characters by template...
David Kuhn [Sat, 31 Aug 2019 23:23:16 +0000 (16:23 -0700)]
Bug 23527: BakerTaylorBookstoreURL is converted to escaped characters by template, rendering it invalid

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

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

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Although I don't have valid Baker & Taylor credentials I was able to use
dummy data to verify that the links in the template are correctly
encoded with this patch.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24640: DBRev 19.11.03.002
Joy Nelson [Thu, 5 Mar 2020 01:50:40 +0000 (01:50 +0000)]
Bug 24640: DBRev 19.11.03.002

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24640: Allow quotes.timestamp to be NULL
Jonathan Druart [Wed, 12 Feb 2020 11:26:25 +0000 (12:26 +0100)]
Bug 24640: Allow quotes.timestamp to be NULL

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24654: Remove trailing quote in rda264 XSLT
Nick Clemens [Thu, 13 Feb 2020 15:43:30 +0000 (15:43 +0000)]
Bug 24654: Remove trailing quote in rda264 XSLT

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24621: Phase out jquery.cookie.js: Basic MARC editor
Owen Leonard [Mon, 10 Feb 2020 19:04:57 +0000 (19:04 +0000)]
Bug 24621: Phase out jquery.cookie.js: Basic MARC editor

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

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24619: Phase out jquery.cookie.js: MARC Frameworks
Owen Leonard [Mon, 10 Feb 2020 17:58:04 +0000 (17:58 +0000)]
Bug 24619: Phase out jquery.cookie.js: MARC Frameworks

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

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24389: Better error handle when claiming late orders
Jonathan Druart [Mon, 16 Dec 2019 16:15:19 +0000 (17:15 +0100)]
Bug 24389: Better error handle when claiming late orders

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

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

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 18499: (QA follow-up) Add missing colon after label description
Katrin Fischer [Sat, 15 Feb 2020 01:15:35 +0000 (01:15 +0000)]
Bug 18499: (QA follow-up) Add missing colon after label description

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

Callnumber classification scheme: [pull down]

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 18499: (follow-up) Add missing filters
Nick Clemens [Fri, 14 Feb 2020 17:59:38 +0000 (17:59 +0000)]
Bug 18499: (follow-up) Add missing filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 18499: Use items cn_source in cn_browser.pl
Nick Clemens [Thu, 6 Feb 2020 13:14:30 +0000 (13:14 +0000)]
Bug 18499: Use items cn_source in cn_browser.pl

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

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

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20882: DBRev 19.11.03.001
Joy Nelson [Thu, 5 Mar 2020 01:19:27 +0000 (01:19 +0000)]
Bug 20882: DBRev 19.11.03.001

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20882: Move items.uri to mediumtext
Marcel de Rooy [Mon, 10 Feb 2020 14:28:51 +0000 (14:28 +0000)]
Bug 20882: Move items.uri to mediumtext

Applies to items and deleteditems.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24506: Multibranch limit does not work with ElasticSearch
Andreas Jonsson [Fri, 24 Jan 2020 10:13:05 +0000 (10:13 +0000)]
Bug 24506: Multibranch limit does not work with ElasticSearch

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13574: Fix display of repeatable item subfields
Marcel de Rooy [Mon, 10 Feb 2020 15:17:38 +0000 (15:17 +0000)]
Bug 13574: Fix display of repeatable item subfields

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24649: Fix two other missing <li> tags for cloned subfields
Marcel de Rooy [Thu, 13 Feb 2020 09:27:26 +0000 (09:27 +0000)]
Bug 24649: Fix two other missing <li> tags for cloned subfields

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24649: Fix missing <li> tag on item editor for cloned subfield
Marcel de Rooy [Thu, 13 Feb 2020 08:56:35 +0000 (08:56 +0000)]
Bug 24649: Fix missing <li> tag on item editor for cloned subfield

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24643: Add test to cover the timezone
Jonathan Druart [Thu, 13 Feb 2020 13:24:52 +0000 (14:24 +0100)]
Bug 24643: Add test to cover the timezone

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24643: Add unit tests
Andrew Isherwood [Wed, 12 Feb 2020 16:28:58 +0000 (16:28 +0000)]
Bug 24643: Add unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24643: Support fractional seconds
Andrew Isherwood [Wed, 12 Feb 2020 16:04:07 +0000 (16:04 +0000)]
Bug 24643: Support fractional seconds

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

Test plan:

- Apply patch
- prove t/DateUtils.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 11281: Printing holds awaiting pickup prints both tabs
Owen Leonard [Fri, 22 Nov 2019 19:29:53 +0000 (19:29 +0000)]
Bug 11281: Printing holds awaiting pickup prints both tabs

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

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22860: Remove 1 remaining patron after authentication.t is ran
Jonathan Druart [Mon, 6 May 2019 20:37:38 +0000 (15:37 -0500)]
Bug 22860: Remove 1 remaining patron after authentication.t is ran

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

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24516: Add account_type to the columns settings on boraccount
Jonathan Druart [Mon, 3 Feb 2020 16:31:42 +0000 (17:31 +0100)]
Bug 24516: Add account_type to the columns settings on boraccount

The column was missing from the yml file.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13305: Remove tabindex from PrepareItemsRecordDisplay
Marcel de Rooy [Mon, 20 Jan 2020 12:41:51 +0000 (12:41 +0000)]
Bug 13305: Remove tabindex from PrepareItemsRecordDisplay

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 16719: (QA follow-up) Remove tabs
Nick Clemens [Fri, 7 Feb 2020 16:52:52 +0000 (16:52 +0000)]
Bug 16719: (QA follow-up) Remove tabs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 16719: (follow-up) Update check on password mapping
Oliver Behnke [Fri, 7 Feb 2020 12:35:21 +0000 (12:35 +0000)]
Bug 16719: (follow-up) Update check on password mapping

Change to allow for unmapped default passwords

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 16719: Pass through undef rather than empty string in LDAP mapping
Oliver Behnke [Fri, 7 Feb 2020 12:31:31 +0000 (12:31 +0000)]
Bug 16719: Pass through undef rather than empty string in LDAP mapping

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23640: Flushing L1 on every SIP connection
Jonathan Druart [Thu, 14 Nov 2019 09:50:24 +0000 (10:50 +0100)]
Bug 23640: Flushing L1 on every SIP connection

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

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

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

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

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

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

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

5. Disable IssueLog

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

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

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

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

8. Note results

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

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

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

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24410: Fix multi holds
Jonathan Druart [Mon, 13 Jan 2020 13:30:35 +0000 (14:30 +0100)]
Bug 24410: Fix multi holds

Bug 19618 replaces the call to placerequest.pl with a REST API /holds
That is wrong as it does not support multi holds.

Test plan:
Confirm that prior to this patch you are not able to place a hold on
several records at once, and that this patch fixes it

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13420: (QA follow-up): Fix typo itemdate -> itemdata
Josef Moravec [Wed, 5 Feb 2020 21:13:22 +0000 (21:13 +0000)]
Bug 13420: (QA follow-up): Fix typo itemdate -> itemdata

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13420: Fallback to the previous behavior if published date is not used
Jonathan Druart [Tue, 6 Aug 2019 13:56:44 +0000 (08:56 -0500)]
Bug 13420: Fallback to the previous behavior if published date is not used

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13420: Sort "Serial enumeration" by published date
Jonathan Druart [Mon, 29 Apr 2019 02:53:55 +0000 (22:53 -0400)]
Bug 13420: Sort "Serial enumeration" by published date

So far the sorting on volume information is incorrect. It sorts by the
string displayed in the cell, which may not have any logics.

A better solution would be to use Kyle's suggestion, see comments 7, 8,
but it will need much more work.

This patch suggests to use the publication date to sort this column.
Note: In the code there is a switch depending on the existence of
items.publisheddate, but I do not think it is valid, this valid should
always exist if the item is received (did I miss something?)

Test plan:
You need to have different existing subscription, using different
numbering.
On the detail page of the bibliographic record you should be able to
sort the serials (tab "Holdings") by "Serial enumeration".
The sort will now use the publication dates.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoUpdate release notes for 19.11.03 release v19.11.03
Joy Nelson [Fri, 21 Feb 2020 18:30:15 +0000 (18:30 +0000)]
Update release notes for 19.11.03 release

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoIncrement version for 19.11.03 release
Joy Nelson [Fri, 21 Feb 2020 16:54:55 +0000 (16:54 +0000)]
Increment version for 19.11.03 release

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoTranslation updates for Koha 19.11.03
Koha translators [Fri, 21 Feb 2020 16:46:25 +0000 (13:46 -0300)]
Translation updates for Koha 19.11.03

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23290: [RMaint version] Mitigate XML/XSLT vulnerabilities
Marcel de Rooy [Mon, 20 Jan 2020 09:55:52 +0000 (09:55 +0000)]
Bug 23290: [RMaint version] Mitigate XML/XSLT vulnerabilities

This is a squashed version for backporting to stable branches.
IMPORTANT: It does not move XSLT_Handler to XSLT/Base as in master.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23784: Show subtitle, number and part in course reserve list of records
Katrin Fischer [Sat, 2 Nov 2019 06:39:28 +0000 (06:39 +0000)]
Bug 23784: Show subtitle, number and part in course reserve list of records

At the moment only the title will display in the course reserves
details, but not the information from other title fields. For
series with multiple volumes that can lead to confusing display.
The patch makes use of the new include to display 245$abnp.

To test:
- Add mulitple records to a course reserce course
  Make sure you have some with different combinations of 245$b$n$p
- Look at the course details in the OPAC
- Verify only $a displays
- Apply patch
- Reload
- Verify now the full information displays

Depending on your installation, you might want ot check that the 245
are correctly mapped and save the record once so the database
fields are correctly filled.

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 19809: Remove some new occurrences
Jonathan Druart [Wed, 22 Jan 2020 10:50:19 +0000 (11:50 +0100)]
Bug 19809: Remove some new occurrences

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 19809: Re-allow to call Koha::Objects::find in list context
Julian Maurice [Thu, 14 Dec 2017 08:19:22 +0000 (09:19 +0100)]
Bug 19809: Re-allow to call Koha::Objects::find in list context

and remove 'scalar' keyword in calls where it's not needed.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24449: Add too_many_overdue to patron status for SIP
Nick Clemens [Fri, 17 Jan 2020 14:29:42 +0000 (14:29 +0000)]
Bug 24449: Add too_many_overdue to patron status for SIP

To test:
1 - Have sip running and use the cli to get info for a patron
    example: perl misc/sip_cli_emulator.pl  -a localhost -p 6001 -su koha -sp koha -l CPL -m patron_status_request --patron koha
2 - Checkout an item to the patron, backdated so it is overdue
3 - Set syspref 'OverduesBlockCirc' to anything but "Don't Block"
4 - Get the patron status via SIP, note circ blocked flag is set, but too_many_overdue is not
5 - Apply patch
6 - Restart all the things
7 - Get the patron status via SIP
8 - Note the too_many_overdue flag is now triggered and there is a message
    example: READ: 24Y     Y       00120200117    142716AEEdna Acosta|AA23529001000463|BLY|CQN|BV0.25|AFGreetings from Koha.  -- Patron has overdues -- Patron owes 0.25|AOCPL|

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24590: Fix Koha/Object.t on MySQL 8
Jonathan Druart [Wed, 5 Feb 2020 09:36:14 +0000 (10:36 +0100)]
Bug 24590: Fix Koha/Object.t on MySQL 8

% prove t/db_dependent/Koha/Object.t
is failing on MySQL 8 with:

 kohadev-koha@9bbf9ac68519:/kohadevbox/koha$ prove t/db_dependent/Koha/Object.t
 t/db_dependent/Koha/Object.t .. 15/18
     #   Failed test 'Exception field is correct'
     #   at t/db_dependent/Koha/Object.t line 650.
     #          got: 'api_keys.secret'
     #     expected: 'secret'
     # Looks like you failed 1 test of 16.
 t/db_dependent/Koha/Object.t .. 16/18
 #   Failed test 'store() tests'
 #   at t/db_dependent/Koha/Object.t line 723.

MySQL 8 displays the tablename in the error.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24420: Display waiting on hold items in the Cataloging search results Location...
Lucas Gass [Tue, 14 Jan 2020 15:40:38 +0000 (15:40 +0000)]
Bug 24420: Display waiting on hold items in the Cataloging search results Location column

To Test:
1. Place a hold on an item and trigger it.
2  Do a cataloging search that would include this record.
3. Notice that the 'Location' column does not account for this onhold
item.
4. Apply patch and look at catalog results again.
5. You should see information display about the item being on hold.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23844: Check if field defined in framework and specify 'Default' for framework
Nick [Fri, 18 Oct 2019 18:26:38 +0000 (18:26 +0000)]
Bug 23844: Check if field defined in framework and specify 'Default' for framework

To test:
1 - Go to Cataloguing
2 - New from Z3950
3 - Find an import a record
4 - Check the plack logs:
Use of uninitialized value in string ne at /kohadevbox/koha/cataloguing/addbiblio.pl line 565.
Use of uninitialized value in string ne at /kohadevbox/koha/cataloguing/addbiblio.pl line 580.
Use of uninitialized value $frameworkcode in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 711.
Use of uninitialized value $frameworkcode in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 715.
Use of uninitialized value $frameworkcode in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 734.
5 - Apply patch
6 - Repeat
7 - No new errors
8 - Confirm selecting 'Default' from 'New from Z3950' dropdown also generates no errors

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22302: Make ITEMTYPECAT descriptions fallback to lib description if no opac descr...
Nick Clemens [Tue, 4 Feb 2020 14:16:26 +0000 (14:16 +0000)]
Bug 22302: Make ITEMTYPECAT descriptions fallback to lib description if no opac description

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22302: Unit tests
Nick Clemens [Tue, 4 Feb 2020 14:15:36 +0000 (14:15 +0000)]
Bug 22302: Unit tests

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20708: Add Withdrawn status when placing a request in staff
Jonathan Druart [Tue, 4 Feb 2020 10:17:11 +0000 (11:17 +0100)]
Bug 20708: Add Withdrawn status when placing a request in staff

Same as bug 22021 for the withdrawn status.

1. Withdraw an item
2. Place an hold on this item
Notice the new "withdrawn" status in the information column

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 9993: On editing basket group delivery place resets to logged in branch
Owen Leonard [Wed, 20 Nov 2019 17:00:52 +0000 (17:00 +0000)]
Bug 9993: On editing basket group delivery place resets to logged in branch

This patch modifies basketgroups.pl so that existing data about a basket
group's billing and delivery place are correctly preselected in the edit
form. These fields shouldn't reset to the logged-in user's home branch
just because they have an empty value.

To test, apply the patch and go to Acquisitions -> Vendor -> Basket
groups.

When adding or editing a basket group the pre-selected value for
"Billing place" and "Delivery place" should be correct:

   - When creating a new basket group: The logged-in user's library
     should be pre-selected.

   - When editing a basket group which has a library defined for either
     the billing or delivery places, the correct library should be
     pre-selected.

   - When editing a basket group which has no library defined for either
     the billing or delivery place there should be no library
     pre-selected (the "--" option should be pre-selected).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10879: OverDrive should check for OverDriveLibraryID before performing search
Owen Leonard [Tue, 19 Nov 2019 17:02:02 +0000 (17:02 +0000)]
Bug 10879: OverDrive should check for OverDriveLibraryID before performing search

This patch modifies the OPAC search results template to check for three
populated system preferences before performing an OverDrive search:
OverDriveLibraryID, OverDriveClientKey, and OverDriveClientSecret.
Previously OverDriveLibraryID was not checked, but without it the
interface reports an error performing the search.

To test you must have credentials for the OverDrive API as defined
in OverDriveClientKey, OverDriveClientSecret, and OverDriveLibraryID
system preferences.

 - With OverDriveLibraryID defined, the catalog search results page in
   the OPAC should show a link to results in the library's OverDrive
   collection.

 - With no value in the OverDriveLibraryID preference the catalog
   search page should not show any message about an OverDrive
   collection.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24560: Remove No public list text from OPAC
Lucas Gass [Sat, 1 Feb 2020 16:42:10 +0000 (16:42 +0000)]
Bug 24560: Remove No public list text from OPAC

On the OPAC, the dropdown for Lists always includes
the heading Public Lists, even if no public lists exist.
This is sub-optimal for libraries that want VirtualShelves
enabled for private lists but don't want to use public lists.

TEST PLAN:
1. have no public list and look at the List dropdown on the OPAC. It says No Public Lists.
2. Apply patch
3. It should now not say anything about public lists but still be formatted nice.
4. Add some public lists and confirm that everything looks normal.
5. Sign off

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24171: Check auto_renew if confirmation is needed
Jonathan Druart [Mon, 23 Dec 2019 13:06:06 +0000 (14:06 +0100)]
Bug 24171: Check auto_renew if confirmation is needed

Test plan:
Add some fines
Check auto_renew and check an item out, using a title keyword
Pick one item
You get the confirmation box
=> Notice that the auto_renew checkbox is checked

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24171: Preserve auto_renew when triggering itemBarcodeFallbackSearch
Jonathan Druart [Tue, 17 Dec 2019 11:10:28 +0000 (12:10 +0100)]
Bug 24171: Preserve auto_renew when triggering itemBarcodeFallbackSearch

The auto_renew parameter is not sent to the template when the popup
triggered by itemBarcodeFallbackSearch is displayed.

Test plan:
- Turn on itemBarcodeFallbackSearch
- Open a patron account
- Check the checkboxes for automatic-renewal
- Search for a title keyword in the checkout input box
- Verify that auto-renewal flag is set

Note for QA: The auto_renew flag will be set in any cases. Should we
expect regression?

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24546: Fix intentions of build_sample_item in Club/Hold.t
Jonathan Druart [Thu, 30 Jan 2020 14:38:26 +0000 (15:38 +0100)]
Bug 24546: Fix intentions of build_sample_item in Club/Hold.t

In t/db_dependent/Koha/Club/Hold.t:
my $item1 = $builder->build_sample_item({ branchcode => $library->branchcode });
my $item2 = $builder->build_sample_item({ branchcode => $library->branchcode });

build_sample_item takes either "library" or the item's attributes.
branchcode is not part of the item's table, so what those 2 lines are trying to acchieve is wrong.

Test plan:
 % prove t/db_dependent/Koha/Club/Hold.t
must return green before and after this patch

Note that this patch also remove an uneeded debugging statement.

This has been caught by bug 24363.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24213: Fix Koha::Object->get_from_storage if the object has been deleted
Jonathan Druart [Wed, 11 Dec 2019 08:39:30 +0000 (09:39 +0100)]
Bug 24213: Fix Koha::Object->get_from_storage if the object has been deleted

Without this patch it fails with something like:
  DBIC result _type  isn't of the _type Subscription at t/db_dependent/Biblio.t line 627.

Test plan:
- Apply the first patch (Add tests)
- Confirm that they fail
- Apply this patch
- Confirm that the tests pass

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24213: Add tests
Jonathan Druart [Wed, 11 Dec 2019 08:39:15 +0000 (09:39 +0100)]
Bug 24213: Add tests

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24523: Add missing </p>
Lucas Gass [Mon, 27 Jan 2020 22:06:06 +0000 (22:06 +0000)]
Bug 24523: Add missing </p>

Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24330: When importing patrons from CSV, automatically strip BOM from file if...
Kyle M Hall [Thu, 2 Jan 2020 15:30:54 +0000 (10:30 -0500)]
Bug 24330: When importing patrons from CSV, automatically strip BOM from file if it exists

We have a partner that exports UTF-8 CSV files, and is experiencing the same thing as the author of this article: https://www.freecodecamp.org/news/a-quick-tale-about-feff-the-invisible-character-cd25cd4630e7/

In short, Excel is inserting an invisible UTF-8 character at the start of the file, so that the column name "cardnumber" is actually named "\x{feff}cardnumber", causing "cardnumber" to be blank.

A simple solution is provided here: https://stackoverflow.com/questions/24390034/remove-bom-from-string-with-perl

Test Plan:
1) Download the example.csv file
2) Attempt to import it using the patron import tool
3) Note the invalid column name error
4) Apply this patch, restart all the things!
5) Attempt the import again
6) Assuming you have a branchcode MPL and a cataegory code S, the patron should import!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Maggie Wong <maggie.wong@yccece.edu.hk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24543: Fix wrong test in api/v1/checkouts.t
Jonathan Druart [Thu, 30 Jan 2020 10:51:25 +0000 (11:51 +0100)]
Bug 24543: Fix wrong test in api/v1/checkouts.t

In t/db_dependent/api/v1/checkouts.t we define a circulation rule with renewalperiod=7.
But then the expected due date is today+14 days.
However, at the beginning of the script, the due_date of the issue is today+14 days.

That highlight that the renewal period is not taken into account.

The circulation rule is created with renewalperiod and renewalsallowed,
however GetLoanLength check the existence of issuelength to return the rule.
GetLoanLength finally return the default rule, with renewalperiod=0

Note that this has been found working on bug 18936, code will be cleaned on that patchset.

Test plan:
 % prove t/db_dependent/api/v1/checkouts.t
must return green before and after this patch

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23896: logaction should pass the correct interface to Koha::Logger
Marcel de Rooy [Fri, 25 Oct 2019 08:49:15 +0000 (08:49 +0000)]
Bug 23896: logaction should pass the correct interface to Koha::Logger

Trivial fix.

Test plan:
Run t/db../Log.t to ensure that we did not break stuff.
If you set opac to debug in log4perl config, inspect opac-error.log to see
if you have extra loglines from running the test script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 17697: Improve NotesBlacklist system preference description
Katrin Fischer [Sun, 12 Jan 2020 10:16:05 +0000 (11:16 +0100)]
Bug 17697: Improve NotesBlacklist system preference description

- Switched 'separator' for more common 'tab' and rephrased sentence
- Added examples
- Added note to use hidden settings for hiding in other spots.

To test:
- Search for NotesBlacklist system preference and read the description
- Apply patch
- Refresh and read again
- If improved, sign off.

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24542: (bug 23049 follow-up) Add missing use statement in Koha::Account
Jonathan Druart [Thu, 30 Jan 2020 09:51:51 +0000 (10:51 +0100)]
Bug 24542: (bug 23049 follow-up) Add missing use statement in Koha::Account

Fix the following error when an item is checked out and that
ManInvInNoissuesCharge is turned off:
Can't locate object method "search" via package "Koha::Account::DebitTypes"

Test plan:
0/ Turn off ManInvInNoissuesCharge
1/ Check an item out

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22868: DBRev 19.11.02.004
Joy Nelson [Mon, 10 Feb 2020 23:14:11 +0000 (23:14 +0000)]
Bug 22868: DBRev 19.11.02.004

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22868: Move suggestions_manage subperm out of acquisition perm
Jonathan Druart [Tue, 14 Jan 2020 09:02:11 +0000 (10:02 +0100)]
Bug 22868: Move suggestions_manage subperm out of acquisition perm

Bug 11911 replaced the permission of suggestions.pl (create a purchase
suggestion) from catalogue => 1 to acquisition => 'suggestions_manage'.
However we have a lot of acquisition scripts that have lax permissions
(acquisition => '*' which means any sub permissions of acquisition is
enough).

That causes problem when a circulation staff can create purchase
suggestions but not access acquisition information.

One solution is to move the suggestions_manage subpermission out of the
acquisition permission and create a new suggestion permission.

Test plan:
0. Setup
* Create a patron with several permission (and full acquisition
permission)
* Create another patron with several permission, and suggestions_manage
permission
* Create another patron without the suggestions_manage permission
1. Apply the patch and execute the update database entry
2. Note that the third patron you create still does not have
suggestions_manage
3. Confirm that you can create a purchase suggestion if you have
suggestions_manage, but cannot access acquisition pages if you do not
have any subpermissions of the acquisition permission

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23947: Phase out jquery.cookie.js: Authority merge
Owen Leonard [Fri, 1 Nov 2019 18:15:53 +0000 (18:15 +0000)]
Bug 23947: Phase out jquery.cookie.js: Authority merge

This patch updates the JavaScript which sets cookies during the
authority merge process so that it uses the new js-cookie library.

To test, apply the patch and perform a search in the authority module
which will return multiple results.

 - Select "Merge" from the Actions menu next to any result.
   - A message should appear at the top of the page: "Merging with
     authority: <title>".
   - Click "Cancel merge." The message should disappear.
 - Select a record to merge again.
   - Select another record.
   - The page should redirect to the authority merge page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23944: (follow-up) Update circulation to use new library
Owen Leonard [Fri, 1 Nov 2019 13:18:28 +0000 (13:18 +0000)]
Bug 23944: (follow-up) Update circulation to use new library

This patch updates the circulation page to use the new JavaScript Cookie
library for cookie management.

To test, apply the patch and open a patron record for checkout in the
staff client.

 - Click "Search to hold" in the toolbar and perform a catalog search
   which will return results.
 - On the search results page, the toolbar at the top of the results
   should include a split "Place hold" button. The button's menu should
   include "Place hold for <patron>" and "Forget <patron>" options. Test
   that these work correctly.
 - In the table of search results each title should include a "Place
   hold for <patron>" link.
 - Go to the checkouts page for a patron with one or more checked-out
   items.
   - Check the "Always show checkouts immediately" checkbox.
   - The patron's checkouts should load.
   - Open another patron for checkout who has checked-out items.
   - The table of checkouts should load automatically.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23944: Phase out use of jquery.cookie.js in favor of js.cookie.js
Owen Leonard [Fri, 1 Nov 2019 13:00:03 +0000 (13:00 +0000)]
Bug 23944: Phase out use of jquery.cookie.js in favor of js.cookie.js

This patch adds a new JavaScript file to the staff client's global
JavaScript include file: js.cookie-2.2.1.min.js. This "plugin" will
replace jquery.cookie.js which is no longer maintained.

The "About" page in the staff client is updated to include this new
resource as well as adding previously-missing information about the old
plugin which will remain until all instances of its usage have been
removed.

To test, apply the patch and check the About page to confirm the correct
information is included.

No functionality change is introduced by this bug. The only other
observable change is the existence of the new files and the inclusion of
the minified version of the file in any staff client page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: (follow-up) Remove previous declaration of batch_biblionumbers
Jonathan Druart [Wed, 29 Jan 2020 10:13:45 +0000 (11:13 +0100)]
Bug 24305: (follow-up) Remove previous declaration of batch_biblionumbers

Revert change for cardnumbers, they are not always numbers.
We may need to add a regex to remove special chars however, will be done
on its own bug report if needed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24348: Pass marc record to _passes_required_checks
Andreas Jonsson [Sun, 5 Jan 2020 13:02:13 +0000 (13:02 +0000)]
Bug 24348: Pass marc record to _passes_required_checks

Test plan:

* Add record matching rule:

 Matching rule code: test
 Description: 001 and 003
 Match threshold: 1000
 Record type: Bibliografic record

 Match points:
    Search index: Control-number
    Score: 1000
    Tag: 001
    Subfields:
    Offset:
    Length:
    Normalization rule: none

 Required match checks:

    Source (incoming) record check field

    Tag: 003
    Subfields:
    Offset:
    Length:
    Normalization rule: none

    Target (database) record check field

    Tag: 003
    Subfields:
    Offset:
    Length:
    Normalization rule: none

* Note the match rule identity number.
* Stage a marc-file for import, for instance this one ftp://ftp.libris.kb.se/pub/export2/X/marc/X.20200104.marc

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/stage_file.pl --match 4 --file 'X.20200104.marc' --format ISO2709 --comment 'test'" kohadev

* Note the batch number and commit the file using the batch number:

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/commit_file.pl --batch-number 1" kohadev

* Again, stage the same marc-file  for import:

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/stage_file.pl --match 4 --file 'X.20200104.marc' --format ISO2709 --comment 'test'" kohadev

* Note the number of records matched.

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23113: members/pay.tt account_grp is not longer used
Owen Leonard [Tue, 7 Jan 2020 12:33:02 +0000 (12:33 +0000)]
Bug 23113: members/pay.tt account_grp is not longer used

This patch removes obsolete markup from pay.tt.

To test, apply the patch and search the Koha codebase for instances of
"account_grp" There should be none.

Log in to the staff client and go to the account of a patron who has
fines. Confirm that the "Accounting" page ("Make a payment" tab) works
correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24486: Remove duplicated account information at the OPAC
Nick Clemens [Mon, 27 Jan 2020 11:48:31 +0000 (11:48 +0000)]
Bug 24486: Remove duplicated account information at the OPAC

Test plan:
Create a manual invoice
Pay it
Void it

Go to the opac, account
=> You should see only one "(Voided)"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24497: Turn off smartIndent for SQL
Lucas Gass [Fri, 24 Jan 2020 18:18:33 +0000 (18:18 +0000)]
Bug 24497: Turn off smartIndent for SQL

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24511: Update variable names to avoid confusion
Nick Clemens [Fri, 24 Jan 2020 14:58:25 +0000 (14:58 +0000)]
Bug 24511: Update variable names to avoid confusion

To test:
1 - Create a report
    SELECT borrowernumber, firstname, surname, email, emailpro FROM borrowers WHERE surname='acosta'
2 - Create or edit patron with surname acosta to have a separate email and emailpro
3 - perl misc/cronjobs/patron_emailer --notice HOLDS --module reserves --verbose --email emailpro --report ## --from 'me@you.us'
4 - Note email is used, not email pro
5 - Apply patch
6 - Repeat, correct eamil is used

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24515: Column Configuration for pay-fines-table does not hide Account Type properly
Owen Leonard [Fri, 24 Jan 2020 23:25:20 +0000 (23:25 +0000)]
Bug 24515: Column Configuration for pay-fines-table does not hide Account Type properly

This patch corrects the order of the columns in the columns
configuration YML file. The incorrect order was causing the wrong column
to be hidden when changing the columns settings for the table in
Administration.

To test, apply the patch and go to Administration -> Columns settings.

 - Under Patrons -> pay-fines-table, test hiding the account_type and
   description columns, together and separately.
 - Verify that the correct columns are hidden on the pay fines screen
   (Patron -> Accounting -> Make a payment)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24507: Make Checkouts/ReturnClaim.t pass on MySQL 8
Jonathan Druart [Fri, 24 Jan 2020 10:13:53 +0000 (11:13 +0100)]
Bug 24507: Make Checkouts/ReturnClaim.t pass on MySQL 8

 $ prove t/db_dependent/Koha/Checkouts/ReturnClaim.t
 t/db_dependent/Koha/Checkouts/ReturnClaim.t ..
     #   Failed test 'Exception field is correct'
     #   at t/db_dependent/Koha/Checkouts/ReturnClaim.t line 97.
     #          got: 'return_claims.issue_id'
     #     expected: 'issue_id'
     # Looks like you failed 1 test of 8.
 t/db_dependent/Koha/Checkouts/ReturnClaim.t .. 1/1
 #   Failed test 'store() tests'
 #   at t/db_dependent/Koha/Checkouts/ReturnClaim.t line 133.

This is similar to bug 23825.

Test plan:
Confirm that the tests pass on MySQL8 and MariaDB

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: (QA follow-up) Strip table name in [[table.field|alias]]
Marcel de Rooy [Fri, 24 Jan 2020 11:17:15 +0000 (11:17 +0000)]
Bug 24305: (QA follow-up) Strip table name in [[table.field|alias]]

When you would use the construct, you wont have batch features unless
we strip the table name. This is consistent with the $sth->{NAME} used
to fill the headers by default.

Test plan:
Use [[items.biblionumber|bibno]] instead of items.biblionumber in a
reporting query.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: (follow-up) Add small comment for square brackets in get_prepped_report
Marcel de Rooy [Fri, 24 Jan 2020 11:04:05 +0000 (11:04 +0000)]
Bug 24305: (follow-up) Add small comment for square brackets in get_prepped_report

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: Remove previous declaration of batch_biblionumbers
Jonathan Druart [Mon, 13 Jan 2020 11:15:33 +0000 (12:15 +0100)]
Bug 24305: Remove previous declaration of batch_biblionumbers

We should not init batch_biblionumbers before.
Also this patch deals with batch_cardnumbers.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: Fix links to batch tools when report's columns do not contain integers
Jonathan Druart [Thu, 26 Dec 2019 10:11:55 +0000 (11:11 +0100)]
Bug 24305: Fix links to batch tools when report's columns do not contain integers

If report's columns do not only contain integers, we should not point to
batch tools.
For instance, if the value is a link, the batch tools will not work as
they will not retrieve the id (itemnnumber or biblionumber) properly

Test plan:
Create a report like:
    SELECT CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is not link to the batch tools

Edit the report like:
    SELECT itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is a link to the batch tools

Edit the report like

    SELECT itemnumber, CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is link to the batch tools

Try other combinations with biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24503: fix missing use in value builder barcode_manual.pl
Fridolin Somers [Fri, 24 Jan 2020 08:20:06 +0000 (09:20 +0100)]
Bug 24503: fix missing use in value builder barcode_manual.pl

Bug 22721 added use C4::Biblio in cataloguing/value_builder/barcode.pl.
This is missing in value builder barcode_manual.pl.
You get the error :
Undefined subroutine &Koha::FrameworkPlugin::GetMarcFromKohaField called at cataloguing/value_builder/barcode_manual.pl line 41.

Test plan :
1) Configure a subfield of item to use value builder barcode_manual.pl
2) Go to a record
3) Try to add a new item
4) Check the value builder is OK

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with autobarcode==year-0001,0002
No internal server error, but generates a barcode now.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23407: (QA follow-up) Same change for UNIMARC XSLT
Marcel de Rooy [Fri, 24 Jan 2020 07:22:52 +0000 (07:22 +0000)]
Bug 23407: (QA follow-up) Same change for UNIMARC XSLT

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23407: (QA follow-up) Remove some XSLT item leftovers
Marcel de Rooy [Fri, 24 Jan 2020 07:12:31 +0000 (07:12 +0000)]
Bug 23407: (QA follow-up) Remove some XSLT item leftovers

Test plan:
Check intranet results and detail page.
Check opac detail.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23407: Don't process items for XSLT on details pages
Nick Clemens [Wed, 31 Jul 2019 20:14:34 +0000 (20:14 +0000)]
Bug 23407: Don't process items for XSLT on details pages

To test:
1 - Add 1000 items to a record
    Go to biblio
    Edit items
    Add multiple copies of this item
    Add 1000 and confirm
    Wait..
2 - Load the record in staff client and OPAC, note how long it takes
    Press F12 in browser to open the console
    use the Network tab of the console
    note the load time
    refresh a few times to see average time
3 - Apply patch
4 - Restart all the things
5 - Reload the record in staff and opac
6 - Note decresed time
7 - Verify nothing on the page has changed

QA can grep the standard XSLT files for details pages for 'item' to note occurences do not use items information

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24443: Unit test
Fridolin Somers [Fri, 17 Jan 2020 09:48:50 +0000 (10:48 +0100)]
Bug 24443: Unit test

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24443: Consider NULL as 0 for issues in items search
Fridolin Somers [Fri, 17 Jan 2020 09:25:19 +0000 (10:25 +0100)]
Bug 24443: Consider NULL as 0 for issues in items search

In items search, we can filter by items issues count, data coming from items.issues.
Most of the time, for an item with no issues this column contains NULL.
This enhancement proposes to consider NULL as 0 to allow searching items with no issues.

Test plan:
1) Use SQL to count items with items.issues = NULL :
   select count(*) from items where issues is null;
2) Go to items search
3) Perform search with filter "Checkout count" = 0
4) Check you get the same number of results as SQL query

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 21296: suspend hold ignores system preference on intranet
Owen Leonard [Wed, 20 Nov 2019 20:04:10 +0000 (20:04 +0000)]
Bug 21296: suspend hold ignores system preference on intranet

This patch modifies the DataTable configuration for the table of holds
which displays under the "Holds" tab on the patron's checkout and
details pages. A variable is now defined in the JavaScript with the
value of the "SuspendHoldsIntranet" system preference. This variable is
passed to the DataTable configuration to determine whether the column is
visible or not.

One of the changes made in this patch moves a <script> block so that it
appears before some of the JS includes on the page. This helps keep the
string-defining JS together in one block.

To test, apply the patch and set the "SuspendHoldsIntranet" system
preference to "Allow."

 - Open the checkout page for a patron with one or more holds.
 - Under the "Holds" tab, the table of holds should have a "Suspend"
   column with controls for suspending or resuming holds.
 - Check that the same is true on the patron detail page.
 - Set the "SuspendHoldsIntranet" system preference to "Don't allow."
 - Test the checkout and detail pages again and confirm that the
   "Suspend" column does not appear.

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>