dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31935
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16319: Program, for now updating program version on update
------------------------------------------------------------
revno: 16319
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-08-05 13:27:57 +0200
message:
Program, for now updating program version on update
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.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 2014-07-27 15:02:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2014-08-05 11:27:57 +0000
@@ -212,6 +212,12 @@
return null;
}
+
+ public Program increaseVersion()
+ {
+ version = version != null ? version + 1 : 1;
+ return this;
+ }
// -------------------------------------------------------------------------
// Getters and setters
=== 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-07-27 15:02:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java 2014-08-05 11:27:57 +0000
@@ -105,18 +105,6 @@
this.description = description;
}
- private Integer version;
-
- public Integer getVersion()
- {
- return version;
- }
-
- public void setVersion( Integer version )
- {
- this.version = version;
- }
-
private String dateOfEnrollmentDescription;
public void setDateOfEnrollmentDescription( String dateOfEnrollmentDescription )
@@ -299,7 +287,6 @@
Program program = programService.getProgram( id );
program.setName( name );
program.setDescription( description );
- program.setVersion( version );
program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription );
program.setDateOfIncidentDescription( dateOfIncidentDescription );
program.setType( type );
@@ -373,6 +360,8 @@
program.setRelatedProgram( relatedProgram );
}
+ program.increaseVersion(); //TODO make more fine-grained
+
programService.updateProgram( program );
return SUCCESS;