-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from uonafya/viewprograms
jphes program validation & fixes
- Loading branch information
Showing
50 changed files
with
1,277 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+7.38 KB
...dhis-web/dhis-web-commons-resources/src/main/webapp/icons/jphes-web-program.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...rchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/agency/viewAgencyProgramList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
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<Program> | ||
{ | ||
// ------------------------------------------------------------------------- | ||
// Dependencies | ||
// ------------------------------------------------------------------------- | ||
|
||
@Autowired | ||
private AgencyUnitService agencyUnitService; | ||
|
||
// ------------------------------------------------------------------------- | ||
// Input | ||
// ------------------------------------------------------------------------- | ||
|
||
private Integer id; | ||
|
||
public void setId(Integer id){ | ||
this.id = id; | ||
} | ||
|
||
// ------------------------------------------------------------------------- | ||
// Output | ||
// ------------------------------------------------------------------------- | ||
|
||
private List<Program> programs; | ||
|
||
public List<Program> getPrograms() | ||
{ | ||
return programs; | ||
} | ||
|
||
private AgencyUnit unit; | ||
|
||
public AgencyUnit getUnit(){ return unit; } | ||
|
||
// ------------------------------------------------------------------------- | ||
// Action implementation | ||
// ------------------------------------------------------------------------- | ||
|
||
@Override | ||
public String execute() | ||
throws Exception | ||
{ | ||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...rarchy/src/main/java/org/hisp/dhis/jphes/hierarchy/action/donor/viewDonorProgramList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
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<Program> | ||
{ | ||
// ------------------------------------------------------------------------- | ||
// Dependencies | ||
// ------------------------------------------------------------------------- | ||
|
||
@Autowired | ||
private DonorUnitService donorUnitService; | ||
|
||
// ------------------------------------------------------------------------- | ||
// Input | ||
// ------------------------------------------------------------------------- | ||
|
||
private Integer id; | ||
|
||
public void setId(Integer id){ | ||
this.id = id; | ||
} | ||
|
||
// ------------------------------------------------------------------------- | ||
// Output | ||
// ------------------------------------------------------------------------- | ||
|
||
private List<Program> programs; | ||
|
||
public List<Program> getPrograms() | ||
{ | ||
return programs; | ||
} | ||
|
||
private DonorUnit unit; | ||
|
||
public DonorUnit getUnit(){ return unit; } | ||
|
||
// ------------------------------------------------------------------------- | ||
// Action implementation | ||
// ------------------------------------------------------------------------- | ||
|
||
@Override | ||
public String execute() | ||
throws Exception | ||
{ | ||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.