dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24409
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11958: Improve Define template message UI in program and program-stage.
------------------------------------------------------------
revno: 11958
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-09-07 19:09:05 +0700
message:
Improve Define template message UI in program and program-stage.
modified:
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/addProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramStageForm.js
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/javascript/updateProgramStageForm.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/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2013-09-07 10:25:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2013-09-07 12:09:05 +0000
@@ -31,27 +31,27 @@
userGroup.empty();
jQuery(".daysAllowedSendMessage").each( function( i, item ){
- daysAllowedSendMessages.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ daysAllowedSendMessages.append( "<option value='" + jQuery(item).attr('realvalue') + "' selected='true'></option>" );
});
jQuery(".templateMessage").each( function( i, item ){
- templateMessages.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
+ templateMessages.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".dateToCompare").each( function( i, item ){
- datesToCompare.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
+ datesToCompare.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".sendTo").each( function( i, item ){
- sendTo.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ sendTo.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".whenToSend").each( function( i, item ){
- whenToSend.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ whenToSend.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".userGroup").each( function( i, item ){
- userGroup.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ userGroup.append( "<option value='" + item.value + "' selected='true'></option>" );
});
var selectedPropertyIds = jQuery( "#selectedPropertyIds" );
@@ -332,4 +332,10 @@
var i18n_program_enrollment = '$encoder.jsEscape( $i18n.getString( "program_enrollment" ) , "'")';
var i18n_user_group = '$encoder.jsEscape( $i18n.getString( "user_group" ) , "'")';
var i18n_characters_without_params = '$encoder.jsEscape( $i18n.getString( "characters_without_params" ) , "'")';
+ var i18n_send_message = '$encoder.jsEscape( $i18n.getString( "send_message" ) , "'")';
+ var i18n_days = '$encoder.jsEscape( $i18n.getString( "days" ) , "'")';
+ var i18n_send_message = '$encoder.jsEscape( $i18n.getString( "send_message" ) , "'")';
+ var i18n_before = '$encoder.jsEscape( $i18n.getString( "before" ) , "'")';
+ var i18n_after = '$encoder.jsEscape( $i18n.getString( "after" ) , "'")';
+ var i18n_scheduled_date = '$encoder.jsEscape( $i18n.getString( "scheduled_date" ) , "'")';
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2013-09-07 10:25:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2013-09-07 12:09:05 +0000
@@ -219,7 +219,12 @@
var i18n_complete_event = '$encoder.jsEscape( $i18n.getString( "complete_event" ) , "'")';
var i18n_user_group = '$encoder.jsEscape( $i18n.getString( "user_group" ) , "'")';
var i18n_characters_without_params = '$encoder.jsEscape( $i18n.getString( "characters_without_params" ) , "'")';
-
+ var i18n_send_message = '$encoder.jsEscape( $i18n.getString( "send_message" ) , "'")';
+ var i18n_days = '$encoder.jsEscape( $i18n.getString( "days" ) , "'")';
+ var i18n_before = '$encoder.jsEscape( $i18n.getString( "before" ) , "'")';
+ var i18n_after = '$encoder.jsEscape( $i18n.getString( "after" ) , "'")';
+ var i18n_scheduled_date = '$encoder.jsEscape( $i18n.getString( "scheduled_date" ) , "'")';
+
var programStageList = new Array();
#foreach($programStage in $program.programStages)
programStageList.push("$programStage.displayName");
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramStageForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramStageForm.js 2013-09-07 09:28:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramStageForm.js 2013-09-07 12:09:05 +0000
@@ -39,42 +39,42 @@
jQuery("#selectedList").find("tr").each( function( i, item ){
- selectedDataElementsValidator.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
+ selectedDataElementsValidator.append( "<option value='" + item.id + "' selected='true'></option>" );
var compulsory = jQuery( item ).find( "input[name='compulsory']:first");
var checked = compulsory.attr('checked') ? true : false;
- compulsories.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ compulsories.append( "<option value='" + checked + "' selected='true'></option>" );
var allowProvided = jQuery( item ).find( "input[name='allowProvided']:first");
checked = allowProvided.attr('checked') ? true : false;
- allowProvidedElsewhere.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ allowProvidedElsewhere.append( "<option value='" + checked + "' selected='true'></option>" );
var displayInReport = jQuery( item ).find( "input[name='displayInReport']:first");
checked = displayInReport.attr('checked') ? true : false;
- displayInReports.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ displayInReports.append( "<option value='" + checked + "' selected='true'></option>" );
var allowDateInFuture = jQuery( item ).find( "input[name='allowDateInFuture']:first");
checked = allowDateInFuture.attr('checked') ? true : false;
- allowDateInFutures.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ allowDateInFutures.append( "<option value='" + checked + "' selected='true'></option>" );
var displayAsRadioButton = jQuery( item ).find( "input[name='displayAsRadioButton']:first");
checked = displayAsRadioButton.attr('checked') ? true : false;
- displayAsRadioButtons.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ displayAsRadioButtons.append( "<option value='" + checked + "' selected='true'></option>" );
});
jQuery(".daysAllowedSendMessage").each( function( i, item ){
- daysAllowedSendMessages.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ daysAllowedSendMessages.append( "<option value='" + jQuery(item).attr('realvalue') + "' selected='true'></option>" );
});
jQuery(".templateMessage").each( function( i, item ){
- templateMessages.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
+ templateMessages.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".sendTo").each( function( i, item ){
- sendTo.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ sendTo.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".whenToSend").each( function( i, item ){
- whenToSend.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ whenToSend.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".userGroup").each( function( i, item ){
- userGroup.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ userGroup.append( "<option value='" + item.value + "' selected='true'></option>" );
});
});
=== 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-09-07 10:25:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-09-07 12:09:05 +0000
@@ -298,7 +298,15 @@
+ '</tr>'
+ '<tr name="tr' + rowId + '">'
+ '<td><label>' + i18n_days_before_after_comparison_date + '</label></td>'
- + '<td><input type="text" id="daysAllowedSendMessage' + rowId + '" name="daysAllowedSendMessage' + rowId + '" class="daysAllowedSendMessage {validate:{required:true,number:true}}"/></td>'
+ + '<td>'
+ + '<input type="text" onchange="setRealDays(' + rowId + ')" style="width:100px;" realvalue="" id="daysAllowedSendMessage' + rowId + '" name="daysAllowedSendMessage' + rowId + '" class="daysAllowedSendMessage {validate:{required:true,number:true}}"/> '
+ + i18n_days
+ + ' <select id="time' + rowId + '" name="time' + rowId + '" style="width:100px;" onchange="setRealDays(' + rowId + ')" >'
+ + '<option value="1">' + i18n_before + '</option>'
+ + '<option value="-1">' + i18n_after + '</option>'
+ + '</select> '
+ + i18n_scheduled_date
+ + ' </td>'
+ '</tr>'
+ '<tr name="tr' + rowId + '">'
+ '<td><label>' + i18n_recipients + '</label></td>'
@@ -375,10 +383,12 @@
if(whenToSend==""){
enable('dateToCompare' + index );
enable('daysAllowedSendMessage' + index );
+ enable('time' + index );
}
else{
disable('dateToCompare' + index );
disable('daysAllowedSendMessage' + index );
+ disable('time' + index );
}
}
@@ -405,4 +415,12 @@
{
jQuery('#templateMessage' + rowId ).removeAttr('maxlength');
}
-}
\ No newline at end of file
+}
+
+function setRealDays(rowId)
+{
+ var daysAllowedSendMessage = jQuery("#daysAllowedSendMessage" + rowId);
+ var time = jQuery("#time" + rowId + " option:selected ").val();
+ daysAllowedSendMessage.attr("realvalue", time * eval(daysAllowedSendMessage).val());
+ var aasdf= 0;
+}
=== 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-09-07 10:25:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2013-09-07 12:09:05 +0000
@@ -322,7 +322,15 @@
+ '</tr>'
+ '<tr name="tr' + rowId + '">'
+ '<td><label>' + i18n_days_before_after_due_date + '</label></td>'
- + '<td><input type="text" id="daysAllowedSendMessage' + rowId + '" name="daysAllowedSendMessage' + rowId + '" class="daysAllowedSendMessage {validate:{required:true,number:true}}"/></td>'
+ + '<td>'
+ + '<input type="text" onchange="setRealDays(' + rowId + ')" style="width:100px;" realvalue="" id="daysAllowedSendMessage' + rowId + '" name="daysAllowedSendMessage' + rowId + '" class="daysAllowedSendMessage {validate:{required:true,number:true}}"/> '
+ + i18n_days
+ + ' <select id="time' + rowId + '" name="time' + rowId + '" style="width:100px;" onchange="setRealDays(' + rowId + ')" >'
+ + '<option value="1">' + i18n_before + '</option>'
+ + '<option value="-1">' + i18n_after + '</option>'
+ + '</select> '
+ + i18n_scheduled_date
+ + ' </td>'
+ '</tr>'
+ '<tr name="tr' + rowId + '">'
+ '<td><label>' + i18n_recipients + '</label></td>'
@@ -378,9 +386,11 @@
var whenToSend = getFieldValue('whenToSend' + index );
if(whenToSend==2){
disable('daysAllowedSendMessage' + index );
+ disable('time' + index );
}
else{
enable('daysAllowedSendMessage' + index );
+ enable('time' + index );
}
}
function showHideUserGroup()
@@ -428,4 +438,12 @@
{
jQuery('#templateMessage' + rowId ).removeAttr('maxlength');
}
-}
\ No newline at end of file
+}
+
+function setRealDays(rowId)
+{
+ var daysAllowedSendMessage = jQuery("#daysAllowedSendMessage" + rowId);
+ var time = jQuery("#time" + rowId + " option:selected ").val();
+ daysAllowedSendMessage.attr("realvalue", time * eval(daysAllowedSendMessage).val());
+ var aasdf= 0;
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js 2013-09-07 09:28:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js 2013-09-07 12:09:05 +0000
@@ -44,38 +44,38 @@
var compulsory = jQuery( item ).find( "input[name='compulsory']:first");
var checked = compulsory.attr('checked') ? true : false;
- compulsories.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ compulsories.append( "<option value='" + checked + "' selected='true'></option>" );
var allowProvided = jQuery( item ).find( "input[name='allowProvided']:first");
checked = allowProvided.attr('checked') ? true : false;
- allowProvidedElsewhere.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ allowProvidedElsewhere.append( "<option value='" + checked + "' selected='true'></option>" );
var displayInReport = jQuery( item ).find( "input[name='displayInReport']:first");
checked = displayInReport.attr('checked') ? true : false;
- displayInReports.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ displayInReports.append( "<option value='" + checked + "' selected='true'></option>" );
var allowDateInFuture = jQuery( item ).find( "input[name='allowDateInFuture']:first");
checked = allowDateInFuture.attr('checked') ? true : false;
- allowDateInFutures.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ allowDateInFutures.append( "<option value='" + checked + "' selected='true'></option>" );
var displayAsRadioButton = jQuery( item ).find( "input[name='displayAsRadioButton']:first");
checked = displayAsRadioButton.attr('checked') ? true : false;
- displayAsRadioButtons.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ displayAsRadioButtons.append( "<option value='" + checked + "' selected='true'></option>" );
});
jQuery(".daysAllowedSendMessage").each( function( i, item ){
- daysAllowedSendMessages.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ daysAllowedSendMessages.append( "<option value='" + jQuery(item).attr('realvalue') + "' selected='true'></option>" );
});
jQuery(".templateMessage").each( function( i, item ){
- templateMessages.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
+ templateMessages.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".sendTo").each( function( i, item ){
- sendTo.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ sendTo.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".whenToSend").each( function( i, item ){
- whenToSend.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ whenToSend.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".userGroup").each( function( i, item ){
- userGroup.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ userGroup.append( "<option value='" + item.value + "' selected='true'></option>" );
});
});
=== 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-09-07 10:25:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-09-07 12:09:05 +0000
@@ -33,27 +33,27 @@
userGroup.empty();
jQuery(".daysAllowedSendMessage").each( function( i, item ){
- daysAllowedSendMessages.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ daysAllowedSendMessages.append( "<option value='" + jQuery(item).attr('realvalue') + "' selected='true'></option>" );
});
jQuery(".templateMessage").each( function( i, item ){
- templateMessages.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
+ templateMessages.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".dateToCompare").each( function( i, item ){
- datesToCompare.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
+ datesToCompare.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".sendTo").each( function( i, item ){
- sendTo.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ sendTo.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".whenToSend").each( function( i, item ){
- whenToSend.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ whenToSend.append( "<option value='" + item.value + "' selected='true'></option>" );
});
jQuery(".userGroup").each( function( i, item ){
- userGroup.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+ userGroup.append( "<option value='" + item.value + "' selected='true'></option>" );
});
var selectedPropertyIds = jQuery( "#selectedPropertyIds" );
@@ -63,11 +63,11 @@
if(getFieldValue('type')!=3){
jQuery("#selectedList").find("tr").each( function( i, item ){
- selectedPropertyIds.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
+ selectedPropertyIds.append( "<option value='" + item.id + "' selected='true'></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>" );
+ personDisplayNames.append( "<option value='" + checked + "' selected='true'></option>" );
});
};
});
@@ -337,7 +337,7 @@
<td><label>$i18n.getString( "send_when_to" )</label></td>
<td>
<select type="text" id="whenToSend$index" name="whenToSend$index" class="whenToSend" onchange='whenToSendOnChange($index)'>
- <option value="" >$i18n.getString("scheduled")</option>
+ <option value="" >$i18n.getString("days_scheduled")</option>
<option value="3" #if($!reminder.whenToSend==3) selected #end >$i18n.getString("complete_program")</option>
<option value="1" #if($!reminder.whenToSend==1) selected #end >$i18n.getString("program_enrollment")</option>
</select>
@@ -353,10 +353,26 @@
</td>
</tr>
<tr name="tr$index">
- <td><label>$i18n.getString( "days_before_after_comparison_date" )</label></td>
+ #set($value=$!reminder.daysAllowedSendMessage)
+ #set($time = '1')
+ #if($!value && $value<0)
+ #set($time = '-1')
+ #set($value=-1 * $value)
+ #end
+ <td><label>$i18n.getString( "send_message" )</label></td>
<td><input type="text" id="daysAllowedSendMessage$index" name="daysAllowedSendMessage$index"
- class="daysAllowedSendMessage {validate:{required:true,number:true}}" value="$!reminder.daysAllowedSendMessage"
- #if($!reminder.whenToSend==1 || $!reminder.whenToSend==3 ) disabled #end /></td>
+ class="daysAllowedSendMessage {validate:{required:true,number:true}}" value="$!value"
+ onkeyup='setRealDays($index);' style="width:100px;"
+ #if($!reminder.whenToSend==1 || $!reminder.whenToSend==3 ) disabled #end
+ realvalue="$!reminder.daysAllowedSendMessage" />
+ $i18n.getString('days')
+ <select id='time$index' name='time$index' onchange='setRealDays($index);' style="width:100px;"
+ #if($!reminder.whenToSend==1 || $!reminder.whenToSend==3 ) disabled #end >
+ <option value='1' #if($time=='1') selected #end >$i18n.getString('before')</option>
+ <option value='-1' #if($time=='-1') selected #end >$i18n.getString('after')</option>
+ </select>
+ $i18n.getString('scheduled_date')
+ </td>
</tr>
<tr name="tr$index">
<td><label>$i18n.getString( "recipients" )</label></td>
@@ -450,6 +466,10 @@
var i18n_complete_program_stage = '$encoder.jsEscape( $i18n.getString( "complete_program_stage" ) , "'")';
var i18n_user_group = '$encoder.jsEscape( $i18n.getString( "user_group" ) , "'")';
var i18n_characters_without_params = '$encoder.jsEscape( $i18n.getString( "characters_without_params" ) , "'")';
-
+ var i18n_send_message = '$encoder.jsEscape( $i18n.getString( "send_message" ) , "'")';
+ var i18n_days = '$encoder.jsEscape( $i18n.getString( "days" ) , "'")';
+ var i18n_before = '$encoder.jsEscape( $i18n.getString( "before" ) , "'")';
+ var i18n_after = '$encoder.jsEscape( $i18n.getString( "after" ) , "'")';
+ var i18n_scheduled_date = '$encoder.jsEscape( $i18n.getString( "scheduled_date" ) , "'")';
programOnChange();
</script>
=== 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-09-07 10:25:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2013-09-07 12:09:05 +0000
@@ -223,10 +223,25 @@
</td>
</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"
- #if($!reminder.whenToSend==2) disabled #end /></td>
+ <td><label>$i18n.getString( "send_message" )</label></td>
+ <td>
+ #set($value=$!reminder.daysAllowedSendMessage)
+ #set($time = '1')
+ #if($!value && $value<0)
+ #set($time = '-1')
+ #set($value=-1 * $value)
+ #end
+ <input type="text" id="daysAllowedSendMessage$index" name="daysAllowedSendMessage$index"
+ class="daysAllowedSendMessage {validate:{required:true,number:true}}" value="$value"
+ #if($!reminder.whenToSend==2) disabled #end onkeyup='setRealDays($index);' style="width:100px;" />
+ $i18n.getString('days')
+ <select id='time$index' name='time$index' onchange='setRealDays($index);' style="width:100px;"
+ #if($!reminder.whenToSend==2) disabled #end >
+ <option value='1' #if($time=='1') selected #end >$i18n.getString('before')</option>
+ <option value='-1' #if($time=='-1') selected #end >$i18n.getString('after')</option>
+ </select>
+ $i18n.getString('scheduled_date')
+ </td>
</tr>
<tr name="tr$index">
<td><label>$i18n.getString( "recipients" )</label></td>
@@ -265,7 +280,7 @@
</tr>
<tr name="tr$index">
<td><label>$i18n.getString( "message" )</label></td>
- <td><textarea id="templateMessage$index" onkeypress="getMessageLength($index)" name="templateMessage$index" style="width:320px" class="templateMessage {validate:{required:true, rangelength:[3,160]}}">$reminder.templateMessage</textarea></td>
+ <td><textarea id="templateMessage$index" onkeypress="getMessageLength($index)" name="templateMessage$index" style="width:320px" class="templateMessage {validate:{required:true}}">$reminder.templateMessage</textarea></td>
</tr>
<tr>
<td></td>
@@ -317,4 +332,9 @@
var i18n_program_stage_name = '$encoder.jsEscape( $i18n.getString( "program_stage_name" ) , "'" )';
var i18n_user_group = '$encoder.jsEscape( $i18n.getString( "user_group" ) , "'")';
var i18n_characters_without_params = '$encoder.jsEscape( $i18n.getString( "characters_without_params" ) , "'")';
+ var i18n_send_message = '$encoder.jsEscape( $i18n.getString( "send_message" ) , "'")';
+ var i18n_days = '$encoder.jsEscape( $i18n.getString( "days" ) , "'")';
+ var i18n_before = '$encoder.jsEscape( $i18n.getString( "before" ) , "'")';
+ var i18n_after = '$encoder.jsEscape( $i18n.getString( "after" ) , "'")';
+ var i18n_scheduled_date = '$encoder.jsEscape( $i18n.getString( "scheduled_date" ) , "'")';
</script>
\ No newline at end of file