dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25040
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12344: apply periodService.getPerios(isoPeriod) for web-light
------------------------------------------------------------
revno: 12344
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-10-01 15:28:26 +0700
message:
apply periodService.getPerios(isoPeriod) for web-light
modified:
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/MenuAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetDataSetOverviewAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/MarkComplete.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/UndoCompleteAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntryOverview.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-09-30 07:50:50 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-10-01 08:28:26 +0000
@@ -1976,6 +1976,26 @@
public String findLostToFollowUp( int orgUnitId, String programId )
throws NotAllowedException
{
- return "";
+ DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+ List<String> searchTextList = new ArrayList<String>();
+ List<OrganisationUnit> orgUnitList = new ArrayList<OrganisationUnit>();
+
+ Calendar toCalendar = new GregorianCalendar();
+ toCalendar.add( Calendar.DATE, -1 );
+ toCalendar.add( Calendar.YEAR, 100 );
+ Date toDate = toCalendar.getTime();
+
+ Calendar fromCalendar = new GregorianCalendar();
+ fromCalendar.add( Calendar.DATE, -1 );
+ fromCalendar.add( Calendar.YEAR, -100 );
+ Date fromDate = toCalendar.getTime();
+
+ String searchText = Patient.PREFIX_PROGRAM_EVENT_BY_STATUS+"_"+programId+"_"+formatter.format( fromDate )+"_"+formatter.format( toDate )+"_"+orgUnitId+"_"+true+"_"+ProgramStageInstance.LATE_VISIT_STATUS;
+
+ searchTextList.add( searchText );
+ orgUnitList.add( organisationUnitService.getOrganisationUnit( orgUnitId ) );
+
+ List<Integer> stageInstanceIds = patientService.getProgramStageInstances( searchTextList, orgUnitList, true, null, null );
+ return searchText;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/MenuAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/MenuAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/MenuAction.java 2013-10-01 08:28:26 +0000
@@ -115,11 +115,11 @@
return organisationUnit;
}
- private String periodId;
+ private String isoPeriod;
- public void setPeriodId( String periodId )
+ public void setIsoPeriod( String isoPeriod )
{
- this.periodId = periodId;
+ this.isoPeriod = isoPeriod;
}
private Period period;
@@ -177,7 +177,7 @@
{
organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
- period = periodService.getPeriodByExternalId( periodId );
+ period = periodService.getPeriod( isoPeriod );
period.setName( format.formatPeriod( period ) );
dataSet = dataSetService.getDataSet( dataSetId );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetDataSetOverviewAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetDataSetOverviewAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetDataSetOverviewAction.java 2013-10-01 08:28:26 +0000
@@ -124,16 +124,16 @@
return organisationUnit;
}
- private String periodId;
+ private String isoPeriod;
- public void setPeriodId( String periodId )
+ public String getIsoPeriod()
{
- this.periodId = periodId;
+ return isoPeriod;
}
- public String getPeriodId()
+ public void setIsoPeriod( String isoPeriod )
{
- return periodId;
+ this.isoPeriod = isoPeriod;
}
private Period period;
@@ -215,12 +215,12 @@
public String execute()
{
Validate.notNull( organisationUnitId );
- Validate.notNull( periodId );
+ Validate.notNull( isoPeriod );
Validate.notNull( dataSetId );
-
+
organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
- period = periodService.getPeriodByExternalId( periodId );
+ period = periodService.getPeriod ( isoPeriod );
period.setName( format.formatPeriod( period ) );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java 2013-10-01 08:28:26 +0000
@@ -104,16 +104,16 @@
return organisationUnitId;
}
- private String periodId;
+ private String isoPeriod;
- public void setPeriodId( String periodId )
+ public String getIsoPeriod()
{
- this.periodId = periodId;
+ return isoPeriod;
}
- public String getPeriodId()
+ public void setIsoPeriod( String isoPeriod )
{
- return periodId;
+ this.isoPeriod = isoPeriod;
}
private Integer dataSetId;
@@ -205,12 +205,12 @@
public String execute()
{
Validate.notNull( organisationUnitId );
- Validate.notNull( periodId );
+ Validate.notNull( isoPeriod );
Validate.notNull( dataSetId );
OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
- Period period = periodService.getPeriodByExternalId( periodId );
+ Period period = periodService.getPeriod( isoPeriod );
dataSet = dataSetService.getDataSet( dataSetId );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/MarkComplete.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/MarkComplete.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/MarkComplete.java 2013-10-01 08:28:26 +0000
@@ -103,16 +103,16 @@
return organisationUnitId;
}
- private String periodId;
+ private String isoPeriod;
- public void setPeriodId( String periodId )
+ public String getIsoPeriod()
{
- this.periodId = periodId;
+ return isoPeriod;
}
- public String getPeriodId()
+ public void setIsoPeriod( String isoPeriod )
{
- return periodId;
+ this.isoPeriod = isoPeriod;
}
private Integer dataSetId;
@@ -135,12 +135,12 @@
public String execute() throws Exception
{
Validate.notNull( organisationUnitId );
- Validate.notNull( periodId );
+ Validate.notNull( isoPeriod );
Validate.notNull( dataSetId );
OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
- Period period = periodService.getPeriodByExternalId( periodId );
+ Period period = periodService.getPeriod( isoPeriod );
DataSet dataSet = dataSetService.getDataSet( dataSetId );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2013-10-01 08:28:26 +0000
@@ -166,16 +166,16 @@
return organisationUnitId;
}
- private String periodId;
+ private String isoPeriod;
- public void setPeriodId( String periodId )
+ public String getIsoPeriod()
{
- this.periodId = periodId;
+ return isoPeriod;
}
- public String getPeriodId()
+ public void setIsoPeriod( String isoPeriod )
{
- return periodId;
+ this.isoPeriod = isoPeriod;
}
private Integer dataSetId;
@@ -276,12 +276,12 @@
public String execute()
{
Validate.notNull( organisationUnitId );
- Validate.notNull( periodId );
+ Validate.notNull( isoPeriod );
Validate.notNull( dataSetId );
OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
- Period period = periodService.getPeriodByExternalId( periodId );
+ Period period = periodService.getPeriod( isoPeriod );
boolean needsValidation = false;
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/UndoCompleteAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/UndoCompleteAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/UndoCompleteAction.java 2013-10-01 08:28:26 +0000
@@ -88,16 +88,16 @@
return organisationUnitId;
}
- private String periodId;
+ private String isoPeriod;
- public void setPeriodId( String periodId )
+ public String getIsoPeriod()
{
- this.periodId = periodId;
+ return isoPeriod;
}
- public String getPeriodId()
+ public void setIsoPeriod( String isoPeriod )
{
- return periodId;
+ this.isoPeriod = isoPeriod;
}
private Integer dataSetId;
@@ -118,7 +118,7 @@
{
OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
- Period period = periodService.getPeriodByExternalId( periodId );
+ Period period = periodService.getPeriod( isoPeriod );
DataSet dataSet = dataSetService.getDataSet( dataSetId );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java 2013-10-01 08:28:26 +0000
@@ -136,18 +136,7 @@
@Override
public String execute()
throws Exception
- {
- if ( keyword != null )
- {
- int index = keyword.indexOf( ' ' );
-
- if ( index != -1 && index == keyword.lastIndexOf( ' ' ) )
- {
- String[] keys = keyword.split( " " );
- keyword = keys[0] + " " + keys[1];
- }
- }
-
+ {
patients = patientService.getPatientsForMobile( keyword, organisationUnitId );
if ( patients.size() == 1 )
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java 2013-10-01 08:28:26 +0000
@@ -44,6 +44,7 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.CalendarPeriodType;
import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.period.YearlyPeriodType;
import org.hisp.dhis.setting.SystemSettingManager;
import org.hisp.dhis.system.filter.OrganisationUnitWithDataSetsFilter;
@@ -397,4 +398,12 @@
return false;
}
+
+ public static String getIsoPeriod( PeriodType periodType )
+ {
+ if ( periodType.getName().equals( "" ) )
+ {}
+ String result = "";
+ return result;
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2013-07-26 03:52:08 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2013-10-01 08:28:26 +0000
@@ -69,7 +69,7 @@
<action name="saveSectionForm"
class="org.hisp.dhis.light.dataentry.action.SaveSectionFormAction">
<result name="success" type="redirect">
- /light/dataEntry.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&periodId=${periodId}&sectionId=${sectionId}&validated=${validated}
+ /light/dataEntry.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&isoPeriod=${isoPeriod}&sectionId=${sectionId}&validated=${validated}
</result>
<result name="error" type="velocity">/dhis-web-light/main.vm</result>
<param name="page">/dhis-web-light/dataEntrySection.vm</param>
@@ -79,7 +79,7 @@
<action name="markComplete"
class="org.hisp.dhis.light.dataentry.action.MarkComplete">
<result name="success" type="redirect">
- /light/index.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&periodId=${periodId}&complete=true
+ /light/index.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&isoPeriod=${isoPeriod}&complete=true
</result>
<param name="requiredAuthorities">F_DATAVALUE_ADD</param>
</action>
@@ -87,7 +87,7 @@
<action name="inComplete"
class="org.hisp.dhis.light.dataentry.action.UndoCompleteAction">
<result name="success" type="redirect">
- /light/dataEntry.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&periodId=${periodId}
+ /light/dataEntry.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&isoPeriod=${isoPeriod}
</result>
<param name="requiredAuthorities">F_DATAVALUE_DELETE</param>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntryOverview.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntryOverview.vm 2013-03-21 06:01:22 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntryOverview.vm 2013-10-01 08:28:26 +0000
@@ -29,11 +29,11 @@
#if( $dataSet.sections.size() > 0 )
#foreach( $section in $dataSet.sections )
<li>
- <a href="dataEntrySection.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$periodId§ionId=$section.id">$i18n.getString( $section.displayName )</a>
+ <a href="dataEntrySection.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&isoPeriod=$isoPeriod§ionId=$section.id">$i18n.getString( $section.displayName )</a>
</li>
#end
#else
- <a href="dataEntrySection.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$periodId">$i18n.getString( "Default" )</a>
+ <a href="dataEntrySection.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&isoPeriod=$isoPeriod">$i18n.getString( "Default" )</a>
#end
</ul>
</p>
@@ -41,8 +41,7 @@
<form method="GET" action=#if($completed == true) "inComplete.action" #else "markComplete.action" #end>
<input type="hidden" id="organisationUnitId" name="organisationUnitId" value="$organisationUnitId" />
<input type="hidden" id="dataSetId" name="dataSetId" value="$dataSetId" />
-<input type="hidden" id="periodId" name="periodId" value="$periodId" />
-
+<input type="hidden" id="isoPeriod" name="isoPeriod" value="$isoPeriod" />
<div class="header-box" align="center">
<p>
<input type="hidden" name="formComplete" value="true" />
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm 2013-08-08 12:00:17 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm 2013-10-01 08:28:26 +0000
@@ -29,7 +29,7 @@
<input type="hidden" id="organisationUnitId" name="organisationUnitId" value="$organisationUnitId" />
<input type="hidden" id="dataSetId" name="dataSetId" value="$dataSetId" />
-<input type="hidden" id="periodId" name="periodId" value="$periodId" />
+<input type="hidden" id="isoPeriod" name="isoPeriod" value="$isoPeriod" />
#if( $sectionId)
<input type="hidden" id="sectionId" name="sectionId" value="$sectionId" />
@@ -107,7 +107,7 @@
<div id="footer">
<h2>$i18n.getString( "navigate_to" )</h2>
<ul>
- <li><a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$periodId">$i18n.getString("data_entry_overview")</a></li>
+ <li><a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&isoPeriod=$isoPeriod">$i18n.getString("data_entry_overview")</a></li>
<li><a href="index.action">$i18n.getString("home")</a></li>
</ul>
</div>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm 2013-02-03 10:13:17 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm 2013-10-01 08:28:26 +0000
@@ -17,9 +17,11 @@
#foreach( $period in $periods )
<li>
#if( ! $lockedPeriods.contains( $period ) && ! $periodCompletedMap.get($period) )
- <a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$period.getExternalId()">$!encoder.htmlEncode( ${period.name} )</a>
+ <!--<a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$period.getExternalId()">$!encoder.htmlEncode( ${period.name} )</a>-->
+ <a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&isoPeriod=$period.periodType.getIsoDate($period)">$!encoder.htmlEncode( ${period.name} )</a>
#elseif( $periodCompletedMap.get($period) )
- <a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$period.getExternalId()">$!encoder.htmlEncode( ${period.name} )</a>
+ <!--<a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$period.getExternalId()">$!encoder.htmlEncode( ${period.name} )</a>-->
+ <a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&isoPeriod=$period.periodType.getIsoDate($period)">$!encoder.htmlEncode( ${period.name} )</a>
#end
#if( $periodCompletedMap.get($period) )<img src="../dhis-web-light/images/checkmark.jpg" />#end