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