adding translation for description
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 23 Apr 2008 17:17:15 +0000 (17:17 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 23 Apr 2008 17:17:15 +0000 (17:17 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9442 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/conify/global/permission/perm_list.html
Open-ILS/web/conify/global/permission/perm_list.js

index 18aa944..774a7b3 100644 (file)
                                                window.perm_grid_layout = [
                                                        {       cells : [
                                                                        [
-                                                                               { name : "Code",        field : "code",        width : "300px", editor : dojox.grid.editors.Dijit },
-                                                                               { name : "Description", field : "description", width : "auto",  editor : dojox.grid.editors.Editor }
+                                                                               { name : "Code",        field : "code",        width : "300px", editor : dojox.grid.editors.Dijit, rowSpan : "2" },
+                                                                               { name : "Description", field : "description", width : "auto",  editor : dojox.grid.editors.Editor, style : "minHeight:1em;" }
+                                                                       ],
+                                                                       [
+                                                                               { name : "Translation",
+                                                                                 width : "10em",
+                                                                                 height : "2em",
+                                                                                 get : function (row) {
+                                                                                       if (!window.perm_rows) window.perm_rows = [];
+                                                                                       var r = window.perm_data_model.getRow(row);
+                                                                                       if (r) {
+                                                                                               window.perm_rows[row] = new ccs().fromHash(window.perm_data_model.getRow(row));
+                                                                                               setTimeout(
+                                                                                                       'dojo.query(".perm_grid_trans_desc_' + row + '").'+
+                                                                                                               'instantiate(openils.I18N.translationWidget,{field:"description",'+
+                                                                                                               'targetObject:"window.perm_rows['+row+']",unique:"' + row + '"});'+
+                                                                                                               'perm_grid.rowHeightChanged('+row+')',
+                                                                                                       0
+                                                                                               );
+                                                                                               var oldnode = dojo.byId('description_translation_' + row);
+                                                                                               if (oldnode) dijit.byNode(oldnode).destroyRecursive();
+                                                                                               return '<span class="perm_grid_trans_desc_'+row+'"></span>';
+                                                                                       }
+                                                                                       return '';
+                                                                                 }
+                                                                               }
                                                                        ]
                                                                ]
                                                        }
index 4dc76cf..55ea859 100644 (file)
@@ -16,6 +16,7 @@
 */
 
 dojo.require('fieldmapper.dojoData');
+dojo.require('openils.I18N');
 dojo.require('dojo.parser');
 dojo.require('dojo.string');
 dojo.require('dojo.data.ItemFileWriteStore');