[open-ils-commits] r7961 - trunk/Open-ILS/xul/staff_client/server/cat

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 1 14:47:43 EDT 2007


Author: phasefx
Date: 2007-11-01 14:32:50 -0400 (Thu, 01 Nov 2007)
New Revision: 7961

Modified:
   trunk/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
Log:
prevent accidental scans of item barcodes into the # of copies field for Volume/Copy creator

Modified: trunk/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js	2007-11-01 17:14:30 UTC (rev 7960)
+++ trunk/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js	2007-11-01 18:32:50 UTC (rev 7961)
@@ -1,3 +1,4 @@
+const g_max_copies_that_can_be_added_at_a_time_per_volume = 100;
 function my_init() {
 	try {
 
@@ -126,8 +127,9 @@
 	function render_copy_count_entry(ev) {
 		if (ev.target.disabled) return;
 		if (! isNaN( Number( ev.target.value) ) ) {
-			if ( Number( ev.target.value ) > 100 ) {
-				if (!window.confirm('Are you sure you would like to create ' + ev.target.value + ' volumes?')) return;
+			if ( Number( ev.target.value ) > g_max_copies_that_can_be_added_at_a_time_per_volume ) {
+                g.error.yns_alert('You may not add more than ' + g_max_copies_that_can_be_added_at_a_time_per_volume + ' items at a time for a given volume in this interface.','Maximum items exceeded.','Ok',null,null,'');
+                return;
 			}
 			if (node) { row.removeChild(node); node = null; }
 			//ev.target.disabled = true;
@@ -177,8 +179,9 @@
 	function handle_change(tb1,tb2,hb3) {
 		if (tb1.value == '') return;
 		if (isNaN( Number( tb2.value ) )) return;
-		if ( Number( tb2.value ) > 100 ) {
-			if (!window.confirm('Are you sure you would like to create ' + tb2.value + ' copies?')) return;
+		if ( Number( tb2.value ) > g_max_copies_that_can_be_added_at_a_time_per_volume ) {
+            g.error.yns_alert('You may not add more than ' + g_max_copies_that_can_be_added_at_a_time_per_volume + ' items at a time for a given volume in this interface.','Maximum items exceeded.','Ok',null,null,'');
+            return;
 		}
 
 		//if (tb1.disabled || tb2.disabled) return;



More information about the open-ils-commits mailing list