koha.git
7 years agoIncrement version for 3.22.14 release v3.22.14
Julian Maurice [Mon, 2 Jan 2017 14:16:38 +0000]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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>

7 years agoIncrement version for 3.22.12 release v3.22.12
Julian Maurice [Mon, 24 Oct 2016 12:11:11 +0000]
Increment version for 3.22.12 release

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoUpdate release notes for 3.22.12 release
Julian Maurice [Mon, 24 Oct 2016 12:09:57 +0000]
Update release notes for 3.22.12 release

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoTranslation updates for Koha 3.22.12
Julian Maurice [Mon, 24 Oct 2016 11:53:45 +0000]
Translation updates for Koha 3.22.12

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17154 (QA followup) replace tabs with spaces
Nick Clemens [Fri, 14 Oct 2016 08:52:54 +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>

7 years agoBug 17154 : Note column is missing on account lines receipt
Sophie Meynieux [Mon, 22 Aug 2016 10:02:11 +0000]
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>

7 years agoBug 17404: Patron deletion page: Fix title and breadcrumb
Marc [Wed, 5 Oct 2016 14:08:52 +0000]
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>

7 years agoBug 17411: Remove 3 other occurrences of exit 1
Jonathan Druart [Tue, 18 Oct 2016 16:14:58 +0000]
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>

7 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]
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>

7 years agoBug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel
Marcel de Rooy [Fri, 14 Oct 2016 08:01:12 +0000]
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>

7 years agoBug 16245: RIS export file type incorrect
Hector Castro [Wed, 28 Sep 2016 21:29:37 +0000]
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>

7 years agoBug 17426: Do not set AutoCommit in tests
Jonathan Druart [Tue, 11 Oct 2016 12:15:27 +0000]
Bug 17426: Do not set AutoCommit in tests

  git grep AutoCommit t | grep 1

highlights that 1 test use AutoCommit set, it should not

The other change removes the FIXME should has been fixed.

Test plan:
  prove t/db_dependent/BackgroundJob.t
  t/db_dependent/Patron/Borrower_Discharge.t

should still return green

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ede157e9c09e08b772aaaaacd1a7eb64a2ecc9f6)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 106c66eee67be65246ee50ea59a4c0f27acf7e7e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17405 Edit record uses Default framework
Rodrigo Santellan [Mon, 10 Oct 2016 08:20:12 +0000]
Bug 17405 Edit record uses Default framework

In detail view (catalogue/detail.pl), when clicking on Edit > Edit
record button, the record editor should be opened with the biblio record
framework. It isn't the case. The Default framework is used. Same issue
with Edit > Edit as new (duplicate).

TO TEST:

1. Find a biblio record using a framework which is not the Default one.
2. See the biblio record in detail view (catalogue/detail.pl).
3. Click on Edit > Edit record.
4. Click on Settings => you can see 'Default' as selected framework.
5. Apply the patch.
6. Repeat step 3-4. => the biblio record framework is selected.
7. Repeat 3-4 using Edit > Edit as new (duplicate).

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Added a test plan

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f060709df0ed07c0ff3dbc20404fa5b3b2aa8651)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 8659bad629fcdfb5bb612ad21ce0bcb0f70a74bd)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17393: Fix non-Latin chars handling in self reg
Jonathan Druart [Tue, 4 Oct 2016 07:29:30 +0000]
Bug 17393: Fix non-Latin chars handling in self reg

If you fill the patron self reg with non-latin characters, they will be
encoded with HTML entities (&eacute;)
This bug leads to generate a userid with weird behaviors:
é => eacute
ł => x

Test plan:
0/ Do not apply the patch
1/ Set up the Self reg feature
2/ fill surname, fistname with something like "Michał pouéàç"
3/ Save
4/ See the bad encoding/replacement on the screen and look at the data
The accentued chars are replaced with their html representation and the
non-Latin chars with a 'x'
in the DB
5/ Apply this patch
6/ Repeat steps 2, 3
7/ Everything should be ok
8/ Try to make sure this HTML::Entities escape was not useful:
fill surname with "surname <script>alert("xss?")</script>"
Save and look at the data

Followed test plan, works as expected.
Signed-off-by: Marc Véron <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 35de8aa1ef07b04cfc7c977f7168cd36b40d7941)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit e25934f6cdb1eaae0fbc9be15afe55a3ee2ad51a)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17477: Duplicating a subfield yields an empty subfield tag
Hector Castro [Thu, 20 Oct 2016 14:57:46 +0000]
Bug 17477: Duplicating a subfield yields an empty subfield tag

The problem only when clone a textareas in 5XX

Steps to reproduce error:
- On the cataloging screen (basic screen), create a new record
- Go to the 5xx fields
- Put something on the 521$a subfield or other textareas (e.g. 520$u or
 583$x)
- Clone the subfield
=> FAIL: The subfield correctly doesn't include the original data,
BUT it doesn't have the subtield tag either.

- Apply patch
- Clean cache browser and reload page
- Repeat steps above
- Verify that works as expected

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit fbe75e66ccb93a6a4d973e3066ca1ebad169a5b6)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 90e9ab941eb47b0be4f859c45d394575324b5fc7)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17367 - Showing all items must keep show holdings tab in OPAC details
Fridolin Somers [Wed, 28 Sep 2016 12:49:32 +0000]
Bug 17367 - Showing all items must keep show holdings tab in OPAC details

In OPAC details page, when record as too many items (depending on syspref OpacMaxItemsToDisplay), they are not displayed in holdings tab.
You can click on link "Click here to view them all" to show them : page reloads with a new arg viewallitems=1.
Also you can choose which tab is shown by default using syspref opacSerialDefaultTab.

The bug is that when default tab is not holdings, clicking on link to show all items will show another tab. So one must reclick on holings tab to see all items.

This patch corrects by forcing holdings tab when arg viewallitems is defined.

Test plan :
- Create a serial record with more items than syspref OpacMaxItemsToDisplay (or decrease this syspref)
- Select "Subscriptions tab" for syspref opacSerialDefaultTab
- Go to opac details on this record : /cgi-bin/koha/opac-detail.pl?biblionumber=xxx
=> You see Subscriptions tab selected
- Click on Holdings tab
=> You see no items but a link "Click here to view them all"
- Click on this link
=> Without patch you see Subscriptions tab selected
=> Wih patch you see Holdings tab selected and the items

Signed-off-by: Juliette <juliette.levast@iepg.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit f1298dc7828757fe9277a5128910335d2d6c0f2c)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 2a62a9a18cc3a36288e6abf3586a7e606e6e07db)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17423 - patronimage.pl permission is too restrictive
Fridolin Somers [Tue, 11 Oct 2016 08:00:56 +0000]
Bug 17423 - patronimage.pl permission is too restrictive

Bug 14566 added the permission "borrowers" on patronimage.pl.
This perm is too restrictive because circulation pages also uses this page.

I propose to simply use "catalogue" perm.

Test plan
- Set an image to borrower xx
- Create a user with only catalogue permission
- Log with this user
- Go to page (replace xx by borrower number) : /cgi-bin/koha/members/patronimage.pl?borrowernumber=xx
=> Without patch you get the page saying you do not have the permission
=> With patch you get the image
- Log out and retest the page patronimage.pl
=> You get 403 error

Signed-off-by: remy <remy.gonzalves@iepg.fr>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit e78f81d615a79ad293d599c7395efcabd267662d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit f620fbe0d9ec8c4df258dd3a35b839b466479d52)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 16358: Do not redirect to the editor when deleting records
Jonathan Druart [Tue, 13 Sep 2016 14:03:55 +0000]
Bug 16358: Do not redirect to the editor when deleting records

The "Delete record" button goes to addbiblio.pl?op=delete, which
incorrectly redirects to Rancor when selected.

Test plan:
0/ Enable EnableAdvancedCatalogingEditor
1/ Edit a record
2/ Switch to the Advanced editor
3/ click on "View the record"
4/ Delete the record
=> Without this patch you are redirected to the editor
=> With this patch you are redirected to the advanced search

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit ba8ee98e1bb3b18f579c0b122b14d43e88cda2c8)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 537d7d9fa4650aa35b8e20cbaf0cad7f7a4d2ba4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17446: Typo seleted
Marcel de Rooy [Fri, 14 Oct 2016 09:29:44 +0000]
Bug 17446: Typo seleted

Built on top of bug 17441

Test plan:
Just have a look at the changes. Trivial.
Git grep seleted. No results.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit f75afef59175933f7e93b04bdcbdcf5180b0b024)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 28eb0a880e2bf249da464f7da75ad409f9ffc919)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17441: [QA Follow-up] Return value of SendAlerts
Marcel de Rooy [Fri, 14 Oct 2016 09:07:49 +0000]
Bug 17441: [QA Follow-up] Return value of SendAlerts

This patch makes the return value of SendAlerts more consistent.
It returns 1 on success, or undef || { error => 'msg' } on failure.
Needed to adjust one test in Letters.t too.
Adjusted one typo along the way (seleted).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested by running Letters.t.
Also tested SendAlerts from the interface with AutoEmailOpacUser and
memberentry (adding new patron).

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 17e2e6c994655aaa927b2579524022a4f24a8d1d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 18a472e627e8f8b7cec45ffe90f896374d90fb9d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17441 - t/db_dependent/Letters.t fails on Jenkins
Katrin Fischer [Thu, 13 Oct 2016 17:05:48 +0000]
Bug 17441 - t/db_dependent/Letters.t fails on Jenkins

Run prove t/db_dependent/Letters.t

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
To improve consistency, adding a follow-up.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit ff495c5fa8c58a7762b3494e97d90618d649f7a8)
(cherry picked from commit 4ee9399028fda3f5b8cfbfd9c43eb50349569e91)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 11217: The # in accountlines descriptions makes them un-writeoffable
Marc [Fri, 7 Oct 2016 09:03:45 +0000]
Bug 11217: The # in accountlines descriptions makes them un-writeoffable

This patch adds escaping to url params in mambers/pay.pl

To test:
- Apply patch
- Go to Home > Patrons > Manual invoice and create an invoice with a
  description containing a #
- Go to tab "Pay fines"
- Write off the fine
Expected result: Fine is written off and does no longer display in pay tab.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 692014c817b58876042ab03d71bde0c2cce7e571)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit ff2b5116e9edb5ce62212a8f25518bc1647b19b9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17365: Fix XSS in moremember.pl and memberentry.pl
Jonathan Druart [Thu, 29 Sep 2016 07:46:49 +0000]
Bug 17365: Fix XSS in moremember.pl and memberentry.pl

There are certainly hundred of places where they are not escaped...

Test plan:
Create a patron with "Arun <script>alert('code injection');</script>" in
some of the fields.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 1d0d5f1398687ead3a17cd40f74f879e8ddf9a9d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit a61c072f1acb77906843a5be319412f959374bda)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

7 years agoBug 17389: Clear logs
Jonathan Druart [Mon, 3 Oct 2016 14:23:39 +0000]
Bug 17389: Clear logs

Logs are full of:
Use of uninitialized value in substitution (s///) at
C4/ImportExportFramework.pm line 282.
Use of uninitialized value in concatenation (.) or string at
C4/ImportExportFramework.pm line 283.

Some field are NULL in DB, we need to init the value to an empty string
to avoid these warnings.

Note: This fix is not related to the original bug
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Warnings avoided

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit a1dcd2f2e67f2dc998d2eae0fc6097eb9edbb874)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 4592382e388d7f0ee0467180b50b5630a19c674a)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>