]> git.koha-community.org Git - koha.git/log
koha.git
7 years agoTranslation updates for 3.22.15
Julian Maurice [Mon, 23 Jan 2017 11:21:10 +0000 (12:21 +0100)]
Translation updates for 3.22.15

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17949: Fix batch patron deletion tool
Nick Clemens [Thu, 31 Mar 2016 15:53:31 +0000 (15:53 +0000)]
Bug 17949: Fix batch patron deletion tool

The filter 'who have not borrowed since' was ignored

Reword 'not_borrowered_since' to 'not_borrowed_since'

This patch is originally a followup of bug 10612

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17234: Need to separate KEY and FOREIGN KEY checks
Jonathan Druart [Thu, 12 Jan 2017 09:44:46 +0000 (10:44 +0100)]
Bug 17234: Need to separate KEY and FOREIGN KEY checks

In the previous patch we use the constraint_exists subroutine to verify
if an index or a foreign key exists.
But the `SHOW INDEX` query does not return foreign keys (as its name
suggests!).
We need another subroutine foreign_key_exists to check the FK existence.

I have found that because t/db_dependent/TestBuilder.t fails on
oai_sets_biblios, because oai_sets_biblios_ibfk_1 has not been removed.

Test plan:
0/ Do not apply this patch
1/ Use a 3.20 DB
2/ update the DB
3/ SHOW CREATE TABLE oai_sets_biblios
will display oai_sets_biblios_ibfk_1

Apply the patch and repeat 1, 2, 3
=> Will not display oai_sets_biblios_ibfk_1
It has been removed as expected.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 05fdd855c8da85d3be27d42721f6a544b0145e57)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit ba45608b0d823e4bac4e6794392d53f4eda4b9c2)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17234: Test the column and constraint non-existence
Jonathan Druart [Mon, 2 Jan 2017 10:36:53 +0000 (11:36 +0100)]
Bug 17234: Test the column and constraint non-existence

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 435b7badc22d9c05cb16623d6f423206992ec476)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit cd6782d5b4be87f724b5d2d36ff1dedd4cfab503)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17234: Two new functions lack tests
Mark Tompsett [Fri, 30 Dec 2016 19:08:33 +0000 (14:08 -0500)]
Bug 17234: Two new functions lack tests

This adds two tests to t/db_dependent/Installer.t

TEST PLAN
---------
1) Apply patch
2) prove -v t/db_dependent/Installer.t
   -- column and constraint tests were added.
3) run koha qa test tools

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8938631f38bb22456424219d3c3453493df6f848)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 4518ec795d253901215621235f3c1bf6e76f4df0)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17234: Move new subroutines to C4::Installer
Jonathan Druart [Tue, 27 Sep 2016 07:28:09 +0000 (08:28 +0100)]
Bug 17234: Move new subroutines to C4::Installer

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0b15c5e2cc5d5a84b062c5c5738fe54ab5df98ab)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit a34a60823fc2ed3f92a68e85e2591c0d82f5b4d3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17234: Add constraint_exists and column_exists to updatedatabase.pl
Jonathan Druart [Tue, 20 Sep 2016 15:55:40 +0000 (16:55 +0100)]
Bug 17234: Add constraint_exists and column_exists to updatedatabase.pl

These 2 subroutines will help us deal with the absense of ALTER IGNORE
TABLE

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c08922180e83b0222dc3d54a292aaf49cc15000a)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 70fe225bea608b61b40f237a13195eb028da4231)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17234 - updatedatabase.pl's ALTER IGNORE break with mysql 5.7.4+
Blou [Fri, 2 Sep 2016 12:05:48 +0000 (08:05 -0400)]
Bug 17234 - updatedatabase.pl's ALTER IGNORE break with mysql 5.7.4+

The doc says: "As of MySQL 5.7.4, the IGNORE clause for ALTER TABLE is removed and its use produces an error."
This fix replaces ALTER IGNORE with ALTER in updatedatabase.pl

To TEST, try an upgrade from 3.18 to 3.22 after installing the latest mysql (at least 5.7.4, by the doc).
Some will fail with error

DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE aqbasket
            ADD KEY authorisedby (authorisedby)' at line 1 [for Statement "
        ALTER IGNORE TABLE aqbasket
            ADD KEY authorisedby (authorisedby)
    "] at ./installer/data/mysql/updatedatabase.pl line 10563.

0) Find a database on 3.18, save it.
1) Set your code base to 3.22(or master)
2) run updatedatabase.pl
3) See the errors.
4) Apply the patch
5) Reload the 3.18 database
6) succeed with updatedatabase.pl

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit acf425bbbcb8c22f3655472f90285869c3ad7164)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit e2e61a798cd9e07dfdb4026b1ab455f1a07cd301)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 15711: Follow up batch_id not used
Mark Tompsett [Fri, 2 Dec 2016 19:37:07 +0000 (19:37 +0000)]
Bug 15711: Follow up batch_id not used

Changed batch_id to image_id in the template, as the multiparam
would catch the array case.

TEST PLAN
---------
1) attempt to delete a selected item, but get a warning.
2) apply this follow up
3) attempt to delete a selected item, it deletes.
4) run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2ee5cd27129d487fee26987118a8675033139c53)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit c1768e08cd82c8d2eaa9ac667004b8ad6ab36faf)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 15711: Fixing the 'Delete selected' button on patroncard images
Aleisha Amohia [Wed, 24 Aug 2016 01:08:11 +0000 (01:08 +0000)]
Bug 15711: Fixing the 'Delete selected' button on patroncard images

To test:
1) Go to Tools -> Patron Card Creator -> Manage images
2) Upload an image if you haven't already
3) Click Delete selected without selecting any images
4) Notice broken behaviour as described in Description
5) Apply patch, refresh page
6) Click Delete selected without selecting any images
7) Notice alert. Click OK
8) Select one image or more, click Delete selected
9) Notice confirm delete message.

Sponsored-by: Catalyst IT
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit bd3879e037727cdc2cc851aa910c68bd257ee6f4)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 70c55a6d69d68e04b50e8fbcf0eb7e62457350d7)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17799: MARC bibliographic frameworks breadcrumbs broken for Default framework
Aleisha Amohia [Wed, 21 Dec 2016 02:46:57 +0000 (02:46 +0000)]
Bug 17799: MARC bibliographic frameworks breadcrumbs broken for Default framework

To test:
1) Go to Admin -> MARC frameworks -> Default framework actions -> MARC
structure
2) Click New tag
3) Notice the breadcrumbs say '()' instead of 'Default MARC framework'
or something more appropriate
4) Apply patch and refresh page
5) Confirm breadcrumbs are now filled correctly
6) Go back to tag structure and try deleting a tag (Actions -> Delete)
7) Confirm breadcrubs are filled correctly

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit fdc15cb7623ed2ed8cd2d0b3fcfbd96d90f59041)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 87e3be143b99f7094848045b044ea7685605cf64)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17879: Use image filename if no image name is entered
Aleisha Amohia [Tue, 10 Jan 2017 22:20:40 +0000 (22:20 +0000)]
Bug 17879: Use image filename if no image name is entered

This patch changes the code to use the filename of the uploaded image if
no specific image name is entered.

To test:
1) Go to Tools -> Patron card creator -> Manage images
2) Upload an image and leave the image name field empty
3) Notice this works and 'Name' is left empty.
4) Apply patch and refresh page
5) Upload an image and leave the image name field empty
6) Notice the image name is given the filename so that 'Name' is no
longer empty.

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d3752c85dc2f5af974ec2fe4585efa8510302968)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit d8ff6f0ea8a0839c4689897fa27857b33f9bfb81)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17265 - Make koha-create-defaults less greedy
Magnus Enger [Thu, 8 Sep 2016 12:13:46 +0000 (14:13 +0200)]
Bug 17265 - Make koha-create-defaults less greedy

koha-create-defaults substitutes the instance name with the placeholder
__KOHASITE__ in the SQL file that it creates. If the instance name is
something common, like "data", this means that way too many substitutions
will be made, and when koha-create uses the SQL file as a template, broken
data can be the result.

The solution in this patch was suggested by drojf on IRC.

To test:
- Create an instance called "data"
- Run "sudo koha-dump-defaults data > test.sql"
- Take a look at test.sql and verify there are way too many occurences
  of __KOHASITE__, like "-- Dumping __KOHASITE__ for table `accountlines`"
- Apply the patch
- Copy the resulting koha-create and koha-dump-defaults to somewhere
  running off the packages
- Run "sudo koha-dump-defaults data > test.sql" again and verify there
  are only 4 occurrences of __KOHASITE__, in places that make sense
- Create an instance with something like:
  $ gzip test.sql
  $ sudo koha-create --create-db --defaultsql test.sql.gz test17265
- Verify that you have a working Koha install

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoIncrement version for 3.22.14 release v3.22.14
Julian Maurice [Mon, 2 Jan 2017 14:16:38 +0000 (15:16 +0100)]
Increment version for 3.22.14 release

7 years agoUpdate release notes for 3.22.14 release
Julian Maurice [Mon, 2 Jan 2017 14:15:36 +0000 (15:15 +0100)]
Update release notes for 3.22.14 release

7 years agoTranslation updates for 3.22.14
Julian Maurice [Mon, 2 Jan 2017 14:15:05 +0000 (15:15 +0100)]
Translation updates for 3.22.14

7 years agoBug 15415 [QA Followup] - Make code more readable
Kyle M Hall [Fri, 23 Dec 2016 11:31:00 +0000 (11:31 +0000)]
Bug 15415 [QA Followup] - Make code more readable

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8e68e41df448e9bde7baf69ebab2646d2138cca4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 15415: Warn when creating a new print profile
Aleisha Amohia [Fri, 2 Dec 2016 03:04:07 +0000 (03:04 +0000)]
Bug 15415: Warn when creating a new print profile

As per Jonathan's comment in Comment 3, I've put that line of code in an
if statement that will only call the get_attr method if we are editing
an existing profile (therefore the profile id will exist).

To test:
1) Go to Tools -> Patron Card Creator -> New printer profile
2) Notice warn
3) Apply patch
4) Refresh page
5) Confirm warn is gone and page still works as expected

Sponsored-by: Catalyst IT
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 47e80e899aca7c79aaeb58350401a1963fbe709d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 16914: Remove unused empty_lines.inc file
Tomas Cohen Arazi [Thu, 22 Dec 2016 15:46:06 +0000 (12:46 -0300)]
Bug 16914: Remove unused empty_lines.inc file

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 0b915fbd9735d2585944253fc5230fdb7417fb80)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 2263c97b729f56e917fb7aee41080a3711a022a3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 16914: Rely on TT for newlines
Tomas Cohen Arazi [Thu, 22 Dec 2016 15:45:08 +0000 (12:45 -0300)]
Bug 16914: Rely on TT for newlines

The translation scripts have an historical tendency to chomp newlines
and we introduced an empty_line.inc file to force newlines when building
CSV output out of our templates (in item search and late orders).

This patch makes the mentioned templates use TT ability to force newlines
plus some misuses of the 'minus' sign.

Test plan:
- Apply the patch
- Do an item search that returns more than one result
- Export as CSV
=> SUCCESS: The CSV file is correctly formed.
- Install any translation:
  $ sudo koha-shell kohadev
 k$ cd kohaclone/misc/translator
 k$ perl translate install <chosen language>
- Enable <chosen language> (e.g. es-ES)
- Repeat the item search
- Export as CSV
=> SUCCESS: The CSV file is correctly formed in your chosen language.
- Have more than one late orders (bummer)
- Go to late orders
- Choose them
- Export as CSV (in english)
=> SUCCESS: The CSV file is correctly formed.
- Switch language
- Go to late orders
- Choose them
- Export as CSV (in english)
=> SUCCESS: The CSV file is correctly formed in your chosen language.
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 152ce671eca4b5d74329b518d9d71106f4e60c84)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit a72c8c630cec81f527db8325683e166ee7add97b)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17743: Item search - Fix indexes build on MARC
Jonathan Druart [Thu, 15 Dec 2016 10:47:24 +0000 (10:47 +0000)]
Bug 17743: Item search - Fix indexes build on MARC

Searching items by custom search fields does not work because these
fields are not correctly processed in JS.

In case of custom search field, the parent of the option is not the
select but the optgroup element.

Test plan:
Create a custom search field on 245$c for instance
On the items search form, select this field and launch a search
=> Without this patch, the results will not be filtered and you will get
all your items
=> With this patch applied, the results should be correctly filtered

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c86a9e4d300fe746fe542e38a60148de6501f7a6)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 9e68a7d42d3d0c9c2c8961c32e3348ff4b5d5abf)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 16951: Replace some more
Jonathan Druart [Thu, 15 Dec 2016 12:50:42 +0000 (13:50 +0100)]
Bug 16951: Replace some more

In order to avoid warnings in the logs, $cgi->param should be forced to
scalar context

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e16ec2fcdb8bf67c507591386f94b9d024fec596)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit ae61f7c4f170e292781598c3123cc4a70863d933)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 16951: Fix Item search sorting
Jonathan Druart [Thu, 15 Dec 2016 12:45:22 +0000 (13:45 +0100)]
Bug 16951: Fix Item search sorting

Caused by
  commit ac5a1bfececb5400a77f0ebad90181f5215d5a85
    Bug 16154: CGI->multi_param - Manual changes

The change was wrong, we wanted to retrieve a scalar (the string), not
an array.
We want to retrieve a string with the different column' names, not an
array of 1 element.

Test plan:
Launch an item search and play with column sort

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2184fa6ab1a7449857df15894c8de075aac729ec)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 01f495673f61eb5fced39f1f47ea2c04b5074a35)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17761 - Renewing or returning item via the checkouts table causes lost and damage...
Kyle M Hall [Mon, 12 Dec 2016 11:59:30 +0000 (06:59 -0500)]
Bug 17761 - Renewing or returning item via the checkouts table causes lost and damaged statuses to disappear

Due to the fact that the lost and damaged status are contained within the due_due span,
when the item is renewed or returned these statuses disappear.
Some librarians find this disconcerting and it seems that it would be better to keep the visible.

Test Plan:
1) Find a lost item checked out to a patron
2) Renew that lost item via the checkouts table
3) Notice the lost status disappears from that row
4) Apply this patch
5) Refresh the page ( you may want to clear your browser cache as well )
6) Renew the item again
7) The lost status should remain visible!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Edie Discher <edischer@cityoffargo.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 97eb773c0a4054f0538c8966e207734f6f56bdd5)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 75c3cda017e4998974fad285e21bf63b08e4fce6)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17652: opac-account.pl does not include login branchcode
Chris Kirby [Mon, 28 Nov 2016 05:15:02 +0000 (00:15 -0500)]
Bug 17652: opac-account.pl does not include login branchcode

opac-account.pl does not include the login branchcode, whereas the other pages
available to users (opac-user, opac-memberentry, opac-passwd, opac-readingrecord,
opac-suggestions, opac-messaging, opac-shelves, etc.) on login DO provide
the login branchcode. Having the login branchcode available on opac-account.pl
would facilitate customization of the OPAC for individual branches.

To test:
1) Login to the OPAC and open  /cgi-bin/koha/opac-account.pl
2) Inspect the body tag and observe the class attribute does not include
   the login branchcode.
3) Apply the patch.
4) Repeat step 2.
5) Observe that the login branchcode is present.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1bfcebfb7fa0837428fb577a6fc059886fe37afb)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 2bfd9a95f09c29d1ae116213f83b416a3922cf8c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17681: Exiisting typos might thow some feees when recieved
Marcel de Rooy [Fri, 25 Nov 2016 12:22:42 +0000 (13:22 +0100)]
Bug 17681: Exiisting typos might thow some feees when recieved

Yes, we are fixing these four typos here.

Test plan:
[1] Read the changes.
[2] Run t/Auth_with_shibboleth.t
[3] Run git grep recieved| grep -v -e 'recievedlist' | grep -v -e 'serials-recieve.tt'

Note: serials-recieve.tt is just history. Bonus points for the one who makes
us get rid of that column recievedlist.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
EDIT:
Rebased. Change in Accounts has been corrected already.
Removed the po file.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b5c1a965b165093fb66a5db356da84b4a62bf9a6)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 327c2ba63612c56599d590a0a2dd8539d255b145)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17547: (MARC21|NORMARC) have Chronological term field $9 indexed
Tomas Cohen Arazi [Fri, 2 Dec 2016 20:16:10 +0000 (17:16 -0300)]
Bug 17547: (MARC21|NORMARC) have Chronological term field $9 indexed

This patch makes Zebra index the 648$9 link for chronological terms on
bibliographic records. This way an authority search on chronological terms
will show the right number in 'Used in X records' message.

To test:
- Have a record with a 648 field, linked to an authority record (i.e. with an authid on 648$9).
- Search for the record, notice it is indexed.
- Perform an authority search for the chronological term
=> FAIL: the term is linked to our record, but koha shows '0' count.
- Apply the patch
- Run:
  $ cd kohaclone
  $ xsltproc etc/zebra/xsl/koha-indexdefs-to-zebra.xsl \
       etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \
     > etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
  $ git diff
=> SUCCESS: Notice the shipped etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
   is up-to-date
- Run:
  $ sudo cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \
            /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
  $ sudo koha-restart-zebra kohadev
  $ sudo koha-rebuild-zebra -f -b -v kohadev
- Search for the record, notice it is indexed.
- Perform an authority search for the chronological term
=> SUCCESS: the term is linked to our record, usage count is 1
- Sign off :-D

I assume NORMARC is similar on this regard. Feel free to fail it if the NORMARC part of the
patch is wrong.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit cb3f899826966b5da1242292091aa71ab4831618)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 80955d365af98627110783bc16b12964d117273d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17749 - Missing l in '.pl' in link on waitingreserves.tt
Nick Clemens [Thu, 8 Dec 2016 19:41:33 +0000 (19:41 +0000)]
Bug 17749 - Missing l in '.pl' in link on waitingreserves.tt

Fixes a small typo introduced by Bug 17010

waitingreserves.p#[% tab %]

should be

waitingreserves.pl#[% tab %]

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a1592ec10be56569b64774a3dde1e85c53ba36d9)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 45bd59064f117f984b4bc041c12136a7d6a880c5)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 11274 Sent Notices Tab Not Working Correctly
Owen Leonard [Mon, 21 Nov 2016 13:26:13 +0000 (08:26 -0500)]
Bug 11274 Sent Notices Tab Not Working Correctly

This patch implements the notices toggle event using a different method.
Using on() lets us bind the event to a parent element, allowing the
event to attach to elements which may not exist on the page yet.

Test plan the same as original patch:

1) have a patron with more then 20 notices sent
2) go to patron profile -> notices
-> without patch, the showing/hidding of notices content does work
correctly only on first loaded page
-> with patch, it should work correctly everywhere - try to use
paginator, searching, ordering....

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6163337cd8caab98db993e4d51ac73abbdd83b86)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 9af15e2cb487280e3c4b5859a5edb77a0403c09e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses
Julian Maurice [Mon, 2 Jan 2017 10:55:45 +0000 (11:55 +0100)]
Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses

7 years agoBug 16376 - Koha::Calendar->is_holiday date truncation creates fatal errors for TZ...
David Cook [Mon, 23 May 2016 01:57:04 +0000 (11:57 +1000)]
Bug 16376 - Koha::Calendar->is_holiday date truncation creates fatal errors for TZ America/Santiago

Using a DateTime object with a timezone of America/Santiago
was causing fatal errors for Koha::Calendar->is_holiday
and Koha::Calendar->exception_holidays, when the objects
were truncated to an invalid local time.

Using a floating zone allows us to use the same day, month, year
for comparison purposes without running into the possibility of
creating an invalid local time and thus a fatal software error.

Edit:

While the changes to is_holiday and single_holiday make sense (Jonathan agrees too)
I didn't manage to have them fail, because truncate is not failing in my trials, but
days_between. So to me, it narrows down to have exception_holiday return floating tz
datetime objects so it doesn't break days_between.

Anyway, it is ok to push this patch, and the regression test I provide covers this scenario
I'm describing.

To test:
- Apply the regression tests patch
- Run:
  $ prove t/db_dependent/Holidays.t
=> FAIL: Unexpected error due to bad timezone/date combination
- Apply this patch
- Run:
  $ prove t/db_dependent/Holidays.t
=> SUCCESS: Tests pass

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 32354d8322afd05704d87cb38d9bc032ce8c4ec1)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 5e9056a99cf37acad6c2d4fe5f3ebd1f61171327)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 16376: (regression tests)
Tomas Cohen Arazi [Tue, 6 Dec 2016 14:29:08 +0000 (11:29 -0300)]
Bug 16376: (regression tests)

This patch introduces a regression test for exception_holidays. This routine
returns a list of datetimes to be used in date comparison and some datetimes don't exist
in some timezones, so floating timezones should be used instead.

To test:
- Apply the patch on master
- Run:
  $ prove t/db_dependent/Holidays.t
=> FAIL: The new test fails

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c6a0848ff0b7acbec4d7bf817447d7cc84c0615e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit aa5c67486f297dbdaa1ba7b6665916a3d2cc05f5)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14541 (QA followup) Add warning to gist system preference
Nick Clemens [Thu, 8 Dec 2016 17:19:03 +0000 (17:19 +0000)]
Bug 14541 (QA followup) Add warning to gist system preference

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 36c608ab846c97aa76ea2fd721c7ce09f2c638ed)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 317bd60f18b3ceaec91709ec56f26c27f16359b9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14541: Do not truncate tax rate values
Jonathan Druart [Wed, 9 Nov 2016 09:13:27 +0000 (09:13 +0000)]
Bug 14541: Do not truncate tax rate values

Tax rates are stored in decimal(6,4) fields which means that 4 decimals
are allowed.
If a tax rate is 8.42%, it is stored as 0.0842
If a tax rate has more precision than that, Koha won't deal correctly
with it. We will need to update the DB structure.

With this patch, the tax rate will be displayed with the same precision
as in the DB. So if you enter 8.42, you will see 8.42% instead of 8.4%
without this patch.

Test plan:
Do a full acquisition workflow with a tax rate like 8.42% and confirm
that it is correctly displayed.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit cb3d6625e87fbc861c11e181cea36f9f9cd329cc)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit ff33093591f903c22e251ba694ed59d8a0fb7500)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 15822: Fix 500 error when searching if items.onloan=0000-00-00
Jonathan Druart [Wed, 23 Nov 2016 10:06:04 +0000 (10:06 +0000)]
Bug 15822: Fix 500 error when searching if items.onloan=0000-00-00

The calls
  output_pref({ dt => dt_from_string( $date ) })
are wrong and should be replaced with
  output_pref({ str => $date })
For better error handling.

Here we fix the problem of items.onloan when searching

Test plan:
- Set items.onloan=0000-00-00 (UPDATE items SET onloan='0000-00-00')
This can come from old data or bad migration
- Execute a search
=> Without this patch you get
Can't locate object method "ymd" via package "dateonly" (perhaps you forgot to load "dateonly"?) at /home/vagrant/kohaclone/Koha/DateUtils.pm line 225.
=> With this patch you won't get the error

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 167c74bfd386287783e101989b804077b1020369)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit a5ce343c9d7d8790a8dbd98b3833ea6cf155c180)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 15200 - t/Creators.t fails when using build-git-snapshot
Mirko Tietgen [Tue, 9 Aug 2016 09:52:15 +0000 (11:52 +0200)]
Bug 15200 - t/Creators.t fails when using build-git-snapshot

ttf-dejavu was missing from the build dependencies.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit f1ce002823a51cd2b3ab033f1c38110eeef7fcf3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17278: Fix test compilation errors
Jonathan Druart [Tue, 22 Nov 2016 07:33:50 +0000 (07:33 +0000)]
Bug 17278: Fix test compilation errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit 7a7a9c7958e21112c6d18313b41c6605ec1b3d08)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17278: Fix "show all items" link
Jonathan Druart [Mon, 3 Oct 2016 11:27:21 +0000 (12:27 +0100)]
Bug 17278: Fix "show all items" link

Then we need to remove the "available" part from the query.
They are really awkward patches...

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit 1a27bd10dabe4905c115d4caf7ea566b2a19c073)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17278: Use available limit when requesting zebra when ccl query is used
Jonathan Druart [Mon, 3 Oct 2016 09:45:13 +0000 (10:45 +0100)]
Bug 17278: Use available limit when requesting zebra when ccl query is used

When a ccl query is used, the buildQuery subroutine does not handle
the available limit (not an index).
This available limit is handle later in the subroutine.
This affect the author links on the detail page for instance (an=xx).
A much better solution would be to keep an 'available' zebra index up-to-date.

Test plan:
(OPAC or staff interface, it does not matter)
- Launch a search, click on a result and then on an author link to
  launch another query (an:xx)
- Limit to available items without the 'facet'
=> Without this patch you won't get any results
=> With this patch applied you should get relevant result (regarding the
known bugs 16970, 13715, 13658, 5463, etc.)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit 6391564606507c6edf80b2e5425cee57cb7e1db5)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17494: (QA followup) Fix exception name
Tomas Cohen Arazi [Fri, 4 Nov 2016 15:18:57 +0000 (12:18 -0300)]
Bug 17494: (QA followup) Fix exception name

This patch changes the exception name to match the package name. And
also adds a test for the thrown exception message.

Also creates a general Koha::Exception::Patron::Modification exception
to make the new one inherit from it, following the common use in the codebase.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit 9a301836714924581b806cd7c728695625ddf3cc)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17494: Prevent duplicate tokens from getting stored
Kyle M Hall [Mon, 31 Oct 2016 11:15:02 +0000 (11:15 +0000)]
Bug 17494: Prevent duplicate tokens from getting stored

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit d76cd8a63946572508f4a7d8b8ee8d06c63ddb09)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17494: Make sure the same verification token won't be generated twice
Jonathan Druart [Thu, 27 Oct 2016 08:04:30 +0000 (10:04 +0200)]
Bug 17494: Make sure the same verification token won't be generated twice

Well, this patch does not enforce the unique constraint but mimic what
is already done in C4::ImportExportFramework and Koha::Upload where
md5_hex is used.

Test plan:
Have a look at the code and confirm that it adds more randomness to the
hashed string

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit 5f160f675b1de4a12db6717b297c3d7b0a7a5d3d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoIncrement version for 3.22.13 release v3.22.13
Julian Maurice [Wed, 30 Nov 2016 13:55:28 +0000 (14:55 +0100)]
Increment version for 3.22.13 release

7 years agoUpdate release notes for 3.22.13 release
Julian Maurice [Wed, 30 Nov 2016 14:05:32 +0000 (15:05 +0100)]
Update release notes for 3.22.13 release

7 years agoTranslation updates for 3.22.13
Julian Maurice [Wed, 30 Nov 2016 14:30:46 +0000 (15:30 +0100)]
Translation updates for 3.22.13

7 years agoBug 17395 - exporting checkouts in CVS generates a file with wrong extension
Fridolin Somers [Tue, 4 Oct 2016 10:52:46 +0000 (12:52 +0200)]
Bug 17395 - exporting checkouts in CVS generates a file with wrong extension

In checkouts table, the is an export form (when some exports syspref are enabled).
Export using a CSV profile will create a file with name koha.mrc (same as ISO2709 export).
It would be better with koha.csv.

Bug 14647 manages the export page, this but will only manage for export from checkouts table where file name is hard-coded.

Test plan :
- Enable checkouts exports by setting syspref ExportWithCsvProfile with a profile for record export
- Go to circ page of a patron with checkouts : /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx
- Show checkouts table
- Select some checkboxes in "Export" column
- Select "CSV" in export format combo-box
- Click on "Export"
=> Without patch, the generated file is koha.mrc
=> With patch, the generated file is koha.csv
- Check ISO2709 export generates a file named koha.mrc

Signed-off-by: Dani Elder <dani@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit fc084f90d1da1dedb70c97a225d3df332f8224d2)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17391: Update DB rev (3.22.12.003)
Kyle M Hall [Tue, 22 Nov 2016 11:38:26 +0000 (11:38 +0000)]
Bug 17391: Update DB rev (3.22.12.003)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17391 (QA Followup) use INSERT INGORE in atomicupdate
Nick Clemens [Tue, 22 Nov 2016 11:05:19 +0000 (11:05 +0000)]
Bug 17391 (QA Followup) use INSERT INGORE in atomicupdate

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0a84274f6bfa3ea6e4c37367da7a449d98ce8aca)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17391: Fix number of values in sysprefs.sql
Jonathan Druart [Thu, 17 Nov 2016 09:01:19 +0000 (09:01 +0000)]
Bug 17391: Fix number of values in sysprefs.sql

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 49f8e05b20bd10e017877b996254c47cd2444385)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17391: Add atomic update file
Jonathan Druart [Thu, 17 Nov 2016 08:58:55 +0000 (08:58 +0000)]
Bug 17391: Add atomic update file

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d785cd5b0a025dd2670c7259fd20038f450ab1ef)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17391: Add missing prefs to sysprefs.sql
Katrin Fischer [Sun, 16 Oct 2016 12:20:42 +0000 (14:20 +0200)]
Bug 17391: Add missing prefs to sysprefs.sql

Adds
- ReturnpathDefault
- ReplytoDefault
to the sysprefs.sql file.

To test:
- Run the web installer in any language
- Check all preferences are installed without error
- Check prefs listed above now exsit in your
  systempreferences table

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 15e57368bba86844d103fa46cd3a47438565c56e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17660: #adv is considered as an ad by adblock
Jonathan Druart [Fri, 18 Nov 2016 15:26:17 +0000 (15:26 +0000)]
Bug 17660: #adv is considered as an ad by adblock

So let's rename it!

Test plan:
Edit a $t in any framework, you should be able to unfold the "Advanced
constraints" part

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a0416ff132469e6816554136707e398f114ab13e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17419: Fix smsalertnumber and mobile confusion in moremember.pl
Lari Taskula [Mon, 10 Oct 2016 14:06:07 +0000 (17:06 +0300)]
Bug 17419: Fix smsalertnumber and mobile confusion in moremember.pl

members/moremember.pl will set mobile number as smsalertnumber in template if
smsalertnumber is not defined. This will cause incorrect display for SMS number
in patron's Details-tab. This confusion between smsalertnumber and mobile is
already fixed in Bug 14683, but members/moremember.pl was not fixed yet.

This is a minor issue since it won't occur for manually added new patrons due to
fixes already pushed in Bug 14683, but in case patron's smsalertnumber is null
in database, this bug can be replicated:

To test:
1. Set EnhancedMessagingPreferences to "Allow" and make sure SMSSendDriver
   has been set.
2. Add a new patron, give it a mobile/other phone number.
3. Run a SQL query:
   update koha.borrowers set smsalertnumber=NULL where borrowernumber=XXX;
   (replace XXX with your new patron's borrowernumber)
4. Go to patron's details tab and observe that SMS number shows the mobile/
   other phone you provided earlier.
5. Apply patch.
6. Refresh patron's details tab.
7. Observe that smsalertnumber is now empty, as it should be.

Followed test plan, works as expected.
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 88e0264413b1dc9ecf5dbe562636f40c7e0555d1)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17590 - Exporting reports as CSV with 'delimiter' SysPref set to 'tabulation...
Nick Clemens [Tue, 8 Nov 2016 17:26:36 +0000 (17:26 +0000)]
Bug 17590 - Exporting reports as CSV with 'delimiter' SysPref set to 'tabulation' creates files with 't' as separator

To test:
Set 'delimiter' system preference to 'tabs'
Export a report as csv
Open the file in text editor and note fields separated by character 't'
Apply patch
Export report as CSV
Open file in text editor and note tabs are used to separate fields

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
tabs now, no errors.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b4d94a5ea4a3d9dac4295c53497cbb25e1b1212b)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17513: Create GRANT for user@localhost in koha-create
Jonathan Druart [Thu, 27 Oct 2016 14:15:57 +0000 (14:15 +0000)]
Bug 17513: Create GRANT for user@localhost in koha-create

See the bug description for the details.

Test plan:
Use this script to create a new koha installation, using MariaDB
You should not display
"user koha_kohadev doesn't have enough privilege on database koha_kohadev "

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Confirm that this still works (with MySQL).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 474a369fc03f992971c8af11c910f778e34ac9b9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a...
Kyle M Hall [Wed, 24 Aug 2016 11:13:48 +0000 (11:13 +0000)]
Bug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds

If the AllowRenewalIfOtherItemsAvailable sys pref is set to allow, and a
borrower has an item checked out that has many items {30+} AND many
holds {70+) on it, loading the checkouts table for this borrower takes
FOREVER to load. The load time takes forever, because of the
factoring that happens to determine if an item is truly
available for renewal.

This patch swaps the use of GetMemberDetails for GetMember
and reorders the subroutine calls to check each items' renewability
from fastest to slowest.

In a test case, the results of pre patch were:
Start of loop: 2016-08-24T11:05:14
End of loop:   2016-08-24T11:05:29
Resulting in 15 seconds being spent in the loop

Post patch results were:
Start of loop: 2016-08-24T11:08:43
End of loop:   2016-08-24T11:08:48
Resulting in only 5 seconds being spent in the loop!

Test Plan:
1) Apply this patch
2) Note there are no changes in functionality for the renewals column of
   the patron checkouts table.

If you wish to go further and test the performance benefit:
1) Create a record with 50 items and 100 holds ( 50 waiting, 50 unfilled )
2) Check out one of the waiting holds to a patron
3) Time the amount of time it takes for the checkouts table to load
4) Apply this patch
5) Repeat step 3, you should see an improvement in load time

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 665c5c62fa8b61752e65ff9d18487befc38cb647)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17323: Column search_history.time cannot be null
Jonathan Druart [Tue, 20 Sep 2016 10:40:13 +0000 (11:40 +0100)]
Bug 17323: Column search_history.time cannot be null

When doing a search, with SearchHistory pref switched on:

DBD::mysql::st execute failed: Column 'time' cannot be null [for Statement "
        INSERT INTO search_history(
            userid, sessionid, query_desc, query_cgi, type, total, time
        ) VALUES(
            ?, ?, ?, ?, ?, ?, ?
        )
    " with ParamValues: 0="7874", 1='12338a0bd8da63e32c79ee84f8493a07', 2="kw,wrdl: d", 3='q=d', 4='biblio', 5=6104, 6=undef] at C4/Search/History.pm line 34.

Since MySLQ 5.7, undef does not mean "the default value".
To let the DBMS set the default value (CURRENT_TIMESTAMP), the parameter should not be passed

Test plan:
OPAC+Intranet, swith the 2 SearchHistory syspref on
Do a search
=> Without this patch, you will get an error in the log and the row will not be inserted in the table.
=> With this patch, everything must go fine

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Not verified with MySQL 5.7. But this looks good to me.
Works under Jessie.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6d5b056a14e5671f51735dded7609f65ca389f00)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17484: Search with date range limit (lower and upper) does not work
Koha Team Lyon 3 [Tue, 25 Oct 2016 11:37:47 +0000 (13:37 +0200)]
Bug 17484: Search with date range limit (lower and upper) does not work

If the period is entered without spaces wrapping the hyphen
You can't get any result

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
I can't reproduce the error, search still works after applying the patch

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 660be0e0195613ce9eaaf45b17d2e5db4ad705f0)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: Update DB rev (3.22.12.002)
Kyle M Hall [Fri, 28 Oct 2016 11:30:38 +0000 (11:30 +0000)]
Bug 14598: Update DB rev (3.22.12.002)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: [QA Follow-up] Small changes
Marcel de Rooy [Fri, 28 Oct 2016 07:54:20 +0000 (09:54 +0200)]
Bug 14598: [QA Follow-up] Small changes

[1] Renames the dbrev version to XXX; adding a my for $sth, although
    not strictly necessary it feels better.
[2] Circulation.t stumbles over:
    Undefined subroutine &C4::Circulation::GetItem called at ... line 1283.
    Somehow this is related to use_ok instead of a regular use.
    Worked around this by require_ok and adding a regular use.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3660c451a36db128c143b6388d0d1f34babff4ac)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: Fix warning from effective_itemtype
Jonathan Druart [Thu, 7 Apr 2016 11:03:49 +0000 (12:03 +0100)]
Bug 14598: Fix warning from effective_itemtype

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ec96a0cb3f25f53fbe14f6c93a8d28b48d3b7286)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: (QA followup) use deleted{items|biblioitems} during upgrade
Tomas Cohen Arazi [Wed, 6 Apr 2016 14:34:26 +0000 (11:34 -0300)]
Bug 14598: (QA followup) use deleted{items|biblioitems} during upgrade

If the 'statistics' table contains circulation information about items
that are no longer on the DB it will raise a warning. This patch
makes the updatedatabase.pl script use the deleteditems and deletedbiblioitems
tables to get information for those items on the statistics table.

To reproduce:
- Have your sample DB contain some circulation data on the statistics table
- Make sure some of them have NULL itemtype:
> UPDATE statistics SET itemtype = NULL WHERE type='return';
- Check the upgrade query catches them:
> SELECT s.itemnumber, i.itype, b.itemtype FROM  ( SELECT DISTINCT itemnumber    FROM statistics    WHERE ( type = "return" OR type = "localuse" ) AND itemtype IS NULL ) s  LEFT JOIN  ( SELECT itemnumber,biblionumber, itype      FROM items    UNION    SELECT itemnumber,biblionumber, itype      FROM deleteditems ) i  ON (s.itemnumber=i.itemnumber)  LEFT JOIN  ( SELECT biblionumber, itemtype      FROM biblioitems    UNION    SELECT biblionumber, itemtype      FROM deletedbiblioitems ) b  ON (i.biblionumber=b.biblionumber);
+------------+-------+----------+
| itemnumber | itype | itemtype |
+------------+-------+----------+
|        732 | BK    | BK       |
|        731 | BK    | BK       |
+------------+-------+----------+
2 rows in set (0.00 sec)

- Delete the items, and some biblio too.
- Re-run the query
=> SUCCESS: Same results
- Go reset to NULL the itemtypes
> UPDATE statistics SET itemtype = NULL WHERE type='return';
- Run the updatedatabase.pl script:
 $ sudo koha-shell koahdev ; cd kohaclone
 $ perl installer/data/mysql/updatedatabase.pl
=> SUCCESS: No warnings

Note: It is possible that on production sites, if the sysadmin is cleaning the
deleted{items|biblioitems|biblio} tables, there will be warnings. This is expected
as they need to know some data lacks information.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3fa514133b33aca3727111d2ddfdd0bdb3d5d639)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: (followup) Remove unused and non-existent C4::ItemType include
Tomas Cohen Arazi [Fri, 1 Apr 2016 15:25:39 +0000 (12:25 -0300)]
Bug 14598: (followup) Remove unused and non-existent C4::ItemType include

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e31eb08e29f637f90d095df31388bf64f2b685a9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598 [QA Followup] - Update localuse statistics also
Kyle M Hall [Tue, 19 Jan 2016 14:34:20 +0000 (14:34 +0000)]
Bug 14598 [QA Followup] - Update localuse statistics also

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c042307db35f59fe2dca8d8fa214be7b39b0277e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598 [QA Followup] - Make unit test pass
Kyle M Hall [Tue, 12 Jan 2016 16:04:55 +0000 (16:04 +0000)]
Bug 14598 [QA Followup] - Make unit test pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ad800ce36e07915628602c4f6ba2ccf83bacdd16)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598 [QA Followup] - Correct the behavior of GetItem
Kyle M Hall [Fri, 18 Dec 2015 14:59:02 +0000 (14:59 +0000)]
Bug 14598 [QA Followup] - Correct the behavior of GetItem

Currently GetItem sets itemtype to the biblio itemtype if no item level
itemtype exists. Instead, it should only do this if item_level-itypes
is not set.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 73b85e98755e075044db72b973cb3ebd6c0f4891)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598 [QA Followup] - Only fetch bib data if needed
Kyle M Hall [Fri, 20 Nov 2015 14:23:22 +0000 (14:23 +0000)]
Bug 14598 [QA Followup] - Only fetch bib data if needed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4384e081968c7dd9c95c34d78bda2eba199a3243)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598 - QA Followup touching CanBookBeIssued subroutine
Brendan A Gallagher [Thu, 19 Nov 2015 21:13:05 +0000 (21:13 +0000)]
Bug 14598 - QA Followup touching CanBookBeIssued subroutine

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 096b6c3938d060ab973e76f6840bd26ec8ef26cd)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: (DB update) fix NULL itemtypes in statistics on 'return' rows
Tomas Cohen Arazi [Tue, 1 Sep 2015 14:52:17 +0000 (11:52 -0300)]
Bug 14598: (DB update) fix NULL itemtypes in statistics on 'return' rows

This patch introduces an updatedatabase.pl entry that takes care of
updating existing statistics rows.

It does so by looping on the statistics rows, collecting itemnumber occurences
that are have NULL itemtypes.
It then chooses the right itemtype following what is proposed on bug 14651, and
then updates the rows in statistics using the calculated itemtype.

Regards

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2cdec7ff9178fd8f70b5885b7c2936ddf09e69f7)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: (QA followup) Don't die on bad barcode
Kyle M Hall [Mon, 27 Jul 2015 15:16:56 +0000 (11:16 -0400)]
Bug 14598: (QA followup) Don't die on bad barcode

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 34eb4c1fa95ea14047413436b8df42299d029ca4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: Make C4::Circulation::AddReturn store the right itemtype
Tomas Cohen Arazi [Mon, 27 Jul 2015 14:40:38 +0000 (11:40 -0300)]
Bug 14598: Make C4::Circulation::AddReturn store the right itemtype

This patch makes C4::Circulation::AddReturn correctly store the itemtype
on the 'statistics' table.

To reproduce:
- Checkout master.
- Make a checkout.
- Check the 'statistics' table and notice the itemtype is correctly set
  > SELECT * FROM statistics;
- Check the item in.
- Check the 'statistics' table and notice the itemtype is not set
  > SELECT * FROM statistics WHERE type="return";
=> FAIL: itemtype is set to NULL

To test:
- Apply the regression tests patch
- Run the tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> FAIL: Tests fail
- Apply this patch
- Run the regression tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> SUCCESS: Tests now pass.
- Repeat the 'To reproduce' steps
=> SUCCESS: itemtype is now correctly set (in real life)
- Happily sign off :-D

Sponsored-by: Universidad Empresarial Siglo 21
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 285ac7a31eb50262af9c6a51502630ba150b14fa)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 14598: (regression tests) AddReturn should store itemtype on 'statistics' table
Tomas Cohen Arazi [Sun, 26 Jul 2015 05:05:16 +0000 (02:05 -0300)]
Bug 14598: (regression tests) AddReturn should store itemtype on 'statistics' table

This patch adds tests for C4::Circulation::AddReturn(). Both tests are wrapped
inside a subtest, and look for AddReturn storing the right itemtype on the
'statistics' table.

Note: It also refactors the file a bit, to avoid side effects. And uses TestBuilder
to make it independent on already-present db data. It also removes warnings by mocking
C4::Context::userenv

To test:
- Apply the patch
- Run the tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> FAIL: Tests fail bacause AddReturn is not storing the itemtype
- Sign off :-D

Sponsored-by: Universidad Empresarial Siglo 21
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 357a69b0e174c813ef52d1ee7f47cd810c76938d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 15690: Hardcoded 16 is uncool
Mark Tompsett [Wed, 14 Sep 2016 19:14:02 +0000 (15:14 -0400)]
Bug 15690: Hardcoded 16 is uncool

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Followed test plan in comment #7, works as expectd.
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a618c62ae6c6ddc8334e795ddb1760a7363a88f8)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 15690: CardnumberLength should not be bigger than 16
Jonathan Druart [Tue, 13 Sep 2016 14:43:50 +0000 (15:43 +0100)]
Bug 15690: CardnumberLength should not be bigger than 16

borrowers.cardnumber is a varchar(16), so CardnumberLength should not
have a max > 16

Test plan:
Test different value in CardnumberLength ("20", "20,30", "40,")
Edit a patron a make sure the text display under the cardnumber input is
correct

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 87380d8b460857157b4cf06fa8def626d1d2badb)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17420 - record export fails when itemtype on biblio - followup
Fridolin Somers [Mon, 7 Nov 2016 15:07:01 +0000 (16:07 +0100)]
Bug 17420 - record export fails when itemtype on biblio - followup

Same as previous patch for misc/export_records.pl.

Test plan :
- Use syspref item-level_itypes = biblio record
- Run misc/export_records.pl
=> Without patch you get an error : DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in 'where clause' ...
=> With patch you get a correct export file

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Export Ok, no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17420 - record export fails when itemtype on biblio
Fridolin Somers [Mon, 10 Oct 2016 14:46:04 +0000 (16:46 +0200)]
Bug 17420 - record export fails when itemtype on biblio

In Tools, Export data, you can export with a filter on item type.
When item type is on biblio record, you get the error :
export.pl: DBIx::Class::ResultSet::next(): Unknown column 'biblioitems.itemtype' in 'where clause' at /home/koha/src/Koha/Objects.pm line 150

Looks like its because this code use to be a SQL Select and is now a DBIx call :
                          C4::Context->preference('item-level_itypes')
                            ? ( 'items.itype' => $itemtype )
                            : ( 'me.itemtype' => $itemtype )

This patch corrects by using "me.itemtype"

Test plan :
- Use syspref item-level_itypes = biblio record
- Go to Tools > Export data : /cgi-bin/koha/tools/export.pl
- Select an item type
- Click on "Export biblio records"
=> Without patch you get an error 500
=> With patch you get a correct export file

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fix the issue, no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17394 - exporting checkouts with items selects without items in combo-box
Fridolin Somers [Tue, 4 Oct 2016 10:36:11 +0000 (12:36 +0200)]
Bug 17394 - exporting checkouts with items selects without items in combo-box

In checkouts table, the is an export form (when some exports syspref are enabled).
When selecting some checkouts and selecting "ISO2709 with items" in export format combo-box, clicking on "Export" will select "ISO2709 without items" in the export format combo-box.
This is quite strange.
Its because the form as 2 inputs with same name and id "output_format" : an hidden input (the wanted arg for tools/export.pl) and a select (the export format combo-box).
So an action meant on the hidden input impacts the select.

This patch corrects by changing id and name of the export format combo-box : issues-table-output-format

TEST plan :
- Enable checkouts exports by setting syspref ExportWithCsvProfile with a profile
- Go to circ page of a patron with checkouts : /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx
- Show checkouts table
- Select some checkboxes in "Export" column
- Select "ISO2709 with items" in export format combo-box
- Click on "Export"
=> Without patch, the export format combo-box changes to "ISO2709 without items"
=> With patch, the export format combo-box does not changes
- Check the export file contains the items
- Check exports "ISO2709 without items" and "CSV" are OK

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication)
Matthias Meusburger [Fri, 21 Oct 2016 15:04:58 +0000 (17:04 +0200)]
Bug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 16493: [QA Followup] Restore title and author match as an option, make it the...
Kyle M Hall [Wed, 8 Jun 2016 10:53:25 +0000 (10:53 +0000)]
Bug 16493: [QA Followup] Restore title and author match as an option, make it the default

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 years agoBug 16493: acq matching on title and author
Kyle M Hall [Wed, 11 May 2016 14:19:41 +0000 (14:19 +0000)]
Bug 16493: acq matching on title and author

When you order from a staged file you're getting duplicate warnings that
are inaccurate.  For example, when you order a file of 50 DVDs for
example and they don't have ISBNs they're matching on the books. And
then you have to order them one by one.

This patch replaces the use of FindDuplicates with Koha's match point
system. This means you can select from the same match points defined
and used in the batch record importer, or you can opt to skip matching
altogether!

Test Plan:
1) Import a record with a title, isbn and author.
2) Delete the from the record and stage it again
3) Attempt to add it to a basket via the staged record
4) You should note the gives you the "No records imported" message
5) Apply this patch
6) Create a matcher for ISBN
7) Create a matcher for Author/Title
8) Attempt to add the record to your basket using the ISBN matcher
8) Koha should find no match and import the record to the basket
9) Stage the record again
10) Attempt to add the record to your basket using the Title/Author matcher
11) You should recieve the "No records imported" message.

Signed-off-by: Barbara Fondren <bfondren@roundrocktexas.gov>
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 years agoBug 17518: Update DB rev (3.22.12.001)
Julian Maurice [Tue, 8 Nov 2016 10:34:34 +0000 (11:34 +0100)]
Bug 17518: Update DB rev (3.22.12.001)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17518: Displayed language name for Czech is wrong
Josef Moravec [Wed, 26 Oct 2016 22:53:04 +0000 (22:53 +0000)]
Bug 17518: Displayed language name for Czech is wrong

It's "Ceština" and should be "Čeština"

Test plan:
1) apply the patch
1.1) update database
2) install Czech translation for Koha
3) note the language name in language switcher (in staff client and
    opac) is right: "Čeština"

Signed-off-by: radiuscz <radek.siman@centrum.cz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit de2ba75c25f9f348a312093483dea52168fa5d6e)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 3ea0d7ed993a0c1233e822f7f4db710cb9056cfd)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17504: Make the installer show the right dmbs help if wrong permissions
Tomas Cohen Arazi [Wed, 26 Oct 2016 14:34:08 +0000 (11:34 -0300)]
Bug 17504: Make the installer show the right dmbs help if wrong permissions

This patch changes the installer template for step 2 (DB rights check)
so it correctly displays MySQL-related message.
The previous code was doing the wrong comparisson, thus yielding
PostgreSQL documentation.

To test:
- Run:
  $ sudo koha-mysql kohadev
  > DROP DATABASE koha_kohadev ; CREATE DATABASE koha_kohadev;
  > REVOKE INSERT ON koha_kohadev.* FROM 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Run the webinstaller through step 2
=> FAIL: You get the message in the attached screenshot
- Apply the patch, reload
=> SUCCESS: You are displayed a different warning message, with a link
to up-to-date MySQL docs on GRANT
- Fix permissions for the user:
  $ sudo koha-mysql kohadev
  > GRANT ALL PRIVILEGES on koha_kohadev.* TO 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Reload
=> SUCCESS: All checks are correct and you can move on
- Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1191ea4f448dd9ae994cf703e8e0a4970fdbb57e)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 55e774f5d8d919a6142aac9bc06882de2a971f63)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 4880: Make koha-remove stop all instance's services
Tomas Cohen Arazi [Thu, 20 Oct 2016 14:58:32 +0000 (11:58 -0300)]
Bug 4880: Make koha-remove stop all instance's services

This patch makes koha-remove stop all instance's services before
attempting to remove the system user,

Before this patch, only zebra was stopped.

To test:
- Run:
  $ sudo koha-create --created-db favourite_name
- Run:
  $ sudo koha-remove favourite_name
=> FAIL: koha-indexer is still running for user favourite_name-koha
- Run:
  $ sudo koha-create --created-db another_name
  $ sudo koha-plack --enable another_name
  $ sudo koha-plack --start another_name
  $ sudo koha-indexer --stop another_name
  $ sudo koha-remove another_name
=> FAIL: koha-plack is still running for user another_name-koha
- Apply the patch
- Repeat the previous tests, with new names
=> SUCCESS: Everything works as expected :-D
- Sign off :-D

Signed-off-by: Lucio Moraes <lmoraes@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 607dac69a95e7bcb454661bfde71a45ee20d0155)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 275253e52a67c482665adb11e40d3a54554979cb)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17434: Moremember displaying primary and secondary phone number twice
Josef Moravec [Tue, 18 Oct 2016 00:03:08 +0000 (00:03 +0000)]
Bug 17434: Moremember displaying primary and secondary phone number twice

Test plan:
1) Create patron category with category code "P" and create a patron
with this category
2) Fill in either the primary or other phone number
3) Go to patron details page (moremember.pl)
=> without patch you see primary/other phone duplicated
=> with patch you should see the number only once as expected

Signed-off-by: Lucio Moraes <lmoraes@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e17209de48f3c9d3184dfd430d882a4e8f8d5d4f)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit fa7eba3a3196c74345461934e7b5acca41be9802)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17417 [Revised] Correct invalid markup around news on the staff client home page
Owen Leonard [Mon, 10 Oct 2016 12:10:29 +0000 (08:10 -0400)]
Bug 17417 [Revised] Correct invalid markup around news on the staff client home page

This patch fixes two minor errors in the markup around displaying news
on the staff client home page: Adding a missing "class" attribute, and
changing the container around news items from <p> to <div> (because news
items might contain <p> and nesting them is incorrect).

To test, apply the patch and view the staff client home page with news
items showing. Validate the page and confirm that there are no errors.

Signed-off-by: Marc <veron@veron.ch>
Revision for QA removes an extra </div> from elsewhere in the template
to make the validator return no errors.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d08076e7e55a7c78a7ab3d79c33151dd4c469101)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 23e0c8ffb50c97553dfbc368b78f1d3e7a29bacc)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 16935 - launch export_records.pl with deleted_barcodes param fails
Fridolin Somers [Wed, 24 Aug 2016 09:44:55 +0000 (11:44 +0200)]
Bug 16935 - launch export_records.pl with deleted_barcodes param fails

When launching misc/export_records.pl with this command line :

 misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc

You get this error message :

DBD::mysql::db selectall_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 [for Statement " (
            SELECT DISTINCT barcode
            FROM deleteditems
            WHERE deleteditems.biblionumber = ?
        "] at misc/export_records.pl line 189.

This is because of a '(' after 'q|', looks like a typo.
Also, this patch removes useless var $q.

Test plan :
- Delete an item with barcode
- Without patch, run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc
=> You get dirty MySQL
- Without patch, run the same command
=> No error and the file is generated

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit dbab260afccc04fac8d088839d6017242c818917)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit b57fb0a9b20333ce52536b319342c2dd5021e3da)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17376 - rebuild_zebra.pl in daemon mode no database access kills the process
Fridolin Somers [Thu, 29 Sep 2016 14:19:48 +0000 (16:19 +0200)]
Bug 17376 - rebuild_zebra.pl in daemon mode no database access kills the process

When running rebuild_zebra.pl in daemon mode, a while loop runs the script for ever.
But if something crashes inside the rebuild process, the all daemon crashes.
For example when it can not access database.
This problem may be temporary so daemon should keep running.

This patch add eval around the rebuild process to allow a run to fail without killing the daemon.
Also moves the DB handler get inside daemon loop because it is broken is DB stoppes.

This is a big issue for indexer running in a systemd service.

Test plan :
- run rebuild_zebra.pl in daemon mode :
/home/koha/src/misc/migration_tools/rebuild_zebra.pl -daemon -z -a -b -x --sleep 30
- stop the database
- wait a minute
=> you see an error on database connexion
=> the daemon is still running
- restart the database
- test the indexer by creating a new record (wait for a minute)

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit bfcc7cad70bfc23163865b2ff39eb592d6d9d152)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit db1bf801e6ad9f9f051d51672a744179beb48bc8)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17375: Search by dateofbirth - handle invalid dates
Jonathan Druart [Tue, 4 Oct 2016 10:55:25 +0000 (11:55 +0100)]
Bug 17375: Search by dateofbirth - handle invalid dates

Prevent internal software error when searching patron with invalid birth date

To reproduce:

- Go to Home > Patron
- Expand patron search (click on + at the left of the search button)
- In drop down 'Search fields', select 'Date of birth'
- Enter a valid date (e.g. 11.02.1995 if syspref 'dateformat' is set to dmydot)
Result: Search works OK
- Enter an invalid date, e.g. 11.02 or abcd...
Result: Internal server error

- Do a patron search with many results
- Use filter on results screen, select 'Date of birth' as search field and
  enter an invalid date to search (e.g. 'a')
Result: Endless message 'Processing'

To test:
- Apply patch
- Repeat steps above
- In both cases, you should get "No results"

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Lucio Moraes <lmoraes@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 9b34b07d62588713405f31481cb363661b1a5d0c)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 0d9e1667bfc64a3d6dfaefacf304f329549c0bf4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoBug 17375: Search by dateofbirth - Add tests
Jonathan Druart [Tue, 4 Oct 2016 10:55:02 +0000 (11:55 +0100)]
Bug 17375: Search by dateofbirth - Add tests

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 12167c57d0608637504a011627a0256e28e515cd)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 41a1796ab19c6aef05d58b75a5c6a32ae9c04c21)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoIncrement version for 3.22.12 release v3.22.12
Julian Maurice [Mon, 24 Oct 2016 12:11:11 +0000 (14:11 +0200)]
Increment version for 3.22.12 release

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoUpdate release notes for 3.22.12 release
Julian Maurice [Mon, 24 Oct 2016 12:09:57 +0000 (14:09 +0200)]
Update release notes for 3.22.12 release

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoTranslation updates for Koha 3.22.12
Julian Maurice [Mon, 24 Oct 2016 11:53:45 +0000 (13:53 +0200)]
Translation updates for Koha 3.22.12

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 17154 (QA followup) replace tabs with spaces
Nick Clemens [Fri, 14 Oct 2016 08:52:54 +0000 (08:52 +0000)]
Bug 17154 (QA followup) replace tabs with spaces

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1e17c92905143f6bc8cac38f00256541c7146fa3)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit f4b6b70f70b65bdcd948f6880f779b66c02a1ded)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 17154 : Note column is missing on account lines receipt
Sophie Meynieux [Mon, 22 Aug 2016 10:02:11 +0000 (12:02 +0200)]
Bug 17154 : Note column is missing on account lines receipt

    When displaying Fines > Account tab for a patron, you can see on screen a Note column that is missing if you click on Print

    Test plan :
    * Find a patron with accountlines or add them manually (Create manual invoice/credit).
    * Be sure some of them got a Note
    * Clik on Print fior those lines

    Without patch, the printed receipt does not show the Note column
    with the patch, the printed receipt shows a Note column and Note content is correctly printed for accountline with a note.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 734d08c2af16909f96b19003c4cc1d758b74f11d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit a8dbb0cae8c5ca7e36ef9a2a3f2dc6b4474e64bd)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 17404: Patron deletion page: Fix title and breadcrumb
Marc [Wed, 5 Oct 2016 14:08:52 +0000 (16:08 +0200)]
Bug 17404: Patron deletion page: Fix title and breadcrumb

Title and breadcrumb of patron deletion page (deletemember.pl) say:
"Can't Delete Patron". This should be changed to "Delete patron".

To verify:
- Go to a patron's detail page
- Toolbar : More : Delete
Result: You get a question: "Are you sure...", but title and breadcrumb say:
  "Can't Delete Patron" rsp "Cant delete patron"

To test:
- Apply patch
- Repeat steps above.
- Verify that title and breadcrumb display properly, including patron's name

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 9a81a138d45b245b69754f3e61115d5d997510c0)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 14d5f19b9ee100c81b33414ffd58eac668c08823)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 17411: Remove 3 other occurrences of exit 1
Jonathan Druart [Tue, 18 Oct 2016 16:14:58 +0000 (17:14 +0100)]
Bug 17411: Remove 3 other occurrences of exit 1

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f1a8ca13028411384847615fbdeeaaedd9703382)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 5c324d8201fff6e3a727c95e182ad32b78ccf715)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 17411 - Change exit 1 to exit 0 in acqui/basket.pl to prevent Internal Server...
Marc [Thu, 6 Oct 2016 12:37:14 +0000 (14:37 +0200)]
Bug 17411 - Change exit 1 to exit 0 in acqui/basket.pl to prevent Internal Server Error

Note: Same situation as in Bug 17403

To test:
- Verifiy that code change makes sense.

Note: Same situation as in Bug 17403
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Remove unecessary comment

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 01636dca2f1bd132fcc8d16f7a91fa4a45a90668)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit f3889059133d5e9933325c98e172d4d0b1e69c11)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel
Marcel de Rooy [Fri, 14 Oct 2016 08:01:12 +0000 (10:01 +0200)]
Bug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel

Position 7 of the leader is better referred to as biblevel.
(Pos 6 is record type.)
At the same time replacing some regex's by simple eq's.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
It seems that bib level in the UNIMARC leader only allows a subset of
the possible combinations for MARC21. This does not have bad side-effects
however in the new code that tests bib level to determine the type tag.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 556a4870d6beced7df52dbbc2ad472769e79e148)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 6b02b7404dbaf4a9c266cdc6a23ddba829ffdf81)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
8 years agoBug 16245: RIS export file type incorrect
Hector Castro [Wed, 28 Sep 2016 21:29:37 +0000 (15:29 -0600)]
Bug 16245: RIS export file type incorrect

When exporting lists to a RIS file, the TY field of the RIS file is always
'book' even if the item being exported is a journal or serial.
Since unimarc and marc21 is coded in Koha, just a few references types are
included. This needs a much better code.

This bug changes only TY BOOK result. Other resources needs a case by case
basis.

To test:
-In advanced search limit by itemtype (books, music, continue resources, etc).
-Search and save result in Cart
-Export to RIS Format and notice about the new TY change with all materials
-Export record in bib record details page in OPAC and Intranet.
-Confirm that works as expected.
-Bonus test:
-Try to import the  RIS file in  http://www.myendnoteweb.com if you
have account or create one.
NOTE: According with previous comment, some values has changed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a74329af022eeb857e1f936c13274c0e41497472)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 14b662558019a4b3c1ff3923a8455f43fc878233)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>