Bug 6254: make it possible to set default privacy setting for new patrons

There is currently no way to set the privacy setting for newly created
patrons. This patch adds a new field "default privacy" to the patron
categories such that each patron category may have a different default
privacy setting.

Test Plan:
1) Apply this patch
2) Edit a patron category, change the default privacy to "forever"
3) Create a new patron of that category
4) Log into the catalog as that patron, verify the privacy setting
   is set to "forever"
5) Repeat steps 2-4 with the settings "never" and "default"

Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Bug 6254 [QA Followup 1] - can't set patron privacy by default

* Adds default privacy column to summary table
* Adds default privacy to delete category summary
* Adds "AFTER categorycode" to the database update
* Whitespace cleanup and formatting for affected code blocks
* Switch basic DBI queries to DBIx::Class to simplify code
* Adds reference to misc/cronjobs/batch_anonymise.pl to description

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Bug 6254 [QA Followup 2] - can't set patron privacy by default

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Bug 6254: QA FIX: remove trailing whitespaces

This patch removes trailing whitespaces/tab and fix the fields order in
the updatedb entry (according to the kohastructure.pl).

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 6254: (follow-up) update DBIC classes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 6254: (follow-up) tidy admin/categorie.pl ( whitespace changes only )

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 6254: DBrev 3.17.00.004

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 6254: (follow-up) update DBIC classes using newer version of DBIx::Class::Schema::Loader

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12230: Set a maximum suspension days as a new issuing rule

This patch adds a new issuing rule: maxsuspensiondays.

A new column "Max. suspension duration (day)" appears in the main table
of the issuing rules.

If this value is filled, on returning an item, a patron won't be
suspended longer than this cap.

Test plan:
1/ Set "suspension in days" to 2.
2/ Check an item out to a patron and specify a due date to today - 10
days.
3/ Check the item in and verify the patron is suspended until today + 10
* 2 days.
4/ Remove the suspension.
5/ Set "Max. suspension duration" to 10.
6/ Check an item out to a patron and specify a due date to today - 10
days.
7/ Check the item in and verify the patron is suspended until today + 10
days.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12230: DB changes - add issuingrules.maxsuspensiondays

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12230: (follow-up) maxsuspensiondays should be set to NULL if not set

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12230: DBRev 3.17.00.005

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12230: (follow-up) update DBIC classes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12230: (follow-up) improve unit tests

[1] Clear holidays first to avoid throwing off the
    calculations
[2] Add descriptions for the tests

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7720: add options for controlling display of an item's home and/or holdings location

Currently, in opac-detail.pl, there exists a column named 'Location'.
This column lists the name of the holding branch, and the item's
location description. This can cause confusion to borrowers, as
they may assume that the holding branch is the *owning* branch
(homebranch) of an item.

This could cause a situation where a borrower waits for an
item to be returned to his or her library, only to find that
the library never owned that item, and it was transferred back
to its homebranch. It could also lead a borrower to falsely
assume that his or her home library does not own a copy of a
particular item because the borrower does not see an his or her
home library listed for any of the items on the record.

In addition, even when the holding branch is different
than the home branch, the item's shelving location is displayed,
even though that branch may not use that location.

This commit makes the item details table equivalent to the intranet
details page by adding a "Home Library" column, which displays the
item's home library, as well as the shelving location.

If singleBranchMode is enabled, this column disappears and the
"Location" column displays the shelving location only.

This commit adds two new system preferences:

OpacLocationBranchToDisplay, which defines whether
to display the holding library, the home library,
or both for the opac details page.

OpacLocationBranchToDisplayShelving, which defines
where the shelving location should be displayed,
under the home library, the holding library, or both.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Work as described. Tested all variations.
No koha-qa errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7720: (follow-up) fix various issues

[1] Fix capitalization
[2] Move logic for getting the home library name URL to the
    Branches TT plugin

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7720: (follow-up) update Bootstrap theme

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7720: (follow-up) revert change to GetItemsInfo

The QA follow-up which adds GetURL to the TT branches
plugin means that GetItemsInfo no longer needs to be changed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7720: DBRev 3.17.00.006

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7720: (follow-up) fix issues in Bootstrap theme

- Fix breakage of tablesorting when OpacLocationBranchToDisplay
  is set to both.
- When displaying the home library, ensure that its correct
  name and URL are displayed
- Remove the attempt to display the "opac_info" tooltip for
  the home library, as it is not currently retrieved.

RM NOTE: Rather than add a GetOpacInfo function or the like
to the TT Branches plugin, simpler would be adding a
plugin function that fetches a DBIC result object for
a given branchcode, thereby allowing any column in the
branches table to be fetched into the template.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7720: (follow-up) restore CSS selectors for the current/home location columns

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11629 - Add ability to update not for loan status on checkin

Some libraries would like to streamline the cataloging process my
automatically updating notforloan values on checkin. For example, an
item is set to notforloan of -1 ( ordered ). The item, is received,
processed, and checked in for the first time before being shelved.
The checkin automatically changes the nfl value from -1 to 0. The
same workflow could be used for damaged items as well.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Set the new system preference UpdateNotForLoanStatusOnCheckin
   to the following:
-1: 0
0: 1
4) Create an item, set its notforloan value to -1
5) Check in the item, note its not for loan value is now 0
6) Check in the item again, note its not for loan value is now 1
7) Check in the item again, note its not for loan value reamins 1

Signed-off-by: Havilah Lyon <havilah@aflibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes on last patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11629: (follow-up) Add message for librarian that status was updated

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>