=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRepeatableEventRegistrationFormAction.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRepeatableEventRegistrationFormAction.java 2012-05-26 12:31:07 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRepeatableEventRegistrationFormAction.java 2012-05-30 08:49:09 +0000 @@ -89,6 +89,18 @@ { this.programStage = programStage; } + + private Integer currentProgramStageInstanceId; + + public Integer getCurrentProgramStageInstanceId() + { + return currentProgramStageInstanceId; + } + + public void setCurrentProgramStageInstanceId( Integer currentProgramStageInstanceId ) + { + this.currentProgramStageInstanceId = currentProgramStageInstanceId; + } @Override public String execute() === removed file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEvemtAction.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEvemtAction.java 2012-05-26 12:31:07 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEvemtAction.java 1970-01-01 00:00:00 +0000 @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2004-2012, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package org.hisp.dhis.light.namebaseddataentry.action; - -import org.hisp.dhis.program.ProgramInstance; -import org.hisp.dhis.program.ProgramInstanceService; -import org.hisp.dhis.program.ProgramStage; -import org.hisp.dhis.program.ProgramStageInstance; -import org.hisp.dhis.program.ProgramStageInstanceService; -import org.hisp.dhis.program.ProgramStageService; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; -import com.opensymphony.xwork2.Action; - -public class SaveRepeatableEvemtAction - implements Action -{ - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ProgramInstanceService programInstanceService; - - public ProgramInstanceService getProgramInstanceService() - { - return programInstanceService; - } - - public void setProgramInstanceService( ProgramInstanceService programInstanceService ) - { - this.programInstanceService = programInstanceService; - } - - private ProgramStageService programStageService; - - public ProgramStageService getProgramStageService() - { - return programStageService; - } - - public void setProgramStageService( ProgramStageService programStageService ) - { - this.programStageService = programStageService; - } - - private ProgramStageInstanceService programStageInstanceService; - - public ProgramStageInstanceService getProgramStageInstanceService() - { - return programStageInstanceService; - } - - public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) - { - this.programStageInstanceService = programStageInstanceService; - } - - // ------------------------------------------------------------------------- - // Input & Output - // ------------------------------------------------------------------------- - - private Integer programInstanceId; - - public Integer getProgramInstanceId() - { - return programInstanceId; - } - - public void setProgramInstanceId( Integer programInstanceId ) - { - this.programInstanceId = programInstanceId; - } - - private Integer programStageId; - - public Integer getProgramStageId() - { - return programStageId; - } - - public void setProgramStageId( Integer programStageId ) - { - this.programStageId = programStageId; - } - - private String nextDueDate; - - public String getNextDueDate() - { - return nextDueDate; - } - - public void setNextDueDate( String nextDueDate ) - { - this.nextDueDate = nextDueDate; - } - - public Integer currentProgramStageInstanceId; - - public Integer getCurrentProgramStageInstanceId() - { - return currentProgramStageInstanceId; - } - - public void setCurrentProgramStageInstanceId( Integer currentProgramStageInstanceId ) - { - this.currentProgramStageInstanceId = currentProgramStageInstanceId; - } - - @Override - public String execute() - throws Exception - { - ProgramStageInstance currentStageInstance = programStageInstanceService - .getProgramStageInstance( currentProgramStageInstanceId ); - DateTimeFormatter sdf = ISODateTimeFormat.yearMonthDay(); - ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId ); - ProgramStage programStage = programStageService.getProgramStage( programStageId ); - - ProgramStageInstance programStageInstance = new ProgramStageInstance(); - programStageInstance.setDueDate( sdf.parseDateTime( nextDueDate ).toDate() ); - programStageInstance.setProgramInstance( programInstance ); - programStageInstance.setProgramStage( programStage ); - programStageInstance.setStageInProgram( currentStageInstance.getStageInProgram() ); - - programStageInstanceService.addProgramStageInstance( programStageInstance ); - return SUCCESS; - } -} === added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEventAction.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEventAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEventAction.java 2012-05-30 08:49:09 +0000 @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2004-2012, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package org.hisp.dhis.light.namebaseddataentry.action; + +import org.hisp.dhis.program.ProgramInstance; +import org.hisp.dhis.program.ProgramInstanceService; +import org.hisp.dhis.program.ProgramStage; +import org.hisp.dhis.program.ProgramStageInstance; +import org.hisp.dhis.program.ProgramStageInstanceService; +import org.hisp.dhis.program.ProgramStageService; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; +import com.opensymphony.xwork2.Action; + +public class SaveRepeatableEventAction + implements Action +{ + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private ProgramInstanceService programInstanceService; + + public ProgramInstanceService getProgramInstanceService() + { + return programInstanceService; + } + + public void setProgramInstanceService( ProgramInstanceService programInstanceService ) + { + this.programInstanceService = programInstanceService; + } + + private ProgramStageService programStageService; + + public ProgramStageService getProgramStageService() + { + return programStageService; + } + + public void setProgramStageService( ProgramStageService programStageService ) + { + this.programStageService = programStageService; + } + + private ProgramStageInstanceService programStageInstanceService; + + public ProgramStageInstanceService getProgramStageInstanceService() + { + return programStageInstanceService; + } + + public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) + { + this.programStageInstanceService = programStageInstanceService; + } + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private Integer programInstanceId; + + public Integer getProgramInstanceId() + { + return programInstanceId; + } + + public void setProgramInstanceId( Integer programInstanceId ) + { + this.programInstanceId = programInstanceId; + } + + private Integer programStageId; + + public Integer getProgramStageId() + { + return programStageId; + } + + public void setProgramStageId( Integer programStageId ) + { + this.programStageId = programStageId; + } + + private String nextDueDate; + + public String getNextDueDate() + { + return nextDueDate; + } + + public void setNextDueDate( String nextDueDate ) + { + this.nextDueDate = nextDueDate; + } + + public Integer currentProgramStageInstanceId; + + public Integer getCurrentProgramStageInstanceId() + { + return currentProgramStageInstanceId; + } + + public void setCurrentProgramStageInstanceId( Integer currentProgramStageInstanceId ) + { + this.currentProgramStageInstanceId = currentProgramStageInstanceId; + } + + @Override + public String execute() + throws Exception + { + ProgramStageInstance currentStageInstance = programStageInstanceService + .getProgramStageInstance( currentProgramStageInstanceId ); + DateTimeFormatter sdf = ISODateTimeFormat.yearMonthDay(); + ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId ); + ProgramStage programStage = programStageService.getProgramStage( programStageId ); + + ProgramStageInstance programStageInstance = new ProgramStageInstance(); + programStageInstance.setDueDate( sdf.parseDateTime( nextDueDate ).toDate() ); + programStageInstance.setProgramInstance( programInstance ); + programStageInstance.setProgramStage( programStage ); + programStageInstance.setStageInProgram( currentStageInstance.getStageInProgram() ); + + programStageInstanceService.addProgramStageInstance( programStageInstance ); + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2012-05-26 12:31:07 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2012-05-30 08:49:09 +0000 @@ -248,8 +248,8 @@ + id="org.hisp.dhis.light.namebaseddataentry.action.SaveRepeatableEventAction" + class="org.hisp.dhis.light.namebaseddataentry.action.SaveRepeatableEventAction"> === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/repeatableEventRegistrationForm.vm' --- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/repeatableEventRegistrationForm.vm 2012-05-26 12:31:07 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/repeatableEventRegistrationForm.vm 2012-05-30 08:49:09 +0000 @@ -1,8 +1,9 @@

$i18n.getString( "register_due_date_for" ) $programStage.getName()

-
+
- - + + +

#if( $validationMap.get( "enrollmentDate" ) ) @@ -14,7 +15,7 @@

- +

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java 2012-05-30 08:49:09 +0000 @@ -98,6 +98,18 @@ { this.attributes = attributes; } + + private List allAttributes; + + public List getAllAttributes() + { + return allAttributes; + } + + public void setAllAttributes( List allAttributes ) + { + this.allAttributes = allAttributes; + } private PatientMobileSetting setting; @@ -110,7 +122,7 @@ { this.setting = setting; } - + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -120,6 +132,7 @@ throws Exception { attributes = patientAttributeService.getAllPatientAttributes(); + allAttributes = new ArrayList(attributes); Collection paSettings = new HashSet( patientMobileSettingService .getCurrentSetting() ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java 2012-05-29 15:37:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java 2012-05-30 08:49:09 +0000 @@ -98,6 +98,18 @@ this.birthdate = birthdate; } + private Integer groupingAttributeId; + + public Integer getGroupingAttributeId() + { + return groupingAttributeId; + } + + public void setGroupingAttributeId( Integer groupingAttributeId ) + { + this.groupingAttributeId = groupingAttributeId; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -163,6 +175,19 @@ patientMobileSettingService.savePatientMobileSetting( setting ); } } + + Collection allPatientAttributes = patientAttributeService.getAllPatientAttributes(); + + for ( PatientAttribute patientAttribute : allPatientAttributes ) + { + patientAttribute.setGroupBy( false ); + if ( patientAttribute.getId() == groupingAttributeId ) + { + patientAttribute.setGroupBy( true ); + } + patientAttributeService.updatePatientAttribute( patientAttribute ); + } + return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/org/hisp/dhis/mobile/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/org/hisp/dhis/mobile/i18n_module.properties 2012-05-30 07:22:33 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/org/hisp/dhis/mobile/i18n_module.properties 2012-05-30 08:49:09 +0000 @@ -94,4 +94,6 @@ registering_unit=Registering Unit search_by_name_identifier=Search by name or identifier search_by_program=Search by program -please_select_village=Please select village \ No newline at end of file +please_select_village=Please select village +please_select=Please Select +activity_grouping_attribute=Activity Grouping Attribute \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/patientSettings.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/patientSettings.vm 2012-05-29 15:37:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/patientSettings.vm 2012-05-30 08:49:09 +0000 @@ -23,6 +23,17 @@ $i18n.getString( "registration_date" ) + + $i18n.getString( "activity_grouping_attribute" ) + + + +