dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #03492
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1170: (GIS) Auto-assignment now doesn't crash because of poor shapefiles (duplicated organisation units).
------------------------------------------------------------
revno: 1170
committer: admin <admin@laptop>
branch nick: trunk
timestamp: Sat 2009-12-05 18:23:03 +0100
message:
(GIS) Auto-assignment now doesn't crash because of poor shapefiles (duplicated organisation units).
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.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 2009-12-02 14:46:45 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2009-12-05 17:23:03 +0000
@@ -3191,8 +3191,6 @@
var organisationUnits = Ext.util.JSON.decode(responseText).organisationUnits;
var nameColumn = MAPDATA.nameColumn;
var mlp = MAPDATA.mapLayerPath;
- var count_features = 0;
- var count_orgunits = 0;
var count_match = 0;
var relations = '';
var featureName, orgunitName;
@@ -3205,10 +3203,10 @@
organisationUnits[i].compareName = organisationUnits[i].name.split(' ').join('').toLowerCase();
}
- for ( var j=0; j < features.length; j++ ) {
- for ( var i=0; i < organisationUnits.length; i++ ) {
+ for ( var i=0; i < organisationUnits.length; i++ ) {
+ for ( var j=0; j < features.length; j++ ) {
if (features[j].attributes.compareName == organisationUnits[i].compareName) {
- count_match++;
+ count_match++;
relations += organisationUnits[i].id + '::' + features[j].attributes[nameColumn] + ';;';
break;
}