Patron Stat Cat Enhancements: Add 'allow free text' and 'required' flags

Add database entities, controller mappings, and HTML/Javascript
widgets to allow administrators to set and persist 'required'
and 'allow free text' boolean flags for patron statistical categories
in the Statistical Categories Editor.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add default entry table to database

Add actor.stat_cat_entry_default table to Pg database.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add stat_cat_entry_default IDL class

Add stat_cat_entry_default IDL class, and links to actor.stat_cat and
actor.stat_cat_entry

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add event for ACTOR_STAT_CAT_ENTRY_DEFAULT_NOT_FOUND

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add OpenSRF methods for retrieving actor stat cat default entries.

Added the methods 'fetch_stat_cat_entry_default' and
'fetch_stat_cat_entry_default_by_stat_cat_and_org' for
fetching stat_cat_entry_default objects.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add OpenSRF CRUD methods for actor statistical category default entries.

Added methods to create, delete, update default entries for patron statistical
categories.  Modified create_stat_cat and create_stat_cat_entry to also create,
update stat_cat_entry_default objects if present in the request.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Link CDBI actor::stat_cat_entry_default to parent entities.

Add relations between actor::stat_cat and actor::stat_cat_entry to actor::stat_cat_entry_default.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add CDBI package actor::stat_cat_entry_default.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add Pg DBI actor::stat_cat_entry_default table and sequence.

Add actor::stat_cat_entry_default->table and
actor::stat_cat_entry_default->sequence.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add Publisher actor methods for stat_cat_entry_default objects.

Add methods actor_stat_cat_entry_default and actor_stat_cat_entry_default_ancestor
to retrieve and populate stat_cat_entry_default objects.  Modify ranged_actor_stat_cat_entry
and fleshed_actor_stat_cat to also include default entry objects, if present.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add permissions for manipulating stat_cat_entry_default.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Add language entities for default stat cat entry labels.

Add label entities for setting a default entry;  rename staff.server.admin.stat_cat.edit_entry_name_submit
to staff.server.admin.stat_cat.edit_entry_submit.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Modify stat cat editor javascript to manipulate patron stat cat default entries.

Add functions, methods, variables to Statistical Categories Editor
javascript to manage patron stat cat default entries.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Modify stat cat editor HTML to manipulate patron stat cat default entries.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Enforce stat_cat "required" flag in patron registration screen

If a patron statistical category is flagged as required, make
the category form field a required field, and validate it before
submitting the form.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Enforce stat_cat "allow_freetext" flag in patron registration screen

If a patron statistical category is flagged to disallow user-provided
entries, make the category form field a FilteringSelect box;  otherwise,
make it a ComboBox.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Fix values stored, then displayed in "Allow freetext" categories

In the patron registration screen:  the widget dijit.form.FilteringSelect
stores the option value, not the displayed value, unlike ComboBox; so store
the FilteringSelect displayedValue, then set the FilteringSelect displayedValue
with the value retrieved from the patron/stat_cat_entry map table.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Rearrange stat cat editor screen

Rearrange the statistical categories editor interface to correctly
display the "Archived" radio buttons along side the other radio
buttons.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: Only show default entry for new patrons

Only display the default entry when registering new patrons.
Otherwise, display the saved value for the patron or nothing.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Patron Stat Cat Enhancements: SQL upgrade statements

Add SQL upgrade statements:  new table stat_cat_entry_default,
new columns 'required' and 'allow_freetext' on actor.stat_cat,
and new permissions to create, delete default entries.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>