=== 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-11-19 04:01:09 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2015-11-27 16:04:36 +0000 @@ -36,6 +36,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.google.common.collect.Sets; import org.hisp.dhis.common.BaseIdentifiableObject; +import org.hisp.dhis.common.BaseNameableObject; import org.hisp.dhis.common.DxfNamespaces; import org.hisp.dhis.common.IdentifiableObject; import org.hisp.dhis.common.MergeStrategy; @@ -65,7 +66,7 @@ */ @JacksonXmlRootElement( localName = "program", namespace = DxfNamespaces.DXF_2_0 ) public class Program - extends BaseIdentifiableObject + extends BaseNameableObject implements VersionedObject { private String description; === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramDataElement.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramDataElement.java 2015-11-26 21:26:54 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramDataElement.java 2015-11-27 16:04:36 +0000 @@ -82,7 +82,7 @@ @Override public String getShortName() { - return program.getDisplayName() + " " + dataElement.getDisplayShortName(); + return program.getDisplayShortName() + " " + dataElement.getDisplayShortName(); } @JsonProperty === 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 2015-11-26 21:26:54 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java 2015-11-27 16:04:36 +0000 @@ -112,7 +112,7 @@ @Override public String getShortName() { - return program.getDisplayName() + " " + attribute.getDisplayShortName(); + return program.getDisplayShortName() + " " + attribute.getDisplayShortName(); } @JsonProperty === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-11-27 09:40:25 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-11-27 16:04:36 +0000 @@ -717,6 +717,7 @@ executeSql( "UPDATE optionset SET version=0 WHERE version IS NULL" ); executeSql( "UPDATE dataset SET version=0 WHERE version IS NULL" ); executeSql( "UPDATE program SET version=0 WHERE version IS NULL" ); + executeSql( "update program set shortname = substring(name,0,50) where shortname is null" ); executeSql( "update program set categorycomboid = " + defaultCategoryComboId + " where categorycomboid is null" ); executeSql( "update programstageinstance set attributeoptioncomboid = " + defaultOptionComboId + " where attributeoptioncomboid is null" ); === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2015-11-23 06:52:49 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2015-11-27 16:04:36 +0000 @@ -16,6 +16,8 @@ &identifiableProperties; + + === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2015-10-23 08:32:36 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2015-11-27 16:04:36 +0000 @@ -455,6 +455,10 @@ "required" : true, "rangelength" : [ 2, 230 ] }, + "shortName" : { + "required" : true, + "rangelength" : [ 2, 50 ] + }, "trackedEntityId" : { "required" : true }, === 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 2015-11-23 06:52:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java 2015-11-27 16:04:36 +0000 @@ -101,6 +101,13 @@ { this.name = name; } + + private String shortName; + + public void setShortName( String shortName ) + { + this.shortName = shortName; + } private String description; @@ -274,6 +281,7 @@ Program program = new Program(); program.setName( StringUtils.trimToNull( name ) ); + program.setShortName( StringUtils.trimToNull( shortName ) ); program.setDescription( StringUtils.trimToNull( description ) ); program.setVersion( 1 ); program.setEnrollmentDateLabel( StringUtils.trimToNull( enrollmentDateLabel ) ); === 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 2015-11-23 06:52:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java 2015-11-27 16:04:36 +0000 @@ -95,6 +95,13 @@ this.name = name; } + private String shortName; + + public void setShortName( String shortName ) + { + this.shortName = shortName; + } + private String description; public void setDescription( String description ) @@ -297,6 +304,7 @@ Program program = programService.getProgram( id ); program.setName( StringUtils.trimToNull( name ) ); + program.setShortName( StringUtils.trimToNull( shortName ) ); program.setDescription( StringUtils.trimToNull( description ) ); program.setEnrollmentDateLabel( StringUtils.trimToNull( enrollmentDateLabel ) ); program.setIncidentDateLabel( StringUtils.trimToNull( incidentDateLabel ) ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm 2015-11-18 14:08:06 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm 2015-11-27 16:04:36 +0000 @@ -80,6 +80,12 @@ + + + + + + === 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 2015-11-18 14:08:06 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm 2015-11-27 16:04:36 +0000 @@ -83,6 +83,12 @@ + + + + + +