[open-ils-commits] r14808 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Nov 6 13:35:19 EST 2009


Author: phasefx
Date: 2009-11-06 13:35:15 -0500 (Fri, 06 Nov 2009)
New Revision: 14808

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/error.js
Log:
fix logic error with the patron log.  The array should work more like a Set.  We only want to see the last X unique patrons who had activity logged

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/error.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/error.js	2009-11-06 17:08:54 UTC (rev 14807)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/error.js	2009-11-06 18:35:15 UTC (rev 14808)
@@ -606,7 +606,11 @@
                 to_top: true
             };
             if (data.patron_log.length > 0) {
-                if ( data.patron_log[ data.patron_log.length -1 ].row.my.au_id == row_data.au_id ) data.patron_log.pop();
+                var temp = [];
+                for (var i = 0; i < data.patron_log.length; i++) {
+                    if (data.patron_log[ i ].row.my.au_id != row_data.au_id) temp.push( data.patron_log[i] );
+                } 
+                data.patron_log = temp;
             }
             data.patron_log.push( ds );
             if (data.patron_log.length > max_entries) data.patron_log.shift();



More information about the open-ils-commits mailing list