dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22539
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10854: Fix bug - Don't load data elements which belong to other program-stages; small changes ui.
------------------------------------------------------------
revno: 10854
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-05-16 13:09:31 +0700
message:
Fix bug - Don't load data elements which belong to other program-stages; small changes ui.
modified:
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/webapp/dhis-web-maintenance-patient/addProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js
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/programList.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramIndicator.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/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 2013-05-15 09:14:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2013-05-16 06:09:31 +0000
@@ -132,7 +132,7 @@
specify_dataelememt=Please specify a data element
processing=Processing
done=Done
-dataelement_of_orther_program_stage=Data element of other program stage
+other_program_stage_data_element=Other program stage data element
load_existed_form=Load existing form
design_dataentry_form=Design data entry form
dataelement_is_inserted=This data element is inserted in form
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2013-05-15 02:13:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2013-05-16 06:09:31 +0000
@@ -153,6 +153,12 @@
<td></td>
</tr>
+ <tr>
+ <td><label>$i18n.getString( "display_on_all_orgunits" )</label></td>
+ <td><input type="checkbox" id="displayOnAllOrgunit" name="displayOnAllOrgunit" value='true' checked></td>
+ <td></td>
+ </tr>
+
<tr name='nonAnonymous'>
<td><label>$i18n.getString( "show_incident_date" )</label></td>
<td><input type="checkbox" id="displayIncidentDate" name="displayIncidentDate" value='true' checked onchange='programOnChange();'></td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-04-18 06:45:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-05-16 06:09:31 +0000
@@ -35,6 +35,9 @@
var onlyEnrollOnce = ( json.program.onlyEnrollOnce == 'true') ? i18n_yes : i18n_no;
setInnerHTML( 'onlyEnrollOnceField', onlyEnrollOnce );
+ var displayOnAllOrgunit= ( json.program.displayOnAllOrgunit == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML( 'displayOnAllOrgunitField', displayOnAllOrgunit );
+
var remindCompleted = ( json.program.remindCompleted == 'true') ? i18n_yes : i18n_no;
setInnerHTML( 'remindCompletedField', remindCompleted );
=== 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-04-28 08:54:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js 2013-05-16 06:09:31 +0000
@@ -138,7 +138,6 @@
return result;
}
-
function checkExisted( id )
{
var result = false;
@@ -315,7 +314,7 @@
jQuery.postJSON("setAutoSaveDataEntrySetting.action", {autoSave:_autoSave}, function(json) {
autoSave = _autoSave;
if (_autoSave) {
- window.setTimeout( "validateDataEntryFormTimeout( false );", 600 );
+ window.setTimeout( "validateDataEntryFormTimeout( false );", 60000 );
}
else{
window.clearTimeout(timeOut);
@@ -331,6 +330,12 @@
function validateDataEntryForm()
{
+ if( getFieldValue('name').length==0 )
+ {
+ setHeaderDelayMessage( i18n_name_exists );
+ return;
+ }
+
$.post( 'validateDataEntryForm.action',
{
name: getFieldValue('name'),
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm 2013-05-15 02:13:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm 2013-05-16 06:09:31 +0000
@@ -91,6 +91,7 @@
<p><label class="bold">$i18n.getString( "display_date_of_incident" ):</label><br><span id="displayIncidentDateField"></span></p> <p><label class="bold">$i18n.getString( "generated_events_by_enrollment_date" ):</label><br><span id="generatedByEnrollmentDateField"></span></p>
<p><label class="bold">$i18n.getString( "skip_to_generate_overdue_events" ):</label><br><span id="ignoreOverdueEventsField"></span></p>
<p><label class="bold">$i18n.getString( "only_enroll_once" ):</label><br><span id="onlyEnrollOnceField"></span></p>
+ <p><label class="bold">$i18n.getString( "display_on_all_orgunits" ):</label><br><span id="displayOnAllOrgunitField"></span></p>
<p><label class="bold">$i18n.getString( "block_entry_form_after_completed" ):</label><br><span id="blockEntryFormField"></span></p>
<p><label class="bold">$i18n.getString( "remind_completing_program_after_program_stage_completed" ):</label><br><span id="remindCompletedField"></span></p>
<p><label class="bold">$i18n.getString( "disable_registration_fields" ):</label><br><span id="disableRegistrationFieldsField"></span></p>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-05-15 02:13:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-05-16 06:09:31 +0000
@@ -157,6 +157,12 @@
<td></td>
</tr>
+ <tr>
+ <td><label>$i18n.getString( "display_on_all_orgunits" )</label></td>
+ <td><input type="checkbox" id="displayOnAllOrgunit" name="displayOnAllOrgunit" value='true' #if($program.displayOnAllOrgunit) checked #end></td>
+ <td></td>
+ </tr>
+
<tr name='nonAnonymous'>
<td><label>$i18n.getString( "show_incident_date" )</label></td>
<td><input type="checkbox" id="displayIncidentDate" name="displayIncidentDate" value='true' onchange='programOnChange();' #if( $program.type=='3' ) disabled #elseif($program.displayIncidentDate=='true') checked #end></td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramIndicator.vm 2013-04-17 09:20:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramIndicator.vm 2013-05-16 06:09:31 +0000
@@ -47,8 +47,8 @@
<td><label>$i18n.getString( "value_type" )</label></td>
<td>
<select style="width: 336px;" id="valueType" name="valueType" onchange='programIndicatorOnChange();' class="{validate:{required:true}}">
- <option value='int' #if( '$programIndicator.valueType'=='int' ) selected #end>$i18n.getString('int')</option>
- <option value='date' #if( '$programIndicator.valueType'=='date' ) selected #end>$i18n.getString('date')</option>
+ <option value='int' #if( $programIndicator.valueType=='int' ) selected #end>$i18n.getString('int')</option>
+ <option value='date' #if( $programIndicator.valueType=='date' ) fasdfasdf selected #end>$i18n.getString('date')</option>
</select>
</td>
<td></td>
=== 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-04-05 07:46:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm 2013-05-16 06:09:31 +0000
@@ -111,10 +111,10 @@
<button type="button" id='loadExistForms' onclick="openloadExistedForm()">$i18n.getString( 'load_existed_form' )</button>
#end
#if(!$dataElements.isEmpty())
- <button type="button" id='insertDataElements' onclick="openDataElementSelector()"/>$i18n.getString( 'insert_data_elements' )</button>
+ <button type="button" id='insertDataElements' onclick="openDataElementSelector()">$i18n.getString( 'insert_data_elements' )</button>
#end
#if(!$programStages.isEmpty())
- <button type="button" id='insertOtherDataElements' value="$i18n.getString( 'dataelement_of_orther_program_stage' )" onclick="openOtherProgramStageDataElements()"></button>
+ <button type="button" id='insertOtherDataElements' onclick="openOtherProgramStageDataElements()">$i18n.getString( 'other_program_stage_data_element')</button>
#end
<button type="button" id="insertImagesButton">$i18n.getString( 'insert_images' )</button>
@@ -133,30 +133,9 @@
<div id="dataElementSelection">
<table>
<tr>
- <td class="bold">$i18n.getString("display_name")</td>
- <td>
- <select id='displayNameOption' onchange='displayNameOnChange( "dataElementSelection",this.value )'>
- <option 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>
- <input type='radio' name='sortBy' value='1' onchange="sortByOnChange('dataElementSelection', '1')" checked >$i18n.getString("name")
- <input type='radio' name='sortBy' value='2' onchange="sortByOnChange('dataElementSelection', '2')">$i18n.getString("code")
- </td>
- </tr>
- <tr>
- <td>
- <span class="bold">$i18n.getString( "dataelement" )</span><br>
- </td>
- </tr>
- <tr>
- <td colspan='2'>
- <input type="text" id='dataElementFilter' style="width:350px" onkeyup="filterDataElements( this.value, '#dataElementSelection', '#dataElementIds')"/>
+ <td>$i18n.getString( "dataelement" )</td>
+ <td>
+ <input type="text" id='dataElementFilter' style="width:260px;" onkeyup="filterDataElements( this.value, '#dataElementSelection', '#dataElementIds')"/>
<input type='button' value="$i18n.getString('clear')" style="width:80px;" onclick="setFieldValue('dataElementFilter','');">
</td>
</tr>
@@ -177,6 +156,29 @@
</td>
</tr>
<tr>
+ <td colspan='2' style="background-color:#DFEFEC;">
+ <table>
+ <tr>
+ <td>$i18n.getString("display_name")</td>
+ <td>
+ <select id='displayNameOption' onchange='displayNameOnChange( "dataElementSelection",this.value )'>
+ <option 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>$i18n.getString("sort_by")</td>
+ <td>
+ <input type='radio' name='sortBy' value='1' onchange="sortByOnChange('dataElementSelection', '1')" checked >$i18n.getString("name")
+ <input type='radio' name='sortBy' value='2' onchange="sortByOnChange('dataElementSelection', '2')">$i18n.getString("code")
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
<td>
<input type="button" id="insertButton" value="$i18n.getString('insert')" onclick="insertDataElement( '#dataElementSelection', '$programStage.uid')" style="width:100px">
</td>
@@ -190,12 +192,10 @@
<div id="otherProgramStageDataElements">
<table>
<tr>
- <td>
- <span class="bold">$i18n.getString( "program_stage" )</span>
- </td>
+ <td>$i18n.getString( "program_stage" )</td>
<td>
<select id="programStageIds" style="min-width:300px" onchange="getProgramStageDataElements( this.value )" >
- <option value=''>$i18n.getString( "select" )</option>
+ <option value=''>[$i18n.getString( "please_select" )]</option>
#foreach( $p in $programStages)
<option value='$p.id'>$encoder.htmlEncode( $p.name )</option>
#end
@@ -203,32 +203,10 @@
</td>
</tr>
<tr>
- <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 colspan='2'>
- <input type="text" style="width:100%" onkeyup="filterDataElements( this.value, '#otherProgramStageDataElements', '#dataElementIds')"/>
+ <td>$i18n.getString( "dataelement" )</td>
+ <td>
+ <input type="text" id='otherDataElementFilter' style="width:260px;" onkeyup="filterDataElements( this.value, '#otherProgramStageDataElements', '#dataElementIds')"/>
+ <input type='button' value="$i18n.getString('clear')" style="width:80px;" onclick="setFieldValue('otherDataElementFilter','');">
</td>
</tr>
<tr>
@@ -238,6 +216,29 @@
</td>
</tr>
<tr>
+ <td colspan='2'>
+ <table style="background-color:#DFEFEC;">
+ <tr>
+ <td>$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>$i18n.getString("sort_by")</td>
+ <td>
+ <input type='radio' name='sortBy' value='1' onchange="sortByOnChange('otherProgramStageDataElements', '1')" checked >$i18n.getString("name")
+ <input type='radio' name='sortBy' value='2' onchange="sortByOnChange('otherProgramStageDataElements', '2')">$i18n.getString("code")
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
<td>
<input type="button" value="Insert" id="insert" name="insert" onclick="insertDataElement( '#otherProgramStageDataElements', byId('programStageIds').value )"/>
</td>
@@ -274,4 +275,5 @@
<script>
var i18n_delete_program_data_entry_confirm = '$encoder.jsEscape( $i18n.getString( "delete_program_data_entry_confirm" ) , "'" )';
+ var i18n_name_exists = '$encoder.jsEscape( $i18n.getString( "name_exists" ) , "'" )';
</script>