LP1193095 lineitem batch actions sanity filters

Avoid applying the following actions to lineitems which are in a state
where each action makes no sense.

The following actions are affected.  For each, the set of states for
which a lineitem must be in for the action to proceed is listed.

create PO
    - new selector-ready order-ready approved
add to PO
    - new selector-ready order-ready approved
create invoice
    - !cancelled
add to invoice
    - !cancelled
cancel lineitem
    - !cancelled
mark selector ready
    - new
mark order ready
    - new selector-ready
mark received
    - pending-order on-order

Depending on the interface, some top-level lineitem actions may be
globally disabled.  The list of states listed above represent the bare
minimum requirements.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Add Zoom support to browser views

Currently tied to CTRL with +/-/0 like Firefox uses.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
LP#1084758 store staff client tpac (etc) zoom pref

Staff client pages loaded via browser.xul which have a name (via
internal XUL URL param) now have the ability to store and load a per-
page zoom value preference.  This includes (at minimum) the embedded
TPAC.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Optimize container filters in QueryParser

When a container filter is used at the top level of a QueryParser
query (that is, in a simple query with no OR-logic branches or explicit
nesting groups) we can use an INNER join instead of LEFT + IS NOT NULL.

On some production datasets this showed an increase in performance from
20+ seconds to 1ms for the core query.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
internal: allow checkout ui to set statusbar

Minor bug fix and geared toward future functionality

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
internal: default_focus not called

Minor bug. Was being called in an else clause dependent on some help context
logic for new tabs, but should be called for every new tab. Shouldn't result
in any end-user visible change, but if interfaces wrapped in browser.js were
to have a default_focus function, then this could come into play.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
internal: an alternative to default_focus

Interfaces can now set event listeners on their window for 'tab_focus' instead
of defining a single default_focus function.

We also include a change to browser.js so that embedded interfaces also get
their default_focus function called (and a tab_focus event sent).

This is geared to help future functionality, but shouldn't produce any end-user
visible changes by itself.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
internal: JSAN socket library

Leverages Mozilla's nsISocketTransportService, nsIScriptableInputStream, and
nsIInputStreamPump XPCOM, and the NetUtils javascript module.

    Usage example:

    Install netcat on a server and as root do:  nc -l -p 5000

    Then, in the staff client, load Admin -> For Developers -> Javascript Shell

    Enter:

    JSAN.use('util.socket');
    var s = new util.socket('server hostname or IP address here', 5000);
    s.write('hello\n');

    On the server, reply with world<enter>

    Back in the javascript shell, use

    s.read();

This is geared to help with implementing future functionality, but shouldn't
result in any end-user visible changes by itself.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
JSAN module autoloader for "add-ons"

This adds a "Server Add-ons" menu entry under Admin -> Workstation
Administration in the staff client.  Choosing this allows you to edit or set a
list of identifiers that correspond to JSAN-style modules found in
/server/addons/, and is meant mainly for activating 3rd party modules within the
staff client on a per-workstation basis.  You need the
ADMIN_SERVER_ADDON_FOR_WORKSTATION permission to use it.

Configuration options for activated add-ons may also show up in this interface.

More technical details:

This Server Add-ons list is stored as a JSON array in the Mozilla preference
'oils.addon.autoload.list'.

We also add an addon.autoloader module that gets called in most XUL interfaces
via the util_overlay file.  This autoloader will loop through the modules
specified in 'oils.addon.autoload.list' and instantiate each, storing a
reference to each of the newly created objects in a data structure in
window.oils_autoloaded.

So, as an example, let's say there is a module: /xul/server/addon/uber_scan.js
And we have the identifier 'uber_scan' in our Server Add-ons list.  Then, on
every page load of a XUL interface using the stock util overlay, we will
effectively call:

    new addon.uber_scan();

Causing the code in the module to execute.  It is up to the module to determine
whether it needs to do anything within a given interface.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>

Conflicts [permission numbering]:
	Open-ILS/src/sql/Pg/950.data.seed-values.sql
P.V. SUPA GoodStuff integration

This impliments a "Server Add-ons" module for integrating P.V. Supa's RFID
product known as GoodStuff with the Evergreen staff client.

To activate it, you should add the identifier "pv_supa_goodstuff" (without the
quotes) to the list managed by the Admin->Workstation Administration->Server
Add-ons menu action within the staff client.  You will need the
ADMIN_SERVER_ADDON_FOR_WORKSTATION permission to do this.

After doing this and clicking the Update Active Add-Ons button, the interface
will refresh and show a GoodStuff tab in the Add-on Preferences section.  Within
this tab you will have the option of specifying the hostname and port for the
GoodStuff hardware. There is also an "Enabled" setting that needs to be checked.

Currently three interfaces have been integrated:
* Circulation -> Check In Items
* Circulation -> Check Out Items (where you scan the patron barcode)
* Circulation -> Check Out Items (where you scan the item barcodes)

Each interface gets an RFID checkbox if the "Enabled" preference has been set,
that can activate/deactivate the functionality on a per interface basis.  The
checkbox states persist (i.e. are sticky).

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Stamping P.V. SUPA upgrade scripts

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Allow action trigger events to be repeated

Currently, there is no way to repeat an event (action/trigger) when a
real-world event occurs more than once for the same target. This only
matters for targets that are persistent (such as a library card)
combined with events that can reoccur (such as expiration, if the
expiration can be removed). To address this, we add a new field to the
action_trigger.event_definition table that sets the amount of time
after which the event is allowed to repeat.

This commit adds the new field to the IDL, database schema and template
files and also provides the simple db upgrade script. It is worth noting
that we chose to base the repeatability on the start_time of the previous
event, which is more predictable than complete_time (which could be null
if the event fails).

Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Release notes for Action Trigger Event Repeatability

Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Stamping upgrade script for repeatable events

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Allow translation of acq.cancel_reason texts.

Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
LP#856688 OUS to disable org unit as hold pickup lib

YAOUS that removes an org unit from consideration as a hold pickup
library.  This setting only affects the OPAC display and does not
otherwise affect the display of the org unit in the OPAC.  (In other
words, it's not the same thing as actor.org_unit.opac_visible).  It also
has no affect on hold targeting / capturing.

[LFW: Numbered upgrade script.]

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fix PCrudFilterPane generating illegal queries when using the "not like" and "not between" operators.

Make the window remember the user-input value even when changing the operator.

[LFW: whitespace fixes - the original commit had real tabs, which we avoid
in some files, including .js ones.]

Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>