dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19335
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8387: Only display Data entry form tab if selected progam is single event with registration in Dashboard.
------------------------------------------------------------
revno: 8387
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-10-05 15:12:39 +0700
message:
Only display Data entry form tab if selected progam is single event with registration in Dashboard.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.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-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-10-05 07:47:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-10-05 08:12:39 +0000
@@ -1248,49 +1248,12 @@
jQuery('#activeTB' ).prepend(activedRow);
jQuery('#enrollmentDiv').dialog("close");
saveIdentifierAndAttribute( patientId, programId,'identifierAndAttributeDiv' );
- loadProgramInstance( programInstanceId, false );
+ loadActiveProgramStageRecords( programInstanceId );
showSuccessMessage(i18n_enrol_success);
});
}
// ----------------------------------------------------------------
-// Load program instance
-// ----------------------------------------------------------------
-
-function loadProgramInstance( programInstanceId, completed )
-{
- if( programInstanceId=='') {
- hideById('programEnrollmentDiv');
- return;
- }
- jQuery('#loaderDiv').show();
- jQuery('#programEnrollmentDiv').load('enrollmentform.action',
- {
- programInstanceId:programInstanceId
- }, function()
- {
- showById('programEnrollmentDiv');
- var type = jQuery('#tb_' + programInstanceId).attr('programType');
- if(type=='2'){
- hideById('colorHelpLink');
- hideById('programInstanceDiv');
- var programStageInstanceId = jQuery('.stage-object').attr('id').split('_')[1];
- loadDataEntry( programStageInstanceId );
- }
- else{
- showById('programInstanceDiv');
- }
- activeProgramInstanceDiv( programInstanceId );
- if( completed ){
- hideById('newEncounterBtn_' + programInstanceId);
- }
- jQuery('#loaderDiv').hide();
- resize();
- $(window).scrollTop(200);
- });
-}
-
-// ----------------------------------------------------------------
// Program enrollmment && unenrollment
// ----------------------------------------------------------------
@@ -1505,21 +1468,26 @@
}, function()
{
showById('programEnrollmentDiv');
- var type = jQuery('#tr_'+programInstanceId).attr('programType');
+ var type = jQuery('#tb_'+programInstanceId).attr('programType');
if(type=='2'){
+ hideById('colorHelpLink');
hideById('programInstanceDiv');
- var programStageInstanceId = jQuery('#tr_'+programInstanceId).attr('programStageInstanceId');
- loadDataEntryloadDataEntry( programStageInstanceId );
+ var programStageInstanceId = jQuery('.stage-object').attr('id').split('_')[1];
+ loadDataEntry( programStageInstanceId );
}
else{
showById('programInstanceDiv');
+ activeProgramInstanceDiv( programInstanceId );
+ if( activeProgramStageInstanceId != undefined )
+ {
+ loadDataEntry( activeProgramStageInstanceId );
+ }
}
- activeProgramInstanceDiv( programInstanceId );
- if( activeProgramStageInstanceId )
+
+ if( activeProgramStageInstanceId != undefined )
{
- loadDataEntry( activeProgramStageInstanceId );
+ jQuery('#completedList').val('');
}
- jQuery('#completedList').val('');
jQuery('#loaderDiv').hide();
});
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-10-03 06:04:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-10-05 08:12:39 +0000
@@ -150,7 +150,7 @@
<tr><th>$i18n.getString("completed_programs")</th></tr>
<tr>
<td>
- <select id="completedList" name="completedList" onchange="javascript:loadProgramInstance(this.value, true);" style="width:100%">
+ <select id="completedList" name="completedList" onchange="javascript:loadActiveProgramStageRecords(this.value);" style="width:100%">
<option value="">[$i18n.getString("please_select")]</option>
#foreach($programInstance in $completedProgramInstances)
#set($programStageInstanceId = '')
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2012-10-05 03:29:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2012-10-05 08:12:39 +0000
@@ -144,21 +144,24 @@
$('#tabs').tabs();
#if( $programInstance.program.type!='1' )
+ $("#tabs").tabs("remove", 4);
+ $("#tabs").tabs("remove", 3);
$("#tabs").tabs("remove", 2);
- #end
-
- #if( ( $noIden && $noIden > 0) || ( $noOtherGroup && $noOtherGroup > 0) || ( $noGroup && $noGroup > 0 ))
- $( "#tabs" ).tabs( "option", "selected", 1 );
- #else
- $( "#tabs" ).tabs( "option", "selected", 2 );
$("#tabs").tabs("remove", 1);
- #end
-
- #if( $hasDataEntry == 'true' )
- $( "#tabs" ).tabs( "option", "selected", 0 );
#else
- $( "#tabs" ).tabs( "option", "disabled", [0] );
- $("#tabs").tabs("remove", 0);
+ #if( ( $noIden && $noIden > 0) || ( $noOtherGroup && $noOtherGroup > 0) || ( $noGroup && $noGroup > 0 ))
+ $( "#tabs" ).tabs( "option", "selected", 1 );
+ #else
+ $( "#tabs" ).tabs( "option", "selected", 2 );
+ $("#tabs").tabs("remove", 1);
+ #end
+
+ #if( $hasDataEntry == 'true' )
+ $( "#tabs" ).tabs( "option", "selected", 0 );
+ #else
+ $( "#tabs" ).tabs( "option", "disabled", [0] );
+ $("#tabs").tabs("remove", 0);
+ #end
#end
#end
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm 2012-10-05 07:47:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm 2012-10-05 08:12:39 +0000
@@ -22,7 +22,6 @@
psid="$programStageInstance.programStage.id"
psname="$programStageInstance.programStage.name"
status="$programStageInstance.getEventStatus()"
- orgunit="$!programStageInstance.organisationUnit.name"
programType='$programInstance.program.type'
reportDate="$!format.formatDate( $!programStageInstance.executionDate )"
reportDateDes="$programStageInstance.programStage.reportDateDescription"