dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19934
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8907: (GIS) Add to dashboard button + Map loader bug fixed + Table alteror update.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 8907 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-11-06 17:28:00 +0300
message:
(GIS) Add to dashboard button + Map loader bug fixed + Table alteror update.
added:
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/images/grid-dashboard_16.png
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/widgets/geostat/Thematic1.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/widgets/geostat/Thematic2.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/styles/style.css
--
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-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2012-11-04 09:06:31 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2012-11-06 14:23:42 +0000
@@ -83,6 +83,7 @@
executeSql( "DROP TABLE sectionmembers" );
executeSql( "DROP TABLE reporttable_categoryoptioncombos" );
executeSql( "DROP TABLE dashboardcontent_datamartexports" );
+ executeSql( "DROP TABLE dashboardcontent_mapview" );
executeSql( "DROP TABLE customvalue" );
executeSql( "DROP TABLE reporttable_displaycolumns" );
executeSql( "DROP TABLE reportreporttables" );
=== added file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/images/grid-dashboard_16.png'
Binary files dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/images/grid-dashboard_16.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/images/grid-dashboard_16.png 2012-11-06 12:22:24 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js 2012-11-06 06:05:58 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js 2012-11-06 14:23:42 +0000
@@ -1818,9 +1818,10 @@
{
dataIndex: 'name',
sortable: false,
- width: 355,
+ width: 335,
renderer: function(value, metaData, record) {
var fn = function() {
+console.log(record.data.id, record.data.name, Ext.get(record.data.id));
var el = Ext.get(record.data.id).parent('td');
el.addClsOnOver('link');
el.dom.setAttribute('onclick', 'GIS.cmp.mapWindow.destroy(); GIS.map.mapLoader = new GIS.obj.MapLoader("' + record.data.id + '"); GIS.map.mapLoader.load();');
@@ -1834,12 +1835,12 @@
{
xtype: 'actioncolumn',
sortable: false,
- width: 65,
+ width: 85,
items: [
{
iconCls: 'gis-grid-row-icon-edit',
getClass: function() {
- return 'tooltip-map-edit'; // tooltips removed if deleteArray is empty
+ return 'tooltip-map-edit';
},
handler: function(grid, rowIndex, colIndex, col, event) {
var record = this.up('grid').store.getAt(rowIndex),
@@ -1857,7 +1858,7 @@
{
iconCls: 'gis-grid-row-icon-overwrite',
getClass: function() {
- return 'tooltip-map-overwrite'; // tooltips removed if deleteArray is empty
+ return 'tooltip-map-overwrite';
},
handler: function(grid, rowIndex, colIndex, col, event) {
var record = this.up('grid').store.getAt(rowIndex),
@@ -1909,8 +1910,29 @@
}
},
{
+ iconCls: 'gis-grid-row-icon-dashboard',
+ getClass: function() {
+ return 'tooltip-map-dashboard';
+ },
+ handler: function(grid, rowIndex) {
+ var record = this.up('grid').store.getAt(rowIndex),
+ id = record.data.id,
+ name = record.data.name,
+ message = 'Add to dashboard?\n\n' + name;
+
+ if (confirm(message)) {
+ Ext.Ajax.request({
+ url: GIS.conf.url.path_gis + 'addMapViewToDashboard.action',
+ params: {
+ id: id
+ }
+ });
+ }
+ }
+ },
+ {
iconCls: 'gis-grid-row-icon-delete',
- getClass: function(value, metaData, record) { // all tooltips removed if deleteArray is empty
+ getClass: function(value, metaData, record) {
var system = !record.data.user,
isAdmin = GIS.init.security.isAdmin;
@@ -1964,11 +1986,11 @@
var fn = function() {
var editArray = document.getElementsByClassName('tooltip-map-edit'),
overwriteArray = document.getElementsByClassName('tooltip-map-overwrite'),
+ dashboardArray = document.getElementsByClassName('tooltip-map-dashboard'),
deleteArray = document.getElementsByClassName('tooltip-map-delete'),
- len = deleteArray.length,
el;
- for (var i = 0; i < len; i++) {
+ for (var i = 0; i < deleteArray.length; i++) {
el = editArray[i];
Ext.create('Ext.tip.ToolTip', {
target: el,
@@ -1995,6 +2017,17 @@
anchorOffset: -14,
showDelay: 1000
});
+ }
+
+ for (var i = 0; i < dashboardArray.length; i++) {
+ el = dashboardArray[i];
+ Ext.create('Ext.tip.ToolTip', {
+ target: el,
+ html: 'Add to dashboard',
+ 'anchor': 'bottom',
+ anchorOffset: -14,
+ showDelay: 1000
+ });
}
};
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/widgets/geostat/Thematic1.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/widgets/geostat/Thematic1.js 2012-11-06 07:41:32 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/widgets/geostat/Thematic1.js 2012-11-06 14:08:43 +0000
@@ -390,12 +390,7 @@
var store = this.cmp.dataElement.store;
store.proxy.url = GIS.conf.url.path_api + 'dataElementGroups/' + cb.getValue() + '.json?links=false&paging=false';
- store.load({
- scope: this,
- callback: function() {
- this.cmp.dataElement.selectFirst();
- }
- });
+ store.load();
}
}
}
@@ -470,8 +465,6 @@
this.store.periodsByType.setIndex(periods);
this.store.periodsByType.loadData(periods);
-
- this.cmp.period.selectFirst();
}
}
}
@@ -487,11 +480,6 @@
width: GIS.conf.layout.widget.item_width,
labelWidth: GIS.conf.layout.widget.itemlabel_width,
store: this.store.periodsByType,
- scope: this,
- selectFirst: function() {
- this.setValue(this.store.getAt(0).data.id);
- this.scope.config.extended.updateData = true;
- },
listeners: {
select: {
scope: this,
@@ -1511,7 +1499,7 @@
updateLegend: Ext.isDefined(conf.extended.updateLegend) ? conf.extended.updateLegend : false,
updateGui: Ext.isDefined(conf.extended.updateGui) ? conf.extended.updateGui : false
};
-console.log(view);
+
return view;
},
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/widgets/geostat/Thematic2.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/widgets/geostat/Thematic2.js 2012-11-06 07:41:32 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/widgets/geostat/Thematic2.js 2012-11-06 14:08:43 +0000
@@ -390,12 +390,7 @@
var store = this.cmp.dataElement.store;
store.proxy.url = GIS.conf.url.path_api + 'dataElementGroups/' + cb.getValue() + '.json?links=false&paging=false';
- store.load({
- scope: this,
- callback: function() {
- this.cmp.dataElement.selectFirst();
- }
- });
+ store.load();
}
}
}
@@ -1511,7 +1506,7 @@
updateLegend: Ext.isDefined(conf.extended.updateLegend) ? conf.extended.updateLegend : false,
updateGui: Ext.isDefined(conf.extended.updateGui) ? conf.extended.updateGui : false
};
-console.log(view);
+
return view;
},
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/styles/style.css'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/styles/style.css 2012-11-04 10:23:39 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/styles/style.css 2012-11-06 09:06:22 +0000
@@ -433,6 +433,7 @@
.gis-grid-row-icon-edit,
.gis-grid-row-icon-overwrite,
+.gis-grid-row-icon-dashboard,
.gis-grid-row-icon-delete {
width: 16px;
height: 16px;
@@ -445,11 +446,17 @@
background: url('../images/grid-save_16.png') no-repeat;
margin-left: 4px;
}
+.gis-grid-row-icon-dashboard {
+ background: url('../images/grid-dashboard_16.png') no-repeat;
+ margin-left: 4px;
+}
.gis-grid-row-icon-delete {
background: url('../images/grid-delete_16.png') no-repeat;
margin-left: 4px;
}
-.gis-grid-row-icon-disabled img {
+.gis-grid-row-icon-disabled img.gis-grid-row-icon-edit,
+.gis-grid-row-icon-disabled img.gis-grid-row-icon-overwrite
+.gis-grid-row-icon-disabled img.gis-grid-row-icon-delete {
opacity: 0;
filter:Alpha(opacity=0);
}