From 8a2fc56ed0bc67ac82f349cad65753932fc0e531 Mon Sep 17 00:00:00 2001 From: banga Date: Tue, 24 Jan 2017 15:49:47 +0300 Subject: [PATCH 01/21] added Program validation --- .../main/webapp/icons/jphes-web-program.png | Bin 0 -> 7552 bytes .../program/action/ValidateProgramAction.java | 113 ++++++++++++++++++ .../src/main/resources/struts.xml | 11 ++ .../javascript/addProgramFrom.js | 21 ++++ .../javascript/updateProgramForm.js | 26 ++++ 5 files changed, 171 insertions(+) create mode 100644 dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/jphes-web-program.png create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ValidateProgramAction.java create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/addProgramFrom.js create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/updateProgramForm.js diff --git a/dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/jphes-web-program.png b/dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/jphes-web-program.png new file mode 100644 index 0000000000000000000000000000000000000000..968b5066e12d06c8a330b71e658c45152a66402f GIT binary patch literal 7552 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 WHmu=OuDF2!0000GU literal 0 HcmV?d00001 diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ValidateProgramAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ValidateProgramAction.java new file mode 100644 index 00000000..b25b8df4 --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ValidateProgramAction.java @@ -0,0 +1,113 @@ +package org.hisp.dhis.jphes.program.action; + +import com.opensymphony.xwork2.Action; +import org.hisp.dhis.dataelement.DataElementGroup; +import org.hisp.dhis.dataelement.DataElementService; +import org.hisp.dhis.i18n.I18n; +import org.hisp.dhis.indicator.IndicatorService; +import org.hisp.dhis.jphes.program.Program; +import org.hisp.dhis.jphes.program.ProgramService; +import org.springframework.beans.factory.annotation.Autowired; + + +/** + * Created by mfl on 1/24/17. + */ +public class ValidateProgramAction implements Action { + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + @Autowired + private ProgramService programService; + + @Autowired + private DataElementService dataElementService; + + + private I18n i18n; + + public void setI18n( I18n i18n ) + { + this.i18n = i18n; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + private String name; + + public void setName( String name ) + { + this.name = name; + } + + private String code; + + public void setCode( String code ) + { + this.code = code; + } + + + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private String message; + + public String getMessage() + { + return message; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + + if ( name != null ) + { + Program match = programService.getProgramByName(name); + + DataElementGroup dataElementGroup = dataElementService.getDataElementGroupByName(name); + + if ( (match != null && (id == null || match.getId() != id)) || + (dataElementGroup != null && (id == null || dataElementGroup.getId() != id)) ) + { + message = i18n.getString( "name_in_use" ); + + return ERROR; + } + } + + if ( code != null ) + { + Program match3 = programService.getProgramByCode( code ); + + if ( match3 != null && (id == null || match3.getId() != id) ) + { + message = i18n.getString( "code_in_use" ); + + return ERROR; + } + } + + message = i18n.getString( "everything_is_ok" ); + + return SUCCESS; + } +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml index 3ccc74d9..048e80a7 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml @@ -21,25 +21,36 @@ /jphes-web-program/allProgram.vm /jphes-web-program/menu.vm javascript/program.js,javascript/filterTable.js + F_JPHES_PROGRAM_LIST /main.vm /jphes-web-program/addProgramForm.vm + F_JPHES_PROGRAM_ADD allProgram.action?currentPage=${keyCurrentPage}&key=${keyCurrentKey} showAddProgramForm.action + F_JPHES_PROGRAM_ADD allProgram.action showUpdateProgramForm.action + F_JPHES_PROGRAM_ADD /main.vm /jphes-web-program/updateProgramForm.vm + F_JPHES_PROGRAM_ADD + + + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + /dhis-web-commons/ajax/jsonResponseError.vm + plainTextError diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/addProgramFrom.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/addProgramFrom.js new file mode 100644 index 00000000..04bf8575 --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/addProgramFrom.js @@ -0,0 +1,21 @@ +jQuery( document ).ready( function() +{ + jQuery( "#name" ).focus(); + + validation2( 'addProgramForm', function( form ) + { + selectAllById( 'indSelected' ); + selectAllById( 'deSelected' ); + form.submit(); + }, { + 'rules' : getValidationRules("jphesProgram") + } ); + + /* remote validation */ + checkValueIsExist( "name", "validateProgram.action" ); + checkValueIsExist( "code", "validateProgram.action" ); + + sortList( 'iAvailable', 'ASC' ); + sortList( 'deAvailable', 'ASC' ); + +} ); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/updateProgramForm.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/updateProgramForm.js new file mode 100644 index 00000000..7d1559b2 --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/updateProgramForm.js @@ -0,0 +1,26 @@ +jQuery( document ).ready( function() +{ + jQuery( "#name" ).focus(); + + validation2( 'updateProgramForm', function( form ) + { + selectAllById( 'indSelected' ); + selectAllById( 'deSelected' ); + form.submit(); + }, { + 'rules' : getValidationRules("jphesProgram") + } ); + + /* remote validation */ + checkValueIsExist( "name", "validateProgram.action", { + id : getFieldValue( 'id' ) + } ); + + checkValueIsExist( "code", "validateProgram.action", { + id : getFieldValue( 'id' ) + } ); + + sortList( 'iAvailable', 'ASC' ); + sortList( 'deAvailable', 'ASC' ); + +} ); From 3d45cdc3af173c922342617768d20c980471c4fa Mon Sep 17 00:00:00 2001 From: banga Date: Tue, 24 Jan 2017 15:50:54 +0300 Subject: [PATCH 02/21] fixed bug by adding the missing Program Constructor --- .../src/main/java/org/hisp/dhis/jphes/program/Program.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/Program.java b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/Program.java index ca609d6e..948dd5c1 100644 --- a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/Program.java +++ b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/Program.java @@ -40,6 +40,12 @@ public class Program extends BaseIdentifiableObject { private Boolean enabled; + //Constructor + + public Program(){ + + } + //Logic DataElement public void addDataElement( DataElement dataElement ) From a0ec170bbebf42b051c2f72a3a54b5ce52abe8b3 Mon Sep 17 00:00:00 2001 From: banga Date: Tue, 24 Jan 2017 15:52:23 +0300 Subject: [PATCH 03/21] added program role actions --- .../main/resources/org/hisp/dhis/user/i18n_module.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties b/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties index 59c7f903..2ccfa0e2 100644 --- a/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties +++ b/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties @@ -344,6 +344,10 @@ F_MECHANISM_UNIT_CREATE=Add/Update Mechanism Unit F_MECHANISM_UNIT_DELETE=Delete Mechanism Unit F_MECHANISM_UNIT_LIST=List Mechanism Units +F_JPHES_PROGRAM_ADD=Add/Update JPHES Program +F_JPHES_PROGRAM_LIST=List JPHES Programs +F_JPHES_PROGRAM_DELETE=Delete JPHES Program + #-- User module ---------------------------------------------------------------# user_management=User management From 1a14b7a0f8c77f737fd65c34661aafe4f3ccb6d4 Mon Sep 17 00:00:00 2001 From: banga Date: Tue, 24 Jan 2017 15:53:12 +0300 Subject: [PATCH 04/21] defined JPHES Program Validations --- .../javascripts/validationRules.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js b/dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js index 4b8fd41b..b3b4843a 100644 --- a/dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js +++ b/dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js @@ -644,6 +644,22 @@ var validationRules = { "required" : true, "rangelength" : [ 2, 230] } + }, + + "jphesProgram" : { + "name" : { + "required" : true, + "rangelength" : [ 2, 230 ] + }, + "displayName" : { + "required" : true, + "rangelength" : [ 2, 230 ] + }, + "code" : { + "rangelength" : [ 0, 50 ], + "alphanumericwithbasicpuncspaces" : true, + "notOnlyDigits" : false + } } From 06a11d54ba274e4240e1813d4ac75f52be02c80d Mon Sep 17 00:00:00 2001 From: banga Date: Tue, 24 Jan 2017 15:53:31 +0300 Subject: [PATCH 05/21] fixes and updates --- .../dhis/jphes/program/ProgramService.java | 2 +- .../hisp/dhis/jphes/program/ProgramStore.java | 2 -- .../jphes/program/DefaultProgramService.java | 4 +-- .../jphes/program/hibernate/Program.hbm.xml | 12 +++++---- .../src/main/resources/hibernate-caches.txt | 18 +++++++++++++ .../program/action/AddProgramAction.java | 27 +++++++++++++++++-- .../main/resources/META-INF/dhis/beans.xml | 1 + .../jphes-web-program/addProgramForm.vm | 24 +++-------------- .../webapp/jphes-web-program/allProgram.vm | 4 +-- .../jphes-web-program/updateProgramForm.vm | 23 +++------------- 10 files changed, 63 insertions(+), 54 deletions(-) diff --git a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/ProgramService.java b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/ProgramService.java index 851327cb..6a7370a3 100644 --- a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/ProgramService.java +++ b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/ProgramService.java @@ -53,7 +53,7 @@ public interface ProgramService { * @param name * @return */ - List getProgramByName(String name); + Program getProgramByName(String name); /** * retrieves all programs diff --git a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/ProgramStore.java b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/ProgramStore.java index c6e95783..f9e66393 100644 --- a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/ProgramStore.java +++ b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/jphes/program/ProgramStore.java @@ -2,8 +2,6 @@ import org.hisp.dhis.common.GenericIdentifiableObjectStore; -import java.util.List; - /** * Created by xenial on 1/4/17. */ diff --git a/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/jphes/program/DefaultProgramService.java b/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/jphes/program/DefaultProgramService.java index 1875e2f6..0eab6aae 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/jphes/program/DefaultProgramService.java +++ b/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/jphes/program/DefaultProgramService.java @@ -85,8 +85,8 @@ public Program getProgramByCode(String code) { * @return */ @Override - public List getProgramByName(String name) { - return programStore.getAllLikeName( name ); + public Program getProgramByName(String name) { + return programStore.getByName(name); } /** diff --git a/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml b/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml index e06fead7..810e525c 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml +++ b/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml @@ -5,7 +5,7 @@ [] > - + @@ -31,14 +31,16 @@ - - + + - - + + diff --git a/dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hibernate-caches.txt b/dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hibernate-caches.txt index d428e427..55ebddc8 100644 --- a/dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hibernate-caches.txt +++ b/dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hibernate-caches.txt @@ -244,3 +244,21 @@ org.hisp.dhis.validation.ValidationRuleGroup.members org.hisp.dhis.validation.ValidationRuleGroup.userGroupsToAlert org.hisp.dhis.validation.ValidationRuleGroup.userGroupAccesses org.hisp.dhis.version.Version +org.hisp.dhis.jphes.program.Program +org.hisp.dhis.jphes.program.Program.dataElements +org.hisp.dhis.jphes.program.Program.indicators +org.hisp.dhis.jphes.hierarchy.NationalUnit +org.hisp.dhis.jphes.hierarchy.NationalUnit.programs +org.hisp.dhis.jphes.hierarchy.NationalUnit.donorUnits +org.hisp.dhis.jphes.hierarchy.NationalUnit.userGroupAccesses +org.hisp.dhis.jphes.hierarchy.DonorUnit +org.hisp.dhis.jphes.hierarchy.DonorUnit.programs +org.hisp.dhis.jphes.hierarchy.DonorUnit.agencyUnits +org.hisp.dhis.jphes.hierarchy.DonorUnit.userGroupAccesses +org.hisp.dhis.jphes.hierarchy.AgencyUnit +org.hisp.dhis.jphes.hierarchy.AgencyUnit.programs +org.hisp.dhis.jphes.hierarchy.AgencyUnit.mechanismUnits +org.hisp.dhis.jphes.hierarchy.AgencyUnit.userGroupAccesses +org.hisp.dhis.jphes.hierarchy.MechanismUnit +org.hisp.dhis.jphes.hierarchy.MechanismUnit.programs +org.hisp.dhis.jphes.hierarchy.MechanismUnit.userGroupAccesses \ No newline at end of file diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/AddProgramAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/AddProgramAction.java index 60a73d6f..acd9f04e 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/AddProgramAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/AddProgramAction.java @@ -105,7 +105,6 @@ public void setIndSelected( List indSelected ) DataElement dataElement = dataElementService.getDataElement( id ); dataElementGroupMembers.add( dataElement ); - program.getDataElements().add( dataElement ); } for ( String id : indSelected ) @@ -114,7 +113,6 @@ public void setIndSelected( List indSelected ) Indicator indicator = indicatorService.getIndicator( id ); indicatorGroupMembers.add( indicator ); - program.getIndicators().add( indicator ); } @@ -127,13 +125,38 @@ public void setIndSelected( List indSelected ) indicatorGroup.setCode( StringUtils.trimToNull( code ) ); indicatorGroup.setMembers( indicatorGroupMembers ); + //Save DataElementGroup and IndicatorGroup dataElementService.addDataElementGroup( dataElementGroup ); indicatorService.addIndicatorGroup( indicatorGroup ); + //Set DataElementGroup and Indicator Group to Program program.setDataElementGroup( dataElementGroup ); program.setIndicatorGroup( indicatorGroup ); + //Save Program programService.addProgram( program ); + + + //Add Indicators and DataElements + + for ( String id : deSelected ) + { + DataElement dataElement = dataElementService.getDataElement( id ); + + program.getDataElements().add( dataElement ); + } + + for ( String id : indSelected ) + { + + Indicator indicator = indicatorService.getIndicator( id ); + + program.getIndicators().add( indicator ); + } + + //update the program + + programService.updateProgram(program); } return SUCCESS; diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/META-INF/dhis/beans.xml b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/META-INF/dhis/beans.xml index 01de1558..dd573ec9 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/META-INF/dhis/beans.xml +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/META-INF/dhis/beans.xml @@ -18,4 +18,5 @@ + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm index 5c861ad0..db6a8e09 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm @@ -1,18 +1,6 @@ + -

Add Program

+

Update Program

@@ -66,13 +51,13 @@ - + - + From 6c17e6800b5369ad8ac3cc0ab746ac3cc4abb4bc Mon Sep 17 00:00:00 2001 From: banga Date: Tue, 24 Jan 2017 16:58:33 +0300 Subject: [PATCH 06/21] fixes on jphesprogram validation --- .../hisp/dhis/jphes/program/action/ValidateProgramAction.java | 2 +- .../src/main/webapp/jphes-web-program/updateProgramForm.vm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ValidateProgramAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ValidateProgramAction.java index b25b8df4..e576f75c 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ValidateProgramAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ValidateProgramAction.java @@ -86,7 +86,7 @@ public String execute() DataElementGroup dataElementGroup = dataElementService.getDataElementGroupByName(name); if ( (match != null && (id == null || match.getId() != id)) || - (dataElementGroup != null && (id == null || dataElementGroup.getId() != id)) ) + (dataElementGroup != null && (id == null)) ) { message = i18n.getString( "name_in_use" ); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm index e8a4e565..d634ec08 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm @@ -76,7 +76,7 @@ From 9b8e4f1ea0e4d1c8858fa37efe8a305bb93b36e9 Mon Sep 17 00:00:00 2001 From: banga Date: Wed, 25 Jan 2017 11:30:16 +0300 Subject: [PATCH 13/21] updates on the viewprogram option for the units --- .../action/agency/viewAgencyProgramList.java | 66 ++++++++++++++++++ .../action/donor/viewDonorProgramList.java | 66 ++++++++++++++++++ .../mechanism/viewMechanismProgramList.java | 66 ++++++++++++++++++ .../national/viewNationalProgramList.java | 67 +++++++++++++++++++ .../main/resources/META-INF/dhis/beans.xml | 19 +++++- .../src/main/resources/struts.xml | 26 ++++++- .../agency/allAgencyUnit.vm | 1 + .../jphes-web-hierarchy/donor/allDonorUnit.vm | 1 + .../mechanism/allMechanismUnit.vm | 3 +- .../res/javascript/agency/agencyUnit.js | 9 +++ .../res/javascript/donor/donorUnit.js | 9 +++ .../res/javascript/mechanism/mechanismUnit.js | 10 +++ .../res/javascript/viewPrograms.js | 2 +- .../jphes-web-hierarchy/viewPrograms.vm | 10 +-- 14 files changed, 346 insertions(+), 9 deletions(-) create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/viewMechanismProgramList.java create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/viewNationalProgramList.java diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java new file mode 100644 index 00000000..6a75c80e --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java @@ -0,0 +1,66 @@ +package org.hisp.dhis.jphes.hierarchy.action.agency; + +import org.hisp.dhis.jphes.hierarchy.agency.AgencyUnit; +import org.hisp.dhis.jphes.hierarchy.agency.AgencyUnitService; +import org.hisp.dhis.jphes.program.Program; +import org.hisp.dhis.paging.ActionPagingSupport; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by afya on 25/01/17. + */ +public class viewAgencyProgramList extends ActionPagingSupport +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + @Autowired + private AgencyUnitService agencyUnitService; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId(Integer id){ + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List programs; + + public List getPrograms() + { + return programs; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + AgencyUnit unit = agencyUnitService.getAgencyUnit( id ); + + programs = new ArrayList<>( unit.getPrograms() ); + + Collections.sort( programs ); + + this.paging = createPaging( programs.size() ); + + programs = programs.subList( paging.getStartPos(), paging.getEndPos() ); + + return SUCCESS; + } +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java new file mode 100644 index 00000000..37df523b --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java @@ -0,0 +1,66 @@ +package org.hisp.dhis.jphes.hierarchy.action.donor; + +import org.hisp.dhis.jphes.hierarchy.donor.DonorUnit; +import org.hisp.dhis.jphes.hierarchy.donor.DonorUnitService; +import org.hisp.dhis.jphes.program.Program; +import org.hisp.dhis.paging.ActionPagingSupport; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by afya on 25/01/17. + */ +public class viewDonorProgramList extends ActionPagingSupport +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + @Autowired + private DonorUnitService donorUnitService; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId(Integer id){ + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List programs; + + public List getPrograms() + { + return programs; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + DonorUnit unit = donorUnitService.getDonorUnit( id ); + + programs = new ArrayList<>( unit.getPrograms() ); + + Collections.sort( programs ); + + this.paging = createPaging( programs.size() ); + + programs = programs.subList( paging.getStartPos(), paging.getEndPos() ); + + return SUCCESS; + } +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/viewMechanismProgramList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/viewMechanismProgramList.java new file mode 100644 index 00000000..fbad083d --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/viewMechanismProgramList.java @@ -0,0 +1,66 @@ +package org.hisp.dhis.jphes.hierarchy.action.mechanism; + +import org.hisp.dhis.jphes.hierarchy.mechanism.MechanismUnit; +import org.hisp.dhis.jphes.hierarchy.mechanism.MechanismUnitService; +import org.hisp.dhis.jphes.program.Program; +import org.hisp.dhis.paging.ActionPagingSupport; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by afya on 25/01/17. + */ +public class viewMechanismProgramList extends ActionPagingSupport +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + @Autowired + private MechanismUnitService mechanismUnitService; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId(Integer id){ + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List programs; + + public List getPrograms() + { + return programs; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + MechanismUnit unit = mechanismUnitService.getMechanismUnit( id ); + + programs = new ArrayList<>( unit.getPrograms() ); + + Collections.sort( programs ); + + this.paging = createPaging( programs.size() ); + + programs = programs.subList( paging.getStartPos(), paging.getEndPos() ); + + return SUCCESS; + } +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/viewNationalProgramList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/viewNationalProgramList.java new file mode 100644 index 00000000..dd65942b --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/viewNationalProgramList.java @@ -0,0 +1,67 @@ +package org.hisp.dhis.jphes.hierarchy.action.national; + +import org.hisp.dhis.jphes.hierarchy.national.NationalUnit; +import org.hisp.dhis.jphes.hierarchy.national.NationalUnitService; +import org.hisp.dhis.jphes.program.Program; +import org.hisp.dhis.paging.ActionPagingSupport; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by afya on 25/01/17. + */ +public class viewNationalProgramList extends ActionPagingSupport +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + @Autowired + private NationalUnitService nationalUnitService; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId(Integer id){ + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List programs; + + public List getPrograms() + { + return programs; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + NationalUnit nationalUnit = nationalUnitService.getNationalUnit( id ); + + programs = new ArrayList<>( nationalUnit.getPrograms() ); + + Collections.sort( programs ); + + this.paging = createPaging( programs.size() ); + + programs = programs.subList( paging.getStartPos(), paging.getEndPos() ); + + return SUCCESS; + } + +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/META-INF/dhis/beans.xml b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/META-INF/dhis/beans.xml index 382fbb91..03e98dba 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/META-INF/dhis/beans.xml +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/META-INF/dhis/beans.xml @@ -39,6 +39,10 @@ scope="prototype"> + + + @@ -72,7 +76,11 @@ scope="prototype"> - + + + + @@ -93,6 +101,10 @@ scope="prototype"> + + + @@ -118,4 +130,9 @@ + + + + + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/struts.xml b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/struts.xml index b554aeb2..8df1ccb1 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/struts.xml +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/struts.xml @@ -69,6 +69,13 @@ F_NATIONAL_UNIT_DELETE + + /main.vm + /jphes-web-hierarchy/viewPrograms.vm + /jphes-web-hierarchy/menu.vm + F_NATIONAL_UNIT_LIST + + @@ -130,11 +137,11 @@ plainTextError - + /main.vm /jphes-web-hierarchy/viewPrograms.vm /jphes-web-hierarchy/menu.vm - F_NATIONAL_UNIT_LIST + F_DONOR_UNIT_LIST @@ -200,6 +207,13 @@ plainTextError + + /main.vm + /jphes-web-hierarchy/viewPrograms.vm + /jphes-web-hierarchy/menu.vm + F_AGENCY_UNIT_LIST + + @@ -270,6 +284,14 @@ F_MECHANISM_UNIT_LIST + + /main.vm + /jphes-web-hierarchy/viewPrograms.vm + /jphes-web-hierarchy/menu.vm + F_MECHANISM_UNIT_LIST + + + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/agency/allAgencyUnit.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/agency/allAgencyUnit.vm index 1058a4a3..5c96e2a0 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/agency/allAgencyUnit.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/agency/allAgencyUnit.vm @@ -12,6 +12,7 @@
  •   $i18n.getString( "sharing_settings" )
  • +
  •   $i18n.getString( "view_programs" )
  •   $i18n.getString( "add_mechanism" )
  •   $i18n.getString( "edit" )
  •   $i18n.getString( "remove" )
  • diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/donor/allDonorUnit.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/donor/allDonorUnit.vm index 50eabe20..219b2b46 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/donor/allDonorUnit.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/donor/allDonorUnit.vm @@ -12,6 +12,7 @@
    •   $i18n.getString( "sharing_settings" )
    • +
    •   $i18n.getString( "view_programs" )
    •   $i18n.getString( "add_agency" )
    •   $i18n.getString( "edit" )
    •   $i18n.getString( "remove" )
    • diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/mechanism/allMechanismUnit.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/mechanism/allMechanismUnit.vm index fd62ac04..229eceae 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/mechanism/allMechanismUnit.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/mechanism/allMechanismUnit.vm @@ -12,7 +12,8 @@
      •   $i18n.getString( "sharing_settings" )
      • -
      •   $i18n.getString( "view_orgunits" )
      • +
      •   $i18n.getString( "view_programs" )
      • +
      •   $i18n.getString( "view_orgunits" )
      •   $i18n.getString( "edit" )
      •   $i18n.getString( "remove" )
      •   $i18n.getString( "show_details" )
      • diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/agency/agencyUnit.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/agency/agencyUnit.js index 6d43430b..9014ef3c 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/agency/agencyUnit.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/agency/agencyUnit.js @@ -27,3 +27,12 @@ function removeAgencyUnit( context ) { removeItem(context.id, context.name, i18n_confirm_delete, 'removeAgencyUnit.action'); } +// ----------------------------------------------------------------------------- +// View Programs +// ----------------------------------------------------------------------------- + +function viewAgencyPrograms( context ) { + + location.href = 'viewAgencyPrograms.action?id=' + context.id; + +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/donor/donorUnit.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/donor/donorUnit.js index 90d27528..a9660b0f 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/donor/donorUnit.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/donor/donorUnit.js @@ -27,3 +27,12 @@ function removeDonorUnit( context ) { removeItem(context.id, context.name, i18n_confirm_delete, 'removeDonorUnit.action'); } +// ----------------------------------------------------------------------------- +// View Programs +// ----------------------------------------------------------------------------- + +function viewDonorPrograms( context ) { + + location.href = 'viewDonorPrograms.action?id=' + context.id; + +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/mechanism/mechanismUnit.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/mechanism/mechanismUnit.js index 023c319c..399ae22d 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/mechanism/mechanismUnit.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/mechanism/mechanismUnit.js @@ -39,6 +39,16 @@ function viewOrganistionUnits( context ) { } +// ----------------------------------------------------------------------------- +// View Programs +// ----------------------------------------------------------------------------- + +function viewMechanismPrograms( context ) { + + location.href = 'viewMechanismPrograms.action?id=' + context.id; + +} + // ----------------------------------------------------------------------------- // filter MechanismUnits by AgencyUnit // ----------------------------------------------------------------------------- diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/viewPrograms.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/viewPrograms.js index 97062f63..5efcb94f 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/viewPrograms.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/viewPrograms.js @@ -8,5 +8,5 @@ jQuery(document).ready(function() { }); function showProgramDetails( context ) { - location.href = 'showProgramDetails.action?id=' + context.id; + location.href = ''; } diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/viewPrograms.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/viewPrograms.vm index d5c404ac..2aefbfd5 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/viewPrograms.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/viewPrograms.vm @@ -1,15 +1,17 @@ -

        $i18n.getString( 'jphes_programs' ) #openHelp( "jphes_hierarchy" )

        +

        $i18n.getString( 'jphes_programs' )  for - ${unit.name} #openHelp( "jphes_hierarchy" )

        +
@@ -98,7 +98,7 @@ From 53a7bc807d3ebd4ed51364db4ece0892d04ad6fc Mon Sep 17 00:00:00 2001 From: banga Date: Tue, 24 Jan 2017 17:21:15 +0300 Subject: [PATCH 07/21] fixes on update program --- .../org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml | 4 ++-- .../hisp/dhis/jphes/program/action/AddProgramAction.java | 6 +++--- .../hisp/dhis/jphes/program/action/UpdateProgramAction.java | 3 ++- .../jphes-web-program/javascript/updateProgramForm.js | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml b/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml index 810e525c..d01e8c98 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml +++ b/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml @@ -29,14 +29,14 @@ - + - + indSelected ) program.setDisplayName( StringUtils.trimToNull( name ) ); program.setName( StringUtils.trimToNull( name ) ); program.setCode( StringUtils.trimToNull( code ) ); - program.setDescription( StringUtils.trimToNull( displayName ) ); - program.setShortName( StringUtils.trimToNull( name ) ); + program.setDisplayName( StringUtils.trimToNull( displayName ) ); + program.setShortName( StringUtils.abbreviate(name, 40) ); Set dataElementGroupMembers = new HashSet<>(); @@ -118,7 +118,7 @@ public void setIndSelected( List indSelected ) dataElementGroup.setName( StringUtils.trimToNull( name ) ); dataElementGroup.setCode( StringUtils.trimToNull( code ) ); - dataElementGroup.setShortName( StringUtils.trimToNull( name ) ); + dataElementGroup.setShortName( StringUtils.abbreviate( name, 40 ) ); dataElementGroup.setMembers( dataElementGroupMembers ); indicatorGroup.setName( StringUtils.trimToNull( name ) ); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/UpdateProgramAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/UpdateProgramAction.java index c1fc7fb7..9e485a28 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/UpdateProgramAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/UpdateProgramAction.java @@ -95,6 +95,7 @@ public String execute() throws Exception { program.setName( StringUtils.trimToNull( name ) ); program.setCode( StringUtils.trimToNull( code ) ); program.setDisplayName( StringUtils.trimToNull( displayName ) ); + program.setShortName( StringUtils.abbreviate(name,40)); program.getDataElements().clear(); program.getIndicators().clear(); @@ -123,7 +124,7 @@ public String execute() throws Exception { //updating DataElementGroup and IndicatorGroup dataElementGroup.setName( StringUtils.trimToNull( name ) ); dataElementGroup.setCode( StringUtils.trimToNull( code ) ); - dataElementGroup.setShortName( StringUtils.trimToNull( name ) ); + dataElementGroup.setShortName( StringUtils.abbreviate(name, 40) ); indicatorGroup.setName( StringUtils.trimToNull( name ) ); indicatorGroup.setCode( StringUtils.trimToNull( code ) ); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/updateProgramForm.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/updateProgramForm.js index 7d1559b2..551b533e 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/updateProgramForm.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/updateProgramForm.js @@ -4,8 +4,8 @@ jQuery( document ).ready( function() validation2( 'updateProgramForm', function( form ) { - selectAllById( 'indSelected' ); - selectAllById( 'deSelected' ); + selectAllById( 'deSelectedList' ); + selectAllById( 'indSelectedList' ); form.submit(); }, { 'rules' : getValidationRules("jphesProgram") From e9b3d0f4c3282234f210e111293cacf275baf9b9 Mon Sep 17 00:00:00 2001 From: banga Date: Wed, 25 Jan 2017 07:24:55 +0300 Subject: [PATCH 08/21] validation for mechanism units-categoryoption by code,name and shortname --- .../ValidateMechanismUnitAction.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/ValidateMechanismUnitAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/ValidateMechanismUnitAction.java index 037b1245..b06df46b 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/ValidateMechanismUnitAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/ValidateMechanismUnitAction.java @@ -1,6 +1,8 @@ package org.hisp.dhis.jphes.hierarchy.action.mechanism; import com.opensymphony.xwork2.Action; +import org.hisp.dhis.dataelement.DataElementCategoryOption; +import org.hisp.dhis.dataelement.DataElementCategoryService; import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.jphes.hierarchy.mechanism.MechanismUnit; import org.hisp.dhis.jphes.hierarchy.mechanism.MechanismUnitService; @@ -18,6 +20,9 @@ public class ValidateMechanismUnitAction implements Action @Autowired private MechanismUnitService mechanismUnitService; + @Autowired + private DataElementCategoryService categoryService; + @Autowired private UserGroupService userGroupService; @@ -89,7 +94,10 @@ public String execute() int userGroupCount = userGroupService.getUserGroupCountByName( name ); - if ( (match != null && (id == null || match.getId() != id)) || (userGroupCount>0 && id==null) ) + DataElementCategoryOption categoryOptionName = categoryService.getDataElementCategoryOptionByName( name ); + + if ( (match != null && (id == null || match.getId() != id)) || (userGroupCount>0 && id==null) + || (categoryOptionName != null && (id == null))) { message = i18n.getString( "name_in_use" ); @@ -101,7 +109,10 @@ public String execute() { MechanismUnit match2 = mechanismUnitService.getMechanismUnitByShortName( shortName ); - if ( match2 != null && (id == null || match2.getId() != id) ) + DataElementCategoryOption categoryOptionShortName = categoryService.getDataElementCategoryOptionByShortName( shortName ); + + if ( (match2 != null && (id == null || match2.getId() != id)) || + (categoryOptionShortName != null && (id == null)) ) { message = i18n.getString( "name_in_use" ); @@ -113,7 +124,10 @@ public String execute() { MechanismUnit match3 = mechanismUnitService.getMechanismUnitByCode( code ); - if ( match3 != null && (id == null || match3.getId() != id) ) + DataElementCategoryOption categoryOptionCode = categoryService.getDataElementCategoryOptionByCode( code ); + + if ( (match3 != null && (id == null || match3.getId() != id)) + || (categoryOptionCode != null && (id == null)) ) { message = i18n.getString( "code_in_use" ); From 82246433580cccb01f889ddc2836ed6a29118463 Mon Sep 17 00:00:00 2001 From: banga Date: Wed, 25 Jan 2017 08:25:15 +0300 Subject: [PATCH 09/21] auto-sort units when loading --- .../action/agency/GetAgencyUnitListAction.java | 5 +++++ .../action/donor/GetDonorUnitListAction.java | 5 +++++ .../mechanism/GetMechanismUnitListAction.java | 14 ++++++++++++-- .../mechanism/ViewMechanismOrgUnitAction.java | 6 ++++-- .../action/national/GetNationalUnitListAction.java | 5 +++++ 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/GetAgencyUnitListAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/GetAgencyUnitListAction.java index 4d9d3092..77083229 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/GetAgencyUnitListAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/GetAgencyUnitListAction.java @@ -5,6 +5,7 @@ import org.hisp.dhis.paging.ActionPagingSupport; import org.springframework.beans.factory.annotation.Autowired; +import java.util.Collections; import java.util.List; import static org.apache.commons.lang.StringUtils.isNotBlank; @@ -52,12 +53,16 @@ public String getKey() this.paging = createPaging(agencyUnitService.getAgencyUnitCountByName(key)); agencyUnits = agencyUnitService.getAgencyUnitsBetweenByName(key, paging.getStartPos(), paging.getPageSize() ); + + Collections.sort( agencyUnits ); } else { this.paging = createPaging( agencyUnitService.getAgencyUnitCount() ); agencyUnits = agencyUnitService.getAgencyUnitsBetween( paging.getStartPos(), paging.getPageSize() ); + + Collections.sort( agencyUnits ); } return SUCCESS; diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/GetDonorUnitListAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/GetDonorUnitListAction.java index 1e8a0583..30bec554 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/GetDonorUnitListAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/GetDonorUnitListAction.java @@ -4,6 +4,7 @@ import org.hisp.dhis.jphes.hierarchy.donor.DonorUnitService; import org.hisp.dhis.paging.ActionPagingSupport; +import java.util.Collections; import java.util.List; import static org.apache.commons.lang.StringUtils.isNotBlank; @@ -54,12 +55,16 @@ public String getKey() this.paging = createPaging(donorUnitService.getDonorUnitCountByName(key)); donorUnits = donorUnitService.getDonorUnitsBetweenByName(key, paging.getStartPos(), paging.getPageSize() ); + + Collections.sort( donorUnits ); } else { this.paging = createPaging( donorUnitService.getDonorUnitCount() ); donorUnits = donorUnitService.getDonorUnitsBetween( paging.getStartPos(), paging.getPageSize() ); + + Collections.sort( donorUnits ); } return SUCCESS; diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/GetMechanismUnitListAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/GetMechanismUnitListAction.java index 5468393d..feba8eed 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/GetMechanismUnitListAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/GetMechanismUnitListAction.java @@ -8,6 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired; import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; import java.util.List; import static org.apache.commons.lang.StringUtils.isNotBlank; @@ -75,6 +77,8 @@ public String getKey() this.paging = createPaging(mechanismUnitService.getMechanismUnitCountByName(key)); mechanismUnits = mechanismUnitService.getMechanismUnitsBetweenByName(key, paging.getStartPos(), paging.getPageSize() ); + + Collections.sort(mechanismUnits); } if ( (! isNotBlank( key )) && (! isNotBlank( agencyUnit ))) @@ -82,15 +86,21 @@ public String getKey() this.paging = createPaging( mechanismUnitService.getMechanismUnitCount() ); mechanismUnits = mechanismUnitService.getMechanismUnitsBetween( paging.getStartPos(), paging.getPageSize() ); + + Collections.sort(mechanismUnits); } if ( isNotBlank( agencyUnit ) ) { AgencyUnit agency = agencyUnitService.getAgencyUnit( agencyUnit ); - this.paging = createPaging(agency.getMechanismUnits().size()); - mechanismUnits = new ArrayList<>( agency.getMechanismUnits() ); + + this.paging = createPaging(mechanismUnits.size()); + + mechanismUnits = mechanismUnits.subList(paging.getStartPos(), paging.getEndPos() ); + + Collections.sort(mechanismUnits); } return SUCCESS; diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/ViewMechanismOrgUnitAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/ViewMechanismOrgUnitAction.java index bc00cca1..63e59e84 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/ViewMechanismOrgUnitAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/ViewMechanismOrgUnitAction.java @@ -53,10 +53,12 @@ public MechanismUnit getMechanismUnit(){ mechanismUnit = mechanismUnitService.getMechanismUnit( uid ); - this.paging = createPaging(mechanismUnit.getCategoryOption().getOrganisationUnits().size()); - organisationUnits = new ArrayList<>(mechanismUnit.getCategoryOption().getOrganisationUnits()); + this.paging = createPaging(organisationUnits.size() ); + + organisationUnits = organisationUnits.subList( paging.getStartPos(), paging.getEndPos() ); + Collections.sort(organisationUnits); } else{ diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/GetNationalUnitListAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/GetNationalUnitListAction.java index f71620d6..2961a8b2 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/GetNationalUnitListAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/GetNationalUnitListAction.java @@ -8,6 +8,7 @@ import org.hisp.dhis.user.UserGroupService; import org.hisp.dhis.user.UserService; +import java.util.Collections; import java.util.List; import static org.apache.commons.lang3.StringUtils.isNotBlank; @@ -58,12 +59,16 @@ public String getKey() this.paging = createPaging(nationalUnitService.getNationalUnitCountByName(key)); nationalUnits = nationalUnitService.getNationalUnitsBetweenByName(key, paging.getStartPos(), paging.getPageSize() ); + + Collections.sort(nationalUnits); } else { this.paging = createPaging( nationalUnitService.getNationalUnitCount() ); nationalUnits = nationalUnitService.getNationalUnitsBetween( paging.getStartPos(), paging.getPageSize() ); + + Collections.sort(nationalUnits); } return SUCCESS; From 69d01277c19feee1260f355dfe8d5cf52eeeeda2 Mon Sep 17 00:00:00 2001 From: banga Date: Wed, 25 Jan 2017 09:06:46 +0300 Subject: [PATCH 10/21] view nationalunit programs --- .../jphes/hierarchy/i18n_module.properties | 2 + .../src/main/resources/struts.xml | 7 +++ .../mechanism/allMechanismUnit.vm | 2 +- .../national/allNationalUnit.vm | 1 + .../res/javascript/national/nationalUnit.js | 9 ++++ .../res/javascript/viewPrograms.js | 12 +++++ .../jphes-web-hierarchy/viewPrograms.vm | 44 +++++++++++++++++++ 7 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/viewPrograms.js create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/viewPrograms.vm diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/org/hisp/dhis/jphes/hierarchy/i18n_module.properties b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/org/hisp/dhis/jphes/hierarchy/i18n_module.properties index 63174737..2efb26cd 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/org/hisp/dhis/jphes/hierarchy/i18n_module.properties +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/org/hisp/dhis/jphes/hierarchy/i18n_module.properties @@ -12,6 +12,8 @@ intro_jphes_donor=Create, modify, delete and view donor units e.g PEPFAR. intro_jphes_agency=Create, modify, delete and view agency units e.g USAID, DOD. intro_jphes_mechanism=Create, modify, delete and view mechanism units e.g Afyaplus Western. +view_programs=Assigned Programs + # National Unit actions and functions definitions create_new_national_unit=Create New National Unit diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/struts.xml b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/struts.xml index 4d6e05a1..b554aeb2 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/struts.xml +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/resources/struts.xml @@ -130,6 +130,13 @@ plainTextError + + /main.vm + /jphes-web-hierarchy/viewPrograms.vm + /jphes-web-hierarchy/menu.vm + F_NATIONAL_UNIT_LIST + + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/mechanism/allMechanismUnit.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/mechanism/allMechanismUnit.vm index 582b3230..fd62ac04 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/mechanism/allMechanismUnit.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/mechanism/allMechanismUnit.vm @@ -12,7 +12,7 @@
  •   $i18n.getString( "sharing_settings" )
  • -
  •   $i18n.getString( "view_orgunits" )
  • +
  •   $i18n.getString( "view_orgunits" )
  •   $i18n.getString( "edit" )
  •   $i18n.getString( "remove" )
  •   $i18n.getString( "show_details" )
  • diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/national/allNationalUnit.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/national/allNationalUnit.vm index 3c8a39b2..23e84b30 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/national/allNationalUnit.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/national/allNationalUnit.vm @@ -12,6 +12,7 @@
    •   $i18n.getString( "sharing_settings" )
    • +
    •   $i18n.getString( "view_programs" )
    •   $i18n.getString( "add_donor" )
    •   $i18n.getString( "edit" )
    •   $i18n.getString( "remove" )
    • diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/national/nationalUnit.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/national/nationalUnit.js index 38d77d40..b20e694b 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/national/nationalUnit.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/national/nationalUnit.js @@ -29,3 +29,12 @@ function removeNationalUnit( context ) { removeItem(context.id, context.name, i18n_confirm_delete, 'removeNationalUnit.action'); } +// ----------------------------------------------------------------------------- +// View Programs +// ----------------------------------------------------------------------------- + +function viewNationalPrograms( context ) { + + location.href = 'viewNationalPrograms.action?id=' + context.id; + +} \ No newline at end of file diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/viewPrograms.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/viewPrograms.js new file mode 100644 index 00000000..97062f63 --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/res/javascript/viewPrograms.js @@ -0,0 +1,12 @@ +jQuery(document).ready(function() { + tableSorter('listTable'); + + dhis2.contextmenu.makeContextMenu({ + menuId: 'contextMenu', + menuItemActiveClass: 'contextMenuItemActive' + }); +}); + +function showProgramDetails( context ) { + location.href = 'showProgramDetails.action?id=' + context.id; +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/viewPrograms.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/viewPrograms.vm new file mode 100644 index 00000000..d5c404ac --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/webapp/jphes-web-hierarchy/viewPrograms.vm @@ -0,0 +1,44 @@ + + +

      $i18n.getString( 'jphes_programs' ) #openHelp( "jphes_hierarchy" )

      + + + + + + +
      + +## +## +## +
      + + + + + + + + + + + #foreach( $program in $programs ) + + + + + + + #end + +
      $i18n.getString( "jphes_name")$i18n.getString( "jphes_code")$i18n.getString( "jphes_created")$i18n.getString( "jphes_lastupdated")
      $!encoder.htmlEncode( $program.name )$!encoder.htmlEncode( $program.code )$!format.formatDate( $program.created )$!format.formatDate( $program.lastUpdated )
      +

      +
      + #parse( "/dhis-web-commons/paging/paging.vm" ) +
      + +
      From de41f802fcac149009e7c39b7efa2e04c7511cec Mon Sep 17 00:00:00 2001 From: george2 Date: Wed, 25 Jan 2017 09:40:27 +0300 Subject: [PATCH 11/21] .. --- .../org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml b/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml index e06fead7..bf03d43a 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml +++ b/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/jphes/program/hibernate/Program.hbm.xml @@ -29,13 +29,13 @@ - + - + From 0e7567ef72a67b481d7b7789db58556e3b628f0b Mon Sep 17 00:00:00 2001 From: george2 Date: Wed, 25 Jan 2017 10:22:54 +0300 Subject: [PATCH 12/21] fixed program editting picklist --- .../dhis/jphes/program/i18n_module.properties | 3 ++- .../jphes-web-program/updateProgramForm.vm | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties index 807e13c5..f07f5eb7 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties @@ -1,4 +1,5 @@ jphes_program=All Programs intro_jphes_program=Create, modify, delete and view programs. available_dataelements=Available Dataelements -selected_dataelements=Selected Dataelements \ No newline at end of file +selected_dataelements=Selected Dataelements +save=Save \ No newline at end of file diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm index d634ec08..4b9722fa 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm @@ -15,7 +15,7 @@ } }); - jQuery("#iAvailable").dhisAjaxSelect({ + jQuery("#indAvailable").dhisAjaxSelect({ source: "../api/indicators.json?paging=false&fields=displayName,id,name", iterator: 'indicators', connectedTo: 'indSelectedList', @@ -69,9 +69,9 @@

-
+

- +
@@ -86,14 +86,14 @@
- + -
-
-
- +
+
+
+
@@ -107,7 +107,7 @@
- +
+ + + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +
-## -## -##
From fa25120bb160fe38dfe982097066ed05be47ce43 Mon Sep 17 00:00:00 2001 From: banga Date: Wed, 25 Jan 2017 13:04:16 +0300 Subject: [PATCH 14/21] added view indicators and dataelements option --- .../action/ViewProgramDataElementList.java | 64 +++++++++++++++++++ .../action/ViewProgramIndicatorList.java | 64 +++++++++++++++++++ .../main/resources/META-INF/dhis/beans.xml | 4 ++ .../dhis/jphes/program/i18n_module.properties | 19 +++++- .../src/main/resources/struts.xml | 14 ++++ .../jphes-web-program/addProgramForm.vm | 4 +- .../webapp/jphes-web-program/allProgram.vm | 2 + .../jphes-web-program/javascript/program.js | 20 ++++++ .../jphes-web-program/updateProgramForm.vm | 6 +- .../jphes-web-program/viewDataElements.vm | 41 ++++++++++++ .../jphes-web-program/viewIndicators.vm | 41 ++++++++++++ 11 files changed, 273 insertions(+), 6 deletions(-) create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ViewProgramDataElementList.java create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ViewProgramIndicatorList.java create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/viewDataElements.vm create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/viewIndicators.vm diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ViewProgramDataElementList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ViewProgramDataElementList.java new file mode 100644 index 00000000..31a8e422 --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ViewProgramDataElementList.java @@ -0,0 +1,64 @@ +package org.hisp.dhis.jphes.program.action; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.jphes.program.Program; +import org.hisp.dhis.jphes.program.ProgramService; +import org.hisp.dhis.paging.ActionPagingSupport; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by afya on 25/01/17. + */ +public class ViewProgramDataElementList extends ActionPagingSupport +{ + @Autowired + private ProgramService programService; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId(Integer id){ + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List dataElements; + + public List getDataElements() + { + return dataElements; + } + + private Program program; + + public Program getProgram(){ return program; } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override public String execute() throws Exception + { + program = programService.getProgram( id ); + + dataElements = new ArrayList<>( program.getDataElements() ); + + Collections.sort( dataElements ); + + this.paging = createPaging( dataElements.size() ); + + dataElements = dataElements.subList( paging.getStartPos(), paging.getEndPos() ); + + return SUCCESS; + } +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ViewProgramIndicatorList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ViewProgramIndicatorList.java new file mode 100644 index 00000000..6f7d9beb --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/ViewProgramIndicatorList.java @@ -0,0 +1,64 @@ +package org.hisp.dhis.jphes.program.action; + +import org.hisp.dhis.indicator.Indicator; +import org.hisp.dhis.jphes.program.Program; +import org.hisp.dhis.jphes.program.ProgramService; +import org.hisp.dhis.paging.ActionPagingSupport; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by afya on 25/01/17. + */ +public class ViewProgramIndicatorList extends ActionPagingSupport +{ + @Autowired + private ProgramService programService; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId(Integer id){ + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List indicators; + + public List getIndicators() + { + return indicators; + } + + private Program program; + + public Program getProgram(){ return program; } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override public String execute() throws Exception + { + program = programService.getProgram( id ); + + indicators = new ArrayList<>( program.getIndicators() ); + + Collections.sort( indicators ); + + this.paging = createPaging( indicators.size() ); + + indicators = indicators.subList( paging.getStartPos(), paging.getEndPos() ); + + return SUCCESS; + } +} diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/META-INF/dhis/beans.xml b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/META-INF/dhis/beans.xml index dd573ec9..5a707ceb 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/META-INF/dhis/beans.xml +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/META-INF/dhis/beans.xml @@ -19,4 +19,8 @@ + + + + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties index 807e13c5..e8514844 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties @@ -1,4 +1,21 @@ jphes_program=All Programs intro_jphes_program=Create, modify, delete and view programs. available_dataelements=Available Dataelements -selected_dataelements=Selected Dataelements \ No newline at end of file +selected_dataelements=Selected Dataelements + +#Attributes +view_dataelements=View Data Elements +view_indicators=View Indicators +jphes_indicators=Indicators +jphes_dataelements= Data Elements +jphes_shortname=Short Name +jphes_code=Code +jphes_name=Name +jphes_description=Description +jphes_lastupdated=Last Updated +jphes_href=API Link +jphes_startdate=Start Date +jphes_enddate=End Date +jphes_created=Create Date +jphes_back= Back + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml index 048e80a7..efc11f68 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml @@ -53,5 +53,19 @@ plainTextError + + /main.vm + /jphes-web-program/viewDataElements.vm + /jphes-web-program/menu.vm + F_JPHES_PROGRAM_LIST + + + + /main.vm + /jphes-web-program/viewIndicators.vm + /jphes-web-program/menu.vm + F_JPHES_PROGRAM_LIST + + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm index db6a8e09..87de8f61 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm @@ -61,7 +61,7 @@ - + @@ -79,7 +79,7 @@ - + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm index f74ee6b8..e0bc74e4 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm @@ -11,6 +11,8 @@
    +
  •   $i18n.getString( "view_dataelements" )
  • +
  •   $i18n.getString( "view_indicators" )
  •   $i18n.getString( "edit" )
  •   $i18n.getString( "remove" )
  •   $i18n.getString( "show_details" )
  • diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js index 511a8e67..1a1b95d4 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js @@ -22,3 +22,23 @@ function removeProgram( context ) { removeItem(context.id, context.name, i18n_confirm_delete, 'removeProgram.action'); } +// ----------------------------------------------------------------------------- +// View Indicators +// ----------------------------------------------------------------------------- + +function viewProgramIndicators( context ) { + + location.href = 'viewProgramIndicators.action?id=' + context.id; + +} + +// ----------------------------------------------------------------------------- +// View DataElements +// ----------------------------------------------------------------------------- + +function viewProgramDataElements( context ) { + + location.href = 'viewProgramDataElements.action?id=' + context.id; + +} + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm index d634ec08..0c53c235 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm @@ -29,7 +29,7 @@ }); }); -

    Update Program

    +

    Edit Program

@@ -62,7 +62,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/viewDataElements.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/viewDataElements.vm new file mode 100644 index 00000000..5c4433d1 --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/viewDataElements.vm @@ -0,0 +1,41 @@ + +

$i18n.getString( 'jphes_dataelements' )  for - ${program.name} #openHelp( "jphes_programs" )

+ + +
+ + + +
+ + +
+ + + + + + + + + + + #foreach( $dataElement in $dataElements ) + + + + + + + #end + +
$i18n.getString( "jphes_name")$i18n.getString( "jphes_code")$i18n.getString( "jphes_created")$i18n.getString( "jphes_lastupdated")
$!encoder.htmlEncode( $dataElement.name )$!encoder.htmlEncode( $dataElement.code )$!format.formatDate( $dataElement.created )$!format.formatDate( $dataElement.lastUpdated )
+

+
+ #parse( "/dhis-web-commons/paging/paging.vm" ) +
+ +
diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/viewIndicators.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/viewIndicators.vm new file mode 100644 index 00000000..85439eb8 --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/viewIndicators.vm @@ -0,0 +1,41 @@ + +

$i18n.getString( 'jphes_indicators' )  for - ${program.name} #openHelp( "jphes_programs" )

+ + + + + + +
+ + +
+ + + + + + + + + + + #foreach( $indicator in $indicators ) + + + + + + + #end + +
$i18n.getString( "jphes_name")$i18n.getString( "jphes_code")$i18n.getString( "jphes_created")$i18n.getString( "jphes_lastupdated")
$!encoder.htmlEncode( $indicator.name )$!encoder.htmlEncode( $indicator.code )$!format.formatDate( $indicator.created )$!format.formatDate( $indicator.lastUpdated )
+

+
+ #parse( "/dhis-web-commons/paging/paging.vm" ) +
+ +
From c94e8dd73d3545ea97c728b54fe9f9910e196b96 Mon Sep 17 00:00:00 2001 From: banga Date: Wed, 25 Jan 2017 13:05:46 +0300 Subject: [PATCH 15/21] fixed loading of program name in program views --- .../hierarchy/action/agency/viewAgencyProgramList.java | 6 +++++- .../hierarchy/action/donor/viewDonorProgramList.java | 6 +++++- .../action/mechanism/viewMechanismProgramList.java | 6 +++++- .../action/national/viewNationalProgramList.java | 8 ++++++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java index 6a75c80e..dec42416 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java @@ -43,6 +43,10 @@ public List getPrograms() return programs; } + private AgencyUnit unit; + + public AgencyUnit getUnit(){ return unit; } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -51,7 +55,7 @@ public List getPrograms() public String execute() throws Exception { - AgencyUnit unit = agencyUnitService.getAgencyUnit( id ); + unit = agencyUnitService.getAgencyUnit( id ); programs = new ArrayList<>( unit.getPrograms() ); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java index 37df523b..f369b3ac 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java @@ -43,6 +43,10 @@ public List getPrograms() return programs; } + private DonorUnit unit; + + public DonorUnit getUnit(){ return unit; } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -51,7 +55,7 @@ public List getPrograms() public String execute() throws Exception { - DonorUnit unit = donorUnitService.getDonorUnit( id ); + unit = donorUnitService.getDonorUnit( id ); programs = new ArrayList<>( unit.getPrograms() ); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/viewMechanismProgramList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/viewMechanismProgramList.java index fbad083d..80379249 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/viewMechanismProgramList.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/mechanism/viewMechanismProgramList.java @@ -43,6 +43,10 @@ public List getPrograms() return programs; } + private MechanismUnit unit; + + public MechanismUnit getUnit(){ return unit; } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -51,7 +55,7 @@ public List getPrograms() public String execute() throws Exception { - MechanismUnit unit = mechanismUnitService.getMechanismUnit( id ); + unit = mechanismUnitService.getMechanismUnit( id ); programs = new ArrayList<>( unit.getPrograms() ); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/viewNationalProgramList.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/viewNationalProgramList.java index dd65942b..ae88185d 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/viewNationalProgramList.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-hierarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/national/viewNationalProgramList.java @@ -43,6 +43,10 @@ public List getPrograms() return programs; } + private NationalUnit unit; + + public NationalUnit getUnit(){ return unit; } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -51,9 +55,9 @@ public List getPrograms() public String execute() throws Exception { - NationalUnit nationalUnit = nationalUnitService.getNationalUnit( id ); + unit = nationalUnitService.getNationalUnit( id ); - programs = new ArrayList<>( nationalUnit.getPrograms() ); + programs = new ArrayList<>( unit.getPrograms() ); Collections.sort( programs ); From e263f1079f64a83d46fbd85f484e2ed9ca86c01b Mon Sep 17 00:00:00 2001 From: george2 Date: Wed, 25 Jan 2017 13:10:28 +0300 Subject: [PATCH 16/21] view program details --- .../jphes/program/action/AddProgramAction.java | 16 ++++++++++------ .../dhis/jphes/program/i18n_module.properties | 6 +++++- .../src/main/resources/struts.xml | 6 ++++++ .../webapp/jphes-web-program/addProgramForm.vm | 17 ++++++++++++----- .../jphes-web-program/ajax/jsonProgram.vm | 15 +++++++++++++++ .../main/webapp/jphes-web-program/allProgram.vm | 16 +++++++++------- .../jphes-web-program/javascript/program.js | 6 +++--- 7 files changed, 60 insertions(+), 22 deletions(-) create mode 100644 dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/AddProgramAction.java b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/AddProgramAction.java index 5bfaa6e2..78581e7f 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/AddProgramAction.java +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/java/org/hisp/dhis/jphes/program/action/AddProgramAction.java @@ -55,13 +55,17 @@ public void setCode( String code ) this.code = code; } - private String displayName; + private String shortName; - public void setDisplayName( String displayName ) - { - this.displayName = displayName; + public void setShortName(String shortName) { + this.shortName = shortName; } + private String description; + + public void setDescription(String description) { + this.description = description; + } private List deSelected = new ArrayList<>(); @@ -90,11 +94,11 @@ public void setIndSelected( List indSelected ) IndicatorGroup indicatorGroup = new IndicatorGroup(); if( deSelected.size() >0 || indSelected.size()>0) { - program.setDisplayName( StringUtils.trimToNull( name ) ); program.setName( StringUtils.trimToNull( name ) ); program.setCode( StringUtils.trimToNull( code ) ); - program.setDisplayName( StringUtils.trimToNull( displayName ) ); program.setShortName( StringUtils.abbreviate(name, 40) ); + program.setDescription( StringUtils.trimToNull( description ) ); + Set dataElementGroupMembers = new HashSet<>(); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties index f07f5eb7..1dcb9034 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties @@ -2,4 +2,8 @@ jphes_program=All Programs intro_jphes_program=Create, modify, delete and view programs. available_dataelements=Available Dataelements selected_dataelements=Selected Dataelements -save=Save \ No newline at end of file +save=Save +confirm_delete_program=Confirm Delete +shortname=Short Name +description=Description +uid=UID \ No newline at end of file diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml index 048e80a7..9569b971 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/struts.xml @@ -53,5 +53,11 @@ plainTextError + + /jphes-web-program/ajax/jsonProgram.vm + plainTextError + F_JPHES_PROGRAM_LIST + + diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm index db6a8e09..35168847 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/addProgramForm.vm @@ -49,17 +49,24 @@
diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm new file mode 100644 index 00000000..59b7b2fd --- /dev/null +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm @@ -0,0 +1,15 @@ +{ "program": +{ +"id": "$!{program.programid}", +"name": "$!encoder.jsonEncode( ${program.name} )", +"shortname": "$!encoder.jsonEncode( ${program.shortname} )", +"description": "$!encoder.jsonEncode( ${program.description} )", +"shortname": "$!encoder.jsonEncode( ${program.shortname} )", +"code": "$!encoder.jsonEncode( ${program.code} )", +"uid": "$!{program.uid}", +"dataelementgroup": "$!{program.dataElementGroup.name}", +"indicatorgroup": "$!{program.indicatorGroup.name}", +"created": "$!format.formatDate( ${program.created} )", +"lastupdated": "$!format.formatDate( ${program.lastupdated} )" +} +} \ No newline at end of file diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm index f74ee6b8..829f20a6 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm @@ -1,7 +1,6 @@ -###sharingDialog() - +

Add Program

@@ -43,71 +43,82 @@
+
+
- - -
-
-
- -
- -
- - -
-
-
- -
- -
+ + +
+
+
+ +
+ +
+ + +
+
+
+ +
+ +
- +
diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm index 59b7b2fd..32bd2d8b 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm @@ -7,6 +7,8 @@ "shortname": "$!encoder.jsonEncode( ${program.shortname} )", "code": "$!encoder.jsonEncode( ${program.code} )", "uid": "$!{program.uid}", +"dataelements": "$!{program.dataElements.size()}", +"indicators": "$!{program.indicators.size()}", "dataelementgroup": "$!{program.dataElementGroup.name}", "indicatorgroup": "$!{program.indicatorGroup.name}", "created": "$!format.formatDate( ${program.created} )", diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm index 6896b050..e688e820 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm @@ -13,7 +13,7 @@
  •   $i18n.getString( "view_dataelements" )
  •   $i18n.getString( "view_indicators" )
  •   $i18n.getString( "edit" )
  • -
  •   $i18n.getString( "remove" )
  • +
  •   $i18n.getString( "remove" )
  •   $i18n.getString( "show_details" )
  • @@ -66,8 +66,8 @@




    -##


    -##


    +


    +


    ##


    diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js index 2dd9c601..b2db5c83 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js @@ -7,6 +7,8 @@ function showProgramDetails( context ) { setInnerHTML('nameField', json.program.name); setInnerHTML('shortnameField', json.program.shortName); setInnerHTML('descriptionField', json.program.description); + setInnerHTML('dataElementsField', json.program.dataelements); + setInnerHTML('indicatorsField', json.program.indicators); setInnerHTML('codeField', json.program.code); setInnerHTML('uidField', json.program.uid); diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm index c14910fa..f6d2c50a 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/updateProgramForm.vm @@ -50,17 +50,25 @@ + + + + + + - - - - - + + + + + + From b672e2f0fff652a9aff3731910ab3d709703a681 Mon Sep 17 00:00:00 2001 From: banga Date: Wed, 25 Jan 2017 22:48:03 +0300 Subject: [PATCH 21/21] fixes --- .../org/hisp/dhis/jphes/program/i18n_module.properties | 6 ++++-- .../src/main/webapp/jphes-web-program/ajax/jsonProgram.vm | 3 +-- .../src/main/webapp/jphes-web-program/allProgram.vm | 5 +++-- .../src/main/webapp/jphes-web-program/javascript/program.js | 4 +++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties index e8b96976..7e9722d6 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/resources/org/hisp/dhis/jphes/program/i18n_module.properties @@ -24,5 +24,7 @@ confirm_delete_program=Confirm Delete shortname=Short Name description=Description uid=UID -jphes_number_dataelements=No. of DataElements -jphes_number_indicators=No. of Indicators \ No newline at end of file +jphes_number_dataelements=No. of Data Elements +jphes_number_indicators=No. of Indicators +jphes_dataelementgroup=DataElement Group +jphes_indicatorgroup=Indicator Group \ No newline at end of file diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm index 32bd2d8b..a14a50c5 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/ajax/jsonProgram.vm @@ -2,9 +2,8 @@ { "id": "$!{program.programid}", "name": "$!encoder.jsonEncode( ${program.name} )", -"shortname": "$!encoder.jsonEncode( ${program.shortname} )", +"shortname": "$!encoder.jsonEncode( ${program.shortName} )", "description": "$!encoder.jsonEncode( ${program.description} )", -"shortname": "$!encoder.jsonEncode( ${program.shortname} )", "code": "$!encoder.jsonEncode( ${program.code} )", "uid": "$!{program.uid}", "dataelements": "$!{program.dataElements.size()}", diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm index e688e820..54d3e0fc 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/allProgram.vm @@ -62,13 +62,14 @@ $i18n.getString( 'hide_details' )


    -


    +







    -##


    +


    +


    diff --git a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js index b2db5c83..3b1c1147 100644 --- a/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js +++ b/dhis-2/dhis-web/jphes-web-apps/jphes-web-program/src/main/webapp/jphes-web-program/javascript/program.js @@ -5,10 +5,12 @@ function showProgramDetails( context ) { jQuery.post('getProgram.action', { id: context.id }, function( json ) { setInnerHTML('nameField', json.program.name); - setInnerHTML('shortnameField', json.program.shortName); + setInnerHTML('shortNameField', json.program.shortname); setInnerHTML('descriptionField', json.program.description); setInnerHTML('dataElementsField', json.program.dataelements); setInnerHTML('indicatorsField', json.program.indicators); + setInnerHTML('dataElementGroupField', json.program.dataelementgroup); + setInnerHTML('indicatorGroupField', json.program.indicatorgroup); setInnerHTML('codeField', json.program.code); setInnerHTML('uidField', json.program.uid);