]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/cat/bib_brief.xul
some tweaks and bug fixes
[Evergreen.git] / Open-ILS / xul / staff_client / server / cat / bib_brief.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Brief Bib Display -->
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 SYSTEM "chrome://open_ils_staff_client/locale/lang.dtd">
14
15 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
16 <!-- OVERLAYS -->
17 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
18
19 <window id="cat_bib_brief_win" 
20         onload="my_init()"
21         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
22
23         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
24         <!-- BEHAVIOR -->
25         <script type="text/javascript">
26                 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
27         </script>
28         <scripts id="openils_util_scripts"/>
29
30         <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
31         <script>
32         <![CDATA[
33                 function my_init() {
34                         try {
35                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
36                                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
37                                 JSAN.errorLevel = "die"; // none, warn, or die
38                                 JSAN.addRepository('/xul/server/');
39                                 JSAN.use('util.error'); g.error = new util.error();
40                                 g.error.sdump('D_TRACE','my_init() for cat_bib_brief.xul');
41
42                                 g.cgi = new CGI();
43                                 var docid = g.cgi.param('docid');
44
45                                 JSAN.use('util.network'); g.network = new util.network();
46                                 JSAN.use('util.date');
47
48                                 g.network.request(
49                                         api.MODS_SLIM_RECORD_RETRIEVE.app,
50                                         api.MODS_SLIM_RECORD_RETRIEVE.method,
51                                         [ docid ],
52                                         function (req) {
53                                                 var mods = req.getResultObject();
54                                                 
55                                                 if (mods.title()) document.getElementById('title').setAttribute('value',mods.title());
56                                                 if (mods.author()) document.getElementById('author').setAttribute('value',mods.author());
57                                                 if (mods.edition()) document.getElementById('edition').setAttribute('value',mods.edition());
58                                                 if (mods.pubdate()) document.getElementById('pubdate').setAttribute('value',mods.pubdate());
59                                                 if (mods.tcn()) document.getElementById('tcn').setAttribute('value',mods.tcn());
60
61                                                 if (window.xulG && typeof window.xulG.set_tab_name == 'function') {
62                                                         try {
63                                                                 window.xulG.set_tab_name(mods.tcn());
64                                                         } catch(E) {
65                                                                 g.error.sdump('D_ERROR','bib_brief.xul, set_tab: ' + E);
66                                                         }
67                                                 }
68
69                                                 g.network.request(
70                                                         api.FM_BRE_RETRIEVE_VIA_ID.app,
71                                                         api.FM_BRE_RETRIEVE_VIA_ID.method,
72                                                         [ docid ],
73                                                         function (req) {
74                                                                 var meta = req.getResultObject()[0];
75                                                                 document.getElementById('creator').setAttribute('value',meta.creator());
76                                                                 document.getElementById('editor').setAttribute('value',meta.editor());
77                                                                 document.getElementById('edit_date').setAttribute('value',
78                                                                         util.date.formatted_date(meta.edit_date(),"%D")
79                                                                 );
80                                                         }
81                                                 );
82
83                                         }
84                                 );
85
86
87
88                         } catch(E) {
89                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
90                                         "system administrator or software developer the following:\ncat/bib_brief.xul\n" + E + '\n';
91                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
92                                 alert(err_msg);
93                         }
94                 }
95
96         ]]>
97         </script>
98
99         <groupbox flex="1">
100                 <caption label="Record Details"/>
101                 <hbox flex="1">
102                         <label style="font-weight: bold;" value="Title:" /><label id="title" /> 
103                         <label style="font-weight: bold;" value="Author:" /><label id="author" />
104                         <label style="font-weight: bold;" value="Edition:" /> <label id="edition" />
105                         <label style="font-weight: bold;" value="Pub Date:" /> <label id="pubdate" />
106                 </hbox>
107                 <hbox flex="1">
108                         <label style="font-weight: bold;" value="TCN:" /> <label id="tcn" />
109                         <label style="font-weight: bold;" value="Created By:" /> <label id="creator" />
110                         <label style="font-weight: bold;" value="Last Edited By:" /> <label id="editor" />
111                         <label style="font-weight: bold;" value="Last Edited On:" /> <label id="edit_date" />
112                 </hbox>
113         </groupbox>
114
115 </window>
116