From a2894e8e6dab8d7f7de278fd8b2d6a5a240dc051 Mon Sep 17 00:00:00 2001 From: pines Date: Sat, 30 Sep 2006 05:08:59 +0000 Subject: [PATCH] option for auto-pruning lists git-svn-id: svn://svn.open-ils.org/ILS/trunk@6282 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/util/list.js | 13 +++++++++++++ Open-ILS/xul/staff_client/server/circ/checkin.js | 4 ++++ Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul | 1 + Open-ILS/xul/staff_client/server/circ/copy_status.js | 4 ++++ .../xul/staff_client/server/circ/copy_status_overlay.xul | 3 ++- Open-ILS/xul/staff_client/server/circ/in_house_use.js | 4 ++++ Open-ILS/xul/staff_client/server/circ/in_house_use.xul | 3 ++- 7 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 7efed0f0be..ef69cae34d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -437,6 +437,19 @@ util.list.prototype = { } this.error.sdump('D_LIST',s); + try { + + if (obj.trim_list && obj.row_count.total >= obj.trim_list) { + // Remove oldest row + if (typeof params.to_top == 'undefined') { + treechildren_node.removeChild( treechildren_node.firstChild ); + } else { + treechildren_node.removeChild( treechildren_node.lastChild ); + } + } + } catch(E) { + } + setTimeout( function() { obj.auto_retrieve(); }, 0 ); return treeitem; diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index 6f1d564dbc..4a89ea395a 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -307,6 +307,10 @@ circ.checkin.prototype = { || checkin.ilsevent == 7012 /* COPY_STATUS_MISSING */) return obj.on_failure(); var retrieve_id = js2JSON( { 'copy_id' : checkin.copy.id(), 'barcode' : checkin.copy.barcode(), 'doc_id' : (typeof checkin.record != 'undefined' ? ( typeof checkin.record.ilsevent == 'undefined' ? checkin.record.doc_id() : null ) : null ) } ); if (checkin.circ && checkin.circ.checkin_time() == 'now') checkin.circ.checkin_time(backdate); + if (document.getElementById('trim_list')) { + var x = document.getElementById('trim_list'); + if (x.checked) { obj.list.trim_list = 20; } else { obj.list.trim_list = null; } + } obj.list.append( { 'retrieve_id' : retrieve_id, diff --git a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul index df432ed780..14f927c5cd 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul @@ -101,6 +101,7 @@ label="&staff.checkin.reprint_receipt_label;" command="cmd_checkin_reprint" accesskey="&staff.checkin.reprint_receipt_label.accesskey;"/> +