[open-ils-commits] r7635 - in trunk/Open-ILS/xul/staff_client: chrome/content/main server/cat server/circ

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Aug 8 13:13:06 EDT 2007


Author: phasefx
Date: 2007-08-08 13:10:09 -0400 (Wed, 08 Aug 2007)
New Revision: 7635

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/main/main.js
   trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
   trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
   trunk/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
Log:
Fix so that replacing a file with the save file dialog works.  Should probably move this from these files into a shared library

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/main.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/main.js	2007-08-08 15:31:52 UTC (rev 7634)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/main.js	2007-08-08 17:10:09 UTC (rev 7635)
@@ -34,7 +34,8 @@
 		mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave
 	);
 	fp.appendFilters( nsIFilePicker.filterAll );
-	if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) {
+	var fp_result = fp.show();
+	if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) {
 		return fp.file;
 	} else {
 		return null;

Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js	2007-08-08 15:31:52 UTC (rev 7634)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js	2007-08-08 17:10:09 UTC (rev 7635)
@@ -188,7 +188,8 @@
 		mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave
 	);
 	fp.appendFilters( nsIFilePicker.filterAll );
-	if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) {
+	var fp_result = fp.show();
+	if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) {
 		return fp.file;
 	} else {
 		return null;

Modified: trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js	2007-08-08 15:31:52 UTC (rev 7634)
+++ trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js	2007-08-08 17:10:09 UTC (rev 7635)
@@ -298,7 +298,8 @@
 									mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave
 								);
 								fp.appendFilters( nsIFilePicker.filterAll );
-								if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) {
+								var fp_result = fp.show();
+								if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) {
 									return fp.file;
 								} else {
 									return null;

Modified: trunk/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js	2007-08-08 15:31:52 UTC (rev 7634)
+++ trunk/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js	2007-08-08 17:10:09 UTC (rev 7635)
@@ -366,7 +366,8 @@
 				mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave
 			);
 			fp.appendFilters( nsIFilePicker.filterAll );
-			if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) {
+			var fp_result = fp.show();
+			if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) {
 				return fp.file;
 			} else {
 				return null;



More information about the open-ils-commits mailing list