1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Brief Bib Display -->
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
7 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
8 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
9 <?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
13 <!DOCTYPE window PUBLIC "" ""[
14 <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
17 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
19 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
21 <window id="circ_circ_brief_win"
22 onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
23 width="750" height="550"
24 xmlns:html="http://www.w3.org/1999/xhtml"
25 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
27 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
29 <script type="text/javascript">
30 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
32 <scripts id="openils_util_scripts"/>
34 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
37 function $(id) { return document.getElementById(id); }
43 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
44 if (typeof JSAN == 'undefined') {
45 throw( document.getElementById("commonStrings").getString('common.jsan.missing') );
47 JSAN.errorLevel = "die"; // none, warn, or die
48 JSAN.addRepository('/xul/server/');
49 JSAN.use('util.error'); g.error = new util.error();
50 g.error.sdump('D_TRACE','my_init() for circ_circ_brief.xul');
52 g.copy_id = xul_param('copy_id',{'modal_xulG':true});
54 JSAN.use('util.network'); g.network = new util.network();
55 JSAN.use('util.date');
56 JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
58 g.copy = g.network.simple_request('FM_ACP_RETRIEVE',[ g.copy_id ]);
59 if (typeof g.copy.ilsevent != 'undefined') throw(g.copy);
60 g.callnumber = g.network.simple_request('FM_ACN_RETRIEVE.authoritative',[ g.copy.call_number() ]);
61 if (typeof g.callnumber.ilsevent != 'undefined') throw(g.callnumber);
63 var tv = $('top_vbox'); while(tv.firstChild) tv.removeChild(tv.lastChild);
64 var top = document.createElement('iframe'); tv.appendChild(top);
65 top.setAttribute('src',urls.XUL_BIB_BRIEF);
66 top.setAttribute('flex','1');
67 get_contentWindow(top).xulG = { 'docid' : g.callnumber.record() };
68 var mv = $('mid_vbox'); while(mv.firstChild) mv.removeChild(mv.lastChild);
69 var mid = document.createElement('iframe'); mv.appendChild(mid);
70 mid.setAttribute('src',urls.XUL_COPY_SUMMARY);
71 mid.setAttribute('flex','1');
72 get_contentWindow(mid).xulG = { 'copy_id' : g.copy.id() };
77 g.error.standard_unexpected_error_alert('Error in circ_brief.xul, my_init()',E);
81 function show_circs() {
83 $('r_last').disabled = true; $('r_all').disabled = true;
84 g.circs = g.network.simple_request('FM_CIRC_RETRIEVE_VIA_COPY',
85 [ ses(), g.copy_id ]);
86 if (g.circs == null || typeof g.circs.ilsevent != 'undefined') throw(circs);
87 if (g.circs.length == 0) return;
88 //g.circs = g.circs.reverse(); /* put the most recent at the top */
89 $('r_last').disabled = false; $('r_all').disabled = false;
92 for (var j = 0; j < g.circs.length; j++) {
93 var iframe = document.createElement('iframe');
94 iframe.setAttribute('style','overflow: none; min-height: 100px;');
95 iframe.setAttribute('flex','1');
96 gb.appendChild(iframe);
97 iframe.setAttribute('src', urls.XUL_CIRC_BRIEF); // + '?circ_id=' + g.circs[j].id() );
98 get_contentWindow(iframe).xulG = { 'circ_id' : g.circs[j].id() };
101 g.error.standard_unexpected_error_alert('error showing circs',E);
105 function retrieve_last() {
107 //g.data.fancy_prompt_data = js2JSON( [ g.circs[0].usr() ] );
108 //g.data.stash('fancy_prompt_data');
109 xulG.retrieve_these_patrons = [ g.circs[0].usr() ];
110 update_modal_xulG(xulG);
113 g.error.standard_unexpected_error_alert('retrieve_last',E);
117 function retrieve_all() {
119 var patrons = []; var p_hash = {};
120 for (var i = 0; i < g.circs.length; i++) {
121 var usr = g.circs[i].usr();
122 if (typeof p_hash[usr] != 'undefined') { continue; }
124 patrons.push( function(a){return a;}(usr) );
126 //g.data.fancy_prompt_data = js2JSON(patrons);
127 //g.data.stash('fancy_prompt_data');
128 xulG.retrieve_these_patrons = patrons;
129 update_modal_xulG(xulG);
132 g.error.standard_unexpected_error_alert('retrieve_all',E);
139 <vbox flex="1" class="my_overflow">
140 <vbox id="top_vbox" flex="1" class="my_overflow"/>
141 <splitter><grippy/></splitter>
142 <vbox id="mid_vbox" flex="1" class="my_overflow"/>
143 <splitter><grippy/></splitter>
144 <groupbox flex="1" id="circs" class="my_overflow">
145 <caption label="&staff.circ.circ_summary.caption;"/>
148 <button id="r_last" label="&staff.circ.circ_summary.retrieve_last.label;" accesskey="&staff.circ.circ_summary.retrieve_last.accesskey;" oncommand="retrieve_last();"/>
149 <button id="r_all" label="&staff.circ.circ_summary.retrieve_all.label;" accesskey="&staff.circ.circ_summary.retrieve_all.accesskey;" oncommand="retrieve_all();"/>
151 <button label="&staff.circ.circ_summary.done.label;" accesskey="&staff.circ.circ_summary.done.accesskey;" oncommand="window.close();"/>