[open-ils-commits] r15992 - in trunk/Open-ILS/web: js/dojo/fieldmapper js/ui/default/conify/global/acq templates/default/conify/global/acq (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 25 15:42:58 EDT 2010


Author: senator
Date: 2010-03-25 15:42:53 -0400 (Thu, 25 Mar 2010)
New Revision: 15992

Modified:
   trunk/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
   trunk/Open-ILS/web/js/ui/default/conify/global/acq/fund_tag.js
   trunk/Open-ILS/web/templates/default/conify/global/acq/fund_tag.tt2
Log:
Acq: correction to fund tag admin UI

The owner selector now correctly shows tags owned by selected OU or by an
ancestor, not by descendants.


Modified: trunk/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js	2010-03-25 19:41:06 UTC (rev 15991)
+++ trunk/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js	2010-03-25 19:42:53 UTC (rev 15992)
@@ -169,7 +169,7 @@
 		return org;
 	}
 
-	fieldmapper.aou.prototype.orgNodeTrail = function (node) {
+	fieldmapper.aou.prototype.orgNodeTrail = function(node, asId) {
 		if (!node) node = this;
 		if (!node) return [];
 
@@ -183,7 +183,9 @@
 				node = null;
 		}
 
-		return na.reverse();
+		na.reverse();
+		if (asId) return na.map(function(o) { return o.id(); });
+		else return na;
 	}
 	fieldmapper.aou.orgNodeTrail = fieldmapper.aou.prototype.orgNodeTrail;
 

Modified: trunk/Open-ILS/web/js/ui/default/conify/global/acq/fund_tag.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/acq/fund_tag.js	2010-03-25 19:41:06 UTC (rev 15991)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/acq/fund_tag.js	2010-03-25 19:42:53 UTC (rev 15992)
@@ -13,6 +13,8 @@
 var ftList;
 
 function ftInit() {
+    pcrud = new openils.PermaCrud();
+
     new openils.User().buildPermOrgSelector(
         "ADMIN_ACQ_FUND_TAG",
         ftOwnerSelect,
@@ -22,7 +24,7 @@
                 ftOwnerSelect,
                 "onChange",
                 function() {
-                    ftOwner = this.getValue();
+                    ftOwner = fieldmapper.aou.findOrgUnit(this.attr("value"));
                     ftGrid.resetStore();
                     buildFtGrid();
                 }
@@ -32,12 +34,12 @@
 }
 
 function buildFtGrid() {
-    if (!pcrud) pcrud = new openils.PermaCrud();
-    if (!ftOwner) ftOwner = openils.User.user.ws_ou();
+    if (!ftOwner)
+        ftOwner = fieldmapper.aou.findOrgUnit(openils.User.user.ws_ou());
 
     pcrud.search(
         "acqft",
-        {"owner": fieldmapper.aou.fullPath(ftOwner, true /* asId */)},
+        {"owner": fieldmapper.aou.orgNodeTrail(ftOwner, true /* asId */)},
         {
             "async": true,
             "oncomplete": function(r) {

Modified: trunk/Open-ILS/web/templates/default/conify/global/acq/fund_tag.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/acq/fund_tag.tt2	2010-03-25 19:41:06 UTC (rev 15991)
+++ trunk/Open-ILS/web/templates/default/conify/global/acq/fund_tag.tt2	2010-03-25 19:42:53 UTC (rev 15992)
@@ -12,13 +12,12 @@
         </div>
     </div>
     <div class="oils-acq-basic-roomy">
-        <span>Owned by</span>
+        <span>Show tags available to</span>
         <select
             dojoType="openils.widget.OrgUnitFilteringSelect"
             jsId="ftOwnerSelect"
             searchAttr="shortname" labelAttr="shortname">
         </select>
-        <span>or a descendant of the same:</span>
     </div>
     <table jsId="ftGrid"
         dojoType="openils.widget.AutoGrid"



More information about the open-ils-commits mailing list