'render_loan_duration', 'mark_item_as_missing_pieces', 'render_callnumbers_for_bib_menu',
'render_cn_prefix_menuitems', 'render_cn_suffix_menuitems', 'render_cn_class_menu',
'render_cn_prefix_menu', 'render_cn_suffix_menu', 'transfer_specific_title_holds',
- 'request_items'
+ 'request_items', 'mark_for_overlay'
];
cat.util.EXPORT_TAGS = { ':all' : cat.util.EXPORT_OK };
}
}
+cat.util.mark_for_overlay = function(doc_id,doc_mvr) {
+
+ try {
+
+ JSAN.use('OpenILS.data'); var data = new OpenILS.data();
+ data.stash_retrieve();
+ JSAN.use('util.network'); var network = new util.network();
+
+ function gen_statusbar_click_handler(data_key) {
+ return function (ev) {
+
+ if (! data[data_key]) {
+ return;
+ }
+
+ if (ev.button == 0 /* left click, spawn opac */) {
+ var opac_url = xulG.url_prefix( urls.opac_rdetail )
+ + '?r=' + 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( $('offlineStrings').getString(
+ 'cat.opac.clear_statusbar')
+ ) ) {
+ data[data_key] = null;
+ data.stash(data_key);
+ ev.target.setAttribute('label','');
+ if (ev.target.hasAttribute('tooltiptext')) {
+ ev.target.removeAttribute('tooltiptext');
+ }
+ }
+ }
+ }
+ }
+
+ data.marked_record = doc_id;
+ data.stash('marked_record');
+ if (!doc_mvr) {
+ var robj = network.simple_request(
+ 'MODS_SLIM_RECORD_RETRIEVE.authoritative',[doc_id]);
+ if (typeof robj.ilsevent == 'undefined') {
+ data.marked_record_mvr = robj;
+ } else {
+ data.marked_record_mvr = null;
+ alert('Error in cat.util.mark_for_overlay #2: ', js2JSON(robj));
+ }
+ } else {
+ data.marked_record_mvr = doc_mvr;
+ }
+ data.stash('marked_record_mvr');
+ if (data.marked_record_mvr) {
+ alert(
+ $('offlineStrings').getFormattedString(
+ 'cat.opac.record_marked_for_overlay.tcn.alert',
+ [ data.marked_record_mvr.tcn() ]
+ )
+ );
+ xulG.set_statusbar(
+ 1,
+ $("offlineStrings").getFormattedString(
+ 'staff.cat.z3950.marked_record_for_overlay_indicator.tcn.label',
+ [data.marked_record_mvr.tcn()]
+ ),
+ $("offlineStrings").getFormattedString(
+ 'staff.cat.z3950.marked_record_for_overlay_indicator.record_id.label',
+ [data.marked_record]
+ ),
+ gen_statusbar_click_handler('marked_record')
+ );
+ } else {
+ alert(
+ $('offlineStrings').getFormattedString(
+ 'cat.opac.record_marked_for_overlay.record_id.alert',
+ [ data.marked_record ]
+ )
+ );
+ xulG.set_statusbar(
+ 1,
+ $("offlineStrings").getFormattedString(
+ 'staff.cat.z3950.marked_record_for_overlay_indicator.record_id.label',
+ [data.marked_record]
+ ),
+ '',
+ gen_statusbar_click_handler('marked_record')
+ );
+ }
+ } catch(E) {
+ alert('Error in cat.util.mark_for_overlay(): ' + E);
+ }
+}
+
+
dump('exiting cat/util.js\n');
$('jacket_image').setAttribute('tooltiptext','');
}
}
+ if (o.getAttribute('service') == 'native-evergreen-catalog') {
+ $('mark_overlay_btn').disabled = false;
+ obj.controller.view.mark_overlay.setAttribute('doc_id',o.getAttribute('doc_id'));
+ } else {
+ $('mark_overlay_btn').disabled = true;
+ }
return o.getAttribute('retrieve_id');
}
);
}
},
],
+ 'mark_overlay' : [
+ ['command'],
+ function() {
+ try {
+ var doc_id = obj.controller.view.mark_overlay.getAttribute('doc_id');
+ if (doc_id) {
+ cat.util.mark_for_overlay(doc_id);
+ }
+ } catch(E) {
+ alert('Error in z3950.js, mark_overlay: ' + E);
+ }
+ }
+ ],
'marc_import' : [
['command'],
function() {
'retrieve_id' : String( obj.number_of_result_sets ) + '-' + String( j ),
'row' : {
'my' : {
- 'mvr' : function(a){return a;}(obj.result_set[ obj.number_of_result_sets ].records[j].mvr),
+ 'mvr' : function(a){
+ if (a.bibid) {
+ // We have col definitions, etc.
+ // expecting doc_id
+ a.mvr.doc_id( a.bibid );
+ }
+ return a.mvr;
+ }(obj.result_set[ obj.number_of_result_sets ].records[j]),
'service' : results[i].service
}
}
}
);
n.my_node.setAttribute('isbn', function(a){return a;}(obj.result_set[ obj.number_of_result_sets ].records[j].mvr).isbn());
+ n.my_node.setAttribute(
+ 'service',
+ function(a){return a;}(
+ results[i].service
+ )
+ );
+ n.my_node.setAttribute(
+ 'doc_id',
+ function(a){return a;}(
+ (obj.result_set[ obj.number_of_result_sets ].records[j].mvr)
+ ).doc_id()
+ );
+
if (!f) { n.my_node.parentNode.focus(); f = n; }
}
} else {
<command id="cmd_z3950_csv_to_clipboard" disabled="true" />
<command id="cmd_z3950_csv_to_file" disabled="true" />
<command id="save_columns" />
+ <command id="mark_overlay" />
<command id="toggle_form" />
<command id="marc_view" />
</commandset>
<menuitem command="save_columns" label="&staff.cat.z3950.menuitem.save_columns.label;" />
</menupopup>
</button>
+ <button id="mark_overlay_btn"
+ command="mark_overlay"
+ disabled="true"
+ label="&staff.cat.z3950.mark_overlay.label;"
+ accesskey="&staff.cat.z3950.mark_overlay.accesskey;"/>
<spacer flex="1"/>
<button id="marc_view_btn" command="marc_view" disabled="true"/>
<checkbox id="marc_editor" label="&staff.cat.z3950.marc_editor.label;" accesskey="&staff.cat.z3950.marc_editor.accesskey;" oils_persist="checked" checked="true"/>