← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12284: Log exception, went from external to iso period format

 

------------------------------------------------------------
revno: 12284
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-09-27 15:45:21 +0200
message:
  Log exception, went from external to iso period format
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/datasetLockReport.js
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/AddLockExceptionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/lockException.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonPeriods.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-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/AddLockExceptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/AddLockExceptionAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/AddLockExceptionAction.java	2013-09-27 13:45:21 +0000
@@ -38,6 +38,7 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
 
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -110,7 +111,7 @@
         }
 
         DataSet dataSet = dataSetService.getDataSet( dataSetId );
-        Period period = periodService.getPeriodByExternalId( periodId );
+        Period period = periodService.reloadPeriod( PeriodType.getPeriodFromIsoString( periodId ) );
 
         if ( dataSet == null || period == null )
         {

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/datasetLockReport.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/datasetLockReport.js	2011-05-30 07:01:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/datasetLockReport.js	1970-01-01 00:00:00 +0000
@@ -1,108 +0,0 @@
-
-var clickedButtonElement = null;
-var numberOfSelects = 0;
-var selectedOrgunits = new Array();
-	
-function setClickedButtonElementValue( isLock )
-{
-	setFieldValue("selectBetweenLockUnlock", isLock);
-}
-
-function validateCollectiveDataLockingForm( form )
-{
-	var url = "validateCollectiveDataLocking.action?";
-		url += getParamString( "selectedPeriods", "selectedPeriods" );
-		url += "&" + getParamString( "selectedDataSets", "selectedDataSets" );
-
-	$.postJSON( url, {}, function( json )
-	{
-		if ( json.response == "input" )
-		{
-			setHeaderDelayMessage( json.message );
-		}
-		else if ( json.response == "success" )
-		{
-			selectAllById( "selectedPeriods" );
-			selectAllById( "selectedDataSets" ); 
-			form.submit();
-		}
-	});
-}
-
-// ------------------------------------------------------------------------------
-// Get Periods correspond to Selected Period Type
-// ------------------------------------------------------------------------------
-
-function getPeriods()
-{
-	var periodTypeList = byId("periodTypeId");
-	var periodTypeId = periodTypeList.options[periodTypeList.selectedIndex].value;
-
-	if (periodTypeId != null) {
-		var url = "getPeriodsForLock.action?name=" + periodTypeId;
-		$.ajax( {
-			url :url,
-			cache :false,
-			success : function(response) {
-				dom = parseXML(response);
-				$('#availablePeriods >option').remove();
-				$(dom).find('period').each(
-						function() {
-							$('#availablePeriods').append(
-									"<option value="
-											+ $(this).find('id').text() + ">"
-											+ $(this).find('name').text()
-											+ "</option>");
-						});
-			}
-
-		});
-	}
-	
-	enable("lock");
-	enable("unlock");
-	enable("availablePeriods");
-	
-	getDataSets();
-
-}
-
-function parseXML(xml) {
-
-	if (window.ActiveXObject && window.GetObject) {
-		var dom = new ActiveXObject('Microsoft.XMLDOM');
-		dom.loadXML(xml);
-		return dom;
-	}
-	if (window.DOMParser)
-		return new DOMParser().parseFromString(xml, 'text/xml');
-	
-	throw new Error('No XML parser available');
-}
-
-function getDataSets() {
-
-	var periodTypeList = byId("periodTypeId");
-	var periodType = periodTypeList.options[periodTypeList.selectedIndex].value;
-
-	if (periodType != null) {
-		var url = "getDataSetsForPeriodType.action?periodType=" + periodType;
-		$.ajax( {
-			url :url,
-			cache :false,
-			success : function(response) {
-			$('#availableDataSets >option').remove();
-			$(response).find('dataSet').each(
-					function() {
-						$('#availableDataSets').append(
-								"<option value=" + $(this).find('id').text()
-										+ ">" + $(this).find('name').text()
-										+ "</option>");
-					});
-			enable("availableDataSets");
-			$('#selectedPeriods >option').remove();
-			$('#selectedDataSets >option').remove();
-		}
-		});
-	}
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/lockException.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/lockException.js	2012-02-14 02:58:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/lockException.js	2013-09-27 13:45:21 +0000
@@ -39,7 +39,7 @@
                 resetPeriods();
             } else {
                 for ( var n in data.periods ) {
-                    var option = jQuery("<option />").attr("value", data.periods[n].externalId).text(data.periods[n].name);
+                    var option = jQuery("<option />").attr("value", data.periods[n].id).text(data.periods[n].name);
                     jQuery("#periods").append(option);
                 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonPeriods.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonPeriods.vm	2012-02-08 12:04:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonPeriods.vm	2013-09-27 13:45:21 +0000
@@ -3,7 +3,7 @@
 #foreach( $period in $periods )
   {
     "name": "$!format.formatPeriod( ${period} )",
-    "externalId": "$!{period.externalId}"
+    "id": "$!{period.isoDate}"
   }#if( $velocityCount < $size ),#end
 #end
 ] }