[open-ils-commits] r14754 - in trunk/Open-ILS/xul/staff_client/server: circ skin (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 3 17:59:20 EST 2009
Author: phasefx
Date: 2009-11-03 17:59:14 -0500 (Tue, 03 Nov 2009)
New Revision: 14754
Modified:
trunk/Open-ILS/xul/staff_client/server/circ/checkin.js
trunk/Open-ILS/xul/staff_client/server/skin/circ.css
Log:
For backdating circs post-checkin in the Checkin interface, style the rows for the circs affected
Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkin.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkin.js 2009-11-03 22:38:15 UTC (rev 14753)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkin.js 2009-11-03 22:59:14 UTC (rev 14754)
@@ -14,6 +14,7 @@
circ.checkin.prototype = {
'selection_list' : [],
+ 'row_map' : {},
'init' : function( params ) {
@@ -54,7 +55,7 @@
var sel = obj.list.retrieve_selection();
obj.selection_list = util.functional.map_list(
sel,
- function(o) { return JSON2js(o.getAttribute('retrieve_id')); }
+ function(o) { var p = JSON2js(o.getAttribute('retrieve_id')); p.unique_row_counter = o.getAttribute('unique_row_counter'); return p; }
);
obj.error.sdump('D_TRACE', 'circ/copy_status: selection list = ' + js2JSON(obj.selection_list) );
if (obj.selection_list.length == 0) {
@@ -168,19 +169,46 @@
'sel_backdate' : [
['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;
- if (!circ_id) {
- var blob = obj.network.simple_request('FM_ACP_DETAILS',[ses(),copy_id]);
- if (blob.circ) circ_id = blob.circ.id();
+ try {
+ JSAN.use('circ.util');
+ var circ_ids = []; var circ_row_map = {};
+ 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;
+ if (!circ_id) {
+ var blob = obj.network.simple_request('FM_ACP_DETAILS',[ses(),copy_id]);
+ if (blob.circ) circ_id = blob.circ.id();
+ }
+ if (!circ_id) continue;
+ if (! circ_row_map[ circ_id ]) { circ_row_map[ circ_id ] = []; }
+ circ_row_map[ circ_id ].push( obj.selection_list[i].unique_row_counter );
+ circ_ids.push( circ_id );
}
- if (!circ_id) continue;
- circ_ids.push( circ_id );
+ var robj = circ.util.backdate_post_checkin( circ_ids );
+ if (robj.complete) {
+ var bad_circs = {};
+ for (var i = 0; i < robj.bad_circs.length; i++) {
+ bad_circs[ robj.bad_circs[i].circ_id ] = robj.bad_circs[i].result;
+ }
+ for (var circ_id in circ_row_map) {
+ var row_array = circ_row_map[circ_id];
+ for (var i = 0; i < row_array.length; i++) {
+ var row_data = obj.row_map[ row_array[i] ];
+ if (row_data.row.my.circ) {
+ if (bad_circs[ circ_id ]) {
+ row_data.row_properties = 'backdate_failed';
+ } else {
+ row_data.row_properties = 'backdate_succeeded';
+ row_data.row.my.circ.checkin_time( robj.backdate );
+ }
+ }
+ obj.list.refresh_row( row_data );
+ }
+ }
+ }
+ } catch(E) {
+ alert('Error in checkin.js, sel_backdate: ' + E);
}
- circ.util.backdate_post_checkin( circ_ids );
}
],
'sel_mark_items_damaged' : [
@@ -490,7 +518,9 @@
'message' : checkin.message
}
},
- 'to_top' : true
+ 'to_top' : true,
+ 'on_append' : function(rparams) { obj.row_map[ rparams.unique_row_counter ] = rparams; },
+ 'on_remove' : function(unique_row_counter) { delete obj.row_map[ unique_row_counter ]; }
}
);
obj.list.node.view.selection.select(0);
Modified: trunk/Open-ILS/xul/staff_client/server/skin/circ.css
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/skin/circ.css 2009-11-03 22:38:15 UTC (rev 14753)
+++ trunk/Open-ILS/xul/staff_client/server/skin/circ.css 2009-11-03 22:59:14 UTC (rev 14754)
@@ -7,6 +7,26 @@
background-color: pink;
}
+treechildren::-moz-tree-row(backdate_failed) {
+ background-color: pink ! important;
+}
+
+treechildren::-moz-tree-row(backdate_succeeded) {
+ background-color: lightgreen ! important;
+}
+
+treechildren::-moz-tree-row(backdate_failed) {
+ background-color: pink ! important;
+}
+
+treechildren::-moz-tree-row(backdate_succeeded,selected) {
+ background-color: #900eff ! important;
+}
+
+treechildren::-moz-tree-row(backdate_failed,selected) {
+ background-color: #ffc0ff ! important;
+}
+
.checkin_screen_normal { background-color: green; }
.checkin_screen_backdating { background-color: red; }
.checkin_screen_do_not_alert_on_precat { }
More information about the open-ils-commits
mailing list