false
);
+ $('copy_details').addEventListener(
+ 'command',
+ handle_copy_details,
+ false
+ );
+
$('payment').addEventListener(
'change',
function(ev) {
{},
{
'patron_id' : g.patron_id,
- 'refresh' : function() { refresh(); }
+ 'refresh' : function() { refresh(); },
+ 'new_tab' : xulG.new_tab
}
);
},
$('add').setAttribute('disabled', g.bill_list_selection.length == 0);
$('voidall').setAttribute('disabled', g.bill_list_selection.length == 0);
$('opac').setAttribute('disabled', g.bill_list_selection.length == 0);
+ $('copy_details').setAttribute('disabled', g.bill_list_selection.length == 0);
},
'on_click' : function(ev) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserRead');
}
}
+function handle_copy_details() {
+ try {
+ var ids = [];
+ for (var i = 0; i < g.bill_list_selection.length; i++) {
+ var my_acp = g.bill_map[ g.bill_list_selection[i] ].copy;
+ if (typeof my_acp != 'undefined' && my_acp != null) {
+ ids.push( my_acp.barcode() );
+ }
+ }
+ JSAN.use('circ.util');
+ circ.util.item_details_new( ids );
+ } catch(E) {
+ alert('Error in bill2.js, handle_opac: ' + E);
+ }
+}
+
function handle_details() {
JSAN.use('util.window'); var win = new util.window();
for (var i = 0; i < g.bill_list_selection.length; i++) {
<messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties"/>
<commandset>
- <command id="opac" disabled="true"/>
- <command id="voidall" disabled="true"/>
- <command id="refund" disabled="true"/>
- <command id="add" disabled="true"/>
- <command id="details" disabled="true"/>
+ <command id="opac" label="&staff.patron.bill_interface.show_in_catalog.label;" accesskey="&staff.patron.bill_interface.show_in_catalog.accesskey;" disabled="true"/>
+ <command id="copy_details" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" disabled="true"/>
+ <command id="voidall" label="&staff.patron.bill_interface.void_all_billings.label;" accesskey="&staff.patron.bill_interface.void_all_billings.accesskey;" disabled="true"/>
+ <command id="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" disabled="true"/>
+ <command id="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" disabled="true"/>
+ <command id="details" label="&staff.patron.bill_interface.full_details.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;" disabled="true"/>
</commandset>
<popupset>
<popup id="actions_popup">
- <menuitem command="opac" label="&staff.patron.bill_interface.show_in_catalog.label;" accesskey="&staff.patron.bill_interface.show_in_catalog.accesskey;" oncommand="alert('Not Yet Implemented');"/>
- <menuitem command="voidall" label="&staff.patron.bill_interface.void_all_billings.label;" accesskey="&staff.patron.bill_interface.void_all_billings.accesskey;" />
- <menuitem command="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" />
- <menuitem command="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" />
- <menuitem command="details" label="&staff.patron.bill_interface.full_details.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;"/>
+ <menuitem command="opac" />
+ <menuitem command="copy_details" />
+ <menuitem command="voidall" />
+ <menuitem command="refund" />
+ <menuitem command="add" />
+ <menuitem command="details" />
</popup>
</popupset>
<menubar>
<menu label="&staff.patron.bill_interface.actions.label;" accesskey="&staff.patron.bill_interface.actions.accesskey;">
<menupopup>
- <menuitem command="opac" label="&staff.patron.bill_interface.show_in_catalog.label;" accesskey="&staff.patron.bill_interface.show_in_catalog.accesskey;" oncommand="alert('Not Yet Implemented');"/>
- <menuitem command="voidall" label="&staff.patron.bill_interface.void_all_billings.label;" accesskey="&staff.patron.bill_interface.void_all_billings.accesskey;" />
- <menuitem command="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" />
- <menuitem command="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" />
- <menuitem command="details" label="&staff.patron.bill_interface.full_details.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;"/>
+ <menuitem command="opac" />
+ <menuitem command="copy_details" />
+ <menuitem command="voidall" />
+ <menuitem command="refund" />
+ <menuitem command="add" />
+ <menuitem command="details" />
</menupopup>
</menu>
</menubar>
);
tally_selected();
$('details').disabled = g.bill_list_selection.length == 0;
+ $('copy_details').disabled = g.bill_list_selection.length == 0;
$('add').disabled = g.bill_list_selection.length == 0;
$('summary').hidden = g.bill_list_selection.length == 0;
$('copy_summary').hidden = g.bill_list_selection.length == 0;
);
payments_tally_selected();
$('payments_details').disabled = g.payments_list_selection.length == 0;
+ $('copy_details_from_payments').disabled = g.payments_list_selection.length == 0;
},
'retrieve_row' : function(params) {
var id = params.retrieve_id;
false
);
+ $('copy_details').addEventListener(
+ 'command',
+ gen_handle_copy_details('bills'),
+ false
+ );
+
+ $('copy_details_from_payments').addEventListener(
+ 'command',
+ gen_handle_copy_details('payments'),
+ false
+ );
+
$('add').addEventListener(
'command',
handle_add,
};
}
+function gen_handle_copy_details(which_list) {
+ return function() {
+ try {
+ JSAN.use('util.functional');
+ var selection;
+ switch(which_list) {
+ case 'payments': selection = util.functional.map_list( g.payments_list_selection, function(o) { return o.xact; } ); break;
+ default: selection = g.bill_list_selection; break;
+ }
+ var ids = [];
+ for (var i = 0; i < selection.length; i++) {
+ var blob = g.network.simple_request('BLOB_MBTS_DETAILS_RETRIEVE',[ses(),selection[i]]);
+ if (blob.copy) { ids.push( blob.copy.barcode() ) }
+ }
+ JSAN.use('circ.util');
+ circ.util.item_details_new(ids);
+ } catch(E) {
+ alert('Error in bill_history.js, handle_copy_details(): ' + E);
+ }
+ };
+}
+
function print_bills() {
try {
var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current';
<button id="opac" label="&staff.patron.bill_history.show_in_catalog.label;" accesskey="&staff.patron.bill_history.show_in_catalog.accesskey;" hidden="true" oncommand="alert('Not Yet Implemented');"/>
<button id="print" label="&staff.patron.bill_history.print.label;" accesskey="&staff.patron.bill_history.print.accesskey;" hidden="false" oncommand="print_bills();"/>
<button id="add" label="&staff.patron.bill_history.add_billing.label;" disabled="true"/>
+ <button id="copy_details" disabled="true" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" />
<button id="details" label="&staff.patron.bill_history.full_details.label;" disabled="true" accesskey="&staff.patron.bill_history.full_details.accesskey;"/>
</hbox>
</tabpanel>
<hbox>
<hbox id="payments_list_actions" />
<spacer flex="1"/>
+ <button id="copy_details_from_payments" disabled="true" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" />
<button id="payments_details" label="&staff.patron.bill_history.full_details.label;" disabled="true" accesskey="&staff.patron.bill_history.full_details.accesskey;"/>
</hbox>
</tabpanel>