[Mapbender-commits] r7926 - in branches/2.7: http/plugins resources/db/pgsql/UTF-8/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 11 08:43:46 EDT 2011


Author: verenadiewald
Date: 2011-07-11 05:43:46 -0700 (Mon, 11 Jul 2011)
New Revision: 7926

Modified:
   branches/2.7/http/plugins/mb_button.js
   branches/2.7/http/plugins/mb_print.php
   branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.1_to_2.7.2_pgsql_UTF-8.sql
Log:
http://trac.osgeo.org/mapbender/ticket/827 + remove printbox if print dialog is closed + change scale in textfield (always became 0)

Modified: branches/2.7/http/plugins/mb_button.js
===================================================================
--- branches/2.7/http/plugins/mb_button.js	2011-07-08 09:50:53 UTC (rev 7925)
+++ branches/2.7/http/plugins/mb_button.js	2011-07-11 12:43:46 UTC (rev 7926)
@@ -50,10 +50,11 @@
 		left: "auto"
 	}).hide().dialog({
 		autoOpen: false,
-		position: o.position
-	});
+		position: o.position,
+                dialogClass: o.target + "-dialog"
+        });
 
-	var openDialog = function () {
+        var openDialog = function () {
 		dialog.dialog("open");
 		button.stop();
 	};

Modified: branches/2.7/http/plugins/mb_print.php
===================================================================
--- branches/2.7/http/plugins/mb_print.php	2011-07-08 09:50:53 UTC (rev 7925)
+++ branches/2.7/http/plugins/mb_print.php	2011-07-11 12:43:46 UTC (rev 7926)
@@ -26,6 +26,22 @@
  * > var_value, context, var_type) VALUES('<appId>', 'printPDF', 
  * > 'mbPrintConfig', '{"Standard": "mapbender_template.json"}', '' ,'var');
  * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'printPDF',
+ * > 'unlink', 'true', 'delete print pngs after pdf creation' ,'php_var');
+ * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'printPDF',
+ * > 'logRequests', 'false', 'log wms requests for debugging' ,'php_var');
+ * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'printPDF',
+ * > 'logType', 'file', 'log mode can be set to file or db' ,'php_var');
+ * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name,
+ * > var_value, context, var_type) VALUES('<appId>', 'printPDF',
+ * > 'timeout', '90000', 'define maximum seconds to wait for print request finished' ,'var');
+ * >
  * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
  * > var_value, context, var_type) VALUES('<appId>', 'body', 
  * > 'print_css', '../css/print_div.css', '' ,'file/css');
@@ -110,7 +126,7 @@
 			printBox.repaint();
 		}
 	});
-	/**
+        /**
  	 * Method: createPrintBox
 	 * 
 	 * creates a printBox in the current view, calculates the scale 
@@ -211,8 +227,13 @@
 		that.loadConfig(mbPrintConfigFilenames[0]);
 		/* than we need the translation of the print button */
 		$("#submit").val("<?php echo htmlentities(_mb("print"), ENT_QUOTES, "UTF-8");?>");
-	};
 
+                //destroy printBox if printDialog is closed
+                $("."+myId+"-dialog").bind("dialogclose", function () {
+                    destroyPrintBox();
+                });
+        };
+
 	/**
  	 * Method: loadConfig
 	 * 
@@ -239,17 +260,20 @@
 	 * utility method to connect the form plugin to the print form.
 	 */	
 	var hookForm = function () {
-		var o = {
+        	var o = {
 	   		url:			'../print/printFactory.php?e_id='+myId,
 	   		type:			'post',
 	   		dataType:		'json',
 	   		beforeSubmit: 	validate,
-	   		success:    	showResult
-                        //timeout:        1,
-                        //error:          function() {
-                        //        showHideWorking("hide");
-                        //}
+	   		success:    	showResult,
+                        timeout:        options.timeout ? options.timeout : 90000,
+                        error:          function() {
+                                showHideWorking("hide");
+                                alert("Timeout of " + Math.round(options.timeout/1000) + " seconds reached. Print was aborted.");
+                                destroyPrintBox();
+                        }
 		};
+                
 		$("#"+myId+"_form").ajaxForm(o);
 	};
 	
@@ -534,12 +558,12 @@
 				if (e.keyCode === 13) {
 					return false;
 				}
-			}).keyup(function (e) {
+			}).blur(function (e) {
 				if (e.keyCode === 13) {
 					return false;
 				}
 				var scale = parseInt(this.value, 10);
-				if (isNaN(scale) || typeof printBox === "undefined") {
+                                if (isNaN(scale) || typeof printBox === "undefined") {
 					return true;
 				}
 				printBox.setScale(scale);

Modified: branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.1_to_2.7.2_pgsql_UTF-8.sql
===================================================================
--- branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.1_to_2.7.2_pgsql_UTF-8.sql	2011-07-08 09:50:53 UTC (rev 7925)
+++ branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.1_to_2.7.2_pgsql_UTF-8.sql	2011-07-11 12:43:46 UTC (rev 7926)
@@ -78,15 +78,16 @@
 NOT IN (SELECT fkey_gui_id FROM gui_element_vars
 WHERE var_name = 'logRequests' AND fkey_e_id = 'printPDF');
 
--- new element var logRequests for gui element template printPDF
+-- new element var logType for gui element template printPDF
 INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
 SELECT gui_element.fkey_gui_id, 'printPDF', 'logType', 'file', 'log mode can be set to file or db' ,'php_var'
 FROM gui_element WHERE gui_element.e_id = 'printPDF' AND gui_element.e_js_file = '../plugins/mb_print.php' AND gui_element.fkey_gui_id
 NOT IN (SELECT fkey_gui_id FROM gui_element_vars
 WHERE var_name = 'logType' AND fkey_e_id = 'printPDF');
 
---
--- mb_metadata
--- new column responsible_party_name
--- 
-ALTER TABLE mb_metadata ADD COLUMN responsible_party_name character varying(100);
+-- new element var timeout for gui element template printPDF
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
+SELECT gui_element.fkey_gui_id, 'printPDF', 'timeout', '90000', 'define maximum seconds to wait for print request finished' ,'var'
+FROM gui_element WHERE gui_element.e_id = 'printPDF' AND gui_element.e_js_file = '../plugins/mb_print.php' AND gui_element.fkey_gui_id
+NOT IN (SELECT fkey_gui_id FROM gui_element_vars
+WHERE var_name = 'timeout' AND fkey_e_id = 'printPDF');



More information about the Mapbender_commits mailing list