dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25594
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12743: Fixed bug - Option set doesn't work in single event with registration form.
------------------------------------------------------------
revno: 12743
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-10-17 00:29:40 +0700
message:
Fixed bug - Option set doesn't work in single event with registration form.
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java
--
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-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2013-10-11 06:11:27 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2013-10-16 17:29:40 +0000
@@ -268,6 +268,7 @@
executeSql( "ALTER TABLE patientaggregatereport RENAME level TO ouMode" );
executeSql( "ALTER TABLE patientaggregatereport DROP COLUMN facilityLB" );
executeSql( "update programstage_dataelements set allowDateInFuture=false where allowDateInFuture is null" );
+ executeSql( "update programstage set autoGenerateEvent=true where programid in ( select programid from program where type=2 )" );
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java 2013-09-19 08:26:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java 2013-10-16 17:29:40 +0000
@@ -166,9 +166,7 @@
Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( patient, program,
ProgramInstance.STATUS_ACTIVE );
-
- ProgramInstance programInstance = null;
-
+
if ( programInstances.iterator().hasNext() )
{
programInstance = programInstances.iterator().next();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-10-16 15:24:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-10-16 17:29:40 +0000
@@ -2679,8 +2679,8 @@
},
createAggColTable: function(){
var cols = [];
-
- for( var i =0; i <TR.value.columns.length; i++ )
+ var i=0;
+ for( i =0; i <TR.value.columns.length; i++ )
{
cols[i] = {
header: TR.value.columns[i].column,
@@ -2693,6 +2693,17 @@
menuDisabled: true
}
}
+
+ cols[i] = {
+ header: TR.value.columns[i].column,
+ dataIndex: TR.value.columns[i].name,
+ height: TR.conf.layout.east_gridcolumn_height,
+ name: TR.value.columns[i].column,
+ sortable: true,
+ draggable: false,
+ hideable: false,
+ menuDisabled: true
+ }
return cols;
},
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2013-09-20 15:13:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2013-10-16 17:29:40 +0000
@@ -120,7 +120,34 @@
datePicker( '$programStageDataElement.programStage.uid' + '-' + '$programStageDataElement.dataElement.uid' + '-val', false, false);
</script>
#elseif($hasOptionSet=='true')
- <input name="entryfield" options='$hasOptionSet' id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" class="option {validate:{$validate}}" />
+ #if( $programStageDataElement.dataElement.optionSet.options.size() <= 7 && $program.dataEntryMethod =='true' )
+ <table style='width:100%'>
+ <tr>
+ <td>
+ <input id='$id' class='$id' name="$id" options='no' type='radio' optionset='$programStageDataElement.dataElement.optionSet.uid'
+ data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }"
+ #if( $patientDataValue.value == $option) checked #end
+ onclick="saveRadio( '$programStageDataElement.dataElement.uid', '' )" tabindex="$tabIndex" />$i18n.getString("non_value")
+ </td>
+ #set($index=1)
+ #foreach($option in $programStageDataElement.dataElement.optionSet.options)
+ #if($index==4)
+ </tr><tr>
+ #set($index=0)
+ #end
+ <td>
+ <input id='$id' class='$id' name="$id" type='radio' options='no' optionset='$programStageDataElement.dataElement.optionSet.uid'
+ data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }"
+ #if( $patientDataValue.value == $option) checked #end value="$encoder.htmlEncode($option)"
+ onclick="saveRadio( '$programStageDataElement.dataElement.uid', '$option' )" tabindex="$tabIndex" />$encoder.htmlEncode($option)
+ </td>
+ #set($index=$index + 1)
+ #end
+ </tr>
+ </table>
+ #else
+ <input optionset='$programStageDataElement.dataElement.optionSet.uid' id='$id' name="entryfield" options='$hasOptionSet' data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" class="auto-field optionset" />
+ #end
#elseif($programStageDataElement.dataElement.type=='username')
<input name="entryfield" username='true' class="auto-field optionset" data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" />
#else
@@ -225,7 +252,34 @@
datePicker( '$programStageDataElement.programStage.uid' + '-' + '$programStageDataElement.dataElement.uid' + '-val', false, false);
</script>
#elseif($hasOptionSet=='true')
- <input name="entryfield" options='$hasOptionSet' id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" class="option {validate:{$validate}}" />
+ #if( $programStageDataElement.dataElement.optionSet.options.size() <= 7 && $program.dataEntryMethod =='true' )
+ <table style='width:100%'>
+ <tr>
+ <td>
+ <input id='$id' class='$id' name="$id" options='no' type='radio' optionset='$programStageDataElement.dataElement.optionSet.uid'
+ data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }"
+ #if( $patientDataValue.value == $option) checked #end
+ onclick="saveRadio( '$programStageDataElement.dataElement.uid', '' )" tabindex="$tabIndex" />$i18n.getString("non_value")
+ </td>
+ #set($index=1)
+ #foreach($option in $programStageDataElement.dataElement.optionSet.options)
+ #if($index==4)
+ </tr><tr>
+ #set($index=0)
+ #end
+ <td>
+ <input id='$id' class='$id' name="$id" type='radio' options='no' optionset='$programStageDataElement.dataElement.optionSet.uid'
+ data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }"
+ #if( $patientDataValue.value == $option) checked #end value="$encoder.htmlEncode($option)"
+ onclick="saveRadio( '$programStageDataElement.dataElement.uid', '$option' )" tabindex="$tabIndex" />$encoder.htmlEncode($option)
+ </td>
+ #set($index=$index + 1)
+ #end
+ </tr>
+ </table>
+ #else
+ <input optionset='$programStageDataElement.dataElement.optionSet.uid' id='$id' name="entryfield" options='$hasOptionSet' data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" class="auto-field optionset" />
+ #end
#elseif($programStageDataElement.dataElement.type=='username')
<input name="entryfield" username='true' class="auto-field optionset" data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" />
#else
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2013-09-19 12:43:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2013-10-16 17:29:40 +0000
@@ -338,7 +338,14 @@
programStage.setMinDaysFromStart( minDaysFromStart );
programStage.setDisplayGenerateEventBox( displayGenerateEventBox );
programStage.setValidCompleteOnly( validCompleteOnly );
- programStage.setAutoGenerateEvent( autoGenerateEvent );
+ if ( program.isSingleEvent() )
+ {
+ programStage.setAutoGenerateEvent( true );
+ }
+ else
+ {
+ programStage.setAutoGenerateEvent( autoGenerateEvent );
+ }
programStage.setCaptureCoordinates( captureCoordinates );
programStage.setBlockEntryForm( blockEntryForm );
programStage.setRemindCompleted( remindCompleted );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2013-09-19 12:43:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2013-10-16 17:29:40 +0000
@@ -336,11 +336,15 @@
programStage.setOpenAfterEnrollment( openAfterEnrollment );
programStage.setReportDateToUse( reportDateToUse );
- if ( !programStage.getProgram().isSingleEvent() )
+ if ( programStage.getProgram().isSingleEvent() )
+ {
+ programStage.setAutoGenerateEvent( true );
+ }
+ else
{
programStage.setAutoGenerateEvent( autoGenerateEvent );
}
-
+
programStage.setValidCompleteOnly( validCompleteOnly );
programStage.setCaptureCoordinates( captureCoordinates );