Org unit prox adjustment tweaks user/senator/prox-tweaks
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 14 Mar 2013 17:58:47 +0000 (13:58 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 14 Mar 2013 20:11:46 +0000 (16:11 -0400)
commit040e7f7ed20e8fa5b80343a399cf0d690977570e
tree942656742e6e412fa1018519fe0faf2e2cd7bae8
parenta19259c23927490ab9a052d9edcdbae395d27f7d
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@esilibrary.com>
Open-ILS/src/sql/Pg/005.schema.actors.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql [new file with mode: 0644]
Open-ILS/src/templates/conify/global/config/org_unit_proximity_adjustment.tt2
Open-ILS/web/js/dojo/openils/User.js