dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31836
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16258: Use List for attributes in Program object and rename attributes property to programAttributes.
------------------------------------------------------------
revno: 16258
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-07-27 22:02:58 +0700
message:
Use List for attributes in Program object and rename attributes property to programAttributes.
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/ProgramTrackedEntityAttribute.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/ProgramDeletionHandler.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java
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/ProgramEnrollmentAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java
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/webapp/dhis-web-caseentry/attributeFormDiv.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramAttributes.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listTrackedEntityInstance.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetParamsByProgramAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addValidationCriteria.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateValidationCriteria.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-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2014-07-26 14:38:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2014-07-27 15:02:58 +0000
@@ -94,7 +94,7 @@
private Boolean ignoreOverdueEvents = false;
- private Set<ProgramTrackedEntityAttribute> attributes = new HashSet<ProgramTrackedEntityAttribute>(); //TODO use List?
+ private List<ProgramTrackedEntityAttribute> programAttributes = new ArrayList<ProgramTrackedEntityAttribute>(); //TODO use List?
@Scanned
private Set<UserAuthorityGroup> userRoles = new HashSet<UserAuthorityGroup>();
@@ -152,7 +152,7 @@
*/
public ProgramTrackedEntityAttribute getAttribute( TrackedEntityAttribute attribute )
{
- for ( ProgramTrackedEntityAttribute programAttribute : attributes )
+ for ( ProgramTrackedEntityAttribute programAttribute : programAttributes )
{
if ( programAttribute != null && programAttribute.getAttribute().equals( attribute ) )
{
@@ -188,10 +188,9 @@
public List<TrackedEntityAttribute> getTrackedEntityAttributes()
{
List<TrackedEntityAttribute> entityAttributes = new ArrayList<TrackedEntityAttribute>();
-
- for ( ProgramTrackedEntityAttribute entityAttribute : attributes )
+ for ( ProgramTrackedEntityAttribute programAttribute : programAttributes )
{
- entityAttributes.add( entityAttribute.getAttribute() );
+ entityAttributes.add( programAttribute.getAttribute() );
}
return entityAttributes;
@@ -525,17 +524,16 @@
@JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
@JacksonXmlElementWrapper( localName = "programTrackedEntityAttributes", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "programTrackedEntityAttribute", namespace = DxfNamespaces.DXF_2_0 )
- public Set<ProgramTrackedEntityAttribute> getAttributes()
- {
- return attributes;
- }
-
- public void setAttributes( Set<ProgramTrackedEntityAttribute> attributes )
- {
- this.attributes = attributes;
- }
-
- @JsonProperty
+ public List<ProgramTrackedEntityAttribute> getProgramAttributes() {
+ return programAttributes;
+ }
+
+ public void setProgramAttributes(
+ List<ProgramTrackedEntityAttribute> programAttributes) {
+ this.programAttributes = programAttributes;
+ }
+
+ @JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "trackedEntity", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "trackedEntity", namespace = DxfNamespaces.DXF_2_0 )
@@ -585,8 +583,8 @@
validationCriteria.clear();
validationCriteria.addAll( program.getValidationCriteria() );
- attributes.clear();
- attributes.addAll( program.getAttributes() );
+ programAttributes.clear();
+ programAttributes.addAll( program.getProgramAttributes() );
userRoles.clear();
userRoles.addAll( program.getUserRoles() );
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java 2014-07-08 05:07:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java 2014-07-27 15:02:58 +0000
@@ -55,9 +55,7 @@
private int id;
private TrackedEntityAttribute attribute;
-
- private Integer sortOrder;
-
+
private boolean displayInList;
private Boolean mandatory;
@@ -75,24 +73,21 @@
public ProgramTrackedEntityAttribute( TrackedEntityAttribute attribute, int sortOrder, boolean displayInList )
{
this.attribute = attribute;
- this.sortOrder = sortOrder;
this.displayInList = displayInList;
}
- public ProgramTrackedEntityAttribute( TrackedEntityAttribute attribute, Integer sortOrder, boolean displayInList,
+ public ProgramTrackedEntityAttribute( TrackedEntityAttribute attribute, boolean displayInList,
Boolean mandatory )
{
this.attribute = attribute;
- this.sortOrder = sortOrder;
this.displayInList = displayInList;
this.mandatory = mandatory;
}
- public ProgramTrackedEntityAttribute( TrackedEntityAttribute attribute, Integer sortOrder, boolean displayInList,
+ public ProgramTrackedEntityAttribute( TrackedEntityAttribute attribute, boolean displayInList,
Boolean mandatory, Boolean allowFutureDate )
{
this.attribute = attribute;
- this.sortOrder = sortOrder;
this.displayInList = displayInList;
this.mandatory = mandatory;
this.allowFutureDate = allowFutureDate;
@@ -139,16 +134,6 @@
this.attribute = attribute;
}
- public Integer getSortOrder()
- {
- return sortOrder;
- }
-
- public void setSortOrder( Integer sortOrder )
- {
- this.sortOrder = sortOrder;
- }
-
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
@JacksonXmlProperty( localName = "displayInList", namespace = DxfNamespaces.DXF_2_0 )
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java 2014-06-27 10:55:57 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java 2014-07-27 15:02:58 +0000
@@ -483,7 +483,7 @@
Map<TrackedEntityAttribute, Boolean> mandatoryMap = Maps.newHashMap();
Map<String, String> attributeValueMap = Maps.newHashMap();
- for ( ProgramTrackedEntityAttribute programTrackedEntityAttribute : program.getAttributes() )
+ for ( ProgramTrackedEntityAttribute programTrackedEntityAttribute : program.getProgramAttributes() )
{
mandatoryMap
.put( programTrackedEntityAttribute.getAttribute(), programTrackedEntityAttribute.isMandatory() );
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java 2014-06-24 04:33:13 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java 2014-07-27 15:02:58 +0000
@@ -284,7 +284,7 @@
pr.setProgramStages( prStgs );
List<ProgramTrackedEntityAttribute> programPatientAttributes = new ArrayList<ProgramTrackedEntityAttribute>(
- program.getAttributes() );
+ program.getProgramAttributes() );
for ( int i = 0; i < programPatientAttributes.size(); i++ )
{
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/ProgramDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/ProgramDeletionHandler.java 2014-05-04 14:04:41 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/ProgramDeletionHandler.java 2014-07-27 15:02:58 +0000
@@ -120,11 +120,11 @@
for ( Program program : programs )
{
- for ( ProgramTrackedEntityAttribute programAttribute : program.getAttributes() )
+ for ( ProgramTrackedEntityAttribute programAttribute : program.getProgramAttributes() )
{
if ( programAttribute.getAttribute().equals( trackedEntityAttribute ) )
{
- program.getAttributes().remove( programAttribute );
+ program.getProgramAttributes().remove( programAttribute );
programService.updateProgram( program );
break;
}
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java 2014-05-16 15:26:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java 2014-07-27 15:02:58 +0000
@@ -135,7 +135,7 @@
{
for ( Program program : programs )
{
- result.removeAll( program.getAttributes() );
+ result.removeAll( program.getProgramAttributes() );
}
return result;
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2014-07-26 14:38:39 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2014-07-27 15:02:58 +0000
@@ -297,6 +297,7 @@
executeSql( "UPDATE program_attributes SET allowFutureDate='false' WHERE allowFutureDate is null" );
updateProgramStageList();
+ updateProgramAttributeList();
}
// -------------------------------------------------------------------------
@@ -472,6 +473,42 @@
}
}
+ private void updateProgramAttributeList()
+ {
+ StatementHolder holder = statementManager.getHolder();
+
+ try
+ {
+ Statement statement = holder.getStatement();
+
+ ResultSet resultSet = statement
+ .executeQuery( "select programtrackedentityattributeid, programid from program_attributes ORDER BY programid, sort_order" );
+
+ int index = 1;
+ int programId = 0;
+ while ( resultSet.next() )
+ {
+ if ( programId != resultSet.getInt( "programid" ) )
+ {
+ programId = resultSet.getInt( "programid" );
+ index = 1;
+ }
+
+ executeSql( "UPDATE program_attributes SET sort_order=" + index + " WHERE programtrackedentityattributeid="
+ + resultSet.getInt( "programtrackedentityattributeid" ) );
+ index++;
+ }
+ }
+ catch ( Exception ex )
+ {
+ log.debug( ex );
+ }
+ finally
+ {
+ holder.close();
+ }
+ }
+
private int executeSql( String sql )
{
try
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2014-07-26 14:38:39 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2014-07-27 15:02:58 +0000
@@ -25,7 +25,7 @@
<property name="dateOfIncidentDescription" type="text" />
- <list name="programStages">
+ <list name="programStages">
<key column="programid" />
<list-index column="sort_order" base="1" />
<one-to-many class="org.hisp.dhis.program.ProgramStage" />
@@ -49,11 +49,12 @@
<property name="onlyEnrollOnce" />
- <set name="attributes" cascade="all,delete-orphan" order-by="sort_order">
- <key column="programid" />
- <one-to-many class="org.hisp.dhis.program.ProgramTrackedEntityAttribute" />
- </set>
-
+ <list name="programAttributes" cascade="all,delete-orphan">
+ <key column="programid" />
+ <list-index column="sort_order" base="1" />
+ <one-to-many class="org.hisp.dhis.program.ProgramTrackedEntityAttribute" />
+ </list>
+
<property name="ignoreOverdueEvents" />
<set name="userRoles" table="program_userroles">
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml 2014-06-21 09:02:27 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml 2014-07-27 15:02:58 +0000
@@ -15,8 +15,6 @@
class="org.hisp.dhis.trackedentity.TrackedEntityAttribute" column="trackedentityattributeid"
foreign-key="fk_program_attributeid" />
- <property name="sortOrder" column="sort_order" />
-
<property name="displayInList" column="displayinlist" />
<property name="mandatory" column="mandatory" />
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2014-07-26 14:38:39 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2014-07-27 15:02:58 +0000
@@ -1197,7 +1197,7 @@
for ( TrackedEntityAttribute attribute : attributes )
{
- program.getAttributes().add( new ProgramTrackedEntityAttribute( attribute, i++, false ) );
+ program.getProgramAttributes().add( new ProgramTrackedEntityAttribute( attribute, i++, false ) );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java 2014-05-16 07:52:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java 2014-07-27 15:02:58 +0000
@@ -243,7 +243,7 @@
for ( Program p : programs )
{
- attributes.removeAll( p.getAttributes() );
+ attributes.removeAll( p.getProgramAttributes() );
}
for ( TrackedEntityAttribute attribute : attributes )
@@ -254,7 +254,7 @@
else
{
attributes = program.getTrackedEntityAttributes();
- for ( ProgramTrackedEntityAttribute programAttribute : program.getAttributes() )
+ for ( ProgramTrackedEntityAttribute programAttribute : program.getProgramAttributes() )
{
mandatoryMap.put( programAttribute.getAttribute().getId(), programAttribute.isMandatory() );
}
=== 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-25 09:05:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java 2014-07-27 15:02:58 +0000
@@ -347,7 +347,7 @@
else
{
attributes = program.getTrackedEntityAttributes();
- for ( ProgramTrackedEntityAttribute programAttribute : program.getAttributes() )
+ for ( ProgramTrackedEntityAttribute programAttribute : program.getProgramAttributes() )
{
mandatoryMap.put( programAttribute.getAttribute().getId(), programAttribute.isMandatory() );
allowFutureDateMap.put( programAttribute.getAttribute().getId(),
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java 2014-05-14 15:14:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java 2014-07-27 15:02:58 +0000
@@ -181,7 +181,7 @@
// Load attributes of the selected program
// ---------------------------------------------------------------------
- attributes = new ArrayList<ProgramTrackedEntityAttribute>( programInstance.getProgram().getAttributes() );
+ attributes = new ArrayList<ProgramTrackedEntityAttribute>( programInstance.getProgram().getProgramAttributes() );
if ( attributes != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java 2014-05-29 15:19:07 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java 2014-07-27 15:02:58 +0000
@@ -144,7 +144,7 @@
String value = null;
- Collection<ProgramTrackedEntityAttribute> programAttributes = program.getAttributes();
+ Collection<ProgramTrackedEntityAttribute> programAttributes = program.getProgramAttributes();
TrackedEntityAttributeValue attributeValue = null;
=== 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-25 09:05:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java 2014-07-27 15:02:58 +0000
@@ -369,7 +369,7 @@
else
{
attributes = program.getTrackedEntityAttributes();
- for ( ProgramTrackedEntityAttribute programAttribute : program.getAttributes() )
+ for ( ProgramTrackedEntityAttribute programAttribute : program.getProgramAttributes() )
{
mandatoryMap.put( programAttribute.getAttribute().getId(), programAttribute.isMandatory() );
allowFutureDateMap.put( programAttribute.getAttribute().getId(), programAttribute.getAllowFutureDate() );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/attributeFormDiv.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/attributeFormDiv.vm 2014-05-29 15:19:07 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/attributeFormDiv.vm 2014-07-27 15:02:58 +0000
@@ -1,13 +1,13 @@
#if($program)
- #set($attributes = $program.attributes)
+ #set($attributes = $program.programAttributes)
#end
<table width="100%">
-#foreach($_attribute in $attributes )
+#foreach($programAttribute in $programAttributes )
#if($program)
- #set($attribute = $_attribute.attribute)
+ #set($attribute = $programAttribute.attribute)
#end
- #set($mandatory=$!_attribute.mandatory)
+ #set($mandatory=$!programAttribute.mandatory)
<tr name='attributesFields'>
<td class='text-column'><label>$attribute.displayName #if($mandatory)<em title="$i18n.getString( "required" )" class="required">*</em> #end</label></td>
<td class="input-column" align='right'>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramAttributes.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramAttributes.vm 2014-04-24 16:30:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramAttributes.vm 2014-07-27 15:02:58 +0000
@@ -5,8 +5,8 @@
#set( $size = $!attributes.size() )
#end
-#if( $!program.attributes )
- #set( $size = $size + $program.attributes.size() )
+#if( $!program.programAttributes )
+ #set( $size = $size + $program.programAttributes.size() )
#end
#if( $!size > 0 )
@@ -40,7 +40,7 @@
#end
#end
-#foreach( $programAttribute in $program.attributes )
+#foreach( $programAttribute in $program.programAttributes )
#if($programAttribute.attribute.unique=='true')
{
"id": "${programAttribute.attribute.uid}",
@@ -53,7 +53,7 @@
#end
-#foreach( $programAttribute in $program.attributes )
+#foreach( $programAttribute in $program.programAttributes )
#if($programAttribute.attribute.unique!='true')
{
"id": "${programAttribute.attribute.uid}",
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listTrackedEntityInstance.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listTrackedEntityInstance.vm 2014-04-04 17:58:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listTrackedEntityInstance.vm 2014-07-27 15:02:58 +0000
@@ -27,7 +27,7 @@
<table class="listTable" id="entityInstanceList" width='100%'>
<col width="30"/>
#if($program)
- #foreach( $programAttribute in $program.attributes )
+ #foreach( $programAttribute in $program.programAttributes )
#if($programAttribute.displayInList=='true')
<col/>
#end
@@ -47,7 +47,7 @@
<tr>
<th>#</th>
#if($program)
- #foreach( $attribute in $program.attributes )
+ #foreach( $attribute in $program.programAttributes )
#if($attribute.displayInList=='true')
<th id="attributeName">$encoder.htmlEncode($attribute.attribute.displayName)</th>
#end
@@ -75,7 +75,7 @@
$nr
</td>
#if($program)
- #foreach( $programAttribute in $program.attributes )
+ #foreach( $programAttribute in $program.programAttributes )
#if($programAttribute.displayInList=='true')
#set($value='')
<td style="cursor:pointer;" onclick="javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )">
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2014-04-11 00:54:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2014-07-27 15:02:58 +0000
@@ -23,7 +23,7 @@
<tr>
<th>$i18n.getString('risk')</th>
- #foreach( $programAttribute in $program.attributes )
+ #foreach( $programAttribute in $program.programAttributes )
#if($programAttribute.displayInList=='true')
<th id="attributeName">$encoder.htmlEncode($programAttribute.attribute.displayName)</th>
#end
@@ -51,7 +51,7 @@
#end
</td>
- #foreach( $programAttribute in $program.attributes )
+ #foreach( $programAttribute in $program.programAttributes )
#if($programAttribute.displayInList=='true')
#set($value='')
<td name='infor_$entityInstance.id' class='$class'><a href="javascript:isDashboard=false;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )">
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm 2014-04-12 12:12:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm 2014-07-27 15:02:58 +0000
@@ -25,7 +25,7 @@
<td>
#set( $value="")
#set( $entityInstance = $programInstance.entityInstance )
- #foreach( $programAttribute in $program.attributes)
+ #foreach( $programAttribute in $program.programAttributes)
#foreach( $attributeValue in $entityInstance.attributeValues)
#if($attributeValue.attribute.id==$programAttribute.attribute.id
&& $programAttribute.displayInList=='true' )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm 2014-06-18 13:30:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm 2014-07-27 15:02:58 +0000
@@ -35,7 +35,7 @@
<table class="listTable" id="entityInstanceList" width='100%'>
<col width="30"/>
#if($program)
- #foreach( $programAttribute in $program.attributes )
+ #foreach( $programAttribute in $program.programAttributes )
#if($programAttribute.displayInList=='true')
<col/>
#end
@@ -52,7 +52,7 @@
<tr>
<th>#</th>
#if($program)
- #foreach( $programAttribute in $program.attributes )
+ #foreach( $programAttribute in $program.programAttributes )
#if($programAttribute.displayInList=='true')
<th id="attributeName">$encoder.htmlEncode($programAttribute.attribute.displayName)</th>
#end
@@ -76,7 +76,7 @@
$nr
</td>
#if($program)
- #foreach( $programAttribute in $program.attributes )
+ #foreach( $programAttribute in $program.programAttributes )
#set($value="")
#if($programAttribute.displayInList=='true')
<td style="cursor:pointer;" onclick="javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetParamsByProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetParamsByProgramAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetParamsByProgramAction.java 2014-07-27 15:02:58 +0000
@@ -110,7 +110,7 @@
for ( Program _program : programs )
{
- attributes.removeAll( _program.getAttributes() );
+ attributes.removeAll( _program.getProgramAttributes() );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java 2014-05-16 07:52:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java 2014-07-27 15:02:58 +0000
@@ -164,13 +164,13 @@
for ( Program program : programs )
{
- attributes.removeAll( program.getAttributes() );
+ attributes.removeAll( program.getProgramAttributes() );
}
}
else
{
program = programService.getProgram( programId );
- programAttributes = program.getAttributes();
+ programAttributes = program.getProgramAttributes();
registrationForm = formService.getFormsWithProgram( program );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java 2014-07-12 21:07:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java 2014-07-27 15:02:58 +0000
@@ -176,7 +176,7 @@
{
this.mandatory = mandatory;
}
-
+
private Boolean ignoreOverdueEvents;
public void setIgnoreOverdueEvents( Boolean ignoreOverdueEvents )
@@ -304,7 +304,7 @@
RelationshipType relationshipType = relationshipTypeService.getRelationshipType( relationshipTypeId );
program.setRelationshipType( relationshipType );
}
-
+
program.setRelationshipFromA( relationshipFromA );
program.setRelationshipText( relationshipText );
@@ -313,7 +313,7 @@
TrackedEntity trackedEntity = trackedEntityService.getTrackedEntity( trackedEntityId );
program.setTrackedEntity( trackedEntity );
}
-
+
programService.addProgram( program );
int index = 0;
@@ -327,9 +327,9 @@
.parseInt( ids[1] ) );
ProgramTrackedEntityAttribute programAttribute = new ProgramTrackedEntityAttribute( attribute,
- index + 1, personDisplayNames.get( index ), mandatory.get( index ), allowFutureDate.get( index ) );
+ personDisplayNames.get( index ), mandatory.get( index ), allowFutureDate.get( index ) );
- program.getAttributes().add( programAttribute );
+ program.getProgramAttributes().add( programAttribute );
}
index++;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java 2014-03-26 12:59:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java 2014-07-27 15:02:58 +0000
@@ -199,7 +199,7 @@
availableAttributes = new ArrayList<TrackedEntityAttribute>( attributeService.getAllTrackedEntityAttributes() );
- for ( ProgramTrackedEntityAttribute programAttribue : program.getAttributes() )
+ for ( ProgramTrackedEntityAttribute programAttribue : program.getProgramAttributes() )
{
availableAttributes.remove( programAttribue.getAttribute() );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java 2014-06-21 09:02:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java 2014-07-27 15:02:58 +0000
@@ -344,9 +344,9 @@
program.setTrackedEntity( null );
}
- if ( program.getAttributes() != null )
+ if ( program.getProgramAttributes() != null )
{
- program.getAttributes().clear();
+ program.getProgramAttributes().clear();
}
int index = 0;
@@ -360,8 +360,8 @@
TrackedEntityAttribute attribute = attributeService.getTrackedEntityAttribute( Integer
.parseInt( ids[1] ) );
ProgramTrackedEntityAttribute programAttribute = new ProgramTrackedEntityAttribute( attribute,
- index + 1, personDisplayNames.get( index ), mandatory.get( index ), allowFutureDate.get( index ) );
- program.getAttributes().add( programAttribute );
+ personDisplayNames.get( index ), mandatory.get( index ), allowFutureDate.get( index ) );
+ program.getProgramAttributes().add( programAttribute );
}
index++;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm 2014-06-21 09:56:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm 2014-07-27 15:02:58 +0000
@@ -256,7 +256,7 @@
#end
var attrOptions = "";
- #foreach($programAttribute in $program.attributes)
+ #foreach($programAttribute in $program.programAttributes)
attrOptions+="<option value={attributeid=$programAttribute.attribute.uid}>$programAttribute.attribute.displayName</option>";
#end
</script>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addValidationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addValidationCriteria.vm 2014-06-11 04:53:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addValidationCriteria.vm 2014-07-27 15:02:58 +0000
@@ -23,7 +23,7 @@
<td>
<select id='property' name='property' style='width:120px' onChange="showDivValue();">
<option value="" selected="selected">[$i18n.getString( "please_select" )]</option>
- #foreach($programAttribute in $program.attributes)
+ #foreach($programAttribute in $program.programAttributes)
#if( $programAttribute.attribute.valueType!='trackerAssociate')
#set($opt="")
#foreach($option in $programAttribute.attribute.optionSet.options)
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm 2014-06-22 11:20:48 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm 2014-07-27 15:02:58 +0000
@@ -288,7 +288,7 @@
</tr>
</thead>
<tbody id="selectedList" #if($program.type==3) style="display:none;" #end>
- #foreach( $programAttribute in $program.attributes )
+ #foreach( $programAttribute in $program.programAttributes )
#set($attribute = $programAttribute.attribute)
<tr ondblclick="unSelectProperties( this )" id="attr_$programAttribute.attribute.id">
<td onmousedown="select(event, this)">$encoder.htmlEncode( $attribute.name )</td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm 2014-06-21 09:56:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm 2014-07-27 15:02:58 +0000
@@ -245,7 +245,7 @@
<script type="text/javascript">
var attrOptions = "";
- #foreach($programAttribute in $programStage.program.attributes)
+ #foreach($programAttribute in $programStage.program.programAttributes)
attrOptions+="<option value={attributeid=$programAttribute.attribute.uid}>$programAttribute.attribute.displayName</option>";
#end
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateValidationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateValidationCriteria.vm 2014-06-11 04:53:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateValidationCriteria.vm 2014-07-27 15:02:58 +0000
@@ -27,7 +27,7 @@
<select id='property' name='property' style='width:120px' onChange="showDivValue();">
<option value="" selected="selected">[$i18n.getString( "please_select" )]</option>
#set($attribute = '')
- #foreach($programAttribute in $program.attributes)
+ #foreach($programAttribute in $program.programAttributes)
#if( $programAttribute.attribute.valueType!='trackerAssociate')
set($opt="")
#foreach($option in $programAttribute.attribute.optionSet.options)