[open-ils-commits] r9944 - in branches/acq-experiment/Open-ILS/web: js/dojo/openils oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common oilsweb/oilsweb/templates/oils/default/common

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jun 26 18:11:20 EDT 2008


Author: erickson
Date: 2008-06-26 18:11:16 -0400 (Thu, 26 Jun 2008)
New Revision: 9944

Modified:
   branches/acq-experiment/Open-ILS/web/js/dojo/openils/editors.js
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
Log:
added copy location display and editing for lineitem details.  still need to find a way to pass runtime info to the editor object -- to test, it is currently loading all copy locations

Modified: branches/acq-experiment/Open-ILS/web/js/dojo/openils/editors.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/editors.js	2008-06-26 22:09:57 UTC (rev 9943)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/editors.js	2008-06-26 22:11:16 UTC (rev 9944)
@@ -50,4 +50,22 @@
     },
 });
 
+dojo.declare('openils.editors.CopyLocationSelectEditor', dojox.grid.editors.Dijit, {
+    editorClass: "dijit.form.FilteringSelect",
+    createEditor: function(inNode, inDatum, inRowIndex) {
+        dojo.require('openils.CopyLocation');
+	    var editor = new this.editorClass(this.getEditorProps(inDatum), inNode);
+        openils.CopyLocation.createStore(1,  /* XXX how do we propagate arguments to the editor?? */
+            function(store) {
+                editor.store = new dojo.data.ItemFileReadStore({data:store});
+                editor.startup();
+                if(inDatum)
+                    editor.setValue(inDatum);
+            }
+        );
+	    return editor;
+    },
+});
+
 }
+

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js	2008-06-26 22:09:57 UTC (rev 9943)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js	2008-06-26 22:11:16 UTC (rev 9944)
@@ -55,6 +55,11 @@
         if(!data || !data.provider) return;
         return openils.acq.Provider.retrieve(data.provider).code();
     },
+    getCopyLocation : function(rowIndex) {
+        var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
+        if(!data || !data.location) return '';
+        return openils.CopyLocation.retrieve(data.location).name();
+    },
     getLIDFundName : function(rowIndex) {
         var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
         if (!data || !data.fund) return;
@@ -78,20 +83,21 @@
         if(JUBGrid.showDetails) {
             dojo.connect(gridWidget, "onRowClick", 
                 function(evt) {
-            var jub = model.getRow(evt.rowIndex);
-            var grid;
+                    var jub = model.getRow(evt.rowIndex);
+                    var grid;
 
-            JUBGrid.jubDetailGrid.lineitemID = jub.id;
+                    JUBGrid.jubDetailGrid.lineitemID = jub.id;
 
-            if (jub.state == "approved") {
-                grid = JUBGrid.jubDetailGridLayoutReadOnly;
-            } else {
-                grid = JUBGrid.jubDetailGridLayout;
-            }
-            openils.acq.Lineitems.loadGrid(
+                    if (jub.state == "approved") {
+                        grid = JUBGrid.jubDetailGridLayoutReadOnly;
+                    } else {
+                        grid = JUBGrid.jubDetailGridLayout;
+                    }
+                    openils.acq.Lineitems.loadGrid(
                         JUBGrid.jubDetailGrid, 
                         JUBGrid.jubGrid.model.getRow(evt.rowIndex).id, grid);
-                });
+                }
+            );
         }
         gridWidget.update();
     },

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html	2008-06-26 22:09:57 UTC (rev 9943)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html	2008-06-26 22:11:16 UTC (rev 9944)
@@ -44,6 +44,7 @@
 % endif
 
     <script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/common/jubgrid.js'> </script>
+    <script src='${c.oils.core.media_prefix.value}/js/dojo/openils/CopyLocation.js'> </script>
     <script type="text/javascript">
     JUBGrid.getPO = function(rowIndex) {
         var data = JUBGrid.jubGrid.model.getRow(rowIndex);
@@ -85,10 +86,13 @@
                 editorClass: "dijit.form.TextBox" 
 	        },
             {name:"Shelving Location", field:"location", width:'auto',
+                editor:openils.editors.CopyLocationSelectEditor,
+                get:JUBGrid.getCopyLocation
+                /*
                 editor:dojox.grid.editors.Dijit, 
-                editorClass: "dijit.form.TextBox" 
+                editorClass: "dijit.form.FilteringSelect",
+                */
 	        },
-
         ]]
     }];
 



More information about the open-ils-commits mailing list