LP1203753 AuthProxy barcode login support

When users attempt a barcode-based login with AuthProxy, the system will
determine the username of the user (based on the barcode) and use the
username instead of the barcode for all proxied login attempts.  This
allows users to use their barcodes (or barcode-looking usernames) to
log in via remote authenticators.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
LP1195150 batch update funds alters debits

When a fund is updated via the ACQ batch update bar (along the top of
the PO interface), ensure that any existing fund debits are updated to
use the new fund.  If the selected fund exceeds the balance block
percent, the operation will fail and the  user will be notified.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Fix transposed acq invoice receive table column titles

Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Fix error on deleted hold in transit

May be caused by purging holds combined with "Checkout fills related hold"

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Eliminate a warning in Z3950.pm

Noticed in 06-OpenILS-Application-Search.t:
Odd number of elements in anonymous hash at /usr/local/share/perl/5.10.1/OpenILS/Application/Search/Z3950.pm line 532.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Test for an MFHD warning in 14-OpenILS-Utils.t

Specifically "Cannot compress without pattern data, returning original holdings"

I also added Test::Warn to Makefile.install for Debian and Fedora.

--
Bill moved the @comp_holdings variable declaration outside of the
warning_like block to avoid a new warning:

Name "main::comp_holdings" used only once: possible typo at
t/14-OpenILS-Utils.t line 42.
---

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
The check library for Debian and Fedora

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
C unit test examples for Evergreen

Building off of Kevin Beswick's work in OpenSRF

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
pgTAP examples

These specific ones do not assume stock test data such as the concerto bibs, and
I think such tests should go elsewhere.  You need to install pgTAP.  I did the
following for my test environment:

    git clone git://github.com/theory/pgtap.git
    cd pgtap
    make
    make installcheck
    sudo make install

Then in my Evergreen database with psql, I did:

    CREATE EXTENSION pgtap;

I also installed a CPAN module to get pg_prove:

    sudo cpan TAP::Parser::SourceHandler::pgTAP

You can use psql to run a given test like so:

opensrf@dev141:~/git/Evergreen/Open-ILS/src/sql/Pg/t (pgtap)$ psql -d evergreen -f 0799.state_field_required_toggle.s
1..4
ok 1 - actor.usr_address.state does not have the NOT NULL constraint
ok 2 - ui.patron.edit.au.state.require exists
ok 3 - ui.patron.edit.au.state.show exists
ok 4 - ui.patron.edit.au.state.suggest exists

Or you can use pg_prove on all or some of them:

opensrf@dev141:~/git/Evergreen/Open-ILS/src/sql/Pg/t (pgtap)$ pg_prove -d evergreen *.s
0799.state_field_required_toggle.s .. ok
dewey.s ............................. 1/6
 # Failed (TODO) test 6: "testing prefix plus decimal"
 #     'YR_DVD_800_100000000000000'
 #         <
 #     'YR_000000000000000_DVD_900'
dewey.s ............................. ok
schema.s ............................ ok
versions.s .......................... ok
All tests successful.
Files=4, Tests=39,  0 wallclock secs ( 0.05 usr  0.03 sys +  0.13 cusr  0.07 csys =  0.28 CPU)
Result: PASS

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
start adding pgTAP test cases

pgTAP is a PostgreSQL unit testing framework; about which
more can be found at http://pgtap.org/

This commit introduces the first pgTAP test case, which exercises
the NACO normalization functions.

To run the tests, install pgTAP, create an Evergreen database that
contains (for now) just the seed data, and from the top of the
source tree run

pg_prove -vr -U evergreen Open-ILS/src/sql/Pg/t/*

Replace '-U evergreen' with the psql command-line switches
needed to access your database.

To install pgTAP on a Debian Wheezy system, you can do:

Then, to load the pgTAP extension into the database, run

psql> CREATE EXTENSION pgtap;

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
use .pg extension for pgTAP test cases

That way, pg_prove --recurse t/ will DWIM.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
add regression test for LP#1155329

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Use the .pg extension

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
make-pgtap-tests.pl

For seeding a baseline set of pgTAP tests for Evergreen.  By default, assumes
PostgreSQL is running on localhost at port 5432 with a database name of
"evergreen", and with an "evergreen" user configured with password "evergreen".

Command-line options for tweaking these are

    -db_name=? -db_host=? -db_port=? -db_user=? -db_pw=?

Make sure to install pgTAP (probably best do it from source for all the
assertion functions we're using) for the database you want to run the tests
against.

I did the following for my test environment:

    git clone git://github.com/theory/pgtap.git
    cd pgtap
    make
    make installcheck
    sudo make install

Then in my Evergreen database with psql, I did:

    CREATE EXTENSION pgtap;

I also installed a CPAN module to get pg_prove:

    sudo cpan TAP::Parser::SourceHandler::pgTAP

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
LP1204273 - Repair org unit settings for making state not required

As noted by tsbere in IRC, the org unit settings were using "au" instead of "aua"
which led to issues applying the settings and making the addresses require the
state field.

Also, change the constraint for field_name on actor.org_unit_setting_type_log to
be "DEFERRABLE INITIALLY DEFERRED" to be more flexible and consistent with other
parts of the database relating to org unit setting names.

And, the table auditor.actor_usr_address_history needs to be updated so that
state can be NULL there as well.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Stamping upgrade script for LP1204273.

Repair org unit settings for making state not required

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>