dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31144
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15840: Fixed bug - Don't allow to selete a value in future of DATE attribute which is set the allowFutur...
------------------------------------------------------------
revno: 15840
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-06-25 17:05:54 +0800
message:
Fixed bug - Don't allow to selete a value in future of DATE attribute which is set the allowFutureDate property as active.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java 2014-06-21 09:02:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java 2014-06-25 09:05:54 +0000
@@ -270,11 +270,11 @@
return mandatoryMap;
}
- private Map<Integer, Boolean> allowDateInFutureMap = new HashMap<Integer, Boolean>();
+ private Map<Integer, Boolean> allowFutureDateMap = new HashMap<Integer, Boolean>();
- public Map<Integer, Boolean> getAllowDateInFutureMap()
+ public void setAllowFutureDateMap( Map<Integer, Boolean> allowFutureDateMap )
{
- return allowDateInFutureMap;
+ this.allowFutureDateMap = allowFutureDateMap;
}
// -------------------------------------------------------------------------
@@ -309,9 +309,9 @@
Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( entityInstance,
program, ProgramInstance.STATUS_ACTIVE );
-
+
ProgramInstance programInstance = null;
-
+
if ( programInstances != null && !programInstances.isEmpty() )
{
programInstance = programInstances.iterator().next();
@@ -337,11 +337,11 @@
attributes = new ArrayList<TrackedEntityAttribute>(
attributeService.getTrackedEntityAttributesDisplayInList() );
Collections.sort( attributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() );
-
+
for ( TrackedEntityAttribute attribute : attributes )
{
mandatoryMap.put( attribute.getId(), false );
- allowDateInFutureMap.put( attribute.getId(), false );
+ allowFutureDateMap.put( attribute.getId(), false );
}
}
else
@@ -350,7 +350,8 @@
for ( ProgramTrackedEntityAttribute programAttribute : program.getAttributes() )
{
mandatoryMap.put( programAttribute.getAttribute().getId(), programAttribute.isMandatory() );
- allowDateInFutureMap.put( programAttribute.getAttribute().getId(), programAttribute.getAllowFutureDate() );
+ allowFutureDateMap.put( programAttribute.getAttribute().getId(),
+ programAttribute.getAllowFutureDate() );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java 2014-06-21 09:02:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java 2014-06-25 09:05:54 +0000
@@ -277,11 +277,11 @@
return mandatoryMap;
}
- private Map<Integer, Boolean> allowDateInFutureMap = new HashMap<Integer, Boolean>();
-
- public Map<Integer, Boolean> getAllowDateInFutureMap()
+ private Map<Integer, Boolean> allowFutureDateMap = new HashMap<Integer, Boolean>();
+
+ public void setAllowFutureDateMap( Map<Integer, Boolean> allowFutureDateMap )
{
- return allowDateInFutureMap;
+ this.allowFutureDateMap = allowFutureDateMap;
}
private List<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
@@ -363,7 +363,7 @@
for ( TrackedEntityAttribute attribute : attributes )
{
mandatoryMap.put( attribute.getId(), false );
- allowDateInFutureMap.put( attribute.getId(), false );
+ allowFutureDateMap.put( attribute.getId(), false );
}
}
else
@@ -372,7 +372,7 @@
for ( ProgramTrackedEntityAttribute programAttribute : program.getAttributes() )
{
mandatoryMap.put( programAttribute.getAttribute().getId(), programAttribute.isMandatory() );
- allowDateInFutureMap.put( programAttribute.getAttribute().getId(), programAttribute.getAllowFutureDate() );
+ allowFutureDateMap.put( programAttribute.getAttribute().getId(), programAttribute.getAllowFutureDate() );
}
}