[open-ils-commits] r17165 - in trunk/Open-ILS: examples web/js/ui/default/vandelay web/opac/locale/en-US web/templates/default/vandelay web/templates/default/vandelay/inc (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Aug 10 22:18:49 EDT 2010


Author: erickson
Date: 2010-08-10 22:18:47 -0400 (Tue, 10 Aug 2010)
New Revision: 17165

Added:
   trunk/Open-ILS/web/templates/default/vandelay/inc/item_attrs.tt2
Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js
   trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd
   trunk/Open-ILS/web/templates/default/vandelay/inc/toolbar.tt2
   trunk/Open-ILS/web/templates/default/vandelay/vandelay.tt2
Log:
added an UI for editing vandelay import item attribute definitions.  it's a basic autogrid version for now.  TODO: fix some grid height styling issues

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2010-08-10 21:22:44 UTC (rev 17164)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2010-08-11 02:18:47 UTC (rev 17165)
@@ -251,10 +251,10 @@
 		</links>
 		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
 			<actions>
-				<create permission="CREATE_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
-				<retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
-				<update permission="UPDATE_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
-				<delete permission="DELETE_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
+				<create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
+				<retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
+				<update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
+				<delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
 			</actions>
 		</permacrud>
 	</class>

Modified: trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js	2010-08-10 21:22:44 UTC (rev 17164)
+++ trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js	2010-08-11 02:18:47 UTC (rev 17165)
@@ -56,7 +56,8 @@
     'vl-marc-upload-status-div',
     'vl-attr-editor-div',
     'vl-marc-export-div',
-    'vl-profile-editor-div'
+    'vl-profile-editor-div',
+    'vl-item-attr-editor-div'
 ];
 
 var authtoken;
@@ -273,6 +274,9 @@
         case 'vl-profile-editor-div':
             openils.Util.addCSSClass(dojo.byId('vl-menu-profile-editor'), 'toolbar_selected');
             break;
+        case 'vl-item-attr-editor-div':
+            openils.Util.addCSSClass(dojo.byId('vl-menu-import-item-attr-editor'), 'toolbar_selected');
+            break;
     }
 }
 
@@ -1322,7 +1326,7 @@
             function() {
                 profileContextOrg = this.attr('value');
                 pGrid.resetStore();
-                buildGrid();
+                buildProfileGrid();
             }
         );
     };
@@ -1342,5 +1346,36 @@
     );
 }
 
+/* --- Import Item Attr Grid --------------- */
 
+var itemAttrContextOrg;
+function vlShowImportItemAttrEditor() {
+    displayGlobalDiv('vl-item-attr-editor-div');
+    buildImportItemAttrGrid();
 
+    var connect = function() {
+        dojo.connect(itemAttrContextOrgSelector, 'onChange',
+            function() {
+                itemAttrContextOrg = this.attr('value');
+                itemAttrGrid.resetStore();
+                vlShowImportItemAttrEditor();
+            }
+        );
+    };
+
+    new openils.User().buildPermOrgSelector(
+        'ADMIN_IMPORT_ITEM_ATTR_DEF', 
+            itemAttrContextOrgSelector, null, connect);
+}
+
+function buildImportItemAttrGrid() {
+
+    if(itemAttrContextOrg == null)
+        itemAttrContextOrg = openils.User.user.ws_ou();
+
+    itemAttrGrid.loadAll( 
+        {order_by : {viiad : 'name'}}, 
+        {owner : fieldmapper.aou.fullPath(itemAttrContextOrg, true)}
+    );
+}
+

Modified: trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd	2010-08-10 21:22:44 UTC (rev 17164)
+++ trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd	2010-08-11 02:18:47 UTC (rev 17165)
@@ -27,6 +27,7 @@
 <!ENTITY vandelay.edit.attributes "Edit Attributes">
 <!ENTITY vandelay.edit.attrs "Edit Attributes">
 <!ENTITY vandelay.edit.profiles "Edit Merge / Overlay Profiles">
+<!ENTITY vandelay.edit.import_item_attrs "Edit Import Item Attributes">
 <!ENTITY vandelay.false "False">
 <!ENTITY vandelay.file.to.upload "File to Upload:">
 <!ENTITY vandelay.for.example "Example">

Added: trunk/Open-ILS/web/templates/default/vandelay/inc/item_attrs.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/vandelay/inc/item_attrs.tt2	                        (rev 0)
+++ trunk/Open-ILS/web/templates/default/vandelay/inc/item_attrs.tt2	2010-08-11 02:18:47 UTC (rev 17165)
@@ -0,0 +1,27 @@
+<!--
+    Grid for configuring vandelay.import_item_attr_definition
+-->
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+        <div>Import Item Attrbute Definitions</div>
+        <div>
+            <button dojoType='dijit.form.Button' onClick='itemAttrGrid.showCreateDialog()'>New Definition</button>
+            <button dojoType='dijit.form.Button' onClick='itemAttrGrid.deleteSelected()'>Delete Selected</button>
+        </div>
+    </div>
+    <div>
+        <span style='padding-right:10px;'>Context Org Unit</span>
+        <select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='itemAttrContextOrgSelector'
+            searchAttr='shortname' labelAttr='shortname'> </select>
+    </div>
+    <table  jsId="itemAttrGrid"
+            dojoType="openils.widget.AutoGrid"
+            fieldOrder="[]"
+            query="{id: '*'}"
+            fmClass='viiad'
+            editStyle='pane'
+            showPaginator='true'
+            editOnEnter='true'>
+    </table>
+</div>

Modified: trunk/Open-ILS/web/templates/default/vandelay/inc/toolbar.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/vandelay/inc/toolbar.tt2	2010-08-10 21:22:44 UTC (rev 17164)
+++ trunk/Open-ILS/web/templates/default/vandelay/inc/toolbar.tt2	2010-08-11 02:18:47 UTC (rev 17165)
@@ -9,4 +9,6 @@
         onclick="vlShowAttrEditor();" showLabel="true">&vandelay.edit.attributes;</div>
     <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"  id='vl-menu-profile-editor'
         onclick="vlShowProfileEditor();" showLabel="true">&vandelay.edit.profiles;</div>
+    <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"  id='vl-menu-import-item-attr-editor'
+        onclick="vlShowImportItemAttrEditor();" showLabel="true">&vandelay.edit.import_item_attrs;</div>
 </div>

Modified: trunk/Open-ILS/web/templates/default/vandelay/vandelay.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/vandelay/vandelay.tt2	2010-08-10 21:22:44 UTC (rev 17164)
+++ trunk/Open-ILS/web/templates/default/vandelay/vandelay.tt2	2010-08-11 02:18:47 UTC (rev 17165)
@@ -37,6 +37,9 @@
 <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-profile-editor-div' class='hidden content'>
     [% INCLUDE 'default/vandelay/inc/profiles.tt2' %]
 </div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-item-attr-editor-div' class='hidden content'>
+    [% INCLUDE 'default/vandelay/inc/item_attrs.tt2' %]
+</div>
 
 
 [% END %]



More information about the open-ils-commits mailing list