JSAN.use('util.network'); network = new util.network();
JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.stash_retrieve();
JSAN.use('util.date');
+ JSAN.use('cat.util');
// timeout so xulG gets a chance to get pushed in
setTimeout(
}
if (typeof bib_brief_overlay == 'function') bib_brief_overlay( { 'mvr' : details.mvr, 'acp' : details.copy } );
-/*
- set('title', '');
- set('author', '');
- set('doc_id', '');
- set('doc_type', '');
- set('pubdate', '');
- set('isbn', '');
- set('publisher', '');
- set('tcn', '');
- set('subject', '');
- set('types_of_resource', '');
- set('call_numbers', '');
- set('edition', '');
- set('online_loc', '');
- set('synopsis', '');
- set('physical_description', '');
- set('toc', '');
- set('copy_count', '');
- set('series', '');
- set('serials', '');
- if (details.mvr) {
- set('title',details.mvr.title());
- set('author',details.mvr.author());
- set('doc_id', details.mvr.doc_id());
- set('doc_type', details.mvr.doc_type());
- set('pubdate', details.mvr.pubdate());
- set('isbn',details.mvr.isbn());
- set('publisher', details.mvr.publisher());
- set('tcn', details.mvr.tcn());
- set('subject', details.mvr.subject());
- set('types_of_resource', details.mvr.types_of_resource());
- set('call_numbers', details.mvr.call_numbers());
- set('edition', details.mvr.edition());
- set('online_loc', details.mvr.online_loc());
- set('synopsis', details.mvr.synopsis());
- set('physical_description', details.mvr.physical_description());
- set('toc', details.mvr.toc());
- set('copy_count', details.mvr.copy_count());
- set('series', details.mvr.series());
- set('serials', details.mvr.serials());
- } else {
- set('title',details.copy.dummy_title());
- set('author',details.copy.dummy_author());
- set('isbn',details.copy.dummy_isbn());
- }
-*/
set("stat_cat_entries", '');
set("age_protect", '');
set("alert_message", '');
set("opac_visible", '');
set("price", '');
set("ref", '');
- set("status", '');
+ set("copy_status", '');
+ set_tooltip("copy_status", '');
set("notes", '');
set("stat_cat_entry_copy_maps", '');
set("circulations", '');
set("age_protect", details.copy.age_protect());
set("alert_message", details.copy.alert_message());
set("barcode", details.copy.barcode());
- set("call_number", details.copy.call_number());
+ if (typeof details.copy.call_number() == 'object') {
+ set("call_number", details.copy.call_number().label());
+ } else {
+ network.simple_request('FM_ACN_RETRIEVE.authoritative',[details.copy.call_number()], function(req) {
+ var acn_obj = req.getResultObject();
+ set("call_number", acn_obj.label());
+ });
+ }
set("circ_as_type", details.copy.circ_as_type());
set("copy_circ_lib" , typeof details.copy.circ_lib() == 'object' ? details.copy.circ_lib().shortname() : data.hash.aou[ details.copy.circ_lib() ].shortname());
set_tooltip("copy_circ_lib" , typeof details.copy.circ_lib() == 'object' ? details.copy.circ_lib().name() : data.hash.aou[ details.copy.circ_lib() ].name());
set("circ_modifier", details.copy.circ_modifier());
- set("circulate", details.copy.circulate());
+ set("circulate", get_localized_bool( details.copy.circulate() ));
set("copy_number", details.copy.copy_number());
set("copy_create_date", util.date.formatted_date( details.copy.create_date(), '%{localized}' ));
set("status_changed_time", util.date.formatted_date( details.copy.status_changed_time(), '%{localized}' ));
set("dummy_title", details.copy.dummy_title());
set("copy_edit_date", util.date.formatted_date( details.copy.edit_date(), '%{localized}' ));
set("copy_editor", details.copy.editor());
- set("fine_level", details.copy.fine_level());
- set("holdable", details.copy.holdable());
+ set("fine_level", cat.util.render_fine_level( details.copy.fine_level() ));
+ set("holdable", get_localized_bool( details.copy.holdable() ));
set("copy_id", details.copy.id());
- set("loan_duration", details.copy.loan_duration());
+ set("loan_duration", cat.util.render_loan_duration( details.copy.loan_duration() ));
var copy_location = typeof details.copy.location() == 'object' ? details.copy.location() : data.lookup('acpl',details.copy.location());
set("location", copy_location.name());
set_tooltip("location", document.getElementById('circStrings').getFormattedString(
get_localized_bool( copy_location.opac_visible() )
]
));
- set("opac_visible", details.copy.opac_visible());
+ set("opac_visible", get_localized_bool( details.copy.opac_visible() ));
set("price", details.copy.price());
- set("ref", details.copy.ref());
- set("status", details.copy.status());
+ set("ref", get_localized_bool( details.copy.ref() ));
+ var copy_status = typeof details.copy.status() == 'object' ? details.copy.status() : data.hash.ccs[ details.copy.status() ];
+ set("copy_status", copy_status.name() );
+ set_tooltip("copy_status", document.getElementById('circStrings').getFormattedString(
+ 'staff.circ.copy_details.copy_status_tooltip',
+ [
+ get_localized_bool( copy_status.opac_visible() ),
+ get_localized_bool( copy_status.holdable() )
+ ]
+ ));
set("notes", details.copy.notes());
set("stat_cat_entry_copy_maps", details.copy.stat_cat_entry_copy_maps());
set("circulations", details.copy.circulations());
set("uris", details.volume.uris());
}
- set("copy_status", '');
+ set("transit_copy_status", '');
+ set_tooltip("transit_copy_status", '');
set("dest", '');
set("dest_recv_time", '');
set("transit_id", '');
set("hold_transit_copy", '');
if (details.transit) {
- set("copy_status", details.transit.copy_status());
+ var transit_copy_status = typeof details.transit.copy_status() == 'object' ? details.transit.copy_status() : data.hash.ccs[ details.transit.copy_status() ];
+ set("transit_copy_status", transit_copy_status.name() );
+ set_tooltip("transit_copy_status", document.getElementById('circStrings').getFormattedString(
+ 'staff.circ.copy_details.copy_status_tooltip',
+ [
+ get_localized_bool( transit_copy_status.opac_visible() ),
+ get_localized_bool( transit_copy_status.holdable() )
+ ]
+ ));
set("dest", details.transit.dest());
set("dest_recv_time", util.date.formatted_date( details.transit.dest_recv_time(), '%{localized}' ));
set("transit_id", details.transit.id());
set("workstation", details.circ.workstation());
if (get_bool(details.circ.opac_renewal())||get_bool(details.circ.phone_renewal())||get_bool(details.circ.desk_renewal())) {
set("renewal_workstation", (typeof details.circ.workstation() == 'object' && details.circ.workstation() != null) ? details.circ.workstation().name() : details.circ.workstation() );
- network.simple_request('FM_CIRC_CHAIN', [ses(), details.circ.id() ], function(req) { // Tiny race condition between details.circ and circs[circs.length-1] here, but meh :)
+ network.simple_request('FM_CIRC_CHAIN_SUMMARY', [ses(), details.circ.id() ], function(req) {
try {
- var circs = req.getResultObject();
- set("checkout_workstation", (typeof circs[0].workstation() == 'object' && circs[0].workstation() != null) ? circs[0].workstation().name() : circs[0].workstation() );
+ var summary = req.getResultObject();
+ set("checkout_workstation", summary.checkout_workstation());
+ set("renewal_workstation", summary.last_renewal_workstation());
+ set("checkin_workstation", summary.last_checkin_workstation());
+ set("stop_fines", summary.last_stop_fines());
+ set("stop_fines_time", util.date.formatted_date( summary.last_stop_fines_time(), '%{localized}' ));
+ set("renewal_time", util.date.formatted_date( summary.last_renewal_time(), '%{localized}' ));
} catch(E) {
alert('Error in alternate_copy_summary.js, FM_CIRC_CHAIN: ' + E);
}
}
}
- set("status", '');
+ set("hold_status", '');
set("transit", '');
set("capture_time", '');
set("current_copy", '');
set("notes", '');
if (details.hold) {
- set("status", details.hold.status());
+ set("hold_status", details.hold.status());
set("transit", details.hold.transit());
set("capture_time", util.date.formatted_date( details.hold.capture_time(), '%{localized}' ));
set("current_copy", details.hold.current_copy());
<script type="text/javascript" src="alternate_copy_summary.js"/>
<messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties"/>
+ <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties"/>
<groupbox flex="1">
<label value="&staff.circ.alternate_copy_summary.Call_Number.label;" />
<textbox name="call_number" readonly="true" context="clipboard"/>
<label value="&staff.circ.alternate_copy_summary.Status.label;" />
- <textbox name="status" readonly="true" context="clipboard"/>
+ <textbox name="copy_status" readonly="true" context="clipboard"/>
</row>
<row>
<label value="&staff.circ.alternate_copy_summary.Price.label;" />
<row>
<label value="&staff.circ.alternate_copy_summary.Date_Created.label;" />
<textbox name="copy_create_date" readonly="true" context="clipboard"/>
- <label value="&staff.circ.alternate_copy_summary.Reference.label;" />
- <textbox name="reference" readonly="true" context="clipboard"/>
+ <label value="&staff.circ.alternate_copy_summary.Fine_Level.label;" />
+ <textbox name="fine_level" readonly="true" context="clipboard"/>
<label value="&staff.circ.alternate_copy_summary.Total_Circs___Current_Year.label;" />
<textbox name="total_circ_count_curr_year" readonly="true" context="clipboard"/>
<label value="&staff.circ.alternate_copy_summary.Checkout_Workstation.label;" />
<row>
<label value="&staff.circ.alternate_copy_summary.Status_Changed_Time.label;" />
<textbox name="status_changed_time" readonly="true" context="clipboard"/>
- <label value="&staff.circ.alternate_copy_summary.OPAC_Visible.label;" />
- <textbox name="opac_visible" readonly="true" context="clipboard"/>
+ <label value="&staff.circ.alternate_copy_summary.Reference.label;" />
+ <textbox name="ref" readonly="true" context="clipboard"/>
<label value="&staff.circ.alternate_copy_summary.Total_Circs___Prev_Year.label;" />
<textbox name="total_circ_count_prev_year" readonly="true" context="clipboard"/>
<label value="&staff.circ.alternate_copy_summary.Duration_Rule.label;" />
<row>
<label value="&staff.circ.alternate_copy_summary.Copy_ID.label;" />
<textbox name="copy_id" readonly="true" context="clipboard"/>
- <label value="&staff.circ.alternate_copy_summary.Holdable.label;" />
- <textbox name="holdable" readonly="true" context="clipboard"/>
+ <label value="&staff.circ.alternate_copy_summary.OPAC_Visible.label;" />
+ <textbox name="opac_visible" readonly="true" context="clipboard"/>
+ <!--
<label value="&staff.circ.alternate_copy_summary.Rolling_Counter.label;" />
<textbox name="rolling_counter" readonly="true" context="clipboard"/>
+ -->
+ <label value="&staff.circ.alternate_copy_summary.Renewal_Workstation.label;" />
+ <textbox name="renewal_workstation" readonly="true" context="clipboard"/>
<label value="&staff.circ.alternate_copy_summary.Recurring_Fine_Rule.label;" />
<textbox name="recurring_fine_rule" readonly="true" context="clipboard"/>
</row>
<row>
<label value="&staff.circ.alternate_copy_summary.TCN.label;" />
<textbox name="tcn" readonly="true" context="clipboard"/>
- <label value="&staff.circ.alternate_copy_summary.Circ_Modifier.label;" />
- <textbox name="circ_mod" readonly="true" context="clipboard"/>
- <label value="&staff.circ.alternate_copy_summary.Renewal_Workstation.label;" />
- <textbox name="renewal_workstation" readonly="true" context="clipboard"/>
+ <label value="&staff.circ.alternate_copy_summary.Holdable.label;" />
+ <textbox name="holdable" readonly="true" context="clipboard"/>
+ <label value="&staff.circ.alternate_copy_summary.Remaining_Renewals.label;" />
+ <textbox name="renewal_remaining" readonly="true" context="clipboard"/>
<label value="&staff.circ.alternate_copy_summary.Max_Fine_Rule.label;" />
<textbox name="max_fine_rule" readonly="true" context="clipboard"/>
</row>
<row>
- <spacer />
- <spacer />
- <label value="&staff.circ.alternate_copy_summary.Hold_Shelf_Location.label;" />
- <textbox name="hold_shelf_loc" readonly="true" context="clipboard"/>
- <label value="&staff.circ.alternate_copy_summary.Remaining_Renewals.label;" />
- <textbox name="remaining_renewals" readonly="true" context="clipboard"/>
+ <spacer /><spacer />
+ <label value="&staff.circ.alternate_copy_summary.Circulate.label;" />
+ <textbox name="circulate" readonly="true" context="clipboard"/>
+ <spacer /><spacer />
<label value="&staff.circ.alternate_copy_summary.Checkin_Time.label;" />
<textbox name="checkin_time" readonly="true" context="clipboard"/>
</row>
<row>
<spacer /><spacer />
- <spacer /><spacer />
+ <label value="&staff.circ.alternate_copy_summary.Circ_Modifier.label;" />
+ <textbox name="circ_modifier" readonly="true" context="clipboard"/>
+ <!--
+ <label value="&staff.circ.alternate_copy_summary.Hold_Shelf_Location.label;" />
+ <textbox name="hold_shelf_loc" readonly="true" context="clipboard"/>
+ -->
<spacer /><spacer />
<label value="&staff.circ.alternate_copy_summary.Checkin_Scan_Time.label;" />
<textbox name="checkin_scan_time" readonly="true" context="clipboard"/>