dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04573
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1529: (GIS) Embedded help for the left side panels implemented.
------------------------------------------------------------
revno: 1529
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-03-02 12:58:13 +0100
message:
(GIS) Embedded help for the left side panels implemented.
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/config.js
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/core/GeoStat.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.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/css/style.css'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css 2010-02-24 17:19:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css 2010-03-02 11:58:13 +0000
@@ -7,7 +7,7 @@
/* MAPPING GRID */
.row-assigned {
- background-color:#b1ffa1;
+ background-color:#90ee90;
}
.row-unassigned {
@@ -56,6 +56,10 @@
background-image:url(../../../images/pdf.png);
}
+.x-btn .icon-help {
+ background-image:url(../../../images/help.png);
+}
+
.aa_dark button {
font-family:lucida sans unicode, arial;
font-weight:normal;
@@ -89,39 +93,43 @@
/* DIALOGUE BOX */
.window-info {
- font-family:lucida sans unicode,arial;
- font-weight:normal;
- font-size:11px;
- color:#333;
padding:0 0 8px 0;
+ font:normal 11px lucida sans unicode,arial;
+ color: #333;
}
.window-field-label-first {
padding:0px 0 3px 3px;
- font-family:lucida sans unicode,arial;
- font-weight:normal;
- font-size:11px;
+ font:normal 11px lucida sans unicode,arial;
color:#888;
}
.window-field-label {
padding:8px 0 3px 3px;
- font-family:lucida sans unicode,arial;
- font-weight:normal;
- font-size:11px;
+ font:normal 11px lucida sans unicode,arial;
color:#888;
}
.window-button {
padding:8px 0 0 0;
}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+/* HELP */
+
+#help {
+ padding:0px 8px 8px 8px;
+}
+
+#help h3 {
+ padding:8px 0 0 0;
+ font:bold 11px arial;
+ color:#333;
+ letter-spacing:0px;
+}
+
+#help p {
+ padding:4px 0 4px 0;
+ font:normal 11px lucida sans unicode,arial;
+ color:#333;
+}
+
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html 2010-02-25 13:42:48 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html 2010-03-02 11:58:13 +0000
@@ -44,10 +44,11 @@
<!-- MapFish -->
<script type="text/javascript" src="../resources/mapfish/MapFish.js"></script>
- <!-- DHIS2 -->
+ <!-- GIS -->
<script type="text/javascript" src="script/config.js"></script>
<script type="text/javascript" src="script/index.js"></script>
+
</head>
<body>
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/config.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/config.js 2010-02-24 14:11:32 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/config.js 2010-03-02 11:58:13 +0000
@@ -19,7 +19,17 @@
path_geoserver = '../../../geoserver/';
ows = 'ows?service=WMS&request=GetCapabilities';
wfs = 'wfs?request=GetFeature&typename=';
- output = '&outputformat=json&version=1.0.0';
+ output = '&outputformat=json&version=1.0.0';
+
+// Help strings
+
+ thematicMap = 'thematicMap';
+ mapRegistration = 'map';
+ organisationUnitAssignment = 'mapOrganisationUnitRelation';
+ overlayRegistration = 'overlay';
+ administration = 'administration';
+ favorites = 'favoriteMapView';
+ legendSets = 'legendSet';
// Layout
@@ -57,7 +67,8 @@
AA_LIGHT = 'font-family:lucida sans unicode,arial; font-weight:normal; font-size:11px; color:#888; letter-spacing:0px;';
LABEL = 'padding-bottom:2px; padding-left:3px;';
- ASSIGNED_ROW_COLOR = '#b1ffa1';
+ // ASSIGNED_ROW_COLOR = '#b1ffa1';
+ ASSIGNED_ROW_COLOR = '#90ee90';
UNASSIGNED_ROW_COLOR = '#ffffff';
// Ext.message
=== 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-25 16:35:57 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2010-03-02 11:58:13 +0000
@@ -9,7 +9,7 @@
var MAPVIEW;
var PARAMETER;
var BOUNDS = 0;
-var ACTIVEPANEL = 'choropleth';
+var ACTIVEPANEL;
var MAP_SOURCE_TYPE_DATABASE = 'database';
var MAP_SOURCE_TYPE_GEOJSON = 'geojson';
var MAP_SOURCE_TYPE_SHAPEFILE = 'shapefile';
@@ -97,10 +97,10 @@
activateLabels();
}
- if (ACTIVEPANEL == 'choropleth') {
+ if (ACTIVEPANEL == thematicMap) {
choropleth.classify(false, true);
}
- else if (ACTIVEPANEL == 'mapping') {
+ else if (ACTIVEPANEL == organisationUnitAssignment) {
mapping.classify(false, true);
}
}
@@ -1894,6 +1894,13 @@
mapLayerPathComboBox.show();
mapLayerPathWMSTextField.hide();
}
+
+ ACTIVEPANEL = mapRegistration;
+ }
+ },
+ collapse: {
+ fn: function() {
+ ACTIVEPANEL = false;
}
}
}
@@ -2286,6 +2293,13 @@
mapLayerMapSourceFileComboBox.hide();
mapLayerPathWMSOverlayTextField.show();
}
+
+ ACTIVEPANEL = overlayRegistration;
+ }
+ },
+ collapse: {
+ fn: function() {
+ ACTIVEPANEL = false;
}
}
}
@@ -2514,8 +2528,15 @@
else if (MAPSOURCE == MAP_SOURCE_TYPE_DATABASE) {
Ext.getCmp('register_chb').disable();
}
+
+ ACTIVEPANEL = administration;
}
- }
+ },
+ collapse: {
+ fn: function() {
+ ACTIVEPANEL = false;
+ }
+ }
}
});
@@ -2638,9 +2659,14 @@
choroplethLayer.setVisibility(false);
choropleth.classify(false);
- ACTIVEPANEL = 'choropleth';
+ ACTIVEPANEL = thematicMap;
}
- }
+ },
+ collapse: {
+ fn: function() {
+ ACTIVEPANEL = false;
+ }
+ }
}
});
@@ -2659,9 +2685,14 @@
choroplethLayer.setVisibility(false);
mapping.classify(false);
- ACTIVEPANEL = 'mapping';
+ ACTIVEPANEL = organisationUnitAssignment;
}
- }
+ },
+ collapse: {
+ fn: function() {
+ ACTIVEPANEL = false;
+ }
+ }
}
});
@@ -2706,26 +2737,24 @@
}
});
- function showFavorites() {
- var x = Ext.getCmp('center').x + 15;
- var y = Ext.getCmp('center').y + 41;
- viewWindow.setPosition(x,y);
-
- if (viewWindow.visible) {
- viewWindow.hide();
- }
- else {
- viewWindow.show();
- }
- }
-
var favoritesButton = new Ext.Button({
cls: 'x-btn-text-icon',
ctCls: 'aa_med',
icon: '../../images/favorite_star2.png',
text: 'Favorites',
tooltip: 'Favorite map views',
- handler: showFavorites
+ handler: function() {
+ var x = Ext.getCmp('center').x + 15;
+ var y = Ext.getCmp('center').y + 41;
+ viewWindow.setPosition(x,y);
+
+ if (viewWindow.visible) {
+ viewWindow.hide();
+ }
+ else {
+ viewWindow.show();
+ }
+ }
});
function showPdf() {
@@ -2755,21 +2784,43 @@
icon: '../../images/color_swatch.png',
text: 'Legend sets',
tooltip: 'Assign legend sets to indicators',
- handler: showLegendSets
- });
-
- function showLegendSets() {
- var x = Ext.getCmp('center').x + 15;
- var y = Ext.getCmp('center').y + 41;
- legendSetWindow.setPosition(x,y);
-
- if (legendSetWindow.visible) {
- legendSetWindow.hide();
- }
- else {
- legendSetWindow.show();
- }
- }
+ handler: function() {
+ var x = Ext.getCmp('center').x + 15;
+ var y = Ext.getCmp('center').y + 41;
+ legendSetWindow.setPosition(x,y);
+
+ if (legendSetWindow.visible) {
+ legendSetWindow.hide();
+ }
+ else {
+ legendSetWindow.show();
+ }
+ }
+ });
+
+ var helpButton = new Ext.Button({
+ iconCls: 'icon-help',
+ tooltip: 'Get help for the active panel',
+ handler: function() {
+
+ Ext.Ajax.request({
+ url: '../../dhis-web-commons-about/getHelpContent.action',
+ method: 'POST',
+ params: { id: ACTIVEPANEL },
+ success: function(r) {
+ var h = new Ext.Window({
+ title: '<span style="' + AA_DARK + '">Help</span>',
+ html: '<div id="help">' + r.responseText + '</div>',
+ width: 300,
+ height: 400,
+ autoScroll: true,
+ });
+ h.show();
+ },
+ failure: function() {}
+ });
+ }
+ });
var exitButton = new Ext.Button({
text: 'Exit GIS',
@@ -2798,6 +2849,8 @@
'-',
favoritesButton,
legendSetButton,
+ '-',
+ helpButton,
'->',
exitButton
]
@@ -2916,6 +2969,7 @@
],
border: false,
map: MAP,
+ layerTree: layerTree,
configUrl: printConfigUrl,
overrides: layerOverrides
}
@@ -2938,6 +2992,7 @@
shapefilePanel.hide();
mapping.hide();
mapLayerPanel.hide();
+ ACTIVEPANEL = thematicMap;
Ext.getCmp('printMultiPage_p').hide();
/* MAP CONTROLS */
@@ -3010,13 +3065,12 @@
}
});
-
function onHoverSelectChoropleth(feature) {
if (MAPDATA != null) {
- if (ACTIVEPANEL == 'choropleth') {
+ if (ACTIVEPANEL == thematicMap) {
Ext.getCmp('featureinfo_l').setText('<span style="color:black">' + feature.attributes[MAPDATA.nameColumn] + '</span><br><span style="color:#555">' + feature.attributes.value + '</span>', false);
}
- else if (ACTIVEPANEL == 'mapping') {
+ else if (ACTIVEPANEL == organisationUnitAssignment) {
Ext.getCmp('featureinfo_l').setText('<span style="color:black">' + feature.attributes[MAPDATA.nameColumn] + '</span>', false);
}
}
@@ -3031,7 +3085,7 @@
var x = east_panel.x - 210;
var y = east_panel.y + 41;
- if (ACTIVEPANEL == 'mapping') {
+ if (ACTIVEPANEL == organisationUnitAssignment) {
feature_popup.html = '<p style="margin-top: 5px; padding-left:5px; padding-bottom:3px; ' + AA_MED + '">' + feature.attributes[MAPDATA.nameColumn] + '</p>';
feature_popup.x = x;
feature_popup.y = y;
@@ -3052,7 +3106,6 @@
url: path + 'getMapByMapLayerPath' + type,
method: 'POST',
params: { mapLayerPath: URL, format: 'json' },
-
success: function( responseObject ) {
MAPDATA = Ext.util.JSON.decode(responseObject.responseText).map[0];
@@ -3084,9 +3137,9 @@
toggleFeatureLabels(false);
- if (redirect == 'choropleth') {
+ if (redirect == thematicMap) {
getChoroplethData(); }
- else if (redirect == 'assignment') {
+ else if (redirect == organisationUnitAssignment) {
getAssignOrganisationUnitData(); }
else if (redirect == 'auto-assignment') {
getAutoAssignOrganisationUnitData(position); }
@@ -3326,7 +3379,7 @@
Ext.messageBlack.msg('Assign organisation units', '' + msg_highlight_start + count_match + msg_highlight_end + ' organisation units assigned.<br><br>Database: ' + msg_highlight_start + organisationUnits.length + msg_highlight_end + '<br>Shapefile: ' + msg_highlight_start + features.length + msg_highlight_end);
Ext.getCmp('grid_gp').getStore().reload();
- loadMapData('assignment', position);
+ loadMapData(organisationUnitAssignment, position);
},
failure: function() {
alert( 'Error: addOrUpdateMapOrganisationUnitRelations' );
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js 2010-02-25 16:35:57 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js 2010-03-02 11:58:13 +0000
@@ -362,7 +362,7 @@
* nBins - {Integer} Total number of bins
*/
defaultLabelGenerator: function(bin, binIndex, nbBins) {
- if (ACTIVEPANEL == 'mapping') {
+ if (ACTIVEPANEL == organisationUnitAssignment) {
if (bin.upperBound < 1) {
return 'Available' + ' ( ' + bin.nbVal + ' )';
}
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2010-02-25 16:35:57 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2010-03-02 11:58:13 +0000
@@ -753,7 +753,7 @@
MASK.msg = 'Loading data...';
MASK.show();
- loadMapData('choropleth', position);
+ loadMapData(thematicMap, position);
},
/**
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js 2010-02-24 16:36:32 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js 2010-03-02 11:58:13 +0000
@@ -386,7 +386,7 @@
Ext.messageBlack.msg('Assign organisation units', msg_highlight_start + mapping.relation + msg_highlight_end + ' (map) assigned to ' + msg_highlight_start + name + msg_highlight_end + ' (database).');
Ext.getCmp('grid_gp').getStore().reload();
feature_popup.hide();
- loadMapData('assignment', true);
+ loadMapData(organisationUnitAssignment, true);
},
failure: function() {
alert( 'Error: addOrUpdateMapOrganisationUnitRelation' );
@@ -488,7 +488,7 @@
MASK.msg = 'Loading data...';
MASK.show();
- loadMapData('assignment', position);
+ loadMapData(organisationUnitAssignment, position);
},
/**