Merged revisions 9444-9445,9447-9450,9452-9453,9456,9458,9460-9462,9464-9474,9476...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 5 May 2008 00:58:16 +0000 (00:58 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 5 May 2008 00:58:16 +0000 (00:58 +0000)
svn://svn.open-ils.org/ILS/trunk

........
  r9444 | miker | 2008-04-23 22:30:21 -0400 (Wed, 23 Apr 2008) | 1 line

  use 001 as the authority record number value
........
  r9445 | miker | 2008-04-23 23:02:32 -0400 (Wed, 23 Apr 2008) | 1 line

  initial vandelay schema
........
  r9447 | miker | 2008-04-24 12:50:56 -0400 (Thu, 24 Apr 2008) | 1 line

  adding vandelay IDL section
........
  r9448 | miker | 2008-04-24 16:10:54 -0400 (Thu, 24 Apr 2008) | 1 line

  add translation support to the, um, translation widget; add example es-us translation
........
  r9449 | miker | 2008-04-24 16:29:54 -0400 (Thu, 24 Apr 2008) | 1 line

  moving es-us to es to catch all es-*
........
  r9450 | miker | 2008-04-24 16:39:34 -0400 (Thu, 24 Apr 2008) | 1 line

  typo in translate
........
  r9452 | erickson | 2008-04-25 16:33:10 -0400 (Fri, 25 Apr 2008) | 4 lines

  forward-porting merge_bib_records perm and adding it to the seed data
........
  r9453 | miker | 2008-04-26 12:05:14 -0400 (Sat, 26 Apr 2008) | 1 line

  sql script for upgrading to a materialized version of the simple record view (reporting speed)
........
  r9456 | miker | 2008-04-26 12:13:13 -0400 (Sat, 26 Apr 2008) | 1 line

  add reporter.materialized_simple_record to the base schema
........
  r9458 | miker | 2008-04-26 12:49:25 -0400 (Sat, 26 Apr 2008) | 1 line

  base materialized simple record on old super_simple_record
........
  r9460 | miker | 2008-04-26 14:05:58 -0400 (Sat, 26 Apr 2008) | 1 line

  allow deleted records to be visible
........
  r9461 | dbs | 2008-04-27 21:11:04 -0400 (Sun, 27 Apr 2008) | 2 lines

  Kill one JavaScript warning for an apparent typo
........
  r9462 | dbs | 2008-04-27 21:25:36 -0400 (Sun, 27 Apr 2008) | 2 lines

  Clean up trailing comma
........
  r9464 | dbs | 2008-04-27 21:34:29 -0400 (Sun, 27 Apr 2008) | 2 lines

  ECMA-262 isn't happy when variables are declared without var...
........
  r9465 | dbs | 2008-04-27 22:40:20 -0400 (Sun, 27 Apr 2008) | 2 lines

  Silence a few more trailing comma warnings
........
  r9466 | dbs | 2008-04-27 22:41:50 -0400 (Sun, 27 Apr 2008) | 2 lines

  And silence a few more trailing comma warnings
........
  r9467 | dbs | 2008-04-27 22:57:52 -0400 (Sun, 27 Apr 2008) | 2 lines

  Silence some more trailing comma warnings
........
  r9468 | dbs | 2008-04-27 23:00:50 -0400 (Sun, 27 Apr 2008) | 2 lines

  Silence another trailing comma warning
........
  r9469 | dbs | 2008-04-27 23:13:43 -0400 (Sun, 27 Apr 2008) | 2 lines

  ue.xhtml goes nuts with &quot; if we escape the calendar script
........
  r9470 | dbs | 2008-04-27 23:38:54 -0400 (Sun, 27 Apr 2008) | 2 lines

  Declare the globalOrgTypes var to silence another warning
........
  r9471 | dbs | 2008-04-27 23:43:59 -0400 (Sun, 27 Apr 2008) | 2 lines

  Silence a few more trailing comma warnings
........
  r9472 | dbs | 2008-04-27 23:52:44 -0400 (Sun, 27 Apr 2008) | 2 lines

  Silence a lot more trailing comma warnings
........
  r9473 | miker | 2008-04-28 01:08:58 -0400 (Mon, 28 Apr 2008) | 1 line

  made translation widget self-contained
........
  r9474 | miker | 2008-04-28 03:42:25 -0400 (Mon, 28 Apr 2008) | 1 line

  fixing translator for grids
........
  r9476 | miker | 2008-04-28 08:15:25 -0400 (Mon, 28 Apr 2008) | 1 line

  improved concurrency detection
........
  r9477 | dbs | 2008-04-28 11:24:37 -0400 (Mon, 28 Apr 2008) | 2 lines

  x.y.z for egg versions seems to satisfy setuptools and avoid first-time install errors
........
  r9479 | miker | 2008-04-28 14:19:37 -0400 (Mon, 28 Apr 2008) | 1 line

  1.2.1 to 1.2.2 upgrade SQL script; will get 1.2 to 1.4/2.0 as well
........
  r9481 | dbs | 2008-04-29 09:48:20 -0400 (Tue, 29 Apr 2008) | 2 lines

  Try giving our application a default locale
........
  r9482 | dbs | 2008-04-29 09:49:05 -0400 (Tue, 29 Apr 2008) | 2 lines

  Remove duplicate span id
........
  r9483 | dbs | 2008-04-29 09:49:47 -0400 (Tue, 29 Apr 2008) | 2 lines

  JavaScript strictness cleanup to reduce warning noise at console
........
  r9484 | dbs | 2008-04-29 10:25:52 -0400 (Tue, 29 Apr 2008) | 2 lines

  Silence more trailing comma warnings
........
  r9486 | miker | 2008-04-29 13:50:09 -0400 (Tue, 29 Apr 2008) | 1 line

  protecting against existing views
........
  r9490 | miker | 2008-04-30 00:50:12 -0400 (Wed, 30 Apr 2008) | 1 line

  adding some more billing report views
........
  r9492 | miker | 2008-04-30 08:17:45 -0400 (Wed, 30 Apr 2008) | 1 line

  protect against empty folder names
........
  r9494 | miker | 2008-04-30 08:30:18 -0400 (Wed, 30 Apr 2008) | 1 line

  bz#618, stop duplicate authority cross-ref suggestions
........
  r9496 | miker | 2008-04-30 18:19:36 -0400 (Wed, 30 Apr 2008) | 1 line

  use org_unit datatype for easier filtering
........
  r9498 | miker | 2008-04-30 22:47:09 -0400 (Wed, 30 Apr 2008) | 1 line

  typo in field name
........
  r9505 | erickson | 2008-05-03 07:58:45 -0400 (Sat, 03 May 2008) | 1 line

  added additional needed script path to sip config
........
  r9506 | miker | 2008-05-04 19:51:08 -0400 (Sun, 04 May 2008) | 1 line

  break up the transactions a bit more, and move DROPs outside of transactions, as they are allowed to fail
........

git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9507 dcc99617-32d9-48b4-a31d-7c20da2025e4

40 files changed:
Open-ILS/examples/apache/eg_vhost.conf
Open-ILS/examples/fm_IDL.xml
Open-ILS/examples/oils_sip.xml.example
Open-ILS/src/extras/fieldmapper.pl
Open-ILS/src/extras/import/marc2are.pl
Open-ILS/src/extras/org_tree_js.pl
Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm
Open-ILS/src/python/setup.py
Open-ILS/src/sql/Pg/002.functions.config.sql
Open-ILS/src/sql/Pg/012.schema.vandelay.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/1.2.1-1.2.2-upgrade-db.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/example.reporter-extension.sql
Open-ILS/src/sql/Pg/reporter-schema.sql
Open-ILS/web/conify/global/admin.js
Open-ILS/web/conify/global/config/copy_status.html
Open-ILS/web/conify/global/permission/perm_list.html
Open-ILS/web/conify/global/permission/perm_list.js
Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js
Open-ILS/web/js/dojo/openils/widget/nls/TranslatorPopup.js [new file with mode: 0644]
Open-ILS/web/js/dojo/openils/widget/nls/es/TranslatorPopup.js [new file with mode: 0644]
Open-ILS/web/opac/common/js/utils.js
Open-ILS/web/opac/skin/default/js/result_common.js
Open-ILS/web/reports/oils_rpt_folder_window.js
Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/util/browser.js
Open-ILS/xul/staff_client/chrome/content/util/deck.js
Open-ILS/xul/staff_client/chrome/content/util/error.js
Open-ILS/xul/staff_client/chrome/content/util/list.js
Open-ILS/xul/staff_client/chrome/content/util/network.js
Open-ILS/xul/staff_client/chrome/content/util/print.js
Open-ILS/xul/staff_client/defaults/preferences/prefs.js
Open-ILS/xul/staff_client/server/cat/marc_new.xul
Open-ILS/xul/staff_client/server/cat/marcedit.js
Open-ILS/xul/staff_client/server/main/ws_info.xul
Open-ILS/xul/staff_client/server/patron/ue.xhtml
Open-ILS/xul/staff_client/server/patron/ue_config.js
Open-ILS/xul/staff_client/server/patron/util.js

index 7716719..58cb576 100644 (file)
@@ -103,6 +103,7 @@ OSRFGatewayConfig /openils/conf/opensrf_core.xml
 # ----------------------------------------------------------------------------------
 <LocationMatch /xul/.*\.xhtml$>
     Options +Includes
+    XMLEntEscapeScript "no"
     AddOutputFilter INCLUDES;XMLENT .xhtml
     allow from all
 
index 2f216be..40ce499 100644 (file)
@@ -136,6 +136,256 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
 
        <!-- Actually in the DB -->
+       <class id="vbq" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::bib_queue" oils_persist:tablename="vandelay.bib_queue" reporter:label="Import/Overlay Bib Queue">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Queue ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
+                       <field reporter:label="Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Name" name="name" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+                       <field reporter:label="Complete" name="complete" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="bool"/>
+                       <field reporter:label="Type" name="queue_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Purpose" name="queue_purpose" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
+               </fields>
+               <links>
+                       <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
+               </links>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <retrieve permission="CREATE_BIB_IMPORT_QUEUE|UPDATE_BIB_IMPORT_QUEUE|DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vqbr" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::queued_bib_record" oils_persist:tablename="vandelay.queued_bib_record" reporter:label="Queued Bib Record">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Record ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+                       <field reporter:label="Create Time" name="create_time" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field reporter:label="Import Time" name="import_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field reporter:label="MARC" name="marc" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Queue" name="queue" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Bib Source" name="bib_source" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Final Target Record" name="imported_as" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
+               </fields>
+               <links>
+                       <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
+                       <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
+                       <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
+               </links>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <retrieve permission="CREATE_BIB_IMPORT_QUEUE|UPDATE_BIB_IMPORT_QUEUE|DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vqbrad" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::bib_attr_definition" oils_persist:tablename="vandelay.bib_attr_definition" reporter:label="Queued Bib Record Attribute Definition">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+                       <field reporter:label="Code" name="code" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Description" name="description" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+                       <field reporter:label="XPath" name="xpath" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Remove RegExp" name="remove" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Is Identifier?" name="ident" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
+               </fields>
+               <links/>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
+                               <retrieve permission="CREATE_BIB_IMPORT_IMPORT_FIELD_DEF|UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF|DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
+                               <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
+                               <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vqbra" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::queued_bib_record_attr" oils_persist:tablename="vandelay.queued_bib_record_attr" reporter:label="Queued Bib Record Attribute">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Attribute ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+                       <field reporter:label="Record" name="record" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Field" name="field" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Value" name="attr_value" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+               </fields>
+               <links>
+                       <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
+                       <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
+               </links>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <retrieve permission="CREATE_BIB_IMPORT_QUEUE|UPDATE_BIB_IMPORT_QUEUE|DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vbm" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::bib_match" oils_persist:tablename="vandelay.bib_match" reporter:label="Queued Bib Record Match">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Match ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+                       <field reporter:label="Queued Record" name="queued_record" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Matched Attribute" name="field" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Evergreen Record" name="eg_record" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Field Type" name="field_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+               </fields>
+               <links>
+                       <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
+                       <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
+                       <link field="matched_attr" reltype="has_a" key="id" map="" class="vqbra"/>
+               </links>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <retrieve permission="CREATE_BIB_IMPORT_QUEUE|UPDATE_BIB_IMPORT_QUEUE|DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
+                               <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vaq" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::authority_queue" oils_persist:tablename="vandelay.authority_queue" reporter:label="Import/Overlay Authority Queue">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Queue ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
+                       <field reporter:label="Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Name" name="name" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+                       <field reporter:label="Complete" name="complete" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="bool"/>
+                       <field reporter:label="Type" name="queue_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Purpose" name="queue_purpose" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
+               </fields>
+               <links>
+                       <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
+               </links>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE|UPDATE_AUTHORITY_IMPORT_QUEUE|DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vqar" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::queued_authority_record" oils_persist:tablename="vandelay.queued_authority_record" reporter:label="Queued Authority Record">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Record ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+                       <field reporter:label="Create Time" name="create_time" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field reporter:label="Import Time" name="import_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field reporter:label="MARC" name="marc" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Queue" name="queue" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Final Target Record" name="imported_as" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
+               </fields>
+               <links>
+                       <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
+                       <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
+               </links>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE|UPDATE_AUTHORITY_IMPORT_QUEUE|DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vqarad" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::authority_attr_definition" oils_persist:tablename="vandelay.authority_attr_definition" reporter:label="Queued Authority Record Attribute Definition">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+                       <field reporter:label="Code" name="code" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Description" name="description" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+                       <field reporter:label="XPath" name="xpath" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Remove RegExp" name="remove" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Is Identifier?" name="ident" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
+               </fields>
+               <links/>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
+                               <retrieve permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF|UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF|DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
+                               <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
+                               <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vqara" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::queued_authority_record_attr" oils_persist:tablename="vandelay.queued_authority_record_attr" reporter:label="Queued Authority Record Attribute">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Attribute ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+                       <field reporter:label="Record" name="record" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Field" name="field" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Value" name="attr_value" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+               </fields>
+               <links>
+                       <link field="record" reltype="has_a" key="id" map="" class="vaqr"/>
+                       <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
+               </links>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE|UPDATE_AUTHORITY_IMPORT_QUEUE|DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+       <class id="vam" controller="open-ils.cstore" oils_obj:fieldmapper="vandelay::authority_match" oils_persist:tablename="vandelay.authority_match" reporter:label="Queued Authority Record Match">
+               <fields oils_persist:primary="code" oils_persist:sequence="">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Match ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+                       <field reporter:label="Queued Record" name="queued_record" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Matched Attribute" name="field" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Evergreen Record" name="eg_record" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
+               </fields>
+               <links>
+                       <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
+                       <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
+                       <link field="matched_attr" reltype="has_a" key="id" map="" class="vqbra"/>
+               </links>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE|UPDATE_AUTHORITY_IMPORT_QUEUE|DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                               <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
+
+
        <class id="auoi" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_org_unit_opt_in" oils_persist:tablename="actor.usr_org_unit_opt_in" reporter:label="User Sharing Opt-in">
                <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
@@ -865,7 +1115,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                <links>
                        <link field="editor" reltype="has_a" key="id" map="" class="au"/>
                        <link field="creator" reltype="has_a" key="id" map="" class="au"/>
-                       <link field="simple_record" reltype="might_have" key="id" map="" class="rssr"/>
+                       <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
                        <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
                        <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
                        <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
@@ -3513,6 +3763,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
                </links>
        </class>
+       <class id="rmsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::materialized_simple_record" oils_persist:tablename="reporter.materialized_simple_record" reporter:label="Fast Simple Record Extracts">
+               <fields oils_persist:primary="id">
+                       <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+                       <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+                       <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+                       <field reporter:label="Record ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
+                       <field reporter:label="Fingerprint" name="fingerprint" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Overall Record Quality" name="quality" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="int"/>
+                       <field reporter:label="TCN Source" name="tcn_source" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="TCN Value" name="tcn_value" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Title Proper (normalized)" name="title" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Author (normalized)" name="author" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Publisher (normalized)" name="publisher" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Publication Year (normalized)" name="pubdate" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="int"/>
+                       <field reporter:label="ISBN" name="isbn" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="ISSN" name="issn" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Full Bibliographic record" name="biblio_record" oils_obj:array_position="14" oils_persist:virtual="true" reporter:datatype="link"/>
+               </fields>
+               <links>
+                       <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
+               </links>
+       </class>
        <class id="rssr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::super_simple_record" oils_persist:tablename="reporter.super_simple_record" reporter:label="Simple Record Extracts">
                <fields oils_persist:primary="id">
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
@@ -3907,6 +4179,105 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
         </links>
     </class>
 
+    <class id="rmocbbol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_owning_lib" oils_persist:tablename="money.open_circ_balance_by_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by Owning Library">
+        <fields oils_persist:primary="id">
+            <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+            <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+            <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+            <field reporter:label="Circulation ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
+            <field reporter:label="Owning Library" name="owning_lib" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Billing Type" name="billing_type" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
+            <field reporter:label="Total Billed" name="billed" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="money"/>
+        </fields>
+        <links>
+            <link field="id" reltype="has_a" key="id" map="" class="circ"/>
+            <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
+        </links>
+    </class>
+
+    <class id="rmobbol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_owning_lib" oils_persist:tablename="money.open_balance_by_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by Owning Library">
+        <fields oils_persist:primary="owning_lib">
+            <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+            <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+            <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+            <field reporter:label="Owning Library" name="owning_lib" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Billing Types" name="billing_types" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
+            <field reporter:label="Balance" name="balance" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money"/>
+        </fields>
+        <links>
+            <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
+        </links>
+    </class>
+
+    <class id="rmocbbcol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_circ_and_owning_lib" oils_persist:tablename="money.open_circ_balance_by_circ_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by Circulating Library and Owning Library">
+        <fields oils_persist:primary="id">
+            <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+            <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+            <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+            <field reporter:label="Circulation ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
+            <field reporter:label="Circulating Library" name="circ_lib" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Owning Library" name="owning_lib" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Billing Type" name="billing_type" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+            <field reporter:label="Total Billed" name="billed" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="money"/>
+        </fields>
+        <links>
+            <link field="id" reltype="has_a" key="id" map="" class="circ"/>
+            <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
+            <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
+        </links>
+    </class>
+
+    <class id="rmobbcol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_circ_and_owning_lib" oils_persist:tablename="money.open_balance_by_circ_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by Circulating Library and Owning Library">
+        <fields oils_persist:primary="circ_lib">
+            <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+            <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+            <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+            <field reporter:label="Circulating Library" name="circ_lib" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Owning Library" name="owning_lib" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Billing Types" name="billing_types" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
+            <field reporter:label="Balance" name="balance" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="money"/>
+        </fields>
+        <links>
+            <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
+            <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
+        </links>
+    </class>
+
+    <class id="rmocbbhol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_usr_home_and_owning_lib" oils_persist:tablename="money.open_circ_balance_by_usr_home_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by User Home Library and Owning Library">
+        <fields oils_persist:primary="id">
+            <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+            <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+            <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+            <field reporter:label="Circulation ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
+            <field reporter:label="User Home Library" name="home_ou" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Owning Library" name="owning_lib" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Billing Type" name="billing_type" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+            <field reporter:label="Total Billed" name="billed" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="money"/>
+        </fields>
+        <links>
+            <link field="id" reltype="has_a" key="id" map="" class="circ"/>
+            <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
+            <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
+        </links>
+    </class>
+
+    <class id="rmobbhol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_usr_home_and_owning_lib" oils_persist:tablename="money.open_balance_by_usr_home_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by User Home Library and Owning Library">
+        <fields oils_persist:primary="home_ou">
+            <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+            <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+            <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+            <field reporter:label="User Home Library" name="home_ou" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Owning Library" name="owning_lib" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+            <field reporter:label="Billing Types" name="billing_types" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
+            <field reporter:label="Balance" name="balance" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="money"/>
+        </fields>
+        <links>
+            <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
+            <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
+        </links>
+    </class>
+
+
        <!-- ********************************************************************************************************************* -->
 
 </IDL>
index e1a2c65..27b4c55 100644 (file)
@@ -81,6 +81,7 @@
 
                                <scripts>
                                        <path>/openils/var/</path>
+                    <path>/openils/var/catalog/</path>
                                        <item_config>circ/circ_item_config.js</item_config>
                                </scripts>
 
index 1f0d720..d365bad 100755 (executable)
@@ -63,5 +63,5 @@ for my $object (keys %$map) {
 
 }
 
-print "fmclasses = _c;\n";
+print "var fmclasses = _c;\n";
 
index e01b916..6ae28e2 100755 (executable)
@@ -61,6 +61,9 @@ my $rec;
 while ( try { $rec = $batch->next } otherwise { $rec = -1 } ) {
        next if ($rec == -1);
        my $id = $count;
+       my $_001 = $rec->field('001');
+       my $arn = $count;
+       $arn = $_001->data if ($_001);
 
        (my $xml = $rec->as_xml_record()) =~ s/\n//sog;
        $xml =~ s/^<\?xml.+\?\s*>//go;
@@ -79,7 +82,7 @@ while ( try { $rec = $batch->next } otherwise { $rec = -1 } ) {
        $bib->editor($user);
        $bib->edit_date('now');
        $bib->arn_source('LEGACY');
-       $bib->arn_value($count);
+       $bib->arn_value($arn);
        $bib->last_xact_id('IMPORT-'.$starttime);
 
        print OpenSRF::Utils::JSON->perl2JSON($bib)."\n";
index a867650..9ef9ac2 100644 (file)
@@ -59,7 +59,7 @@ $pile .= join ',', @array;
 $pile .= "]; /* Org Units */ \n";
 
 
-$pile .= 'globalOrgTypes = [';
+$pile .= 'var globalOrgTypes = [';
 for my $t (@$types) {
     my ($u,$v,$d,$i,$n,$o,$p) = (val($t->can_have_users),val($t->can_have_vols),$t->depth,$t->id,val($t->name),val($t->opac_label),$t->parent);
     $p ||= 'null';
index 0c54a50..9912380 100644 (file)
@@ -38,6 +38,10 @@ sub rgrep {
 sub merge_records {
        my( $editor, $master, $records ) = @_;
 
+    # bib records are global objects, so no org context required.
+    return (undef, $editor->die_event) 
+        unless $editor->allowed('MERGE_BIB_RECORDS');
+
        my $vol;
        my $evt;
 
@@ -133,7 +137,7 @@ sub merge_records {
                                $record->deleted('f');
                                $record->editor($reqr->id);
                                $record->edit_date('now');
-                               $editor->update_biblio_record_entry($record, {checkperm => 1})
+                               $editor->update_biblio_record_entry($record)
                                        or return $editor->die_event;
                        }
 
@@ -142,7 +146,7 @@ sub merge_records {
                        $record->deleted('t');
                        $record->editor($reqr->id);
                        $record->edit_date('now');
-                       $editor->update_biblio_record_entry($record, {checkperm => 1})
+                       $editor->update_biblio_record_entry($record)
                                or return $editor->die_event;
                }
        }
@@ -216,7 +220,6 @@ sub merge_volumes {
                $_->deleted('t');
                $_->editor($editor->requestor->id);
                $_->edit_date('now');
-               return (undef,$editor->die_event) unless $editor->allowed('UPDATE_VOLUME', $_->owning_lib);
                $editor->update_asset_call_number($_) or return (undef, $editor->die_event);
         merge_volume_holds($editor, $bigcn, $_->id);
        }
index 4dc8651..5659e08 100644 (file)
@@ -2,7 +2,7 @@
 from setuptools import setup
 
 setup(name='Evergreen',
-    version='1.4',
+    version='1.4.0',
     install_requires='OpenSRF>=1.0',
     description='Evergreen Python Modules',
     author='Bill Erickson',
index ded3995..a4d186f 100644 (file)
@@ -40,6 +40,14 @@ $_$ LANGUAGE SQL;
 
 */
 
+CREATE OR REPLACE FUNCTION public.extract_marc_field ( TEXT, BIGINT, TEXT, TEXT ) RETURNS TEXT AS $$
+    SELECT regexp_replace(array_to_string( array_accum( output ),' ' ),$4,'','g') FROM xpath_table('id', 'marc', $1, $3, 'id='||$2)x(id INT, output TEXT);
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION public.extract_marc_field ( TEXT, BIGINT, TEXT ) RETURNS TEXT AS $$
+       SELECT public.extract_marc_field($1,$2,$3,'');
+$$ LANGUAGE SQL;
+
 CREATE OR REPLACE FUNCTION oils_i18n_xlate ( keytable TEXT, keyclass TEXT, keycol TEXT, identcol TEXT, keyvalue TEXT, raw_locale TEXT ) RETURNS TEXT AS $func$
 DECLARE
     locale      TEXT := LOWER( REGEXP_REPLACE( REGEXP_REPLACE( raw_locale, E'[;, ].+$', '' ), E'-', '_', 'g' ) );
diff --git a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql
new file mode 100644 (file)
index 0000000..e32b1bb
--- /dev/null
@@ -0,0 +1,246 @@
+DROP SCHEMA vandelay CASCADE;
+
+BEGIN;
+
+CREATE SCHEMA vandelay;
+
+CREATE TABLE vandelay.queue (
+       id                              BIGSERIAL       PRIMARY KEY,
+       owner                   INT                     NOT NULL REFERENCES actor.usr (id),
+       name                    TEXT            NOT NULL,
+       complete                BOOL            NOT NULL DEFAULT FALSE,
+       queue_type              TEXT            NOT NULL DEFAULT 'bib' CHECK (queue_type IN ('bib','authority')),
+       queue_purpose   TEXT            NOT NULL DEFAULT 'import' CHECK (queue_purpose IN ('import','overlay')),
+       CONSTRAINT vand_queue_name_once_per_owner_const UNIQUE (owner,name,queue_type)
+);
+
+CREATE TABLE vandelay.queued_record (
+    id                  BIGSERIAL                   PRIMARY KEY,
+    create_time         TIMESTAMP WITH TIME ZONE    NOT NULL DEFAULT NOW(),
+    import_time         TIMESTAMP WITH TIME ZONE,
+    marc                TEXT                        NOT NULL
+);
+
+
+
+/* Bib stuff at the top */
+----------------------------------------------------
+
+CREATE TABLE vandelay.bib_attr_definition (
+       id                      SERIAL  PRIMARY KEY,
+       code            TEXT    UNIQUE NOT NULL,
+       description     TEXT,
+       xpath           TEXT    NOT NULL,
+       remove          TEXT    NOT NULL DEFAULT '',
+       ident           BOOL    NOT NULL DEFAULT FALSE
+);
+
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('title','Title of work','//*[@tag="245"]/*[contains("abcmnopr",@code)]');
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('author','Author of work','//*[@tag="100" or @tag="110" or @tag="113"]/*[contains("ad",@code)]');
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('language','Lanuage of work','//*[@tag="240"]/*[@code="l"][1]');
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('pagination','Pagination','//*[@tag="300"]/*[@code="a"][1]');
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident, remove ) VALUES ('isbn','ISBN','//*[@tag="020"]/*[@code="a"]', TRUE, $r$(?:-|\s.+$)$r$);
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident, remove ) VALUES ('issn','ISSN','//*[@tag="022"]/*[@code="a"]', TRUE, $r$(?:-|\s.+$)$r$);
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('price','Price','//*[@tag="020" or @tag="022"]/*[@code="c"][1]');
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident ) VALUES ('rec_identifier','Identifier','//*[@tag="001"]', TRUE);
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident ) VALUES ('eg_identifier','Identifier','//*[@tag="901"]/*[@code="c"]', TRUE);
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident ) VALUES ('eg_tcn','Identifier','//*[@tag="901"]/*[@code="a"]', TRUE);
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('publisher','Publisher','//*[@tag="260"]/*[@code="b"][1]');
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, remove ) VALUES ('pubdate','Publication Date','//*[@tag="260"]/*[@code="c"][1]',$r$\D$r$);
+INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('edition','Edition','//*[@tag="250"]/*[@code="a"][1]');
+
+
+CREATE TABLE vandelay.bib_queue (
+       queue_type      TEXT            NOT NULL DEFAULT 'bib' CHECK (queue_type = 'bib'),
+       CONSTRAINT vand_bib_queue_name_once_per_owner_const UNIQUE (owner,name,queue_type)
+) INHERITS (vandelay.queue);
+ALTER TABLE vandelay.bib_queue ADD PRIMARY KEY (id);
+
+CREATE TABLE vandelay.queued_bib_record (
+       queue           INT     NOT NULL REFERENCES vandelay.bib_queue (id) ON DELETE CASCADE,
+       bib_source      INT     REFERENCES config.bib_source (id),
+       imported_as     INT     REFERENCES biblio.record_entry (id)
+) INHERITS (vandelay.queued_record);
+ALTER TABLE vandelay.queued_bib_record ADD PRIMARY KEY (id);
+
+CREATE TABLE vandelay.queued_bib_record_attr (
+       id                      BIGSERIAL       PRIMARY KEY,
+       record          BIGINT          NOT NULL REFERENCES vandelay.queued_bib_record (id),
+       field           INT                     NOT NULL REFERENCES vandelay.bib_attr_definition (id),
+       attr_value      TEXT            NOT NULL
+);
+
+CREATE TABLE vandelay.bib_match (
+       id                              BIGSERIAL       PRIMARY KEY,
+       field_type              TEXT            NOT NULL CHECK (field_type in ('isbn','tcn_value','id')),
+       matched_attr    INT                     REFERENCES vandelay.queued_bib_record_attr (id) ON DELETE CASCADE,
+       queued_record   BIGINT          REFERENCES vandelay.queued_bib_record (id) ON DELETE CASCADE,
+       eg_record               BIGINT          REFERENCES biblio.record_entry (id)
+);
+
+CREATE OR REPLACE FUNCTION vandelay.ingest_bib_marc ( ) RETURNS TRIGGER AS $$
+DECLARE
+    value   TEXT;
+    atype   TEXT;
+    adef    RECORD;
+BEGIN
+    FOR adef IN SELECT * FROM vandelay.bib_attr_definition LOOP
+
+        SELECT extract_marc_field('vandelay.queued_bib_record', id, adef.xpath, adef.remove) INTO value FROM vandelay.queued_bib_record WHERE id = NEW.id;
+        IF (value IS NOT NULL AND value <> '') THEN
+            INSERT INTO vandelay.queued_bib_record_attr (record, field, attr_value) VALUES (NEW.id, adef.id, value);
+        END IF;
+
+    END LOOP;
+
+    RETURN NULL;
+END;
+$$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE FUNCTION vandelay.match_bib_record ( ) RETURNS TRIGGER AS $func$
+DECLARE
+    attr    RECORD;
+    eg_rec  RECORD;
+BEGIN
+    FOR attr IN SELECT a.* FROM vandelay.queued_bib_record_attr a JOIN vandelay.bib_attr_definition d ON (d.id = a.field) WHERE record = NEW.id AND d.ident IS TRUE LOOP
+
+               -- All numbers? check for an id match
+               IF (attr.attr_value ~ $r$^\d+$$r$) THEN
+               FOR eg_rec IN SELECT * FROM biblio.record_entry WHERE id = attr.attr_value::BIGINT AND deleted IS FALSE LOOP
+                       INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('id', attr.id, NEW.id, eg_rec.id);
+                       END LOOP;
+               END IF;
+
+               -- Looks like an ISBN? check for an isbn match
+               IF (attr.attr_value ~* $r$^[0-9x]+$$r$ AND character_length(attr.attr_value) IN (10,13)) THEN
+               FOR eg_rec IN EXECUTE $$SELECT * FROM metabib.full_rec fr WHERE fr.value LIKE LOWER('$$ || attr.attr_value || $$%') AND fr.tag = '020' AND fr.subfield = 'a'$$ LOOP
+                               PERFORM id FROM biblio.record_entry WHERE id = eg_rec.record AND deleted IS FALSE;
+                               IF FOUND THEN
+                               INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('isbn', attr.id, NEW.id, eg_rec.record);
+                               END IF;
+                       END LOOP;
+
+                       -- subcheck for isbn-as-tcn
+                   FOR eg_rec IN SELECT * FROM biblio.record_entry WHERE tcn_value = 'i' || attr.attr_value AND deleted IS FALSE LOOP
+                           INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('tcn_value', attr.id, NEW.id, eg_rec.id);
+               END LOOP;
+               END IF;
+
+               -- check for an OCLC tcn_value match
+               IF (attr.attr_value ~ $r$^o\d+$$r$) THEN
+                   FOR eg_rec IN SELECT * FROM biblio.record_entry WHERE tcn_value = regexp_replace(attr.attr_value,'^o','ocm') AND deleted IS FALSE LOOP
+                           INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('tcn_value', attr.id, NEW.id, eg_rec.id);
+               END LOOP;
+               END IF;
+
+               -- check for a direct tcn_value match
+        FOR eg_rec IN SELECT * FROM biblio.record_entry WHERE tcn_value = attr.attr_value AND deleted IS FALSE LOOP
+            INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('tcn_value', attr.id, NEW.id, eg_rec.id);
+        END LOOP;
+
+    END LOOP;
+
+    RETURN NULL;
+END;
+$func$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE FUNCTION vandelay.cleanup_bib_marc ( ) RETURNS TRIGGER AS $$
+BEGIN
+    DELETE FROM vandelay.queued_bib_record_attr WHERE lineitem = OLD.id;
+    IF TG_OP = 'UPDATE' THEN
+        RETURN NEW;
+    END IF;
+    RETURN OLD;
+END;
+$$ LANGUAGE PLPGSQL;
+
+CREATE TRIGGER cleanup_bib_trigger
+    BEFORE UPDATE OR DELETE ON vandelay.queued_bib_record
+    FOR EACH ROW EXECUTE PROCEDURE vandelay.cleanup_bib_marc();
+
+CREATE TRIGGER ingest_bib_trigger
+    AFTER INSERT OR UPDATE ON vandelay.queued_bib_record
+    FOR EACH ROW EXECUTE PROCEDURE vandelay.ingest_bib_marc();
+
+CREATE TRIGGER zz_match_bibs_trigger
+    AFTER INSERT OR UPDATE ON vandelay.queued_bib_record
+    FOR EACH ROW EXECUTE PROCEDURE vandelay.match_bib_record();
+
+
+/* Authority stuff down here */
+---------------------------------------
+CREATE TABLE vandelay.authority_attr_definition (
+       id                      SERIAL  PRIMARY KEY,
+       code            TEXT    UNIQUE NOT NULL,
+       description     TEXT,
+       xpath           TEXT    NOT NULL,
+       remove          TEXT    NOT NULL DEFAULT '',
+       ident           BOOL    NOT NULL DEFAULT FALSE
+);
+INSERT INTO vandelay.authority_attr_definition ( code, description, xpath, ident ) VALUES ('rec_identifier','Identifier','//*[@tag="001"]', TRUE);
+
+CREATE TABLE vandelay.authority_queue (
+       queue_type      TEXT            NOT NULL DEFAULT 'authority' CHECK (queue_type = 'authority'),
+       CONSTRAINT vand_authority_queue_name_once_per_owner_const UNIQUE (owner,name,queue_type)
+) INHERITS (vandelay.queue);
+ALTER TABLE vandelay.authority_queue ADD PRIMARY KEY (id);
+
+CREATE TABLE vandelay.queued_authority_record (
+       queue           INT     NOT NULL REFERENCES vandelay.authority_queue (id) ON DELETE CASCADE,
+       imported_as     INT     REFERENCES authority.record_entry (id)
+) INHERITS (vandelay.queued_record);
+ALTER TABLE vandelay.queued_authority_record ADD PRIMARY KEY (id);
+
+CREATE TABLE vandelay.queued_authority_record_attr (
+       id                      BIGSERIAL       PRIMARY KEY,
+       record          BIGINT          NOT NULL REFERENCES vandelay.queued_authority_record (id),
+       field           INT                     NOT NULL REFERENCES vandelay.authority_attr_definition (id),
+       attr_value      TEXT            NOT NULL
+);
+
+CREATE TABLE vandelay.authority_match (
+       id                              BIGSERIAL       PRIMARY KEY,
+       matched_attr    INT                     REFERENCES vandelay.queued_authority_record_attr (id) ON DELETE CASCADE,
+       queued_record   BIGINT          REFERENCES vandelay.queued_authority_record (id) ON DELETE CASCADE,
+       eg_record               BIGINT          REFERENCES authority.record_entry (id)
+);
+
+CREATE OR REPLACE FUNCTION vandelay.ingest_authority_marc ( ) RETURNS TRIGGER AS $$
+DECLARE
+    value   TEXT;
+    atype   TEXT;
+    adef    RECORD;
+BEGIN
+    FOR adef IN SELECT * FROM vandelay.authority_attr_definition LOOP
+
+        SELECT extract_marc_field('vandelay.queued_authority_record', id, adef.xpath, adef.remove) INTO value FROM vandelay.queued_authority_record WHERE id = NEW.id;
+        IF (value IS NOT NULL AND value <> '') THEN
+            INSERT INTO vandelay.queued_authority_record_attr (record, field, attr_value) VALUES (NEW.id, adef.id, value);
+        END IF;
+
+    END LOOP;
+
+    RETURN NULL;
+END;
+$$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE FUNCTION vandelay.cleanup_authority_marc ( ) RETURNS TRIGGER AS $$
+BEGIN
+    DELETE FROM vandelay.queued_authority_record_attr WHERE lineitem = OLD.id;
+    IF TG_OP = 'UPDATE' THEN
+        RETURN NEW;
+    END IF;
+    RETURN OLD;
+END;
+$$ LANGUAGE PLPGSQL;
+
+CREATE TRIGGER cleanup_authority_trigger
+    BEFORE UPDATE OR DELETE ON vandelay.queued_authority_record
+    FOR EACH ROW EXECUTE PROCEDURE vandelay.cleanup_authority_marc();
+
+CREATE TRIGGER ingest_authority_trigger
+    AFTER INSERT OR UPDATE ON vandelay.queued_authority_record
+    FOR EACH ROW EXECUTE PROCEDURE vandelay.ingest_authority_marc();
+
+COMMIT;
+
diff --git a/Open-ILS/src/sql/Pg/1.2.1-1.2.2-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.2.1-1.2.2-upgrade-db.sql
new file mode 100644 (file)
index 0000000..3b98d99
--- /dev/null
@@ -0,0 +1,719 @@
+/*
+ * Copyright (C) 2008  Equinox Software, Inc.
+ * Mike Rylander <miker@esilibrary.com.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+BEGIN;
+
+-------------------------------------------------------------------
+/* new materialized view for reporting schema -- ok if it fails  */
+-------------------------------------------------------------------
+
+CREATE TABLE reporter.materialized_simple_record AS SELECT * FROM reporter.super_simple_record WHERE 1=0;
+
+INSERT INTO reporter.materialized_simple_record
+    (id,fingerprint,quality,tcn_source,tcn_value,title,author,publisher,pubdate,isbn,issn)
+    SELECT DISTINCT ON (id) * FROM reporter.super_simple_record;
+
+ALTER TABLE reporter.materialized_simple_record ADD PRIMARY KEY (id);
+
+CREATE OR REPLACE VIEW reporter.super_simple_record AS SELECT * FROM reporter.materialized_simple_record;
+
+CREATE OR REPLACE VIEW reporter.old_super_simple_record AS
+SELECT  r.id,
+    r.fingerprint,
+    r.quality,
+    r.tcn_source,
+    r.tcn_value,
+    title.value AS title,
+    FIRST(author.value) AS author,
+    publisher.value AS publisher,
+    SUBSTRING(pubdate.value FROM $$\d+$$) AS pubdate,
+    ARRAY_ACCUM( SUBSTRING(isbn.value FROM $$^\S+$$) ) AS isbn,
+    ARRAY_ACCUM( SUBSTRING(issn.value FROM $$^\S+$$) ) AS issn
+  FROM  biblio.record_entry r
+    LEFT JOIN metabib.full_rec title ON (r.id = title.record AND title.tag = '245' AND title.subfield = 'a')
+    LEFT JOIN metabib.full_rec author ON (r.id = author.record AND author.tag IN ('100','110','111') AND author.subfield = 'a')
+    LEFT JOIN metabib.full_rec publisher ON (r.id = publisher.record AND publisher.tag = '260' AND publisher.subfield = 'b')
+    LEFT JOIN metabib.full_rec pubdate ON (r.id = pubdate.record AND pubdate.tag = '260' AND pubdate.subfield = 'c')
+    LEFT JOIN metabib.full_rec isbn ON (r.id = isbn.record AND isbn.tag IN ('024', '020') AND isbn.subfield IN ('a','z'))
+    LEFT JOIN metabib.full_rec issn ON (r.id = issn.record AND issn.tag = '022' AND issn.subfield = 'a')
+  GROUP BY 1,2,3,4,5,6,8,9;
+
+CREATE OR REPLACE FUNCTION reporter.simple_rec_sync () RETURNS TRIGGER AS $$
+DECLARE
+    r_id        BIGINT;
+    new_data    RECORD;
+BEGIN
+    IF TG_OP IN ('DELETE') THEN
+        r_id := OLD.record;
+    ELSE
+        r_id := NEW.record;
+    END IF;
+
+    SELECT * INTO new_data FROM reporter.materialized_simple_record WHERE id = r_id FOR UPDATE;
+    DELETE FROM reporter.materialized_simple_record WHERE id = r_id;
+
+    IF TG_OP IN ('DELETE') THEN
+        RETURN OLD;
+    ELSE
+        INSERT INTO reporter.materialized_simple_record SELECT DISTINCT ON (id) * FROM reporter.old_super_simple_record WHERE id = NEW.record;
+        RETURN NEW;
+    END IF;
+
+END;
+$$ LANGUAGE PLPGSQL;
+
+CREATE TRIGGER zzz_update_materialized_simple_record_tgr
+    AFTER INSERT OR UPDATE OR DELETE ON metabib.full_rec
+    FOR EACH ROW EXECUTE PROCEDURE reporter.simple_rec_sync();
+
+COMMIT;
+
+
+DROP VIEW reporter.overdue_reports;
+DROP VIEW reporter.pending_reports;
+DROP VIEW reporter.currently_running;
+
+BEGIN;
+
+-------------------------------------------------------------------
+/* convenience views for report management                       */
+-------------------------------------------------------------------
+
+CREATE OR REPLACE VIEW reporter.overdue_reports AS
+ SELECT s.id, c.barcode AS runner_barcode, r.name, s.run_time, s.run_time - now() AS scheduled_wait_time
+   FROM reporter.schedule s
+   JOIN reporter.report r ON r.id = s.report
+   JOIN actor.usr u ON s.runner = u.id
+   JOIN actor.card c ON c.id = u.card
+  WHERE s.start_time IS NULL AND s.run_time < now();
+
+CREATE OR REPLACE VIEW reporter.pending_reports AS
+ SELECT s.id, c.barcode AS runner_barcode, r.name, s.run_time, s.run_time - now() AS scheduled_wait_time
+   FROM reporter.schedule s
+   JOIN reporter.report r ON r.id = s.report
+   JOIN actor.usr u ON s.runner = u.id
+   JOIN actor.card c ON c.id = u.card
+  WHERE s.start_time IS NULL;
+
+CREATE OR REPLACE VIEW reporter.currently_running AS
+ SELECT s.id, c.barcode AS runner_barcode, r.name, s.run_time, s.run_time - now() AS scheduled_wait_time
+   FROM reporter.schedule s
+   JOIN reporter.report r ON r.id = s.report
+   JOIN actor.usr u ON s.runner = u.id
+   JOIN actor.card c ON c.id = u.card
+  WHERE s.start_time IS NOT NULL AND s.complete_time IS NULL;
+
+
+-------------------------------------------------------------------
+/* view for restricting circ counts by circ_mod                  */
+-------------------------------------------------------------------
+
+CREATE OR REPLACE VIEW action.open_circ_count_by_circ_mod AS
+    SELECT  circ.usr,
+            cp.circ_modifier,
+            count(circ.id)
+      FROM  action.circulation circ
+            JOIN asset.copy cp ON (circ.target_copy = cp.id)
+      WHERE circ.checkin_time IS NULL
+            AND ( circ.stop_fines IN ('LOST','LONGOVERDUE','CLAIMSRETURNED') OR circ.stop_fines IS NULL )
+      GROUP BY 1,2;
+
+
+-------------------------------------------------------------------
+/* reporting functions for new (and fixed) transforms            */
+-------------------------------------------------------------------
+
+CREATE OR REPLACE FUNCTION public.first_word ( TEXT ) RETURNS TEXT AS $$
+        SELECT SUBSTRING( $1 FROM $_$^\S+$_$);
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION public.first5 ( TEXT ) RETURNS TEXT AS $$
+       SELECT SUBSTRING( $1, 1, 5);
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION public.call_number_dewey( TEXT ) RETURNS TEXT AS $$
+        my $txt = shift;
+        $txt =~ s/^\s+//o;
+        $txt =~ s/[\[\]\{\}\(\)`'"#<>\*\?\-\+\$\\]+//o; #' To help vim in SQL mode
+        $txt =~ s/\s+$//o;
+        if ($txt =~ /(\d{3}(?:\.\d+)?)/o) {
+                return $1;
+        } else {
+                return (split /\s+/, $txt)[0];
+        }
+$$ LANGUAGE 'plperlu' STRICT IMMUTABLE;
+
+COMMIT;
+
+DROP SCHEMA search CASCADE;
+BEGIN;
+
+-------------------------------------------------------------------
+/* staged search -- also applied by 300.schema.staged_search.sql */
+-------------------------------------------------------------------
+
+CREATE SCHEMA search;
+
+CREATE TABLE search.relevance_adjustment (
+    id          SERIAL  PRIMARY KEY,
+    active      BOOL    NOT NULL DEFAULT TRUE,
+    field       INT     NOT NULL REFERENCES config.metabib_field (id),
+    bump_type   TEXT    NOT NULL CHECK (bump_type IN ('word_order','first_word','full_match')),
+    multiplier  NUMERIC NOT NULL DEFAULT 1.0
+);
+CREATE UNIQUE INDEX bump_once_per_field_idx ON search.relevance_adjustment ( field, bump_type );
+
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(1, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(1, 'full_match', 20);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(2, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(2, 'word_order', 10);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(2, 'full_match', 20);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(3, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(3, 'word_order', 10);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(3, 'full_match', 20);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(4, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(4, 'word_order', 10);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(4, 'full_match', 20);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(5, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(5, 'word_order', 10);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(5, 'full_match', 20);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(6, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(7, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(8, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(9, 'first_word', 1.5);
+INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(14, 'word_order', 10);
+
+CREATE OR REPLACE FUNCTION search.pick_table (TEXT) RETURNS TEXT AS $$
+    SELECT  CASE
+                WHEN $1 = 'author'  THEN 'metabib.author_field_entry'
+                WHEN $1 = 'title'   THEN 'metabib.title_field_entry'
+                WHEN $1 = 'subject' THEN 'metabib.subject_field_entry'
+                WHEN $1 = 'keyword' THEN 'metabib.keyword_field_entry'
+                WHEN $1 = 'series'  THEN 'metabib.series_field_entry'
+            END;
+$$ LANGUAGE SQL;
+
+CREATE TYPE search.search_result AS ( id BIGINT, rel NUMERIC, record INT, total INT, checked INT, visible INT, deleted INT, excluded INT );
+CREATE TYPE search.search_args AS ( id INT, field_class TEXT, field_name TEXT, table_alias TEXT, term TEXT, term_type TEXT );
+
+CREATE OR REPLACE FUNCTION search.staged_fts (
+
+    param_search_ou INT,
+    param_depth     INT,
+    param_searches  TEXT, -- JSON hash, to be turned into a resultset via search.parse_search_args
+    param_statuses  INT[],
+    param_audience  TEXT[],
+    param_language  TEXT[],
+    param_lit_form  TEXT[],
+    param_types     TEXT[],
+    param_forms     TEXT[],
+    param_vformats  TEXT[],
+    param_pref_lang TEXT,
+    param_pref_lang_multiplier REAL,
+    param_sort      TEXT,
+    param_sort_desc BOOL,
+    metarecord      BOOL,
+    staff           BOOL,
+    param_rel_limit INT,
+    param_chk_limit INT,
+    param_skip_chk  INT
+
+) RETURNS SETOF search.search_result AS $func$
+DECLARE
+
+    current_res         search.search_result%ROWTYPE;
+    query_part          search.search_args%ROWTYPE;
+    phrase_query_part   search.search_args%ROWTYPE;
+    rank_adjust_id      INT;
+    core_rel_limit      INT;
+    core_chk_limit      INT;
+    core_skip_chk       INT;
+    rank_adjust         search.relevance_adjustment%ROWTYPE;
+    query_table         TEXT;
+    tmp_text            TEXT;
+    tmp_int             INT;
+    current_rank        TEXT;
+    ranks               TEXT[] := '{}';
+    query_table_alias   TEXT;
+    from_alias_array    TEXT[] := '{}';
+    used_ranks          TEXT[] := '{}';
+    mb_field            INT;
+    mb_field_list       INT[];
+    search_org_list     INT[];
+    select_clause       TEXT := 'SELECT';
+    from_clause         TEXT := ' FROM  metabib.metarecord_source_map m JOIN metabib.rec_descriptor mrd ON (m.source = mrd.record) ';
+    where_clause        TEXT := ' WHERE 1=1 ';
+    mrd_used            BOOL := FALSE;
+    sort_desc           BOOL := FALSE;
+
+    core_result         RECORD;
+    core_cursor         REFCURSOR;
+    core_rel_query      TEXT;
+    vis_limit_query     TEXT;
+    inner_where_clause  TEXT;
+
+    total_count         INT := 0;
+    check_count         INT := 0;
+    deleted_count       INT := 0;
+    visible_count       INT := 0;
+    excluded_count      INT := 0;
+
+BEGIN
+
+    core_rel_limit := COALESCE( param_rel_limit, 25000 );
+    core_chk_limit := COALESCE( param_chk_limit, 1000 );
+    core_skip_chk := COALESCE( param_skip_chk, 1 );
+
+    IF metarecord THEN
+        select_clause := select_clause || ' m.metarecord as id, array_accum(distinct m.source) as records,';
+    ELSE
+        select_clause := select_clause || ' m.source as id, array_accum(distinct m.source) as records,';
+    END IF;
+
+    -- first we need to construct the base query
+    FOR query_part IN SELECT * FROM search.parse_search_args(param_searches) WHERE term_type = 'fts_query' LOOP
+
+        inner_where_clause := 'index_vector @@ ' || query_part.term;
+
+        IF query_part.field_name IS NOT NULL THEN
+
+           SELECT  id INTO mb_field
+             FROM  config.metabib_field
+             WHERE field_class = query_part.field_class
+                   AND name = query_part.field_name;
+
+            IF FOUND THEN
+                inner_where_clause := inner_where_clause ||
+                    ' AND ' || 'field = ' || mb_field;
+            END IF;
+
+        END IF;
+
+        -- moving on to the rank ...
+        SELECT  * INTO query_part
+          FROM  search.parse_search_args(param_searches)
+          WHERE term_type = 'fts_rank'
+                AND table_alias = query_part.table_alias;
+
+        current_rank := query_part.term || ' * ' || query_part.table_alias || '_weight.weight';
+
+        IF query_part.field_name IS NOT NULL THEN
+
+           SELECT  array_accum(distinct id) INTO mb_field_list
+             FROM  config.metabib_field
+             WHERE field_class = query_part.field_class
+                   AND name = query_part.field_name;
+
+        ELSE
+
+           SELECT  array_accum(distinct id) INTO mb_field_list
+             FROM  config.metabib_field
+             WHERE field_class = query_part.field_class;
+
+        END IF;
+
+        FOR rank_adjust IN SELECT * FROM search.relevance_adjustment WHERE active AND field IN ( SELECT * FROM search.explode_array( mb_field_list ) ) LOOP
+
+            IF NOT rank_adjust.bump_type = ANY (used_ranks) THEN
+
+                IF rank_adjust.bump_type = 'first_word' THEN
+                    SELECT  term INTO tmp_text
+                      FROM  search.parse_search_args(param_searches)
+                      WHERE table_alias = query_part.table_alias AND term_type = 'word'
+                      ORDER BY id
+                      LIMIT 1;
+
+                    tmp_text := query_part.table_alias || '.value ILIKE ' || quote_literal( tmp_text || '%' );
+
+                ELSIF rank_adjust.bump_type = 'word_order' THEN
+                    SELECT  array_to_string( array_accum( term ), '%' ) INTO tmp_text
+                      FROM  search.parse_search_args(param_searches)
+                      WHERE table_alias = query_part.table_alias AND term_type = 'word';
+
+                    tmp_text := query_part.table_alias || '.value ILIKE ' || quote_literal( '%' || tmp_text || '%' );
+
+                ELSIF rank_adjust.bump_type = 'full_match' THEN
+                    SELECT  array_to_string( array_accum( term ), E'\\s+' ) INTO tmp_text
+                      FROM  search.parse_search_args(param_searches)
+                      WHERE table_alias = query_part.table_alias AND term_type = 'word';
+
+                    tmp_text := query_part.table_alias || '.value  ~ ' || quote_literal( '^' || tmp_text || E'\\W*$' );
+
+                END IF;
+
+                current_rank := current_rank || ' * ( CASE WHEN ' || tmp_text ||
+                    ' THEN ' || rank_adjust.multiplier || '::REAL ELSE 1.0 END )';
+
+                used_ranks := array_append( used_ranks, rank_adjust.bump_type );
+
+            END IF;
+
+        END LOOP;
+
+        ranks := array_append( ranks, current_rank );
+        used_ranks := '{}';
+
+        FOR phrase_query_part IN
+            SELECT  *
+              FROM  search.parse_search_args(param_searches)
+              WHERE term_type = 'phrase'
+                    AND table_alias = query_part.table_alias LOOP
+
+            tmp_text := replace( phrase_query_part.term, '*', E'\\*' );
+            tmp_text := replace( tmp_text, '?', E'\\?' );
+            tmp_text := replace( tmp_text, '+', E'\\+' );
+            tmp_text := replace( tmp_text, '|', E'\\|' );
+            tmp_text := replace( tmp_text, '(', E'\\(' );
+            tmp_text := replace( tmp_text, ')', E'\\)' );
+            tmp_text := replace( tmp_text, '[', E'\\[' );
+            tmp_text := replace( tmp_text, ']', E'\\]' );
+
+            inner_where_clause := inner_where_clause || ' AND ' || 'value  ~* ' || quote_literal( E'(^|\\W+)' || regexp_replace(tmp_text, E'\\s+',E'\\\\s+','g') || E'(\\W+|\$)' );
+
+        END LOOP;
+
+        query_table := search.pick_table(query_part.field_class);
+
+        from_clause := from_clause ||
+            ' JOIN ( SELECT * FROM ' || query_table || ' WHERE ' || inner_where_clause ||
+                    CASE WHEN core_rel_limit > 0 THEN ' LIMIT ' || core_rel_limit::TEXT ELSE '' END || ' ) AS ' || query_part.table_alias ||
+                ' ON ( m.source = ' || query_part.table_alias || '.source )' ||
+            ' JOIN config.metabib_field AS ' || query_part.table_alias || '_weight' ||
+                ' ON ( ' || query_part.table_alias || '.field = ' || query_part.table_alias || '_weight.id  AND  ' || query_part.table_alias || '_weight.search_field)';
+
+        from_alias_array := array_append(from_alias_array, query_part.table_alias);
+
+    END LOOP;
+
+    IF param_pref_lang IS NOT NULL AND param_pref_lang_multiplier IS NOT NULL THEN
+        current_rank := ' CASE WHEN mrd.item_lang = ' || quote_literal( param_pref_lang ) ||
+            ' THEN ' || param_pref_lang_multiplier || '::REAL ELSE 1.0 END ';
+
+        --ranks := array_append( ranks, current_rank );
+    END IF;
+
+    current_rank := ' AVG( ( (' || array_to_string( ranks, ') + (' ) || ') ) * ' || current_rank || ' ) ';
+    select_clause := select_clause || current_rank || ' AS rel,';
+
+    sort_desc = param_sort_desc;
+
+    IF param_sort = 'pubdate' THEN
+
+        tmp_text := '999999';
+        IF param_sort_desc THEN tmp_text := '0'; END IF;
+
+        current_rank := $$
+            ( COALESCE( FIRST ((
+                SELECT  SUBSTRING(frp.value FROM E'\\d{4}')
+                  FROM  metabib.full_rec frp
+                  WHERE frp.record = m.source
+                    AND frp.tag = '260'
+                    AND frp.subfield = 'c'
+                  LIMIT 1
+            )), $$ || quote_literal(tmp_text) || $$ )::INT )
+        $$;
+
+    ELSIF param_sort = 'title' THEN
+
+        tmp_text := 'zzzzzz';
+        IF param_sort_desc THEN tmp_text := '    '; END IF;
+
+        current_rank := $$
+            ( COALESCE( FIRST ((
+                SELECT  LTRIM(SUBSTR( frt.value, COALESCE(SUBSTRING(frt.ind2 FROM E'\\d+'),'0')::INT + 1 ))
+                  FROM  metabib.full_rec frt
+                  WHERE frt.record = m.source
+                    AND frt.tag = '245'
+                    AND frt.subfield = 'a'
+                  LIMIT 1
+            )),$$ || quote_literal(tmp_text) || $$))
+        $$;
+
+    ELSIF param_sort = 'author' THEN
+
+        tmp_text := 'zzzzzz';
+        IF param_sort_desc THEN tmp_text := '    '; END IF;
+
+        current_rank := $$
+            ( COALESCE( FIRST ((
+                SELECT  LTRIM(fra.value)
+                  FROM  metabib.full_rec fra
+                  WHERE fra.record = m.source
+                    AND fra.tag LIKE '1%'
+                    AND fra.subfield = 'a'
+                  ORDER BY fra.tag::text::int
+                  LIMIT 1
+            )),$$ || quote_literal(tmp_text) || $$))
+        $$;
+
+    ELSIF param_sort = 'create_date' THEN
+            current_rank := $$( FIRST (( SELECT create_date FROM biblio.record_entry rbr WHERE rbr.id = m.source)) )$$;
+    ELSIF param_sort = 'edit_date' THEN
+            current_rank := $$( FIRST (( SELECT edit_date FROM biblio.record_entry rbr WHERE rbr.id = m.source)) )$$;
+    ELSE
+        sort_desc := NOT COALESCE(param_sort_desc, FALSE);
+    END IF;
+
+    select_clause := select_clause || current_rank || ' AS rank';
+
+    -- now add the other qualifiers
+    IF param_audience IS NOT NULL AND array_upper(param_audience, 1) > 0 THEN
+        where_clause = where_clause || $$ AND mrd.audience IN ('$$ || array_to_string(param_audience, $$','$$) || $$') $$;
+    END IF;
+
+    IF param_language IS NOT NULL AND array_upper(param_language, 1) > 0 THEN
+        where_clause = where_clause || $$ AND mrd.item_lang IN ('$$ || array_to_string(param_language, $$','$$) || $$') $$;
+    END IF;
+
+    IF param_lit_form IS NOT NULL AND array_upper(param_lit_form, 1) > 0 THEN
+        where_clause = where_clause || $$ AND mrd.lit_form IN ('$$ || array_to_string(param_lit_form, $$','$$) || $$') $$;
+    END IF;
+
+    IF param_types IS NOT NULL AND array_upper(param_types, 1) > 0 THEN
+        where_clause = where_clause || $$ AND mrd.item_type IN ('$$ || array_to_string(param_types, $$','$$) || $$') $$;
+    END IF;
+
+    IF param_forms IS NOT NULL AND array_upper(param_forms, 1) > 0 THEN
+        where_clause = where_clause || $$ AND mrd.item_form IN ('$$ || array_to_string(param_forms, $$','$$) || $$') $$;
+    END IF;
+
+    IF param_vformats IS NOT NULL AND array_upper(param_vformats, 1) > 0 THEN
+        where_clause = where_clause || $$ AND mrd.vr_format IN ('$$ || array_to_string(param_vformats, $$','$$) || $$') $$;
+    END IF;
+
+    core_rel_query := select_clause || from_clause || where_clause ||
+                        ' GROUP BY 1 ORDER BY 4' || CASE WHEN sort_desc THEN ' DESC' ELSE ' ASC' END || ';';
+    --RAISE NOTICE 'Base Query:  %', core_rel_query;
+
+    IF param_depth IS NOT NULL THEN
+        SELECT array_accum(distinct id) INTO search_org_list FROM actor.org_unit_descendants( param_search_ou, param_depth );
+    ELSE
+        SELECT array_accum(distinct id) INTO search_org_list FROM actor.org_unit_descendants( param_search_ou );
+    END IF;
+
+    OPEN core_cursor FOR EXECUTE core_rel_query;
+
+    LOOP
+
+        FETCH core_cursor INTO core_result;
+        EXIT WHEN NOT FOUND;
+
+        IF total_count % 1000 = 0 THEN
+            -- RAISE NOTICE ' % total, % checked so far ... ', total_count, check_count;
+        END IF;
+
+        IF core_chk_limit > 0 AND total_count - core_skip_chk + 1 >= core_chk_limit THEN
+            total_count := total_count + 1;
+            CONTINUE;
+        END IF;
+
+        total_count := total_count + 1;
+
+        CONTINUE WHEN param_skip_chk IS NOT NULL and total_count < param_skip_chk;
+
+        check_count := check_count + 1;
+
+        PERFORM 1 FROM biblio.record_entry b WHERE NOT b.deleted AND b.id IN ( SELECT * FROM search.explode_array( core_result.records ) );
+        IF NOT FOUND THEN
+            -- RAISE NOTICE ' % were all deleted ... ', core_result.records;
+            deleted_count := deleted_count + 1;
+            CONTINUE;
+        END IF;
+
+        PERFORM 1
+          FROM  biblio.record_entry b
+                JOIN config.bib_source s ON (b.source = s.id)
+          WHERE s.transcendant
+                AND b.id IN ( SELECT * FROM search.explode_array( core_result.records ) );
+
+        IF FOUND THEN
+            -- RAISE NOTICE ' % were all transcendant ... ', core_result.records;
+            visible_count := visible_count + 1;
+
+            current_res.id = core_result.id;
+            current_res.rel = core_result.rel;
+
+            tmp_int := 1;
+            IF metarecord THEN
+                SELECT COUNT(DISTINCT s.source) INTO tmp_int FROM metabib.metarecord_source_map s WHERE s.metarecord = core_result.id;
+            END IF;
+
+            IF tmp_int = 1 THEN
+                current_res.record = core_result.records[1];
+            ELSE
+                current_res.record = NULL;
+            END IF;
+
+            RETURN NEXT current_res;
+
+            CONTINUE;
+        END IF;
+
+        IF param_statuses IS NOT NULL AND array_upper(param_statuses, 1) > 0 THEN
+
+            PERFORM 1
+              FROM  asset.call_number cn
+                    JOIN asset.copy cp ON (cp.call_number = cn.id)
+              WHERE NOT cn.deleted
+                    AND NOT cp.deleted
+                    AND cp.status IN ( SELECT * FROM search.explode_array( param_statuses ) )
+                    AND cn.record IN ( SELECT * FROM search.explode_array( core_result.records ) )
+                    AND cp.circ_lib IN ( SELECT * FROM search.explode_array( search_org_list ) )
+              LIMIT 1;
+
+            IF NOT FOUND THEN
+                -- RAISE NOTICE ' % were all status-excluded ... ', core_result.records;
+                excluded_count := excluded_count + 1;
+                CONTINUE;
+            END IF;
+
+        END IF;
+
+        IF staff IS NULL OR NOT staff THEN
+
+            PERFORM 1
+              FROM  asset.call_number cn
+                    JOIN asset.copy cp ON (cp.call_number = cn.id)
+                    JOIN actor.org_unit a ON (cp.circ_lib = a.id)
+                    JOIN asset.copy_location cl ON (cp.location = cl.id)
+                    JOIN config.copy_status cs ON (cp.status = cs.id)
+              WHERE NOT cn.deleted
+                    AND NOT cp.deleted
+                    AND cs.holdable
+                    AND cl.opac_visible
+                    AND cp.opac_visible
+                    AND a.opac_visible
+                    AND cp.circ_lib IN ( SELECT * FROM search.explode_array( search_org_list ) )
+                    AND cn.record IN ( SELECT * FROM search.explode_array( core_result.records ) )
+              LIMIT 1;
+
+            IF NOT FOUND THEN
+                -- RAISE NOTICE ' % were all visibility-excluded ... ', core_result.records;
+                excluded_count := excluded_count + 1;
+                CONTINUE;
+            END IF;
+
+        ELSE
+
+            PERFORM 1
+              FROM  asset.call_number cn
+                    JOIN asset.copy cp ON (cp.call_number = cn.id)
+                    JOIN actor.org_unit a ON (cp.circ_lib = a.id)
+                    JOIN asset.copy_location cl ON (cp.location = cl.id)
+                    JOIN config.copy_status cs ON (cp.status = cs.id)
+              WHERE NOT cn.deleted
+                    AND NOT cp.deleted
+                    AND cp.circ_lib IN ( SELECT * FROM search.explode_array( search_org_list ) )
+                    AND cn.record IN ( SELECT * FROM search.explode_array( core_result.records ) )
+              LIMIT 1;
+
+            IF NOT FOUND THEN
+
+                PERFORM 1
+                  FROM  asset.call_number cn
+                  WHERE cn.record IN ( SELECT * FROM search.explode_array( core_result.records ) )
+                  LIMIT 1;
+
+                IF FOUND THEN
+                    -- RAISE NOTICE ' % were all visibility-excluded ... ', core_result.records;
+                    excluded_count := excluded_count + 1;
+                    CONTINUE;
+                END IF;
+
+            END IF;
+
+        END IF;
+
+        visible_count := visible_count + 1;
+
+        current_res.id = core_result.id;
+        current_res.rel = core_result.rel;
+
+        tmp_int := 1;
+        IF metarecord THEN
+            SELECT COUNT(DISTINCT s.source) INTO tmp_int FROM metabib.metarecord_source_map s WHERE s.metarecord = core_result.id;
+        END IF;
+
+        IF tmp_int = 1 THEN
+            current_res.record = core_result.records[1];
+        ELSE
+            current_res.record = NULL;
+        END IF;
+
+        RETURN NEXT current_res;
+
+        IF visible_count % 1000 = 0 THEN
+            -- RAISE NOTICE ' % visible so far ... ', visible_count;
+        END IF;
+
+    END LOOP;
+
+    current_res.id = NULL;
+    current_res.rel = NULL;
+    current_res.record = NULL;
+    current_res.total = total_count;
+    current_res.checked = check_count;
+    current_res.deleted = deleted_count;
+    current_res.visible = visible_count;
+    current_res.excluded = excluded_count;
+
+    CLOSE core_cursor;
+
+    RETURN NEXT current_res;
+
+END;
+$func$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE FUNCTION search.explode_array(anyarray) RETURNS SETOF anyelement AS $BODY$
+    SELECT ($1)[s] FROM generate_series(1, array_upper($1, 1)) AS s;
+$BODY$
+LANGUAGE 'sql' IMMUTABLE;
+
+CREATE OR REPLACE FUNCTION search.parse_search_args (TEXT) RETURNS SETOF search.search_args AS $perlcode$
+    use JSON::XS;
+    my $json = shift;
+
+    my $args = decode_json( $json );
+
+    my $id = 1;
+
+    for my $k ( keys %$args ) {
+        (my $alias = $k) =~ s/\|/_/gso;
+        my ($class, $field) = split /\|/, $k;
+        my $part = $args->{$k};
+        for my $p ( keys %$part ) {
+            my $data = $part->{$p};
+            $data = [$data] if (!ref($data));
+            for my $datum ( @$data ) {
+                return_next(
+                    {   field_class => $class,
+                        field_name  => $field,
+                        term        => $datum,
+                        table_alias => $alias,
+                        term_type   => $p,
+                        id          => $id,
+                    }
+                );
+                $id++;
+            }
+        }
+    }
+
+    return undef;
+
+$perlcode$ LANGUAGE PLPERLU;
+
+COMMIT;
index 7f96f95..83fd299 100644 (file)
@@ -1127,6 +1127,7 @@ INSERT INTO permission.perm_list (code) VALUES ('UPDATE_TRANSIT');
 INSERT INTO permission.perm_list (code) VALUES ('UPDATE_VOLUME_NOTE');
 INSERT INTO permission.perm_list (code) VALUES ('UPDATE_VR_FORMAT');
 INSERT INTO permission.perm_list (code) VALUES ('UPDATE_XML_TRANSFORM');
+INSERT INTO permission.perm_list (code) VALUES ('MERGE_BIB_RECORDS');
 
 
 INSERT INTO permission.grp_tree (id, name, parent, description, perm_interval, usergroup, application_perm) VALUES
index c359d91..00c79e4 100644 (file)
@@ -224,6 +224,83 @@ SELECT  t.value as title,
     LEFT JOIN asset.stat_cat_entry_copy_map sc2 ON (sc2.owning_copy = cp.id AND sc2.stat_cat = 2)
     LEFT JOIN asset.stat_cat_entry sce2 ON (sce2.id = sc2.stat_cat_entry);
 
+
+CREATE OR REPLACE VIEW money.open_circ_balance_by_owning_lib AS
+       SELECT  circ.id,
+               cn.owning_lib,
+               bill.billing_type,
+               SUM(bill.amount) AS billed
+         FROM  action.circulation circ
+               JOIN money.billing bill ON (circ.id = bill.xact) 
+               JOIN asset.copy cp ON (circ.target_copy = cp.id) 
+               JOIN asset.call_number cn ON (cn.id = cp.call_number) 
+         WHERE circ.xact_finish IS NULL
+               AND NOT bill.voided
+         GROUP BY 1,2,3
+         ORDER BY 1,2,3;
+
+CREATE OR REPLACE VIEW money.open_balance_by_owning_lib AS
+       SELECT  owning_lib,
+               ARRAY_TO_STRING(ARRAY_ACCUM(DISTINCT billing_type), ', ') AS billing_types,
+               SUM(billed) - SUM( COALESCE((SELECT SUM(amount) AS paid FROM money.payment WHERE NOT voided AND xact = x.id), 0::NUMERIC) ) AS balance
+         FROM  money.open_circ_balance_by_owning_lib x
+         GROUP BY 1;
+
+
+
+
+
+CREATE OR REPLACE VIEW money.open_circ_balance_by_circ_and_owning_lib AS
+       SELECT  circ.id,
+               circ.circ_lib,
+               cn.owning_lib,
+               bill.billing_type,
+               SUM(bill.amount) AS billed
+         FROM  action.circulation circ
+               JOIN money.billing bill ON (circ.id = bill.xact) 
+               JOIN asset.copy cp ON (circ.target_copy = cp.id) 
+               JOIN asset.call_number cn ON (cn.id = cp.call_number) 
+         WHERE circ.xact_finish IS NULL
+               AND NOT bill.voided
+         GROUP BY 1,2,3,4
+         ORDER BY 1,2,3,4;
+
+CREATE OR REPLACE VIEW money.open_balance_by_circ_and_owning_lib AS
+       SELECT  circ_lib,
+               owning_lib,
+               ARRAY_TO_STRING(ARRAY_ACCUM(DISTINCT billing_type), ', ') AS billing_types,
+               SUM(billed) - SUM( COALESCE((SELECT SUM(amount) AS paid FROM money.payment WHERE NOT voided AND xact = x.id), 0::NUMERIC) ) AS balance
+         FROM  money.open_circ_balance_by_circ_and_owning_lib x
+         GROUP BY 1,2;
+
+
+
+
+
+CREATE OR REPLACE VIEW money.open_circ_balance_by_usr_home_and_owning_lib AS
+       SELECT  circ.id,
+               usr.home_ou,
+               cn.owning_lib,
+               bill.billing_type,
+               SUM(bill.amount) AS billed
+         FROM  action.circulation circ
+               JOIN money.billing bill ON (circ.id = bill.xact) 
+               JOIN asset.copy cp ON (circ.target_copy = cp.id) 
+               JOIN asset.call_number cn ON (cn.id = cp.call_number) 
+               JOIN actor.usr usr ON (circ.usr = usr.id) 
+         WHERE circ.xact_finish IS NULL
+               AND NOT bill.voided
+         GROUP BY 1,2,3,4
+         ORDER BY 1,2,3,4;
+
+CREATE OR REPLACE VIEW money.open_balance_by_usr_home_and_owning_lib AS
+       SELECT  home_ou,
+               owning_lib,
+               ARRAY_TO_STRING(ARRAY_ACCUM(DISTINCT billing_type), ', ') AS billing_types,
+               SUM(billed) - SUM( COALESCE((SELECT SUM(amount) AS paid FROM money.payment WHERE NOT voided AND xact = x.id), 0::NUMERIC) ) AS balance
+         FROM  money.open_circ_balance_by_usr_home_and_owning_lib x
+         GROUP BY 1,2;
+
 COMMIT;
 
 
index 30b3bd0..9fd9a9e 100644 (file)
@@ -129,10 +129,9 @@ SELECT     r.id,
        LEFT JOIN metabib.full_rec series_title ON (r.id = series_title.record AND series_title.tag IN ('830','440') AND series_title.subfield = 'a')
        LEFT JOIN metabib.full_rec series_statement ON (r.id = series_statement.record AND series_statement.tag = '490' AND series_statement.subfield = 'a')
        LEFT JOIN metabib.full_rec summary ON (r.id = summary.record AND summary.tag = '520' AND summary.subfield = 'a')
-  WHERE        r.deleted IS FALSE
   GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14;
 
-CREATE OR REPLACE VIEW reporter.super_simple_record AS
+CREATE OR REPLACE VIEW reporter.old_super_simple_record AS
 SELECT r.id,
        r.fingerprint,
        r.quality,
@@ -151,9 +150,40 @@ SELECT     r.id,
        LEFT JOIN metabib.full_rec pubdate ON (r.id = pubdate.record AND pubdate.tag = '260' AND pubdate.subfield = 'c')
        LEFT JOIN metabib.full_rec isbn ON (r.id = isbn.record AND isbn.tag IN ('024', '020') AND isbn.subfield IN ('a','z'))
        LEFT JOIN metabib.full_rec issn ON (r.id = issn.record AND issn.tag = '022' AND issn.subfield = 'a')
-  WHERE        r.deleted IS FALSE
   GROUP BY 1,2,3,4,5,6,8,9;
 
+CREATE TABLE reporter.materialized_simple_record AS SELECT * FROM reporter.old_super_simple_record WHERE 1=0;
+ALTER TABLE reporter.materialized_simple_record ADD PRIMARY KEY (id);
+CREATE VIEW reporter.super_simple_record AS SELECT * FROM reporter.materialized_simple_record;
+
+CREATE OR REPLACE FUNCTION reporter.simple_rec_sync () RETURNS TRIGGER AS $$
+DECLARE
+    r_id        BIGINT;
+    new_data    RECORD;
+BEGIN
+    IF TG_OP IN ('DELETE') THEN
+        r_id := OLD.record;
+    ELSE
+        r_id := NEW.record;
+    END IF;
+
+    SELECT * INTO new_data FROM reporter.materialized_simple_record WHERE id = r_id FOR UPDATE;
+    DELETE FROM reporter.materialized_simple_record WHERE id = r_id;
+
+    IF TG_OP IN ('DELETE') THEN
+        RETURN OLD;
+    ELSE
+        INSERT INTO reporter.materialized_simple_record SELECT DISTINCT ON (id) * FROM reporter.old_super_simple_record WHERE id = NEW.record;
+        RETURN NEW;
+    END IF;
+
+END;
+$$ LANGUAGE PLPGSQL;
+
+CREATE TRIGGER zzz_update_materialized_simple_record_tgr
+    AFTER INSERT OR UPDATE OR DELETE ON metabib.full_rec
+    FOR EACH ROW EXECUTE PROCEDURE reporter.simple_rec_sync();
+
 CREATE OR REPLACE VIEW reporter.demographic AS
 SELECT u.id,
        u.dob,
index e3b4ae2..a8e7e02 100644 (file)
@@ -1,6 +1,11 @@
 var djConfig = { parseOnLoad : true };
 
-var _url_locale = location.href.replace(/^.*conify\/(.+)\/global.*$/, "$1").toLowerCase().replace(/-/,'_');
-if (_url_locale) djConfig.locale = _url_locale;
-else djConfig.locale = '<!--#echo var="locale"-->';
+if (location.href.match(/^.*conify\/(.+)\/global.*$/, "$1")) {
+       var _url_locale = location.href.replace(/^.*conify\/(.+)\/global.*$/, "$1").toLowerCase().replace(/_/,'-','g');
 
+       if (_url_locale) djConfig.locale = _url_locale;
+
+} else {
+       var _url_locale = '<!--#echo var="locale"-->';
+       if (_url_locale != '(none)') djConfig.locale = _url_locale;
+}
index 9b25ff3..21d88cb 100644 (file)
                                                                                                setTimeout(
                                                                                                        'dojo.query(".status_grid_trans_cell_' + row + '").'+
                                                                                                                'instantiate(openils.widget.TranslatorPopup,{field:"name",'+
-                                                                                                               'targetObject:"window.status_rows['+row+']",unique:"' + row + '"});'+
+                                                                                                               'targetObject:"window.status_rows['+row+']"});'+
                                                                                                                'status_grid.rowHeightChanged('+row+')',
                                                                                                        0
                                                                                                );
index 774a7b3..518ffeb 100644 (file)
                                                                                                window.perm_rows[row] = new ccs().fromHash(window.perm_data_model.getRow(row));
                                                                                                setTimeout(
                                                                                                        'dojo.query(".perm_grid_trans_desc_' + row + '").'+
-                                                                                                               'instantiate(openils.I18N.translationWidget,{field:"description",'+
-                                                                                                               'targetObject:"window.perm_rows['+row+']",unique:"' + row + '"});'+
+                                                                                                               'instantiate(openils.widget.TranslatorPopup,{field:"description",'+
+                                                                                                               'targetObject:"window.perm_rows['+row+']"});'+
                                                                                                                'perm_grid.rowHeightChanged('+row+')',
                                                                                                        0
                                                                                                );
index 55ea859..8d54750 100644 (file)
@@ -16,7 +16,7 @@
 */
 
 dojo.require('fieldmapper.dojoData');
-dojo.require('openils.I18N');
+dojo.require('openils.widget.TranslatorPopup');
 dojo.require('dojo.parser');
 dojo.require('dojo.string');
 dojo.require('dojo.data.ItemFileWriteStore');
index 4a5f044..7c7262e 100644 (file)
@@ -30,6 +30,8 @@ if(!dojo._hasResource["openils.widget.TranslatorPopup"]) {
        dojo.require("dijit.form.Button");
        dojo.require("dijit.form.TextBox");
        dojo.require("dijit.form.ComboBox");
+       dojo.require("dojox.jsonPath");
+       dojo.requireLocalization("openils.widget", "TranslatorPopup");
 
 
     dojo.declare(
@@ -37,187 +39,206 @@ if(!dojo._hasResource["openils.widget.TranslatorPopup"]) {
                [dijit._Widget, dijit._Templated],
                {
 
-                       templateString : "<span dojoAttachPoint='node'><div dojoType='dijit.form.DropDownButton'><span>Translate</span><div id='${field}_translation_${unique}' dojoType='dijit.TooltipDialog' onOpen='openils.widget.TranslatorPopup.renderTranslationPopup(${targetObject}, \"${field}\", \"${unique}\")' ><div dojoType='dijit.layout.ContentPane'><table><tbody class='translation_tbody_template' style='display:none; visiblity:hidden;'><tr><th>Locale</th><td class='locale'><div class='locale_combobox'></div></td><th>Translation</th><td class='translation'><div class='translation_textbox'></div></td><td><button class='create_button' style='display:none; visiblity:hidden;'>Create</button><button class='update_button' style='display:none; visiblity:hidden;'>Update</button><button class='delete_button' style='display:none; visiblity:hidden;'>Remove</button></td></tr></tbody><tbody class='translation_tbody'></tbody></table></div></div></div></span>",
+                       templateString : "<span dojoAttachPoint='node'><div id='${field}_translation_button_${unique}' dojoAttachPoint='translateLabelNode' dojoType='dijit.form.DropDownButton'><span>Translate</span><div id='${field}_translation_${unique}' dojoAttachPoint='tooltipDialog' dojoType='dijit.TooltipDialog'><div dojoType='dijit.layout.ContentPane'><table><tbody class='translation_tbody_template' style='display:none; visiblity:hidden;'><tr><th dojoAttachPoint='localeLabelNode'/><td class='locale'><div class='locale_combobox'></div></td><th dojoAttachPoint='translationLabelNode'/><td class='translation'><div class='translation_textbox'></div></td><td><button class='create_button' style='display:none; visiblity:hidden;'><span dojoAttachPoint='createButtonNode'/></button><button class='update_button' style='display:none; visiblity:hidden;'><span dojoAttachPoint='updateButtonNode'/></button><button class='delete_button' style='display:none; visiblity:hidden;'><span dojoAttachPoint='removeButtonNode'/></button></td></tr></tbody><tbody class='translation_tbody'></tbody></table></div></div></div></span>",
 
                        widgetsInTemplate: true,
                        field : "",
                        targetObject : "",
-                       unique : ""
-               }
-       );
-
-       openils.widget.TranslatorPopup.renderTranslationPopup = function (obj, field, num) {
-               var node = dojo.byId(field + '_translation_' + num);
-
-               var trans_list = openils.I18N.getTranslations( obj, field );
-
-               var trans_template = dojo.query('.translation_tbody_template', node)[0];
-               var trans_tbody = dojo.query('.translation_tbody', node)[0];
-
-               // Empty it
-               while (trans_tbody.lastChild) trans_tbody.removeChild( trans_tbody.lastChild );
+                       unique : "",
 
-               for (var i in trans_list) {
-                       if (!trans_list[i]) continue;
+                       postCreate : function () {
 
-                       var trans_obj = trans_list[i];
-                       var trans_id = trans_obj.id();
+                               dojo.connect(this.tooltipDialog, 'onOpen', this, 'renderTranslatorPopup');
 
-                       var trans_row = dojo.query('tr',trans_template)[0].cloneNode(true);
-                       trans_row.id = 'translation_row_' + trans_id;
+                               this.nls = dojo.i18n.getLocalization("openils.widget", "TranslatorPopup");
 
-                       var old_dijit = dijit.byId('locale_' + trans_id);
-                       if (old_dijit) old_dijit.destroy();
+                               this.translateLabelNode.setLabel(this.nls.translate);
 
-                       old_dijit = dijit.byId('translation_' + trans_id);
-                       if (old_dijit) old_dijit.destroy();
+                               this.localeLabelNode.textContent = this.nls.locale;
+                               this.translationLabelNode.textContent = this.nls.translation;
 
-                       dojo.query('.locale_combobox',trans_row).instantiate(
-                               dijit.form.ComboBox,
-                               { store:openils.I18N.localeStore,
-                                 searchAttr:'locale',
-                                 lowercase:true,
-                                 required:true,
-                                 id:'locale_' + trans_id,
-                                 value: trans_obj.translation(),
-                                 invalidMessage:'Specify locale as {languageCode}_{countryCode}, like en_us',
-                                 regExp:'[a-z_]+'
-                               }
-                       );
+                               this.createButtonNode.textContent = this.nls.create;
+                               this.updateButtonNode.textContent = this.nls.update;
+                               this.removeButtonNode.textContent = this.nls.remove;
+                       },
 
-                       dojo.query('.translation_textbox',trans_row).instantiate(
-                               dijit.form.TextBox,
-                               { required : true,
-                                 id:'translation_' + trans_id,
-                                 value: trans_obj.string()
-                               }
-                       );
-
-                       dojo.query('.update_button',trans_row).style({ visibility : 'visible', display : 'inline'}).instantiate(
-                               dijit.form.Button,
-                               { onClick :
-                                       (function (trans_id, obj, field) {
-                                               return function () { openils.widget.TranslatorPopup.updateTranslation(trans_id, obj, field, num) }
-                                       })(trans_id, obj, field) 
+                       renderTranslatorPopup : function () {
+               
+                               this._targetObject = dojox.jsonPath.query(window, '$.' + this.targetObject, {evalType:"RESULT"});
+
+                               var node = dojo.byId(this.field + '_translation_' + this.unique);
+               
+                               var trans_list = openils.I18N.getTranslations( this._targetObject, this.field );
+               
+                               var trans_template = dojo.query('.translation_tbody_template', node)[0];
+                               var trans_tbody = dojo.query('.translation_tbody', node)[0];
+               
+                               // Empty it
+                               while (trans_tbody.lastChild) trans_tbody.removeChild( trans_tbody.lastChild );
+               
+                               for (var i in trans_list) {
+                                       if (!trans_list[i]) continue;
+               
+                                       var trans_obj = trans_list[i];
+                                       var trans_id = trans_obj.id();
+               
+                                       var trans_row = dojo.query('tr',trans_template)[0].cloneNode(true);
+                                       trans_row.id = 'translation_row_' + trans_id;
+               
+                                       var old_dijit = dijit.byId('locale_' + trans_id);
+                                       if (old_dijit) old_dijit.destroy();
+               
+                                       old_dijit = dijit.byId('translation_' + trans_id);
+                                       if (old_dijit) old_dijit.destroy();
+               
+                                       dojo.query('.locale_combobox',trans_row).instantiate(
+                                               dijit.form.ComboBox,
+                                               { store:openils.I18N.localeStore,
+                                                 searchAttr:'locale',
+                                                 lowercase:true,
+                                                 required:true,
+                                                 id:'locale_' + trans_id,
+                                                 value: trans_obj.translation(),
+                                                 invalidMessage:'Specify locale as {languageCode}_{countryCode}, like en_us',
+                                                 regExp:'[a-z_]+'
+                                               }
+                                       );
+               
+                                       dojo.query('.translation_textbox',trans_row).instantiate(
+                                               dijit.form.TextBox,
+                                               { required : true,
+                                                 id:'translation_' + trans_id,
+                                                 value: trans_obj.string()
+                                               }
+                                       );
+               
+                                       dojo.query('.update_button',trans_row).style({ visibility : 'visible', display : 'inline'}).instantiate(
+                                               dijit.form.Button,
+                                               { onClick : dojo.hitch( this, 'updateTranslation') }
+                                       );
+               
+                                       dojo.query('.delete_button',trans_row).style({ visibility : 'visible', display : 'inline'}).instantiate(
+                                               dijit.form.Button,
+                                               { onClick : dojo.hitch( this, 'removeTranslation') }
+                                       );
+               
+                                       trans_tbody.appendChild( trans_row );
+               
                                }
-                       );
-
-                       dojo.query('.delete_button',trans_row).style({ visibility : 'visible', display : 'inline'}).instantiate(
-                               dijit.form.Button,
-                               { onClick :
-                                       (function (trans_id, obj, field) {
-                                               return function () { openils.widget.TranslatorPopup.removeTranslation(trans_id, obj, field, num) }
-                                       })(trans_id, obj, field) 
-                               }
-                       );
-
-                       trans_tbody.appendChild( trans_row );
-               }
-
-               old_dijit = dijit.byId('i18n_new_locale_' + obj.classname + '.' + field + num);
-               if (old_dijit) old_dijit.destroy();
-
-               old_dijit = dijit.byId('i18n_new_translation_' + obj.classname + '.' + field + num);
-               if (old_dijit) old_dijit.destroy();
+               
+                               old_dijit = dijit.byId('i18n_new_locale_' + this._targetObject.classname + '.' + this.field + this.unique);
+                               if (old_dijit) old_dijit.destroy();
+               
+                               old_dijit = dijit.byId('i18n_new_translation_' + this._targetObject.classname + '.' + this.field + this.unique);
+                               if (old_dijit) old_dijit.destroy();
+               
+                               trans_row = dojo.query('tr',trans_template)[0].cloneNode(true);
+               
+                               dojo.query('.locale_combobox',trans_row).instantiate(
+                                       dijit.form.ComboBox,
+                                       { store:openils.I18N.localeStore,
+                                         searchAttr:'locale',
+                                         id:'i18n_new_locale_' + this._targetObject.classname + '.' + this.field + this.unique,
+                                         lowercase:true,
+                                         required:true,
+                                         invalidMessage:'Specify locale as {languageCode}_{countryCode}, like en_us',
+                                         regExp:'[a-z_]+'
+                                       }
+                               );
+               
+                               dojo.query('.translation_textbox',trans_row).addClass('new_translation').instantiate(
+                                       dijit.form.TextBox,
+                                       { required : true,
+                                         id:'i18n_new_translation_' + this._targetObject.classname + '.' + this.field + this.unique
+                                       }
+                               );
+               
+                               dojo.query('.create_button',trans_row).style({ visibility : 'visible', display : 'inline'}).instantiate(
+                                       dijit.form.Button,
+                                       { onClick : dojo.hitch( this, 'createTranslation') }
+                               );
+               
+                               trans_tbody.appendChild( trans_row );
 
-               trans_row = dojo.query('tr',trans_template)[0].cloneNode(true);
+                       },
 
-               dojo.query('.locale_combobox',trans_row).instantiate(
-                       dijit.form.ComboBox,
-                       { store:openils.I18N.localeStore,
-                         searchAttr:'locale',
-                         id:'i18n_new_locale_' + obj.classname + '.' + field + num,
-                         lowercase:true,
-                         required:true,
-                         invalidMessage:'Specify locale as {languageCode}_{countryCode}, like en_us',
-                         regExp:'[a-z_]+'
+                       updateTranslation : function (t) {
+                               return this.changeTranslation('update',t);
+                       },
+                       
+                       removeTranslation : function (t) {
+                               return changeTranslation('delete',t);
+                       },
+                       
+                       changeTranslation : function (method, trans_id) {
+                       
+                               var trans_obj = new i18n().fromHash({
+                                       ischanged : method == 'update' ? 1 : 0,
+                                       isdeleted : method == 'delete' ? 1 : 0,
+                                       id : trans_id,
+                                       fq_field : this._targetObject.classname + '.' + this.field,
+                                       identity_value : this._targetObject.id(),
+                                       translation : dijit.byId('locale_' + trans_id).getValue(),
+                                       string : dijit.byId('translation_' + trans_id).getValue()
+                               });
+                       
+                               this.writeTranslation(method, trans_obj);
+                       },
+                       
+                       createTranslation : function () {
+                               var node = dojo.byId(this.field + '_translation_' + this.unique);
+                       
+                               var trans_obj = new i18n().fromHash({
+                                       isnew : 1,
+                                       fq_field : this._targetObject.classname + '.' + this.field,
+                                       identity_value : this._targetObject.id(),
+                                       translation : dijit.byId('i18n_new_locale_' + this._targetObject.classname + '.' + this.field + this.unique).getValue(),
+                                       string : dijit.byId('i18n_new_translation_' + this._targetObject.classname + '.' + this.field + this.unique).getValue()
+                               });
+                       
+                               this.writeTranslation('create', trans_obj);
+                       },
+       
+                       writeTranslation : function (method, trans_obj) {
+                       
+                               OpenSRF.CachedClientSession('open-ils.permacrud').request({
+                                       method : 'open-ils.permacrud.' + method + '.i18n',
+                                       timeout: 10,
+                                       params : [ ses, trans_obj ],
+                                       onerror: function (r) {
+                                               //highlighter.editor_pane.red.play();
+                                               if (status_update) status_update( 'Problem saving translation for ' + this._targetObject[this.field]() );
+                                       },
+                                       oncomplete : function (r) {
+                                               var res = r.recv();
+                                               if ( res && res.content() ) {
+                                                       //highlighter.editor_pane.green.play();
+                                                       if (status_update) status_update( 'Saved changes to translation for ' + this._targetObject[this.field]() );
+                       
+                                                       if (method == 'delete') {
+                                                               dojo.NodeList(dojo.byId('translation_row_' + trans_obj.id())).orphan();
+                                                       } else if (method == 'create') {
+                                                               var node = dojo.byId(this.field + '_translation_' + this.unique);
+                                                               dijit.byId('i18n_new_locale_' + this._targetObject.classname + '.' + this.field + this.unique).setValue(null);
+                                                               dijit.byId('i18n_new_translation_' + this._targetObject.classname + '.' + this.field + this.unique).setValue(null);
+                                                               this.renderTranslatorPopup();
+                                                       }
+                       
+                                               } else {
+                                                       //highlighter.editor_pane.red.play();
+                                                       if (status_update) status_update( 'Problem saving translation for ' + this._targetObject[this.field]() );
+                                               }
+                                       },
+                               }).send();
                        }
-               );
 
-               dojo.query('.translation_textbox',trans_row).addClass('new_translation').instantiate(
-                       dijit.form.TextBox,
-                       { required : true,
-                         id:'i18n_new_translation_' + obj.classname + '.' + field + num
-                       }
-               );
+               }
 
-               dojo.query('.create_button',trans_row).style({ visibility : 'visible', display : 'inline'}).instantiate(
-                       dijit.form.Button,
-                       { onClick : function () { openils.widget.TranslatorPopup.createTranslation( obj, field, num) } }
-               );
+       );
+
+       openils.widget.TranslatorPopup._unique = 1;
 
-               trans_tbody.appendChild( trans_row );
-       }
 
-       openils.widget.TranslatorPopup.updateTranslation = function (trans_id, obj, field, num) {
-               return openils.widget.TranslatorPopup.changeTranslation('update', trans_id, obj, field, num);
-       }
-       
-       openils.widget.TranslatorPopup.removeTranslation = function (trans_id, obj, field, num) {
-               return openils.widget.TranslatorPopup.changeTranslation('delete', trans_id, obj, field, num);
-       }
-       
-       openils.widget.TranslatorPopup.changeTranslation = function (method, trans_id, obj, field, num) {
-       
-               var trans_obj = new i18n().fromHash({
-                       ischanged : method == 'update' ? 1 : 0,
-                       isdeleted : method == 'delete' ? 1 : 0,
-                       id : trans_id,
-                       fq_field : obj.classname + '.' + field,
-                       identity_value : obj.id(),
-                       translation : dijit.byId('locale_' + trans_id).getValue(),
-                       string : dijit.byId('translation_' + trans_id).getValue()
-               });
-       
-               openils.widget.TranslatorPopup.writeTranslation(method, trans_obj, obj, field, num);
-       }
-       
-       openils.widget.TranslatorPopup.createTranslation = function (obj, field, num) {
-               var node = dojo.byId(field + '_translation_' + num);
-       
-               var trans_obj = new i18n().fromHash({
-                       isnew : 1,
-                       fq_field : obj.classname + '.' + field,
-                       identity_value : obj.id(),
-                       translation : dijit.byId('i18n_new_locale_' + obj.classname + '.' + field + num).getValue(),
-                       string : dijit.byId('i18n_new_translation_' + obj.classname + '.' + field + num).getValue()
-               });
-       
-               openils.widget.TranslatorPopup.writeTranslation('create', trans_obj, obj, field, num);
-       }
-       
-       openils.widget.TranslatorPopup.writeTranslation = function (method, trans_obj, obj, field, num) {
-       
-               OpenSRF.CachedClientSession('open-ils.permacrud').request({
-                       method : 'open-ils.permacrud.' + method + '.i18n',
-                       timeout: 10,
-                       params : [ ses, trans_obj ],
-                       onerror: function (r) {
-                               //highlighter.editor_pane.red.play();
-                               if (status_update) status_update( 'Problem saving translation for ' + obj[field]() );
-                       },
-                       oncomplete : function (r) {
-                               var res = r.recv();
-                               if ( res && res.content() ) {
-                                       //highlighter.editor_pane.green.play();
-                                       if (status_update) status_update( 'Saved changes to translation for ' + obj[field]() );
-       
-                                       if (method == 'delete') {
-                                               dojo.NodeList(dojo.byId('translation_row_' + trans_obj.id())).orphan();
-                                       } else if (method == 'create') {
-                                               var node = dojo.byId(field + '_translation_' + num);
-                                               dijit.byId('i18n_new_locale_' + obj.classname + '.' + field + num).setValue(null);
-                                               dijit.byId('i18n_new_translation_' + obj.classname + '.' + field + num).setValue(null);
-                                               openils.widget.TranslatorPopup.renderTranslationPopup(obj, field, num);
-                                       }
-       
-                               } else {
-                                       //highlighter.editor_pane.red.play();
-                                       if (status_update) status_update( 'Problem saving translation for ' + obj[field]() );
-                               }
-                       },
-               }).send();
-       }
 
 }
 
diff --git a/Open-ILS/web/js/dojo/openils/widget/nls/TranslatorPopup.js b/Open-ILS/web/js/dojo/openils/widget/nls/TranslatorPopup.js
new file mode 100644 (file)
index 0000000..7fc07a4
--- /dev/null
@@ -0,0 +1,8 @@
+({
+       locale : 'Locale',
+       translation : 'Translation',
+       translate : 'Translate',
+       create : 'Create',
+       update : 'Update',
+       remove : 'Remove'
+})
diff --git a/Open-ILS/web/js/dojo/openils/widget/nls/es/TranslatorPopup.js b/Open-ILS/web/js/dojo/openils/widget/nls/es/TranslatorPopup.js
new file mode 100644 (file)
index 0000000..b976c60
--- /dev/null
@@ -0,0 +1,8 @@
+({
+       locale : 'Escena',
+       translation : 'Traduccion',
+       translate : 'Traducir',
+       create : 'Crear',
+       update : 'Actualizacion',
+       remove : 'Quitar'
+})
index 19c484c..99197a8 100644 (file)
@@ -111,7 +111,7 @@ function instanceOf(object, constructorFunction) {
 
 /* ------------------------------------------------------------------------------------------- */
 /* detect my browser */
-var isMac, NS, NS4, NS6, IE, IE4, IE4mac, IE4plus, IE5, IE5plus, IE6, IEMajor, ver4;
+var isMac, NS, NS4, NS6, IE, IE4, IEmac, IE4plus, IE5, IE5plus, IE6, IEMajor, ver4;
 function detect_browser() {       
 
    isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
index b7a210d..0ef27e5 100644 (file)
@@ -209,6 +209,7 @@ function resultLowHits() {
        if(getTerm()) resultExpandSearch(); /* advanced search */
 }
 
+var lowHitsXRefSet = {};
 var lowHitsXRefLink;
 var lowHitsXRefLinkParent;
 function resultLowHitXRef(r) {
@@ -224,6 +225,10 @@ function resultLowHitXRef(r) {
                var word;
                var c = 0;
                while( word = arr.shift() ) {
+
+            if (lowHitsXRefSet[word] == 1) continue;
+            lowHitsXRefSet[word] = 1;
+
                        if(c++ > 20) break;
                        var a = {};
                        a[PARAM_TERM] = word;
index 85ff58c..8fdcb11 100644 (file)
@@ -604,7 +604,7 @@ oilsRptFolderWindow.prototype.setFolderEditActions = function() {
        DOM.oils_rpt_folder_manager_name_input.value = folder.name();
        DOM.oils_rpt_folder_manager_change_name_submit.onclick = function() {
                var name = DOM.oils_rpt_folder_manager_name_input.value;
-               if(name) {
+               if(name != "") {
                        folder.name( name );
                        if(confirmId('oils_rpt_folder_manager_change_name_confirm')) {
                                oilsRptUpdateFolder(folder, obj.type,
index 4565aba..055d1e0 100644 (file)
@@ -213,7 +213,7 @@ OpenILS.data.prototype = {
                'ccs' : [ api.FM_CCS_RETRIEVE.app, api.FM_CCS_RETRIEVE.method, [], true ],
                'aou' : [ api.FM_AOU_RETRIEVE.app, api.FM_AOU_RETRIEVE.method, [], true ],
                'aout' : [ api.FM_AOUT_RETRIEVE.app, api.FM_AOUT_RETRIEVE.method, [], true ],
-               'crahp' : [ api.FM_CRAHP_RETRIEVE.app, api.FM_CRAHP_RETRIEVE.method, [], true ],
+               'crahp' : [ api.FM_CRAHP_RETRIEVE.app, api.FM_CRAHP_RETRIEVE.method, [], true ]
        },
 
        'stash_retrieve' : function() {
@@ -255,92 +255,92 @@ OpenILS.data.prototype = {
                                        'type' : 'items',
                                        'header' : 'The following items have been examined:<hr/><ol>',
                                        'line_item' : '<li>%title%<br/>\r\nBarcode: %barcode%\r\n',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                }, 
                                'transit_list' : {
                                        'type' : 'transits',
                                        'header' : 'Transits:<hr/><ol>',
                                        'line_item' : '<li>From: %transit_source% To: %transit_dest_lib%<br/>\r\nWhen: %transit_source_send_time%<br />\r\nBarcode: %transit_item_barcode% Title: %transit_item_title%<br/>\r\n',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                }, 
                                'items_out' : {
                                        'type' : 'items',
                                        'header' : 'Welcome to %LIBRARY%!<br/>\r\nYou have the following items:<hr/><ol>',
                                        'line_item' : '<li>%title%<br/>\r\nBarcode: %barcode% Due: %due_date%\r\n',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\nYou were helped by %STAFF_FIRSTNAME%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\nYou were helped by %STAFF_FIRSTNAME%<br/>\r\n<br/>\r\n'
                                }, 
                                'checkout' : {
                                        'type' : 'items',
                                        'header' : 'Welcome to %LIBRARY%!<br/>\r\nYou checked out the following items:<hr/><ol>',
                                        'line_item' : '<li>%title%<br/>\r\nBarcode: %barcode% Due: %due_date%\r\n',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\nYou were helped by %STAFF_FIRSTNAME%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\nYou were helped by %STAFF_FIRSTNAME%<br/>\r\n<br/>\r\n'
                                }, 
                                'offline_checkout' : {
                                        'type' : 'offline_checkout',
                                        'header' : 'Patron %patron_barcode%<br/>\r\nYou checked out the following items:<hr/><ol>',
                                        'line_item' : '<li>Barcode: %barcode%<br/>\r\nDue: %due_date%\r\n',
-                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                },
                                'checkin' : {
                                        'type' : 'items',
                                        'header' : 'You checked in the following items:<hr/><ol>',
                                        'line_item' : '<li>%title%<br/>\r\nBarcode: %barcode%  Call Number: %call_number%\r\n',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                }, 
                                'bill_payment' : {
                                        'type' : 'payment',
                                        'header' : 'Welcome to %LIBRARY%!<br/>A receipt of your  transaction:<hr/> <table width="100%"> <tr> <td>Original Balance:</td> <td align="right">$%original_balance%</td> </tr> <tr> <td>Payment Method:</td> <td align="right">%payment_type%</td> </tr> <tr> <td>Payment Received:</td> <td align="right">$%payment_received%</td> </tr> <tr> <td>Payment Applied:</td> <td align="right">$%payment_applied%</td> </tr> <tr> <td>Billings Voided:</td> <td align="right">%voided_balance%</td> </tr> <tr> <td>Change Given:</td> <td align="right">$%change_given%</td> </tr> <tr> <td>New Balance:</td> <td align="right">$%new_balance%</td> </tr> </table> <p> Note: %note% </p> <p> Specific bills: <blockquote>',
                                        'line_item' : 'Bill #%bill_id%  %last_billing_type% Received: $%payment%<br />%barcode% %title%<br /><br />',
-                                       'footer' : '</blockquote> </p> <hr />%SHORTNAME% %TODAY_TRIM%<br/> <br/> ',
+                                       'footer' : '</blockquote> </p> <hr />%SHORTNAME% %TODAY_TRIM%<br/> <br/> '
                                },
                                'bills_historical' : {
                                        'type' : 'bills',
                                        'header' : 'Welcome to %LIBRARY%!<br/>You had the following bills:<hr/><ol>',
                                        'line_item' : '<dt><b>Bill #%id%</b></dt> <dd> <table> <tr valign="top"><td>Date:</td><td>%xact_start%</td></tr> <tr valign="top"><td>Type:</td><td>%xact_type%</td></tr> <tr valign="top"><td>Last Billing:</td><td>%last_billing_type%<br/>%last_billing_note%</td></tr> <tr valign="top"><td>Total Billed:</td><td>$%total_owed%</td></tr> <tr valign="top"><td>Last Payment:</td><td>%last_payment_type%<br/>%last_payment_note%</td></tr> <tr valign="top"><td>Total Paid:</td><td>$%total_paid%</td></tr> <tr valign="top"><td><b>Balance:</b></td><td><b>$%balance_owed%</b></td></tr> </table><br/>',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                }, 
                                'bills_current' : {
                                        'type' : 'bills',
                                        'header' : 'Welcome to %LIBRARY%!<br/>You have the following bills:<hr/><ol>',
                                        'line_item' : '<dt><b>Bill #%id%</b></dt> <dd> <table> <tr valign="top"><td>Date:</td><td>%xact_start%</td></tr> <tr valign="top"><td>Type:</td><td>%xact_type%</td></tr> <tr valign="top"><td>Last Billing:</td><td>%last_billing_type%<br/>%last_billing_note%</td></tr> <tr valign="top"><td>Total Billed:</td><td>$%total_owed%</td></tr> <tr valign="top"><td>Last Payment:</td><td>%last_payment_type%<br/>%last_payment_note%</td></tr> <tr valign="top"><td>Total Paid:</td><td>$%total_paid%</td></tr> <tr valign="top"><td><b>Balance:</b></td><td><b>$%balance_owed%</b></td></tr> </table><br/>',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                },
                                'bills_main_view' : {
                                        'type' : 'bills',
                                        'header' : 'Welcome to %LIBRARY%!<br/>You have the following bills:<hr/><ol>',
                                        'line_item' : '<dt><b>Bill #%id%</b> %title%</dt> <dd> <table width="100%"> <tr valign="top"><td>Date:</td><td>%xact_start%</td></tr> <tr valign="top"><td>Type:</td><td>%xact_type%</td></tr> <tr valign="top"><td>Last Billing:</td><td>%last_billing_type%<br/>%last_billing_note%</td></tr> <tr valign="top"><td>Total Billed:</td><td>$%total_owed%</td></tr> <tr valign="top"><td>Last Payment:</td><td>%last_payment_type%<br/>%last_payment_note%</td></tr> <tr valign="top"><td>Total Paid:</td><td>$%total_paid%</td></tr> <tr valign="top"><td><b>Balance:</b></td><td><b>$%balance_owed%</b></td></tr> </table><br/>',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                },
                                'offline_checkin' : {
                                        'type' : 'offline_checkin',
                                        'header' : 'You checked in the following items:<hr/><ol>',
                                        'line_item' : '<li>Barcode: %barcode%\r\n',
-                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                },
                                'offline_renew' : {
                                        'type' : 'offline_renew',
                                        'header' : 'You renewed the following items:<hr/><ol>',
                                        'line_item' : '<li>Barcode: %barcode%\r\n',
-                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                },
                                'offline_inhouse_use' : {
                                        'type' : 'offline_inhouse_use',
                                        'header' : 'You marked the following in-house items used:<hr/><ol>',
                                        'line_item' : '<li>Barcode: %barcode%\r\nUses: %count%',
-                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                },
                                'in_house_use' : {
                                        'type' : 'items',
                                        'header' : 'You marked the following in-house items used:<hr/><ol>',
                                        'line_item' : '<li>Barcode: %barcode%\r\nUses: %uses%\r\n<br />%alert_message%',
-                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                                       'footer' : '</ol><hr />%TODAY_TRIM%<br/>\r\n<br/>\r\n'
                                },
                                'holds' : {
                                        'type' : 'holds',
                                        'header' : 'Welcome to %LIBRARY%!<br/>\r\nYou have the following titles on hold:<hr/><ol>',
                                        'line_item' : '<li>%title%\r\n',
-                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\nYou were helped by %STAFF_FIRSTNAME%<br/>\r\n<br/>\r\n',
-                               } 
+                                       'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\nYou were helped by %STAFF_FIRSTNAME%<br/>\r\n<br/>\r\n'
+                               }
                        }; 
 
                        obj.stash( 'print_list_templates', 'print_list_types' );
index dc3841f..f6ae1ea 100644 (file)
@@ -15,7 +15,7 @@ const my_constants = {
                '1' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : true }, /* | Checked out    | t */
                '3' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : true }, /* | Lost           | f */
                '6' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : true }, /* | In transit     | t */
-               '8' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : false }, /* | On holds shelf | t */
+               '8' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : false } /* | On holds shelf | t */
        }
 }
 
@@ -214,7 +214,7 @@ const api = {
        'RECALCULATE_STANDING_PENALTIES' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.penalties.update' },
     'USER_ORG_UNIT_OPT_IN_FEATURE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.enabled' },
     'USER_ORG_UNIT_OPT_IN_CHECK' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.check' },
-    'USER_ORG_UNIT_OPT_IN_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.create' },
+    'USER_ORG_UNIT_OPT_IN_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.create' }
 }
 
 const urls = {
@@ -310,5 +310,5 @@ const urls = {
        'XUL_VOLUME_EDITOR' : '/xul/server/cat/volume_editor.xul',
        'XUL_Z3950_IMPORT' : '/xul/server/cat/z3950.xul',
        'TEST_HTML' : '/xul/server/main/test.html',
-       'TEST_XUL' : '/xul/server/main/test.xul',
+       'TEST_XUL' : '/xul/server/main/test.xul'
 }
index b5bf127..39a40a5 100644 (file)
@@ -323,7 +323,7 @@ main.menu.prototype = {
                                        var loc = urls.XUL_REMOTE_BROWSER + '?url=' + window.escape(
                                                obj.url_prefix(urls.XUL_HOLD_PULL_LIST) + '?ses='+window.escape(ses())
                                        );
-                                       obj.set_tab( loc, {'tab_name' : offlineStrings.getString('menu.cmd_browse_hold_pull_list.tab')}, { 'show_print_button' : true, } );
+                                       obj.set_tab( loc, {'tab_name' : offlineStrings.getString('menu.cmd_browse_hold_pull_list.tab')}, { 'show_print_button' : true } );
                                }
                        ],
 
index 4df7cb5..35af4e6 100644 (file)
@@ -72,7 +72,7 @@ util.browser.prototype = {
                                                                        obj.error.sdump('D_ERROR',err);
                                                                }
                                                        }
-                                               ],
+                                               ]
                                        }
                                }
                        );
@@ -258,7 +258,7 @@ util.browser.prototype = {
                } catch(E) {
                        this.error.sdump('D_ERROR','util.browser.buildProgressListener: ' + E + '\n');
                }
-       },
+       }
 }
 
 dump('exiting util.browser.js\n');
index cf173ec..29b5b4c 100644 (file)
@@ -164,7 +164,7 @@ util.deck.prototype = {
                                        'push_xulG' : true,
                                        'alt_print' : false,
                                        'browser_id' : 'frame_'+obj.id_incr,
-                                       'passthru_content_params' : content_params,
+                                       'passthru_content_params' : content_params
                                }
                        );
                return browser;
@@ -180,7 +180,7 @@ util.deck.prototype = {
                }
        },
 
-       'id_incr' : 0,
+       'id_incr' : 0
 }      
 
 dump('exiting util/deck.js\n');
index 63b45ad..aa83188 100644 (file)
@@ -509,7 +509,7 @@ util.error.prototype = {
                        }
                }
                return r;
-       },
+       }
 }
 
 dump('exiting util/error.js\n');
index d148bba..3606ab0 100644 (file)
@@ -1294,7 +1294,7 @@ util.list.prototype = {
                } catch(E) {
                        obj.error.standard_unexpected_error_alert('pre sorting', E);
                }
-       },
+       }
 
 }
 dump('exiting util.list.js\n');
index b0d42a6..736d680 100644 (file)
@@ -251,7 +251,7 @@ util.network.prototype = {
                        {
                                'login_type' : 'staff',
                                'desc_brief' : text ? 'Session Expired' : 'Operator Change',
-                               'desc_full' : text ? 'Please enter the credentials for a new login session.' : 'Please enter the credentials for the new login session.  Note that the previous session is still active.',
+                               'desc_full' : text ? 'Please enter the credentials for a new login session.' : 'Please enter the credentials for the new login session.  Note that the previous session is still active.'
                                //'simple_auth' : (new Date()).toString(),
                        }
                );
@@ -315,7 +315,7 @@ util.network.prototype = {
                                                {
                                                        'login_type' : 'temp',
                                                        'desc_brief' : 'Permission Denied: ' + robj.ilsperm,
-                                                       'desc_full' : 'Another staff member with the above permission may authorize this specific action.  Please notify your library administrator if you need this permission.  If you feel you have received this exception in error, please inform your friendly Evergreen developers or helpdesk staff of the above permission and this debug information: ' + name,
+                                                       'desc_full' : 'Another staff member with the above permission may authorize this specific action.  Please notify your library administrator if you need this permission.  If you feel you have received this exception in error, please inform your friendly Evergreen developers or helpdesk staff of the above permission and this debug information: ' + name
                                                        //'simple_auth' : (new Date()).toString(),
                                                }
                                        );
@@ -399,9 +399,7 @@ util.network.prototype = {
                } catch(E) {
                        throw(E);
                }
-       },
-
-
+       }
 }
 
 /*
index b53c619..34ce66c 100644 (file)
@@ -436,7 +436,7 @@ util.print.prototype = {
                } catch(E) {
                        this.error.standard_unexpected_error_alert("save_settings()",E);
                }
-       },
+       }
 }
 
 dump('exiting util/print.js\n');
index 5a45f51..2190199 100644 (file)
@@ -12,6 +12,9 @@ pref("open-ils.repository.revision","$Revision$");
 pref("open-ils.repository.date","$Date$");
 pref("open-ils.repository.id","$Id$");
 
+// We'll set a default locale
+pref("general.useragent.locale", "en-US");
+
 // We need something like this to get window.open to work in some places (where it complains about
 // navigator.xul not being registered.  But is about:blank the best value to use here?
 pref("browser.chromeURL","about:blank");
index 990d5b0..8b8f397 100644 (file)
                                                                                        var content_params = {
                                                                                                'session' : ses(),
                                                                                                'authtime' : ses('authtime'),
-                                                                                               'opac_url' : opac_url,
+                                                                                               'opac_url' : opac_url
                                                                                        };
                                                                                        xulG.set_tab(
                                                                                                xulG.url_prefix(urls.XUL_OPAC_WRAPPER),
index b391763..8c815e8 100644 (file)
@@ -542,7 +542,7 @@ var ff_pos = {
                },
                _6 : {
                        VIS : {start : 16, len : 1, def : ' ' }
-               },
+               }
        },
        Time : {
                _8 : {
@@ -586,7 +586,7 @@ var ff_pos = {
                },
                _6 : {
                        MAP : {start : 16, len : 2, def : ' ' }
-               },
+               }
        },
        Relf : {
                _8 : {
@@ -1090,7 +1090,7 @@ function updateFixedFields (element) {
                ldr : _record.leader,
                _6 : _record.controlfield.(@tag=='006'),
                _7 : _record.controlfield.(@tag=='007'),
-               _8 : _record.controlfield.(@tag=='008'),
+               _8 : _record.controlfield.(@tag=='008')
        };
 
        var name = element.getAttribute('name');
@@ -1305,14 +1305,14 @@ function marcSubfield (sf) {
                          onmouseover : 'getTooltip(this, "subfield");',
                          contextmenu : function (event) { getAuthorityContextMenu(event.target, sf) },
                          size : new String(sf.text()).length + 2,
-                         oninput : "this.setAttribute('size', this.value.length + 2);",
+                         oninput : "this.setAttribute('size', this.value.length + 2);"
                        } )
        );
 }
 
 function loadRecord(rec) {
        try {
-                       _record = rec;
+                       var _record = rec;
                        var grid_rows = document.getElementById('recGrid').lastChild;
 
                        while (grid_rows.firstChild) grid_rows.removeChild(grid_rows.firstChild);
@@ -1408,7 +1408,7 @@ function genToolTips () {
                                                'var e = document.createEvent("MutationEvents");' +
                                                'e.initMutationEvent("change",1,1,null,0,0,0,0);' +
                                                'current_focus.inputField.dispatchEvent(e);',
-                                         tooltiptext : sf.description,
+                                         tooltiptext : sf.description
                                        }
                                )
                        );
@@ -1582,7 +1582,7 @@ function getAuthorityContextMenu (target, sf) {
                                  command : function (event) {
                                                applyAuthority(event.target.previousSibling, target, sf);
                                                return true;
-                                 },
+                                 }
                                }
                        )
                );
@@ -1792,7 +1792,7 @@ var control_map = {
                        181 : 'z',
                        182 : 'z',
                        185 : 'z'
-               },
+               }
        },
        630 : {
                'a' : { 130 : 'a' },
index c90dfda..f2764ec 100644 (file)
                                                        obj.shortname(), 
                                                        obj.id(), 
                                                        ( !get_bool( g.aout_hash[ obj.ou_type() ].can_have_users() ) ),
-                                                       ( g.aout_hash[ obj.ou_type() ].depth() ),
+                                                       ( g.aout_hash[ obj.ou_type() ].depth() )
                                                ]; 
                                        }
                                ),
                                        {
                                                'title' : document.getElementById('commonStrings').getString('staff.main.gen_offline_widgets.registration.override'),
                                                'overridable_events' : [ 
-                                                       1703 /* WORKSTATION_NAME_EXISTS */
-                                               ],
+                                                       1703 /* WORKSTATION_NAME_EXISTS */
+                                               ]
                                        }
                                );
 
                                        g.data.ws_info[ xulG.auth.controller.view.server_prompt.value ] = { 
                                                'name' : g.my_libs_shortname_hash[ g.ml.value ] + '-' + g.tb.value, 
                                                'owning_lib' : g.ml.value,
-                                               'lib_shortname' : g.my_libs_shortname_hash[ g.ml.value ],
+                                               'lib_shortname' : g.my_libs_shortname_hash[ g.ml.value ]
                                        };
                                        xulG.file.get('ws_info');
                                        xulG.file.set_object(g.data.ws_info);
index bd455f4..ad9693f 100644 (file)
                <span id='ue_no_profile'>A profile group must be selected</span>
                <span id='ue_bad_expire'>The user expiration date is invalid.  We're expecting YYYY-MM-DD</span>
                <span id='ue_bad_claims_returned'>The claims returned count is invalid</span>
-               <span id='ue_no_profile'>A profile group must be selected</span>
                <span id='ue_unknown_error'>An unknown formatting error occurred</span>
                <span id='ue_bad_addr_label'>Address label is invalid</span>
                <span id='ue_bad_addr_street'>Address street is invalid</span>
index 6b63f0d..bb26d0b 100644 (file)
@@ -303,7 +303,7 @@ function uEditDefineData(patron) {
                        widget  : {
                                id                      : 'ue_day_phone',
                                type            : 'input',
-                               regex           :  phoneRegex,
+                               regex           :  phoneRegex
                        }
                },
                {
@@ -314,7 +314,7 @@ function uEditDefineData(patron) {
                        widget  : {
                                id                      : 'ue_night_phone',
                                type            : 'input',
-                               regex           :  phoneRegex,
+                               regex           :  phoneRegex
                        }
                },
                {
@@ -325,7 +325,7 @@ function uEditDefineData(patron) {
                        widget  : {
                                id                      : 'ue_other_phone',
                                type            : 'input',
-                               regex           :  phoneRegex,
+                               regex           :  phoneRegex
                        }
                },
                {
@@ -335,7 +335,7 @@ function uEditDefineData(patron) {
                        widget  : {
                                id                      : 'ue_org_selector',
                                type            : 'select',
-                               regex           :  numRegex,
+                               regex           :  numRegex
                        }
                },
                {
@@ -346,7 +346,7 @@ function uEditDefineData(patron) {
                        widget  : {
                                id                      : 'ue_expire',
                                type            : 'input',
-                               regex           :  dateRegex,
+                               regex           :  dateRegex
                        }
                },
                {
@@ -355,7 +355,7 @@ function uEditDefineData(patron) {
                        key             : 'active',
                        widget  : {
                                id                      : 'ue_active',
-                               type            : 'checkbox',
+                               type            : 'checkbox'
                        }
                },
                {
@@ -429,7 +429,7 @@ function uEditDefineData(patron) {
                        key             : 'master_account',
                        widget  : {
                                id                      : 'ue_group_lead',
-                               type            : 'checkbox',
+                               type            : 'checkbox'
                        }
                },
                {
@@ -439,7 +439,7 @@ function uEditDefineData(patron) {
                        widget  : {
                                id                      : 'ue_claims_returned',
                                type            : 'input',
-                               regex           : numRegex,
+                               regex           : numRegex
                        }
                },
                {
@@ -448,7 +448,7 @@ function uEditDefineData(patron) {
                        key             : 'alert_message',
                        widget  : {
                                id                      : 'ue_alert_message',
-                               type            : 'input',
+                               type            : 'input'
                        }
                }
        ];
@@ -659,7 +659,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_label',
                                type    : 'input',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                },
                { 
@@ -671,7 +671,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_street1',
                                type    : 'input',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                },
                { 
@@ -683,7 +683,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_street2',
                                type    : 'input',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                },
                { 
@@ -695,7 +695,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_city',
                                type    : 'input',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                },
                { 
@@ -706,7 +706,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_county',
                                type    : 'input',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                },
                { 
@@ -718,7 +718,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_state',
                                type    : 'input',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                },
                { 
@@ -730,7 +730,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_country',
                                type    : 'input',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                },
                { 
@@ -780,7 +780,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_inc_yes',
                                type    : 'checkbox',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                },
                { 
@@ -791,7 +791,7 @@ function uEditBuildAddrFields(patron, address) {
                                base    : row,
                                name    : 'ue_addr_valid_yes',
                                type    : 'checkbox',
-                               disabled : disabled,
+                               disabled : disabled
                        }
                }
        ];
index 945635c..11a8e0c 100644 (file)
@@ -19,62 +19,62 @@ patron.util.mbts_columns = function(modify,params) {
        var c = [
                {
                        'persist' : 'hidden width ordinal', 'id' : 'id', 'label' : commonStrings.getString('staff.mbts_id_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mbts.id(); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mbts.id(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'usr', 'label' : commonStrings.getString('staff.mbts_usr_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.usr() ? "Id = " + my.mbts.usr() : ""; },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.usr() ? "Id = " + my.mbts.usr() : ""; }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'xact_type', 'label' : commonStrings.getString('staff.mbts_xact_type_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mbts.xact_type(); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mbts.xact_type(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'balance_owed', 'label' : commonStrings.getString('staff.mbts_balance_owed_label'), 'flex' : 1,
                        'primary' : false, 'hidden' : false, 'render' : function(my) { return util.money.sanitize( my.mbts.balance_owed() ); },
-                       'sort_type' : 'money',
+                       'sort_type' : 'money'
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'total_owed', 'label' : commonStrings.getString('staff.mbts_total_owed_label'), 'flex' : 1,
                        'primary' : false, 'hidden' : false, 'render' : function(my) { return util.money.sanitize( my.mbts.total_owed() ); },
-                       'sort_type' : 'money',
+                       'sort_type' : 'money'
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'total_paid', 'label' : commonStrings.getString('staff.mbts_total_paid_label'), 'flex' : 1,
                        'primary' : false, 'hidden' : false, 'render' : function(my) { return util.money.sanitize( my.mbts.total_paid() ); },
-                       'sort_type' : 'money',
+                       'sort_type' : 'money'
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'last_billing_note', 'label' : commonStrings.getString('staff.mbts_last_billing_note_label'), 'flex' : 2,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.last_billing_note(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.last_billing_note(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'last_billing_type', 'label' : commonStrings.getString('staff.mbts_last_billing_type_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.last_billing_type(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.last_billing_type(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'last_billing_ts', 'label' : commonStrings.getString('staff.mbts_last_billing_timestamp_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return util.date.formatted_date( my.mbts.last_billing_ts(), "" ); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return util.date.formatted_date( my.mbts.last_billing_ts(), "" ); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'last_payment_note', 'label' : commonStrings.getString('staff.mbts_last_payment_note_label'), 'flex' : 2,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.last_payment_note(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.last_payment_note(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'last_payment_type', 'label' : commonStrings.getString('staff.mbts_last_payment_type_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.last_payment_type(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mbts.last_payment_type(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'last_payment_ts', 'label' : commonStrings.getString('staff.mbts_last_payment_timestamp_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return util.date.formatted_date( my.mbts.last_payment_ts(), "" ); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return util.date.formatted_date( my.mbts.last_payment_ts(), "" ); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'xact_start', 'label' : commonStrings.getString('staff.mbts_xact_start_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mbts.xact_start() ? my.mbts.xact_start().toString().substr(0,10) : ""; },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mbts.xact_start() ? my.mbts.xact_start().toString().substr(0,10) : ""; }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'xact_finish', 'label' : commonStrings.getString('staff.mbts_xact_finish_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mbts.xact_finish() ? my.mbts.xact_finish().toString().substr(0,10) : ""; },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mbts.xact_finish() ? my.mbts.xact_finish().toString().substr(0,10) : ""; }
                },
        ];
        for (var i = 0; i < c.length; i++) {
@@ -117,40 +117,40 @@ patron.util.mb_columns = function(modify,params) {
        var c = [
                {
                        'persist' : 'hidden width ordinal', 'id' : 'id', 'label' : commonStrings.getString('staff.mb_id_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mb.id(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mb.id(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'voided', 'label' : commonStrings.getString('staff.mb_voided_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return get_bool( my.mb.voided() ) ? "Yes" : "No"; },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return get_bool( my.mb.voided() ) ? "Yes" : "No"; }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'voider', 'label' : commonStrings.getString('staff.mb_voider_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mb.voider() ? "Id = " + my.mb.voider() : ""; },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mb.voider() ? "Id = " + my.mb.voider() : ""; }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'void_time', 'label' : commonStrings.getString('staff.mb_void_time_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mb.void_time(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mb.void_time(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'amount', 'label' : commonStrings.getString('staff.mb_amount_label'), 'flex' : 1,
                        'primary' : false, 'hidden' : false, 'render' : function(my) { return util.money.sanitize( my.mb.amount() ); },
-                       'sort_type' : 'money',
+                       'sort_type' : 'money'
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'billing_type', 'label' : commonStrings.getString('staff.mb_billing_type_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mb.billing_type(); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mb.billing_type(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'billing_ts', 'label' : commonStrings.getString('staff.mb_billing_ts_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return util.date.formatted_date( my.mb.billing_ts(), "" ); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return util.date.formatted_date( my.mb.billing_ts(), "" ); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'note', 'label' : commonStrings.getString('staff.mb_note_label'), 'flex' : 2,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mb.note(); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mb.note(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'xact', 'label' : commonStrings.getString('staff.mb_xact_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mb.xact(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mb.xact(); }
                },
        ];
        for (var i = 0; i < c.length; i++) {
@@ -194,36 +194,36 @@ patron.util.mp_columns = function(modify,params) {
        var c = [
                {
                        'persist' : 'hidden width ordinal', 'id' : 'mp_id', 'label' : commonStrings.getString('staff.mp_id_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mp.id(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mp.id(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'mp_amount', 'label' : commonStrings.getString('staff.mp_amount_label'), 'flex' : 1,
                        'primary' : false, 'hidden' : false, 'render' : function(my) { return util.money.sanitize( my.mp.amount() ); },
-                       'sort_type' : 'money',
+                       'sort_type' : 'money'
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'mp_payment_type', 'label' : commonStrings.getString('staff.mp_payment_type_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mp.payment_type(); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mp.payment_type(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'mp_payment_ts', 'label' : commonStrings.getString('staff.mp_payment_timestamp_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return util.date.formatted_date( my.mp.payment_ts(), "" ); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return util.date.formatted_date( my.mp.payment_ts(), "" ); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'mp_note', 'label' : commonStrings.getString('staff.mp_note_label'), 'flex' : 2,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mp.note(); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mp.note(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'mp_ws', 'label' : commonStrings.getString('staff.mp_cash_drawer_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mp.cash_drawer().name(); }
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { return my.mp.cash_drawer().name(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'mp_staff', 'label' : commonStrings.getString('staff.mp_accepting_usr_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'render' : function(my) { var s = my.mp.accepting_usr(); if (s && typeof s != "object") s = patron.util.retrieve_fleshed_au_via_id(ses(),s); return s.family_name() + " (" + s.card().barcode() + ") @ " + data.hash.aou[ s.home_ou() ].shortname(); },
+                       'primary' : false, 'hidden' : false, 'render' : function(my) { var s = my.mp.accepting_usr(); if (s && typeof s != "object") s = patron.util.retrieve_fleshed_au_via_id(ses(),s); return s.family_name() + " (" + s.card().barcode() + ") @ " + data.hash.aou[ s.home_ou() ].shortname(); }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'mp_xact', 'label' : commonStrings.getString('staff.mp_xact_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mp.xact(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mp.xact(); }
                },
        ];
        for (var i = 0; i < c.length; i++) {
@@ -266,125 +266,125 @@ patron.util.columns = function(modify,params) {
        var c = [
                {
                        'persist' : 'hidden width ordinal', 'id' : 'barcode', 'label' : commonStrings.getString('staff.card_barcode_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.card().barcode(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.card().barcode(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'usrname', 'label' : commonStrings.getString('staff.au_usrname_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.usrname(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.usrname(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'profile', 'label' : commonStrings.getString('staff.au_profile_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.pgt[ my.au.profile() ].name(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.pgt[ my.au.profile() ].name(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'active', 'label' : commonStrings.getString('staff.au_active_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.au.active() ) ? "Yes" : "No"; },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.au.active() ) ? "Yes" : "No"; }
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'barred', 'label' : commonStrings.getString('staff.au_barred_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.au.barred() ) ? "Yes" : "No"; },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.au.barred() ) ? "Yes" : "No"; }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'id', 'label' : document.getElementById('commonStrings').getString('staff.au_id_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.id(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.id(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'prefix', 'label' : document.getElementById('commonStrings').getString('staff.au_name_prefix_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.prefix(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.prefix(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'family_name', 'label' : document.getElementById('commonStrings').getString('staff.au_family_name_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.family_name(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.family_name(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'first_given_name', 'label' : document.getElementById('commonStrings').getString('staff.au_first_given_name_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.first_given_name(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.first_given_name(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'second_given_name', 'label' : document.getElementById('commonStrings').getString('staff.au_second_given_name_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.second_given_name(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.second_given_name(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'suffix', 'label' : document.getElementById('commonStrings').getString('staff.au_name_suffix_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.suffix(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.suffix(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'alert_message', 'label' : commonStrings.getString('staff.au_alert_message_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.alert_message(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.alert_message(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'claims_returned_count', 'label' : commonStrings.getString('staff.au_claims_returned_count_label'), 'flex' : 1, 
                        'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.claims_returned_count(); },
-                       'sort_type' : 'number',
+                       'sort_type' : 'number'
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'create_date', 'label' : commonStrings.getString('staff.au_create_date_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.create_date(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.create_date(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'expire_date', 'label' : commonStrings.getString('staff.au_expire_date_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.expire_date().substr(0,10); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.expire_date().substr(0,10); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'home_ou', 'label' : commonStrings.getString('staff.au_home_library_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.aou[ my.au.home_ou() ].shortname(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.aou[ my.au.home_ou() ].shortname(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'home_ou_fullname', 'label' : commonStrings.getString('staff.au_home_library_fullname_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.aou[ my.au.home_ou() ].name(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.aou[ my.au.home_ou() ].name(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'credit_forward_balance', 'label' : commonStrings.getString('staff.au_credit_forward_balance_label'), 'flex' : 1, 
                        'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.credit_forward_balance(); },
-                       'sort_type' : 'money',
+                       'sort_type' : 'money'
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'day_phone', 'label' : commonStrings.getString('staff.au_day_phone_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.day_phone(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.day_phone(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'evening_phone', 'label' : commonStrings.getString('staff.au_evening_phone_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.evening_phone(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.evening_phone(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'other_phone', 'label' : commonStrings.getString('staff.au_other_phone_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.other_phone(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.other_phone(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'email', 'label' : commonStrings.getString('staff.au_email_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.email(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.email(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'dob', 'label' : commonStrings.getString('staff.au_birth_date_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.dob().substr(0,10); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.dob().substr(0,10); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'ident_type', 'label' : commonStrings.getString('staff.au_ident_type_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.cit[ my.au.ident_type() ].name(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.cit[ my.au.ident_type() ].name(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'ident_value', 'label' : commonStrings.getString('staff.au_ident_value_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.ident_value(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.ident_value(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'ident_type2', 'label' : commonStrings.getString('staff.au_ident_type2_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.cit[ my.au.ident_type2() ].name(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return data.hash.cit[ my.au.ident_type2() ].name(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'ident_value2', 'label' : commonStrings.getString('staff.au_ident_value2_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.ident_value2(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.ident_value2(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'net_access_level', 'label' : commonStrings.getString('staff.au_net_access_level_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.net_access_level(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.net_access_level(); }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'master_account', 'label' : commonStrings.getString('staff.au_master_account_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.au.master_account() ) ? "Yes" : "No"; },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.au.master_account() ) ? "Yes" : "No"; }
                },
                { 
                        'persist' : 'hidden width ordinal', 'id' : 'usrgroup', 'label' : commonStrings.getString('staff.au_group_id_label'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.usrgroup(); },
+                       'primary' : false, 'hidden' : true, 'render' : function(my) { return my.au.usrgroup(); }
                },
        ];
        for (var i = 0; i < c.length; i++) {