added an UI for editing vandelay import item attribute definitions. it's a basic...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Aug 2010 02:18:47 +0000 (02:18 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Aug 2010 02:18:47 +0000 (02:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17165 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/web/js/ui/default/vandelay/vandelay.js
Open-ILS/web/opac/locale/en-US/vandelay.dtd
Open-ILS/web/templates/default/vandelay/inc/item_attrs.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/vandelay/inc/toolbar.tt2
Open-ILS/web/templates/default/vandelay/vandelay.tt2

index db066c7..dfa2558 100644 (file)
@@ -251,10 +251,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                </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>
index 7346ef0..61d0485 100644 (file)
@@ -56,7 +56,8 @@ var globalDivs = [
     '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 @@ function displayGlobalDiv(id) {
         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 vlShowProfileEditor() {
             function() {
                 profileContextOrg = this.attr('value');
                 pGrid.resetStore();
-                buildGrid();
+                buildProfileGrid();
             }
         );
     };
@@ -1342,5 +1346,36 @@ function buildProfileGrid() {
     );
 }
 
+/* --- 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)}
+    );
+}
 
index de3b233..31fdc67 100644 (file)
@@ -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">
diff --git a/Open-ILS/web/templates/default/vandelay/inc/item_attrs.tt2 b/Open-ILS/web/templates/default/vandelay/inc/item_attrs.tt2
new file mode 100644 (file)
index 0000000..ad9878d
--- /dev/null
@@ -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>
index d2aca97..69c2190 100644 (file)
@@ -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>
index 019245f..2e2a2e0 100644 (file)
@@ -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 %]