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="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
9 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
10 <?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
12 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
14 <!DOCTYPE window PUBLIC "" ""[
15 <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
18 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
20 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
22 <window id="circ_circ_brief_win"
23 onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
24 width="750" height="550"
25 xmlns:html="http://www.w3.org/1999/xhtml"
26 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
28 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
30 <script type="text/javascript">
31 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
33 <scripts id="openils_util_scripts"/>
35 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
38 function $(id) { return document.getElementById(id); }
44 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
45 if (typeof JSAN == 'undefined') {
46 throw( document.getElementById("commonStrings").getString('common.jsan.missing') );
48 JSAN.errorLevel = "die"; // none, warn, or die
49 JSAN.addRepository('/xul/server/');
50 JSAN.use('util.error'); g.error = new util.error();
51 g.error.sdump('D_TRACE','my_init() for circ_circ_brief.xul');
53 g.copy_id = xul_param('copy_id',{'modal_xulG':true});
54 g.count = xul_param('count',{'modal_xulG':true});
56 JSAN.use('util.network'); g.network = new util.network();
57 JSAN.use('util.date');
58 JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
60 g.copy = g.network.simple_request('FM_ACP_RETRIEVE',[ g.copy_id ]);
61 if (typeof g.copy.ilsevent != 'undefined') throw(g.copy);
62 g.callnumber = g.network.simple_request('FM_ACN_RETRIEVE',[ g.copy.call_number() ]);
63 if (typeof g.callnumber.ilsevent != 'undefined') throw(g.callnumber);
65 $('top').setAttribute('src',urls.XUL_BIB_BRIEF);// + '?docid=' + g.callnumber.record());
66 get_contentWindow($('top')).xulG = { 'docid' : g.callnumber.record() };
67 $('mid').setAttribute('src',urls.XUL_COPY_SUMMARY); // + '?copy_id=' + g.copy.id());
68 get_contentWindow($('mid')).xulG = { 'copy_id' : g.copy.id() };
73 g.error.standard_unexpected_error_alert('Error in circ_brief.xul, my_init()',E);
77 function show_circs() {
79 $('r_last').disabled = true; $('r_all').disabled = true;
80 g.circs = g.network.simple_request('FM_CIRC_RETRIEVE_VIA_COPY',
81 [ ses(), g.copy_id, g.count ]);
82 if (g.circs == null || typeof g.circs.ilsevent != 'undefined') throw(circs);
83 if (g.circs.length == 0) return;
84 //g.circs = g.circs.reverse(); /* put the most recent at the top */
85 $('r_last').disabled = false; $('r_all').disabled = false;
88 for (var j = 0; j < g.circs.length; j++) {
89 var iframe = document.createElement('iframe');
90 iframe.setAttribute('style','overflow: none; min-height: 100px;');
91 iframe.setAttribute('flex','1');
92 gb.appendChild(iframe);
93 iframe.setAttribute('src', urls.XUL_CIRC_BRIEF); // + '?circ_id=' + g.circs[j].id() );
94 get_contentWindow(iframe).xulG = { 'circ_id' : g.circs[j].id() };
97 g.error.standard_unexpected_error_alert('error showing circs',E);
101 function retrieve_last() {
103 //g.data.fancy_prompt_data = js2JSON( [ g.circs[0].usr() ] );
104 //g.data.stash('fancy_prompt_data');
105 xulG.retrieve_these_patrons = [ g.circs[0].usr() ];
106 update_modal_xulG(xulG);
109 g.error.standard_unexpected_error_alert('retrieve_last',E);
113 function retrieve_all() {
115 var patrons = []; var p_hash = {};
116 for (var i = 0; i < g.circs.length; i++) {
117 var usr = g.circs[i].usr();
118 if (typeof p_hash[usr] != 'undefined') { continue; }
120 patrons.push( function(a){return a;}(usr) );
122 //g.data.fancy_prompt_data = js2JSON(patrons);
123 //g.data.stash('fancy_prompt_data');
124 xulG.retrieve_these_patrons = patrons;
125 update_modal_xulG(xulG);
128 g.error.standard_unexpected_error_alert('retrieve_all',E);
135 <vbox flex="1" style="overflow: auto;">
136 <iframe id="top" style="overflow: auto;"/>
137 <splitter><grippy/></splitter>
138 <iframe id="mid" style="overflow: auto;"/>
139 <splitter><grippy/></splitter>
140 <groupbox flex="1" id="circs" style="overflow: auto;">
141 <caption label="&staff.circ.circ_summary.caption;"/>
144 <button id="r_last" label="&staff.circ.circ_summary.retrieve_last.label;" accesskey="&staff.circ.circ_summary.retrieve_last.accesskey;" oncommand="retrieve_last();"/>
145 <button id="r_all" label="&staff.circ.circ_summary.retrieve_all.label;" accesskey="&staff.circ.circ_summary.retrieve_all.accesskey;" oncommand="retrieve_all();"/>
147 <button label="&staff.circ.circ_summary.done.label;" accesskey="&staff.circ.circ_summary.done.accesskey;" oncommand="window.close();"/>