Bug 8288 - showmarc.tt should not include full doc-head-close.inc

showmarc.tt and opac-showmarc.tt are used to load a plain view
of a MARC record and thus do not need the full set of page assets
loaded with other pages (CSS and JavaScript). Removing the
standard doc-head-close include will reduce the load time of
these pages.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 8279: CAS Debugging improvements

  Adds more precise debug informations for easier CAS troubleshootings resolution.

  Before this patch, whenever ticket validation failed, the debug message was "Invalid ticket".
  But ticket validation may fail for other reasons: CAS server not reachable, casServerUrl syspref is wrong...

  This patch adds the reason for ticket validation failing.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 8205: Add OPACShowUnusedAuthorities syspref

Rather than list authorities that are not actually used by a library,
this commit introduces a new syspref: OPACShowUnusedAuthorities to
enable libraries to hide unused authorities in the OPAC authority browser.

To test:
1) Do a search in the OPAC authority browser that brings up multiple
   results, including some that are used in the bibliographic database
   and some that are not.
2) Observe that the results include both used and unused authorities.
3) Set OPACShowUnusedAuthorities to "Do not."
4) Repeat the same search as in step 1.
5) Observe that the results no longer include unused authorities.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Preference is implemented cleanly and works like advertised.
As a note: The unused authority records will be hidden from display,
but the result list paging does not adjust for the hidden records.
So the result pages will show more or less records total, depending
on how many records are hidden.
Bug 8205 follow-up DBRev number
Bug 6939 DefaultClassificationSource should be default in 942

A logic bug in the original code adding DefaultClassificationSource
caused the default not to be used (the last used value was used instead)
The bug was fixed in additem by bug 2398 but addbiblio's use
of the code was not fixed.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 8130 - attach PDF files to a patron record

Adds the ability to attach unlimited arbitrary files to
a borrower record.

Test Plan:
1) Enable system preference EnableBorrowerFiles
2) Look up borrower record, click 'Files' tab on left
3) Upload a file, download the file, delete the file.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
rebased for current master.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
rebased again; some indentation issues in include menus.
Bug 8130 follow-up DBRev number
Bug 8319: Update headings on Patron Statistics tab

The patron statistics tab had had headings that were too
hard to understand for the average library user. This patch
changes the language to something less technical.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 8313 - add ASHS to 'Koha team' page, for sponsorship of the 'star-ratings' feature

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 8321: Fix OPACShowBarcode description

This preference had a few grammar errors and repeated the
word 'show.' This patch resolves those issues.

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug-7161 Open Library - Larger image, Read, borrow and checked-out status

To test:
1. go into system administration and search for "cover"
2. change "OpenLibraryCovers" to "add" and all other to "don't show"
3. verify that opac search results have small covers, while
   detail page has big ones

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Addressing M. de Rooy's concerns

* remove console.log
* removed some comments that looked like debug code?
* remove ebook display -  I couldn't get it to work properly, and we want the bigger images. So it's gone.
* remove get_cover

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
June 27, 2012: Removing unused function keys from openlibrary.js.
7161 Followup for indentation openlibrary.js

Only whitespace changes to fix indentation after tab removal.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 8315 - fix 'C4::Output 3.02' errors in Koha

	modified:   opac/opac-ratings-ajax.pl
	modified:   opac/opac-tags.pl
	modified:   tags/review.pl

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 6557: Record bib popularity in totalissues

Because updating the total issues count associated with a bibliographic
record on issue could cause a significant load on the server, this
commit adds the syspref UpdateTotalIssuesOnCirc (which defaults to OFF
to match existing behavior). The syspref has the following description:

  Do/Do not update a bibliographic record's total issues count whenever
  an item is issued (WARNING! This increases server load significantly;
  if performance is a concern, use the update_totalissues.pl cron job
  to update the total issues count).

Bug 6557: automatically increment totalissues

Adds the ability to automatically increment biblioitems.totalissues
whenever an item is issued.

To test:
1) Choose a record with at least one item that can circulate
2) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). Most likely there won't be any 942$0 at all
3) Enable UpdateTotalIssuesOnCirc
4) Check out the item you selected
5) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). That value should now be one greater than before
6) Discharge the item
7) Disable UpdateTotalIssuesOnCirc
8) Check out the item you selected again
9) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). That value should not have changed

Bug 6557: add script to update totalissues from stats

NAME
       update_totalissues.pl

SYNOPSIS
         update_totalissues.pl --use-stats
         update_totalissues.pl --use-items
         update_totalissues.pl --commit=1000
         update_totalissues.pl --since='2012-01-01'
         update_totalissues.pl --interval=30d

DESCRIPTION
       This batch job populates bibliographic records' total issues count
       based on historical issue statistics.

       --help  Prints this help

       -v|--verbose
               Provide verbose log information (list every bib modified).

       --use-stats
               Use the data in the statistics table for populating total
               issues.

       --use-items
               Use items.issues data for populating total issues. Note that
               issues data from the items table does not respect the --since
               or --interval options, by definition. Also note that if both
               --use-stats and --use-items are specified, the count of biblios
               processed will be misleading.

       -s|--since=DATE
               Only process issues recorded in the statistics table since
               DATE.

       -i|--interval=S
               Only process issues recorded in the statistics table in the
               last N units of time. The interval should consist of a number
               with a one-letter unit suffix. The valid suffixes are h
               (hours), d (days), w (weeks), m (months), and y (years). The
               default unit is days.

       --incremental
               Add the number of issues found in the statistics table to the
               existing total issues count. Intended so that this script can
               be used as a cron job to update popularity information during
               low-usage periods. If neither --since or --interval are
               specified, incremental mode will default to processing the
               last twenty-four hours.

       --commit=N
               Commit the results to the database after every N records are
               processed.

       --test  Only test the popularity population script.

WARNING

If the time on your database server does not match the time on your Koha
server you will need to take that into account, and probably use the
--since argument instead of the --interval argument for incremental
updating.

=== TESTING PLAN ===

NOTE: in order to test this script, you will need to have some sort of
circulation data already existing in your Koha installation.

1) Disable UpdateTotalIssuesOnCirc
2) Run: misc/cronjobs/update_totalissues.pl --use-items -t -v
3) If you have total checkout data in your item records (i.e. anything
   in 952$l), you should see messages like "Processing bib 43 (1 issues)"
4) Choose one of the lines that shows more than 0 issues, and view the
   record with that biblionumber in the staff client, choosing the "Items"
   tab (moredetail.pl). Add up the "Total checkouts" listed for each item,
   and confirm it matches what the script reported
5) Run: misc/cronjobs/update_totalissues.pl --use-stats -t -v
6) If you have any circulation statistics in your database (i.e. any
   'issue' entries in your statistics table), you should see messages
   like "Processing bib 43 (1 issues)";
7) Choose one of the lines and view the record with that biblionumber in
   the staff client, choosing the "Items" tab (moredetail.pl). If you
   count the number of checkouts listed in each item's checkout history,
   the total should match what the script reported.
8) Check out an item
9) Run: misc/cronjobs/update_totalissues.pl --use-stats
   --incremental --interval=1h -t -v
10) You should see one line reporting a single circ for the bib record
    associated with the item you just checked out (there may be more if
    you checked out any books in the hour prior to running these tests
11) If the results in steps 4, 7, and 10 match the predictions, the
    script worked

This patch to Koha was sponsored by the Arcadia Public Library and the
Arcadia Public Library Foundation in honor of Jackie Faust-Moreno, late
director of the Arcadia Public Library.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Tested this with my test data - numbers are correct and updated appropriately.

More importantly - if I do a popularity search, the most popular items *come up first*. Amazing.
Bug 6557 follow-up DBRev number
Bug 6557 follow-up UNIMARC 942$0 in default french frameworks
Bug 8311: Fix scoping error in C4::Auth

There is a mis-scoped function call in C4::Auth, on line 154, where
GetMembers is called without explicit scoping and before
'require C4::Members;'. This does not actually have any functional
ramifications as far as I can tell, but it would be a good idea to fix
it.

This patch also corrects a bit of indenting in that area, because it was
an unnecessary challenge to understand the code with the mis-indenting.

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 3280 Restrict Send basket feature

In order to prevent spamming using sendbasket.pl, some counter-measure are done:
 - permit send basket only for authenticated user
 - permit send basket only if basket contains items
 - use username & email for 'Reply-To' field (with fallback to KohaAdminEmailAddress)
 - add field X-Orig-IP with IP of sender
 - add field X-Abuse-Report with KohaAdminEmailAddress

Note: we don't use forged 'To' address with patron email in order to
prevent be marked as spam (by SPF for example).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Bug 8318: Update StatisticsFields preference language

Patch rewritten  from the original one from nengard, that I couldn't apply for an unknown reason

This patch changes around the wording of the StatisticsFields
preference to make it clearer where these values will show.

Signed-off-by: Marc Veron <veron@veron.ch>
Bug 8217: Followup: move code to the document.ready function

Signed-off-by: Mirko Tietgen <5p4m@gmx.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>