[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19725: added missing reference

2015-08-06 Thread noreply

revno: 19725
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Thu 2015-08-06 11:49:49 +0200
message:
  added missing reference
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-cache-cleaner/index.html


--
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-apps/src/main/webapp/dhis-web-cache-cleaner/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-cache-cleaner/index.html	2015-06-11 09:09:20 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-cache-cleaner/index.html	2015-08-06 09:49:49 +
@@ -22,6 +22,7 @@
   
 
 
+
 
 
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19726: tracker-capture: some refactoring in metadata download

2015-08-06 Thread noreply

revno: 19726
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Thu 2015-08-06 12:10:48 +0200
message:
  tracker-capture: some refactoring in metadata download
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.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-apps/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js	2015-07-15 16:38:42 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js	2015-08-06 10:10:48 +
@@ -1,4 +1,4 @@
-/* global dhis2, angular */
+/* global dhis2, angular, selection, i18n_ajax_login_failed, _ */
 
 dhis2.util.namespace('dhis2.tc');
 
@@ -151,40 +151,28 @@
 promise = promise.then( getMetaProgramIndicators );
 promise = promise.then( getProgramIndicators );
 promise = promise.then( getOrgUnitLevels );
-promise.done(function() {
-
+promise.done(function() {
 //Enable ou selection after meta-data has downloaded
-$( "#orgUnitTree" ).removeClass( "disable-clicks" );
-
+$( "#orgUnitTree" ).removeClass( "disable-clicks" );
 console.log( 'Finished loading meta-data' );
 selection.responseReceived(); 
 });
 
-def.resolve();
-
+def.resolve();
 }
 
 function getUserRoles()
 {
-var SessionStorageService = angular.element('body').injector().get('SessionStorageService');
-
+var SessionStorageService = angular.element('body').injector().get('SessionStorageService');
 if( SessionStorageService.get('USER_ROLES') ){
return; 
 }
 
 var def = $.Deferred();
-
-$.ajax({
-url: '../api/me.json?fields=id,name,userCredentials[userRoles[id,authorities]]',
-type: 'GET'
-}).done(function(response) {
-SessionStorageService.set('USER_ROLES', response);
-def.resolve();
-}).fail(function(){
-def.resolve();
-});
-
-return def.promise();
+var promise = def.promise();
+promise = promise.then( getD2Object(null, 'USER_ROLES', '../api/me.json', 'fields=id,name,userCredentials[userRoles[id,authorities]]', 'sessionStorage') );
+promise = promise.done(function(){});
+def.resolve();
 }
 
 function getCalendarSetting()
@@ -194,18 +182,10 @@
 }
 
 var def = $.Deferred();
-
-$.ajax({
-url: '../api/systemSettings?key=keyCalendar&key=keyDateFormat',
-type: 'GET'
-}).done(function(response) {
-localStorage['CALENDAR_SETTING'] = JSON.stringify(response);
-def.resolve();
-}).fail(function(){
-def.resolve();
-});
-
-return def.promise();
+var promise = def.promise();
+promise = promise.then( getD2Object(null, 'CALENDAR_SETTING', '../api/systemSettings', 'key=keyCalendar&key=keyDateFormat', 'localStorage') );
+promise = promise.done(function(){});
+def.resolve();
 }
 
 function getConstants()
@@ -214,7 +194,7 @@
 if(res.length > 0){
 return;
 }
-return getD2Objects('constants', 'constants', '../api/constants.json', 'paging=false&fields=id,name,displayName,value');
+return getD2Objects('constants', 'constants', '../api/constants.json', 'paging=false&fields=id,name,displayName,value', 'idb');
 });
 }
 
@@ -224,7 +204,7 @@
 if(res.length > 0){
 return;
 }
-return getD2Objects('relationshipTypes', 'relationshipTypes', '../api/relationshipTypes.json', 'paging=false&fields=id,name,aIsToB,bIsToA,displayName');
+return getD2Objects('relationshipTypes', 'relationshipTypes', '../api/relationshipTypes.json', 'paging=false&fields=id,name,aIsToB,bIsToA,displayName', 'idb');
 });
 }
 
@@ -234,25 +214,13 @@
 if(res.length > 0){
 return;
 }
-return getD2Objects('trackedEntities', 'trackedEntities', '../api/trackedEntities.json', 'paging=false&fields=id,name');
+return getD2Objects('trackedEntities', 'trackedEntities', '../api/trackedEntities.json', 'paging=false&fields=id,name', 'idb');
 });
 }
 
 function getMetaPrograms()
 {
-var def = $.Deferred();
-
-$.ajax({
-url: '../api/programs.json',
-type: 'GET',
-data:'filter=programType:eq:WITH_REGISTRATION&paging=false&fields=id,version,programTrackedEntityAttributes[trackedEntityAttribute[id,optionSet[id,version]]],programStages[id,name,version,minDaysFromStart,standardInterval,periodType,generatedByEnrollmentDate,rep

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19727: Option set, trim to null before save

2015-08-06 Thread noreply

revno: 19727
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 14:24:02 +0200
message:
  Option set, trim to null before save
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/constant/AddConstantAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/constant/UpdateConstantAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/option/AddOptionAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/option/AddOptionSetAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/option/UpdateOptionAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/option/UpdateOptionSetAction.java


--
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-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java	2015-03-20 07:08:50 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java	2015-08-06 12:24:02 +
@@ -29,12 +29,13 @@
  */
 
 import com.opensymphony.xwork2.Action;
+
+import org.apache.commons.lang3.StringUtils;
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.option.OptionService;
 import org.hisp.dhis.option.OptionSet;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.StringUtils;
 
 /**
  * @author Morten Olav Hansen 
@@ -208,8 +209,8 @@
 }
 }
 
-Attribute attribute = new Attribute( name, valueType );
-attribute.setCode( StringUtils.isEmpty( code.trim() ) ? null : code );
+Attribute attribute = new Attribute( StringUtils.trimToNull( name ), StringUtils.trimToNull( valueType ) );
+attribute.setCode( StringUtils.trimToNull( code ) );
 attribute.setMandatory( mandatory );
 attribute.setDataElementAttribute( dataElementAttribute );
 attribute.setDataElementGroupAttribute( dataElementGroupAttribute );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java	2015-03-20 07:08:50 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java	2015-08-06 12:24:02 +
@@ -29,12 +29,13 @@
  */
 
 import com.opensymphony.xwork2.Action;
+
+import org.apache.commons.lang3.StringUtils;
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.option.OptionService;
 import org.hisp.dhis.option.OptionSet;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.StringUtils;
 
 /**
  * @author Morten Olav Hansen 
@@ -219,9 +220,9 @@
 attribute.setOptionSet( optionSet );
 }
 
-attribute.setName( name );
-attribute.setCode( StringUtils.isEmpty( code.trim() ) ? null : code );
-attribute.setValueType( valueType );
+attribute.setName( StringUtils.trimToNull( name ) );
+attribute.setCode( StringUtils.trimToNull( code ) );
+attribute.setValueType( StringUtils.trimToNull( valueType ) );
 attribute.setMandatory( mandatory );
 attribute.setDataElementAttribute( dataElementAttribute );
 attribute.setDataElementGroupAttribute( dataElementGroupAttribute );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/constant/AddConstantAction.jav

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19728: Analytics, setting level of org units

2015-08-06 Thread noreply

revno: 19728
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 15:12:50 +0200
message:
  Analytics, setting level of org units
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java


--
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-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java	2015-07-07 14:54:50 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java	2015-08-06 13:12:50 +
@@ -482,6 +482,14 @@
  * @return true if the organisation unit with the given uid is part of the hierarchy.
  */
 boolean isInUserHierarchy( String uid, Set organisationUnits );
+
+/**
+ * Sets the transient level property of each organisation unit in the given
+ * list. Fetches the organisation unit from the database.
+ * 
+ * @param organisationUnits the collection of organisation units.
+ */
+void setOrganisationUnitLevel( Collection organisationUnits );
 
 // -
 // OrganisationUnitHierarchy

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-08-05 15:46:59 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-08-06 13:12:50 +
@@ -1273,6 +1273,13 @@
 }
 }
 
+// -
+// Set level property
+// -
+
+Collection typedOus = NameableObjectUtils.asTypedList( ous );
+organisationUnitService.setOrganisationUnitLevel( typedOus );
+
 List orgUnits = new UniqueArrayList<>();
 List ousList = NameableObjectUtils.asTypedList( ous );
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java	2015-07-08 09:56:56 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java	2015-08-06 13:12:50 +
@@ -813,6 +813,18 @@
 return organisationUnit != null ? organisationUnit.isDescendant( organisationUnits ) : false;
 }
 
+@Override
+public void setOrganisationUnitLevel( Collection organisationUnits )
+{
+for ( OrganisationUnit unit : organisationUnits )
+{
+if ( unit != null && !unit.hasLevel() )
+{
+unit.setLevel( getLevelOfOrganisationUnit( unit.getId() ) );
+}
+}
+}
+
 // -
 // OrganisationUnitHierarchy
 // -

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19729: GIS DI map loader fix + plugins updated.

2015-08-06 Thread noreply

revno: 19729
committer: Jan Henrik Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 15:27:58 +0200
message:
  GIS DI map loader fix + plugins updated.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.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-apps/src/main/webapp/dhis-web-mapping/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js	2015-07-19 21:43:56 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js	2015-08-06 13:27:58 +
@@ -9702,6 +9702,7 @@
 
 var googleHybrid = new OpenLayers.Layer.Google('Google Hybrid', {
 type: google.maps.MapTypeId.HYBRID,
+useTiltImages: false,
 numZoomLevels: 20,
 animationEnabled: true,
 layerType: gis.conf.finals.layer.type_base,

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js	2015-08-05 15:16:32 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js	2015-08-06 13:27:58 +
@@ -1050,7 +1050,7 @@
 		return window;
 	};
 
-	GIS.core.MapLoader = function(gis, isSession, applyViews) {
+	GIS.core.MapLoader = function(gis, isSession, applyConfig) {
 		var getMap,
 			setMap,
 			afterLoad,
@@ -1227,7 +1227,9 @@
 
 		loader = {
 			load: function(views) {
-gis.olmap.mask.show();
+if (gis.olmap.mask && !gis.skipMask) {
+gis.olmap.mask.show();
+}
 
 if (gis.map && gis.map.id) {
 	getMap();
@@ -1499,7 +1501,9 @@
 			hideMask: false,
 			callBack: null,
 			load: function(view) {
-gis.olmap.mask.show();
+if (gis.olmap.mask && !gis.skipMask) {
+gis.olmap.mask.show();
+}
 
 loadOrganisationUnits(view);
 			},
@@ -1796,7 +1800,9 @@
 			hideMask: false,
 			callBack: null,
 			load: function(view) {
-gis.olmap.mask.show();
+if (gis.olmap.mask && !gis.skipMask) {
+gis.olmap.mask.show();
+}
 
 if (this.compare) {
 	compareView(view, true);
@@ -2075,7 +2081,9 @@
 			hideMask: false,
 			callBack: null,
 			load: function(view) {
-gis.olmap.mask.show();
+if (gis.olmap.mask && !gis.skipMask) {
+gis.olmap.mask.show();
+}
 
 if (this.compare) {
 	compareView(view, true);
@@ -2640,7 +2648,9 @@
 			hideMask: false,
 			callBack: null,
 			load: function(view) {
-gis.olmap.mask.show();
+if (gis.olmap.mask && !gis.skipMask) {
+gis.olmap.mask.show();
+}
 
 if (this.compare) {
 	compareView(view, true);

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js	2015-08-05 15:16:32 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js	2015-08-06 13:27:58 +
@@ -3190,7 +3190,9 @@
 			hideMask: false,
 			callBack: null,
 			load: function(view) {
-gis.olmap.mask.show();
+if (gis.olmap.mask && !gis.skipMask) {
+gis.olmap.mask.show();
+}
 
 if (this.compare) {
 	compareView(view, true);
@@ -3469,7 +3471,9 @@
 			hideMask: false,
 			callBack: null,
 			load: function(view) {
-gis.olmap.mask.show();
+if (gis.olmap.mask && !gis.skipMask) {
+gis.olmap.mask.show();
+}
 
 if (this.compare) {
 	compareView(view, true);
@@ -4034,7 +4038,9 @@
 			hideMask: false,
 			callBack: null,
 			load: function(view) {
-gis.olmap.mask.show();
+if (gis.olmap.mask && !gis.skipMask) {
+gis.olmap.mask.show();
+}
 
 if (this.compare) {
 	compareView(view, true);

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webap

[Dhis2-devs] [Bug 1474419] Re: Metadata import into empty db in 2.19 dhis2 fails because of already existing key

2015-08-06 Thread David Huser
** Summary changed:

- metadata import into empty db in 2.19 dhis2 fails
+ Metadata import into empty db in 2.19 dhis2 fails because of already existing 
key

** Summary changed:

- Metadata import into empty db in 2.19 dhis2 fails because of already existing 
key
+ Metadata import into empty db fails because of already existing key violating 
unique constraint

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1474419

Title:
  Metadata import into empty db fails because of already existing key
  violating unique constraint

Status in DHIS:
  New

Bug description:
  Dhis2 version: 2.19
  tested: local and with the demo Sierra Leone server.
  OS: Local Windows 7, tomcat(-7.0.62) , postgres 9.4
  browser: Firefox and Chrome.

  Problem statement
  Dhis2 version 2.19 fails  to imports metadate into empty database. Goes fine 
with 2.18 version.

  How tested
   Test 1. Do a default meta data export in msf dhis2 data on dhis2 version 
2.19. 
  Stop tomcat, drop database , create a new empty database.
  1.Start tomcat, start metadata import as admin user.
  2.Check import summary, see Detailed error description below.

  Detailed error description
  Import never finishes it gets ‘stuck’  during importing  of Data sets. 
   
  In tomcat cat log the following is found.
  SEVERE: Servlet.service() for servlet [webapi] in context with path [/dhis] 
threw exception
  org.springframework.dao.DataIntegrityViolationException: could not execute 
statement; SQL [n/a]; constraint [null]; nested exception is 
org.hibernate.exception.ConstraintViolationException: could not execute 
statement
at … (a lot of java class exceptions calls that are not helpful)

  Test 2, same but then with an meta data export into  the Sierra Leone demo 
server. With same result ( as described in the detailed err description).
  Test 3. Same but then with 2.18 version of dhis2 installed local and with a 
dhis2 import with Sierra leone demo data and our data,  both goes fine.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1474419/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19730: AuthenticationSuccessHandler, re-impl update of lastlogin for user, got lost in 2.20

2015-08-06 Thread noreply

revno: 19730
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 16:04:41 +0200
message:
  AuthenticationSuccessHandler, re-impl update of lastlogin for user, got lost 
in 2.20
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java
  
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/DefaultAuthenticationSuccessHandler.java


--
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-api/src/main/java/org/hisp/dhis/user/UserCredentials.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java	2015-07-13 12:34:39 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java	2015-08-06 14:04:41 +
@@ -365,6 +365,14 @@
 {
 return username;
 }
+
+/**
+ * Sets the last login property to the current date.
+ */
+public void updateLastLogin()
+{
+this.lastLogin = new Date();
+}
 
 /**
  * Tests whether the credentials contain all needed parameters to

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/DefaultAuthenticationSuccessHandler.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/DefaultAuthenticationSuccessHandler.java	2015-02-22 20:30:29 +
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/DefaultAuthenticationSuccessHandler.java	2015-08-06 14:04:41 +
@@ -28,16 +28,20 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import org.hisp.dhis.security.intercept.LoginInterceptor;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
+import java.io.IOException;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
-import java.io.IOException;
+
+import org.hisp.dhis.security.intercept.LoginInterceptor;
+import org.hisp.dhis.user.UserCredentials;
+import org.hisp.dhis.user.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.Authentication;
 import org.springframework.security.core.userdetails.User;
+import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
 
 /**
  * Since ActionContext is not available at this point, we set a mark in the
@@ -56,16 +60,29 @@
  */
 public static final int DEFAULT_SESSION_TIMEOUT = 60 * 60;
 
+@Autowired
+private UserService userService;
+
 @Override
 public void onAuthenticationSuccess( HttpServletRequest request, HttpServletResponse response, Authentication authentication )
 throws ServletException, IOException
 {
 HttpSession session = request.getSession();
+
+String username = ((User)authentication.getPrincipal()).getUsername();
 
-session.setAttribute( "userIs", ((User)authentication.getPrincipal()).getUsername());
+session.setAttribute( "userIs", username);
 session.setAttribute( LoginInterceptor.JLI_SESSION_VARIABLE, Boolean.TRUE );
 session.setMaxInactiveInterval( DefaultAuthenticationSuccessHandler.DEFAULT_SESSION_TIMEOUT );
 
+UserCredentials credentials = userService.getUserCredentialsByUsername( username );
+
+if ( credentials != null )
+{
+credentials.updateLastLogin();
+userService.updateUserCredentials( credentials );
+}
+
 super.onAuthenticationSuccess( request, response, authentication );
 }
 }

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19731: tracker-capture: bug fix during enrollment

2015-08-06 Thread noreply

revno: 19731
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Thu 2015-08-06 16:08:42 +0200
message:
  tracker-capture: bug fix during enrollment
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.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-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-07-14 19:05:51 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-08-06 14:08:42 +
@@ -143,7 +143,7 @@
 }
 
 RegistrationService.registerOrUpdate($scope.tei, $scope.optionSets, $scope.attributesById).then(function(registrationResponse){
-var reg = registrationResponse.response && registrationResponse.response.importSummaries && registrationResponse.response.importSummaries[0] ? registrationResponse.response.importSummaries[0] : {};
+var reg = registrationResponse.response ? registrationResponse.response : {};
 if(reg.reference && reg.status === 'SUCCESS'){
 $scope.tei.trackedEntityInstance = reg.reference;
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19732: tracker-capture: minor cosmetic fix in relationship widget

2015-08-06 Thread noreply

revno: 19732
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Thu 2015-08-06 16:14:31 +0200
message:
  tracker-capture: minor cosmetic fix in relationship widget
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html


--
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-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2015-06-02 12:25:03 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2015-08-06 14:14:31 +
@@ -30,6 +30,7 @@
 
 {{att.name}}
 
+
 
 
 {{rel.relName}} 
@@ -37,7 +38,7 @@
 {{rel.attributes[att.id]}}
 
 
-
+
 
 


___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1481058] Re: Program enrollment fails in Tracker Capture dashboard

2015-08-06 Thread Abyot Asalefew Gizaw
** Changed in: dhis2
 Assignee: (unassigned) => Abyot Asalefew Gizaw (abyot)

** Changed in: dhis2
   Status: New => Fix Committed

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1481058

Title:
  Program enrollment fails in Tracker Capture dashboard

Status in DHIS:
  Fix Committed

Bug description:
  I’m getting a “Error in update: Import was successful” message when I
  try to enroll a person in a program via the Tracker Capture dashboard
  in DHIS 2.20.

  The enrollment does not save. This occurs in both my DHIS instance
  (2.20 build 19688) and the online demo (2.20 build 19691).

  Steps to reproduce:
  1.Open Tracker Capture
  2.Select an existing patient
  3.In the Tracker dashboard, select a program for which this person is not 
yet enrolled
  4.Press New in the Enrollment section
  5.Fill in the form and hit “Enroll”

  Here's the Tomcat log:
  sql: from trackedentityinstance tei inner join trackedentity te on 
tei.trackedentityid = te.trackedentityid inner join organisationunit ou on 
tei.organisationunitid = ou.organisationunitid inner join 
trackedentityattributevalue as "EeS8q0xyMxp" on 
"EeS8q0xyMxp".trackedentityinstanceid = tei.trackedentityinstanceid and 
"EeS8q0xyMxp".trackedentityattributeid = 1175 and lower("EeS8q0xyMxp".value) = 
''
  sql: from trackedentityinstance tei inner join trackedentity te on 
tei.trackedentityid = te.trackedentityid inner join organisationunit ou on 
tei.organisationunitid = ou.organisationunitid inner join 
trackedentityattributevalue as "gT7UHCoaMO2" on 
"gT7UHCoaMO2".trackedentityinstanceid = tei.trackedentityinstanceid and 
"gT7UHCoaMO2".trackedentityattributeid = 1167 and "gT7UHCoaMO2".value = '7'
  * INFO  2015-08-03 14:24:14,214 Deleted objects associated with object of 
type TrackedEntityAttributeValue (DefaultDeletionManager.java 
[http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,215 Deleted objects associated with object of 
type TrackedEntityAttributeValue (DefaultDeletionManager.java 
[http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,215 Deleted objects associated with object of 
type TrackedEntityAttributeValue (DefaultDeletionManager.java 
[http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,216 Deleted objects associated with object of 
type TrackedEntityAttributeValue (DefaultDeletionManager.java 
[http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,217 Deleted objects associated with object of 
type TrackedEntityAttributeValue (DefaultDeletionManager.java 
[http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,217 Deleted objects associated with object of 
type TrackedEntityAttributeValue (DefaultDeletionManager.java 
[http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,218 Deleted objects associated with object of 
type TrackedEntityAttributeValue (DefaultDeletionManager.java 
[http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,219 'rs3524' update 
org.hisp.dhis.trackedentity.TrackedEntityInstance, uid: HTkyyZTtQF9 
(AuditLogUtil.java [http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,220 'rs3524' update 
org.hisp.dhis.trackedentity.TrackedEntityInstance, uid: HTkyyZTtQF9 
(AuditLogUtil.java [http-bio-80-exec-11])
  * INFO  2015-08-03 14:24:14,240 'rs3524' update 
org.hisp.dhis.trackedentity.TrackedEntityInstance, uid: HTkyyZTtQF9 
(AuditLogUtil.java [http-bio-80-exec-11])

  
  I don’t think it’s related, but there is also an error in the Javascript 
console: GET 
https://apps.dhis2.org/dev/api/userSettings/keyTrackerDashboardLayout 404 (Not 
Found)

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1481058/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19733: tracker-capture: some style fix

2015-08-06 Thread noreply

revno: 19733
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Thu 2015-08-06 17:06:48 +0200
message:
  tracker-capture: some style fix
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/select2/select2.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-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html	2015-08-04 07:44:44 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html	2015-08-06 15:06:48 +
@@ -1,28 +1,28 @@

 
-
+
 
-
-
+
+
 {{'data_element'| translate}}
 
-
+
 {{'value'| translate}}
 
-
+
 {{'provided_elsewhere'| translate}}
 
 
 
 
-
+
 {{prStDe.dataElement.formName ? prStDe.dataElement.formName : prStDe.dataElement.name}}
 
 
 {{prStDe.dataElement.description}}
  
 
-
+
 
 
 
@@ -156,7 +156,7 @@
 
 
 
-
+
 
 
 
 
-
-
+
+
 {{'data_element'| translate}}
 
-
+
 {{'value'| translate}}
 
-
+
 {{'provided_elsewhere'| translate}}
 
 
 

-
-
+
+
 {{prStDes[de.dataElement.id].dataElement.formName ? prStDes[de.dataElement.id].dataElement.formName : prStDes[de.dataElement.id].dataElement.name}}
 
 
 {{prStDes[de.dataElement.id].dataElement.description}}
 
 
-
+
 
 
 
@@ -328,7 +328,7 @@
 
 
 
-
+
 
 ___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19734: GIS improved validation.

2015-08-06 Thread noreply

revno: 19734
committer: Jan Henrik Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 17:33:17 +0200
message:
  GIS improved validation.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.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-apps/src/main/webapp/dhis-web-mapping/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js	2015-08-06 13:27:58 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js	2015-08-06 15:33:17 +
@@ -3571,6 +3571,11 @@
 console.log('Organisation unit dimension is invalid', config.rows);
 return;
 }
+
+if (!config.filters) {
+console.log('Please select a valid period', config.filters);
+return;
+}
 
 if (Ext.Array.contains([gis.layer.thematic1.id, gis.layer.thematic2.id, gis.layer.thematic3.id, gis.layer.thematic4.id], config.layer)) {
 if (!config.columns) {
@@ -3594,9 +3599,11 @@
 for (var j = 0; j < dim.items.length; j++) {
 if (dim.items[j].id === 'USER_ORGUNIT') {
 isOu = true;
-} else if (dim.items[j].id === 'USER_ORGUNIT_CHILDREN') {
+}
+else if (dim.items[j].id === 'USER_ORGUNIT_CHILDREN') {
 isOuc = true;
-} else if (dim.items[j].id === 'USER_ORGUNIT_GRANDCHILDREN') {
+}
+else if (dim.items[j].id === 'USER_ORGUNIT_GRANDCHILDREN') {
 isOugc = true;
 }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js	2015-08-06 13:27:58 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/map.js	2015-08-06 15:33:17 +
@@ -7337,7 +7337,7 @@
 };
 
 initialize = function() {
-var el = Ext.get(config.el);
+var el = Ext.get(config.el);
 
 if (!validateConfig()) {
 return;

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] New Program analytic functionality

2015-08-06 Thread Lars Helge Øverland
Hi,

for the record:

On Thu, Jul 30, 2015 at 2:20 AM, Lorill Crees  wrote:

> Hi,
>
> We have some questions with the new program analytic functionality rolled
> out in v 2.20:
>
>1. Program attributes aren't showing up in the pivot tables. When you
>select from the dropdown menu for Data in the pivot table app, Attributes
>is not an option. Is there plans to include this functionality?
>
>
This has been fixed in trunk/2.20.

>
>1.
>2. In the pivot table, when selecting "Event data items" then a
>particular program stage data element, the events seem to be averaging
>instead of using the aggregate function specified by the Data Element
>itself. When going into the pivot table options you can choose the
>aggregator (sum, count, etc) or the default which is "Data Element". When
>choosing "Data Element" (which in our data element is set to "sum"), it
>averages instead of summing. When choosing "sum" explicitly it sums
>properly instead of averaging. Is this a bug or are we missing something
>here?
>
>
Data items now respect the aggregation operator of the data elements, and
an aggregation operator property has also been added to attribute.

regards,

Lars


> Thanks,
>
> Lorill
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org 
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Showing receive SMS wrong

2015-08-06 Thread Lars Helge Øverland
Hi Riddy,

that was a bug, been fixed now in trunk/2.20:

https://apps.dhis2.org/demo/dhis-web-maintenance-mobile/showSentPage.action

regards,

Lars


On Thu, Jul 23, 2015 at 3:53 PM, riddy ndoma  wrote:

> Hello all,
> I tried to show receive SMS in demo, i've an error. I also tried it in an
> other server in 2.20 too. I have the same error. I wont to konw if it's a
> bug??
>
> Cheers,
>
> --
> Riddy NDOMA
> Software Developer
> *Skype:* riddyndoma, *G+:* riddyndoma, *FB:* riddy ndoma
> *Twitter:* riddyndoma, *LinkedIn:* riddy ndoma
> *Blog:* http://riddyndoma.blogspot.com/
> *Vous servir est mon désire (Serving you is my desire)*
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org 
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19735: ProgramInstanceService, minor

2015-08-06 Thread noreply

revno: 19735
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 19:12:37 +0200
message:
  ProgramInstanceService, minor
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java


--
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-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2015-07-15 17:25:10 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2015-08-06 17:12:37 +
@@ -249,6 +249,11 @@
 
 return null;
 }
+
+public boolean isSingleProgramStage()
+{
+return programStages != null && programStages.size() == 1;
+}
 
 @Override
 public int increaseVersion()

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java	2015-07-08 03:26:22 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java	2015-08-06 17:12:37 +
@@ -250,8 +250,8 @@
 Integer max );
 
 /**
- * Retrieve program instances with active status on an orgunit by a program
- * for a certain period with result limited
+ * Retrieve program instances with active status on an organisation unit by 
+ * a program for a certain period with result limited
  *
  * @param programProgram
  * @param orgunitIds Organisation Units
@@ -266,7 +266,7 @@
 
 /**
  * Get the number of program instances which are active status and
- * registered in a certain orgunit by a program for a certain period
+ * registered in a certain organisation unit by a program for a certain period
  *
  * @param programProgram
  * @param orgunitIds Organisation Units
@@ -335,16 +335,16 @@
 /**
  * Enroll a TrackedEntityInstance into a program. Must be run inside a transaction.
  *
- * @param uidUID to use for new instance
- * @param entityInstance TrackedEntityInstance
- * @param programProgram
- * @param enrollmentDate The date of enrollment
- * @param dateOfIncident The date of incident
- * @param orgunitOrganisation Unit
- * @return ProgramInsance
+ * @param uid   UID to use for new instance
+ * @param trackedEntityInstance TrackedEntityInstance
+ * @param program   Program
+ * @param enrollmentDateThe date of enrollment
+ * @param dateOfIncidentThe date of incident
+ * @param orgunit   Organisation Unit
+ * @return ProgramInstance
  */
-ProgramInstance enrollTrackedEntityInstance( String uid, TrackedEntityInstance entityInstance, Program program, Date enrollmentDate, Date dateOfIncident,
-OrganisationUnit orgunit );
+ProgramInstance enrollTrackedEntityInstance( String uid, TrackedEntityInstance trackedEntityInstance, Program program, 
+Date enrollmentDate, Date dateOfIncident, OrganisationUnit orgunit );
 
 /**
  * Enroll a TrackedEntityInstance into a program. Must be run inside a transaction.
@@ -354,7 +354,7 @@
  * @param enrollmentDate The date of enrollment
  * @param dateOfIncident The date of incident
  * @param orgunitOrganisation Unit
- * @return ProgramInsance
+ * @return ProgramInstance
  */
 ProgramInstance enrollTrackedEntityInstance( TrackedEntityInstance entityInstance, Program program, Date enrollmentDate, Date dateOfIncident,
 OrganisationUnit orgunit );

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java	2015-07-13 12:34:39 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java	2015-08-06 17:12:37 +
@@ -90,7 +90,7 @@
 
 public static final int SEND_TO_USER_GROUP = 5;
 
-public static final int SEND_WHEN_TO_EMROLLEMENT = 1;
+public static final int SEND_WHEN_TO_ENROLLMENT = 1;
 
 public static final int SEND_WHEN_TO_C0MPLETED_EVENT = 2;
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/or

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19736: Javadocs

2015-08-06 Thread noreply

revno: 19736
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 22:09:10 +0200
message:
  Javadocs
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java


--
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-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java	2015-08-06 17:12:37 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java	2015-08-06 20:09:10 +
@@ -335,7 +335,20 @@
 /**
  * Enroll a TrackedEntityInstance into a program. Must be run inside a transaction.
  *
+ * @param trackedEntityInstance TrackedEntityInstance
+ * @param program   Program
+ * @param enrollmentDateThe date of enrollment
+ * @param dateOfIncidentThe date of incident
+ * @param orgunit   Organisation Unit
  * @param uid   UID to use for new instance
+ * @return ProgramInstance
+ */
+ProgramInstance enrollTrackedEntityInstance( TrackedEntityInstance trackedEntityInstance, Program program, 
+Date enrollmentDate, Date dateOfIncident, OrganisationUnit orgunit, String uid );
+
+/**
+ * Enroll a TrackedEntityInstance into a program. Must be run inside a transaction.
+ *
  * @param trackedEntityInstance TrackedEntityInstance
  * @param program   Program
  * @param enrollmentDateThe date of enrollment
@@ -343,20 +356,7 @@
  * @param orgunit   Organisation Unit
  * @return ProgramInstance
  */
-ProgramInstance enrollTrackedEntityInstance( String uid, TrackedEntityInstance trackedEntityInstance, Program program, 
-Date enrollmentDate, Date dateOfIncident, OrganisationUnit orgunit );
-
-/**
- * Enroll a TrackedEntityInstance into a program. Must be run inside a transaction.
- *
- * @param entityInstance TrackedEntityInstance
- * @param programProgram
- * @param enrollmentDate The date of enrollment
- * @param dateOfIncident The date of incident
- * @param orgunitOrganisation Unit
- * @return ProgramInstance
- */
-ProgramInstance enrollTrackedEntityInstance( TrackedEntityInstance entityInstance, Program program, Date enrollmentDate, Date dateOfIncident,
+ProgramInstance enrollTrackedEntityInstance( TrackedEntityInstance trackedEntityInstance, Program program, Date enrollmentDate, Date dateOfIncident,
 OrganisationUnit orgunit );
 
 /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2015-06-16 13:17:59 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2015-08-06 20:09:10 +
@@ -180,20 +180,28 @@
 OrganisationUnit organisationUnit );
 
 /**
- * For the first case of an anonymous program, the program-instance doesn't
- * exist, So system has to create a program-instance and
- * program-stage-instance. The similar thing happens for single event with
- * registration.
+ * Creates a program stage instance. Will create a program instance in case
+ * the program is single event.
  *
- * @param entityInstance TrackedEntityInstance
- * @param program Single event without registration
- * @param executionDate Report date of the event
- * @param organisationUnit Orgunit where the event happens
- * @return ProgramStageInstance ProgramStageInstance object
+ * @param entityInstance the tracked entity instance.
+ * @param program the program.
+ * @param executionDate the report date of the event.
+ * @param organisationUnit the organisation unit where the event took place.
+ * @return ProgramStageInstance a ProgramStageInstance object.
  */
 ProgramStageInstance createProgramStageInstance( TrackedEntityInstance entityInstance, Program program,
 Date executionDate, OrganisationUnit organisationUnit );
 
+/**
+ * Creates a program stage instance. 
+ *
+ * @param programInstance the 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19737: Event analytics tables. Using integer column types with values (1, 0, null) for booleans instead of...

2015-08-06 Thread noreply

revno: 19737
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 22:36:58 +0200
message:
  Event analytics tables. Using integer column types with values (1,0,null) for 
booleans instead of text.
modified:
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java


--
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-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java	2015-06-22 09:21:54 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java	2015-08-06 20:36:58 +
@@ -380,7 +380,8 @@
 }
 
 /**
- * Returns the database column type based on the given value type.
+ * Returns the database column type based on the given value type. For boolean
+ * values, 1 means true, 0 means false and null means no value.
  */
 private String getColumnType( ValueType valueType )
 {
@@ -392,6 +393,10 @@
 {
 return "integer";
 }
+else if ( Boolean.class.equals( valueType.getJavaClass() ) )
+{
+return "integer";
+}
 else
 {
 return "character varying(255)";
@@ -412,6 +417,10 @@
 {
 return "cast(value as integer)";
 }
+else if ( Boolean.class.equals( valueType.getJavaClass() ) )
+{
+return "case when value = 'true' then 1 when value = 'false' then 0 else null end";
+}
 else
 {
 return "value";

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19738: Program indicator, program stage selector, fixed bug

2015-08-06 Thread noreply

revno: 19738
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Thu 2015-08-06 23:31:17 +0200
message:
  Program indicator, program stage selector, fixed bug
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetTrackedEntityDataElementsAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.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-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetTrackedEntityDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetTrackedEntityDataElementsAction.java	2015-03-30 09:30:54 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetTrackedEntityDataElementsAction.java	2015-08-06 21:31:17 +
@@ -49,7 +49,6 @@
 public class GetTrackedEntityDataElementsAction
 implements Action
 {
-
 // -
 // Dependencies
 // -
@@ -79,9 +78,9 @@
 this.programId = programId;
 }
 
-private Integer programStageId;
+private String programStageId;
 
-public void setProgramStageId( Integer programStageId )
+public void setProgramStageId( String programStageId )
 {
 this.programStageId = programStageId;
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js	2015-07-19 13:38:39 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js	2015-08-06 21:31:17 +
@@ -61,7 +61,9 @@
 function getTrackedEntityDataElements( type ) {
   var fieldId = type + '-data-elements';
   clearListById(fieldId);
-  var programStageId = getFieldValue('programStageId');
+  
+  var psSelectId = type + '-program-stage';
+  var programStageId = getFieldValue(psSelectId);
 
   jQuery.getJSON('getTrackedEntityDataElements.action',
 {

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19739: Program indicator ui, fixed bug

2015-08-06 Thread noreply

revno: 19739
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Fri 2015-08-07 08:05:01 +0200
message:
  Program indicator ui, fixed bug
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetTrackedEntityDataElementsAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.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-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetTrackedEntityDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetTrackedEntityDataElementsAction.java	2015-08-06 21:31:17 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetTrackedEntityDataElementsAction.java	2015-08-07 06:05:01 +
@@ -78,12 +78,19 @@
 this.programId = programId;
 }
 
-private String programStageId;
+private Integer programStageId;
 
-public void setProgramStageId( String programStageId )
+public void setProgramStageId( Integer programStageId )
 {
 this.programStageId = programStageId;
 }
+
+private Integer programStageUid;
+
+public void setProgramStageUid( Integer programStageUid )
+{
+this.programStageUid = programStageUid;
+}
 
 private List dataElements;
 
@@ -99,18 +106,24 @@
 @Override
 public String execute()
 {
-if ( programStageId == null )
+if ( programStageId != null )
+{
+ProgramStage stage = programStageService.getProgramStage( programStageId );
+
+dataElements = new ArrayList<>( stage.getAllDataElements() );
+}
+else if ( programStageUid != null )
+{
+ProgramStage stage = programStageService.getProgramStage( programStageUid );
+
+dataElements = new ArrayList<>( stage.getAllDataElements() );
+}
+else
 {
 Program program = programService.getProgram( programId );
 
 dataElements = new ArrayList<>( program.getAllDataElements() );
 }
-else
-{
-ProgramStage stage = programStageService.getProgramStage( programStageId );
-
-dataElements = new ArrayList<>( stage.getAllDataElements() );
-}
 
 Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js	2015-08-06 21:31:17 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js	2015-08-07 06:05:01 +
@@ -68,7 +68,7 @@
   jQuery.getJSON('getTrackedEntityDataElements.action',
 {
   programId: getFieldValue('programId'),
-  programStageId: programStageId
+  programStageUid: programStageId
 }, function( json ) {
   var dataElements = jQuery('#' + fieldId);
   for( i in json.dataElements ) {

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp