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>
--- /dev/null
+[% 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 %]
+
--- /dev/null
+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);
<!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">
['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); }
/>
<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;">