dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19606
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8624: Small changes form of program-tracking.
------------------------------------------------------------
revno: 8624
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-10-22 13:00:03 +0700
message:
Small changes form of program-tracking.
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/javascript/smsReminder.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css
--
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-22 03:02:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-10-22 06:00:03 +0000
@@ -1596,8 +1596,7 @@
setInnerHTML('smsError', '');
if(field.value==""){
field.style.backgroundColor = ERROR_COLOR;
- jQuery('#smsError').css("color", "red");
- setInnerHTML('smsError', i18n_this_field_is_required);
+ jQuery('#' + field.id).attr("placeholder", i18n_this_field_is_required);
return;
}
@@ -1642,6 +1641,7 @@
var commentText = field.value;
if( commentText == ''){
field.style.backgroundColor = ERROR_COLOR;
+ jQuery('#' + field.id).attr("placeholder", i18n_this_field_is_required);
return;
}
@@ -1662,7 +1662,7 @@
showSuccessMessage( i18n_comment_added );
field.style.backgroundColor = SUCCESS_COLOR;
- if( jQuery("#commentTB tr.hidden").length > 0 ){
+ if( jQuery("#commentTB tr").length > 5 ){
commentDivToggle(true);
}
else{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-10-06 14:57:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-10-22 06:00:03 +0000
@@ -189,10 +189,10 @@
}
// --------------------------------------------------------------------
-// Post Comments
+// Post Comments/Send Message
// --------------------------------------------------------------------
-function keypress(event, field, programStageInstanceId )
+function keypressOnComent(event, field, programStageInstanceId )
{
var key = getKeyCode( event );
if ( key==13 ){ // Enter
@@ -200,6 +200,14 @@
}
}
+function keypressOnMessage(event, field, programStageInstanceId )
+{
+ var key = getKeyCode( event );
+ if ( key==13 ){ // Enter
+ sendSmsOnePatient( field, programStageInstanceId );
+ }
+}
+
// --------------------------------------------------------------------
// Dashboard
// --------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm 2012-10-05 03:18:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm 2012-10-22 06:00:03 +0000
@@ -1,4 +1,3 @@
-
<h3>
<a href="javascript:onClickBackBtn();">$i18n.getString( 'program_tracking' )</a>
• <a href="javascript:showPatientDashboardForm( $programStageInstance.programInstance.patient.id );">$i18n.getString( 'patient_dashboard' )</a>
@@ -7,210 +6,161 @@
<input type='hidden' id='currentUsername' name='currentUsername' value='$currentUsername'>
<input type='hidden' id='programInstanceId' name='programInstanceId' value='$programStageInstance.programInstance.id'>
-#set($status = $programStageInstance.getEventStatus())
-<table>
- <tr>
- <td class="bold">$i18n.getString( "full_name" ):</td>
- <td>$programStageInstance.programInstance.patient.getFullName()<td>
- </tr>
- <tr>
- <td class="bold">$i18n.getString( "gender" ):</td>
- <td>$programStageInstance.programInstance.patient.gender<td>
- </tr>
- <tr>
- <td class="bold">$i18n.getString( "date_of_birth" ):</td>
- <td>$format.formatDate( $programStageInstance.programInstance.patient.birthDate )<td>
- </tr>
- <tr>
- <td class="bold">$i18n.getString( "age" ):</td>
- <td>$programStageInstance.programInstance.patient.getAge()<td>
- </tr>
- <tr>
- <td class="bold">$i18n.getString("phone_number")</td>
- <td>
- #if($!programStageInstance.programInstance.patient.phoneNumber && $!programStageInstance.programInstance.patient.phoneNumber!='')
- $!programStageInstance.programInstance.patient.phoneNumber
- #else
- [$i18n.getString('none')]
- #end
- </td>
- </tr>
- <tr>
- <td class="bold">$i18n.getString("health_worker")</td>
- <td>
- #if($!programStageInstance.programInstance.patient.healthWorker )
- $!programStageInstance.programInstance.patient.healthWorker.name
- #else
- [$i18n.getString('none')]
- #end
- </td>
- </tr>
-</table>
-
-<table>
- <tr>
- <td>
- <div class="event-tracking-area">
- <table width='100%'>
- <tr>
- <th>$i18n.getString("reschedule_and_set_status")</th>
- </tr>
- </table>
-
- <div class="content-event-tracking-area">
- <table width='100%' id='progarmStageListDiv' name='progarmStageListDiv' >
- <tr>
- <td>$i18n.getString( "reschedule_due_date" )</td>
- #set( $duedateId = "value_" + $programStageInstance.id + "_date" )
- <td>
- <input type="text" id="$duedateId" value="$!format.formatDate( $programStageInstance.dueDate )" onchange="saveDueDate( $programInstance.id, $programStageInstance.id, '$encoder.jsEncode( $programStageInstance.programStage.name )' )" />
- <input type="hidden" name="enrollmentDate" id="enrollmentDate" value="$!format.formatDate( $programInstance.enrollmentDate )">
- <input type="hidden" name="dateOfIncident" id="dateOfIncident" value="$!format.formatDate( $programInstance.dateOfIncident )">
- <script type="text/javascript">
- #if($status==1 || $status==5 )
- disable('$duedateId');
- #else
- datePicker( '$duedateId' );
- #end
- </script>
- </td>
- </tr>
- <tr>
- <td>$i18n.getString( "status" )</td>
- <td>
- <select id="stat_$programStageInstance.id" name="status_$programStageInstance.id" onchange="setEventStatus(this, $programStageInstance.id)">
- #if($status==4)
- <option value='4'>$i18n.getString("overdue")</option>
- <option value='5'>$i18n.getString("skipped")</option>
- #elseif($status==3)
- <option value='3'>$i18n.getString("scheduled_in_future")</option>
- <option value='5'>$i18n.getString("skipped")</option>
- #elseif($status==5)
- <option value='4'>$i18n.getString("overdue")</option>
- <option value='3'>$i18n.getString("scheduled_in_future")</option>
- <option value='5'>$i18n.getString("skipped")</option>
- #else
- <option value='1'>$i18n.getString("completed")</option>
- <option value='2'>$i18n.getString("incompleted")</option>
- #end
- </select>
- <script>
- setFieldValue("stat_$programStageInstance.id", $status);
- </script>
- </td>
- </tr>
- <tr>
- <td>$i18n.getString( "post_comment" )</td>
- <td>
- <input type='text' id='commentText' name='commentText' onkeypress="keypress(event,this,'$programStageInstance.id');">
- <input type='button' value="+" class='tiny-button' title='$i18n.getString("post_comment")' onclick="addComment( byId('commentText'),'$programStageInstance.id');">
- </td>
- </tr>
- <tr>
- <td>$i18n.getString( "message" )</td>
- <td>
- <textarea id="smsMessage" name="smsMessage" style="width:260px;height:100px;" class="{validate:{required:true,maxlength:160}}"></textarea>
- <input type="button" value="»" class='tiny-button' onclick="sendSmsOnePatient( byId('smsMessage'),'$programStageInstance.id' );"/>
- </td>
- </tr>
- <tr>
- <td></td>
- <td id="smsError" style="color:red;"></td>
- </tr>
- #if( $auth.hasAccess( "dhis-web-caseentry", "removeCurrentEncounter" ) )
- <tr>
- <td></td>
- <td>
- <input type="button" value="$i18n.getString('remove_this_event')" onclick="javascript:removeEvent($programStageInstance.id, true)" title='$i18n.getString( "remove_this_event" )' #if( $status==1 ) class='hidden' #end></a>
- </td>
- </tr>
- #end
- </table>
- </div>
- </div>
- </td>
-
- <td>
- <div class="event-tracking-area" style="width:600px;">
- <table width='100%'>
- <col width="100px"/>
- <col width="150px"/>
- <col width="80px"/>
- <col/>
- <tr>
- <th>$i18n.getString( "date" )</th>
- <th>$i18n.getString( "program_stage" )</th>
- <th>$i18n.getString( "sender" )</th>
- <th>$i18n.getString( "message" )</th>
- </tr>
- </table>
-
- <div class="content-event-tracking-area" style="width:600px;">
- <table width='100%' id='progarmStageListDiv' name='progarmStageListDiv' >
- <col width="100px"/>
- <col width="150px"/>
- <col width="80px"/>
- <col/>
- <tbody id='commentTB'>
- #set($index = 0)
- #foreach( $comment in $comments )
- #if( $index < 5 )
- <tr id="comment_$comment.id">
- <td>$format.formatDateTime($comment.createdDate)</td>
- <td>$programStageInstance.programStage.name</td>
- <td>$comment.creator</td>
- <td>$comment.commentText</td>
- #set($index = $index + 1)
- </tr>
- #end
- #end
- #foreach( $sms in $outboundSms )
- #if( $index < 5 )
- <tr id="tr${sms.id}" >
- <td>$format.formatDateTime($!sms.date)</td>
- <td>$programStageInstance.programStage.name</td>
- <td>$sms.sender</td>
- <td>$sms.message</td>
- </tr>
- #end
- #end
- #foreach( $comment in $comments )
- #if( $index >= 5 )
- <tr id="comment_$comment.id" class='hidden'>
- <td>$format.formatDateTime($comment.createdDate)</td>
- <td>$programStageInstance.programStage.name</td>
- <td>$comment.creator</td>
- <td>$comment.commentText</td>
- </tr>
- #end
- #end
-
- #foreach( $sms in $outboundSms )
- #if( $index >= 5 )
- <tr id="tr${sms.id}" class='hidden' >
- <td>$format.formatDateTime($sms.date)</td>
- <td>$programStageInstance.programStage.name</td>
- <td>$sms.sender</td>
- <td>$sms.message</td>
- </tr>
- #end
- #end
- </tbody>
- </table>
- <br>
- #set($count = $comments.size() + $outboundSms.size() )
- <input type='button' id="showCommentBtn" name="showCommentBtn" value='$i18n.getString("show_hide_more")' #if($count && $count<=5) class='hidden' #end onclick='commentDivToggle(false);'>
- <input type='button' id="hideCommentBtn" name="hideCommentBtn" value='$i18n.getString("show_hide_more")' class='hidden' onclick='commentDivToggle(true);'>
- </div>
- </div>
- </td>
- </tr>
-</table>
+
+<div class='dashboard-area'>
+ <div class="link-area" style="height:200px">
+ <p class='header'>$i18n.getString("demographics")</p>
+ <div class="contentProviderTable" style="height:200px">
+ #set($status = $programStageInstance.getEventStatus())
+ <table>
+ <tr>
+ <td class="bold">$i18n.getString( "full_name" ):</td>
+ <td>$programStageInstance.programInstance.patient.getFullName() ( $programStageInstance.programInstance.patient.gender )</td>
+ </tr>
+ <tr>
+ <td class="bold">$i18n.getString( "date_of_birth" ):</td>
+ <td>$format.formatDate( $programStageInstance.programInstance.patient.birthDate ) ( $programStageInstance.programInstance.patient.getAge() )</td>
+ </tr>
+ <tr>
+ <td class="bold">$i18n.getString("phone_number")</td>
+ <td>
+ #if($!programStageInstance.programInstance.patient.phoneNumber && $!programStageInstance.programInstance.patient.phoneNumber!='')
+ $!programStageInstance.programInstance.patient.phoneNumber
+ #else
+ [$i18n.getString('none')]
+ #end
+ </td>
+ </tr>
+ <tr>
+ <td class="bold">$i18n.getString("health_worker")</td>
+ <td>
+ #if($!programStageInstance.programInstance.patient.healthWorker )
+ $!programStageInstance.programInstance.patient.healthWorker.name
+ #else
+ [$i18n.getString('none')]
+ #end
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <div class="link-area-tracking">
+ <p class='header'>
+ $i18n.getString("reschedule_and_set_status")
+ #if( $auth.hasAccess( "dhis-web-caseentry", "removeCurrentEncounter" ) || ( $status==1 ) )
+ • <a href="javascript:removeEvent($programStageInstance.id, true)" title='$i18n.getString( "remove_this_event" )'> $i18n.getString('remove_this_event') </a>
+ #end
+ </p>
+ <div class="contentProviderTable" style="height:200px">
+ <table id='progarmStageListDiv' name='progarmStageListDiv' >
+ <tr>
+ <td>$i18n.getString( "due_date" )</td>
+ #set( $duedateId = "value_" + $programStageInstance.id + "_date" )
+ <td>
+ <input type="text" id="$duedateId" value="$!format.formatDate( $programStageInstance.dueDate )" onchange="saveDueDate( $programInstance.id, $programStageInstance.id, '$encoder.jsEncode( $programStageInstance.programStage.name )' )" />
+ <input type="hidden" name="enrollmentDate" id="enrollmentDate" value="$!format.formatDate( $programInstance.enrollmentDate )">
+ <input type="hidden" name="dateOfIncident" id="dateOfIncident" value="$!format.formatDate( $programInstance.dateOfIncident )">
+ <script type="text/javascript">
+ #if($status==1 || $status==2 || $status==5 )
+ disable('$duedateId');
+ #else
+ datePicker( '$duedateId' );
+ #end
+ </script>
+ </td>
+ </tr>
+ <tr>
+ <td>$i18n.getString( "status" )</td>
+ <td>
+ <select id="stat_$programStageInstance.id" name="status_$programStageInstance.id" onchange="setEventStatus(this, $programStageInstance.id)">
+ #if($status==4)
+ <option value='4'>$i18n.getString("overdue")</option>
+ <option value='5'>$i18n.getString("skipped")</option>
+ #elseif($status==3)
+ <option value='3'>$i18n.getString("scheduled_in_future")</option>
+ <option value='5'>$i18n.getString("skipped")</option>
+ #elseif($status==5)
+ <option value='4'>$i18n.getString("overdue")</option>
+ <option value='3'>$i18n.getString("scheduled_in_future")</option>
+ <option value='5'>$i18n.getString("skipped")</option>
+ #else
+ <option value='1'>$i18n.getString("completed")</option>
+ <option value='2'>$i18n.getString("incompleted")</option>
+ #end
+ </select>
+ <script>
+ setFieldValue("stat_$programStageInstance.id", $status);
+ </script>
+ </td>
+ </tr>
+ <tr>
+ <td>$i18n.getString( "post_comment" )</td>
+ <td>
+ <input type='text' id='commentText' name='commentText' onkeypress="keypressOnComent(event,this,'$programStageInstance.id');">
+ <input type='button' value="+" class='tiny-button' title='$i18n.getString("post_comment")' onclick="addComment( byId('commentText'),'$programStageInstance.id');">
+ </td>
+ </tr>
+ <tr>
+ <td>$i18n.getString( "message" )</td>
+ <td>
+ <input type="text" id="smsMessage" name="smsMessage" class="{validate:{required:true,maxlength:160}}" onkeypress="keypressOnMessage(event, this,'$programStageInstance.id');"></input>
+ <input type="button" value="»" class='tiny-button' onclick="sendSmsOnePatient( byId('smsMessage'),'$programStageInstance.id' );"/>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td id="smsError" style="color:red;"></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+
+<table class="mainPageTable">
+ <colgroup>
+ <col width="160px"/>
+ <col width="160px"/>
+ <col width="100px"/>
+ <col/>
+ </colgroup>
+ <tr>
+ <th>$i18n.getString( "date" )</th>
+ <th>$i18n.getString( "program_stage" )</th>
+ <th>$i18n.getString( "sender" )</th>
+ <th>$i18n.getString( "message" )</th>
+ </tr>
+ <tbody id='commentTB'>
+ #foreach( $comment in $comments )
+ <tr id="comment_$comment.id">
+ <td>$format.formatDateTime($comment.createdDate)</td>
+ <td>$programStageInstance.programStage.name</td>
+ <td>$comment.creator</td>
+ <td>$comment.commentText</td>
+ </tr>
+ #end
+
+ #foreach( $sms in $outboundSms )
+ <tr id="tr${sms.id}" >
+ <td>$format.formatDateTime($!sms.date)</td>
+ <td>$programStageInstance.programStage.name</td>
+ <td>$sms.sender</td>
+ <td>$sms.message</td>
+ </tr>
+ #end
+ </tbody>
+</table>
+<p>
+ #set($count = $comments.size() + $outboundSms.size() )
+ <input type='button' id="showCommentBtn" name="showCommentBtn" value='$i18n.getString("show_hide_more")' #if($count && $count<=5) class='hidden' #end onclick='commentDivToggle(false);'>
+ <input type='button' id="hideCommentBtn" name="hideCommentBtn" value='$i18n.getString("show_hide_more")' class='hidden' onclick='commentDivToggle(true);'>
+</p>
<script type="text/javascript">
jQuery(document).ready( function(){
setFieldValue('programStageName', "$programStageInstance.programStage.name");
setFieldValue( "programStageInstanceId", "$!programStageInstance.id" );
+ commentDivToggle(true);
});
var i18n_color_quick_help = '$encoder.jsEscape( $i18n.getString( "color_quick_help" ) , "'")';
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2012-10-18 08:12:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2012-10-22 06:00:03 +0000
@@ -457,23 +457,19 @@
padding-bottom:1px;
}
-div.event-tracking-area
+/*----------------------------------------------------------------------------*/
+/* Program tracking
+/*----------------------------------------------------------------------------*/
+
+div.link-area-tracking
{
+ display:inline-block;
border:1px solid #d0d0d0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
padding-bottom:0px;
- height: 270px;
- width: 450px;
+ height:200px;
+ width:60%;
overflow:hidden;
- position:relative;
-}
-
-.content-event-tracking-area
-{
- height: 270px;
- width: 450px;
- overflow-y: auto;
- overflow-x:hidden;
}