[open-ils-commits] [GIT] Evergreen ILS branch master updated. 9f831d2a1120e2336aa66f1ea77405632907b49e

Evergreen Git git at git.evergreen-ils.org
Wed Mar 27 15:51:46 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  9f831d2a1120e2336aa66f1ea77405632907b49e (commit)
       via  bd8e8002cdb6c0c9ee15f88120ef021e9bf8f3aa (commit)
      from  f5a9d766097b939cc64b3338d5153fb47503be4b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9f831d2a1120e2336aa66f1ea77405632907b49e
Author: Mike Rylander <mrylander at gmail.com>
Date:   Wed Mar 27 15:50:40 2013 -0400

    Stamping upgrade script for aoupa constraint fix
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 8d86600..07bb235 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0784', :eg_version); -- Callender/berick
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0785', :eg_version); -- senator/miker
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql b/Open-ILS/src/sql/Pg/upgrade/0785.schema.aoupa-unique-constraint.sql
similarity index 84%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql
rename to Open-ILS/src/sql/Pg/upgrade/0785.schema.aoupa-unique-constraint.sql
index 1f5221d..37b15b8 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0785.schema.aoupa-unique-constraint.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0785', :eg_version);
 
 DROP INDEX actor.prox_adj_once_idx;
 

commit bd8e8002cdb6c0c9ee15f88120ef021e9bf8f3aa
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Thu Mar 14 13:58:47 2013 -0400

    Org unit prox adjustment tweaks
    
    1) UI change - pre-select highest OU where user can edit
    
    There's a dropdown in the org unit proximity adjustment interface that
    affects the scope of what you can see in the table below.  Before, that
    dropdown would be set to the user's home UO (say, BR1 in the example org
    tree).  But you might have the permission to make changes everywhere, so
    you add a proximity adjustment that affects BR3 in some way.  As soon as
    you'd refresh the interface, your new proximity adjustment would not be
    visible, because your scope selector would default to BR1.
    
    So now the dropdown defaults to the first context where you have the
    permission, which in all but eccentric setups should be the highest OU
    (and therefore broadest scope) where you have the permission.
    
    This could also improve other interfaces in the future.  Anything that
    invokes openils.User.buildPermOrgSelector() can pass -1 as the third
    parameter to get the new behavior.
    
    2) Change UNIQUE index at DB layer.
    
    This prevents the creation of rows that would give the hold targeter
    conflicting directives.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/sql/Pg/005.schema.actors.sql b/Open-ILS/src/sql/Pg/005.schema.actors.sql
index c92ede4..8d63430 100644
--- a/Open-ILS/src/sql/Pg/005.schema.actors.sql
+++ b/Open-ILS/src/sql/Pg/005.schema.actors.sql
@@ -393,7 +393,15 @@ CREATE TABLE actor.org_unit_proximity_adjustment (
     circ_mod            TEXT,       -- REFERENCES config.circ_modifier (code),
     CONSTRAINT prox_adj_criterium CHECK (COALESCE(item_circ_lib::TEXT,item_owning_lib::TEXT,copy_location::TEXT,hold_pickup_lib::TEXT,hold_request_lib::TEXT,circ_mod) IS NOT NULL)
 );
-CREATE UNIQUE INDEX prox_adj_once_idx ON actor.org_unit_proximity_adjustment (item_circ_lib,item_owning_lib,copy_location,hold_pickup_lib,hold_request_lib,circ_mod);
+CREATE UNIQUE INDEX prox_adj_once_idx ON actor.org_unit_proximity_adjustment (
+    COALESCE(item_circ_lib, -1),
+    COALESCE(item_owning_lib, -1),
+    COALESCE(copy_location, -1),
+    COALESCE(hold_pickup_lib, -1),
+    COALESCE(hold_request_lib, -1),
+    COALESCE(circ_mod, ''),
+    pos
+);
 CREATE INDEX prox_adj_circ_lib_idx ON actor.org_unit_proximity_adjustment (item_circ_lib);
 CREATE INDEX prox_adj_owning_lib_idx ON actor.org_unit_proximity_adjustment (item_owning_lib);
 CREATE INDEX prox_adj_copy_location_idx ON actor.org_unit_proximity_adjustment (copy_location);
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql
new file mode 100644
index 0000000..1f5221d
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql
@@ -0,0 +1,17 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+DROP INDEX actor.prox_adj_once_idx;
+
+CREATE UNIQUE INDEX prox_adj_once_idx ON actor.org_unit_proximity_adjustment (
+    COALESCE(item_circ_lib, -1),
+    COALESCE(item_owning_lib, -1),
+    COALESCE(copy_location, -1),
+    COALESCE(hold_pickup_lib, -1),
+    COALESCE(hold_request_lib, -1),
+    COALESCE(circ_mod, ''),
+    pos
+);
+
+COMMIT;
diff --git a/Open-ILS/src/templates/conify/global/config/org_unit_proximity_adjustment.tt2 b/Open-ILS/src/templates/conify/global/config/org_unit_proximity_adjustment.tt2
index 6a0c67b..9f6f32f 100644
--- a/Open-ILS/src/templates/conify/global/config/org_unit_proximity_adjustment.tt2
+++ b/Open-ILS/src/templates/conify/global/config/org_unit_proximity_adjustment.tt2
@@ -72,7 +72,7 @@
             new openils.User().buildPermOrgSelector(
                 "ADMIN_PROXIMITY_ADJUSTMENT",
                 context_org_selector,
-                null,
+                -1, /* high OU where permission held */
                 function() {
                     context_org_selector.onChange =
                         reload_grid_from_ou_selector;
diff --git a/Open-ILS/web/js/dojo/openils/User.js b/Open-ILS/web/js/dojo/openils/User.js
index 60e5f91..ef17bf8 100644
--- a/Open-ILS/web/js/dojo/openils/User.js
+++ b/Open-ILS/web/js/dojo/openils/User.js
@@ -306,17 +306,18 @@ if(!dojo._hasResource["openils.User"]) {
          * using the orgs where the user has the requested permission.
          * @param perm The permission to check
          * @param selector The pre-created dijit.form.FilteringSelect object.  
+         * @param selectedOrg org to select in FilteringSelect object. null defaults to user ws_ou, -1 will select the first OU where the perm is held, typically the top of a [sub]tree.
          */
         buildPermOrgSelector : function(perm, selector, selectedOrg, onload) {
             var _u = this;
     
             dojo.require('dojo.data.ItemFileReadStore');
 
-            function hookupStore(store) {
+            function hookupStore(store, useOrg) {
                 selector.store = store;
                 selector.startup();
-                if(selectedOrg != null)
-                    selector.setValue(selectedOrg);
+                if(useOrg != null)
+                    selector.setValue(useOrg);
                 else
                     selector.setValue(_u.user.ws_ou());
                 if(onload) onload();
@@ -324,7 +325,10 @@ if(!dojo._hasResource["openils.User"]) {
 
             function buildTreePicker(orgList) {
                 var store = new dojo.data.ItemFileReadStore({data:aou.toStoreData(orgList)});
-                hookupStore(store);
+                if (selectedOrg == -1 && orgList[0])
+                    selectedOrg = orgList[0].id();
+
+                hookupStore(store, selectedOrg);
                 _u.permOrgStoreCache[perm] = store;
             }
     

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/005.schema.actors.sql          |   10 +++++++++-
 .../0785.schema.aoupa-unique-constraint.sql        |   17 +++++++++++++++++
 .../config/org_unit_proximity_adjustment.tt2       |    2 +-
 Open-ILS/web/js/dojo/openils/User.js               |   12 ++++++++----
 5 files changed, 36 insertions(+), 7 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0785.schema.aoupa-unique-constraint.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list