Add Circulation file.
Use image macro formatting.
Rename image files fix.
Add missing .png extension.
LP#928896 improve row estimate for action.usr_visible_circ_copies()

Fixes problem where use of this function by the tagging circs in search
results feature can result in sequential scans of asset.call_number.

Thanks to Mike Rylander for the suggestion.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Stamping upgrade for LP#928896

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Stream results from targetable holds list retrieval

Tested and slightly modified patch from Mike R. to improve multi-session
hold targeting.  This patch includes an update to the targetable holds
API call to stream results instead of returning them in 1 big chunk,
which has been known to result in messages too large for jabber
(max_stanza_size).  hold_targer.pl is updated to handle the stream.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Booking: make pick up interface show resources captured for reservation ...

... even beyond the first day of the reservation.  I can think of no
reason why this limitation existed in the first place.

Also, just replace naive_start_of_day() with "today"

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
TPac: facet display filtering and sorting

Provides the ability (via config.tt2) to define which facets should
display and the order of facet display.  The behavior is consistent with
the openils.widget.FacetSidebar Dojo class, used in JSPAC.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
LP#820006: Action trigger notices fixes

Cleaned up action triggers a little bit.

1. Added the editor param to the auto lost, because triggers will fail
without this.

2. Also removed the use of simple_records in some of the notices and
changed it to something more efficient.

3. Changed the use of total money owed to balance owed.

Signed-off-by: Steven Callender <stevecallender@esilibrary.com>
Signed-off-by: Dan Scott <dan@coffeecode.net>
Fix up 3-day courtesy notice with better title / author too

Use the helper function to get better quality title/author out of the
target copy for pre-due notices.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Fix typos in lp820006 that broke clean schema creation

Backslashes to escape single quotes in SQL aren't cool.

Also, lists of rows to insert need commas as delimiters.

Also, needed a trailing "]" on the 90-day lost notice template.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Vandelay record match sets: fix bug loading some trees

Reported to me by Bill Erickson.  The Vandelay Record Match Sets
interface was failing to load some simple trees of match set points.

Example: http://pastesite.com/31643

The proximate symptom was this error message:

    Error: dojo.data.ItemFileReadStore: Invalid item argument.
    Source File: http://dev198.esilibrary.com/js/dojo/dojo/dojo.js
    Line: 119

but the root cause was a problem in dojoize_match_set_tree(), which
was failing to generate unique identifiers for each item in the data
store it's responsible for generating.

Since that function is only ever used to deal with trees where all the
nodes come from the database and have actual IDs, that function now uses
the database IDs as is rather than attempting to generate new ones.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Add booking and booking administration files to master.
Add images to the booking documentation provided by SITKA. Thank you SITKA!
Escape content when generating DTD for fieldmapper

Noticed by Thomas Berezansky, if a translation in a PO or POT file
contains an unescaped left angle bracket, a DTD will be generated that
contains the unescaped left angle bracket - and that isn't valid.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Correct special winter handling in predictions

The current serials prediction code has an exception for handling
cases where 'Winter 2010' is followed by 'Spring 2010' rather than
'Spring 2011'.  This exception assumed the more common case of a
combined subfield $y, e.g.:

$yps21,22,23,24

In doing so, it incorrectly handled less common cases where the $y
is listed separately:

$yps21$yps22$yps23$yps24

This change (with test data) ensures we only check the first $y
for our 'early winter' exception.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
AutoSuggest

Get an autocompleting dialog underneath basic search boxes.

If activated, the dialog appears in both the JavaScript OPAC and the Template
Toolkit OPAC.

Mike Rylander and Bill Erickson largely designed and spec'ed out this
feature, especially at the database level.  Lebbeous Fogle-Weekley and
Mike Rylander did the programming.

How it works, for site administrators
-------------------------------------

Once the code is installed, including database stored procedures,
(re)ingesting your bibliographic records will populate two new tables
needed by AutoSuggest: metabib.browse_entry and metabib.browse_entry_def_map.

Yes, for now this means that the size of your database in per-record terms
will be greater.  The browse_entry data we generate is extremely similar to
facet data, so it's possible that in the future we can blend them into the
same thing at the database level, and save some space.

To control what gets indexed in the metabib.browse_* tables, set the
boolean 'browse_field' column for each row in config.metabib_field as desired
Numbers 15 (keyword|keyword) and 16 (subject|complete) should generally be set
to false.

The config.metabib_class  table has a new 'bouyant'
column.  Setting this to true means that when a user is typing in the OPAC
search box with a search class selector set to, say, 'Subject', and the cmc row
for 'Subject' has 'bouyant' set to true, the top suggestions will definitely
come from the Subject fields of MARC records (if any).  'restrict' is like
'bouyant', only stronger.  In that case suggestions /only/ come from the
selected class.

This is the idea behind the 'restrict' column (in both the
config.metabib_class table and the config.metabib_field table):
For any given class or field, if restrict is true AND the user at the OPAC
has selected that same class or field from the search class dropdown, then
autosuggestions will only come from that class or field in the record.

You never want this column to be true for keyword, because we don't index
keywords for browse/autosuggest purposes (we would get giant blobs of
information as autosuggestions, and you don't want that (really)).

You don't really want it to be true for most classes and fields.
If the user sets the dropdown to "subject" and start typing "harry potter",
the user really wants matches from the "title" class too (although other
things being equal, matches from the "subject" class will rise to the top).

If you have a speciality index, you *may* want to set restrict to true
for that particular field.  For a song title index, for example.  To take
advantage of this, you would also have to customize your OPAC to have an
entry in the search class dropdown for 'title|songtitle' (or whatever's
appropriate for your specialty index).  This is easy to do and should be
covered somewhere in documentation for both the JSPAC and the TPAC.

The order of suggestions otherwise has mostly to do with how well what users
have typed matches what's in your bib records, and the value of the weight
column of the relevant config.metabib_field row.  Examine the code if you're
curious to know more or want to make adjustments.

The master on/off switch for AutoSuggest is a new row in in config.global_flag
named 'opac.use_autosuggest'.  Set its 'enabled' column to false to turn
off AutoSuggest.  If you don't want your suggestions to be limited to whatever's
OPAC visible at the search org, set the 'value' column to anything that
does not contain the string 'opac_visible'.  This could be a good idea
if AutoSuggest seems slow on a large site.

Turning this on means introducing Dojo in your TPAC.  I tried to
keep it minimal, for load time's sake.  There's no fieldmapper or IDL stuff
play.  For now, turning this feature off will avoid loading Dojo in your
TPAC.

Managing the little stuff
-------------------------
CSS classes that affect the look of suggestions are in this file for the TPAC:
    Open-ILS/web/css/skin/default/opac/style.css

and in this file for the JSPAC:
    Open-ILS/web/opac/skin/default/css/layout.css

At bottom, autosuggest is shaped by PostgreSQL's Full Text Search features.
Some of the arguments that are passed to TS_RANK_CD() and TS_HEADLINE() are
expoposed via options to the openils.widget.AutoSuggest and
openils.AutoSuggestStore modules, which have comments.  You can customize your
OPAC files to invoke these with your desired options without touching much
actual code.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
AutoSuggest: Make directly clicking a suggestion initiate search

Formerly, I thought it best not to do this, so that users could choose a
suggestion and refine their search term further, but that put the
widget's behavior at odds with that of certain ubiquitous search
engines.

Users can still highlight a suggestion and press tab to modify their
search further before submitting, if they wish (and if they know this or
figure it out somehow).

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
AutoSuggest: more UI tweaks regarding typing after selecting

Avoid highlighting text in the textbox part of the autosuggest widget,
so that if the user wants to type more after selecting a suggestion with the
arrow keys, s/he doesn't clobber the existing part.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>