← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9028: (GIS) Legend sets for admins only + (DV) Theme update.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 9028 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-11-14 15:56:55 +0100
message:
  (GIS) Legend sets for admins only + (DV) Theme update.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.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/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2012-11-13 16:07:36 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2012-11-14 14:46:41 +0000
@@ -1802,7 +1802,7 @@
 						}
 					}
 					else {
-						alert('No layers to save');
+						alert('Please create a map first');
 					}
 				}
 			});
@@ -2250,7 +2250,7 @@
 				lonLat;
 				
 			if (!views.length) {
-				alert('Favorite has no layers'); //i18n
+				alert('Favorite has no layers (probably outdated)'); //i18n
 				return;
 			}
 			GIS.util.map.closeAllLayers();
@@ -3414,35 +3414,36 @@
                 region: 'center',
                 map: GIS.map,
                 height: 31,
-                cmp: {
+				cmp: {
 					tbar: {}
 				},
                 tbar: {
 					defaults: {
 						height: 26
 					},
-					items: [
-						{
+					items: function() {
+						var a = [];
+						a.push({
 							iconCls: 'gis-btn-icon-' + GIS.base.boundary.id,
 							menu: GIS.base.boundary.menu,
 							width: 26
-						},
-						{
+						});
+						a.push({
 							iconCls: 'gis-btn-icon-' + GIS.base.thematic1.id,
 							menu: GIS.base.thematic1.menu,
 							width: 26
-						},
-						{
+						});
+						a.push({
 							iconCls: 'gis-btn-icon-' + GIS.base.thematic2.id,
-							menu: GIS.obj.LayerMenu(GIS.base.thematic2),
+							menu: GIS.base.thematic2.menu,
 							width: 26
-						},
-						{
+						});
+						a.push({
 							iconCls: 'gis-btn-icon-' + GIS.base.facility.id,
-							menu: GIS.obj.LayerMenu(GIS.base.facility),
+							menu: GIS.base.facility.menu,
 							width: 26
-						},
-						{
+						});
+						a.push({
 							text: 'Favorites', //i18n
 							menu: {},
 							handler: function() {
@@ -3453,25 +3454,27 @@
 								GIS.cmp.mapWindow = GIS.obj.MapWindow();
 								GIS.cmp.mapWindow.show();
 							}
-						},
-						{
-							text: 'Legend', //i18n
-							menu: {},
-							handler: function() {
-								if (GIS.cmp.legendSetWindow && GIS.cmp.legendSetWindow.destroy) {
-									GIS.cmp.legendSetWindow.destroy();
+						});
+						if (GIS.init.security.isAdmin) {
+							a.push({
+								text: 'Legend', //i18n
+								menu: {},
+								handler: function() {
+									if (GIS.cmp.legendSetWindow && GIS.cmp.legendSetWindow.destroy) {
+										GIS.cmp.legendSetWindow.destroy();
+									}
+									
+									GIS.cmp.legendSetWindow = GIS.obj.LegendSetWindow();
+									GIS.cmp.legendSetWindow.show();
 								}
-								
-								GIS.cmp.legendSetWindow = GIS.obj.LegendSetWindow();
-								GIS.cmp.legendSetWindow.show();
-							}
-						},
-						{
+							});
+						}
+						a.push({
 							xtype: 'tbseparator',
 							height: 18,
 							style: 'border-color: transparent #d1d1d1 transparent transparent; margin-right: 4px',
-						},
-						{
+						});
+						a.push({
 							text: 'Download', //i18n
 							menu: {},
 							disabled: true,
@@ -3496,8 +3499,8 @@
 									GIS.cmp.downloadButton = this;
 								}
 							}
-						},
-						{
+						});
+						a.push({
 							text: 'Share', //i18n
 							menu: {},
 							disabled: true,
@@ -3514,15 +3517,15 @@
 									GIS.cmp.interpretationButton = this;
 								}
 							}
-						},
-						'->',
-						{
+						});
+						a.push('->');
+						a.push({
 							text: 'Exit', //i18n
 							handler: function() {								
-                                window.location.href = '../../dhis-web-commons-about/redirect.action';
+								window.location.href = '../../dhis-web-commons-about/redirect.action';
 							}
-						},
-						{
+						});
+						a.push({
 							text: '>>>', //i18n
 							handler: function() {
 								GIS.cmp.region.east.toggleCollapse();
@@ -3532,9 +3535,9 @@
 									GIS.cmp.region.center.cmp.tbar.resize = this;
 								}
 							}
-						}
-						
-					]
+						});
+						return a;
+					}()
 				},
 				listeners: {
 					added: function() {

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2012-11-13 15:50:05 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2012-11-14 14:54:37 +0000
@@ -220,7 +220,7 @@
             font: 'arial,sans-serif,ubuntu,consolas'
         },
         theme: {
-            dv1: ['#94ae0a', '#0b3b68', '#a61120', '#ff8809', '#7c7474', '#a61187', '#ffd13e', '#24ad9a', '#a66111', '#414141', '#4500c4', '#1d5700']
+            dv1: ['#0b3b68', '#a61120', '#ff8809', '#94ae0a', '#7c7474', '#ffd13e', '#24ad9a', '#a66111', '#414141', '#4500c4', '#1d5700']
         }
     },
     statusbar: {