initial merge/overlay profile editor ui
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 12 Mar 2010 20:51:03 +0000 (20:51 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 12 Mar 2010 20:51:03 +0000 (20:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15839 dcc99617-32d9-48b4-a31d-7c20da2025e4

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/profiles.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/vandelay/inc/toolbar.tt2
Open-ILS/web/templates/default/vandelay/vandelay.tt2

index 5c2ab31..8f10cc3 100644 (file)
@@ -40,6 +40,8 @@ dojo.require('openils.Util');
 dojo.require('openils.MarcXPathParser');
 dojo.require('openils.widget.GridColumnPicker');
 dojo.require('openils.PermaCrud');
 dojo.require('openils.MarcXPathParser');
 dojo.require('openils.widget.GridColumnPicker');
 dojo.require('openils.PermaCrud');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+dojo.require('openils.widget.AutoGrid');
 
 
 var globalDivs = [
 
 
 var globalDivs = [
@@ -52,7 +54,8 @@ var globalDivs = [
     'vl-queue-select-div',
     'vl-marc-upload-status-div',
     'vl-attr-editor-div',
     'vl-queue-select-div',
     'vl-marc-upload-status-div',
     'vl-attr-editor-div',
-    'vl-marc-export-div'
+    'vl-marc-export-div',
+    'vl-profile-editor-div'
 ];
 
 var authtoken;
 ];
 
 var authtoken;
@@ -239,6 +242,7 @@ function displayGlobalDiv(id) {
     openils.Util.removeCSSClass(dojo.byId('vl-menu-marc-upload'), 'toolbar_selected');
     openils.Util.removeCSSClass(dojo.byId('vl-menu-queue-select'), 'toolbar_selected');
     openils.Util.removeCSSClass(dojo.byId('vl-menu-attr-editor'), 'toolbar_selected');
     openils.Util.removeCSSClass(dojo.byId('vl-menu-marc-upload'), 'toolbar_selected');
     openils.Util.removeCSSClass(dojo.byId('vl-menu-queue-select'), 'toolbar_selected');
     openils.Util.removeCSSClass(dojo.byId('vl-menu-attr-editor'), 'toolbar_selected');
+    openils.Util.removeCSSClass(dojo.byId('vl-menu-profile-editor'), 'toolbar_selected');
 
     switch(id) {
         case 'vl-marc-export-div':
 
     switch(id) {
         case 'vl-marc-export-div':
@@ -253,6 +257,9 @@ function displayGlobalDiv(id) {
         case 'vl-attr-editor-div':
             openils.Util.addCSSClass(dojo.byId('vl-menu-attr-editor'), 'toolbar_selected');
             break;
         case 'vl-attr-editor-div':
             openils.Util.addCSSClass(dojo.byId('vl-menu-attr-editor'), 'toolbar_selected');
             break;
+        case 'vl-profile-editor-div':
+            openils.Util.addCSSClass(dojo.byId('vl-menu-profile-editor'), 'toolbar_selected');
+            break;
     }
 }
 
     }
 }
 
@@ -1219,3 +1226,38 @@ function looksLikeDerivedXpath(path) {
 // amazing xpath-util unit-tests
 if (!looksLikeDerivedXpath('//*[@tag="901"]/*[@code="c"]'))    alert('vandelay xpath-utility error');
 if ( looksLikeDerivedXpath('ba-boo-ba-boo!'))                  alert('vandelay xpath-utility error');
 // amazing xpath-util unit-tests
 if (!looksLikeDerivedXpath('//*[@tag="901"]/*[@code="c"]'))    alert('vandelay xpath-utility error');
 if ( looksLikeDerivedXpath('ba-boo-ba-boo!'))                  alert('vandelay xpath-utility error');
+
+
+
+var profileContextOrg
+function vlShowProfileEditor() {
+    displayGlobalDiv('vl-profile-editor-div');
+    buildProfileGrid();
+
+    var connect = function() {
+        dojo.connect(profileContextOrgSelector, 'onChange',
+            function() {
+                profileContextOrg = this.attr('value');
+                pGrid.resetStore();
+                buildGrid();
+            }
+        );
+    };
+
+    new openils.User().buildPermOrgSelector(
+        '"ADMIN_MERGE_PROFILE', profileContextOrgSelector, null, connect);
+}
+
+function buildProfileGrid() {
+
+    if(profileContextOrg == null)
+        profileContextOrg = openils.User.user.ws_ou();
+
+    pGrid.loadAll( 
+        {order_by : {vmp : 'name'}}, 
+        {owner : fieldmapper.aou.fullPath(profileContextOrg, true)}
+    );
+}
+
+
+
index 8f0ca15..1f64fda 100644 (file)
@@ -24,6 +24,7 @@
 <!ENTITY vandelay.done "Done">
 <!ENTITY vandelay.edit.attributes "Edit Attributes">
 <!ENTITY vandelay.edit.attrs "Edit Attributes">
 <!ENTITY vandelay.done "Done">
 <!ENTITY vandelay.edit.attributes "Edit Attributes">
 <!ENTITY vandelay.edit.attrs "Edit Attributes">
+<!ENTITY vandelay.edit.profiles "Edit Merge / Overlay Profiles">
 <!ENTITY vandelay.false "False">
 <!ENTITY vandelay.file.to.upload "File to Upload:">
 <!ENTITY vandelay.for.example "Example">
 <!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/profiles.tt2 b/Open-ILS/web/templates/default/vandelay/inc/profiles.tt2
new file mode 100644 (file)
index 0000000..d19d059
--- /dev/null
@@ -0,0 +1,25 @@
+<script src='[% ctx.media_prefix %]/js/ui/default/vandelay/vandelay.js'> </script>
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+        <div>Overlay / Merge Profiles</div>
+        <div>
+            <button dojoType='dijit.form.Button' onClick='crGrid.showCreateDialog()'>New Merge Profile</button>
+            <button dojoType='dijit.form.Button' onClick='crGrid.deleteSelected()'>Delete Selected</button>
+        </div>
+    </div>
+    <div>
+        <span>Context Org Unit</span>
+        <select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='profileContextOrgSelector'
+            searchAttr='shortname' labelAttr='shortname'> </select>
+    </div>
+    <table  jsId="pGrid"
+            dojoType="openils.widget.AutoGrid"
+            fieldOrder="[]"
+            query="{id: '*'}"
+            defaultCellWidth='"auto"'
+            fmClass='vmp'
+            showPaginator='true'
+            editOnEnter='true'>
+    </table>
+</div>
index 6bf3b39..d2aca97 100644 (file)
@@ -7,4 +7,6 @@
         onclick="vlShowQueueSelect();" showLabel="true">&vandelay.inspect.queue;</div>
     <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"  id='vl-menu-attr-editor'
         onclick="vlShowAttrEditor();" showLabel="true">&vandelay.edit.attributes;</div>
         onclick="vlShowQueueSelect();" showLabel="true">&vandelay.inspect.queue;</div>
     <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"  id='vl-menu-attr-editor'
         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>
 </div>
index 3ab0b97..29bc1d4 100644 (file)
@@ -34,5 +34,9 @@
         class='hidden attr-editor-detail-content-pane content' title='&vandelay.edit.attrs;'>
     [% INCLUDE 'default/vandelay/inc/attrs.tt2' %]
 </div>
         class='hidden attr-editor-detail-content-pane content' title='&vandelay.edit.attrs;'>
     [% INCLUDE 'default/vandelay/inc/attrs.tt2' %]
 </div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-profile-editor-div' class='hidden content'>
+    [% INCLUDE 'default/vandelay/inc/profiles.tt2' %]
+</div>
+
 
 [% END %]
 
 [% END %]