]> git.koha-community.org Git - koha.git/log
koha.git
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: Mason James <mtj@kohaaloha.com>
7 years agoBug 17785: Fix OAI-PMH's XSLT-generated URLs under Plack
Marcel de Rooy [Tue, 20 Dec 2016 15:11:36 +0000 (16:11 +0100)]
Bug 17785: Fix OAI-PMH's XSLT-generated URLs under Plack

Look at e.g. the URL for Show More at the end of the output of Records or
Identifiers. If you use Plack, you will see that it refers to
yourserver:/opac/oai.pl, which is not correct.

This is caused by using CGI's self_url in combination with script alias,
mounting point, etc. Note that we cannot solve this problem in the code of
Koha only. Since HTTP::OAI modules also call self_url, we still end up
with some wrong url's.

Instead of a larger architectural operation on Apache and Plack config files,
this patch adjusts the final xslt transformation on the OAI response.
It hardcodes the correct path only once, in a xslt variable. And replaces
all oai:OAI-PMH/oai:request/text() calls, containing wrong URLs, by this
variable.

Test plan:
Run oai.pl. Try the various verbs.
Verify that the URLs point to /cgi-bin/koha/oai.pl.

Edit: changed commit subject

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Works as expected. Good workaround until a definitive solution is implemented.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17781 - Improper branchcode set during renewal
Kyle M Hall [Thu, 22 Dec 2016 14:00:37 +0000 (14:00 +0000)]
Bug 17781 - Improper branchcode set during renewal

For no discernable reason, when AddIssue calls AddRenewal, it passes the
branchcode generated from _GetCircControlBranch. Assume
_GetCircControlBranch is set to return items.homebranch. So:
1) If an item owned by LibraryA is checked out at LibraryB, the
  statistic line branchcode will be LibraryB
2) If an item is renewed via the ajax datatables renewal function, the
  statistic line branchcode will be LibraryB the
3) If an item is renewed via scanning the item into the checkout again,
  statistic line branchcode will be *LibraryA*

This is clearly improper behavior. The renewal is taking place at
LibraryB, so the branchcode passed to AddRenewal should be LibraryB,
the logged in library. This also jives with the documentation for
the subroutine.

Test Plan:
1) Set CircControl to "the library the item is from" aka ( ItemHomeLibrary )
2) Set HomeOrHoldingBranch to 'The library the items is from" ( aka homebranch )
3) Create item with homebranch of LibraryA and holdingbranch of LibraryB
4) Set the logged in library to LibraryB
4) Check the item out to a patron at LibraryB
5) Note the statistics line has a branchcode of LibraryB
6) Check the item out again to trigger a renewal, renew the item
7) Note the statistic line has a branchcode of LibraryA!
8) Apply this patch
9) Repeat step 6
10) Note the statistics line has a branchcode of LibraryB!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Kuhn <kuhn@monterey.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17742: Use TestBuilder to create the library and patron category
Jonathan Druart [Wed, 28 Dec 2016 08:57:14 +0000 (09:57 +0100)]
Bug 17742: Use TestBuilder to create the library and patron category

Moreover we do not need to remove the existing issues and patrons

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17742: Fix t/db_dependent/Patrons.t
Josef Moravec [Tue, 6 Dec 2016 21:07:56 +0000 (21:07 +0000)]
Bug 17742: Fix t/db_dependent/Patrons.t

Moves the getting of testing date for updated_on just after the storing
the test patron data to make the gap between generating data and now
date as short as possible

Fixes test 7

Use Koha::Database instead of C4::Context->dbh

Test plan
1. prove t/db_dependent/Patrons.t
2. read the diff

NOTE: Only minor improvement could be using test builder to
      generate the category and branch codes, rather than assume
      data exists. However, that is beyond scope of this bug.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14637: Followup - Fix number of tests due to rebase
Kyle M Hall [Fri, 23 Dec 2016 13:35:34 +0000 (13:35 +0000)]
Bug 14637: Followup - Fix number of tests due to rebase

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0747a11b2648a20fcca9d3f5e02a4b3b9270b3f3)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Conflicts:
t/db_dependent/Koha/Patron/Categories.t

7 years agoBug 14637: Fix add patron category under MySQL 5.7
Jonathan Druart [Tue, 6 Sep 2016 09:40:46 +0000 (10:40 +0100)]
Bug 14637: Fix add patron category under MySQL 5.7

If no dateofbirthrequired or upperagelimit is set on the interface, the
->store method will receive an empty string defined for these values.
For INT field, we must explicitely set these empty value to undef
instead to avoid MySQL 5.7 (and strict mode) to raise:
  DBD::mysql::st execute failed: Incorrect integer value: ' for column
'dateofbirthrequired''

Test plan:
Using MySQL 5.7 (and/or sql_mode=STRICT_TRANS_TABLES)
Create a patron category without specifying upperagelimit or
dateofbirthrequired

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14637: Fix add patron category under MySQL 5.7 - tests
Jonathan Druart [Tue, 6 Sep 2016 09:40:28 +0000 (10:40 +0100)]
Bug 14637: Fix add patron category under MySQL 5.7 - tests

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 16933 - Update documentation/help file.
Dani Elder [Mon, 10 Oct 2016 13:51:43 +0000 (09:51 -0400)]
Bug 16933 - Update documentation/help file.

Updates help documentation about Alt+W to open renew tab.

To test: Go to circulation help page, open help file and see that new
line mentioning Alt+W.

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 16933 - Alt-Y not working on "Please confirm checkout" dialogs
Tim McMahon [Thu, 8 Sep 2016 16:19:17 +0000 (12:19 -0400)]
Bug 16933 - Alt-Y not working on "Please confirm checkout" dialogs

This patch changes the keyboard shortcut for renew from Alt+y to Alt+w.

To test:
1) Press Alt+y when you get a "Please confirm checkout" dialog.
2) The renew tab is selected instead of confirming the dialog.
3) Apply the patch and refresh your browser to load the change.
4) Repeat step one.
5) Alt+y confirms the checkout, Alt+w selects the renew tab.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoVersion 16.05.07 v16.05.07
Mason James [Sat, 31 Dec 2016 02:32:45 +0000 (15:32 +1300)]
Version 16.05.07

Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoUpdate release notes for 16.05.07 release
Mason James [Tue, 3 Jan 2017 02:23:03 +0000 (15:23 +1300)]
Update release notes for 16.05.07 release

Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses
Julian Maurice [Thu, 8 Dec 2016 09:13:35 +0000 (10:13 +0100)]
Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.com>
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 agoTranslation updates for Koha 16.05.07
Mason James [Mon, 2 Jan 2017 05:06:55 +0000 (18:06 +1300)]
Translation updates for Koha 16.05.07

Signed-off-by: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.com>
7 years agoRevert "Bug 17494: Make sure the same verification token won't be generated twice"
Mason James [Thu, 29 Dec 2016 01:43:41 +0000 (14:43 +1300)]
Revert "Bug 17494: Make sure the same verification token won't be generated twice"

This reverts commit 5f160f675b1de4a12db6717b297c3d7b0a7a5d3d.

7 years agoRevert "Bug 17494: Prevent duplicate tokens from getting stored"
Mason James [Thu, 29 Dec 2016 01:43:26 +0000 (14:43 +1300)]
Revert "Bug 17494: Prevent duplicate tokens from getting stored"

This reverts commit d76cd8a63946572508f4a7d8b8ee8d06c63ddb09.

7 years agoRevert "Bug 17494: (QA followup) Fix exception name"
Mason James [Thu, 29 Dec 2016 01:42:58 +0000 (14:42 +1300)]
Revert "Bug 17494: (QA followup) Fix exception name"

This reverts commit 9a301836714924581b806cd7c728695625ddf3cc.

7 years agoRevert "Bug 17641: Fix t/Biblio/Isbd.t"
Mason James [Thu, 29 Dec 2016 01:05:20 +0000 (14:05 +1300)]
Revert "Bug 17641: Fix t/Biblio/Isbd.t"

This reverts commit 2bc7fc1551e2c4b37fd054a733e36494adda02e3.

7 years agoRevert "Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf...
Mason James [Thu, 29 Dec 2016 00:54:22 +0000 (13:54 +1300)]
Revert "Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml"

This reverts commit a071fb8517a215d451e7bd8fd28cd7386d037485.

7 years agoRevert "Bug 17278: Use available limit when requesting zebra when ccl query is used"
Mason James [Thu, 29 Dec 2016 00:50:55 +0000 (13:50 +1300)]
Revert "Bug 17278: Use available limit when requesting zebra when ccl query is used"

This reverts commit 81e19a289471654f5f89408a2fe5020dbd48e7e9.

7 years agoRevert "Bug 17278: Fix "show all items" link"
Mason James [Thu, 29 Dec 2016 00:50:42 +0000 (13:50 +1300)]
Revert "Bug 17278: Fix "show all items" link"

This reverts commit 24e69d1ccbe0efa5ad49db7cd3bfe09cfab6a6ca.

7 years agoRevert "Bug 17278: Fix test compilation errors"
Mason James [Thu, 29 Dec 2016 00:50:22 +0000 (13:50 +1300)]
Revert "Bug 17278: Fix test compilation errors"

This reverts commit ef94d6ba9da04994dc1fd4f6cb72f51bafbb7ba0.

7 years agoRevert "Bug 17564: Fix t/db_dependent/Acquisition/OrderUsers.t"
Mason James [Wed, 14 Dec 2016 10:29:47 +0000 (23:29 +1300)]
Revert "Bug 17564: Fix t/db_dependent/Acquisition/OrderUsers.t"

This reverts commit 54aee78d6afb0cd1bcb26fc7c7a65e46c372cd0f.

7 years agoRevert "Bug 14598: (regression tests) AddReturn should store itemtype on 'statistics...
Mason James [Thu, 29 Dec 2016 01:59:50 +0000 (14:59 +1300)]
Revert "Bug 14598: (regression tests) AddReturn should store itemtype on 'statistics' table"

This reverts commit db99e5ff04298683a4b6651f0b906de0336b5646.

7 years agoRevert "Bug 14598: Make C4::Circulation::AddReturn store the right itemtype"
Mason James [Thu, 29 Dec 2016 01:59:32 +0000 (14:59 +1300)]
Revert "Bug 14598: Make C4::Circulation::AddReturn store the right itemtype"

This reverts commit f8e2e2f1e25a9838300a160a094f4c0b3dcfa710.

7 years agoRevert "Bug 14598: (QA followup) Don't die on bad barcode"
Mason James [Thu, 29 Dec 2016 01:59:17 +0000 (14:59 +1300)]
Revert "Bug 14598: (QA followup) Don't die on bad barcode"

This reverts commit 575bbbeaba5a2c808725697b1db263dcef9520da.

7 years agoRevert "Bug 14598 - QA Followup touching CanBookBeIssued subroutine"
Mason James [Thu, 29 Dec 2016 01:56:16 +0000 (14:56 +1300)]
Revert "Bug 14598 - QA Followup touching CanBookBeIssued subroutine"

This reverts commit c28704e5731ad0da1dd26757fa8fa19c39653fcc.

7 years agoRevert "Bug 14598 [QA Followup] - Only fetch bib data if needed"
Mason James [Thu, 29 Dec 2016 01:55:45 +0000 (14:55 +1300)]
Revert "Bug 14598 [QA Followup] - Only fetch bib data if needed"

This reverts commit 8a919ef2bd216483b5e388c4eecab9075ec39aac.

7 years agoRevert "Bug 14598 [QA Followup] - Correct the behavior of GetItem"
Mason James [Thu, 29 Dec 2016 01:55:18 +0000 (14:55 +1300)]
Revert "Bug 14598 [QA Followup] - Correct the behavior of GetItem"

This reverts commit c9433c56385946d14a29dd67a771a5bb5186aecb.

7 years agoRevert "Bug 14598 [QA Followup] - Make unit test pass"
Mason James [Thu, 29 Dec 2016 01:55:06 +0000 (14:55 +1300)]
Revert "Bug 14598 [QA Followup] - Make unit test pass"

This reverts commit cdfabce1b8b3f6a0915f9d13057269847695b9d7.

7 years agoRevert "Bug 14598: (followup) Remove unused and non-existent C4::ItemType include"
Mason James [Thu, 29 Dec 2016 01:53:22 +0000 (14:53 +1300)]
Revert "Bug 14598: (followup) Remove unused and non-existent C4::ItemType include"

This reverts commit b0124b321a57264fcb949f142e6a2a3b001530e7.

7 years agoRevert "Bug 14598: Fix warning from effective_itemtype"
Mason James [Thu, 29 Dec 2016 01:51:52 +0000 (14:51 +1300)]
Revert "Bug 14598: Fix warning from effective_itemtype"

This reverts commit 9f247faaed3275931222a81f20c007ee07ac2dbd.

7 years agoRevert "Bug 14598: [QA Follow-up] Small changes"
Mason James [Thu, 29 Dec 2016 01:50:23 +0000 (14:50 +1300)]
Revert "Bug 14598: [QA Follow-up] Small changes"

This reverts commit 8c14c3b32a57fd9a3be4c7e44a79e1a4b8cc8acf.

Conflicts:
installer/data/mysql/updatedatabase.pl

7 years agoBug 17663: Forgotten userpermissions from bug 14686 (follow-up) v16.05.06-01
Mason James [Wed, 14 Dec 2016 09:42:04 +0000 (22:42 +1300)]
Bug 17663: Forgotten userpermissions from bug 14686 (follow-up)

Move atomic updates to updatedatabase.pl

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>
7 years agoAdd release notes for the 16.05.06 release v16.05.06
Mason James [Mon, 12 Dec 2016 03:41:40 +0000 (16:41 +1300)]
Add release notes for the 16.05.06 release

Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoVersion 16.05.06
Mason James [Wed, 7 Dec 2016 17:36:41 +0000 (06:36 +1300)]
Version 16.05.06

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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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>
Signed-off-by: Mason James <mtj@kohaaloha.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>
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>
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>
7 years agoBug 17663: Forgotten userpermissions from bug 14686
Marcel de Rooy [Sun, 20 Nov 2016 15:35:53 +0000 (16:35 +0100)]
Bug 17663: Forgotten userpermissions from bug 14686

Bug 14686 added in a dbrev:
    (13, 'upload_general_files', 'Upload any file'),
    (13, 'upload_manage', 'Manage uploaded files');

But these were not added in userpermissions.sql somehow :)
So, what now?

This patch:
[1] adds them to userpermissions.sql as should have been done,
[2] adds a dbrev to add them for newer installs that did not run the
    14686 dbrev.

Test plan:
[1] Run this sql statement:
    DELETE FROM permissions WHERE code = 'upload_general_files' OR
        code = 'upload_manage'
[2] Run the db rev.
[3] Check if you see Tools/Upload (with sufficient perms).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17626 (QA followup)
Nick Clemens [Tue, 22 Nov 2016 10:45:56 +0000 (10:45 +0000)]
Bug 17626 (QA followup)

    Fix SAX parser error pointing to INSTALL docs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17626: Remove existing install instructions and link to the wiki pages instead
Jonathan Druart [Tue, 15 Nov 2016 08:55:04 +0000 (08:55 +0000)]
Bug 17626: Remove existing install instructions and link to the wiki pages instead

Since we are pretty bad to maintain INSTALL files, I'd suggest to point
to the wiki.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17626: Remove INSTALL.distri files
Jonathan Druart [Tue, 15 Nov 2016 08:54:45 +0000 (08:54 +0000)]
Bug 17626: Remove INSTALL.distri files

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17132 - Availability search broken when using Elastic
Kyle M Hall [Mon, 15 Aug 2016 18:12:44 +0000 (18:12 +0000)]
Bug 17132 - Availability search broken when using Elastic

Elastic appears to be indexing onloan as a string, but our code assumes
it is a boolean.

Test Plan:
1) Ensure you are set up using Elastic as your search engine
2) Search only for available items from the advanced search
3) Note you get no results
4) Apply this patch
5) Re-run the search
6) You should now get results!

Signed-off-by: Jennifer Schmidt <jschmidt@switchinc.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml
Tomas Cohen Arazi [Wed, 16 Nov 2016 14:40:21 +0000 (11:40 -0300)]
Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml

This patch makes the tests clean the 'config' namespace for cache before
it runs any tests.

To test:
- Run:
  $ prove t/db_dependent/Search.t
=> FAIL: Self explanatory
- Apply the patch
- Run:
  $ prove t/db_dependent/Search.t
=> SUCCESS: All green
- Sign off :-D

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All test pass successfuly

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Cannot reproduce, but I trust everyone telling me it's failing ; )
No regressions spotted
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17559: Fixed HTML element ID of B_streetnumber
Radek Šiman [Thu, 3 Nov 2016 13:45:43 +0000 (14:45 +0100)]
Bug 17559: Fixed HTML element ID of B_streetnumber

There is a duplicate ID in HTML code, because of this:
<input type="text" id="B_address" name="B_streetnumber" size="5"
value="" />
<input type="text" id="B_address" name="B_address" size="40" value="" />

Test plan:
1) Edit a patron and look into its HTML code
2) Find input: name="B_streetnumber"
3) Its ID is B_address - a duplicate within the code in fact
4) Apply the patch
5) Repeat steps 1 and 2
6) The ID is unique now: B_streetnumber

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17645 - Remove obsolete interface customization images
Owen Leonard [Wed, 16 Nov 2016 13:22:08 +0000 (08:22 -0500)]
Bug 17645 - Remove obsolete interface customization images

This patch removes three files which are obsolete following the removal
of the OPAC prog template.

To test, apply the patch and confirm that these files no longer exist in
misc/interface_customization:

- koha3-opac-button-background.png
- koha3-opac-button-background.psd
- koha3-opac-button-background.svg

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17545 [Revised] Make "Add biblio" not hidden by language chooser
Owen Leonard [Fri, 4 Nov 2016 13:34:12 +0000 (09:34 -0400)]
Bug 17545 [Revised] Make "Add biblio" not hidden by language chooser

This alternate patch changes the menu direction so that it "drops" up
instead of down. This avoids the problem of overlapping or being hidden
by the language chooser.

The disadvantage of this patch is that it is not global. However, I
think it's a better long-term solution to the problem.

To test, apply the patch and follow the issue description:

- Make sure more than one language is active for the staff client, so
  that the language chooser bar shows at the bottom of each page
- Do one or more Z39.50 searches, to make sure you have some records in
  the reservoir
- Go to "Cataloging" and do a "Catalog search", so that the reservoir is
  searched. Make sure your search is broad enough that some results from
  the reservoir is shown "below the fold"
- Scroll to the last result and click on the "Actions" menu

The direction of the menu should be up instead of down.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Popup menus on the cataloging search page now pop up instead
of down, which means they avoid being hidden by the language
chooser. Mission accimplished!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17657: Fix locations of item types images
Jonathan Druart [Fri, 18 Nov 2016 08:23:16 +0000 (08:23 +0000)]
Bug 17657: Fix locations of item types images

Koha::ItemType->image_location takes the interface in parameter or
default to OPAC.
From the item types admin page, we need to specify the intranet
interface to retrieve the correct image's url

Test plan:
Go on the item types admin page, see the source of the page and find the
image' urls.
=> Without this patch, they point to the OPAC
=> With this patch, the location is correct

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17653: Remove itemtype-related t/db_dependent/Circulation* warnings
Tomas Cohen Arazi [Thu, 17 Nov 2016 15:29:14 +0000 (12:29 -0300)]
Bug 17653: Remove itemtype-related t/db_dependent/Circulation* warnings

This patch makes t/db_dependent/Circulation* create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation*
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation*
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17647: Remove itemtype-related CancelReceipt.t warnings
Tomas Cohen Arazi [Wed, 16 Nov 2016 19:44:44 +0000 (16:44 -0300)]
Bug 17647: Remove itemtype-related CancelReceipt.t warnings

This patch makes t/db_dependent/Acquisition/CancelReceipt.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Acquisition/CancelReceipt.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Acquisition/CancelReceipt.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 12359: Add HidePatronName functionality to the holds queue
Katrin Fischer [Mon, 10 Nov 2014 19:23:45 +0000 (20:23 +0100)]
Bug 12359: Add HidePatronName functionality to the holds queue

This changes the Holds Queue page to not show the patron's name
and phone number, but only the cardnumber, when HidePatronName
is set to 'Don't show'

This also changes the link to the patron account to use
the borrowernumber instead of the cardnumber, which seems
more consistent.

Fixes a tiny capitalization error: Only item...

To test:
- Look at the holds queue page with holds displayed
- Toggle HidePatronName system preference and observe the change
- Make sure the link works correctly

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

Signed-off-by: Chris Kirby <christopherlawrencekirby@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17377: ES - Take control fields into account
Jonathan Druart [Thu, 29 Sep 2016 15:08:36 +0000 (16:08 +0100)]
Bug 17377: ES - Take control fields into account

There is a bug in Koha::SearchEngine::Elasticsearc::Search->json2marc, it
assumes that the MARC::Field constructor always takes >= 5 parameters.
This assumption is wrong for control fields, to create a control field you
need to call the constructor with:
  MARC::Field->new($tag, $value);

Note that I got "Too much data for control field" in the _warning value of my
MARC::Field because too many parameters were passed, and the value was undef.

That broke the result search links (on the staff interface) for DB with
biblio.biblionumber mapped with 001.

Other bugs will certainly be fixed by this patch.
For instance I got:
  GetMarcBiblio called with undefined biblionumber at /home/koha/src/opac/opac-search.pl line 664.
  GetCOinSBiblio called with undefined record at /home/koha/src/opac/opac-search.pl line 665.
in my logs, with this patch I don't get them anymore.

Test plan:
You can try to recreate the different issues and confirm than this patch
fixes them.
Or just run the tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17377: Add tests for json2marc
Jonathan Druart [Thu, 29 Sep 2016 15:41:53 +0000 (16:41 +0100)]
Bug 17377: Add tests for json2marc

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17636: Remove itemtype-related GetIssues.t warnings
Tomas Cohen Arazi [Tue, 15 Nov 2016 20:40:22 +0000 (17:40 -0300)]
Bug 17636: Remove itemtype-related GetIssues.t warnings

This patch makes t/db_dependent/Circulation/GetIssues.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/GetIssues.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/GetIssues.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All test pass successfuly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17646: Remove itemtype-related IssueSlip.t warnings
Tomas Cohen Arazi [Wed, 16 Nov 2016 13:59:26 +0000 (10:59 -0300)]
Bug 17646: Remove itemtype-related IssueSlip.t warnings

This patch makes t/db_dependent/Members/IssueSlip.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Members/IssueSlip.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Members/IssueSlip.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All test pass successfuly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17644 - t/db_dependent/Exporter/Record.t fails
Kyle M Hall [Wed, 16 Nov 2016 12:40:31 +0000 (12:40 +0000)]
Bug 17644 - t/db_dependent/Exporter/Record.t fails

Test Plan:
1) prove t/db_dependent/Exporter/Record.t fails
2) Apply this patch
3) prove t/db_dependent/Exporter/Record.t succeeds!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17637: Fix tests Auth_with_ldap.t
Jonathan Druart [Wed, 16 Nov 2016 07:44:03 +0000 (07:44 +0000)]
Bug 17637: Fix tests Auth_with_ldap.t

Koha::Patron->delete create a transaction and so we need to use
txn_begin to have nested txn

DBD::mysql::db begin_work failed: Already in a transaction

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17587: Remove itemtype-related IsItemIssued.t warnings
Tomas Cohen Arazi [Tue, 8 Nov 2016 15:40:45 +0000 (12:40 -0300)]
Bug 17587: Remove itemtype-related IsItemIssued.t warnings

This patch makes t/db_dependent/Circulation/IsItemIssued.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/IsItemIssued.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/IsItemIssued.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.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: Mason James <mtj@kohaaloha.com>