dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23381
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11377: Disable Date to compare and Days before/after comparison date fields if send-to-when is selected ...
------------------------------------------------------------
revno: 11377
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-07-10 15:02:32 +0700
message:
Disable Date to compare and Days before/after comparison date fields if send-to-when is selected as Complete program/Complete event.
modified:
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/programStage.js
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/updateProgramStageForm.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/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-07-09 03:26:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-07-10 08:02:32 +0000
@@ -266,7 +266,7 @@
+ '<tr name="tr' + rowId + '">'
+ '<td><label>' + i18n_send_when_to + '</label></td>'
+ '<td>'
- + '<select id="whenToSend' + rowId + '" name="whenToSend' + rowId + '" class="whenToSend" >'
+ + '<select id="whenToSend' + rowId + '" name="whenToSend' + rowId + '" class="whenToSend" onchange="whenToSendOnChange(' + rowId + ')" >'
+ '<option value="">' + i18n_from_the_day_set + '</option>'
+ '<option value="3">' + i18n_complete_program + '</option>'
+ '</select>'
@@ -275,7 +275,7 @@
+ '<tr name="tr' + rowId + '">'
+ '<td><label>' + i18n_date_to_compare + '</label></td>'
+ '<td>'
- + '<select class="dateToCompare">'
+ + '<select id="dateToCompare' + rowId + '" class="dateToCompare">'
+ '<option value="dateofincident">' + i18n_incident_date + '</option>'
+ '<option value="enrollmentdate">' + i18n_enrollment_date + '</option>'
+ '</select>'
@@ -327,4 +327,17 @@
{
var templateMessage = paramValue;
insertTextCommon('templateMessage' + rowId, templateMessage);
+}
+
+function whenToSendOnChange(index)
+{
+ var whenToSend = getFieldValue('whenToSend' + index );
+ if(whenToSend==3){
+ disable('dateToCompare' + index );
+ disable('daysAllowedSendMessage' + index );
+ }
+ else{
+ enable('dateToCompare' + index );
+ enable('daysAllowedSendMessage' + index );
+ }
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2013-07-02 14:26:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2013-07-10 08:02:32 +0000
@@ -280,7 +280,7 @@
+ '<tr name="tr' + rowId + '">'
+ '<td><label>' + i18n_send_when_to + '</label></td>'
+ '<td>'
- + '<select id="whenToSend' + rowId + '" name="whenToSend' + rowId + '" class="whenToSend" >'
+ + '<select id="whenToSend' + rowId + '" name="whenToSend' + rowId + '" class="whenToSend" onchange="whenToSendOnChange(' + rowId + ')">'
+ '<option value="">' + i18n_from_the_day_set + '</option>'
+ '<option value="2">' + i18n_complete_event + '</option>'
+ '</select>'
@@ -326,3 +326,14 @@
{
jQuery("[name=tr" + rowId + "]").remove();
}
+
+function whenToSendOnChange(index)
+{
+ var whenToSend = getFieldValue('whenToSend' + index );
+ if(whenToSend==2){
+ disable('daysAllowedSendMessage' + index );
+ }
+ else{
+ enable('daysAllowedSendMessage' + index );
+ }
+}
\ No newline at end of file
=== 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-07-09 03:26:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-07-10 08:02:32 +0000
@@ -286,7 +286,7 @@
<tr name="tr$index">
<td><label>$i18n.getString( "send_when_to" )</label></td>
<td>
- <select type="text" id="whenToSend$index" name="whenToSend$index" class="whenToSend">
+ <select type="text" id="whenToSend$index" name="whenToSend$index" class="whenToSend" onchange='whenToSendOnChange($index)'>
<option value="" >$i18n.getString("from_the_day_set")</option>
<option value="3" #if($!reminder.whenToSend==3) selected #end >$i18n.getString("complete_program")</option>
</select>
@@ -295,7 +295,7 @@
<tr name="tr$index">
<td><label>$i18n.getString( "date_to_compare")</label></td>
<td>
- <select class="dateToCompare"/>
+ <select class="dateToCompare" id='dateToCompare$index' #if($!reminder.whenToSend==3) disabled #end />
<option value="dateofincident">$i18n.getString( "incident_date" )</option>
<option value="enrollmentdate">$i18n.getString( "enrollment_date" )</option>
</select>
@@ -303,7 +303,9 @@
</tr>
<tr name="tr$index">
<td><label>$i18n.getString( "days_before_after_comparison_date" )</label></td>
- <td><input type="text" id="daysAllowedSendMessage$index" name="daysAllowedSendMessage$index" class="daysAllowedSendMessage {validate:{required:true,number:true}}" value="$!reminder.daysAllowedSendMessage"/></td>
+ <td><input type="text" id="daysAllowedSendMessage$index" name="daysAllowedSendMessage$index"
+ class="daysAllowedSendMessage {validate:{required:true,number:true}}" value="$!reminder.daysAllowedSendMessage"
+ #if($!reminder.whenToSend==3) disabled #end /></td>
</tr>
<tr name="tr$index">
<td><label>$i18n.getString( "send_to" )</label></td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2013-07-02 14:26:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2013-07-10 08:02:32 +0000
@@ -179,7 +179,7 @@
<tr name="tr$index">
<td><label>$i18n.getString( "send_when_to" )</label></td>
<td>
- <select type="text" id="whenToSend$index" name="whenToSend$index" class="whenToSend">
+ <select type="text" id="whenToSend$index" name="whenToSend$index" class="whenToSend" onchange='whenToSendOnChange($index)' >
<option value="" >$i18n.getString("from_the_day_set")</option>
<option value="2" #if($!reminder.whenToSend==2) selected #end >$i18n.getString("complete_event")</option>
</select>
@@ -187,7 +187,9 @@
</tr>
<tr name="tr$index">
<td><label>$i18n.getString( "days_before_after_due_date" )</label></td>
- <td><input type="text" id="daysAllowedSendMessage$index" name="daysAllowedSendMessage$index" class="daysAllowedSendMessage {validate:{required:true,number:true}}" value="$!reminder.daysAllowedSendMessage"/></td>
+ <td><input type="text" id="daysAllowedSendMessage$index" name="daysAllowedSendMessage$index"
+ class="daysAllowedSendMessage {validate:{required:true,number:true}}" value="$!reminder.daysAllowedSendMessage"
+ #if($!reminder.whenToSend==2) disabled #end /></td>
</tr>
<tr name="tr$index">
<td><label>$i18n.getString( "send_to" )</label></td>