dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20639
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9547: Minor fix.
------------------------------------------------------------
revno: 9547
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-01-17 22:58:12 +0700
message:
Minor fix.
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseSelDataElementList.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.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-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js 2013-01-17 15:14:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js 2013-01-17 15:58:12 +0000
@@ -7,15 +7,15 @@
dataElementSelector = jQuery("#dataElementSelection").dialog({
title: i18n_dataelement,
height: 400,
- width: jQuery("#dataElementIds").outerWidth() + 30,
+ width: jQuery("#dataElementSelection [id=dataElementIds]").outerWidth() + 30,
autoOpen: false,
zIndex:99999
});
otherProgramStageDataElements = jQuery("#otherProgramStageDataElements").dialog({
title: i18n_dataelement_of_orther_program_stage,
- height: 350,
- width:350,
+ height: 460,
+ width:jQuery("#otherProgramStageDataElements [id=dataElementIds]").outerWidth() + 50,
autoOpen: false,
zIndex:99999
});
@@ -81,8 +81,8 @@
associationId: id
}, function( xml ){
jQuery( xml ).find( 'dataElement' ).each( function(i, item ){
- dataElements.append("<option value='" + jQuery( item ).find( "json" ).text() + "'>" + jQuery( item ).find( "name" ).text() + "</option>");
- dataElementIdsStore.append("<option value='" + jQuery( item ).find( "json" ).text() + "'>" + jQuery( item ).find( "name" ).text() + "</option>");
+ dataElements.append("<option value='" + jQuery( item ).find( "json" ).text() + "' dename='" + jQuery( item ).find( "name" ).text() + "' decode='" + jQuery( item ).find( "code" ).text() + "'>" + jQuery( item ).find( "name" ).text() + "</option>");
+ dataElementIdsStore.append("<option value='" + jQuery( item ).find( "json" ).text() + "' dename='" + jQuery( item ).find( "name" ).text() + "' decode='" + jQuery( item ).find( "code" ).text() + "'>" + jQuery( item ).find( "name" ).text() + "</option>");
});
});
}
@@ -179,49 +179,49 @@
}
-function displayNameOnChange( displayName )
+function displayNameOnChange( div, displayName )
{
// display - name
if(displayName=='1'){
- jQuery('#dataElementIds option').each(function(){
+ jQuery('#' + div + ' [id=dataElementIds] option').each(function(){
var item = jQuery(this);
item[0].text = item.attr('dename');
});
- jQuery('#dataElementIdsStore option').each(function(){
+ jQuery('#' + div + ' [id=dataElementIdsStore] option').each(function(){
var item = jQuery(this);
item[0].text = item.attr('dename');
});
}
// display - code
else if(displayName=='2'){
- jQuery('#dataElementIds option').each(function(){
+ jQuery('#' + div + ' [id=dataElementIds] option').each(function(){
var item = jQuery(this);
item[0].text = item.attr('decode');
});
- jQuery('#dataElementIdsStore option').each(function(){
+ jQuery('#' + div + ' [id=dataElementIdsStore] option').each(function(){
var item = jQuery(this);
item[0].text = item.attr('decode');
});
}
// display - code and name
else{
- jQuery('#dataElementIds option').each(function(){
+ jQuery('#' + div + ' [id=dataElementIds] option').each(function(){
var item = jQuery(this);
item[0].text = "(" + item.attr('decode') + ") " + item.attr('dename');
});
- jQuery('#dataElementIdsStore option').each(function(){
+ jQuery('#' + div + ' [id=dataElementIdsStore] option').each(function(){
var item = jQuery(this);
item[0].text = "(" + item.attr('decode') + ") " + item.attr('dename');
});
}
- jQuery("#dataElementIds").width(jQuery("#dataElementSelection").width() - 10 );
+ jQuery('#' + div + ' [id=dataElementIds]').width(jQuery("#" + div).width() - 10 );
}
-function sortByOnChange(sortBy)
+function sortByOnChange( div, sortBy)
{
if( sortBy == 1)
{
- $('#dataElementIds').each(function() {
+ jQuery('#' + div + ' [id=dataElementIds]').each(function() {
// Keep track of the selected option.
var selectedValue = $(this).val();
@@ -238,7 +238,7 @@
}
else
{
- $('#dataElementIds').each(function() {
+ jQuery('#' + div + ' [id=dataElementIds]').each(function() {
// Keep track of the selected option.
var selectedValue = $(this).val();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseSelDataElementList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseSelDataElementList.vm 2012-10-30 04:15:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseSelDataElementList.vm 2013-01-17 15:58:12 +0000
@@ -5,6 +5,7 @@
<dataElement>
<id>$dataElement.id</id>
<name>$encoder.xmlEncode( $dataElement.name )</name>
+ <code>$encoder.xmlEncode( $dataElement.code )</code>
<shortName>$encoder.xmlEncode( $dataElement.shortName )</shortName>
<type>$dataElement.type</type>
#set($deJSON = '{' + '"id"' + ":" + $dataElement.id + "," + '"name"' + ':"' + "$dataElement.name" + '",' + '"shortName"' + ':"' + "$dataElement.shortName" + '",' + '"type"' + ':"' + "$dataElement.getDetailedTextType()" + '"}' );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm 2013-01-17 12:54:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm 2013-01-17 15:58:12 +0000
@@ -126,7 +126,7 @@
<tr>
<td class="bold">$i18n.getString("display_name")</td>
<td>
- <select id='displayNameOption' onchange='displayNameOnChange( this.value )'>
+ <select id='displayNameOption' onchange='displayNameOnChange( "dataElementSelection",this.value )'>
<option selected value='1'>$i18n.getString("name")</option>
<option value='2'>$i18n.getString("code")</option>
<option value='3'>$i18n.getString("code_and_name")</option>
@@ -136,7 +136,7 @@
<tr>
<td class="bold">$i18n.getString("sort_by")</td>
<td>
- <select id='sortBy' onchange="sortByOnChange(this.value)">
+ <select id='sortBy' onchange="sortByOnChange('dataElementSelection', this.value)">
<option value='1' selected>$i18n.getString("name")</option>
<option value='2' >$i18n.getString("code")</option>
</select>
@@ -154,7 +154,7 @@
</tr>
<tr>
<td colspan='2'>
- <select id="dataElementIds" name="dataElementIds" style="width:100%; height:210px;" multiple="multiple" size="10" ondblclick="insertDataElement( '#dataElementSelection', '$programStage.id')">
+ <select id="dataElementIds" name="dataElementIds" style="min-width:400; width:100%; height:210px;" multiple="multiple" size="10" ondblclick="insertDataElement( '#dataElementSelection', '$programStage.id')">
#foreach( $de in $dataElements)
#set($deJSON = '{' + '"id"' + ":" + $de.id + "," + '"name"' + ':"' + "$de.name" + '",' + '"shortName"' + ':"' + "$de.shortName" + '",' + '"type"' + ':"' + "$de.getDetailedTextType()" + '"}' );
<option value='$deJSON' decode="$!de.code" dename="$de.name">$encoder.htmlEncode( $de.name )</option>
@@ -185,7 +185,9 @@
<table>
<tr>
<td>
- <span class="bold">$i18n.getString( "program_stage" )</span><br>
+ <span class="bold">$i18n.getString( "program_stage" )</span>
+ </td>
+ <td>
<select id="programStageIds" style="min-width:300px" onchange="getProgramStageDataElements( this.value )" >
<option value=''>$i18n.getString( "select" )</option>
#foreach( $p in $programStages)
@@ -195,18 +197,37 @@
</td>
</tr>
<tr>
- <td>
+ <td class="bold">$i18n.getString("display_name")</td>
+ <td>
+ <select onchange='displayNameOnChange( "otherProgramStageDataElements",this.value )'>
+ <option selected value='1'>$i18n.getString("name")</option>
+ <option value='2'>$i18n.getString("code")</option>
+ <option value='3'>$i18n.getString("code_and_name")</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="bold">$i18n.getString("sort_by")</td>
+ <td>
+ <select onchange="sortByOnChange('otherProgramStageDataElements', this.value)">
+ <option value='1' selected>$i18n.getString("name")</option>
+ <option value='2' >$i18n.getString("code")</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2'>
<span class="bold">$i18n.getString( "dataelement" )</span>
</td>
</tr>
<tr>
- <td>
- <input type="text" style="min-width:290px" onkeyup="filterDataElements( this.value, '#otherProgramStageDataElements', '#dataElementIds')"/>
+ <td colspan='2'>
+ <input type="text" style="width:100%" onkeyup="filterDataElements( this.value, '#otherProgramStageDataElements', '#dataElementIds')"/>
</td>
</tr>
<tr>
- <td>
- <select id="dataElementIds" name="dataElementIds" style="min-width:300px" multiple="multiple" size="10" ondblclick="insertDataElement( '#otherProgramStageDataElements', byId('programStageIds').value )"/>
+ <td colspan='2'>
+ <select id="dataElementIds" name="dataElementIds" style="min-width:400; width:100%; height:210px;" multiple="multiple" size="10" ondblclick="insertDataElement( '#otherProgramStageDataElements', byId('programStageIds').value )"/>
<select id="dataElementIdsStore" style="min-width:300px;display:none" multiple="multiple" size="10"/>
</td>
</tr>