stub out entry for Add Multi-Bib Items, and implement bib marking for multi-home...
authorJason Etheridge <jason@esilibrary.com>
Mon, 4 Apr 2011 03:53:51 +0000 (23:53 -0400)
committerJason Etheridge <jason@esilibrary.com>
Mon, 4 Apr 2011 03:53:51 +0000 (23:53 -0400)
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties

index e8bb029..24a7f3e 100644 (file)
 <!ENTITY staff.cat.opac.default.label "Set bottom interface as Default">
 <!ENTITY staff.cat.opac.manage_parts.accesskey "P">
 <!ENTITY staff.cat.opac.manage_parts.label "Manage Parts">
+<!ENTITY staff.cat.opac.add_multi_home_items.accesskey "B">
+<!ENTITY staff.cat.opac.add_multi_home_items.label "Add Multi-Bib Items">
+<!ENTITY staff.cat.opac.mark_for_multi_home.accesskey "B">
+<!ENTITY staff.cat.opac.mark_for_multi_home.label "Mark as Target for Multi-Bib Items">
 <!ENTITY staff.cat.opac.marc_edit.accesskey "E">
 <!ENTITY staff.cat.opac.marc_edit.label "MARC Edit">
 <!ENTITY staff.cat.opac.marc_view.accesskey "V">
index 7c64f92..a4e0b4a 100644 (file)
@@ -674,10 +674,20 @@ function mark_for_overlay() {
     g.data.stash('marked_record_mvr');
     if (g.data.marked_record_mvr) {
         alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_marked_for_overlay.tcn.alert',[ g.data.marked_record_mvr.tcn() ]));
-        xulG.set_statusbar(1, $("offlineStrings").getFormattedString('staff.cat.z3950.marked_record_for_overlay_indicator.tcn.label',[g.data.marked_record_mvr.tcn()]) );
+        xulG.set_statusbar(
+            1,
+            $("offlineStrings").getFormattedString('staff.cat.z3950.marked_record_for_overlay_indicator.tcn.label',[g.data.marked_record_mvr.tcn()]),
+            $("offlineStrings").getFormattedString('staff.cat.z3950.marked_record_for_overlay_indicator.record_id.label',[g.data.marked_record]),
+            gen_statusbar_click_handler('marked_record')
+        );
     } else {
         alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_marked_for_overlay.record_id.alert',[ g.data.marked_record  ]));
-        xulG.set_statusbar(1, $("offlineStrings").getFormattedString('staff.cat.z3950.marked_record_for_overlay_indicator.record_id.label',[g.data.marked_record]) );
+        xulG.set_statusbar(
+            1,
+            $("offlineStrings").getFormattedString('staff.cat.z3950.marked_record_for_overlay_indicator.record_id.label',[g.data.marked_record]),
+            '',
+            gen_statusbar_click_handler('marked_record')
+        );
     }
 }
 
@@ -694,10 +704,22 @@ function mark_for_hold_transfer() {
     g.data.stash('marked_record_for_hold_transfer_mvr');
     if (g.data.marked_record_mvr) {
         var m = $("offlineStrings").getFormattedString('staff.cat.opac.marked_record_for_hold_transfer_indicator.tcn.label',[g.data.marked_record_for_hold_transfer_mvr.tcn()]);
-        alert(m); xulG.set_statusbar(1, m );
+        alert(m);
+        xulG.set_statusbar(
+            3,
+            m,
+            '',
+            gen_statusbar_click_handler('marked_record_for_hold_transfer')
+        );
     } else {
         var m = $("offlineStrings").getFormattedString('staff.cat.opac.marked_record_for_hold_transfer_indicator.record_id.label',[g.data.marked_record_for_hold_transfer]);
-        alert(m); xulG.set_statusbar(1, m );
+        alert(m);
+        xulG.set_statusbar(
+            3,
+            m,
+            '',
+            gen_statusbar_click_handler('marked_record_for_hold_transfer')
+        );
     }
 }
 
@@ -859,3 +881,81 @@ function manage_parts() {
     }
 }
 
+function add_multi_home_items() {
+    try {
+        xulG.new_tab(
+            window.xulG.url_prefix(urls.ADD_MULTI_HOME_ITEMS),
+            {},
+            { 'docid' : docid }
+        );
+    } catch(E) {
+        alert('Error in chrome/content/cat/opac.js, add_multi_home_items(): ' + E);
+    }
+}
+
+function mark_for_multi_home() {
+    g.data.marked_multi_home_record = docid;
+    g.data.stash('marked_multi_home_record');
+    var robj = g.network.simple_request('MODS_SLIM_RECORD_RETRIEVE.authoritative',[docid]);
+    if (typeof robj.ilsevent == 'undefined') {
+        g.data.marked_multi_home_record_mvr = robj;
+    } else {
+        g.data.marked_multi_home_record_mvr = null;
+        g.error.standard_unexpected_error_alert('in mark_for_multi_home',robj);
+    }
+    g.data.stash('marked_multi_home_record_mvr');
+
+    if (g.data.marked_multi_home_record_mvr) {
+        alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_marked_for_multi_home.tcn.alert',[ g.data.marked_multi_home_record_mvr.tcn() ]));
+        xulG.set_statusbar(
+            2,
+            $("offlineStrings").getFormattedString('staff.cat.copy_browser.marked_record_for_multi_home_indicator.tcn.label',[g.data.marked_multi_home_record_mvr.tcn()]),
+            $("offlineStrings").getFormattedString('staff.cat.copy_browser.marked_record_for_multi_home_indicator.record_id.label',[g.data.marked_multi_home_record]),
+            gen_statusbar_click_handler('marked_multi_home_record')
+        );
+    } else {
+        alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_marked_for_multi_home.record_id.alert',[ g.data.marked_multi_home_record ]));
+        xulG.set_statusbar(
+            2,
+            $("offlineStrings").getFormattedString('staff.cat.copy_browser.marked_record_for_multi_home_indicator.record_id.label',[g.data.marked_multi_home_record]),
+            '',
+            gen_statusbar_click_handler('marked_multi_home_record')
+        );
+    }
+}
+
+function gen_statusbar_click_handler(data_key) {
+    return function (ev) {
+
+        if (! g.data[data_key]) {
+            return;
+        }
+
+        if (ev.button == 0 /* left click, spawn opac */) {
+            var opac_url = xulG.url_prefix( urls.opac_rdetail ) + '?r=' + g.data[data_key];
+            var content_params = {
+                'session' : ses(),
+                'authtime' : ses('authtime'),
+                'opac_url' : opac_url,
+            };
+            xulG.new_tab(
+                xulG.url_prefix(urls.XUL_OPAC_WRAPPER),
+                {'tab_name':'Retrieving title...'},
+                content_params
+            );
+        }
+
+        if (ev.button == 2 /* right click, remove mark */) {
+            if ( window.confirm( document.getElementById('offlineStrings').getString('cat.opac.clear_statusbar') ) ) {
+                g.data[data_key] = null;
+                g.data.stash(data_key);
+                ev.target.setAttribute('label','');
+                if (ev.target.hasAttribute('tooltiptext')) {
+                    ev.target.removeAttribute('tooltiptext');
+                }
+            }
+        }
+    }
+}
+
+
index 9e8549d..8d4fe7c 100644 (file)
@@ -60,6 +60,8 @@
                 <menuitem label="&staff.cat.opac.mark_for_hold_transfer.label;" accesskey="&staff.cat.opac.mark_for_hold_transfer.accesskey;" id="mark_for_hold_transfer" oncommand="mark_for_hold_transfer();"/>
                 <menuitem label="&staff.cat.opac.transfer_title_holds.label;" accesskey="&staff.cat.opac.transfer_title_holds.accesskey;" id="transfer_title_holds" oncommand="transfer_title_holds();"/>
                 <menuitem label="&staff.cat.opac.manage_parts.label;" accesskey="&staff.cat.opac.manage_parts.accesskey;" id="manage_parts" oncommand="manage_parts();"/>
+                <menuitem label="&staff.cat.opac.mark_for_multi_home.label;" accesskey="&staff.cat.opac.mark_for_multi_home.accesskey;" id="mark_for_multi_home" oncommand="mark_for_multi_home();"/>
+                <menuitem label="&staff.cat.opac.add_multi_home_items.label;" accesskey="&staff.cat.opac.add_multi_home_items.accesskey;" id="add_multi_home_items" oncommand="add_multi_home_items();"/>
                 <menuseparator/>
                 <menuitem label="&staff.cat.opac.bib_in_new_tab.label;" id="bib_in_new_tab" oncommand="bib_in_new_tab();"/>
                 <menuitem label="&staff.cat.opac.remove_me.label;" id="remove_me" oncommand="remove_me();"/>
index 802592d..bb44776 100644 (file)
@@ -379,6 +379,7 @@ var urls = {
     'AUDIO_circ_bad' : '/xul/server/skin/media/audio/question.wav',
     'AUDIO_event_ASSET_COPY_NOT_FOUND' : '/xul/server/skin/media/audio/redalert.wav',
 
+    'ADD_MULTI_HOME_ITEMS' : '/xul/server/cat/add_multi_home_items.xul',
     'AUTHORITY_MANAGE' : '/eg/cat/authority/list',
     'XUL_AUTH_SIMPLE' : '/xul/server/main/simple_auth.xul',
     'XUL_BIB_BRIEF' : '/xul/server/cat/bib_brief.xul',
index 7de93f9..6f6ff73 100644 (file)
@@ -35,6 +35,9 @@ cat.opac.record_deleted.error=Error deleting record #%1$s : %2$s : %3$s
 cat.opac.record_undeleted.error=Error undeleting record #%1$s : %2$s : %3$s
 cat.opac.record_marked_for_overlay.record_id.alert=Record with ID %1$s marked for overlay.
 cat.opac.record_marked_for_overlay.tcn.alert=Record with TCN %1$s marked for overlay.
+cat.opac.record_marked_for_multi_home.record_id.alert=Record with ID %1$s targeted for Multi-Bib items.
+cat.opac.record_marked_for_multi_home.tcn.alert=Record with TCN %1$s targeted for Mutli-Bib items.
+cat.opac.clear_statusbar=Un-target/un-mark this record?
 cat.save_record=Save Record
 cat.save.failure=Record not likely updated.
 cat.record.counter=Record %1$s of %2$s
@@ -257,6 +260,8 @@ staff.cat.util.copy_editor.view=View
 staff.circ.copy_status.add_volumes.perm_failure=You do not have permission to add volumes to the workstation library.
 staff.circ.copy_status.add_volumes.title=Add Volume/Item for Record # %1$s
 staff.cat.manage_parts.title=Manage Parts for Record # %1$s
+staff.cat.copy_browser.marked_record_for_multi_home_indicator.tcn.label=Record with TCN %1$s targeted for Multi-Bib items.
+staff.cat.copy_browser.marked_record_for_multi_home_indicator.record_id.label=Record with ID %1$s targeted for Multi-Bib items.
 staff.cat.z3950.marked_record_for_overlay_indicator.tcn.label=Record with TCN %1$s marked for overlay.
 staff.cat.z3950.marked_record_for_overlay_indicator.record_id.label=Record with ID %1$s marked for overlay.
 staff.cat.opac.marked_record_for_hold_transfer_indicator.tcn.label=Record with TCN %1$s marked for title hold transfer.