marc_view i18n
[Evergreen.git] / Open-ILS / xul / staff_client / server / cat / marc_view.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: MARC View -->
4 <!--
5 vim:noet:sw=4:ts=4:
6 -->
7
8 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
9 <!-- STYLESHEETS -->
10 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
11 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
12 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
13
14 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
15 <!-- LOCALIZATION -->
16 <!DOCTYPE window PUBLIC "" ""[
17         <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
18 ]>
19
20 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
21 <!-- OVERLAYS -->
22 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
23
24 <window id="cat_marc_view_win" 
25         onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
26         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
27
28         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
29         <!-- BEHAVIOR -->
30         <script type="text/javascript">
31                 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
32         </script>
33         <scripts id="openils_util_scripts"/>
34
35         <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
36         <script>
37         <![CDATA[
38                 function my_init() {
39                         try {
40                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
41                                 if (typeof JSAN == 'undefined') { 
42                                         throw( document.getElementById('commonStrings').getString('common.jsan.missing') );
43                                 }
44                                 JSAN.errorLevel = "die"; // none, warn, or die
45                                 JSAN.addRepository('/xul/server/');
46                                 JSAN.use('util.error'); g.error = new util.error();
47                                 g.error.sdump('D_TRACE','my_init() for cat/marc_view.xul');
48
49                                 var docid = xul_param('docid');
50                                 var noprint = xul_param('noprint');
51
52                                 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
53                                 var key = location.pathname + location.search + location.hash;
54                                 if (!docid && typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') {
55                                         var modal_xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ];
56                                         if (typeof modal_xulG == 'object') {
57                                                 docid = modal_xulG.docid;
58                                                 if (modal_xulG.noprint) noprint = modal_xulG.noprint;
59                                         }
60                                 }
61
62                                 JSAN.use('util.network'); g.network = new util.network();
63
64                                 g.network.request(
65                                         api.MARC_HTML_RETRIEVE.app,
66                                         api.MARC_HTML_RETRIEVE.method,
67                                         [ docid ],
68                                         function(req) {
69                                                 marc_html = req.getResultObject();
70                                                 if (noprint||typeof xulG == 'undefined') marc_html = marc_html.replace(/<button.+?button>/, '');
71                                                 document.getElementById('marc_frame').setAttribute('src', 'data:text/html,' + marc_html);
72                                         }
73                                 );
74
75                         } catch(E) {
76                                 var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['cat/marc_view.xul', E]);
77                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
78                                 alert(err_msg);
79                         }
80                 }
81
82         ]]>
83         </script>
84
85         <groupbox flex="1">
86                 <caption label="&staff.cat.marc_view.title;"/>
87                 <iframe id="marc_frame" flex="1"/>
88         </groupbox>
89
90 </window>
91