From 7c5b43620134b656fe3acc027263e9aaa68cf0aa Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 18 Sep 2009 18:39:32 +0000 Subject: [PATCH] in case marc_view.xul gets sent a pre-cat git-svn-id: svn://svn.open-ils.org/ILS/trunk@14055 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/marc_view.xul | 27 ++++++++++++++-------- .../server/locale/en-US/cat.properties | 1 + 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/marc_view.xul b/Open-ILS/xul/staff_client/server/cat/marc_view.xul index 67f80214cd..a45dadf4df 100644 --- a/Open-ILS/xul/staff_client/server/cat/marc_view.xul +++ b/Open-ILS/xul/staff_client/server/cat/marc_view.xul @@ -61,16 +61,21 @@ vim:noet:sw=4:ts=4: JSAN.use('util.network'); g.network = new util.network(); - g.network.request( - api.MARC_HTML_RETRIEVE.app, - api.MARC_HTML_RETRIEVE.method, - [ docid ], - function(req) { - marc_html = req.getResultObject(); - if (noprint||typeof xulG == 'undefined') marc_html = marc_html.replace(//, ''); - document.getElementById('marc_frame').setAttribute('src', 'data:text/html,' + marc_html); - } - ); + if (docid > -1) { + g.network.request( + api.MARC_HTML_RETRIEVE.app, + api.MARC_HTML_RETRIEVE.method, + [ docid ], + function(req) { + var marc_html = req.getResultObject(); + if (noprint||typeof xulG == 'undefined') marc_html = marc_html.replace(//, ''); + document.getElementById('marc_frame').setAttribute('src', 'data:text/html,' + marc_html); + } + ); + } else { + var marc_html = '

' + document.getElementById('catStrings').getString('bib.no_marc') + '

'; + document.getElementById('marc_frame').setAttribute('src', 'data:text/html,' + marc_html); + } } catch(E) { var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['cat/marc_view.xul', E]); @@ -82,6 +87,8 @@ vim:noet:sw=4:ts=4: ]]> + +