[open-ils-commits] r9488 - branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Apr 29 21:59:46 EDT 2008


Author: djfiander
Date: 2008-04-29 21:19:37 -0400 (Tue, 29 Apr 2008)
New Revision: 9488

Modified:
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html
Log:
Pretty display of Library names now works. Also speed up display
of line items by not talking to the server if the fund or org
unit fields are null.


Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html	2008-04-30 00:27:17 UTC (rev 9487)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html	2008-04-30 01:19:37 UTC (rev 9488)
@@ -14,6 +14,8 @@
 	dojo.require('openils.acq.Picklist');
 	// For decoding fund IDs into names
 	dojo.require("openils.acq.Fund");
+	// For decoding Library IDs into names
+	dojo.require("fieldmapper.OrgUtils");
     </script>
     <script type='text/javascript'>
 	function getJUBTitle(rowIndex) {
@@ -28,13 +30,22 @@
 	}
 	function getLIDFundName(rowIndex) {
 	    var data = lineItemGrid.model.getRow(rowIndex);
-	    if (!data) return;
+	    if (!data || !data.fund) return;
 	    try {
 		return openils.acq.Fund.retrieve(data.fund).name();
 	    } catch (evt) {
 		return data.fund;
 	    }
 	}
+	function getLIDLibName(rowIndex) {
+	    var data = lineItemGrid.model.getRow(rowIndex);
+	    if (!data || !data.owning_lib) return;
+	    try {
+		return fieldmapper.aou.findOrgUnit(data.owning_lib, true).name();
+	    } catch (evt) {
+		return data.owning_lib;
+	    }
+	}
     </script>
 </%def>
 <%def name="page_title()">${_('Picklist')}</%def>
@@ -70,7 +81,7 @@
 		var lineitemLayout = [{ cells: [[
 		    {name:"ID", field:"id"},
 		    {name:"Fund", get:getLIDFundName},
-		    {name:"Location", field:"location"} ]] }];
+		    {name:"Location", get:getLIDLibName} ]] }];
 
 		openils.acq.Picklist.createStore(${c.oils.acq.picklist.value.id()},
 		    function(storeData) {



More information about the open-ils-commits mailing list