=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java' --- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java 2014-04-23 20:15:31 +0000 +++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java 2014-04-23 23:45:11 +0000 @@ -161,7 +161,8 @@ { if ( !organisationUnit.hasLevel() ) { - organisationUnit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ) ); + organisationUnit + .setLevel( organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ) ); } } @@ -175,12 +176,14 @@ { if ( params.hasProgram() ) { - params.addAttributesIfNotExist( QueryItem.getQueryItems( params.getProgram().getTrackedEntityAttributes() ) ); + params.addAttributesIfNotExist( QueryItem.getQueryItems( params.getProgram() + .getTrackedEntityAttributes() ) ); } else { Collection filters = attributeService.getAllTrackedEntityAttributes(); - Collection attributes = attributeService.getTrackedEntityAttributesDisplayInList( true ); + Collection attributes = attributeService + .getTrackedEntityAttributesDisplayInList( true ); filters.removeAll( attributes ); params.addAttributesIfNotExist( QueryItem.getQueryItems( attributes ) ); @@ -414,7 +417,8 @@ { return getItem( item, null, null ); } - else // Filter + else + // Filter { String[] split = item.split( DimensionalObjectUtils.DIMENSION_NAME_SEP ); === removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 1970-01-01 00:00:00 +0000 @@ -1,231 +0,0 @@ -package org.hisp.dhis.caseentry.action.caseentry; - -/* - * Copyright (c) 2004-2014, 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. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; - -import org.hisp.dhis.common.Grid; -import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; -import org.hisp.dhis.paging.ActionPagingSupport; -import org.hisp.dhis.program.Program; -import org.hisp.dhis.program.ProgramInstance; -import org.hisp.dhis.program.ProgramService; -import org.hisp.dhis.program.ProgramStageInstance; -import org.hisp.dhis.program.ProgramStageInstanceService; -import org.hisp.dhis.trackedentity.TrackedEntityInstance; -import org.hisp.dhis.trackedentity.TrackedEntityAttribute; -import org.hisp.dhis.trackedentity.TrackedEntityInstanceService; - -public class GetDataRecordsAction - extends ActionPagingSupport -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitSelectionManager selectionManager; - - public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) - { - this.selectionManager = selectionManager; - } - - private TrackedEntityInstanceService entityInstanceService; - - public void setEntityInstanceService( TrackedEntityInstanceService entityInstanceService ) - { - this.entityInstanceService = entityInstanceService; - } - - private ProgramService programService; - - public void setProgramService( ProgramService programService ) - { - this.programService = programService; - } - - private ProgramStageInstanceService programStageInstanceService; - - public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) - { - this.programStageInstanceService = programStageInstanceService; - } - - private I18n i18n; - - public void setI18n( I18n i18n ) - { - this.i18n = i18n; - } - - // ------------------------------------------------------------------------- - // Input/output - // ------------------------------------------------------------------------- - - private String programId; - - public void setProgramId( String programId ) - { - this.programId = programId; - } - - private List searchTexts = new ArrayList(); - - public void setSearchTexts( List searchTexts ) - { - this.searchTexts = searchTexts; - } - - private Integer total; - - public Integer getTotal() - { - return total; - } - - private Map programInstanceMap = new HashMap(); - - public Map getProgramInstanceMap() - { - return programInstanceMap; - } - - private Collection entityInstances; - - public Collection getEntityInstances() - { - return entityInstances; - } - - private List programStageInstances = new ArrayList(); - - public List getProgramStageInstances() - { - return programStageInstances; - } - - private List attributes = new ArrayList(); - - public List getAttributes() - { - return attributes; - } - - private Program program; - - public Program getProgram() - { - return program; - } - - private String type; - - public void setType( String type ) - { - this.type = type; - } - - private Grid grid; - - public Grid getGrid() - { - return grid; - } - - private Boolean followup; - - public void setFollowup( Boolean followup ) - { - this.followup = followup; - } - - private Boolean trackingReport; - - public void setTrackingReport( Boolean trackingReport ) - { - this.trackingReport = trackingReport; - } - - // ------------------------------------------------------------------------- - // Implementation Action - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { -// OrganisationUnit orgunit = selectionManager.getSelectedOrganisationUnit(); -// -// Collection orgunits = new HashSet(); -// orgunits.add( orgunit ); -// -// if ( programId != null ) -// { -// program = programService.getProgram( programId ); -// } -// -// if ( searchTexts.size() > 0 ) -// { -// if ( type == null ) -// { -// total = entityInstanceService.countSearchTrackedEntityInstances( searchTexts, orgunits, followup, -// ProgramInstance.STATUS_ACTIVE ); -// this.paging = createPaging( total ); -// -// List stageInstanceIds = entityInstanceService.getProgramStageInstances( searchTexts, orgunits, -// followup, ProgramInstance.STATUS_ACTIVE, paging.getStartPos(), paging.getPageSize() ); -// -// for ( Integer stageInstanceId : stageInstanceIds ) -// { -// ProgramStageInstance programStageInstance = programStageInstanceService -// .getProgramStageInstance( stageInstanceId ); -// programStageInstances.add( programStageInstance ); -// } -// } -// else if ( trackingReport != null && trackingReport ) -// { -// grid = entityInstanceService.getTrackingEventsReport( program, searchTexts, orgunits, followup, -// ProgramInstance.STATUS_ACTIVE, i18n ); -// } -// else -// { -// grid = entityInstanceService.getScheduledEventsReport( searchTexts, orgunits, followup, -// ProgramInstance.STATUS_ACTIVE, null, null, i18n ); -// } -// } - - return type == null ? SUCCESS : type; - } -} === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramStageInstanceByIdAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramStageInstanceByIdAction.java 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramStageInstanceByIdAction.java 2014-04-23 23:45:11 +0000 @@ -56,9 +56,9 @@ // Getter && Setter // ------------------------------------------------------------------------- - private Integer programStageInstanceId; + private String programStageInstanceId; - public void setProgramStageInstanceId( Integer programStageInstanceId ) + public void setProgramStageInstanceId( String programStageInstanceId ) { this.programStageInstanceId = programStageInstanceId; } === removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java 1970-01-01 00:00:00 +0000 @@ -1,204 +0,0 @@ -package org.hisp.dhis.caseentry.action.reminder; - -/* - * Copyright (c) 2004-2014, 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. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; -import org.hisp.dhis.program.ProgramInstance; -import org.hisp.dhis.program.ProgramStageInstanceService; -import org.hisp.dhis.sms.SmsSender; -import org.hisp.dhis.sms.SmsServiceException; -import org.hisp.dhis.sms.outbound.OutboundSms; -import org.hisp.dhis.trackedentity.TrackedEntityInstanceService; -import org.hisp.dhis.user.CurrentUserService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * - * @version SendSmsToListAction.java 13:29:34 AM Aug 16, 2012 $ - */ -public class SendSmsToListAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitSelectionManager selectionManager; - - private TrackedEntityInstanceService entityInstanceService; - - private SmsSender smsSender; - - private ProgramStageInstanceService programStageInstanceService; - - private CurrentUserService currentUserService; - - private I18n i18n; - - // ------------------------------------------------------------------------- - // Input/output - // ------------------------------------------------------------------------- - - private List searchTexts = new ArrayList(); - - private Boolean searchBySelectedOrgunit; - - private Boolean searchByUserOrgunits; - - private Boolean followup; - - // ------------------------------------------------------------------------- - // Getters && Setters - // ------------------------------------------------------------------------- - - public void setCurrentUserService( CurrentUserService currentUserService ) - { - this.currentUserService = currentUserService; - } - - public void setSmsSender( SmsSender smsSender ) - { - this.smsSender = smsSender; - } - - public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) - { - this.programStageInstanceService = programStageInstanceService; - } - - public void setI18n( I18n i18n ) - { - this.i18n = i18n; - } - - public void setFollowup( Boolean followup ) - { - this.followup = followup; - } - - public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) - { - this.selectionManager = selectionManager; - } - - public void setSearchBySelectedOrgunit( Boolean searchBySelectedOrgunit ) - { - this.searchBySelectedOrgunit = searchBySelectedOrgunit; - } - - public void setSearchByUserOrgunits( Boolean searchByUserOrgunits ) - { - this.searchByUserOrgunits = searchByUserOrgunits; - } - - public void setEntityInstanceService( TrackedEntityInstanceService entityInstanceService ) - { - this.entityInstanceService = entityInstanceService; - } - - public void setSearchTexts( List searchTexts ) - { - this.searchTexts = searchTexts; - } - - private String msg; - - public void setMsg( String msg ) - { - this.msg = msg; - } - - private String message = ""; - - public String getMessage() - { - return message; - } - - // ------------------------------------------------------------------------- - // Action Implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit(); - Collection orgunits = new HashSet(); - - if ( searchByUserOrgunits ) - { - Collection userOrgunits = currentUserService.getCurrentUser().getOrganisationUnits(); - orgunits.addAll( userOrgunits ); - } - else if ( searchBySelectedOrgunit ) - { - orgunits.add( organisationUnit ); - } - else - { - organisationUnit = null; - } - - Collection programStageInstanceIds = entityInstanceService.getProgramStageInstances( searchTexts, orgunits, - followup, ProgramInstance.STATUS_ACTIVE, null, null ); - -// Set phoneNumberList = new HashSet( entityInstanceService.getTrackedEntityInstancePhoneNumbers( searchTexts, -// orgunits, followup, ProgramInstance.STATUS_ACTIVE, null, null ) ); -// try -// { -// OutboundSms outboundSms = new OutboundSms(); -// outboundSms.setMessage( msg ); -// outboundSms.setRecipients( phoneNumberList ); -// outboundSms.setSender( currentUserService.getCurrentUsername() ); -// -// smsSender.sendMessage( outboundSms, null ); -// -// programStageInstanceService.updateProgramStageInstances( programStageInstanceIds, outboundSms ); -// -// message = i18n.getString( "sent_message_success" ); -// } -// catch ( SmsServiceException e ) -// { -// message = e.getMessage(); -// } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java 1970-01-01 00:00:00 +0000 @@ -1,320 +0,0 @@ -package org.hisp.dhis.caseentry.action.trackedentity; - -/* - * Copyright (c) 2004-2014, 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. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; - -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; -import org.hisp.dhis.paging.ActionPagingSupport; -import org.hisp.dhis.program.Program; -import org.hisp.dhis.program.ProgramService; -import org.hisp.dhis.trackedentity.TrackedEntityInstance; -import org.hisp.dhis.trackedentity.TrackedEntityAttribute; -import org.hisp.dhis.trackedentity.TrackedEntityAttributeService; -import org.hisp.dhis.trackedentity.TrackedEntityInstanceService; -import org.hisp.dhis.trackedentity.comparator.TrackedEntityAttributeSortOrderInListNoProgramComparator; -import org.hisp.dhis.user.CurrentUserService; -import org.hisp.dhis.user.User; -import org.hisp.dhis.user.UserService; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * @author Abyot Asalefew Gizaw - */ -public class SearchTrackedEntityInstanceAction - extends ActionPagingSupport -{ - private final String SEARCH_IN_ALL_ORGUNITS = "searchInAllOrgunits"; - - private final String SEARCH_IN_USER_ORGUNITS = "searchInUserOrgunits"; - - private final String SEARCH_IN_BELOW_SELECTED_ORGUNIT = "searchInBelowSelectedOrgunit"; - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitSelectionManager selectionManager; - - private TrackedEntityInstanceService entityInstanceService; - - private ProgramService programService; - - private CurrentUserService currentUserService; - - private OrganisationUnitService organisationUnitService; - - private UserService userService; - - @Autowired - private TrackedEntityAttributeService attributeService; - - // ------------------------------------------------------------------------- - // Input/output - // ------------------------------------------------------------------------- - - private List searchTexts = new ArrayList(); - - private Integer statusEnrollment; - - private String facilityLB; - - private boolean listAll; - - private Collection entityInstances = new ArrayList(); - - // ------------------------------------------------------------------------- - // Getters && Setters - // ------------------------------------------------------------------------- - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - public void setUserService( UserService userService ) - { - this.userService = userService; - } - - public void setCurrentUserService( CurrentUserService currentUserService ) - { - this.currentUserService = currentUserService; - } - - public void setStatusEnrollment( Integer statusEnrollment ) - { - this.statusEnrollment = statusEnrollment; - } - - public void setFacilityLB( String facilityLB ) - { - this.facilityLB = facilityLB; - } - - public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) - { - this.selectionManager = selectionManager; - } - - public void setProgramService( ProgramService programService ) - { - this.programService = programService; - } - - public void setEntityInstanceService( TrackedEntityInstanceService entityInstanceService ) - { - this.entityInstanceService = entityInstanceService; - } - - public void setSearchTexts( List searchTexts ) - { - this.searchTexts = searchTexts; - } - - public boolean isListAll() - { - return listAll; - } - - public void setListAll( boolean listAll ) - { - this.listAll = listAll; - } - - public Collection getEntityInstances() - { - return entityInstances; - } - - private Integer total; - - public Integer getTotal() - { - return total; - } - - private Map mapEntityInstanceOrgunit = new HashMap(); - - public Map getMapEntityInstanceOrgunit() - { - return mapEntityInstanceOrgunit; - } - - private Integer programId; - - public void setProgramId( Integer programId ) - { - this.programId = programId; - } - - private OrganisationUnit organisationUnit; - - public OrganisationUnit getOrganisationUnit() - { - return organisationUnit; - } - - private Map mapUsers = new HashMap(); - - public Map getMapUsers() - { - return mapUsers; - } - - private Program program; - - public Program getProgram() - { - return program; - } - - private List attributes; - - public List getAttributes() - { - return attributes; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { -// organisationUnit = selectionManager.getSelectedOrganisationUnit(); -// -// Collection orgunits = new HashSet(); -// -// if ( programId != null ) -// { -// program = programService.getProgram( programId ); -// } -// else -// { -// attributes = new ArrayList( -// attributeService.getTrackedEntityAttributesDisplayInList( true ) ); -// Collections.sort( attributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() ); -// } -// -// // List all entityInstances -// if ( listAll ) -// { -// total = entityInstanceService.countGetTrackedEntityInstancesByOrgUnit( organisationUnit ); -// this.paging = createPaging( total ); -// -// entityInstances = new ArrayList( entityInstanceService.getTrackedEntityInstances( -// organisationUnit, paging.getStartPos(), paging.getPageSize() ) ); -// } -// // search entityInstances -// else if ( searchTexts.size() > 0 ) -// { -// // selected orgunit -// if ( facilityLB == null || facilityLB.isEmpty() ) -// { -// orgunits.add( organisationUnit ); -// } -// else if ( facilityLB.equals( SEARCH_IN_USER_ORGUNITS ) ) -// { -// Collection userOrgunits = currentUserService.getCurrentUser().getOrganisationUnits(); -// orgunits.addAll( userOrgunits ); -// } -// else if ( facilityLB.equals( SEARCH_IN_BELOW_SELECTED_ORGUNIT ) ) -// { -// Collection orgunitIds = organisationUnitService.getOrganisationUnitHierarchy().getChildren( -// organisationUnit.getId() ); -// orgunits.add( organisationUnit ); -// orgunits.addAll( organisationUnitService.getOrganisationUnits( orgunitIds ) ); -// } -// else if ( facilityLB.equals( SEARCH_IN_ALL_ORGUNITS ) ) -// { -// orgunits = null; -// } -// -// // ----------------------------------------------------------------- -// // Users by orgunits for searching -// // ----------------------------------------------------------------- -// -// Collection users = userService.getAllUsers(); -// for ( User user : users ) -// { -// mapUsers.put( user.getId() + "", user.getName() ); -// } -// -// // ----------------------------------------------------------------- -// // Searching -// // ----------------------------------------------------------------- -// -// total = entityInstanceService.countSearchTrackedEntityInstances( searchTexts, orgunits, null, -// statusEnrollment ); -// this.paging = createPaging( total ); -// entityInstances = entityInstanceService.searchTrackedEntityInstances( searchTexts, orgunits, null, null, -// statusEnrollment, paging.getStartPos(), paging.getPageSize() ); -// -// if ( facilityLB != null && !facilityLB.isEmpty() ) -// { -// for ( TrackedEntityInstance entityInstance : entityInstances ) -// { -// mapEntityInstanceOrgunit.put( entityInstance.getId(), -// getHierarchyOrgunit( entityInstance.getOrganisationUnit() ) ); -// } -// } -// -// } - - return SUCCESS; - } - - // ------------------------------------------------------------------------- - // Supportive method - // ------------------------------------------------------------------------- - - private String getHierarchyOrgunit( OrganisationUnit orgunit ) - { - String hierarchyOrgunit = orgunit.getName(); - - while ( orgunit.getParent() != null ) - { - hierarchyOrgunit = orgunit.getParent().getName() + " / " + hierarchyOrgunit; - - orgunit = orgunit.getParent(); - } - - return hierarchyOrgunit; - } -} === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2014-04-23 23:45:11 +0000 @@ -12,19 +12,6 @@ ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" /> - - - - - - - - - - - - - - - - - - - - - - - - === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2014-04-23 23:45:11 +0000 @@ -43,21 +43,6 @@ F_TRACKED_ENTITY_INSTANCE_SEARCH - - /content.vm - /dhis-web-caseentry/listTrackedEntityInstance.vm - F_TRACKED_ENTITY_INSTANCE_SEARCH - - - - /content.vm - true - /dhis-web-caseentry/listTrackedEntityInstance.vm - F_TRACKED_ENTITY_INSTANCE_SEARCH - - @@ -464,13 +449,6 @@ F_TRACKED_ENTITY_INSTANCE_MANAGEMENT - - /content.vm - /dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm - F_TRACKED_ENTITY_INSTANCE_SEARCH - - @@ -806,14 +784,6 @@ F_PROGRAM_TRACKING_MANAGEMENT - - /content.vm - /dhis-web-caseentry/programTrackingRecords.vm - style/style.css - F_PROGRAM_TRACKING_SEARCH - - /content.vm @@ -834,16 +804,6 @@ F_MOBILE_SENDSMS - - /dhis-web-commons/ajax/jsonResponseSuccess.vm - - /dhis-web-commons/ajax/jsonResponseError.vm - - plainTextError - F_MOBILE_SENDSMS - - /dhis-web-commons/ajax/jsonResponseSuccess.vm @@ -859,6 +819,12 @@ /dhis-web-caseentry/trackingEventMessage.vm style/style.css + + + /dhis-web-caseentry/jsonProgramStageInstance.vm + + @@ -923,15 +889,6 @@ F_ACTIVITY_PLAN - - /content.vm - /dhis-web-caseentry/activityPlanRecords.vm - style/style.css - - - - /dhis-web-commons/ajax/jsonResponseSuccess.vm === removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm 1970-01-01 00:00:00 +0000 @@ -1,94 +0,0 @@ - - - - - - - - -
$i18n.getString( "total_result" ):  $!total
- -#if( $programStageInstances && $programStageInstances.size()>0 ) - - - - - - - - - #if( $auth.hasAccess( "dhis-web-caseentry", "accessAttributes" ) ) - #foreach( $programAttribute in $program.programAttributes ) - #if($programAttribute.displayInList=='true') - - #end - #end - #end - - - - - - - #set( $mark = false ) - #foreach( $programStageInstance in $programStageInstances ) - #set($entityInstance = $programStageInstance.programInstance.entityInstance) - - - - - - - - #if( $auth.hasAccess( "dhis-web-caseentry", "accessAttributes" ) ) - #foreach( $programAttribute in $program.programAttributes ) - #if($programAttribute.displayInList=='true') - - #end - #end - #end - - - - - - - #end - -
#$i18n.getString('date_scheduled')$i18n.getString('orgunit')$encoder.htmlEncode($programAttribute.attribute.displayName)$i18n.getString('events')$i18n.getString('operations')
- #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount ) - $nr - - #if($!programStageInstance.executionDate) - $format.formatDate($!programStageInstance.executionDate) - #else - $format.formatDate($!programStageInstance.dueDate) - #end - - #if($!programStageInstance.executionDate) - $!programStageInstance.organisationUnit.name - #else - $entityInstance.organisationUnit.name - #end - - #foreach( $attributeValue in $entityInstance.attributeValues) - #if($!attributeValue.attribute.id==$programAttribute.attribute.id) - #set($value=$attributeValue.value) - #if( $programAttribute.attribute.valueType == 'bool') - #set($value=$i18n.getString($attributeValue.value)) - #end - #end - #end - $encoder.htmlEncode($value) - $programStageInstance.programStage.displayName - $i18n.getString( "dashboard" ) - $i18n.getString( 'data_entry' ) - $i18n.getString( "tracked_entity_instance_details_and_history" ) -
-
- #parse( "/dhis-web-commons/paging/paging.vm" ) -
- -
- -#end === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js 2014-04-23 23:45:11 +0000 @@ -64,6 +64,7 @@ success : function(json) { setInnerHTML('listEntityInstanceDiv', displayevents(json, page)); showById('listEntityInstanceDiv'); + setTableStyles(); jQuery('#loaderDiv').hide(); hideLoader(); } @@ -133,12 +134,6 @@ + "'>"
 				+ i18n_dashboard
 				+ ""; - table += ""
-				+ i18n_edit
-				+ ""; table += "" + eventDate + ""; + table += "" + eventDate + ""; } table += ""; $('#eventList').html(table); @@ -260,7 +255,7 @@ title : i18n_events, maximize : true, closable : true, - modal : false, + modal : true, width : 380, height : 290 }).show('fast'); @@ -296,28 +291,40 @@ // EntityInstance program tracking // -------------------------------------------------------------------- -function loadDataEntryDialog( programStageInstanceId, programStageUid ) +function loadDataEntryDialog( programStageInstanceId ) { - jQuery('[id=programStageInstanceId]').val(programStageInstanceId); - jQuery('.stage-object-selected').attr('psuid', programStageUid); - - $('#contentDataRecord' ).load("viewProgramStageRecords.action", { - programStageInstanceId: programStageInstanceId - }, function() { - jQuery('#programStageUid').val(programStageUid); - showById('reportDateDiv'); - showById('entityInstanceInforTB'); - showById('entryForm'); - showById('inputCriteriaDiv'); - }).dialog({ - title:i18n_program_stage, - maximize:true, - closable:true, - modal:false, - overlay:{background:'#000000', opacity:0.1}, - width:850, - height:500 - }); + $.ajax({ + type : "GET", + url : "getProgramStageInstanceByUid.action?programStageInstanceId=" + programStageInstanceId, + dataType : "json", + success : function(json) { + var psiid = json.id; + jQuery('.stage-object-selected').attr('psuid', json.programStage.uid); + jQuery('[id=programStageInstanceId]').val(psiid); + jQuery('#programStageUid').val(json.programStage.uid); + + $('#contentDataRecord' ).load("viewProgramStageRecords.action", { + programStageInstanceId: psiid + }, function( html ) { + setInnerHTML('contentDataRecord',html); + showById('reportDateDiv'); + showById('entityInstanceInforTB'); + showById('entryForm'); + showById('inputCriteriaDiv'); + entryFormContainerOnReady(); + }).dialog({ + title:i18n_program_stage, + maximize:true, + closable:true, + modal:false, + overlay:{background:'#000000', opacity:0.1}, + width:850, + height:500 + }); + } + }); + + } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2014-04-23 23:45:11 +0000 @@ -847,7 +847,7 @@ type: 'GET', dataType: 'json' } ).done(function(data) { - if( data.response=='undefined'){ + if( data.response==undefined){ $( "#programStageInstanceId" ).val( data.id ); $( "#entryFormContainer input[id='programStageInstanceId']" ).val( data.id ); $( "#entryFormContainer input[id='incidentDate']" ).val( data.programInstance.dateOfIncident ); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2014-04-23 23:45:11 +0000 @@ -272,15 +272,15 @@ var params = "orgUnit=" + getFieldValue("orgunitId"); params += "&program=" + getFieldValue('program'); params += "&trackedEntityInstance=" + teiUid; - params += '&eventStatus=' + getFieldValue('status'); + params += '&status=' + getFieldValue('status'); if( isAdvancedSearch ){ // advanced-search - params += "&eventStartDate=" + getFieldValue('startDate'); - params += "&eventEndDate=" + getFieldValue('endDate'); + params += "&startDate=" + getFieldValue('startDate'); + params += "&endDate=" + getFieldValue('endDate'); } else // list { - params += "&eventStartDate=1900-01-01"; - params += "&eventEndDate=3000-01-01"; + params += "&startDate=1900-01-01"; + params += "&endDate=3000-01-01"; } $.ajax({ @@ -369,49 +369,6 @@ } // -------------------------------------------------------------------- -// Send SMS -// -------------------------------------------------------------------- - -function showSendSmsForm() -{ - jQuery('#sendSmsToListForm').dialog({ - title: i18n_send_message, - maximize: true, - closable: true, - modal:true, - overlay:{background:'#000000', opacity:0.1}, - width: 420, - height: 200 - }); -} - -function sendSmsToList() -{ - params = getSearchParams(); - params += "&msg=" + getFieldValue( 'smsMessage' ); - params += "&programStageInstanceId=" + getFieldValue('programStageInstanceId'); - $.ajax({ - url: 'sendSMSTotList.action', - type:"POST", - data: params, - success: function( json ){ - if ( json.response == "success" ) { - var programStageName = getFieldValue('programStageName'); - var currentTime = date.getHours() + ":" + date.getMinutes(); - jQuery('#commentTB').prepend("" + getFieldValue("currentDate") + " " + currentTime + "" - + "" + programStageName + "" - + "" + getFieldValue( 'smsMessage' ) + ""); - showSuccessMessage( json.message ); - } - else { - showErrorMessage( json.message ); - } - jQuery('#sendSmsFormDiv').dialog('close') - } - }); -} - -// -------------------------------------------------------------------- // Post Comments/Send Message // -------------------------------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm 2014-04-23 23:45:11 +0000 @@ -142,7 +142,6 @@
-
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java' --- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java 2014-04-22 23:37:46 +0000 +++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java 2014-04-23 23:45:11 +0000 @@ -139,18 +139,18 @@ orgunits.add( organisationUnit ); } -// total = patientService.countSearchTrackedEntityInstances( searchTexts, orgunits, null, ProgramInstance.STATUS_ACTIVE ); -// this.paging = createPaging( total ); -// patients = patientService.searchTrackedEntityInstances( searchTexts, orgunits, null, null, ProgramInstance.STATUS_ACTIVE, -// paging.getStartPos(), paging.getPageSize() ); -// -// if ( !searchBySelectedOrgunit ) -// { -// for ( TrackedEntityInstance patient : patients ) -// { -// mapPatientOrgunit.put( patient.getId(), getHierarchyOrgunit( patient.getOrganisationUnit() ) ); -// } -// } + total = patientService.countSearchTrackedEntityInstances( searchTexts, orgunits, null, ProgramInstance.STATUS_ACTIVE ); + this.paging = createPaging( total ); + patients = patientService.searchTrackedEntityInstances( searchTexts, orgunits, null, null, ProgramInstance.STATUS_ACTIVE, + paging.getStartPos(), paging.getPageSize() ); + + if ( !searchBySelectedOrgunit ) + { + for ( TrackedEntityInstance patient : patients ) + { + mapPatientOrgunit.put( patient.getId(), getHierarchyOrgunit( patient.getOrganisationUnit() ) ); + } + } } return SUCCESS;