=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java' --- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java 2010-06-15 11:26:37 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java 2010-08-31 07:51:06 +0000 @@ -43,6 +43,7 @@ import org.hisp.dhis.dataelement.DataElementService; import org.hisp.dhis.dataentryform.DataEntryForm; import org.hisp.dhis.dataentryform.DataEntryFormService; +import org.hisp.dhis.datalock.DataSetLockService; import org.hisp.dhis.dataset.DataSet; import org.hisp.dhis.datavalue.DataValue; import org.hisp.dhis.den.api.LLDataSets; @@ -127,6 +128,13 @@ { this.selectedStateManager = selectedStateManager; } + + private DataSetLockService dataSetLockService; + + public void setDataSetLockService( DataSetLockService dataSetLockService) + { + this.dataSetLockService = dataSetLockService; + } private I18n i18n; @@ -329,8 +337,14 @@ { return maxRecordNo; } - - + + private boolean locked = false; + + public boolean isLocked() + { + return locked; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -484,6 +498,18 @@ } + if( dataSetLockService == null ) + { + System.out.println(" DataSetLockService is null"); + } + if( dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period ) != null) + { + if( dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period ).getSources().contains(organisationUnit) ) + { + locked = true; + } + } + maxRecordNo = dataValueService.getMaxRecordNo(); return SUCCESS; === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java' --- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java 2010-07-13 09:28:43 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java 2010-08-31 07:51:06 +0000 @@ -293,7 +293,7 @@ if(temp.getName().equalsIgnoreCase( LLDataSets.LL_IDSP_LAB ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS_IDSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_BIRTHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_MATERNAL_DEATHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTS )) { - if ( !( temp.getPeriodType() instanceof CalendarPeriodType ) || temp.getLocked() ) + if ( !( temp.getPeriodType() instanceof CalendarPeriodType ) ) { it.remove(); } === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml' --- local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml 2010-06-17 07:51:57 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml 2010-08-31 07:51:06 +0000 @@ -107,7 +107,9 @@ + ref="org.hisp.dhis.dataelement.DataElementCategoryService"/> + - @@ -103,29 +103,29 @@ #elseif($count1 == 6) - - - $i18n.getString( + + $i18n.getString( #elseif($count1 == 4) - - + + #if( !$locked ) #end #set($calInfo = $calInfo + "Calendar.setup({inputField:'value["+$llDataValue.getDataElement().getId()+"].value:value["+$llDataValue.getRecordNo()+"].value',ifFormat:'$i18n.getString('format.date.label')',button:'getvalue["+$llDataValue.getDataElement().getId()+"].value:value["+$llDataValue.getRecordNo()+"].value'});") #elseif($count1 == 1)
$slno
- + #elseif($count1 == 5) - + #else - + #end #set( $count1 = $count1 + 1 ) #set( $lastRecord = $llDataValue.getRecordNo() ) @@ -133,6 +133,7 @@ #set( $slno = $slno + 1 ) #end +#if( !$locked )
$slno
@@ -168,6 +169,7 @@ +#end === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm' --- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm 2010-06-04 11:50:05 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm 2010-08-31 07:51:06 +0000 @@ -86,7 +86,7 @@ #foreach( $llDataValue in $llDataValues) #if($count1 == 3) - @@ -94,7 +94,7 @@ #elseif($count1 == 4) - @@ -108,7 +108,7 @@ #elseif($count1 == 5) - @@ -135,15 +135,15 @@ - + $i18n.getString( #elseif($count1 == 1)
$slno
- + #else - + #end #set($count1 = $count1+1) #set( $lastRecord = $llDataValue.getRecordNo() ) @@ -151,7 +151,7 @@ #set( $slno = $slno + 1 ) #end - +
$slno
=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm' --- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm 2010-06-04 11:50:05 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm 2010-08-31 07:51:06 +0000 @@ -98,19 +98,19 @@ #foreach( $llDataValue in $llDataValues) #if($count1 == 8) - - + $i18n.getString( #elseif($count1 == 4) - @@ -121,7 +121,7 @@ #elseif($count1 == 5) - @@ -132,7 +132,7 @@ #elseif($count1 == 6) - @@ -144,7 +144,7 @@ #elseif($count1 == 7) - @@ -160,11 +160,11 @@ #elseif($count1 == 1)
$slno
- + #elseif($count1 == 3) - + #else - + #end #set($count1 = $count1+1) #set( $lastRecord = $llDataValue.getRecordNo() ) @@ -172,7 +172,7 @@ #set( $slno = $slno + 1 ) #end - +
$slno