koha.git
8 years agoBug 15699 - Course reserves instructors should be in form "Surname, Firstname" for...
Nick Clemens [Thu, 28 Jan 2016 21:58:37 +0000 (21:58 +0000)]
Bug 15699 - Course reserves instructors should be in form "Surname, Firstname" for sorting purposes

This patch changes the order of the name fields and adds a span class around
each in case of library wanting to customize further

To test:
1 - Enable course reserves
2 - Add some courses with instrcutors
3 - Note they are of form "Firstname Surname"
4 - Apply patch
5 - Note the change
6 - Note span tags
7 - Note you can hide firstname by adding to intranet user js: $(".instr_firstname, instr_separator").hide();

Sing-off note: This patch displays the names as advertised on cgi-bin/koha/opac-course-reserves.pl Sorting
the names would need some more actions but seems not to be intended by this patch.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15719: Silence warning in C4/Language.pm during web install
Mark Tompsett [Mon, 1 Feb 2016 23:12:44 +0000 (18:12 -0500)]
Bug 15719: Silence warning in C4/Language.pm during web install

This problem was discovered the hard way:
- Drop DB
- Create DB
- Webinstaller run until the screen is:
We are ready to do some basic configuration.
Please install basic configuration settings to continue the installation.
-- The error log file will end with an error about splitting
   an uninitialized value.

TEST PLAN
---------
0) First patch already applied
1) prove -v t/Languages.t
   -- success, but warn prints
2) Apply this patch
3) prove -v t/Languages.t
   -- success without warning messages
4) run koha qa test tools

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. QA test tools run OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15719: Silence warning in C4/Language.pm during web install - tests
Mark Tompsett [Mon, 1 Feb 2016 23:26:41 +0000 (18:26 -0500)]
Bug 15719: Silence warning in C4/Language.pm during web install - tests

Test empty database case.

TEST PLAN
---------
1) prove -v t/Languages.t
   -- success (because test case is missing)
2) Apply this patch
3) prove -v t/Languages.t
   -- success, but warning printed.
4) run koha qa test tools

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. QA test tools rus OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15743: Allow plugins to embed Perl modules
Julian Maurice [Thu, 4 Feb 2016 16:42:42 +0000 (17:42 +0100)]
Bug 15743: Allow plugins to embed Perl modules

This patch allows plugins to embed Perl modules by ignoring Perl modules
in plugins directory that don't inherit from Koha::Plugins::Base

TEST PLAN
---------
1) Edit koha-conf.xml to have enable_plugins set to 1, and
   the pluginsdir set to a particular path.
2) Create a dummy plugin file. (e.g. {that path}/Koha/Plugin/Kaboom.pm)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15747: Do not use CGI->param in list context - Auth.pm
Jonathan Druart [Fri, 12 Feb 2016 11:47:22 +0000 (11:47 +0000)]
Bug 15747: Do not use CGI->param in list context - Auth.pm

Test plan:
Log you in!
Without this patch applied, you will get a warning
"Fetching the value or values of a single named parameter"
With this patch applied, the warning from C4::Auth line 401 should not
appear anymore in the log file.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Note: no warnings for older CGI versions.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15777 - Refactor and fix the RecordProcessor class
Mark Tompsett [Fri, 12 Feb 2016 04:30:36 +0000 (23:30 -0500)]
Bug 15777 - Refactor and fix the RecordProcessor class

TEST PLAN
---------
1) Apply all three patches
2) prove -v t/RecordProcessor.t
   -- all should be successful
3) run koha qa test tools

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15777 - Fix base class to prove refactor and fix required
Mark Tompsett [Fri, 12 Feb 2016 04:23:27 +0000 (23:23 -0500)]
Bug 15777 - Fix base class to prove refactor and fix required

TEST PLAN
---------
1) Apply the testing patch and this patch
2) prove -v t/RecordProcess.t
   -- will complain about string use with "use strict".
      This is because it is using the module name, instead
      of the object instantiated with new().
3) run koha qa test tools.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15777 - Test to prove initialization isn't working correctly.
Mark Tompsett [Wed, 10 Feb 2016 16:18:40 +0000 (11:18 -0500)]
Bug 15777 - Test to prove initialization isn't working correctly.

TEST PLAN
---------
1) Apply this testing patch
2) prove -v t/RecordProcessor.t
   -- tests will fail.
3) run koha qa test tools

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15784: Library deletion warning is incorrectly styled
Owen Leonard [Wed, 3 Feb 2016 13:40:20 +0000 (08:40 -0500)]
Bug 15784: Library deletion warning is incorrectly styled

When deleting a library in Administration ->  Libraries and groups, the
deletion confirmation message is not styled with the standard "dialog
alert" <div>. This patch modifies the confirmation markup to match the
standard.

Revised to include Font Awesome icons. Depends on Bug 15785.

To test, apply the patch and go to Administration -> Libraries and
groups.

- Try deleting a library. The confirmation box should have the standard
  "dialog alert" class.
- Test the 'confirm' and 'cancel' actions and make sure both complete
  correctly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Buttons display 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: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15808 - Remove "Return to where you were before" from sysprefs
Marc Véron [Fri, 12 Feb 2016 09:19:00 +0000 (10:19 +0100)]
Bug 15808 - Remove "Return to where you were before" from sysprefs

This patch removes the link 'return to where you were before' from
syspref search result page after failing search.

To test:
- Apply patch
- Go to System preferences in staff client, do a search
  with something that does not exist
- Verify that a message pops up that does not contain the link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15811: follow-up Bug 4912: Redirect to the appropriate view after editing/deletin...
Jonathan Druart [Fri, 12 Feb 2016 15:26:49 +0000 (15:26 +0000)]
Bug 15811: follow-up Bug 4912: Redirect to the appropriate view after editing/deleting a list

Test plan:
1/ At the opac, go on the the list home page (opac-shelves.pl)
2/ Click on 'new list', create a list and save
=> You should be redirect to the list
3/ Click on edit, save
=> You should be redirect to the list
4/ Delete the list
=> You should be redirect to the list
5/ Edit a list from the list view, save
=> You should be redirect to the list
6/ Click on a list link (op=view)
7/ Edit the list, save
=> You should be redirect to the 'show' view
8/ Delete list
=> You should be redirect to the list

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15843: Move MARC subfields structure JavaScript into separate file
Owen Leonard [Wed, 17 Feb 2016 14:33:28 +0000 (09:33 -0500)]
Bug 15843: Move MARC subfields structure JavaScript into separate file

The JavaScript embedded in the MARC subfields structure template is not
dependent on template processing and can safely be moved to a separate
file. This patch does so. Removed in the process is some lines which
were commented out.

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

 - Click 'MARC structure' for a framework you can edit.
 - Click 'subfields' for a tag you can edit.
 - Click 'Edit' for a subfield you can edit.
 - Confirm that tabs and accordian sections work correctly.
 - Make changes under Advanced constraints -> Visibility and confirm
   that they are saved correctly.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15844 - Correct JSHint errors in staff-global.js
Owen Leonard [Wed, 17 Feb 2016 14:54:28 +0000 (09:54 -0500)]
Bug 15844 - Correct JSHint errors in staff-global.js

This patch corrects minor errors in staff-global.js according to
warnings raised by JSHint.

To test, apply the patch and run JSHint on staff-global.js. No warnings
should be raised.

To confirm that the behavior of the JS is not changed, clear your
browser cache if necessary and:

- Confirm that the "Help" link opens the help window.
- Confirm that audio alerts work with local and remote sound files
- Confirm that the format() method is still working correctly by, for
  instance, opening the detail page for a bibliographic record with
  multiple items and choosing 'Edit -> Delete record' from the menu. The
  error message should read like "2 item(s) are attached to this
  record..."

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. No errors with JSHint CLI (6 errors fixed)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15847: Correct JSHint errors in basket.js in the staff client
Owen Leonard [Wed, 17 Feb 2016 17:17:17 +0000 (12:17 -0500)]
Bug 15847: Correct JSHint errors in basket.js in the staff client

This patch corrects minor errors in the staff client's basket.js
according to warnings raised by JSHint.

To test, apply the patch and run JSHint on basket.js. No warnings
should be raised.

To confirm that the behavior of the JS is not changed, clear your
browser cache if necessary and:

- Test adding multiple titles to the Cart from staff client search
  results.
- Confirm that adding titles to the Cart triggers a message by the Cart
  link.
- Test clicking the "Cart" link in the header menu when the Cart popup
  is open but behind the main window.
- Testing emptying the Cart.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. No warnigns raised with jshint tool

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 12549: (QA followup) missing newline in CLI dialog
Tomas Cohen Arazi [Tue, 16 Feb 2016 13:17:34 +0000 (10:17 -0300)]
Bug 12549: (QA followup) missing newline in CLI dialog

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 12549: Hard coded font Paths ( DejaVu ) cause problems for non-Debian systems
Nicholas van Oudtshoorn [Tue, 22 Dec 2015 04:25:47 +0000 (12:25 +0800)]
Bug 12549: Hard coded font Paths ( DejaVu ) cause problems for non-Debian systems

Allows for selection of DejaVu font path when installing from the command line. This
is useful for non-debian distributions that don't store the fonts in the same place.

Adds a new configuration variable to Makefile.PL: FONT_DIR

Defaults to the Debian install location for the fonts.

Test plan:
1. Run a CLI install, accepting the defaults.
2. Compare the generated koha-conf.xml to a
previous install - the font path for DejaVu fonts should be the same.
3. Run another CLI install, this time choosing a custom path for the fonts
4. Check that the path selected is reflected in the koha-conf.xml file.

NOTE: 'perl Makefile.pl' and 'make' generates blib/KOHA_CONF_DIR/koha-conf.xml
      ran with a weird string for the font dir
      copied that koha-conf.xml to my home dir
      reran with all defaults
      compared the two, and only the font paths differed.
      Also, I cleaned up the tabs that snuck in. :)

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 14244: Does not display patron's info in the checkout history if not authorised
Jonathan Druart [Mon, 25 Jan 2016 10:31:34 +0000 (10:31 +0000)]
Bug 14244: Does not display patron's info in the checkout history if not authorised

The librarian needs CAN_user_circulate_circulate_remaining_permissions
to see the checkouts patron's information.

Test plan:
The "Patron" column of the checkout history page should only be
displayed of you have the circulate > circulate_remaining_permissions
permission.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 14244: viewing a bib item's circ history requires circulation permissions
Thomas Misilo [Wed, 16 Sep 2015 17:43:28 +0000 (13:43 -0400)]
Bug 14244: viewing a bib item's circ history requires circulation permissions

On issuehistory.pl you have:

 flagsrequired   => { circulate => "circulate_remaining_permissions" },

But that really doesn't make sense. People should be able to view the history of circulation without having permission to circulate items themselves

This patch changes the required permissions from circulate to catalogue.

Test Plan:
1. Login as user without the circulate_remaining_permissions
2. Attempt to view Circulation History of an Item
3. Does not work
4. Apply Patch
5. Attempt to view circulation history with a user that has access to the staff side.
6. Can view circulation history now

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 14507 [QA Followup] - Restore comment, tidy sub
Kyle M Hall [Fri, 19 Feb 2016 12:51:21 +0000 (12:51 +0000)]
Bug 14507 [QA Followup] - Restore comment, tidy sub

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 14507 Use checkpw to check password in Patron Info
Colin Campbell [Wed, 5 Aug 2015 11:55:41 +0000 (12:55 +0100)]
Bug 14507 Use checkpw to check password in Patron Info

Some devices are using patron information responses to validate
patron passwords to govern access to facilities as we
were using C4::Auth::checkpw_hash this only worked in a db password
context not other authentication routines.
The C4::Auth routines are not very consistent and there isnt a dropin
replacement for checkpw_hash this calls checkpw instead.
In a password only environment this behaves as the old version did
returning field CQ as Y if a valid password or no password is passed in
the patron info request and N if an incorrect password is supplied
It should also test against the appropriate authentication sources if
othere autrhentication schemes are in use

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tested this with a client who reports that this enables SIP authentication to work correctly with their LDAP server.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 14930 [QA Followup] - Allow OpacFineNoRenewals to be 0
Kyle M Hall [Thu, 28 Jan 2016 23:09:43 +0000 (23:09 +0000)]
Bug 14930 [QA Followup] - Allow OpacFineNoRenewals to be 0

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: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 14930 - Leaving OpacFineNoRenewals blank blocks renewals, but should disable...
Gus [Tue, 19 Jan 2016 03:12:48 +0000 (03:12 +0000)]
Bug 14930 - Leaving OpacFineNoRenewals blank blocks renewals, but should disable feature

To Test
- Borrower has some fines and checkouts
- Leave OPACFineNoRenewals empty/blank
- Try to renew items in the OPAC
- notice error message
- Add a big value to OpacFineNoRenewals
- notice renewals work

Leaving the OPACFineNoRenewals empty will disable the feature.

Patch works as expected.(Amended to format the commit message and to
remove a warn on line 112 / MV)
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15285: Fix conflict with the treetable plugin
Jonathan Druart [Fri, 15 Jan 2016 10:01:54 +0000 (10:01 +0000)]
Bug 15285: Fix conflict with the treetable plugin

The tables using the treetable plugin don't display correctly (with JS
error).
The lazy way to fix it is to redefine the dom of the table and remove
the button area (B).

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15285: Update for 3 specific tables
Jonathan Druart [Mon, 14 Dec 2015 12:18:33 +0000 (12:18 +0000)]
Bug 15285: Update for 3 specific tables

The checkouts, currency and items lost tables redefine the dom/sDom and
the older C(olvis) should be replaced with the current B(utton).

Test plan:
To test the whole patch set, you will have to test the 4 tables impacted
by this patch as well as the others using the columns settings.

The additem has specific code and should be tested keeping that in mind.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15285: Update common files
Jonathan Druart [Mon, 14 Dec 2015 12:17:43 +0000 (12:17 +0000)]
Bug 15285: Update common files

This patch moves the Button area all tables which does not redefine the
dom/sDom DT parameter.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15285: Upgrade DataTables to 1.10.10
Jonathan Druart [Mon, 14 Dec 2015 12:15:58 +0000 (12:15 +0000)]
Bug 15285: Upgrade DataTables to 1.10.10

The ColVis DataTables plugin is now retired.
We need to upgrade the plugin to 1.10.10 and use the column visibility
module for Buttons.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15306: Do not display the translate link if only 1 language is installed
Jonathan Druart [Thu, 7 Jan 2016 12:34:54 +0000 (12:34 +0000)]
Bug 15306: Do not display the translate link if only 1 language is installed

It doesn't make sense to offer the option to translate an item type
description into another language if there is only one language
installed.

Test plan:
Generates templates for only 1 language
Edit an item type and confirm that the link "translate into..." is not
displayed.
Generates templates for another language
Confirm that the link is now displayed.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15479 [QA Followup] - Tidy sub to remove tabs causing qa script to fail
Kyle M Hall [Thu, 11 Feb 2016 04:29:55 +0000 (04:29 +0000)]
Bug 15479 [QA Followup] - Tidy sub to remove tabs causing qa script to fail

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15479 Add tests for ILS.pm
Colin Campbell [Thu, 21 Jan 2016 11:30:31 +0000 (11:30 +0000)]
Bug 15479 Add tests for ILS.pm

This patch specifically adds a test for the sub added to
resolve Bug 15479. As no test script existed to add this two
added one which also tests that ILS objects can be instantiated
correctly and offer the required interface

NOTE: This does not apply without the first patch.
      Comment #3 suggested a unit test that would fail
      before and pass after. So while this code is good,
      it missed the before case. -- mtompset

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15479 Make ILS cardnumber comparison case insensitive
Colin Campbell [Wed, 6 Jan 2016 12:56:24 +0000 (12:56 +0000)]
Bug 15479 Make ILS cardnumber comparison case insensitive

The borrowers table is defined COLLATE=utf8_unicode_ci which means
that cardnumbers may be saved in either lowercase or uppercase and
these are considered equivalent.
The server was performing a case sensitive comparison between
the incoming patron identifier and that retrieved from the db
As a result some renewals were rejected as being on loan to
another borrower if the stored cardnumber differed in case.

Make code comparison comply with db.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15514: Fix error with certain repeatable fields in Rancor
Jesse Weaver [Wed, 27 Jan 2016 23:39:22 +0000 (16:39 -0700)]
Bug 15514: Fix error with certain repeatable fields in Rancor

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoDBRev for Bug 15517 - Tables borrowers and deletedborrowers differ again
Brendan Gallagher [Tue, 23 Feb 2016 23:13:08 +0000 (23:13 +0000)]
DBRev for Bug 15517 - Tables borrowers and deletedborrowers differ again

8 years agoBug 15517: Change wording for tests
Jonathan Druart [Mon, 11 Jan 2016 08:35:11 +0000 (08:35 +0000)]
Bug 15517: Change wording for tests

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15517: deleted* tables won't never differ anymore!
Jonathan Druart [Thu, 7 Jan 2016 15:26:15 +0000 (15:26 +0000)]
Bug 15517: deleted* tables won't never differ anymore!

These tests will ensure that the 4 deleted* tables won't never differ
anymore.

Test plan:
0/ Do not execute the update DB entry
1/ prove t/db_dependent/db_structure.t
should fail
2/ Execute the update DB entry and update the schema with
misc/devel/update_dbix_class_files.pl
3/ prove t/db_dependent/db_structure.t
should now be happy

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Test pass successfuly. Works as advertised

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15517: Resync borrowers and deletedborrowers tables
Jonathan Druart [Thu, 7 Jan 2016 15:24:05 +0000 (15:24 +0000)]
Bug 15517: Resync borrowers and deletedborrowers tables

The 2 columns password and userid are not sync and could cause errors
when deleting patrons.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15605: Remove the cursor:pointer style.
Jonathan Druart [Wed, 27 Jan 2016 10:33:24 +0000 (10:33 +0000)]
Bug 15605: Remove the cursor:pointer style.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15605 - Accessibility: Can't tab to add link in serials routing list add user...
Natasha [Wed, 20 Jan 2016 02:11:37 +0000 (02:11 +0000)]
Bug 15605 - Accessibility: Can't tab to add link in serials routing list add user popup

To Test -
1. Go to Serials and search for a title and then click on it.
2. Click routing list and then Add recipients.
3. Search for a patron.
4. Using the tab key try to navigate onto the Add link.
5. Notice it skips Add.
6. Apply the patch and then repeat steps 1-4, notice the Add link can now be accessed through using the keyboard.

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: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15657 (follow-up bug 15501): add missing semi-colon
Lyon3 Team [Mon, 25 Jan 2016 15:52:37 +0000 (16:52 +0100)]
Bug 15657 (follow-up bug 15501): add missing semi-colon

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
The semicolon it's added

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15663: Fix 'remove selected items', add a 'delete batch' button
Aleisha [Tue, 26 Jan 2016 02:57:38 +0000 (02:57 +0000)]
Bug 15663: Fix 'remove selected items', add a 'delete batch' button

In this patch I have fixed the 'Remove selected items' button.
I have also added a 'Delete batch' button like there is in the Patron Card Creator.

To test:
1) Go to Tools -> Label creator -> New label batch
2) Add 2 items
3) Select the checkbox next to an item you just added and click 'Remove selected items'
4) A pop-up will say that you are yet to select an item. (Please ignore the mistake in the pop-up message, this is being fixed in Bug 15662)
5) Apply patch and refresh. Confirm there is now a 'Delete batch' button in the toolbar
6) Select one item and click 'Remove selected items'
7) Confirm the item is deleted from the batch
8) Select the final item and click 'Remove selected items'
9) Pop-up message will tell you that deleting this item will delete the batch. Click 'Okay'
10) Click 'Delete batch' then 'Okay'
11) Confirm you are redirected to the Labels page and the batch has been deleted.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15670 - Rename "Cancel" to "Cancel hold" when checking in a waiting item
Owen Leonard [Thu, 11 Feb 2016 13:56:42 +0000 (08:56 -0500)]
Bug 15670 - Rename "Cancel" to "Cancel hold" when checking in a waiting item

When checking in an on-hold item which is waiting, the "Cancel" button
cancels the hold, so it should say so. This patch changes the text.

This patch also moves the 'cancel hold' button to the middle, on the
theory that buttons on the left should default to 'confirm' and buttons
on the right should generally imply 'cancel'--as in 'do nothing.' Moving
it to the middle seems like a good place to put it where users will have
to think about clicking it.

To test:

1. Find an hold which has been made 'waiting,' or check in an confirm a
   pending hold at your library.
2. Check in that item again and verify that the 'Hold found' dialog
   contains a 'Cancel hold' button which works to cancel the waiting
   hold.
3. Repeat the process and confirm that the functionality of the other
   buttons is unchanged.

Followed test plan, works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15691: Show card number minimum and maximum in visible hint when adding a patron
Owen Leonard [Thu, 28 Jan 2016 13:54:56 +0000 (08:54 -0500)]
Bug 15691: Show card number minimum and maximum in visible hint when adding a patron

The CardnumberLength system preference defines card number minimum and
maximum allowed values when adding a patron. This information is
currently hidden in a title attribute on the card number input field.

This patch moves the information into a <div class="hint">, matching
other fields in the entry form which offer details about entry
guidelines.

To test, apply the patch and open the new patron entry form. Test for
various values of CardnumberLength, and with 'cardnumber' mandatory or
not mandatory as defined in BorrowerMandatoryField.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15706: (follow-up) Changing to circulate_remaining_permissions
Aleisha [Mon, 1 Feb 2016 22:36:06 +0000 (22:36 +0000)]
Bug 15706: (follow-up) Changing to circulate_remaining_permissions

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15706: Changing to circulate_remaining_permissions
Aleisha [Sun, 31 Jan 2016 21:16:18 +0000 (21:16 +0000)]
Bug 15706: Changing to circulate_remaining_permissions

I have only changed this in the includes for the tabs at the top.
Dependent on Bug 12051 as that patch adds extra tabs to the top which would need to be changed later

To test:
1) Apply Bug 12051 first, then this patch
2) Ensure that Check Out/Check In/Renew tabs still work as they should
3) Check patch for errors or pages I've missed

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15833: item.biblioitemnumber returns a biblioitem DBIx::Class object
Jonathan Druart [Tue, 16 Feb 2016 15:58:44 +0000 (15:58 +0000)]
Bug 15833: item.biblioitemnumber returns a biblioitem DBIx::Class object

2 links are wrong on the renew page, because item.biblioitemnumber does
not return the biblioitemnumber as expect the template.

Test plan:
Renew an item and check the item link.
It should contain a valid biblioitemnumber for the 'bi' parameter.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Link repaired. At first glance, I am wondering if biblioitemnumber is
of actual use here; is it only passed back and forth between script and
template?

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoDBRev Bug 6624 - Allow Koha to use the new read API from OpenLibrary
Brendan Gallagher [Tue, 23 Feb 2016 22:10:49 +0000 (22:10 +0000)]
DBRev Bug 6624 - Allow Koha to use the new read API from OpenLibrary

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 6624: Add test for OpenLibrary
Jonathan Druart [Wed, 17 Feb 2016 11:24:16 +0000 (11:24 +0000)]
Bug 6624: Add test for OpenLibrary

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agobug_6624: Added Open Library Search and Read API calls to opac-results.tt and opac...
Srdjan [Mon, 14 Dec 2015 07:08:36 +0000 (20:08 +1300)]
bug_6624: Added Open Library Search and Read API calls to opac-results.tt and opac-detail.tt Conditional to OpenLibrarySearch syspref

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agobug_6624: Added Open Library Search and Read API to openlibrary.js
Srdjan [Mon, 14 Dec 2015 07:07:08 +0000 (20:07 +1300)]
bug_6624: Added Open Library Search and Read API to openlibrary.js

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agobug_6624: OpenLibrarySearch syspref for OPAC
Srdjan [Mon, 14 Dec 2015 07:01:18 +0000 (20:01 +1300)]
bug_6624: OpenLibrarySearch syspref for OPAC

If set to Yes, OPAC search results and details will include buton from
Open Library Raed API.
In addition, Number of titles held in Open Library and the results link
will be reported on the search results screen.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 12051: Adds a Renew tab to the staff client
Aleisha [Tue, 19 Jan 2016 03:44:31 +0000 (03:44 +0000)]
Bug 12051: Adds a Renew tab to the staff client

UPDATE: Added to checkin-search.inc to show up on returns.pl

To test:

1) Apply patch
2) Confirm that there is now a Renew tab on the pages where there is also a Check-in tab only
3) Attempt to renew a book using this, confirm it works as expected
4) Check if I have missed any pages

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15730 - 500 error on returns.pl if barcode doesn't exist
Kyle M Hall [Wed, 3 Feb 2016 15:10:30 +0000 (15:10 +0000)]
Bug 15730 - 500 error on returns.pl if barcode doesn't exist

If a librarian enters a barcode that does not match an item in the
database, a 500 error will be displayed instead of the "No item with
barcode" message.

Test Plan:
1) Enter an invalid barcode on returns.pl
2) Note the 500 error
3) Apply this patch
4) Repeat setp 1
5) Note the "No item with barcode" message

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15742 [QA Followup] - Tidy script
Kyle M Hall [Thu, 4 Feb 2016 21:24:53 +0000 (21:24 +0000)]
Bug 15742 [QA Followup] - Tidy script

Script does not appear to have any other modifying patches at this
time based on bz splitter. This is a perfect time to clean up this
script!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15742: Remove unnecessary loop in j2a cronjob
Jonathan Druart [Thu, 4 Feb 2016 13:25:14 +0000 (13:25 +0000)]
Bug 15742: Remove unnecessary loop in j2a cronjob

If no branchcode is given, all the libraries are retrieved and the same
query (so without using the libraries loop) is executed for each
library.

Test plan:
Use the j2a.pl cronjob to change the category of a child patron
If a branchcode is passed to the script, only the children from this
branchcode should be updated.
But if it is not passed, all children of the DB should be updated.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15746: Same fix for "write off"
Jonathan Druart [Fri, 5 Feb 2016 10:58:20 +0000 (10:58 +0000)]
Bug 15746: Same fix for "write off"

Same fix as before for the "Write off" button next to the "Pay" button.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15746: Do not record individual payments with randomly picked libraries
Jonathan Druart [Fri, 5 Feb 2016 10:46:28 +0000 (10:46 +0000)]
Bug 15746: Do not record individual payments with randomly picked libraries

When a payment is made individualy, the library used to record this
payment is randomly picked from the library list.
This is because C4::Branch::GetBranch looks at 1. the $branch variable
sent by the template, wich does not exist, then 2. the branchname
cookie, which does not exist neither, then 3. get the first branchcode
from a list of keys (non ordered).

To reproduce:
- Create a manual invoice for a patron
(members/maninvoice.pl?borrowernumber=XXXX)
- Pay this fine using the "Pay" button of the corresponding line from
  the members/pay.pl?borrowernumber=XXXX page
Look at the statistics table:
select * from statistics order by datetime desc limit 10;

The branch value of the first line might not correspond to the library
you were using to pay the payment.

Test plan:
Apply this patch, repeat the steps above and confirm that the library
picked is now the one used to pay.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15756: Some tests for haspermission in C4::Auth
Marcel de Rooy [Mon, 8 Feb 2016 13:58:56 +0000 (14:58 +0100)]
Bug 15756: Some tests for haspermission in C4::Auth

Test plan:
Run this new test.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All tests successful. koha-qa.pl run OK.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15764: Fix timestamp sent by KOCT
Julian Maurice [Tue, 9 Feb 2016 10:16:55 +0000 (11:16 +0100)]
Bug 15764: Fix timestamp sent by KOCT

KOCT plugin send UTC timestamp, it should be converted to local timezone

Test plan:
1. Install latest version of KOCT and configure it
   https://addons.mozilla.org/fr/firefox/addon/koct/
   https://wiki.koha-community.org/wiki/Offline_circulation_firefox_plugin
2. Use it to do a checkout and a checkin. See that timestamps are UTC.
3. Click on "Commit to Koha" under "Log" tab
4. Wait for all operations to be processed
5. In Koha, go to Circulation > Offline circulation and check the
   timestamps were correctly converted to the Koha server's timezone
6. Process the pending operations and see that timestamps are still
   correct
7. Repeat step 2
8. Now click on "Apply directly"
9. Check the timestamps are correct in Koha

NOTE: I could not get "Commit to Koha" to work for me, but I did
      confirm this corrected behaviour with "Apply directly".

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Using the "commit to Koha" option works fine for me.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch only affects service.pl, which is not used in any way by the
uploader for desktop client files. No changes to the desktop offline
circ will be needed.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15790 - Don't delete a MARC framework if existing records use that framework
Owen Leonard [Thu, 11 Feb 2016 17:06:39 +0000 (12:06 -0500)]
Bug 15790 - Don't delete a MARC framework if existing records use that framework

If a MARC framework is in use by any records it should not be possible
to delete it. Deleting a framework which is in use will leave the
deleted framework code in those records.

This patch modifies the deletion confirmation dialog so that it will not
let the user confirm the deletion if there are records using it.

Depends on Bug 15785 - Use Font Awesome icons in confirmation dialogs

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

1. Try to delete a framework which is in use by 1 or more records. The
   resulting confirmation dialog should prevent you from proceeding.
2. Try to delete a framework which is not in use. Test both canceling
   and confirming that deletion to make both function correctly.

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: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15785 - Use Font Awesome icons in confirmation dialogs
Owen Leonard [Thu, 11 Feb 2016 14:36:25 +0000 (09:36 -0500)]
Bug 15785 - Use Font Awesome icons in confirmation dialogs

We can simplify the staff client's CSS and reduce some image file usage
if we modify confirmation dialogs to use Font Awesome icons. This patch
makes this change for Administration templates.

This patch includes some whitespace changes, so please consider that
when looking at diffs.

To test, apply the patch and test deletion in the following cases. Test
both confirmation and cancel actions.

Administration -> Budgets -> Delete budget
Administration -> Funds -> Delete fund
Administration -> Authority types -> Delete authority type
Administration -> Authority types -> MARC Structure -> Delete tag
Administration -> Authority types -> MARC Structure -> Subfields -> Delete
Administration -> MARC bibliographic framework -> Delete framework
Administration -> MARC bibliographic framework -> MARC structure -> Delete
Administration -> Cities and Towns -> Delete city
Administration -> Classification sources -> Delete classification source
Administration -> Classification sources -> Delete classification filing rule
Administration -> Item types -> Delete
Administration -> Record matching rules -> Delete
Administration -> Patron attribute types -> Delete

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. Icons changed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoDBRev for Bug 13534 [Followup] - Remove tabs and atomic update file
Kyle M Hall [Tue, 23 Feb 2016 15:43:29 +0000 (15:43 +0000)]
DBRev for Bug 13534 [Followup] - Remove tabs and atomic update file

8 years agoDBRev for Bug 13534 - Deleting staff patron will delete tags approved by this patron
Brendan Gallagher [Tue, 23 Feb 2016 15:33:41 +0000 (15:33 +0000)]
DBRev for Bug 13534 - Deleting staff patron will delete tags approved by this patron

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 13534: Do not remove tags on deleting a patron
Jonathan Druart [Wed, 13 Jan 2016 14:34:29 +0000 (14:34 +0000)]
Bug 13534: Do not remove tags on deleting a patron

On deleting a patron, all the tags approved by this user will be
deleted.
This can cause data lost.

Test plan:
0/ Do not execute the update DB entry
1/ Create 2 patrons A, B
2/ Create some tags with patron A logged in
3/ Approve them with patron B logged in
4/ Delete the 2 patrons
=> The tags have been deleted
5/ Execute the DB entry
6/ Repeat 1,2,3,4
=> The tags have not been deleted and are still shown on the interface
(result, detail, tags module)

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15643 - Every datepicker on serials expected date column updates top issue
Lyon3 Team [Tue, 26 Jan 2016 11:40:11 +0000 (12:40 +0100)]
Bug 15643 - Every datepicker on serials expected date column updates top issue

delete 'expected' and 'supexpected' ids that don't seem useful anymore.
Same thing for changeDate2 function

Test plan :
1) Search a serial subscription from the Serials Home page
2)Go to serial collection page and make sure it has a mimimal bunch of
already received  or missing issues
3)Check some received issues to be sure to get extra issues (not only
the extected one) in the serial edition page
4) Click on Edit serials button
5) Try to modify whatever date in 'Expected on' column (excepted first
one) using datepicker :
You can see that the top date of the column is updated instead of the
choosen one.
6) Apply patch and redo 1 to 5 steps :
now the right date is updated.

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: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15645: Remove the confusing wait var and use found instead
Jonathan Druart [Mon, 1 Feb 2016 13:13:10 +0000 (13:13 +0000)]
Bug 15645: Remove the confusing wait var and use found instead

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15645 - In transit holds do not show as in transit on request.pl
Kyle M Hall [Fri, 22 Jan 2016 16:36:26 +0000 (16:36 +0000)]
Bug 15645 - In transit holds do not show as in transit on request.pl

A hold in transit will simply appear as an unfilled hold!

Test Plan:
1) Place a hold for pickup at a different location
2) Capture that hold for a patron
3) Note you do not see the in transit status on request.pl
4) Apply this patch
5) Refresh the page
6) The hold should now show as in transit!

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: Brendan Gallagher brendan@bywatersolutions.com
8 years agoDeleting the atomic update for bug Bug 15736 - Add a preference to control whether...
Brendan Gallagher [Mon, 22 Feb 2016 20:47:49 +0000 (20:47 +0000)]
Deleting the atomic update for bug Bug 15736 - Add a preference to control whether all items should be shown in checked-in items list

8 years agoUpdating the DB Rev for Bug 15736 - Add a preference to control whether all items...
Brendan Gallagher [Mon, 22 Feb 2016 20:46:52 +0000 (20:46 +0000)]
Updating the DB Rev for Bug 15736 - Add a preference to control whether all items should be shown in checked-in items list

8 years agoBug 15736 [QA Followup] - Make add more details to the syspref description
Kyle M Hall [Sun, 14 Feb 2016 14:12:50 +0000 (14:12 +0000)]
Bug 15736 [QA Followup] - Make add more details to the syspref description

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15736: Add ShowAllCheckins pref to control the display of checked-in item list...
Jonathan Druart [Fri, 12 Feb 2016 09:07:09 +0000 (09:07 +0000)]
Bug 15736: Add ShowAllCheckins pref to control the display of checked-in item list on checking

Bug 14821 removed the items which were not checked out, but some
libraries considered it as a bug.
So let's add a new pref to control this behavior.

Test plan:
0/ Execute the updatedb entry and set ShowAllCheckins to "Do not show"
(default)
1/ Check an item in.
If the item was not checked out, it won't be listed
2/ Turn the pref to "Show"
3/ Check an item in
If the item was not checked out, it should be listed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15810: Make sure the CGI->param is not called in a list context when creating...
Jonathan Druart [Fri, 12 Feb 2016 14:33:57 +0000 (14:33 +0000)]
Bug 15810: Make sure the CGI->param is not called in a list context when creating private shelves

This patch fixes the following bug:
If OpacAllowPublicListCreation is set to "not allow", the creation of a
private list raises an error at the OPAC.

CGI->param is called in a list context and some parameters are not
filled from the template if the pref is set to "not allow".
To make sure we don't have a "Odd number of elements in anonymous hash",
we force the context to scalar.

Test plan:
1/ Set OpacAllowPublicListCreation to "not allow"
2/ Create private and public lists at the OPAC and the intranet
=> Everything should work fine with this patch applied

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15818 - OPAC search with utf-8 characters and without results generates encoding...
Dobrica Pavlinusic [Mon, 15 Feb 2016 14:23:19 +0000 (15:23 +0100)]
Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error

When searching for something in OPAC which doesn't result in any results but have utf-8
characters in search string we get following encoding error:

Cannot decode string with wide characters at /usr/lib/i386-linux-gnu/perl5/5.20/Encode.pm line 215.

This is because we are trying to decode string which is allready correctly
marked as utf-8.

Test scenario:

1) enter search string with utf-8 characters in opac which doesn't
   return any results
2) verify that you get application error
3) apply this patch
4) re-run query and verify that errror is gone

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Step 0: Define "OPACNoResultsFound" with '{QUERY_KW}'
Note that I don't get the error (Encode 2.60) but the search terms are
not display correctly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
The variable to be decoded comes from already decoded vars (via
the -utf8 flag from CGI), following the trail in Search.pm.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years ago Bug 11081: (followup) Rebuild debian/control
Tomas Cohen Arazi [Tue, 16 Feb 2016 14:06:09 +0000 (11:06 -0300)]
 Bug 11081: (followup) Rebuild debian/control

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
8 years agoBug 9021: Update Koha.pm to DBrev 3.23.000.020
Kyle M Hall [Sun, 14 Feb 2016 14:03:32 +0000 (14:03 +0000)]
Bug 9021: Update Koha.pm to DBrev 3.23.000.020

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021: DBrev 3.23.000.020
Kyle M Hall [Sun, 14 Feb 2016 12:50:00 +0000 (12:50 +0000)]
Bug 9021: DBrev 3.23.000.020

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021: Save the provider even if the sms number is not modified
Jonathan Druart [Mon, 15 Feb 2016 16:26:53 +0000 (16:26 +0000)]
Bug 9021: Save the provider even if the sms number is not modified

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021: Fix conflict with bug 15446 (type vs _type)
Jonathan Druart [Mon, 15 Feb 2016 16:26:18 +0000 (16:26 +0000)]
Bug 9021: Fix conflict with bug 15446 (type vs _type)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Add additional message to deletion warning if provider is...
Kyle M Hall [Thu, 11 Feb 2016 10:43:40 +0000 (10:43 +0000)]
Bug 9021 [QA Followup] - Add additional message to deletion warning if provider is in use.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Unit tests
Kyle M Hall [Thu, 11 Feb 2016 06:53:15 +0000 (06:53 +0000)]
Bug 9021 [QA Followup] - Unit tests

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Add column to deleted borrowers, set null on provider deletion
Kyle M Hall [Wed, 10 Feb 2016 10:28:37 +0000 (10:28 +0000)]
Bug 9021 [QA Followup] - Add column to deleted borrowers, set null on provider deletion

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Add feedback to delete button if provider is being used
Kyle M Hall [Wed, 10 Feb 2016 10:19:00 +0000 (10:19 +0000)]
Bug 9021 [QA Followup] - Add feedback to delete button if provider is being used

* Change links to buttons
* Add warning class to delete button if provider is being used

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Switch to Koha::Object(s)
Kyle M Hall [Tue, 9 Feb 2016 15:45:55 +0000 (15:45 +0000)]
Bug 9021 [QA Followup] - Switch to Koha::Object(s)

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Use same color as circ rules editor for row highlighting
Kyle M Hall [Tue, 9 Feb 2016 15:23:36 +0000 (15:23 +0000)]
Bug 9021 [QA Followup] - Use same color as circ rules editor for row highlighting

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Fix ENGINE, don't create index on FK
Kyle M Hall [Tue, 9 Feb 2016 14:52:45 +0000 (14:52 +0000)]
Bug 9021 [QA Followup] - Fix ENGINE, don't create index on FK

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Use Modern::Perl
Kyle M Hall [Tue, 9 Feb 2016 14:47:13 +0000 (14:47 +0000)]
Bug 9021 [QA Followup] - Use Modern::Perl

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 [QA Followup] - Use TT plugin instead of passing syspref via script
Kyle M Hall [Tue, 9 Feb 2016 14:45:51 +0000 (14:45 +0000)]
Bug 9021 [QA Followup] - Use TT plugin instead of passing syspref via script

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021: Flag issues
Mark Tompsett [Fri, 1 Jan 2016 05:30:40 +0000 (00:30 -0500)]
Bug 9021: Flag issues

Check in and check out were failing for me.
Specificly, the $borrower->{flags}->{...} was not accessible as
a hash, so I put a hash ref check around the code that would fail.

TEST PLAN
---------
1) Attempt a checkout
   -- blows up with "1" not being allowed as a hash ref.
2) Apply patch
3) Attempt same checkout again
   -- success
4) prove -v t/db_dependent/Circulation_dateexpiry.t
   -- this triggers CanBookBeIssued
   -- this should succeed
5) prove -v t/db_dependent/rollingloans.t
   -- mine skipped the tests, but if configured, it
      should also trigger and succeed.
6) run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021: Schema update
Mark Tompsett [Thu, 31 Dec 2015 21:49:31 +0000 (16:49 -0500)]
Bug 9021: Schema update

This ensures that the DBIx structure matches the SQL structure changes.
See comment #48 as to how this was generated.
Also, I had to modify misc/devel/update_dbix_class_files.pl
to have an "overwrite_modifications => 1" option to get it to generate.
This should correct issues raised in comment #45.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 9021 - Add SMS via email as an alternative to SMS services via SMS::Send drivers
Kyle M Hall [Tue, 26 Feb 2013 14:12:03 +0000 (09:12 -0500)]
Bug 9021 - Add SMS via email as an alternative to SMS services via SMS::Send drivers

Nearly all cellular providers allow a person to send an text message to a cellular
phone by sending an email to phonenumber@provider. We can leverage this capability
to add the ability for Koha to send sms messages to patrons without the need to
subscribe to an sms gateway server.

Basic plan:
1. Add a table sms_providers to the db to tell Koha what service providers are available, and what domain emails should be sent to.
2. Add borrowers.sms_provider_id to tell Koha which mobile service the patron subscribes to for the number given in smsalertnumber
3. Modify Koha to send an email rather than using SMS::Send if the driver is set to 'Email'

Test plan:
0) Get a mobile phone
1) Apply the patch
2) Run updatedatabase.pl
3) Set the value of SMSSendDriver to 'Email'
4) Go to the admin page, the "Additional parameters" area should now have the link "SMS cellular providers"
5) On this page, add some providers. Make sure to add the provider for your own cellular phone service.

Here are some examples:
Sprint   phonenumber@messaging.sprintpcs.com
Verizon  phonenumber@vtext.com
T-Mobile phonenumber@tmomail.net
AT&T     phonenumber@txt.att.net

Only add the domain part in the 'domain' field. So for Verizon, that would be 'vtext.com'

6) Create an account for yourself, add your SMS number, and select your provider from the dropdown box directly below it.

7) Enable SMS messaging for Item check-in and Item checkout
8) Check out an item to yourself
9) Run process_message_queue.pl
10) Wait! You should receive a text message shortly, when I tested it, I received my sms message within the minute.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15411: DBrev 3.23.000.019 (part 2)
Jesse Weaver [Fri, 12 Feb 2016 19:43:32 +0000 (12:43 -0700)]
Bug 15411: DBrev 3.23.000.019 (part 2)

Update Koha.pm and updatedatabase.pl.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15411: DBrev 3.23.000.019
Jesse Weaver [Fri, 12 Feb 2016 19:43:32 +0000 (12:43 -0700)]
Bug 15411: DBrev 3.23.000.019

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15411: More changes
Aleisha [Wed, 6 Jan 2016 00:21:54 +0000 (00:21 +0000)]
Bug 15411: More changes

Changes to Italian and Polish sql files and catalogue help file.

TEST PLAN
---------
1) Confirm sql is valid and has Non-fiction.
   > delete from auth_vals;
   > source {appropriate file};
2) Staff -> Search -> Help
   -- Confirm Non-fiction
3) Run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15411: Changing 'Non fiction' to 'Non-fiction'
Aleisha [Tue, 22 Dec 2015 21:50:37 +0000 (21:50 +0000)]
Bug 15411: Changing 'Non fiction' to 'Non-fiction'

To test:

1) Apply patch
2) Run updatedatabase.pl
3) Go to advanced search in Staff Client (ie /cgi-bin/koha/catalogue/search.pl)
4) Confirm that it says 'Non-fiction' in the 'Any content' drop-down menu under 'Subtype limits'
5) Go to item search (ie /cgi-bin/koha/catalogue/itemsearch.pl)
6) Confirm that it says 'Non-fiction' under 'Collection code'
7) Go to advanced search in OPAC (ie /cgi-bin/koha/opac-search.pl) and click 'More options'
8) Confirm that it says 'Non-fiction' in the 'Content' drop-down menu
9) Go to the details page for a non-fiction book in the OPAC (ie /cgi-bin/koha/opac-detail.pl?biblionumber=2) and click 'Holdings' tab
10) Confirm that it says 'Non-fiction' under 'Collection' heading

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15446 - DBrev 3.23.000.018
Jesse Weaver [Fri, 12 Feb 2016 19:43:32 +0000 (12:43 -0700)]
Bug 15446 - DBrev 3.23.000.018

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15446 [QA Followup] - Update new classes
Kyle M Hall [Thu, 11 Feb 2016 10:02:56 +0000 (10:02 +0000)]
Bug 15446 [QA Followup] - Update new classes

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15446: (follow-up) Rename Koha::Object[s]->type with _type
Jonathan Druart [Tue, 5 Jan 2016 15:24:46 +0000 (15:24 +0000)]
Bug 15446: (follow-up) Rename Koha::Object[s]->type with _type

Some occurrences have been pushed in the meantime.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15446: Update systempreferences rows where type=YesNo and value=''
Jonathan Druart [Wed, 30 Dec 2015 17:19:02 +0000 (17:19 +0000)]
Bug 15446: Update systempreferences rows where type=YesNo and value=''

Signed-off-by: Marc Véron <veron@veron.ch>
Amended to fix typo in sql statement.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15446: Rename Koha::Object[s]->type with _type
Jonathan Druart [Wed, 30 Dec 2015 17:15:31 +0000 (17:15 +0000)]
Bug 15446: Rename Koha::Object[s]->type with _type

In a few case (at least systempreferences and export_format (csv profiles),
the type method of Koha::Object and Koha::Objects can be in conflict with the
column names.
Indeed systempreferences.type exists and so the method will return
'Systempreference' (the name of the module) instead of the value of the row in
DB.

I have found at least 1 place where it can cause issue:
In C4::Context->set_preference:
 601     my $syspref = Koha::Config::SysPrefs->find( $var );
 602     my $type = $syspref ? $syspref->type() : undef;
 603
 604     $value = 0 if ( $type && $type eq 'YesNo' && $value eq '' );

type will always be 'Systempreference' and the YesNo pref will be set to an
empty string '' instead of 0.

I am not sure about the consequences of this, but it is preferable to
fix it ASAP.

To reproduce:
0/ Do not apply this patch
1/ Edit a YesNo prefs, AutoEmailOpacUser for instance
2/ Set it to "Don't sent"
3/ Check the value in DB, it should be set to an empty string, instead
of 0
4/ Apply this patch and try again. Now the value should be 0

Followed test plan, value is now 0 as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15446: Add tests
Jonathan Druart [Wed, 30 Dec 2015 17:11:45 +0000 (17:11 +0000)]
Bug 15446: Add tests

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
8 years agoBug 15760: Fix order by direction for shelves
Jonathan Druart [Thu, 11 Feb 2016 11:32:43 +0000 (11:32 +0000)]
Bug 15760: Fix order by direction for shelves

The order_by parameters should not be "$direction $order_by" with
quote_names enabled. The correct syntax is { -$direction => $order_by }

Test plan for Opac + Staff interfces:
Sort list by title or whatever and change the direction

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
8 years agoBug 15760: Avoid SQL injections
Jonathan Druart [Thu, 11 Feb 2016 10:16:12 +0000 (10:16 +0000)]
Bug 15760: Avoid SQL injections

Asking on #dbix-class, ribasushi told me to set quote_names to the
connection options.

Indeed it does the fix, globally :)

Test plan:
1/ Add the following snippet to the a script (mainpage.pl is a good candidate)
 use Koha::Virtualshelves;
 my $s = Koha::Virtualshelves->search({}, { order_by => '1,(select case when (3*2*1=6 AND 000227=000227) then 1 else 1*(select table_name from information_schema.tables)end)=1' });
 $s->next;
2/ Execute the script
=> Without the patch, you should not get any error. If you have the mysql logs
enable, you will see the query
=> With the patch applied, you will get a "unknown column" error

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com