dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18801
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7976: Add phone number into dashboard.
------------------------------------------------------------
revno: 7976
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-08-29 13:02:27 +0700
message:
Add phone number into dashboard.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.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/patientForm.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/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-08-28 09:27:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-08-29 06:02:27 +0000
@@ -361,7 +361,7 @@
hideById('dateOfIncidentTR');
}
else{
- var type = jQuery('#enrollmentDiv [name=programId] option:selected').attr('type');
+ var type = jQuery('#enrollmentDiv [name=programId] option:selected').attr('programType')
if(type=='2'){
hideById('enrollmentDateTR');
hideById('dateOfIncidentTR');
@@ -410,20 +410,20 @@
var programStageInstanceId = json.activeProgramStageInstanceId;
var programStageName = json.activeProgramStageName;
var dueDate = json.dueDate;
- var type = jQuery('#enrollmentDiv [id=programId] option:selected').attr('type');
+ var type = jQuery('#enrollmentDiv [id=programId] option:selected').attr('programType');
var activedRow = "<tr id='tr1_" + programInstanceId
+ "' type='" + type +"'"
+ " programStageInstanceId='" + programStageInstanceId + "'>"
+ " <td id='td_" + programInstanceId + "'>"
- + " <a href='javascript:loadProgramInstance(" + programInstanceId + ", false)'>"
+ + " <a href='javascript:loadActiveProgramStageRecords(" + programInstanceId + "," + programStageInstanceId + "')'>"
+ programName + "(" + enrollmentDate + ")</a>"
+ "<img id='img_" + programInstanceId + "' name='imgActive'></td>"
+ "<td><img src='../images/checked.png' style='cursor:pointer;' onclick='unenrollmentForm(" + programInstanceId + ")'></td>"
+ "</tr>";
activedRow += "<tr id='tr2_" + programInstanceId +"'"+
- + " onclick='javascript:loadProgramStageRecords(" + programStageInstanceId + ", false)' style='cursor:pointer;'>"
+ + " onclick='javascript:loadActiveProgramStageRecords(" + programInstanceId + "," + programStageInstanceId + ")' style='cursor:pointer;'>"
+ "<td colspan='2'><a>• " + programStageName + "(" + dueDate + ")</a></td></tr>";
jQuery('#activeTB' ).prepend(activedRow);
@@ -443,7 +443,7 @@
}, function()
{
showById('programEnrollmentDiv');
- var type = jQuery('#tr_'+programInstanceId).attr('type');
+ var type = jQuery('#tr_'+programInstanceId).attr('programType');
if(type=='2'){
hideById('programInstanceDiv');
var programStageInstanceId = jQuery('#tr_'+programInstanceId).attr('programStageInstanceId');
@@ -944,6 +944,30 @@
});
}
+function loadActiveProgramStageRecords(programInstanceId, activeProgramStageInstanceId)
+{
+ jQuery('#loaderDiv').show();
+ jQuery('#programEnrollmentDiv').load('enrollmentform.action',
+ {
+ programInstanceId:programInstanceId
+ }, function()
+ {
+ showById('programEnrollmentDiv');
+ var type = jQuery('#tr_'+programInstanceId).attr('programType');
+ if(type=='2'){
+ hideById('programInstanceDiv');
+ var programStageInstanceId = jQuery('#tr_'+programInstanceId).attr('programStageInstanceId');
+ loadDataEntry( programStageInstanceId );
+ }
+ else{
+ showById('programInstanceDiv');
+ }
+ activeProgramInstanceDiv( programInstanceId );
+ loadDataEntry( activeProgramStageInstanceId );
+ jQuery('#loaderDiv').hide();
+ });
+}
+
function loadProgramStageRecords( programStageInstanceId, completed )
{
showLoader();
@@ -958,14 +982,5 @@
}
showById('dataEntryFormDiv');
hideLoader();
- }).dialog(
- {
- title:i18n_program_stage,
- maximize:true,
- closable:true,
- modal:false,
- overlay:{background:'#000000', opacity:0.1},
- width:1000,
- height:500
});
}
=== 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-08-28 05:48:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-08-29 06:02:27 +0000
@@ -35,6 +35,10 @@
<td>$i18n.getString("date_of_birth")</td>
<td>$format.formatDate( $!patient.birthDate) $!patient.getAge()</td>
</tr>
+ <tr>
+ <td>$i18n.getString("phone_number")</td>
+ <td>$!patient.phoneNumber</td>
+ </tr>
#foreach( $identifier in $identifiers )
<tr>
#if($!identifier.identifierType)
@@ -83,21 +87,22 @@
#set($programStageInstanceId = $programStageInstance.id)
#end
#end
- <tr id='tr1_$programInstance.id' type='$programInstance.program.type'
- programStageInstanceId='$programStageInstanceId'>
- <td id='td_$programInstance.id'>
- <a href='javascript:loadProgramInstance("$programInstance.id", false)'>$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate))</a>
- <img id="img_$programInstance.id" name='imgActive'>
- </td>
- <td>
- <img src='../images/checked.png' style='cursor:pointer;' onclick='unenrollmentForm("$programInstance.id")'>
- </td>
- </tr>
+
#set($flag = 'false')
#foreach( $programStageInstance in $programInstance.programStageInstances )
#set( $status = $statusMap.get( $programStageInstance.id ) )
#if( $status!=1 && $flag=='false')
- <tr id='tr2_$programInstance.id' onclick='javascript:loadProgramStageRecords("$programStageInstance.id", false)' style='cursor:pointer;'>
+ <tr id='tr1_$programInstance.id' type='$programInstance.program.type'
+ programStageInstanceId='$programStageInstanceId'>
+ <td id='td_$programInstance.id'>
+ <a href='javascript:loadActiveProgramStageRecords("$programInstance.id", "$programStageInstance.id")'>$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate))</a>
+ <img id="img_$programInstance.id" name='imgActive'>
+ </td>
+ <td>
+ <img src='../images/checked.png' style='cursor:pointer;' onclick='unenrollmentForm("$programInstance.id")'>
+ </td>
+ </tr>
+ <tr id='tr2_$programInstance.id' onclick='javascript:loadActiveProgramStageRecords("$programInstance.id", "$programStageInstance.id")' style='cursor:pointer;'>
<td colspan='2'>
<a>• $programStageInstance.programStage.name ($format.formatDate($programStageInstance.dueDate))</a>
</td>
@@ -105,6 +110,18 @@
#set($flag = 'true')
#end
#end
+ #if($flag=='false')
+ <tr id='tr1_$programInstance.id' type='$programInstance.program.type'
+ programStageInstanceId='$programStageInstanceId'>
+ <td id='td_$programInstance.id'>
+ <a href='javascript:loadProgramInstance("$programInstance.id", false)'>$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate))</a>
+ <img id="img_$programInstance.id" name='imgActive'>
+ </td>
+ <td>
+ <img src='../images/checked.png' style='cursor:pointer;' onclick='unenrollmentForm("$programInstance.id")'>
+ </td>
+ </tr>
+ #end
#end
</table>
</div>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-08-02 09:58:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-08-29 06:02:27 +0000
@@ -31,9 +31,8 @@
<td class='text-column'><label for="gender">$i18n.getString( "gender" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td class="input-column">
<select id="gender" name="gender" class="{validate:{required:true}}">
- <option value="" selected="selected">[$i18n.getString( "please_select" )]</option>
- <option value="M" >$i18n.getString( "male" )</option>
- <option value="F">$i18n.getString( "female" )</option>
+ <option value="M">$i18n.getString( "male" )</option>
+ <option value="F" selected>$i18n.getString( "female" )</option>
<option value="T">$i18n.getString( "transgender" )</option>
</select>
</td>