[open-ils-commits] r15714 - in trunk/Open-ILS/web/conify/global: config permission (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Mar 5 11:58:43 EST 2010


Author: miker
Date: 2010-03-05 11:58:40 -0500 (Fri, 05 Mar 2010)
New Revision: 15714

Modified:
   trunk/Open-ILS/web/conify/global/config/copy_status.html
   trunk/Open-ILS/web/conify/global/config/marc_code_maps.html
   trunk/Open-ILS/web/conify/global/config/marc_code_maps.js
   trunk/Open-ILS/web/conify/global/permission/perm_list.html
Log:
provide formatters for translation grid cells; move some inline js to the end, as the nodes referenced to exist yet; fix a couple typos/double-pastes

Modified: trunk/Open-ILS/web/conify/global/config/copy_status.html
===================================================================
--- trunk/Open-ILS/web/conify/global/config/copy_status.html	2010-03-05 16:52:34 UTC (rev 15713)
+++ trunk/Open-ILS/web/conify/global/config/copy_status.html	2010-03-05 16:58:40 UTC (rev 15714)
@@ -65,10 +65,6 @@
 
         <script type="text/javascript">
 <![CDATA[
-            var highlighter= {};
-            highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
-            highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
-
             var dirtyStore = [];
 
             var _status_list = pCRUD.retrieveAll('ccs', { order_by : { ccs : 'name' } });
@@ -173,6 +169,9 @@
 										{ name : ccs_strings.TRANSLATION,
 										  width : "10em",
 										  height : "2em",
+                                          formatter: function (row) {
+												return '<span class="status_grid_trans_cell_'+row+'"></span>';
+                                          },
 										  get : function (row) {
 											if (!window.status_rows) window.status_rows = [];
 											var r = window.status_data_model.getRow(row);
@@ -185,7 +184,7 @@
 														'status_grid.rowHeightChanged('+row+')',
 													0
 												);
-												return '<span class="status_grid_trans_cell_'+row+'"></span>';
+												return row;
 											}
 											return '';
 										  }
@@ -284,5 +283,11 @@
 			</div>
 		</div>
 	
+        <script type="text/javascript">
+            var highlighter= {};
+            highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
+            highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
+        </script>
+ 
 	</body>
 </html>

Modified: trunk/Open-ILS/web/conify/global/config/marc_code_maps.html
===================================================================
--- trunk/Open-ILS/web/conify/global/config/marc_code_maps.html	2010-03-05 16:52:34 UTC (rev 15713)
+++ trunk/Open-ILS/web/conify/global/config/marc_code_maps.html	2010-03-05 16:58:40 UTC (rev 15714)
@@ -81,6 +81,9 @@
                             { name : cam_strings.LABEL_TRANSLATION,
                               width : "10em",
                               height : "2em",
+                              formatter : function (row) {
+                                    return '<span class="cam_value_'+row+'"></span>';
+                              },
                               get : function (row) {
                                 if (!grid_row_object_cache.cam) grid_row_object_cache.cam = [];
                                 var r = this.grid.model.getRow(row);
@@ -96,7 +99,7 @@
                                     );
                                     var oldnode = dojo.byId('value_translation_cam_' + row);
                                     if (oldnode) dijit.byNode(oldnode).destroyRecursive();
-                                    return '<span class="cam_value_'+row+'"></span>';
+                                    return row;
                                 }
                                 return '';
                               }
@@ -104,6 +107,9 @@
                             { name : cam_strings.LABEL_TRANSLATION,
                               width : "10em",
                               height : "2em",
+                              formatter : function (row) {
+                                    return '<span class="cam_description_'+row+'"></span>';
+                              },
                               get : function (row) {
                                 if (!grid_row_object_cache.cam) grid_row_object_cache.cam = [];
                                 var r = this.grid.model.getRow(row);
@@ -119,7 +125,7 @@
                                     );
                                     var oldnode = dojo.byId('description_translation_cam_' + row);
                                     if (oldnode) dijit.byNode(oldnode).destroyRecursive();
-                                    return '<span class="cam_description_'+row+'"></span>';
+                                    return row;
                                 }
                                 return '';
                               }
@@ -171,6 +177,9 @@
 								        { name : cam_strings.LABEL_TRANSLATION,
 									      width : "10em",
 										  height : "2em",
+                                          formatter : function (row) {
+					                            return '<span class="'+classname+'_value_'+row+'"></span>';
+                                          },
 	                                      get : function (row) {
 		                                    if (!grid_row_object_cache[classname]) grid_row_object_cache[classname] = [];
 			                                var r = this.grid.model.getRow(row);
@@ -186,7 +195,7 @@
 		                                        );
 												var oldnode = dojo.byId('value_translation_' + classname + '_' + row);
 												if (oldnode) dijit.byNode(oldnode).destroyRecursive();
-					                            return '<span class="'+classname+'_value_'+row+'"></span>';
+					                            return row;
 						                    }
 							                return '';
 								          }

Modified: trunk/Open-ILS/web/conify/global/config/marc_code_maps.js
===================================================================
--- trunk/Open-ILS/web/conify/global/config/marc_code_maps.js	2010-03-05 16:52:34 UTC (rev 15713)
+++ trunk/Open-ILS/web/conify/global/config/marc_code_maps.js	2010-03-05 16:58:40 UTC (rev 15714)
@@ -41,7 +41,7 @@
 // some handy globals
 var cgi = new CGI();
 var ses = dojo.cookie('ses') || cgi.param('ses');
-var pCRUD = new openils.PermaCrudopenils.PermaCrud({authtoken:ses});
+var pCRUD = new openils.PermaCrud({authtoken:ses});
 
 console.log('initialized pcrud session');
 

Modified: trunk/Open-ILS/web/conify/global/permission/perm_list.html
===================================================================
--- trunk/Open-ILS/web/conify/global/permission/perm_list.html	2010-03-05 16:52:34 UTC (rev 15713)
+++ trunk/Open-ILS/web/conify/global/permission/perm_list.html	2010-03-05 16:58:40 UTC (rev 15714)
@@ -63,10 +63,6 @@
 		<script type="text/javascript" src="perm_list.js"></script>
 
 		<script type="text/javascript"><![CDATA[
-			var highlighter= {};
-			highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
-			highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
-
 			var dirtyStore = [];
 			var perm_rows = [];
 
@@ -74,13 +70,14 @@
             var _perm_data = ppl.toStoreData( _perm_list, 'code' );
             var perm_store = new dojo.data.ItemFileWriteStore({ data : _perm_data });
 
+
             perm_store.onSet = function (item, attr, o, n) {
                 if (attr == 'ischanged') return;
                 if (n == o) return;
                 this.setValue( item, 'ischanged', 1);
             };
-			var perm_data_model = new dojox.grid.data.DojoData({ store: perm_store, query: { code : '*' } });
 
+
 			var perm_grid_layout = [
 				{	cells : [
 						[
@@ -91,6 +88,9 @@
 							{ name : ppl_strings.LABEL_TRANSLATION,
 							  width : "10em",
 							  height : "2em",
+							  formatter : function (value) {
+                                return '<span class="perm_grid_trans_desc_'+value+'"></span>';
+                              },
 							  get : function (row) {
 								var r = perm_data_model.getRow(row);
 								if (r) {
@@ -104,7 +104,7 @@
 									);
 									var oldnode = dojo.byId('description_translation_' + row);
 									if (oldnode) dijit.byNode(oldnode).destroyRecursive();
-									return '<span class="perm_grid_trans_desc_'+row+'"></span>';
+									return row;
 								}
 								return '';
 							  }
@@ -118,7 +118,7 @@
 
                 perm_store.fetch({
                     query : { ischanged : 1 },
-                    onItem : function (item, req) { try { if (this.isItem( item )) window.dirtyStore.push( item ); } catch (e) { /* meh */ } },
+                    onItem : function (item, req) { try { if (this.isItem( item )) dirtyStore.push( item ); } catch (e) { /* meh */ } },
                     scope : perm_store
                 });
 
@@ -127,7 +127,7 @@
 
                     if (confirmation) {
                         for (var i in dirtyStore) {
-                            window.current_perm = dirtyStore[i];
+                            current_perm = dirtyStore[i];
                             save_perm(true);
                         }
                     }
@@ -158,7 +158,7 @@
 	                    });
     
     	                var err = false;
-        	            pCRUD.create(new_fm_objnew_fm_obj, {
+        	            pCRUD.create(new_fm_obj, {
 	                        onerror : function (r) {
     	                        highlighter.red.play();
         	                    status_update( ppl_strings.ERROR_CALLING_METHOD_PPL );
@@ -178,11 +178,9 @@
 			</div>
 
 			<div dojoType="dijit.layout.ContentPane" style="width:100%; height:100%;" layoutAlign="client">
+                <div dojoType="dojox.grid.data.DojoData" id="perm_data_model" jsId="perm_data_model" store="perm_store" query="{ code : '*' }">
+                </div>
 				<div id="perm_grid" dojoType="dojox.Grid" model="perm_data_model" structure="perm_grid_layout" jsId="perm_grid">
-					<!--
-					<script type="dojo/connect" event="onSet" args="item,attr,oldVal,newVal">
-					</script>
-					-->
 				</div>
 			</div>
 
@@ -244,5 +242,11 @@
 			</div>
 		</div>
 	
+        <script type="text/javascript">
+            var highlighter= {};
+    		highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
+	    	highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
+        </script>
+
 	</body>
 </html>



More information about the open-ils-commits mailing list