Merged revisions 9388-9390 via svnmerge from
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 20 Apr 2008 13:04:12 +0000 (13:04 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 20 Apr 2008 13:04:12 +0000 (13:04 +0000)
svn://svn.open-ils.org/ILS/trunk

........
  r9388 | dbs | 2008-04-19 23:09:22 -0400 (Sat, 19 Apr 2008) | 2 lines

  Use 950.data.seed-values.sql to avoid referential integrity errors
........
  r9389 | dbs | 2008-04-19 23:26:38 -0400 (Sat, 19 Apr 2008) | 2 lines

  XML::LibXML::XPathContext is a prerequisite for Application::Fielder and Application::PermaCrud
........
  r9390 | erickson | 2008-04-20 09:02:32 -0400 (Sun, 20 Apr 2008) | 1 line

  added a method to build a Tree based on perm orgs.
........

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

Open-ILS/src/extras/Makefile.install
Open-ILS/src/sql/Pg/110.hold_matrix.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/web/js/dojo/openils/User.js

index 245ced7..06ea402 100644 (file)
@@ -188,7 +188,8 @@ CPAN_MODULES = \
     JSON::XS\
     SRU \
     Net::Z3950::ZOOM \
-       Business::CreditCard::Object
+       Business::CreditCard::Object \
+       XML::LibXML::XPathContext
 
 
 # ----------------------------------------------------------------------------
index ac34949..801440a 100644 (file)
@@ -34,8 +34,6 @@ CREATE TABLE config.hold_matrix_matchpoint (
        CONSTRAINT hous_once_per_grp_loc_mod_marc UNIQUE (user_home_ou, request_ou, pickup_ou, item_owning_ou, item_circ_ou, requestor_grp, usr_grp, circ_modifier, marc_type, marc_form, marc_vr_format)
 );
 
-INSERT INTO config.hold_matrix_matchpoint (requestor_grp) VALUES (1);
-
 -- Tests to determine if hold against a specific copy is possible for a user at (and from) a location
 CREATE TABLE config.hold_matrix_test (
        matchpoint                      INT     PRIMARY KEY REFERENCES config.hold_matrix_matchpoint (id),
index 484c101..7f96f95 100644 (file)
@@ -1284,6 +1284,10 @@ INSERT INTO config.xml_transform VALUES ( 'mods32', 'http://www.loc.gov/mods/v3'
 INSERT INTO config.circ_matrix_matchpoint (org_unit,grp) VALUES (1,1);
 INSERT INTO config.circ_matrix_ruleset (matchpoint,duration_rule,recurring_fine_rule,max_fine_rule) VALUES (1,11,1,1);
 
+
+-- hold matrix - 110.hold_matrix.sql:
+INSERT INTO config.hold_matrix_matchpoint (requestor_grp) VALUES (1);
+
 -- Staged Search (for default matchpoints)
 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);
index cbc2f19..31d4978 100644 (file)
@@ -19,7 +19,7 @@ if(!dojo._hasResource["openils.User"]) {
     dojo._hasResource["openils.User"] = true;
     dojo.provide("openils.User");
     dojo.require('openils.Event');
-    dojo.require('DojoSRF');
+    dojo.require('fieldmapper.Fieldmapper');
 
     dojo.declare('openils.User', null, {});
 
@@ -109,6 +109,41 @@ if(!dojo._hasResource["openils.User"]) {
 
         req.send();
     }
+
+    /**
+     * Builds a dijit.Tree using the orgs where the user has the requested permission
+     * @param perm The permission to check
+     * @param domId The DOM node where the tree widget should live
+     * @param onClick If defined, this will be connected to the tree widget for
+     * onClick events
+     */
+    openils.User.buildPermOrgTreePicker = function(perm, domId, onClick) {
+
+        function buildTreePicker(r) {
+            var orgList = r.recv().content();
+            var store = new dojo.data.ItemFileReadStore({data:aou.toStoreData(orgList)});
+            var model = new dijit.tree.ForestStoreModel({
+                store: store,
+                query: {_top:'true'},
+                childrenAttrs: ["children"],
+                rootLabel : "Location" /* XXX i18n */
+            });
+
+            var tree = new dijit.Tree({model : model}, dojo.byId(domId));
+            if(onClick)
+                dojo.connect(tree, 'onClick', onClick);
+            tree.startup()
+        }
+
+        fieldmapper.standardRequest(
+            ['open-ils.actor', 'open-ils.actor.user.work_perm.org_unit_list'],
+            {
+                params: [openils.User.authtoken, 'ADMIN_FUNDING_SOURCE'],
+                oncomplete: buildTreePicker,
+                async: true
+            }
+        )
+    }
 }