Bug 8033: This patch adds print slips to self checkout.

To Test:

Sign in to self checkout.
Enter a barcode and click submit.
Click the finish button
You should be prompted with a message asking if you would like a receipt.
If you click OK you should be taken to the page with the receipt.
If you click Cancel you should not see the reciept and you should be logged out.

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

Added copyright to print slip for SCO

Modified POD and copyright.  Also perltidied

updated print slip option to show on the click of the finish button instead of the submit button

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 8033 follow-up removing tabs in indentation

Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 8033: Change javascipt behavior to degrade nicely

Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 - OPAC Borrower Self Registration

This development will add the ability for a new patron to register
himself or herself. The self-registration will attempt to match this
newly inputted data to any existing patrons and if any possible matches
are found, ask if the patron is sure he or she doesn't already have an
account at the library. A system preference may be set to prevent patron
self-registration if the system detects the possibility that the person
may already have an account.

Once the patron has registered, passing a captcha (or similar
bot-stopper), the patron will then be optionally verified a second time
via email. At this point, the patron will be able to print a temporary
library card (optional by system preference), and will be provided any
details necessary to access electronic resources (this body of text
would be a template in the slips and notices system). At the library's
choice, this new patron would either be set to a temporary patron status
(patron type set via system preference), or a fully-fledged patron
(allow patron type to be determined by age and/or other attributes).
Assuming the library uses temporary patron types for OPAC registrations,
this patron will next enter a queue and would need to physically enter
the library to verify himself and become a fully-fledged patron (most
likely by bringing in physical proof of address, etc.). The librarian
would look up the patron record and modify the patron type. If a
temporary patron has not been verified within a certain time frame
(defined by a system preference), the patron record will be deleted
from the system via a cron job.

For registered patrons, the system will allow each person to also
update his or her personal data via the OPAC. When a patron updates his
or her information, the changes will be entered into a queue to be
verified by a librarian (preventing a patron from inputting obviously
bogus data). The staff client home page will display the number of
patron records with changes awaiting approval. A librarian would then be
able to click through a list of modification requests, and approve or
deny each (with approval and denial alerts being sent to the patron via
the standard messaging system).

NEW SYSTEM PREFERENCES
* PatronSelfRegistration
* PatronSelfRegistrationDetectDuplicates
* PatronSelfRegistrationVerifyByEmail
* PatronSelfRegistrationPrintTemporaryCard
* PatronSelfRegistrationUseTemporaryStatus
* PatronSelfRegistrationExpireTemporaryAccountsDelay

NEW NOTICE
* Verify by email notice

NEW SLIP
* Temporary card slip

NEW CRON JOB
* delete_expired_opac_registrations.pl
  - Deletes patrons that have not been upgraded from the temporary
    status within the specified delay
* delete_unverified_opac_registrations.pl
  - Deletes the unverified patrons based on the length of time specified
    in the PatronSelfRegistrationExpireTemporaryAccountsDelay

The patron will register from self_registration.pl, linked off opac-main.pl if enabled. The registration page will be translatable to other languages in the same way that existing templates are.

Test Plan:
1) Enable PatronSelfRegistration
2) Set PatronSelfRegistrationExpireTemporaryAccountsDelay to a number
   of days
3) Create a self-registered borrower category
4) Set PatronSelfRegistrationUseTemporaryStatus
5) Set PatronSelfRegistrationVerifyByEmail to "Don't require"
6) Go to OPAC, log out if logged in.
7) You should see the "Register here" link below the login box
8) Attempt to register yourself
9) Verify you can log in with your temporary password.
10) Set PatronSelfRegistrationVerifyByEmail to "Require"
11) Attempt another self-registration
12) Check the messages table, you should see a new message with a
    verification link.
13) Copy and paste the link into a web browser to verify the registration
14) Log in with the given credentials to verify the account was created.

Test Plan - Part 2 - Borrower Modifications

1) Log in to OPAC, go to "my personal details" tab.
2) Make some modifications to your details.
3) Repeat steps 1 and 2 for two more borrowers.
4) Log in to Koha intranet with a user that can modify borrowers.
5) At the bottom of mainpage.pl, you should see:
  Patrons requesting modifications: 3
6) Click the link
7) Approve one change, deny a different one, and ignore the third, then
   submit.
8) Check the records, you should see the changes take affect on the
   approved one, and no changes to the other two. You should also see
   "Patrons requesting modifications: 1" at the bottom of mainpage.pl
   now.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Bug 7067 - OPAC Borrower Self Registration - Followup

* Rename PatronSelfRegistrationUseTemporaryStatus to PatronSelfRegistrationDefaultCategory
* Hide register link unless PatronSelfRegistrationDefaultCategory is set.
* Add invalid token page
* Add documentation and switches to cron scripts
* Add required fields check for editing exiting patrons
* Don't force require email address for existing patrons when
  PatronSelfRegistrationVerifyByEmail is enabled.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 [Follow-up: templates] allow patron self registration via the opac

- Adding simple style to register link on home page
- Adding unique ids to new pages and to blocks containing
  registration links
- Adding better page titles and breadcrumb links to some pages
- Correcting bug which meant incorrect message showed on registration
  page when OPACPatronDetails preferences is turned off
- Passing patron details to opac-memberentry.tt so that patron's
  name can be displayed in breadcrumbs
- Improving display in staff client of patron record updates
  waiting to be approved.
- Adding a sort by name to output of pending patron record updates
- Adding updated JqueryUI library files to include expanded widget
  options.

The changes in this patch require the addition of the jQueryUI
Accordion widget. Other pending patches are seeking to add
enough of the other remaining missing widgets that it seems time
to go ahead and add the rest.

Future submissions which add usage of these widgets will have
to be careful to make changes to Koha's CSS where necessary.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067: Followup FIX QA fails

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Fixed minor conflict in C4/Installer/PerlDependencies.pm
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 Followup: FIX merge updatedatabase

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 QA Followup

Adjusts calling conventions to use hashrefs and eliminate redundant
procedural/OO mixed code.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 QA Followup - Add descriptions to tests

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 - QA Followup - Fix failing tests

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 - Fix bad url in breadcrumbs

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 - QA Followup - Fix error when confirming via email

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7067 follow-up: fix updatedatabase.pl formatting
Bug 7067: Increment version number

Database update for bug 7067 has been given version 3.11.00.008
Bug 9056 follow-up: add missing \n to updatedatabase.pl
Merge branch 'bug_9056' into 3.12-master
Bug 9183: Refactor ZOOM event loop

Prior to this patch, there were three identical ZOOM event loops in
C4::Search. This is wasteful, and goes against all good programming
practice. This patch refactors the ZOOM event loops into a separate
subroutine which is called by SimpleSearch, searchResults, and
GetDistinctValues call.

The new routine, _ZOOM_event_loop process the ZOOM event loop and,
once it has been fully processed, passes control to a closure provided
by the calling routine for processing the results, and destroys the
result sets.

To test (after applying patch):
1) Do a regular bibliographic search that should return results.
2) Do a search in the Cataloging module that should return results.
3) If you get results from both searches, the patch works.
Bug 9239: Add QueryParser module to Koha

Although the OpenILS::QueryParser class is going to be moved into a
separate CPAN distribution, this hasn't been done yet, and for ease of
testing it makes sense to include the class in Koha for the moment.
Bug 9239: Introduce QueryParser driver for PQF

Since the most expressive query language supported by Zebra is PQF, this
patch adds a PQF driver for QueryParser which will translate QueryParser
queries into standard PQF (guided by mappings which have been written to
match Koha's existing Zebra configuration) which can then be sent to
Zebra. This driver, Koha::QueryParser::Driver::PQF(::*) extends the
OpenILS::QueryParser(::*) class(es), so as to preserve maximum
interoperability between the various users of the QueryParser driver.

Initially, search syntax is as follows:
* AND operator: &&
* OR operator: ||
* GROUPING operators: ( )

Fields can mostly be searched using the ccl prefixes they have now. The
exception is the various date limits which are searched with a syntax
like this: pubdate(2008)

For sorting, you can simply add #title-sort-az (etc.) to your query.
Bug 9239: Add syspref to enable QueryParser

In light of the experimental nature of the QueryParser code at this
juncture, it behooves Koha to have the option of disabling QP, at least
for the purpose of comparing results between QP-enabled and QP-disabled
searches. This patch adds a UseQueryParser syspref to do just that. In
cases where the user enables QP without having QP installed, however,
there will be no dramatic failure, and Koha will simply fall back to
using the non-QP search code.

In order to reduce the overhead added by the introduction of QueryParser,
this patch adds a C4::Context->queryparser accessor to a static
QueryParser object which is initialized the first time it is required
and then reset thereafter.