]> git.koha-community.org Git - koha.git/log
koha.git
9 years agoBug 14298: Add perms for other languages
Jonathan Druart [Mon, 14 Sep 2015 09:50:12 +0000 (10:50 +0100)]
Bug 14298: Add perms for other languages

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
9 years agoBug 14298: Add warning to the about page if the sco user does not have correct permis...
Jonathan Druart [Wed, 2 Sep 2015 15:30:15 +0000 (16:30 +0100)]
Bug 14298: Add warning to the about page if the sco user does not have correct permissions

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Note: Made a little change, changed He should have, to They should have

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
9 years agoBug 14298: Use the new permission in the sco scripts
Jonathan Druart [Wed, 2 Sep 2015 15:10:45 +0000 (16:10 +0100)]
Bug 14298: Use the new permission in the sco scripts

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Note without this patch, you won't be able to access the SCO side.
So don't panic if you cant use SCO with just the first patch

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
9 years agoBug 14298: Add the new 'self_checkout' permissions
Jonathan Druart [Wed, 2 Sep 2015 15:09:35 +0000 (16:09 +0100)]
Bug 14298: Add the new 'self_checkout' permissions

There is a security issue in the self checkout module.
The user used to check items out must have the circulate =>
circulate_remaining_permissions permissions.
So even if a user does not have a login/password or a barcode he cans
access to the circulation module of the intranet.
Imagine if the sco patron used is a superlibrarian...

This patch set will change the behavior and adds a new permission to
access to the sco module (circulate => self_checkout).
This permission should be the only one defined for this patron.

IMPORTANT NOTE: Hopefully, this only works if both interfaces use the
same domains (but different ports).

Test plan:
0/ Does not apply this patch set
1/ Create a patron with the circulate => circulate_remaining_permissions
and some others. Note his userid/pwd (later 'sco/sco').
Turn on WebBasedSelfCheck and AutoSelfCheckAllowed
Fill the AutoSelfCheckID and AutoSelfCheckPass wich 'sco' and 'sco'
2/ Log you out from the OPAC and the intranet
3/ Go on the sco page
4/ Note that your are automatically logged in
5/ Go on the circulation module on the intranet side
6/ Oops
7/ Apply this patch
8/ Execute the updatedatabase
9/ Note that the sco user only has the new permission circulate =>
self_checkout, others have been removed
10/ Try to reproduce the issue, it should not access anything on the
intranet side
11/ Confirm that there is no regression in the sco module

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Works well no regressions, changes the permissions appropriately.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
9 years agoBug 14585: Fixing up online help on main page
Aleisha [Wed, 22 Jul 2015 01:37:30 +0000 (01:37 +0000)]
Bug 14585: Fixing up online help on main page

To test:

1) Go to home page of staff client and click the Help
2) Notice: 'you should now 'got to' Koha'
   'settings found in 'a'dministration.' (should be capitalized)
   'Once that user is set you should use that user to log in rather than the root user set up as part of installation.' (could be worded better)
3) Apply patch, close Help, reload page, reopen Help
4) Notice: 'got to' --> 'go to'
   'administration' --> 'Administration'
   'Once that user is set you should use that user to log in rather than the root user set up as part of installation.'

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit d810fd1094541ee4c95289df3f18bf765047335b)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 13781: Fix missing heading columns for relative's checkouts table in check out...
Genevieve Plantin [Tue, 8 Sep 2015 17:58:10 +0000 (13:58 -0400)]
Bug 13781: Fix missing heading columns for relative's checkouts table in check out patron page

Theres was two missing heading columns Location and Fines in the Check out section of a Patron

Tested both patches together. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit bcb6e9ea39dce065e8c7ff80b4d1b7b49e1735f4)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 13781: Fix relatives's checkouts missing heading columns
Genevieve Plantin [Fri, 4 Sep 2015 13:15:26 +0000 (09:15 -0400)]
Bug 13781: Fix relatives's checkouts missing heading columns

There was two missing heading columns (location and fine) and one hidden heading missing column (this hidden column is needing for sorting the table) it was taking the due_date column for the hidden column, so I added them

Both patches tested together. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit e0e3efacca9e4e605f0e1c5612ace38194a2f878)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14245: (QA followup) already global
Tomas Cohen Arazi [Wed, 16 Sep 2015 14:51:12 +0000 (11:51 -0300)]
Bug 14245: (QA followup) already global

The original patch correctly unmasks the global variable (by
removing the 'my' on the marc2ris function, but wrongly introduces
a new global variable.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 7349777f14b8d4c11f74da2098568a6966800e5a)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14245: Problems with RIS export in unimarc
Bernardo Gonzalez Kriegel [Thu, 21 May 2015 17:00:05 +0000 (14:00 -0300)]
Bug 14245: Problems with RIS export in unimarc

Variable $itype is used an all C4/Ris.pm to switch
between marc falvors, but is local and not passed along
as argument.

As a quick solution, is defined as global

To test:
1) On UNIMARC setup, export a record as RIS,
check that author (and other fields) are displayed
incorrectly

2) Apply the patch

3) Export again, improved results

4) Run t/Ris.t

There are other problems in this script, needs maintenance
(e.g. no Modern::Perl friendly)

Signed-off-by: Victor do Rosário <jvr@fct.unl.pt>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit e15621fee2693059cce67882691ad8eae9a5c9b7)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14640: 'Cancel Hold' check box on check-out confirmation does not cancel the...
Kyle M Hall [Tue, 25 Aug 2015 14:35:28 +0000 (10:35 -0400)]
Bug 14640: 'Cancel Hold' check box on check-out confirmation does not cancel the hold when item is checked out.

This bug is dealing with the situation where an item is checked out to a
patron that is not the next in line hold-wise for an item. In this case,
Koha will warn the librarian that there are holds on the item and
show the first person in line. Again, I want to stress that this
is the case where the item *is not waiting* for a patron. The
hold for the patron listed will just have a priority of 1.

The only situation where the "Cancel hold" checkbox will function
is when the priority 1 hold is an item level hold. This is due to
the fact that CancelReserve is being passed the trio of
biblionumber, borrowernumber, and itemnumber rather than the
singular reserve_id.

1) place biblio level hold on a book to borrower A.
2) check out an item of the book to borrower B.
3) When confirming checkout, check the 'Cancel hold' check-box, and
   click the "Yes, check out" button.
4) Note the hold was not canceled
5) Apply this patch
6) Repeat steps 1 through 3
7) Note the hold was indeed canceled

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit a37b3bb7f76b5ddea7400f5268c592c0cc578a8c)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14640: Add tests
Jonathan Druart [Tue, 1 Sep 2015 09:52:51 +0000 (10:52 +0100)]
Bug 14640: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 10820de380695f90fd544b40b52682efcf83a962)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 10005: Inventory - Add an option to not check in items
Jonathan Druart [Tue, 14 Jul 2015 14:02:42 +0000 (15:02 +0100)]
Bug 10005: Inventory - Add an option to not check in items

The inventory tools automatically check in items, this patch adds it as
an option.

Test plan:
1/ Check an item out, fill a file with its barcode, and use this file in
the inventory tools.
2/ Check the new checkbox and confirm that the item is not checked in
3/ Repeat again and don't check it, the behavior should be the same as before
this patch.

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Added a missing </li>.
Patch works as expected.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit e5f604378a45d62e8b454cd390abb18b34ef53f8)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 7634: Prevent permanent_location to be set to NULL if not defined
Jonathan Druart [Wed, 2 Sep 2015 13:28:52 +0000 (14:28 +0100)]
Bug 7634: Prevent permanent_location to be set to NULL if not defined

The permanent_location is correctly filled when an item is added from
the cataloguing module (routine set_item_default_location from
cataloguing/additem.pl).
But when records are imported, this filled is not managed. It's only on
editing (_do_column_fixes_for_mod called from ModItem).

This patch set the permanent_location item fields to the location value for all
items created, even the imported ones.

Test plan:
0/ Do not apply this patch
1/ Import a record with items using the "Stage MARC for import" tool
2/ Check the values for the permanent_location in the items table.
They are set to NULL
3/ Apply this patch
4/ Repeat 2 and confirm that now the permanent_location values are set
to the location values.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit a2ca59efb877945f7b2ebc92e7643d4cdaf9d4e1)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 7634: Add tests
Jonathan Druart [Wed, 2 Sep 2015 13:46:02 +0000 (14:46 +0100)]
Bug 7634: Add tests

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit ae5ee62d598ccb0cfe4fb6cc4a3b2ab6408febd8)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 7634: Make the tests pass
Jonathan Druart [Wed, 2 Sep 2015 13:43:15 +0000 (14:43 +0100)]
Bug 7634: Make the tests pass

This patch just fixed a master bug, if your database already has some
items.homebranch set to CPL

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 704aed77ea03bf8a0a0e4ece457e91fb7937742d)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 6756: Add info messages
Jonathan Druart [Tue, 14 Jul 2015 10:38:41 +0000 (11:38 +0100)]
Bug 6756: Add info messages

NOTE: Before patch "./misc/cronjobs/batch_anonymise.pl --help" had no
      message, and neither did the anonymizing tool in the staff client.
      After the patch, both had informative messages.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 1acddd0f1b41e9e5f75b75d9d101c8b0879c00c5)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 6756: Fix bad behaviors if AnonymousPatron is not defined
Jonathan Druart [Tue, 14 Jul 2015 10:30:51 +0000 (11:30 +0100)]
Bug 6756: Fix bad behaviors if AnonymousPatron is not defined

There are at least 2 wrong behaviors if the AnonymousPatron pref is not
defined (0 or empty string).
1/ If you use the clean borrower tools, you will get a successful
message when the nothing happened (the history has not been anonymised).
2/ At the OPAC, if a patron ask for delete his reading history, he will
get an error message "The deletion of your reading history failed,
because there is a problem with the configuration of this feature.
Please help to fix the system by informing your libr    ary of this
error". IMO this should not happen, the history should be anonymised.

With this patch, the old_issues.borrowernumber field will be set to NULL
if the AnonymousPatron pref if not defined.

Test plan:
1/ Fill the pref with "" or 0
2/ At the OPAC, go on the privacy tab and click on the "Immedia deletion" button.
You should get a green and friendly message. Confirm that the history
has been anonymised.
3/ Use the "Batch patron anonymization" tools (tools/cleanborrowers.pl)
to anonymize the checkout history.
Confirm that a) it works and b) you get a message.

Try again with AnonymousPatron set to a valid patron. You should not see
any changes with the current behaviors.

NOTE: This patch tweaks C4/Circulation.pm and provides tests.
      applying just this, and running prove success. Reverting just
      C4/Circulation.pm fails, as expected.
      Tested OPAC stuff with both patches applied.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 224b1c7976567511f1d6715784274169e006edcf)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14813: Fix encoding issues on editing help pages
Jonathan Druart [Mon, 14 Sep 2015 09:28:01 +0000 (10:28 +0100)]
Bug 14813: Fix encoding issues on editing help pages

It has been introduced by bug 11944.

Test plan:
1/ Install and set the fr-FR language (or ar-Arab).
2/ Go on the help page and edit it.
3/ The textarea should not contain encoding issues with this patch.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit d671b8661cf02d8b039eb5230ab732fd1fde2301)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 8723: Update hold_fill_targets, tmp_holdsqueue and linktracker tables
Jonathan Druart [Fri, 10 Jul 2015 14:18:48 +0000 (15:18 +0100)]
Bug 8723: Update hold_fill_targets, tmp_holdsqueue and linktracker tables

Same as previous patch for 3 other tables.

Test plan:
Same as before but the hold should exist to the 3 tables before the
move.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit c7a6745bc0e0241e5f39a12e2ff4e17678288b14)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 8723: Update the reserves table for item-level holds
Jonathan Druart [Fri, 10 Jul 2015 14:04:55 +0000 (15:04 +0100)]
Bug 8723: Update the reserves table for item-level holds

If an item is moved from a biblio to another, the holds should be
updated too.

See discussion on the bug report for more information.

Test plan:
1/ Place a item-level hold on biblio1
2/ Move the item to biblio2
3/ Confirm that the hold still exists and point to the biblio2

This patch should not change the existing behavior for bib-level holds.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 9f8f33e351e1ae5810441a0c9ff7226aafb63c8b)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 8723: Cover the existing behavior
Jonathan Druart [Fri, 10 Jul 2015 13:15:42 +0000 (14:15 +0100)]
Bug 8723: Cover the existing behavior

This patch cover the MoveItemFromBiblio subroutine

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit cb4ce631c316a41ac47a17bfdaa4e5591e0e37df)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14782: Add possibility to search patrons using the username (userid)
Marc Véron [Sat, 5 Sep 2015 14:41:58 +0000 (16:41 +0200)]
Bug 14782: Add possibility to search patrons using the username (userid)

This patch makes it possible to search for users using the username (userid / login name).

To test:

- Apply patch
- Do searches from Home > Patrons
- Search after a full username or parts of a username with Search fields = Standard and Search fields = Userid
- Perform the searches from the top bar (expand with [+]) and from the "Filters" part at the left
- Make sure that other searches behave as before

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit a71cc14a52589f45bc30dad81b8c7fc0ac35d9fc)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14782: Add tests
Katrin Fischer [Sun, 13 Sep 2015 16:06:46 +0000 (18:06 +0200)]
Bug 14782: Add tests

Run:
perl t/db_dependent/Utils/Datatables_Members.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit f704fbebd86e0034cf285b2dd29c0d85cb2086a2)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14655: Fix wording
Jonathan Druart [Mon, 14 Sep 2015 12:22:21 +0000 (13:22 +0100)]
Bug 14655: Fix wording

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Fixed a missing space after Error: :)
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit fdc859281cc2af56431d183c3341ec9f8d4f672c)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14655: Add a warning on the about page if patrons have requested privacy
Jonathan Druart [Tue, 18 Aug 2015 17:15:02 +0000 (18:15 +0100)]
Bug 14655: Add a warning on the about page if patrons have requested privacy

New warning on the about page if at least a patron has requested a
privacy on checkin but the AnonymousPatron is not set to a valid patron.

Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit aaf2903cc0e86a2e59b3c7e223d7d8a85778ca0d)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Conflicts:
about.pl

9 years agoBug 14655: Add a warning if the checkin will fail
Jonathan Druart [Tue, 18 Aug 2015 17:10:37 +0000 (18:10 +0100)]
Bug 14655: Add a warning if the checkin will fail

On the checkin and checkout page, the checkin will fail if the patron
has requested the privacy and the AnonymousPatron is not correctly set.

This patch adds a warning message on both pages.

Test plan:
0/ Be sure you don't have any patron with privacy=2 (Never)
1/ Set OPACPrivacy, not AnonymousPatron
2/ Go on the checkin, you should a warning (same as before this patch).
3/ Set the privacy=2 for a patron
4/ Go on the circulation page, a warning should appear (for this
specific patron)
5/ Check an item out to this patron
6/ Check the item in on the checkin page.
The item is not checked in and you get a specific message for this
patron.

Confirm other/correct situations don't trigger the messages.

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit cb2151529e0c2d031a01e68bd5deab26d2ffbaff)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14683: [QA Follow-up] Similar change for staff
Marcel de Rooy [Tue, 1 Sep 2015 14:11:54 +0000 (16:11 +0200)]
Bug 14683: [QA Follow-up] Similar change for staff

Script memberentry.pl contained a similar line.
Solution is simpler here.

Test plan:
[1] Add, change or clear the sms number at staff side.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bdf4894c507f4bac6b2b79c7ca3b7a556d246ed5)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14683: [QA Follow-up] Mixup between mobile and smsalertnumber
Marcel de Rooy [Fri, 28 Aug 2015 07:13:09 +0000 (09:13 +0200)]
Bug 14683: [QA Follow-up] Mixup between mobile and smsalertnumber

This is an issue discussed on older reports already in the past.
Column mobile in borrowers is actually 'Other phone', not necessary a
mobile number. The name of the field is confusing. (Renaming it is
outside the scope of this report.)
The field that we are editing here is smsalertnumber. It should not be
compared with mobile at all.

What could be the side-effect of this correction?
===
First, the change is only relevant for libraries with pref SMSSendDriver
enabled.
In the past patrons editing their message preferences saw mobile (read:
other phone) in their smsalertnumber field (if the latter was still empty).
If they saved it, it was copied to smsalertnumber.
This change does not affect these patrons. They just have the same number
in two columns. No big deal.
What if a patron does not yet have a smsalertnumber? In that case no sms
is sent in Letters.pm. So no change in behavior. If he submits
opac-messaging now, he will no longer copy his other phone to smsalert [we
cannot assume that it was mobile anyway!]. If he enters a mobile number,
it will be saved correctly in the right field.

Conclusion: this change will not break things or hurt anyone. It only
prevents unwanted copying other phone to smsalertnumber.

Also modified the compare to prevent uninitialized warnings.
And removed a commented warn.

Test plan:
[1] Add, edit or delete the SMS number on opac-messaging regardless of
    the value of Other Phone (in the badly named mobile field).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b8d7168beb27342c4c483a0812e3a6789fabced)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14683: Unable to clear SMS number
Joonas Kylmälä [Wed, 19 Aug 2015 11:42:50 +0000 (11:42 +0000)]
Bug 14683: Unable to clear SMS number

Enables to clear SMS number.

To test:
1. Go to opac-messaging.pl
2. Insert SMS number and submit
3. Clear SMS number and submit
4. Observe that the sms number did not change
5. Apply patch
6. Clear SMS number and submit
7. Observe that the sms number changes

Sponsored-by: Vaara-kirjastot
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Adding a follow-up.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5b1c7e4c359e974e5aca801579db72b356741a0f)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14621: Messaging preferences table needs to be sorted
Lari Taskula [Thu, 30 Jul 2015 15:34:49 +0000 (18:34 +0300)]
Bug 14621: Messaging preferences table needs to be sorted

I have been working with messaging preferences and I noticed a weird issue in Firefox on Ubuntu.

On messaging preferences page, the table is unsorted and the content in rows are generated randomly
on every page refresh. When you select/deselect checkboxes and refresh the page (without posting the changes),
Firefox will remember your choices. Now the issue is that when the table is unsorted and the rows keep
changing on page refresh, Firefox has trouble remembering your choices. This makes it appear as if the
checkboxes are magically changing values on each page refresh.

Here is a patch that prevents this problem by sorting the messaging settings.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 46ac35f8e11c06a784ca309b0dc876aff9469edb)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14760: Disabled courses display in the course reserves list for items
Kyle M Hall [Mon, 31 Aug 2015 13:36:02 +0000 (09:36 -0400)]
Bug 14760: Disabled courses display in the course reserves list for items

If an item is on reserve for two courses but one of those courses is
disabled, both courses are still listed on opac-detail.pl!

Test Plan:
1) Enable course reserves
2) Create two courses
3) Place one item on reserve for both courses
4) Disable one of the two courses
5) View the record details for that record/item
6) You should see both courses listed in the course reserves column
7) Apply this patch
8) Reload the page
9) You should now only see the active course in the course reseves column

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 73e9dcb70fcf24dc87af7c5af6f38102206863ae)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14470: Do not allow renew for on-site checkouts
Jonathan Druart [Tue, 4 Aug 2015 09:38:29 +0000 (10:38 +0100)]
Bug 14470: Do not allow renew for on-site checkouts

At the opac, the renew checkbox should not be displayed if it's an
on-site checkout (same on the intranet).

On the way, this patch adds a specific message to the intranet if the
librarian try to renew an on-site checkout.
Indeed before this patch a renew was allowed if the barcode was scanned.

Test plan:
1/ Create an on-site checkout for a patron
2/ Confirm that the checkbox 'renew' is not displayed on the checkout
list tables
3/ At the OPAC, the renew should not be allowed (no checkbox)
4/ Try to check the item out to the same patron, confirm that you get a
specifig message to inform you the renew is not allowed for on-site
checkouts.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Changed 'issue' to 'item' in the error message.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ea92a92f5384c3256de55b770d31342f796edc47)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Conflicts:
t/db_dependent/Circulation.t

9 years agoBug 12525: Prevent adding several patron lists with the same name
Jonathan Druart [Wed, 15 Jul 2015 10:50:18 +0000 (11:50 +0100)]
Bug 12525: Prevent adding several patron lists with the same name

If you add patron to a patron list, from the patron search result, a
list is created when you click on "Save".
The list is considered as new each time.

To reproduce:
1/ Launch a patron search
2/ Select 1 patron, and create a new list 'aaa'
3/ Select another patron and click Save again
2 lists are created

Test plan:
1/ Launch a patron search
2/ Select 1 patron, and create a new list 'aaa'
The dropdown list should be populated with this new list, and should be
selected
3/ Select another patron and click Save again
Only 1 list should be created

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7f65aaac748833b57f9f1c8ae754d66c7e144d81)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 12525: FIX patron lists dropdown is empty
Jonathan Druart [Wed, 15 Jul 2015 10:36:26 +0000 (11:36 +0100)]
Bug 12525: FIX patron lists dropdown is empty

On the patrons home page, the dropdown list is not populated.

Test plan:
1/ Go on the patrons home page (members/members-home.pl)
2/ Launch a search
3/ The dropdown list close to "Add selected patrons to" should contain
all your patron lists

NOTE: Initially tested with both which created lists.
      git reset --hard origin/master
      And then dropdown list was missing them.
      Applied just this one, and they were listed.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2e50e0b06587f45c5370b313ff7a7d7a432bcd5)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14343: Remove the DT pagination
Jonathan Druart [Fri, 4 Sep 2015 13:53:37 +0000 (14:53 +0100)]
Bug 14343: Remove the DT pagination

It does not make sense to have 2 paginations here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 65ae7af277d6f64ef42f961c290ab92768a90df3)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14343: Incorrect links to results pages in Receive Shipment List
Lyon3 Team [Fri, 5 Jun 2015 13:37:57 +0000 (15:37 +0200)]
Bug 14343: Incorrect links to results pages in Receive Shipment List

Numbered links have incorrect url. Links to result pages
don't work in Receive Shipment List (but fortunately, Next
and Previous buttons work) It's because the booksellerid is
not furnished in the url.

Test Plan :
1) Go to Acquisitions module, enter a bookseller name that you
   know you can get many page of invoices for and search for it.

2) click on Receive shipment button.

3) On bottom of the first results page, click on page number 2
   link. (cf joined screencast)

You'll see that the results include invoices from other
booksellerid. Indeed, I suppose that you get results from all booksellerid.

Intall patch and redo 3 steps.

NOTE: I did not follow this test plan.
      I read the acqui/parcels.pl code.
      The template parameter numbers is assigned in a function which has
      no reference to booksellerid at all!
      Additionally, the booksellerid is set directly elsewhere.
      It is also strange that the booksellerid references before and after
      this loop do not use the numbers.booksellerid, but just booksellerid.
      The change from numbers.booksellerid to booksellerid is correct!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2dc5ae238ae0eb58040be4612cae641330b868ba)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoFixing the number of tests
Chris Cormack [Tue, 22 Sep 2015 03:02:33 +0000 (15:02 +1200)]
Fixing the number of tests

9 years agoBug 14649: Followup - correct budget_period_id in fund name link
Fridolin Somers [Thu, 6 Aug 2015 07:36:42 +0000 (09:36 +0200)]
Bug 14649: Followup - correct budget_period_id in fund name link

Now that fund name is displayed in the table as a link, you see that arg budget_period_id is never defined in this link.

This is because the template var is [% budget_line.budget_period_id %] instead of [% budget_period_id %].
This looks like a mistake when converting from tmpl to tt.

Test plan :
- Without patch
- Look for a planning with funds :
    /cgi-bin/koha/admin/aqplan.pl?budget_period_id=2&authcat=MONTHS
- Click on a fund name
=> You see in URL that budget_period_id is empty :
    /cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_id=6&budget_period_id=
- Apply patch
- Look for a planning with funds :
    /cgi-bin/koha/admin/aqplan.pl?budget_period_id=2&authcat=MONTHS
- Click on a fund name
=> you see in URL that budget_period_id is defined like in planning page :
    /cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_id=6&budget_period_id=2

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc4f7fe67577917df9ca4201257bea822832a3c4)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14649: Fix regression - display fund name on budget planning
Jonathan Druart [Thu, 6 Aug 2015 06:19:06 +0000 (07:19 +0100)]
Bug 14649: Fix regression - display fund name on budget planning

A patch from bug 11714 removes 'budget_name_indent', which was useless.
The script and the template should use the budget_name value.

Note that this patch impacts the CSV export, which does not work, so it cannot be
tested.

Test plan:
Edit a fund and click on one of the Planning value (by months, etc.)
The "Fund name" column should be correctly populated with the fund
names.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0ed9cbcf60a74dbe2690e6c34c5a311744f49ae)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14726: Checkout summary doesn't show title
Blou [Wed, 2 Sep 2015 13:59:45 +0000 (09:59 -0400)]
Bug 14726: Checkout summary doesn't show title

Right after checking out, a small box appear with "Checkout out: Some Title (32154001669305). Due on 24/09/2015".
The title doesn't appear anymore (since the move to db schemas). This fixes it.

Test:
1) checkout ANY item, for ANY user
2) Look at summary right below the checkout input box.  The title doesn't show up.
3) apply patch, reproduce same steps (after checkin if same item).  Title appears.

Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Todo: You need to track what are the queries generated here.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 658e787834784dec7d7782f45061b66e22211423)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14721: OAI-PMH must return error when no results
Fridolin Somers [Tue, 25 Aug 2015 09:33:04 +0000 (11:33 +0200)]
Bug 14721: OAI-PMH must return error when no results

When getting records from OAI-PMH, an error must be returned if there is no results.

See : http://www.openarchives.org/OAI/openarchivesprotocol.html#ErrorConditions

Test plan :
- Enable OAI webservice
- Perform a query that will return no results. ie : /cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml&from=2099-12-30&until=2099-12-31
=> Without patch you get a response with :
   <ListRecords/>
=> With patch you get a response with error code :
   <error code="noRecordsMatch">No records match the given criteria</error>
- Check a good query returns still results
- Same test with ListIdentifiers verb

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 64992a05ce87af7bf595c8d6f0b9d528887a2e44)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14766: unimarc_field_4XX: escape ', ", \n, \r
Julian Maurice [Fri, 4 Sep 2015 06:57:08 +0000 (08:57 +0200)]
Bug 14766: unimarc_field_4XX: escape ', ", \n, \r

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit abd71d017ea68f4209e41b34282e8fce8170e175)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14766: Complete cataloguing plugin unimarc_field_4XX
Paul Poulain [Wed, 26 Aug 2015 08:54:30 +0000 (10:54 +0200)]
Bug 14766: Complete cataloguing plugin unimarc_field_4XX

Add subfields l, n and o for better UNIMARC compliance

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Note: I just did a code audit here, as I don't know enough about
UNIMARC to know if the 4XX fields should have these subfields.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 503dd6036974b4208bd5cd60a87bb28599987f45)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14717: DBRev 3.21.00.023
Tomas Cohen Arazi [Mon, 7 Sep 2015 14:12:49 +0000 (11:12 -0300)]
Bug 14717: DBRev 3.21.00.023

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit db891d33f0bbe75748fd725036066f45c2e762fe)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Conflicts:
Koha.pm

9 years agoBug 14171: Update borrowers date fields
Jonathan Druart [Thu, 3 Sep 2015 15:07:42 +0000 (16:07 +0100)]
Bug 14171: Update borrowers date fields

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
http://bugs.koha-community.org/show_bug.cgi?id=14717

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 69994c38a00a1199b814d823c4e20503d86b28bf)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14717: Prevent 0000-00-00 on updating a patron
Jonathan Druart [Thu, 3 Sep 2015 15:03:17 +0000 (16:03 +0100)]
Bug 14717: Prevent 0000-00-00 on updating a patron

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7bad40dcc294d6d56c937cbd81267fc9df73b6aa)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Conflicts:
t/db_dependent/Members.t

9 years agoBug 14717: Invalid dates in debarred column
Chris Cormack [Mon, 24 Aug 2015 22:00:20 +0000 (10:00 +1200)]
Bug 14717: Invalid dates in debarred column

To test
1/ Import a patron using the patron import tool, make sure they have
no debarred column in the file
2/ Check the database, notice the debarred column is 0000-00-00
3/ For bonus points, checkout an item to that borrower, then check it in
notice Koha errors
4/ Apply patch
5/ Import a new patron
6/ Notice column is now NULL and that checkins work

Signed-off-by: Eugene Espinoza <eugenegf@yahoo.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d8a9d171154f3ad526f31968fdec1ad7809014b8)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 11273: FIX barcode generation in acquisition if hbyymmincr
Jonathan Druart [Tue, 14 Jul 2015 12:12:46 +0000 (13:12 +0100)]
Bug 11273: FIX barcode generation in acquisition if hbyymmincr

When AutoBarcode is activated and you have set AcqCreateItem to 'on
order' there is a Javascript error when you try to generate a barcode
for the item:

TypeError: document.f is undefined
http://localhost:8080/intranet-tmpl/lib/jquery/jquery.js
Line 11

Test plan:
0/ a. Set AutoBarcode to hbyymmincr
   b. Set AcqCreateItem to 'on ordering'
   c. Set the plugin barcode.pl to the barcode field for the default
   and the ACQ frameworks
1/ Go on the add items page (cataloguing/additem.pl) and confirm that
the plugin works as expected.
2/ Go on the New order page (acqui/neworderempty.pl) and confirm that
the plugin works as expected.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5b521eb394771ee305777f0b44098be5fdd11cc7)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14354: Prevent edition of items from other branches if IndependentBranches is on
Jonathan Druart [Tue, 14 Jul 2015 17:07:37 +0000 (18:07 +0100)]
Bug 14354: Prevent edition of items from other branches if IndependentBranches is on

If IdependentBranches is ON, to edit/delete items from other branches
you need to be superlibrarian.
Currently a "simple" staff user cannot edit them from the edit item page
but from the catalogue detail page.

The edit links should not be displayed on this table.

Test plan:
O/ Set IndependentBranches to "Prevent".
Create a record and add 2 items:
   Set homebranch to L1 for item I1.
   Set homebranch to L2 for item I2.
1/ With a superlibrarian user, you should be able to edit both items.
2/ With a "simple" user attached to L1, you should only be able to edit
I1. The edit links should not be displayed for I2.

Note that the checkbox is displayed on the catalogue detail page (item
list), but on the batch tools, it won't be possible to select non-modifiable
items.

TODO: Add a server-side check. Indeed it is still possible to edit an
item if the user know the url.

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bcab2416399e93f5ce9b1083395c052046d5d02a)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 12965: Prevent to erase an existing item type
Jonathan Druart [Fri, 10 Jul 2015 15:11:48 +0000 (16:11 +0100)]
Bug 12965: Prevent to erase an existing item type

On creating an item type, if it already exists, it will replace the
existing one.
This patch prevent that and display a message to the interface.

Note: The fields are lost.

Test plan:
1/ Create an item type 'AAA', description 'AAA'
2/ Edit it, update the description with 'BBB'
3/ Create an item type 'AAA' with a description 'CCC' => you should get
a warning "already exists".

Works well, no errors

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Warning message is triggered.
Adding, editing and deleting item types still works.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb12ee1e223b662cd1e89c0a56a5d1c083ba1ddc)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 12885: Fix if url contains +*... and HTML5 Media is enabled
Jonathan Druart [Wed, 15 Jul 2015 11:49:03 +0000 (12:49 +0100)]
Bug 12885: Fix if url contains +*... and HTML5 Media is enabled

The special regex chars are not escaped in C4::HTML5Media.

Test plan:
1/ Set 856$u=http://www.mrqe.com/lookup?talented+mr.+ripley
2/ Enable the pref HTML5Media
3/ Go on the detail page
It should not explode.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 085d766a0524e399d0c9c9e807d8c0acd0da6a19)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 13943: Prevent the deletion of items if the user cancels
Jonathan Druart [Mon, 13 Jul 2015 16:34:53 +0000 (17:34 +0100)]
Bug 13943: Prevent the deletion of items if the user cancels

On the edit items page, there is some weird JS code: if the user clicks
on the delete link and then cancel, the item is deleted anyway.

It's caused by the following JS code in browser.js
  $('a[href*="biblionumber="]').click(function (ev) {
      ev.preventDefault();
      window.location = $(this).attr('href') + '&searchid=' + me.searchid;
  });

Test plan:
- Do a search with multiple results
- Go to the detail page (make sure results browser shows up!)
- Use the "Edit items" link from the toolbar
- Delete an item (try both way)
- Choose "cancel"
- Delete an item (try both way) and confirm the deletion
You should see the browser after the deletion and the item should have
been deleted correctly.
- Edit an item (try both way)
You should see the browser (did not work before this patch)

Note: Before this patch, the 2 first columns didn't contain the
edit/delete item links, now it's only the 1st one.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Much better!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f7214859df15abfe874141bcc1a32b57067f7c54)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 11247: Improve tests
Jonathan Druart [Wed, 2 Sep 2015 14:07:07 +0000 (15:07 +0100)]
Bug 11247: Improve tests

This patch makes the tests non dependent on the DB and test the 3 marc
flavours.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6e0b61e2acea7c797c1da727474daf7d7a657574)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 11247: Add a simple unit test for TransformHtmlToXml
Marcel de Rooy [Wed, 26 Aug 2015 12:09:53 +0000 (14:09 +0200)]
Bug 11247: Add a simple unit test for TransformHtmlToXml

The unit test is db dependent (as Jonathan correctly remarked),
since the sub checks a preference.

Test plan:
Run t/db_dependent/Biblio/TransformHtmlToXml.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d1335a766d7b54c470701b0055fc99be2e7e7628)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 11247: Fix calls of TransformHtmlToXml
Srdjan [Thu, 14 Nov 2013 06:10:30 +0000 (19:10 +1300)]
Bug 11247: Fix calls of TransformHtmlToXml

The ind_tag of TransformHtmlToXml is unused.
Some calls to this function incorrectly revert indicator and ind_tag (which
is not a problem when both are empty..)

Patch of Srdjan Jankovic, amended and signed off by Marcel de Rooy.

The following calls are fixed:
call in acqui/addorder.pl: switched indicator with ind_tag
call in acqui/addorderiso2709.pl replaced too
acqui/finishreceive.pl replaced too

These calls are fine:
two calls in cataloguing/additem.pl are fine
call in serials/serials-edit.pl is fine
call in tools/batchMod.pl is fine

The folllow-up patch adds a simple unit test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
With AcqCreateItem=='placing an order', tested if adding an order still
worked (covered both addorder.pl and addorderiso2709.pl).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 22b41063981de608402d1dd87f6aa9e2010245dd)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14584: Encoding broken with system preferences
Jonathan Druart [Tue, 18 Aug 2015 17:40:31 +0000 (18:40 +0100)]
Bug 14584: Encoding broken with system preferences

The pref are double encoded.

From bug 12411:
"This will fix the encoding issues existing in 3.14 and 3.16.
The issue still appear in master but is fixed by bug 11944."

They should not have been pushed together.

Test plan:
1) You need an accentuated language installed.
2) Go to NoLoginInstructions pref, and add some accentuated message like
"Hélo médames é mècieüx"
3) refresh opac home page, message should be gibberish
4) apply patch.  Message should be ok now.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 813a047e236947a815c4be3c3dde38f19844b962)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14709: Do not access to C4::Context->userenv from the commandline
Jonathan Druart [Mon, 24 Aug 2015 09:07:37 +0000 (10:07 +0100)]
Bug 14709: Do not access to C4::Context->userenv from the commandline

The script dies with
  Can't use an undefined value as a HASH reference at tools/export.pl
line 149.
if it is called from the command line.

This is introduced by bug 13040.

The C4::Context->userenv is not defined in this case.

Test plan:
Execute the script using the command line.
With the patch applies you should not get the error.

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 6ad59e7ab45bbd2858f4cfad83d862688a48e49b)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14205: (RM followup) DBIx updates
Tomas Cohen Arazi [Wed, 2 Sep 2015 12:49:41 +0000 (09:49 -0300)]
Bug 14205: (RM followup) DBIx updates

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit ce2ea94f304b8e3a0c5fa6c967c2b864e5d0e7bc)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14205: DBRev 3.20.03.001
Tomas Cohen Arazi [Wed, 2 Sep 2015 12:45:35 +0000 (09:45 -0300)]
Bug 14205: DBRev 3.20.03.001

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 4e69b25e71fcb74ce3c2d3830deafdd1569fe361)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Conflicts:
Koha.pm

9 years agoBug 14205: Deleting an Item/Record does not remove link to course reserve
Jonathan Druart [Tue, 4 Aug 2015 09:00:51 +0000 (10:00 +0100)]
Bug 14205: Deleting an Item/Record does not remove link to course reserve

A constraint is missing on the course_reserves.ci_id field.
This patch adds it and removes orphan rows.

Test plan:
0/ Don't apply the patch
1/ Login to Staff Site.
2/ Go to Course Reserves
3/ Create Course
4/ Add Reserve
5/ Go to item added (delete item/record)
6/ Refresh Course (see no items attached)
7/ Delete Course
8/ See course still listed in the courses (Not deleted)
9/ Apply the patch and execute the updatedatabase entry.
10/ Delete the Course
Note that the course has correctly been removed.

NOTE: Make sure to set the UseCourseReserves system preference to test.
      Tested before (problem existed) and after (problem solved) update.
      Dropped DB, web installed, and put in dummy data and retested.
      Problem solved.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit fc568dfb22238a052d7772a0bba374f836543d46)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14685: Fix set guarantor for a child or professional accounts
Jonathan Druart [Tue, 18 Aug 2015 08:08:09 +0000 (09:08 +0100)]
Bug 14685: Fix set guarantor for a child or professional accounts

Bug 13970 removed some useful code to automatically set the guarantor
when creating a child.

But finally there is a better way to do the job, we just need to assume
that only children or professional can have a guarantor.

Test plan:
1/ Create an adult patron and add a child.
2/ The guarantor info should be retrieved and set on the child creation
page.
3/ Create an organization and add a child
4/ The guarantor info should be retrieved and set on the adult creation
page.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
This patch catches both cases, thanks Jonathan!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 438b62e8ffcbab3742ab9a48602a9653b1afde6f)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14703: Holidays description shows \r\n for every new line
Joonas Kylmälä [Tue, 25 Aug 2015 07:24:54 +0000 (07:24 +0000)]
Bug 14703: Holidays description shows \r\n for every new line

Adds a new line for the holiday's description instead of the string
\r\n.

Test plan:
1. In tools -> Calendar look at some holiday's description
   (Do a new holiday with description of multiple lines if
   there is not already)
2. Notice that there is characters \r\n if someone has put
   a newline in the holiday's description
3. Apply patch
4. See that the new lines show there now nicely

Sponsored-by: Vaara-kirjastot
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended slightly: no need to replace title.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa1311894906821e2b6bc9e4e3a831a855a20bca)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14737: wrong permissions required for cn_browser.pl plugin
Tomas Cohen Arazi [Thu, 27 Aug 2015 14:31:42 +0000 (11:31 -0300)]
Bug 14737: wrong permissions required for cn_browser.pl plugin

The cn_browser.pl cataloguing plugin only searches for used callnumbers
on the bibliographic database. There is no need for this plugin to
require special permissions besides access to the catalog.

To test:
- Link the cb_browser.pl cataloguing plugin to 952$o in your favourite cataloguing framework
- Login with a superlibrarian user
- Try the plugin
=> SUCCESS: you can use it
- Login with a user that has the full 'tools' permission
- Try the plugin
=> SUCCSES: you can use it
- Login with a user that doesn't have full 'tools' permission
  but has the normal catalogue and cataloguing permissions.
- Try the plugin
=> FAIL: you are requested to login with a different user
- Apply the patch
- Retry
=> SUCCESS: you can use it
- Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b348c07f969a5bd17f25e5ced681ad44aa351c0e)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14579: 'You are not logged in' should link to log in page
Joonas Kylmälä [Wed, 19 Aug 2015 11:00:27 +0000 (11:00 +0000)]
Bug 14579: 'You are not logged in' should link to log in page

To test:
1) Go to any page on the staff client and make sure you are not logged in (ie an error page, cgi-bin/koha/errors/400.pl)
2) Try click on 'You are not logged in |'
3) Notice it is not really a link and doesn't take you anywhere
4) Apply patch
5) Refresh page
6) Click on what now says 'Log in |'
7) Confirm that you are redirected to the intranet log in page

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 255d133acac24a675dca0106ede20359257d0701)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14634: Warns when placing hold on record with no items
Aleisha [Mon, 3 Aug 2015 02:23:29 +0000 (02:23 +0000)]
Bug 14634: Warns when placing hold on record with no items

To test:

1) Create a new record in Cataloguing
2) When done, instead of adding an item to the record, click on the Holds tab in the left nav
3) Notice warns
4) Apply patch and refresh page
5) Click on Holds tab again
6) Notice warns are gone and page still works

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Warns disappear; note that the display of the error message is still ugly.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4bb888281dec7de676fc6546746a88835a822c62)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 14361: koha-restart-zebra fails and probably breaks upgrade
Benjamin Rokseth [Mon, 8 Jun 2015 09:12:03 +0000 (11:12 +0200)]
Bug 14361: koha-restart-zebra fails and probably breaks upgrade

This patch fixes the koha-restart-zebra and koha-stop-zebra scripts
by adding pidfiles folder to the test is_zebra_running.
It also adds pidfiles to the test is_indexer_running so that
koha-rebuild-zebra will work properly.

Test plan:
1) check if zebrasrv is running, get pid of zebrasrv
   ps ax | grep zebrasrv
2) In my case, there was also a warning on the about.pl page on a fresh
   install: Error message from Zebra: 1011 (bad credentials)
3) try to restart zebra
   koha-restart-zebra instancename
   You will get a msg :
   Zebra does not appear to have been running for instancename
   Starting Zebra server for instancename
4) check again if zebrasrv is running
    ps ax | grep zebrasrv
   and see that pid has not changed, thus it is not restarted
5) Apply patch
6) repeat 4) and watch now how pid has changed
   If there was a warning on about.pl it should now be gone

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Good catch Benjamin! It works as expected with the patch.

(cherry picked from commit e09e7152b6af1f2cb3d2e78eff317cdf77cbf5f2)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoBug 12632: Hold limits ignored for record level holds with item level itemtypes
Kyle M Hall [Fri, 22 Aug 2014 17:29:28 +0000 (13:29 -0400)]
Bug 12632: Hold limits ignored for record level holds with item level itemtypes

The crux of the issue is that if you are using item level itemtypes, but
are allowing biblio levels holds, those holds do not have items.

So, in CanItemBeReserved, when Koha counts the number of holds to
compare against the given rule, it will always give 0 ( except of course
for found holds, and the occasional item-level hold ).

So the query is saying "link each of these reserves to the reserved
item, and count the number of reserves this patron where the itemtype is
DVD". However, since these are all record level reserves, there are no
items to link to, and so when it looks for all reserves this and item
whose itemtype is DVD, it finds zero reserves!

This patch solves the problem by looking first at the item level
itemtype, and if it does not exist, then it looks at the record
level itemtype. For installations using record level itemtypes, the
behavior remains unchanged.

Test plan:
1) Enable item level itemtypes
2) Create two records with one item each of a given itemtype
3) Create a single issuing rule and limit the holds allowed for that
   itemtype to 1
4) Place a record level hold on your first record
5) Attempt to place a record level hold for the same patron on your
   second record. You should not be able to but you can!
6) Apply this patch
7) Repeat step 5, note you can no longer place the hold!

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f95acd1a6cf5113992d28173dece96e8afc6cef)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
9 years agoFixing release notes v3.20.03
Chris Cormack [Sun, 23 Aug 2015 23:53:07 +0000 (11:53 +1200)]
Fixing release notes

9 years agoRelease notes for 3.20.3
Chris Cormack [Sun, 23 Aug 2015 23:42:58 +0000 (11:42 +1200)]
Release notes for 3.20.3

9 years agoUpdating version for 3.20.3 release
Chris Cormack [Sun, 23 Aug 2015 23:36:58 +0000 (11:36 +1200)]
Updating version for 3.20.3 release

9 years agoTranslation updates for Koha 3.20.3 release
Bernardo Gonzalez Kriegel [Sun, 23 Aug 2015 22:51:11 +0000 (19:51 -0300)]
Translation updates for Koha 3.20.3 release

9 years agoBug 14566: Fix permissions in patronimage.pl
Jonathan Druart [Wed, 19 Aug 2015 14:42:10 +0000 (15:42 +0100)]
Bug 14566: Fix permissions in patronimage.pl

There is no permission needed to access the patronimage.pl script.
This means anybody cans access to the patron's images.

Test plan:
Add an image to borrowernumber 42 and call
/cgi-bin/koha/members/patronimage.pl?borrowernumber=42

If you are logged in with borrowers permissions, you will see the image,
otherwise you will get a blank page with a 403 header.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14660: Fix 3 other cataloguing plugins
Jonathan Druart [Wed, 19 Aug 2015 08:12:04 +0000 (09:12 +0100)]
Bug 14660: Fix 3 other cataloguing plugins

These 3 should use C4::Output not to explode.

Test plan:
Link the plugins with the correct fields
They should not log an error when calling them

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 1dc947b18c86e4e07fe12d0b70c0f2a135b43080)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14660: Fix stocknumberam123.pl cataloguing plugin
Katrin Fischer [Thu, 6 Aug 2015 22:33:54 +0000 (00:33 +0200)]
Bug 14660: Fix stocknumberam123.pl cataloguing plugin

The cataloguing plugin stocknumberam123.pl is broken and no
longer generating numbers - this patch fixes it.

To test:
 - Link a subfield to the plugin - usually it's 952$i or the UNIMARC
   equivalent in your MARC frameworks
 - Create a new item, set the inventory number to: A 0000000002
 - Start to catalog another item, enter A into inventory and
 - Enter A as stocknumber and activate the plugin by clicking on
   ... at the end of the field
 - The number will not get added - Firebug shows an error:
   Undefined subroutine CGI::output_html_with_http_headers
 - Apply patch
 - Verify numbers are now generated and no errors are shown

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 85d27f6d9f310002f65dbc17b9c22e9976032cf8)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14660: Fix stocknumberAV.pl cataloguing plugin
Katrin Fischer [Thu, 6 Aug 2015 22:20:09 +0000 (00:20 +0200)]
Bug 14660: Fix stocknumberAV.pl cataloguing plugin

The cataloguing plugin stocknumberAV.pl is broken and no
longer generating numbers - this patch fixes it.

To test:
- Link a subfield to the plugin - usually it's 952$i or the UNIMARC
  equivalent in your MARC frameworks
- Set up a new authorised value INVENTORY, the code is an uppercase
  prefix - "B"
- The Descriptions is your starting number - 1
- The OPAC description remains empty
- Catalalog an item
- Enter B as stocknumber and activate the plugin by clicking on
  ... at the end of the field
- The number will not get added - Firebug shows an error:
  Undefined subroutine CGI::output_html_with_http_headers
- Apply patch
- Verify numbers are now generated and no errors are shown

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 5f227b42c183f961e83f537a9f84f13e32f4424e)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14644: unbreak SIP2 terminal login when using telnet transport
Galen Charlton [Tue, 4 Aug 2015 15:59:39 +0000 (15:59 +0000)]
Bug 14644: unbreak SIP2 terminal login when using telnet transport

This patch fixes breakage introduced by the patch for bug 13506
that prevented SIP2 clients from authenticating themselves over
the telnet transport. Attempts to do so would manifest by the
SIPServer backend crashing and the connection getting closed.

To test:

[1] Use the stock SIPServer config, etc/SIPconfig.xml, and ensure
    that the database contains a staff user whose username is 'term1'
    and password is 'term1' that has the circulate permission.
[2] Start SIPServer, telnet to port 8023, and attempt to log in.  The
    connection will be aborted:

    $ telnet localhost 8023
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    login: term1
    password: term1
    Connection closed by foreign host.

[3] Apply the patch and restart SIPSever, then repeat step 2.  This time,
    the login should succeed:

    $ telnet localhost 8023
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    login: term1
    password: term1
    Login OK.  Initiating SIP

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 3ec8b27185f0c8600bc931c5284a5d73d0a42aac)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14517: List shelves list is broken for translated interfaces
Jonathan Druart [Tue, 14 Jul 2015 15:26:36 +0000 (16:26 +0100)]
Bug 14517: List shelves list is broken for translated interfaces

The translation script adds quotes ("") around translated string (Edit
for instance).
Which breaks the json structure.

Example:
"dt_action": "<a style=\"cursor:pointer\"><form action='shelves.pl'
method='get'><input class="editshelf" value="Editar" type="submit"
/></form></a>"

Test plan:
1/ On the staff interface create a private list
2/ Go to More > Lists ('Your lists' tab)
3/ Translate the templates to any language like:
  $ cd misc/translator/
  $ perl translate install es-ES
4/ Enable the translated templates on the sysprefs
5/ Switch to the translated language
6/ Go to the lists page (Mas > Listas in es-ES)
The list should be displayed correctly.

Note: There is a limitation. If a translated string contains a simple
quote ('), it will also break the json.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 75c70d42a5df526c8bed8633d65721696a0fa176)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14592: Export data bad encoding
Frédéric Demians [Thu, 23 Jul 2015 07:47:15 +0000 (09:47 +0200)]
Bug 14592: Export data bad encoding

Tools > Export data produces a file badly encoded, when marc/xml file
format is chosen. It works with CSV.

To test:

1. Tools > Export data
2. Choose a limited interval of biblionumber
3. Export in marc/xml/csv.
4. Check files exported at 3: csv file is ok. marc/xml files are
   corrupted, ie badly encoded.
5. Apply the patch
6. Repeat steps 3&4, and confirm that all file formats are valid.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dfe07fa410eb48241c218abcc156c466576dcc9a)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14534: Stop overdue_notices.pl from issuing the warning: Use of uninitialized...
Ulrich Kleiber [Wed, 15 Jul 2015 06:35:13 +0000 (08:35 +0200)]
Bug 14534: Stop overdue_notices.pl from issuing the warning: Use of uninitialized value $borrowernumber

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
To test:

1/ Run the overdue_notices.pl script (don't do this on production
obviously :))
2/ Notice the warns
3/ Apply patch
4/ Run again
5/ Notice no warns, but notices are still generated ok

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit d873ed3b5d97f825c52dc53c2f72bd5a1ef03647)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 13663: (followup) fixes tab char QA test fails
Indranil Das Gupta [Sun, 14 Jun 2015 09:22:04 +0000 (14:52 +0530)]
Bug 13663: (followup) fixes tab char QA test fails

Fixes the tab char qa test suite fails in the following files:

1/ tools/upload-file-progress.pl
2/ tools/upload-file.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: tidy whitespaces
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit fb17640c032f0ba0d6594076a71b8b37fda8b373)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 13663: Fix permissions in upload-file.pl and upload-file-progress.pl
Alex Arnaud [Thu, 11 Jun 2015 08:55:35 +0000 (10:55 +0200)]
Bug 13663: Fix permissions in upload-file.pl and upload-file-progress.pl

Test plan:
Verify that the circulate_remaining_permissions perm is enough to upload
.koc file.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 2fcc02321f0f56760cfdbd67a29917e4f0ba278b)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14548: Typo in help file for 3.20 (batch_record_modification.tt)
Hector Castro [Thu, 16 Jul 2015 21:40:14 +0000 (15:40 -0600)]
Bug 14548: Typo in help file for 3.20 (batch_record_modification.tt)

Typo found in batch_record_modification.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/batch_record_modification.tt:20' and check the typo "critera" or go to Tools › Batch record modification, open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 605638243aa6d3db8784f54a4687a850646f6f54)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14547: Typo in help file for 3.20 (basket.tt)
Hector Castro [Thu, 16 Jul 2015 20:35:52 +0000 (14:35 -0600)]
Bug 14547: Typo in help file for 3.20 (basket.tt)

Typo found in basket.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt:24' and check the typo "susbscription" or go to Acqusitions > create or view an existing basket, open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b7e40ce3fba6a6bcfbb6694bf5875a315b3f6e53)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 10961: (followup) Make query fields explicit and add regression tests
Stéphane Delaune [Thu, 23 Jul 2015 14:28:57 +0000 (16:28 +0200)]
Bug 10961: (followup) Make query fields explicit and add regression tests

add correct frameworkcode to _koha_marc_update_bib_ids parameters

add test, prove with : prove t/db_dependent/Biblio.t

TEST PLAN
---------
1) git checkout -b bug_10961 origin/master
2) git bz apply 10961
3) git checkout origin/master -- C4/Biblio.pm
4) prove t/db_dependent/Biblio.t
   -- was expecting failure, got failure.
5) git reset --hard origin/master
6) git bz apply 10961
7) prove t/db_dependent/Biblio.t
   -- success as expected.
8) Read over code.
   -- Noted it also grabs the framework code for the biblio, rather than uses default.
      And it also corrects an indentation issue.
      Test case looks like it attempts to cover the biblionumber!=biblioitemnumber case
      by adding 1.
9) run koha qa test tools.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 62dc6b0ca15a9de99a1cb41809e6c9c016e6b0d0)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 10961: Error in GetMarcBiblio can cause severe data loss
Kyle M Hall [Fri, 27 Sep 2013 16:53:39 +0000 (12:53 -0400)]
Bug 10961: Error in GetMarcBiblio can cause severe data loss

A bug in GetMarcBiblio can cause severe data loss if your database has
records where the biblionumber and biblioitemnumber do not match and the
script misc/batchRebuildBiblioTables.pl is run.

The Biblio::GetMarcBiblio makes a kall to
C4::Biblio::_koha_marc_update_bib_ids which passes the biblionumber as
both the biblionumber *and the biblioitemnumber*.

Thus, if your biblio and biblioitem numbers are not always equal, you
will end up with a record where the biblioitemnumber is incorrect in the
record!

This is usually not a severe issue, but since batchRebuildBiblioTables
uses that record to update the database tables, it ends up updating the
wrong biblioitem row!

NOTE: What a horrible, horrible typo that was. Tested this with the
      second patch.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 298c4c76a5f231d9cc0935b6f14a5f191b727804)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14487: Noise best detected under Debian 8
Mark Tompsett [Fri, 3 Jul 2015 22:04:04 +0000 (18:04 -0400)]
Bug 14487: Noise best detected under Debian 8

The first error is caused by the fact that
$messages->{'IsPermanent'} is undefined.

The second error is caused by querying the CGI
parameter 'barcode' inside a function call. This is not required.
There is a variable $barcode set with the parameter. Changed to
use the variable.

TEST PLAN
----------
1) Test first patch.
2) Clear the log
3) Put in a barcode which is not checked out.
4) Check the log.
   -- should be two errors. One about a hash,
      the other will only be detectable under Debian 8.
5) Apply this second patch
6) Clear the log
7) Put in a barcode which is not checked out.
8) Check the log.
   -- should be empty.
9) run koha qa test tools

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit beef8534724900e5777fc7b6d163763712decb1f)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14487: silence warns during checkin
Indranil Das Gupta [Fri, 3 Jul 2015 08:03:06 +0000 (13:33 +0530)]
Bug 14487: silence warns during checkin

Test plan
=========

1/ check out an item and then check it back in.
1/ check the logs after the check-in to see the warns from
   returns.pl line 623 of :
    (a) Use of uninitialized value $holdingBranch
    (b) Use of uninitialized value $collectionBranch
2/ apply patch
3/ check out and check-in again. no warns are recorded this time.

NOTE: Under Debian Jessie, there are other messages.
      Additionally, this only corrects the line 623 ones.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 0d632a606f499c31afb8a08f81625c4dfbddb445)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14387: Merge reference selection has no effect when merging authorities.
mxbeaulieu [Mon, 15 Jun 2015 15:05:51 +0000 (11:05 -0400)]
Bug 14387: Merge reference selection has no effect when merging authorities.

This patch swaps the authority records according to the refenrece record selection.

To TEST:
Merge two authority records, select the second as merge reference.
The reference authority is always the first.

Apply the patch.
Repeat previous steps, the authority is now merged using the selected reference record.

modified:   authorities/merge.pl

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ee7666a5fdd1b04f1bf50aa89900488e1a01402b)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 11693: Default emailing preferences not loaded for self registering patron
Marcel de Rooy [Sun, 5 Jul 2015 11:17:02 +0000 (13:17 +0200)]
Bug 11693: Default emailing preferences not loaded for self registering patron

The call to AddMember_Opac does not take care of the messaging prefs
when enhanced messaging is enabled.
This patch adds the call to handle_form_action to do that.

Test plan:
Enable self registering patrons and enhanced messaging.
Check the (default) message prefs for the relevant patron category. At least
enable email for one notice.
Self-register a user with and without verification email enabled.
Check in both cases that the message prefs of the user conform to
those in the patron category. (So at least one enabled.)

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f7ed250d618c57a3fc00728bbb93460b25ceda52)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 8684: Add regression tests for SearchItemsByField
Jonathan Druart [Mon, 13 Apr 2015 08:12:03 +0000 (10:12 +0200)]
Bug 8684: Add regression tests for SearchItemsByField

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2eded5f165eb1cc175bc61a93c1b5b7c8f5ac02f)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 8684: Fix duplicate check on creating items in the acquisition module
Jonathan Druart [Tue, 7 Apr 2015 12:14:18 +0000 (14:14 +0200)]
Bug 8684: Fix duplicate check on creating items in the acquisition module

The script acqui/check_uniqueness.pl has been introduced by bug 7178.
But bug 11425 added a call to a new subroutine SearchItemsByField in
order to refactore some code. This subroutine calls SearchItems with an
arrayref, which is not what SearchItems is expecting.
This broke the duplicate check done on creating items in the acquisition
module.

To reproduce the issue:
1/ Fill the pref UniqueItemFields with "barcode" and AcqCreateItem with
"placing an order"
2/ Create a new basket
3/ Create a new order
4/ Close the basket
5/ Receive items and set barcode with one already in your DB
6/ Save
7/ Nothing happen on the interface, but an error should have been added
in your Koha log file:
  Can't use an undefined value as an ARRAY reference at
  /home/koha/src/acqui/check_uniqueness.pl line 48.

Test plan:
1/ Repeat steps 1-6
2/ You should see a warning on the interface

Note that this should also happen with AcqCreateItem set to "creating an
order".

Works well, no errors.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa5104a6a1c7e3b0bcb232e4d888066dd20eebe8)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields
Jacek Ablewicz [Wed, 24 Jun 2015 17:43:05 +0000 (19:43 +0200)]
Bug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields

If the system preference IncludeSeeFromInSearches is enabled, records
exported for zebra indexing are being additionally processed by
EmbedSeeFromHeadings record filter (right now used only in rebuild_zebra.pl
script). This filter embeds 'see from' fields (extracted from authority
records linked with the given biblio via $9 subfields) into target MARC
record, which is then subsequently indexed in zebra.

Currently all fields containing $9 are getting the same exact treatment
by this filter. But on the export stage when the filter is applied, MARC
record being processed already does have holdings data fields added in
the previous stage (usually 952 / 995, depending on the MARC format).
Problem is that holdings data fields use to have $9 subfields in them
as well (mapped to item.itemnumber by default). As a consequence, some
(great many in the typical setup) records exported for zebra indexing
may have surplus "see from" fields added erroneously in semi-random
fashion, so biblio searches would often return some completely
unexpected additional results.

EmbedSeeFromHeadings record filter should not process holdings fields
when dealing with MARC records intended for zebra indexing.

To reproduce:

1) database with as many sample or real-world biblio, item and authority
records as possible is recommended for testing purposes
2) enable IncludeSeeFromInSearches
3) export a bunch of biblio records for zebra (e.g.:
misc/migration_tools/rebuild_zebra.pl -I -b -x -k -length=1000),
inspect the result xml records in /tmp/<whatever> file; observe that at
the end of many records, here and there some extra "see from" (= 1st
indicator: 'z') fields tend to appear, which shouldn't be there ;)

To test:

4) apply patch
5) redo 3)
6) compare results from 3) and 5) with diff

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I introduced a regression test for this. You should run the tests
without/with the patch and verify that the patch actually fixes the problem.
Good job Jacek! I'm sure writing the regression test would take less time
than such a detailed commit message!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3a8b7a0e1e1bf112628c6215105ab80f25ed94f)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings
Tomas Cohen Arazi [Wed, 22 Jul 2015 14:22:20 +0000 (11:22 -0300)]
Bug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings

This patch introduces a regression test for the situation in which
an itemnumber on a record matches the authid of an authority record
and the current implementation of the EmbedSeeFromHeadings filter
wrongly includes new holding fields with authority data...

To test:
- Apply the patch
- Run:
  $ prove t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t
=> FAIL: The test 'Holdings fields not processed to introduce See-from heading'
   fails.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5e1474836024a9ccd1a9fb4eef91641fba6f8598)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14545: Typo in help file (stage-marc-import.tt)
Hector Castro [Fri, 17 Jul 2015 19:42:38 +0000 (13:42 -0600)]
Bug 14545: Typo in help file (stage-marc-import.tt)

Typo found in stage-marc-import.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/stage-marc-import.tt:28' and check the typo "precendence" or go to Tools > Stage MARC records for import and open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa54a6f04d5e84f8747d268efc2e0e1d175a1ecb)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14569: Typo borroewr|borow
Marcel de Rooy [Mon, 20 Jul 2015 09:38:56 +0000 (11:38 +0200)]
Bug 14569: Typo borroewr|borow

Trivial correction. Only touches comments.

Test plan:
Run git grep -E "borroewr|borow". You should not find anything now.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Typos in comments corrected.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d4e7e4e525fc99cb4452de135e161a0e0866753)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14404: Rename class no-show to noshow for consistency with nosort
Jonathan Druart [Thu, 9 Jul 2015 09:31:07 +0000 (10:31 +0100)]
Bug 14404: Rename class no-show to noshow for consistency with nosort

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 0183cc0223678f6b3f0885213c7223ddb31acf5d)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14404: Checkouts default sort order for Self Checkout (SCO) confusing for patrons
Kyle M Hall [Tue, 16 Jun 2015 23:05:10 +0000 (19:05 -0400)]
Bug 14404: Checkouts default sort order for Self Checkout (SCO) confusing for patrons

Libraries are reporting that patrons are very confused during
self-checkout. The problem is they are expecting the list of checkouts
to be in the order they checked out the items ( first checkout on the
bottom, last item checked out on top ). However, the checkouts
table is sorted by title ( ascending ) then due date ( descending ).
This is not intuitive.

Test Plan:
1) Enable Koha's self checkout
2) Use the SCO to check out a random assortment of items,
   make sure you don't check them out in alphabetical order
3) Note the order of the items in the list is not based on the order
   you checked them out in
4) Apply this patch
5) Refresh the page
6) Note the items are now in the order you checked them out
   with the last on top and the first on bottom

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit e9061028c1ba95b310be5e9333b224e735e64f40)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14445: Silences warns in letter.tt
Aleisha [Wed, 1 Jul 2015 01:36:00 +0000 (01:36 +0000)]
Bug 14445: Silences warns in letter.tt

When creating a new notice, warn is triggered "Argument "" isn't numeric in numeric gt (>) at line 400". Same warn is triggered when changing Koha module option to any other module.

To test:
1) Go to Tools, then Notices & Slips
2) Click 'new notice'. Notice warn in intranet-error.log
3) Change Koha module to another module. Notice warn is triggered for every change
4) Apply patch and reload page
5) Change Koha module to another module. Notice there are no longer warns
6) Go back to Notices & Slips and click 'new notice' again. Notice there are no warns

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 7098a36b19c35a06a51361bd381416a1204de38d)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14445: Silences warn in letter.pl
Aleisha [Wed, 24 Jun 2015 01:15:32 +0000 (01:15 +0000)]
Bug 14445: Silences warn in letter.pl

When changing Koha module to 'Circulation', there is a warn saying that $code is uninitialized. This patch sets $code to an empty string to silence the warn.

To test:
1) Go to Tools, the Notices & Slips
2) Click 'new notice' (This will trigger warns, but ignore these as they will be corrected in the next patch)
3) Change Koha module to 'Circulation'
4) Notice warn about uninitialized $code variable
5) Apply patch and reload page, change Koha module to 'Circulation'
6) Notice page still works and warns are gone

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit fe3a49e61133e1e66d0075f3300cd3a99e691890)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
9 years agoBug 14494: Add some unit tests too for CalcDateDue
Marcel de Rooy [Thu, 9 Jul 2015 13:35:53 +0000 (15:35 +0200)]
Bug 14494: Add some unit tests too for CalcDateDue

The second patch of this report made some changes to CalcDateDue.
We are adding some unit tests here.
See the commments on the third patch too.

Test plan:
Run t/db_dependent/Circulation_dateexpiry.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Set the number of tests for the second subtest (was
commented) and perltidy the second block.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 1a8962f306d2d2f0c7789c649aa615192ccd5ca1)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>