dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27900
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13899: GIS, facility info improved + request migrated to api.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 13899 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-01-30 15:43:45 +0100
message:
GIS, facility info improved + request migrated to api.
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm
--
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/resources/org/hisp/dhis/mapping/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties 2013-12-09 11:30:45 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties 2014-01-30 14:43:05 +0000
@@ -401,4 +401,5 @@
financial_april=Financial April
relative=Relative
reporting_rates=Reporting rates
-event_layer=Event layer
\ No newline at end of file
+event_layer=Event layer
+coordinate=Coordinate
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js 2014-01-30 14:13:24 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js 2014-01-30 14:43:05 +0000
@@ -272,10 +272,7 @@
// Infrastructural data
showInfo = function() {
Ext.Ajax.request({
- url: gis.init.contextPath + gis.conf.finals.url.path_module + 'getFacilityInfo.action',
- params: {
- id: att.id
- },
+ url: gis.init.contextPath + '/api/organisationUnits/' + att.id + '.json?links=false',
success: function(r) {
var ou = Ext.decode(r.responseText);
@@ -303,29 +300,41 @@
a.push({html: GIS.i18n.name, cls: 'gis-panel-html-title'}, {html: att.name, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
}
- if (ou.pa) {
- a.push({html: GIS.i18n.parent_unit, cls: 'gis-panel-html-title'}, {html: ou.pa, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
- }
-
- if (ou.ty) {
- a.push({html: GIS.i18n.type, cls: 'gis-panel-html-title'}, {html: ou.ty, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
- }
-
- if (ou.co) {
- a.push({html: GIS.i18n.code, cls: 'gis-panel-html-title'}, {html: ou.co, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
- }
-
- if (ou.ad) {
- a.push({html: GIS.i18n.address, cls: 'gis-panel-html-title'}, {html: ou.ad, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
- }
-
- if (ou.em) {
- a.push({html: GIS.i18n.email, cls: 'gis-panel-html-title'}, {html: ou.em, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
- }
-
- if (ou.pn) {
- a.push({html: GIS.i18n.phone_number, cls: 'gis-panel-html-title'}, {html: ou.pn, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
- }
+ if (ou.parent) {
+ a.push({html: GIS.i18n.parent_unit, cls: 'gis-panel-html-title'}, {html: ou.parent.name, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
+ }
+
+ if (ou.code) {
+ a.push({html: GIS.i18n.code, cls: 'gis-panel-html-title'}, {html: ou.code, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
+ }
+
+ if (ou.address) {
+ a.push({html: GIS.i18n.address, cls: 'gis-panel-html-title'}, {html: ou.address, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
+ }
+
+ if (ou.email) {
+ a.push({html: GIS.i18n.email, cls: 'gis-panel-html-title'}, {html: ou.email, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
+ }
+
+ if (ou.phoneNumber) {
+ a.push({html: GIS.i18n.phone_number, cls: 'gis-panel-html-title'}, {html: ou.phoneNumber, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
+ }
+
+ if (Ext.isString(ou.coordinates)) {
+ var co = ou.coordinates.replace("[","").replace("]","").replace(",",", ");
+ a.push({html: GIS.i18n.coordinate, cls: 'gis-panel-html-title'}, {html: co, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
+ }
+
+ if (Ext.isArray(ou.organisationUnitGroups) && ou.organisationUnitGroups.length) {
+ var html = '';
+
+ for (var i = 0; i < ou.organisationUnitGroups.length; i++) {
+ html += ou.organisationUnitGroups[i].name;
+ html += i < ou.organisationUnitGroups.length - 1 ? '<br/>' : '';
+ }
+
+ a.push({html: GIS.i18n.groups, cls: 'gis-panel-html-title'}, {html: html, cls: 'gis-panel-html'}, {cls: 'gis-panel-html-separator'});
+ }
return a;
}()
@@ -350,7 +359,7 @@
valueField: 'id',
displayField: 'name',
forceSelection: true,
- width: 255, //todo
+ width: 258, //todo
labelWidth: 70,
store: gis.store.infrastructuralPeriodsByType,
lockPosition: false,
@@ -374,7 +383,7 @@
xtype: 'grid',
cls: 'gis-grid',
height: 300, //todo
- width: 255,
+ width: 258,
scroll: 'vertical',
columns: [
{
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm 2013-12-09 11:30:45 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm 2014-01-30 14:43:05 +0000
@@ -443,7 +443,8 @@
"financial_april": "$encoder.jsEscape($i18n.getString( 'financial_april' ) , "'")",
"relative": "$encoder.jsEscape($i18n.getString( 'relative' ) , "'")",
"reporting_rates": "$encoder.jsEscape($i18n.getString( 'reporting_rates' ) , "'")",
-"event_layer": "$encoder.jsEscape($i18n.getString( 'event_layer' ) , "'")"
+"event_layer": "$encoder.jsEscape($i18n.getString( 'event_layer' ) , "'")",
+"coordinate": "$encoder.jsEscape($i18n.getString( 'coordinate' ) , "'")"
}
}
#if($callback)