=== 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 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2012-09-22 12:23:40 +0000 @@ -27,8 +27,8 @@ package org.hisp.dhis.program; -import java.util.Collection; import java.util.HashSet; +import java.util.List; import java.util.Set; import org.apache.commons.lang.StringUtils; @@ -88,9 +88,9 @@ private Boolean displayIncidentDate; - private Collection patientIdentifierTypes; + private List patientIdentifierTypes; - private Collection patientAttributes; + private List patientAttributes; // ------------------------------------------------------------------------- // Constructors @@ -253,22 +253,22 @@ this.patientValidationCriteria = patientValidationCriteria; } - public Collection getPatientIdentifierTypes() + public List getPatientIdentifierTypes() { return patientIdentifierTypes; } - public void setPatientIdentifierTypes( Collection patientIdentifierTypes ) + public void setPatientIdentifierTypes( List patientIdentifierTypes ) { this.patientIdentifierTypes = patientIdentifierTypes; } - public Collection getPatientAttributes() + public List getPatientAttributes() { return patientAttributes; } - public void setPatientAttributes( Collection patientAttributes ) + public void setPatientAttributes( List patientAttributes ) { this.patientAttributes = patientAttributes; } === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2012-09-22 12:23:40 +0000 @@ -45,15 +45,19 @@ - - - - - - - - - + + + + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java 2012-09-07 07:57:47 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java 2012-09-22 12:23:40 +0000 @@ -83,7 +83,7 @@ private Collection programStageInstances = new ArrayList(); - private Collection identifierTypes; + private List identifierTypes; private Collection noGroupAttributes = new HashSet(); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-09-22 09:44:30 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-09-22 12:23:40 +0000 @@ -30,7 +30,7 @@ - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java 2012-09-07 09:18:04 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java 2012-09-22 12:23:40 +0000 @@ -28,9 +28,7 @@ package org.hisp.dhis.patient.action.program; import java.util.ArrayList; -import java.util.Collection; import java.util.Date; -import java.util.HashSet; import java.util.List; import org.hisp.dhis.patient.Patient; @@ -192,8 +190,8 @@ program.setDisplayProvidedOtherFacility( displayProvidedOtherFacility ); program.setDisplayIncidentDate( displayIncidentDate ); - Collection identifierTypes = new HashSet(); - Collection patientAttributes = new HashSet(); + List identifierTypes = new ArrayList(); + List patientAttributes = new ArrayList(); int index = 0; for ( String selectedPropertyId : selectedPropertyIds ) { === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowUpdateProgramFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowUpdateProgramFormAction.java 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowUpdateProgramFormAction.java 2012-09-22 12:23:40 +0000 @@ -28,11 +28,11 @@ package org.hisp.dhis.patient.action.program; import java.util.Collection; +import java.util.HashSet; import java.util.List; import org.hisp.dhis.organisationunit.OrganisationUnitGroup; import org.hisp.dhis.organisationunit.OrganisationUnitLevel; -import org.hisp.dhis.oust.manager.SelectionTreeManager; import org.hisp.dhis.patient.PatientAttribute; import org.hisp.dhis.patient.PatientAttributeService; import org.hisp.dhis.patient.PatientIdentifierType; @@ -166,8 +166,8 @@ for ( Program program : programs ) { - availableIdentifierTypes.removeAll( program.getPatientIdentifierTypes() ); - availableAttributes.removeAll( program.getPatientAttributes() ); + availableIdentifierTypes.removeAll( new HashSet( program.getPatientIdentifierTypes() ) ); + availableAttributes.removeAll( new HashSet( program.getPatientAttributes() ) ); } return SUCCESS; === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java 2012-09-22 12:23:40 +0000 @@ -28,8 +28,6 @@ package org.hisp.dhis.patient.action.program; import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; import java.util.List; import org.hisp.dhis.patient.Patient; @@ -188,8 +186,8 @@ program.setDisplayProvidedOtherFacility( displayProvidedOtherFacility ); program.setDisplayIncidentDate(displayIncidentDate); - Collection identifierTypes = new HashSet(); - Collection patientAttributes = new HashSet(); + List identifierTypes = new ArrayList(); + List patientAttributes = new ArrayList(); int index = 0; for( String selectedPropertyId : selectedPropertyIds ) { === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2012-09-22 12:23:40 +0000 @@ -109,6 +109,10 @@ + +

+

+ === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2012-09-17 06:40:26 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2012-09-22 12:23:40 +0000 @@ -161,4 +161,47 @@ } } return ctrlPressed; +} + +//----------------------------------------------------------------------------- +//Move Table Row Up and Down +//----------------------------------------------------------------------------- + +function moveUpPropertyList() +{ + var selectedList = jQuery("#selectedList"); + + jQuery("#selectedList").find("tr").each( function( i, item ){ + item = jQuery(item); + if( item.hasClass("selected") ) + { + var prev = item.prev('#selectedList tr'); + if (prev.length == 1) + { + prev.before(item); + } + } + }); +} + +function moveDownPropertyList() +{ + var selectedList = jQuery("#selectedList"); + var items = new Array(); + jQuery("#selectedList").find("tr").each( function( i, item ){ + items.push(jQuery(item)); + }); + + for( var i=items.length-1;i>=0;i--) + { + var item = items[i]; + if( item.hasClass("selected") ) + { + var next = item.next('#selectedList tr'); + if (next.length == 1) + { + next.after(item); + } + } + } } \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2012-09-22 12:23:40 +0000 @@ -127,6 +127,10 @@ + +

+

+