← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1454: (GIS) Multi page PDF print implemented. Lets you add an unlimited number of screenshots to the sa...

 

------------------------------------------------------------
revno: 1454
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-02-19 14:14:12 +0100
message:
  (GIS) Multi page PDF print implemented. Lets you add an unlimited number of screenshots to the same PDF document.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/print/BaseWidget.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/print/MultiPage.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-02-18 19:26:45 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-02-19 13:14:12 +0000
@@ -2727,14 +2727,14 @@
 	});
 	
 	function showPdf() {
-		var printSimplePagePanel = Ext.getCmp('printSinglePage_p');
-		if (printSimplePagePanel.hidden) {
-            printSimplePagePanel.show();
-			printSimplePagePanel.expand();
+		var printMultiPagePanel = Ext.getCmp('printMultiPage_p');
+		if (printMultiPagePanel.hidden) {
+            printMultiPagePanel.show();
+			printMultiPagePanel.expand();
         }
         else {
-			printSimplePagePanel.collapse();
-			printSimplePagePanel.hide();
+			printMultiPagePanel.collapse();
+			printMultiPagePanel.hide();
 			choropleth.expand();
         }
 	}	
@@ -2895,35 +2895,30 @@
                     mapLayerPanel,
 					adminPanel,
 					{
-						xtype: 'print-simple',
-						id: 'printSinglePage_p',
-						title: '<font style="' + AA_DARK + '">Print map as PDF</font>',
+						xtype: 'print-multi',
+						id: 'printMultiPage_p',
+						title: '<font style="' + AA_DARK + '">Print multi page PDF</font>',
 						formConfig: {
 							labelWidth: 65,
+							bodyStyle: 'padding: 7px;',
 							defaults: {
 								width: 140,
 								listWidth: 140
+							}
+						},
+						columns: [
+							{
+								header: 'Map title',
+								width: 80,
+								dataIndex: 'mapTitle',
+								editor: new Ext.form.TextField()
 							},
-							items: [
-								{
-									xtype: 'textfield',
-									fieldLabel: 'Map title',
-									name: 'mapTitle',
-									labelStyle: AA_LIGHT,
-									labelSeparator: MENU_LABELSEPARATOR,
-									width: combo_width,
-								},
-								{
-									xtype: 'textarea',
-									fieldLabel: 'Comment',
-									name: 'comment',
-									height: 100,
-									labelStyle: AA_LIGHT,
-									labelSeparator: MENU_LABELSEPARATOR,
-									width: combo_width,
-								}
-							]
-						},
+							{
+								header: 'Comment',
+								dataIndex: 'comment',
+								editor: new Ext.form.TextField()
+							}
+						],
 						border: false,
 						map: MAP,
 						configUrl: printConfigUrl,
@@ -2948,7 +2943,7 @@
     shapefilePanel.hide();
 	mapping.hide();
     mapLayerPanel.hide();
-	Ext.getCmp('printSinglePage_p').hide();
+	Ext.getCmp('printMultiPage_p').hide();
     
 	/* MAP CONTROLS */
 	var selectFeatureChoropleth = new OpenLayers.Control.newSelectFeature(

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/print/BaseWidget.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/print/BaseWidget.js	2010-02-18 17:01:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/print/BaseWidget.js	2010-02-19 13:14:12 +0000
@@ -539,7 +539,7 @@
             });
 
             return {
-                fieldLabel: OpenLayers.Lang.translate('mf.print.dpi'),
+                fieldLabel: 'Dots per inch',
                 xtype: 'combo',
                 store: dpiStore,
                 displayField: 'name',
@@ -555,7 +555,7 @@
                 name: name,
                 editable: false,
                 triggerAction: 'all',
-                value: this.config.dpis[0].value
+                value: this.config.dpis[3].value
             };
         } else {
             return {

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/print/MultiPage.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/print/MultiPage.js	2010-02-18 17:01:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/print/MultiPage.js	2010-02-19 13:14:12 +0000
@@ -144,9 +144,12 @@
         formPanel.add(layout);
 
         formPanel.add(this.createDpiCombo("dpi"));
+        formPanel.getComponent(1).setWidth(122);
 
         this.printButton = formPanel.addButton({
-            text: OpenLayers.Lang.translate('mf.print.print'),
+            text: 'Print PDF',
+            cls: 'aa_med',
+            style: 'margin:-5px 0px 0px 36px',
             scope: this,
             handler: this.print,
             disabled: true
@@ -176,7 +179,8 @@
         var rotation = this.createRotationTextField();
         if (rotation != null) {
             columns.push({
-                header: OpenLayers.Lang.translate('mf.print.rotation'),
+                header: 'Rot.',
+                width: 45,
                 dataIndex: 'rotation',
                 editor: rotation,
                 id: this.getId() + '_rotation',
@@ -216,11 +220,13 @@
             bbar: [
                 {
                     text: OpenLayers.Lang.translate('mf.print.addPage'),
+                    cls: 'aa_med',
                     scope: this,
                     handler: this.addPage
                 },
                 {
                     text: OpenLayers.Lang.translate('mf.print.remove'),
+                    cls: 'aa_med',
                     scope: this,
                     handler: this.removeSelected,
                     id: this.getId() + "_remove",
@@ -228,6 +234,7 @@
                 },
                 {
                     text: OpenLayers.Lang.translate('mf.print.clearAll'),
+                    cls: 'aa_med',
                     scope: this,
                     handler: this.clearPages
                 }