Import bib trash field group admin UI
authorBill Erickson <berick@esilibrary.com>
Fri, 1 Mar 2013 16:01:08 +0000 (11:01 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 13 Mar 2013 20:35:37 +0000 (16:35 -0400)
Staff client admin UI for managing MARC import trash fields.

Admin => Server Admin => MARC Import Remove Fields

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/conify/global/vandelay/import_bib_trash_group.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/conify/global/vandelay/import_bib_trash_group.js [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul

diff --git a/Open-ILS/src/templates/conify/global/vandelay/import_bib_trash_group.tt2 b/Open-ILS/src/templates/conify/global/vandelay/import_bib_trash_group.tt2
new file mode 100644 (file)
index 0000000..e77a826
--- /dev/null
@@ -0,0 +1,104 @@
+[% WRAPPER base.tt2 %]
+[% ctx.page_title = l('Import Bib Trash Groups') %]
+<script type="text/javascript" 
+    src='[% ctx.media_prefix %]/js/ui/default/conify/global/vandelay/import_bib_trash_group.js'>
+</script>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+
+[%  grp_id = ctx.page_args.0 %]
+
+<script>var grp_id = '[% grp_id %]'</script>
+
+[% IF grp_id %]
+
+    <div dojoType="dijit.layout.ContentPane" 
+            layoutAlign="top" class='oils-header-panel'>
+        <div><span id='trash-group-name'></span></div>
+        <div>
+            <button dojoType='dijit.form.Button' 
+                onClick='tfGrid.showCreateDialog()'>[% l('New Field') %]
+            </button>
+            <button dojoType='dijit.form.Button' 
+                onClick='tfGrid.deleteSelected()'>[% l('Delete Selected') %]
+            </button>
+        </div>
+    </div>
+    <div>
+        <button 
+            onClick="location.href = location.href.replace(/\/[^\/]+$/, '')">
+            [% l('Return to Groups') %]
+        </button>
+    </div>
+    <br/>
+
+    <!-- field grid -->
+
+    <table
+        id="tfGrid"
+        jsid="tfGrid"
+        dojoType="openils.widget.FlattenerGrid"
+        columnPersistKey='"conify.vandelay.import_bib_trash_fields"'
+        autoHeight="true"
+        editOnEnter="true"
+        editStyle="pane"
+        showLoadFilter="true"
+        fmClass="'vibtf'"
+        defaultSort="['label']"
+        query="{grp: grp_id}">
+        <thead>
+            <tr>
+                <th field="id" fpath="id" ffilter="true"/>
+                <th field="field" fpath="field" ffilter="true"/>
+            </tr>
+        </thead>
+    </table>
+
+[% ELSE %]
+
+    <div dojoType="dijit.layout.ContentPane" 
+            layoutAlign="top" class='oils-header-panel'>
+
+        <div>[% l('Import Bib Trash Fields') %]</div>
+        <div>
+            <button dojoType='dijit.form.Button' 
+                    onClick='tgGrid.showCreateDialog()'>
+                [% l('New Field Group') %]
+            </button>
+            <button dojoType='dijit.form.Button' 
+                    onClick='tgGrid.deleteSelected()'>
+                [% l('Delete Selected') %]
+            </button>
+        </div>
+    </div>
+
+    <!-- group grid -->
+
+    <table
+        id="tgGrid"
+        jsid="tgGrid"
+        dojoType="openils.widget.FlattenerGrid"
+        columnPersistKey='"conify.vandelay.import_bib_trash_group"'
+        autoHeight="true"
+        editOnEnter="true"
+        editStyle="pane"
+        showLoadFilter="true"
+        fmClass="'vibtg'"
+        defaultSort="['label']"
+        query="{id:{'!=':null}}">
+        <thead>
+            <tr>
+                <th field="id" fpath="id" ffilter="true" formatter="format_grp"/>
+                <th field="owner" fpath="owner.shortname" ffilter="true"/>
+                <th field="label" fpath="label" ffilter="true"/>
+                <th field="always_apply" fpath="always_apply" ffilter="true"/>
+            </tr>
+        </thead>
+    </table>
+
+[% END %]
+
+</div>
+
+[% END %]
+
diff --git a/Open-ILS/web/js/ui/default/conify/global/vandelay/import_bib_trash_group.js b/Open-ILS/web/js/ui/default/conify/global/vandelay/import_bib_trash_group.js
new file mode 100644 (file)
index 0000000..1cd2bec
--- /dev/null
@@ -0,0 +1,32 @@
+dojo.require('openils.Util');
+dojo.require('openils.PermaCrud');
+dojo.require('openils.widget.FlattenerGrid');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+
+function init() {
+    if (!grp_id) return;
+
+    new openils.PermaCrud().retrieve(
+        'vibtg', grp_id, {
+            oncomplete : function(r) {
+                init2(openils.Util.readResponse(r));
+            }
+        }
+    );
+}
+
+function init2(grp) {
+    dojo.byId('trash-group-name').innerHTML = grp.label();
+    tfGrid.overrideEditWidgets.grp = new dijit.form.TextBox({
+        value : grp.id(),
+        disabled : true
+    });
+}
+
+function format_grp(val) {
+    return '<a href="' + location.href + 
+        '/' + escape(val) + '">' + val + '</a>';
+}
+
+openils.Util.addOnLoad(init);
index 0f6b2fe..a02e3ea 100644 (file)
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_hard_due_date "Hard Due Date Changes">
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_rule_circ_duration "Circulation Duration Rules">
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_best_hold_order "Best-Hold Selection Sort Order">
+<!ENTITY staff.main.menu.admin.server_admin.conify.vandelay_import_bib_trash_group "MARC Import Remove Fields">
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_rule_recurring_fine "Circulation Recurring Fine Rules">
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_rule_max_fine "Circulation Max Fine Rules">
 <!ENTITY staff.main.menu.admin.server_admin.conify.config_rule_age_hold_protect "Age Hold Protect Rules">
index 316c033..aab9000 100644 (file)
@@ -796,6 +796,10 @@ main.menu.prototype = {
                 ['oncommand'],
                 function(event) { open_eg_web_page('conify/global/config/best_hold_order', null, event); }
             ],
+                       'cmd_server_admin_vandelay_import_bib_trash_group' : [
+                ['oncommand'],
+                function(event) { open_eg_web_page('conify/global/vandelay/import_bib_trash_group', null, event); }
+            ],
             'cmd_server_admin_config_usr_activity_type' : [
                 ['oncommand'],
                 function(event) { open_eg_web_page('conify/global/config/usr_activity_type', null, event); }
index 0081bec..2d274a6 100644 (file)
              />
     <command id="cmd_server_admin_conify_remote_account"
              perm="ADMIN_CONFIG_REMOTE_ACCOUNT VIEW_CONFIG_REMOTE_ACCOUNT"
+            />
+    <command id="cmd_server_admin_vandelay_import_bib_trash_group"
+             perm="CREATE_IMPORT_TRASH_FIELD UPDATE_IMPORT_TRASH_FIELD DELETE_IMPORT_TRASH_FIELD"
              />
 
     <command id="cmd_hotkeys_toggle" />
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.config_asset_sip_fields;" command="cmd_server_admin_config_asset_sip_fields"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.config_usr_activity_type;" command="cmd_server_admin_config_usr_activity_type"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.config_best_hold_order;" command="cmd_server_admin_config_best_hold_order"/>
+                <menuitem label="&staff.main.menu.admin.server_admin.conify.vandelay_import_bib_trash_group;" command="cmd_server_admin_vandelay_import_bib_trash_group"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.actor.org_unit_custom_tree;" command="cmd_server_admin_actor_org_unit_custom_tree"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.config.remote_account;" command="cmd_server_admin_conify_remote_account"/>
                 <menu id="main.menu.admin.server.acq" label="&staff.main.menu.admin.server_admin.acq.label;" accesskey="&staff.main.menu.admin.server_admin.acq.accesskey;">