option for auto-pruning lists
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 30 Sep 2006 05:08:59 +0000 (05:08 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 30 Sep 2006 05:08:59 +0000 (05:08 +0000)
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
Open-ILS/xul/staff_client/server/circ/checkin.js
Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul
Open-ILS/xul/staff_client/server/circ/copy_status.js
Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul
Open-ILS/xul/staff_client/server/circ/in_house_use.js
Open-ILS/xul/staff_client/server/circ/in_house_use.xul

index 7efed0f..ef69cae 100644 (file)
@@ -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;
index 6f1d564..4a89ea3 100644 (file)
@@ -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,
index df432ed..14f927c 100644 (file)
                label="&staff.checkin.reprint_receipt_label;" 
                command="cmd_checkin_reprint"
                accesskey="&staff.checkin.reprint_receipt_label.accesskey;"/>
+       <checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked"/> 
        <spacer id="pcii3s" flex="1"/>
        <checkbox id="checkin_auto" label="Auto-Print for Hold/Transit Slips" accesskey="P" persist="checked"/> 
 <!--
index bbe6466..a5cb9c8 100644 (file)
@@ -341,6 +341,10 @@ circ.copy_status.prototype = {
                                }
                        } else {
                                var my_mvr = obj.network.simple_request('MODS_SLIM_RECORD_RETRIEVE_VIA_COPY', [ copy.id() ]);
+                               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' : js2JSON( { 'renewable' : copy.circulations() ? 't' : 'f', 'copy_id' : copy.id(), 'barcode' : barcode, 'doc_id' : (typeof my_mvr.ilsevent == 'undefined' ? my_mvr.doc_id() : null ) } ),
index fce9ceb..aa65b2e 100644 (file)
 </hbox>
 
 <hbox id="copy_status_bottom_ui">
-       <spacer flex="1"/>
        <button id="copy_status_print" 
                label="Print"
                command="cmd_copy_status_print"
                accesskey="P"/>
+       <checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked"/> 
+       <spacer flex="1"/>
 </hbox>
 
 </overlay>
index 7fb7482..493062a 100644 (file)
@@ -256,6 +256,10 @@ circ.in_house_use.prototype = {
                                copy = new acp(); copy.barcode( '' );
                        }
 
+                       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(
                                {
                                        'row' : {
index 26dce04..e39a59f 100644 (file)
                        label="Re-Print Last List" 
                        command="cmd_in_house_use_reprint"
                        accesskey="L"/>
+               <checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked"/> 
+               <spacer id="pcii3s" flex="1"/>
                <button id="clip_button" disabled="true" command="sel_clip" label="Copy to Clipboard" />
                <button id="save_cols_btn" command="save_columns" label="Save Columns" />
-               <spacer id="pcii3s" flex="1"/>
        </hbox>
 
 </groupbox>