dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09037
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2309: Fix bug: Cannot enter the date of the patient into multi-dataentry form.
------------------------------------------------------------
revno: 2309
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2010-12-08 14:17:37 +0700
message:
Fix bug: Cannot enter the date of the patient into multi-dataentry form.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryMenu.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatient.vm
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/ui/jquery-ui.min.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
--
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/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2010-10-30 05:54:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2010-12-08 07:17:37 +0000
@@ -227,7 +227,7 @@
for ( Patient patient : patientListByOrgUnit )
{
Collection<ProgramInstance> _programInstances = programInstanceService.getProgramInstances( patient,
- program, true );
+ program, false );
if ( _programInstances == null || _programInstances.size() == 0 )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm 2010-12-03 05:41:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm 2010-12-08 07:17:37 +0000
@@ -1,23 +1,3 @@
-<script>
-function setupDataEntryCalendar( id )
-{
- jQuery("#" + id).datepicker(
- {
- dateFormat:dateFormat,
- changeMonth: true,
- changeYear: true,
- monthNamesShort: monthNames,
- dayNamesMin: dayNamesMin,
- showOn: 'button',
- buttonImage: '../images/calendar.png',
- buttonImageOnly: true
- });
-
- jQuery( "<label>" + formatter + "</label>" ).insertAfter( jQuery("#" + id) );
-}
-
-var formatter = dateFormat.replace( 'yy', 'yyyy');
-</script>
#parse( "/dhis-web-caseentry/dataRecordingSelect.vm" )
<div id="dragDiv">
@@ -140,13 +120,15 @@
</div>
</div>
-
-<script type="text/javascript">
+<script type="text/javascript">
+
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_number = '$encoder.jsEscape( $i18n.getString( "value_must_positive_number" ) , "'")';
var i18n_value_must_negative_number = '$encoder.jsEscape( $i18n.getString( "value_must_negative_number" ) , "'")';
- var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")';
+ var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n "
+ + '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '"
+ + dateFormat.replace('yy', 'yyyy') + " '" ;
var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
var i18n_saving_value_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_error_code" ) , "'")';
var i18n_searching_patient_failed = '$encoder.jsEscape( $i18n.getString( "searching_patient_failed" ) , "'")';
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryMenu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryMenu.vm 2010-12-02 03:44:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryMenu.vm 2010-12-08 07:17:37 +0000
@@ -6,8 +6,4 @@
</ul>
<br>
-#parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
-
-<script type="text/javascript">
- var formatter = '$encoder.jsEscape( $i18n.getString( "format.date.label" ) , "'")';
-</script>
+#parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm 2010-11-21 15:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm 2010-12-08 07:17:37 +0000
@@ -59,11 +59,22 @@
#parse( "/dhis-web-commons/paging/paging.vm" )
</div>
-<div id="detailsArea" style="display:none;overflow:auto;height:250px;width:250px" ondblclick="javascript:hideDetails()">
- <div style="float:right;" onclick="javascript:hideDetails()">
- <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
- </div>
- <p><label>$i18n.getString( "identifier" ):</label><br><span id="identifierField"></span></p>
- <p><label>$i18n.getString( "attributes" ):</label><br><span id="attributeField"></span></p>
- <p><label>$i18n.getString( "enrolled_in_program" ):</label><br><span id="programField"></span></p>
+
+<div id="detailsArea" style="display:none;overflow:auto;height:250px;width:250px">
+ <div style="float:right">
+ <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
+ </div>
+ <p><label>$i18n.getString( "common_info" ):</label><br><span id="commonInfoField"></span></p>
+ <p><label>$i18n.getString( "identifier" ):</label><br><span id="identifierField"></span></p>
+ <p><label>$i18n.getString( "attributes" ):</label><br><span id="attributeField"></span></p>
+ <p><label>$i18n.getString( "enrolled_in_program" ):</label><br><span id="programField"></span></p>
</div>
+
+<script>
+ var i18n_id = '$encoder.jsEscape( $i18n.getString( "id" ), "'")';
+ var i18n_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ), "'")';
+ var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ), "'")';
+ var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
+ var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ), "'")';
+ var i18n_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ), "'")';
+</script>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js 2010-12-03 05:41:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js 2010-12-08 07:17:37 +0000
@@ -1,9 +1,24 @@
+function setupDataEntryCalendar( id )
+{
+ jQuery("#" + id).datepicker(
+ {
+ dateFormat:dateFormat,
+ changeMonth: true,
+ changeYear: true,
+ monthNamesShort: monthNames,
+ dayNamesMin: dayNamesMin,
+ showOn: 'button',
+ buttonImage: '../images/calendar.png',
+ buttonImageOnly: true
+ });
+
+}
function viewPrgramStageRecords( programStageInstanceId )
{
var url = 'viewProgramStageRecords.action?programStageInstanceId=' + programStageInstanceId;
$('#contentDataRecord').dialog('destroy').remove();
- $('<div id="contentDataRecord" style="z-index: 1;">' ).load(url).dialog({
+ $('<div id="contentDataRecord">' ).load(url).dialog({
title: 'ProgramStage',
maximize: true,
closable: true,
@@ -74,42 +89,71 @@
}
function patientReceived( patientElement )
-{
- var identifiers = patientElement.getElementsByTagName( "identifier" );
-
+{
+ // ----------------------------------------------------------------------------
+ // Get common-information
+ // ----------------------------------------------------------------------------
+
+ var id = patientElement.getElementsByTagName( "id" )[0].firstChild.nodeValue;
+ var fullName = patientElement.getElementsByTagName( "fullName" )[0].firstChild.nodeValue;
+ var gender = patientElement.getElementsByTagName( "gender" )[0].firstChild.nodeValue;
+ var dobType = patientElement.getElementsByTagName( "dobType" )[0].firstChild.nodeValue;
+ var birthDate = patientElement.getElementsByTagName( "dateOfBirth" )[0].firstChild.nodeValue;
+ var bloodGroup= patientElement.getElementsByTagName( "bloodGroup" )[0].firstChild.nodeValue;
+
+ var commonInfo = '<strong>' + i18n_id + ':</strong> ' + id + "<br>"
+ + '<strong>' + i18n_full_name + ':</strong> ' + fullName + "<br>"
+ + '<strong>' + i18n_gender + ':</strong> ' + gender+ "<br>"
+ + '<strong>' + i18n_dob_type + ':</strong> ' + dobType+ "<br>"
+ + '<strong>' + i18n_date_of_birth + ':</strong> ' + birthDate+ "<br>"
+ + '<strong>' + i18n_blood_group + ':</strong> ' + bloodGroup;
+
+ setInnerHTML( 'commonInfoField', commonInfo );
+
+ // ----------------------------------------------------------------------------
+ // Get identifier
+ // ----------------------------------------------------------------------------
+
+ var identifiers = patientElement.getElementsByTagName( "identifier" );
+
var identifierText = '';
- for ( var i = 0; i < identifiers.length; i++ )
- {
- identifierText = identifierText + identifiers[ i ].getElementsByTagName( "identifierText" )[0].firstChild.nodeValue + '<br>';
- }
-
- setInnerHTML( 'identifierField', identifierText );
-
- var attributes = patientElement.getElementsByTagName( "attribute" );
-
+ for ( var i = 0; i < identifiers.length; i++ )
+ {
+ identifierText = identifierText + identifiers[ i ].getElementsByTagName( "identifierText" )[0].firstChild.nodeValue + '<br>';
+ }
+
+ setInnerHTML( 'identifierField', identifierText );
+
+
+
+ // ----------------------------------------------------------------------------
+ // Get attribute
+ // ----------------------------------------------------------------------------
+
+ var attributes = patientElement.getElementsByTagName( "attribute" );
+
var attributeValues = '';
- for ( var i = 0; i < attributes.length; i++ )
- {
- attributeValues = attributeValues + '<strong>' + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue + ': </strong>' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue + '<br>';
- }
+ for ( var i = 0; i < attributes.length; i++ )
+ {
+ attributeValues = attributeValues + '<strong>' + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue + ': </strong>' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue + '<br>';
+ }
- setInnerHTML( 'attributeField', attributeValues );
-
- var programs = patientElement.getElementsByTagName( "program" );
-
+ setInnerHTML( 'attributeField', attributeValues );
+
+ var programs = patientElement.getElementsByTagName( "program" );
+
var programName = '';
- for ( var i = 0; i < programs.length; i++ )
- {
- programName = programName + programs[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue + '<br>';
- }
+ for ( var i = 0; i < programs.length; i++ )
+ {
+ programName = programName + programs[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue + '<br>';
+ }
- setInnerHTML( 'programField', programName );
-
+ setInnerHTML( 'programField', programName );
+
showDetails();
-
}
//------------------------------------------------------------------------------
@@ -784,11 +828,6 @@
}
}
-function isDateFormat( value )
-{
- return isDate(value, formatter);
-}
-
/**
* Display data element name in selection display when a value field recieves
* focus.
@@ -927,7 +966,7 @@
if( !isValidDate( field.value ) )
{
field.style.backgroundColor = '#ffcc00';
- window.alert('Incorrect format for date value. The correct format should be ' + formatter + '\n\n '+dataElementName );
+ window.alert('Incorrect format for date value. The correct format should be ' + dateFormat.replace('yy', 'yyyy') + '\n\n '+dataElementName );
field.select();
field.focus();
@@ -958,7 +997,7 @@
jQuery(this_).css({
"background-color":"#ffcc00"
});
- window.alert('Incorrect format for date value. The correct format should be ' + formatter +' \n\n '+data.dataElementName );
+ window.alert('Incorrect format for date value. The correct format should be ' + dateFormat.replace('yy', 'yyyy') +' \n\n '+data.dataElementName );
jQuery(this_).focus();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatient.vm 2009-10-25 11:20:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatient.vm 2010-12-08 07:17:37 +0000
@@ -1,5 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<patient>
+ <id>$patient.id</id>
+ <fullName>$encoder.xmlEncode( $patient.getFullName() )</fullName>
+ <gender>$encoder.xmlEncode( $patient.gender )</gender>
+ <dobType>#if($!patient.dobType) $encoder.xmlEncode( $!patient.dobType )#else $i18n.getString('none') #end</dobType>
+ <dateOfBirth>$format.formatDate( $!patient.birthDate )</dateOfBirth>
+ <age>$encoder.xmlEncode( $patient.getAge() )</age>
+ <bloodGroup>#if($!patient.bloodGroup) $patient.bloodGroup #else $i18n.getString('none') #end</bloodGroup>
#foreach( $patientIdentifier in $patient.identifiers )
<identifier>
<identifierText>$encoder.xmlEncode( $patientIdentifier.identifier )</identifierText>
@@ -7,7 +14,7 @@
#end
#foreach( $attribute in $patient.attributes )
#set( $attributeValue = false )
- #set( $attributeValue = $patientAttributeValueMap.get( $attribute.id ) )
+ #set( $attributeValue = $patientAttributeValueMap.get( $attribute.id ) )
<attribute>
<name>$encoder.xmlEncode( $attribute.name )</name>
<value>$encoder.xmlEncode( $attributeValue )</value>
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/ui/jquery-ui.min.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/ui/jquery-ui.min.js 2010-12-03 05:41:34 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/ui/jquery-ui.min.js 2010-12-08 07:17:37 +0000
@@ -496,7 +496,7 @@
var c=String.fromCharCode(a.charCode==G?a.keyCode:a.charCode);return a.ctrlKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||
a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);
d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&
-d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,
+d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex() + 9999 );d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,
h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");
this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");
this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2010-12-08 03:16:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2010-12-08 07:17:37 +0000
@@ -27,7 +27,8 @@
patient_data_elements = Beneficiary Data Elements
aggregation_mapping_management = Aggregation Mapping Management
aggregation_mapping = Aggregation Mapping
-invalid_date = Invalid Date
+invalid_date = Incorrect format for date value
+format_date = The correct format should be
duplicate_names = Name is already in use
removing_relationship_failed = Removing Relationship failed
back_to_search = Back to Search