[open-ils-commits] r14513 - in trunk/Open-ILS/xul/staff_client: chrome/content/main server/circ (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 21 04:12:21 EDT 2009
Author: phasefx
Date: 2009-10-21 04:12:16 -0400 (Wed, 21 Oct 2009)
New Revision: 14513
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
trunk/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js
trunk/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.xul
trunk/Open-ILS/xul/staff_client/server/circ/checkin.js
trunk/Open-ILS/xul/staff_client/server/circ/util.js
Log:
use batch api call for post-checkin backdating
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2009-10-21 06:19:30 UTC (rev 14512)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2009-10-21 08:12:16 UTC (rev 14513)
@@ -191,6 +191,7 @@
'FM_CIRC_IMPROVED_COUNT_VIA_COPY' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.circbyyr.atomic' },
'FM_CIRC_EDIT_DUE_DATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.due_date.update' },
'FM_CIRC_BACKDATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.post_checkin_backdate' },
+ 'FM_CIRC_BACKDATE_BATCH' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.post_checkin_backdate.batch.atomic' },
'FM_CIT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.ident_types.retrieve', 'secure' : false },
'FM_CITM_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.item_type_map.retrieve.all', 'secure' : false },
'FM_CNAL_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.net_access_level.retrieve.all', 'secure' : false },
Modified: trunk/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js 2009-10-21 06:19:30 UTC (rev 14512)
+++ trunk/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js 2009-10-21 08:12:16 UTC (rev 14513)
@@ -27,8 +27,16 @@
$('checkin_effective_datepicker').value = util.date.formatted_date(new Date(),'%F');
- $('circ_brief').setAttribute('src', urls.XUL_CIRC_BRIEF);
- get_contentWindow($('circ_brief')).xulG = { 'circ_id' : xul_param('circ_id',{'modal_xulG':true}) };
+ var x = $('circ_brief_area');
+ var circ_ids = xul_param('circ_ids',{'modal_xulG':true});
+ dojo.forEach(
+ circ_ids,
+ function(element,idx,list) {
+ var iframe = document.createElement('iframe'); x.appendChild(iframe);
+ iframe.setAttribute('src', urls.XUL_CIRC_BRIEF);
+ get_contentWindow(iframe).xulG = { 'circ_id' : element };
+ }
+ );
/* set widget behavior */
$('cancel_btn').addEventListener(
Modified: trunk/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.xul 2009-10-21 06:19:30 UTC (rev 14512)
+++ trunk/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.xul 2009-10-21 08:12:16 UTC (rev 14513)
@@ -36,7 +36,7 @@
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- CONTENT -->
<dialogheader title="&staff.circ.backdate_post_checkin.header;" description="&staff.circ.backdate_post_checkin.description;" />
- <iframe id="circ_brief" flex="1"/>
+ <vbox class="my_overflow" id="circ_brief_area" flex="1"/>
<hbox>
<label id="checkin_effective_date_label" value="&staff.circ.checkin_overlay.effective_date.label;" control="checkin_effective_datepicker" accesskey="&staff.circ.checkin_overlay.effective_date.accesskey;"/>
<datepicker id="checkin_effective_datepicker" type="popup" context="clipboard"/>
Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkin.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkin.js 2009-10-21 06:19:30 UTC (rev 14512)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkin.js 2009-10-21 08:12:16 UTC (rev 14513)
@@ -169,6 +169,7 @@
['command'],
function() {
JSAN.use('circ.util');
+ var circ_ids = [];
for (var i = 0; i < obj.selection_list.length; i++) {
var circ_id = obj.selection_list[i].circ_id;
var copy_id = obj.selection_list[i].copy_id;
@@ -177,8 +178,9 @@
if (blob.circ) circ_id = blob.circ.id();
}
if (!circ_id) continue;
- circ.util.backdate_post_checkin( circ_id );
+ circ_ids.push( circ_id );
}
+ circ.util.backdate_post_checkin( circ_ids );
}
],
'sel_mark_items_damaged' : [
Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js 2009-10-21 06:19:30 UTC (rev 14512)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js 2009-10-21 08:12:16 UTC (rev 14513)
@@ -84,7 +84,7 @@
}
};
-circ.util.backdate_post_checkin = function(circ_id) {
+circ.util.backdate_post_checkin = function(circ_ids) {
var obj = {};
JSAN.use('util.error'); obj.error = new util.error();
JSAN.use('util.window'); obj.win = new util.window();
@@ -94,29 +94,33 @@
var circStrings = document.getElementById('circStrings');
- if (typeof circ_id == 'object' && circ_id != null) circ_id = circ_id.id();
+ dojo.forEach(
+ circ_ids,
+ function(element,idx,list) {
+ if (typeof element == 'object' && element != null) list[idx] = element.id();
+ }
+ );
try {
var url = xulG.url_prefix( urls.XUL_BACKDATE );
- obj.data.temp_circ_id = circ_id; obj.data.stash('temp_circ_id');
- var my_xulG = obj.win.open( url, 'backdate_post_checkin', 'chrome,resizable,modal', {} );
+ var my_xulG = obj.win.open( url, 'backdate_post_checkin', 'chrome,resizable,modal', { 'circ_ids' : circ_ids } );
if (typeof my_xulG.proceed == 'undefined') return;
- var r = obj.network.simple_request( 'FM_CIRC_BACKDATE', [ ses(), circ_id, my_xulG.backdate ] );
+ var r = obj.network.simple_request( 'FM_CIRC_BACKDATE_BATCH', [ ses(), circ_ids, my_xulG.backdate ] );
if (r == 1) {
obj.sound.circ_good();
var x = $('no_change_label');
if (x) {
x.hidden = false;
- x.setAttribute('value', circStrings.getFormattedString('staff.circ.backdate.success',[circ_id,my_xulG.backdate]));
+ x.setAttribute('value', circStrings.getFormattedString('staff.circ.backdate.success',[circ_ids.join(","),my_xulG.backdate]));
}
} else {
obj.sound.circ_bad();
var x = $('no_change_label');
if (x) {
x.hidden = false;
- x.setAttribute('value', circStrings.getFormattedString('staff.circ.backdate.failed',[circ_id,r.textcode]));
+ x.setAttribute('value', circStrings.getFormattedString('staff.circ.backdate.failed',[circ_ids.join(","),r.textcode]));
}
}
More information about the open-ils-commits
mailing list