dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22290
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10685: Fix bug: Don't save attributes/identifier type when to select then in Add/Update program form.
------------------------------------------------------------
revno: 10685
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-04-24 20:40:48 +0700
message:
Fix bug: Don't save attributes/identifier type when to select then in Add/Update program form.
removed:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java
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/updateProgramForm.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/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2013-04-11 03:23:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2013-04-24 13:40:48 +0000
@@ -214,7 +214,7 @@
{
minDaysFromStart = (minDaysFromStart == null) ? 0 : minDaysFromStart;
irregular = (irregular == null) ? false : irregular;
- autoGenerateEvent = (autoGenerateEvent == null) ? false : autoGenerateEvent;
+ autoGenerateEvent = (autoGenerateEvent == null) ? true : autoGenerateEvent;
validCompleteOnly = (validCompleteOnly == null) ? false : validCompleteOnly;
displayGenerateEventBox = (displayGenerateEventBox == null) ? false : displayGenerateEventBox;
=== 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-04-18 06:45:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2013-04-24 13:40:48 +0000
@@ -4,8 +4,11 @@
validation( 'addProgramForm', function( form ){
if( duplicate==true)
return false;
- else
+ else{
+ enable('dateOfEnrollmentDescription');
+ enable('dateOfIncidentDescription');
form.submit();
+ }
}, function(){
duplicate = false;
var COLOR_RED = '#ff8a8a';
@@ -39,14 +42,28 @@
jQuery(".dateToCompare").each( function( i, item ){
datesToCompare.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
});
+
+ var selectedPropertyIds = jQuery( "#selectedPropertyIds" );
+ selectedPropertyIds.empty();
+ var personDisplayNames = jQuery( "#personDisplayNames" );
+ personDisplayNames.empty();
+
+ if(getFieldValue('type')!=3){
+ jQuery("#selectedList").find("tr").each( function( i, item ){
+
+ selectedPropertyIds.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
+
+ var displayed = jQuery( item ).find( "input[name='displayed']:first");
+ var checked = displayed.attr('checked') ? true : false;
+ personDisplayNames.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ });
+ }
});
checkValueIsExist( "name", "validateProgram.action" );
});
</script>
-<script type="text/javascript" src="javascript/addProgramForm.js"></script>
-
<h3>$i18n.getString( "create_new_program" )</h3>
<form id="addProgramForm" name="addProgramForm" action="addProgram.action" method="post" >
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramForm.js 2013-02-20 08:38:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramForm.js 1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
-jQuery(document).ready( function(){
-
- validation( 'addProgramForm', function( form ){
- enable('dateOfEnrollmentDescription');
- enable('dateOfIncidentDescription');
- form.submit();
- }, function(){
- var selectedPropertyIds = jQuery( "#selectedPropertyIds" );
- selectedPropertyIds.empty();
- var personDisplayNames = jQuery( "#personDisplayNames" );
- personDisplayNames.empty();
-
- if(getFieldValue('type')!=3){
- jQuery("#selectedList").find("tr").each( function( i, item ){
-
- selectedPropertyIds.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
-
- var displayed = jQuery( item ).find( "input[name='displayed']:first");
- var checked = displayed.attr('checked') ? true : false;
- personDisplayNames.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
- });
- }
- });
-
-
- //checkValueIsExist( "name", "validateProgram.action");
-});
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js 2013-03-01 07:34:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
-jQuery(document).ready( function(){
-
- validation( 'updateProgramForm', function( form ){
- enable('dateOfEnrollmentDescription');
- enable('dateOfIncidentDescription');
- form.submit();
- }, function(){
- var selectedPropertyIds = jQuery( "#selectedPropertyIds" );
- selectedPropertyIds.empty();
- var personDisplayNames = jQuery( "#personDisplayNames" );
- personDisplayNames.empty();
- if(getFieldValue('type')!=3){
- jQuery("#selectedList").find("tr").each( function( i, item ){
-
- selectedPropertyIds.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
-
- var displayed = jQuery( item ).find( "input[name='displayed']:first");
- var checked = displayed.attr('checked') ? true : false;
- personDisplayNames.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
- });
- }
- });
-
- programOnChange();
-});
=== 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-04-18 06:45:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-04-24 13:40:48 +0000
@@ -4,8 +4,11 @@
validation( 'updateProgramForm', function( form ){
if( duplicate==true)
return false;
- else
+ else{
+ enable('dateOfEnrollmentDescription');
+ enable('dateOfIncidentDescription');
form.submit();
+ }
}, function(){
duplicate = false;
var COLOR_RED = '#ff8a8a';
@@ -39,14 +42,27 @@
jQuery(".dateToCompare").each( function( i, item ){
datesToCompare.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
});
+
+ var selectedPropertyIds = jQuery( "#selectedPropertyIds" );
+ selectedPropertyIds.empty();
+ var personDisplayNames = jQuery( "#personDisplayNames" );
+ personDisplayNames.empty();
+ if(getFieldValue('type')!=3){
+ jQuery("#selectedList").find("tr").each( function( i, item ){
+
+ selectedPropertyIds.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
+
+ var displayed = jQuery( item ).find( "input[name='displayed']:first");
+ var checked = displayed.attr('checked') ? true : false;
+ personDisplayNames.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ });
+ }
});
checkValueIsExist( "name", "validateProgram.action",{id:getFieldValue('id')} );
});
</script>
-<script type="text/javascript" src="javascript/updateProgramForm.js"></script>
-
<h3>$i18n.getString( "edit_program" )</h3>
<form id="updateProgramForm" name="updateProgramForm" action="updateProgram.action" method="post" onsubmit="selectAllById('selectedPropertyIds');" >
@@ -87,7 +103,7 @@
<tr>
<td><label>$i18n.getString( "version" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="version" name="version" value="$program.version" class="{validate:{required:true,number:true}}"></td>
+ <td><input type="text" id="version" name="version" value="$program.version" class="{validate:{required:true,integer:true}}"></td>
<td></td>
</tr>