[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 4e79be2f645af602292e82db0e8d1dda8ad3f7e5
Evergreen Git
git at git.evergreen-ils.org
Wed Sep 7 14:01:39 EDT 2011
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, rel_2_1 has been updated
via 4e79be2f645af602292e82db0e8d1dda8ad3f7e5 (commit)
from 9ad5937eb26ede57970cdb0f4bba633f9c9d0374 (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 4e79be2f645af602292e82db0e8d1dda8ad3f7e5
Author: James Fournie <jfournie at sitka.bclibraries.ca>
Date: Wed Aug 31 10:37:21 2011 -0700
Adding org unit context selector to providers screen
This helps alleviate the bug reported in LP 731510 and
generally improves usability.
Signed-off-by: James Fournie <jfournie at sitka.bclibraries.ca>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/web/js/ui/default/conify/global/acq/provider.js b/Open-ILS/web/js/ui/default/conify/global/acq/provider.js
index 76c63a5..2dbe1da 100644
--- a/Open-ILS/web/js/ui/default/conify/global/acq/provider.js
+++ b/Open-ILS/web/js/ui/default/conify/global/acq/provider.js
@@ -3,6 +3,7 @@ dojo.require('openils.widget.AutoGrid');
dojo.require('dijit.form.FilteringSelect');
dojo.require('openils.PermaCrud');
dojo.require('openils.MarcXPathParser');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
var provider;
@@ -10,6 +11,19 @@ var xpathParser = new openils.MarcXPathParser();
var subFields= [];
function draw() {
+ var org_id = openils.User.user.ws_ou();
+ var list = fieldmapper.aou.findOrgUnit(org_id).orgNodeTrail().map(
+ function (i) {return i.id() }
+ );
+
+ new openils.User().buildPermOrgSelector(
+ 'VIEW_PROVIDER', contextOrgSelector, null,
+ function() {
+ dojo.connect(contextOrgSelector, 'onChange', filterGrid);
+ }
+ );
+
+
if(providerId) {
openils.Util.addCSSClass(dojo.byId('provider-list-div'), 'hidden');
@@ -31,7 +45,7 @@ function draw() {
} else {
openils.Util.addCSSClass(dojo.byId('provider-details-div'), 'hidden');
console.log('in else block');
- pListGrid.loadAll({order_by:{acqpro : 'name'}});
+ pListGrid.loadAll({order_by:{acqpro : 'name'}},{'owner':list});
pListGrid.onPostCreate = function(fmObject) {
location.href = location.href + '/' + fmObject.id();
}
@@ -120,4 +134,16 @@ function getParsedSubf(rowIndex, item) {
}
return'';
}
+
+function filterGrid() {
+ pListGrid.resetStore();
+ var unit = contextOrgSelector.getValue();
+ var list = fieldmapper.aou.findOrgUnit(unit).orgNodeTrail().map( function (i) {return i.id() } );
+
+ if(unit){
+ pListGrid.loadAll({order_by:{acqpro : 'name'}}, { 'owner' : list });
+ } else {
+ pListGrid.loadAll({order_by:{acqpro : 'name'}});
+ }
+}
openils.Util.addOnLoad(draw);
diff --git a/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 b/Open-ILS/web/templates/default/conify/global/acq/provider.tt2
index 05f9e6b..5d559cd 100644
--- a/Open-ILS/web/templates/default/conify/global/acq/provider.tt2
+++ b/Open-ILS/web/templates/default/conify/global/acq/provider.tt2
@@ -26,6 +26,14 @@
</div>
</div>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <span>Context Org Unit</span>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<table jsId="pListGrid"
dojoType="openils.widget.AutoGrid"
fieldOrder="['id', 'name', 'code', 'owner', 'currency_type']"
-----------------------------------------------------------------------
Summary of changes:
.../js/ui/default/conify/global/acq/provider.js | 28 +++++++++++++++++++-
.../default/conify/global/acq/provider.tt2 | 8 +++++
2 files changed, 35 insertions(+), 1 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list