dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20052
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9017: Run validation rules before to complete an event.
------------------------------------------------------------
revno: 9017
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-11-14 16:37:39 +0700
message:
Run validation rules before to complete an event.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/validationResult.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-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2012-11-14 05:52:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2012-11-14 09:37:39 +0000
@@ -85,7 +85,7 @@
<td rowspan='30' valign='bottom'>
<input type="button" class='large-button' id='addSearchOptionBtn' name='addSearchOptionBtn' value="$i18n.getString('add')" onclick='addAttributeOption()'>
</td>
- <td rowspan='30' valign='bottom' align='right'>
+ <td rowspan='30' valign='bottom'>
<input type="button" class='large-button' id='clearAllBtn' name='clearAllBtnaddSearchOptionBtn' value="$i18n.getString('clear_all')" onclick='removeAllOption()'>
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-11-14 05:52:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-11-14 09:37:39 +0000
@@ -264,7 +264,6 @@
{
params += '&completed=false';
}
- params += '&endDate=' + getFieldValue('endDate');
jQuery( '#advancedSearchTB tr' ).each( function(index, row){
if( index>1 )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-11-09 13:01:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-11-14 09:37:39 +0000
@@ -442,7 +442,28 @@
}
}
-function doComplete( isCreateEvent )
+function doComplete(isCreateEvent){
+ jQuery.get( 'validateProgram.action'
+ , function(html){
+ $('#validateProgramDiv').html(html);
+ if(getFieldValue('violateValidation')=='true'){
+ $('#validateProgramDiv' ).dialog({
+ title: i18n_violate_validation,
+ maximize: true,
+ closable: true,
+ modal:true,
+ overlay:{background:'#000000', opacity:0.1},
+ width: 800,
+ height: 450
+ });
+ }
+ else{
+ runCompleteEvent( isCreateEvent );
+ }
+ });
+}
+
+function runCompleteEvent( isCreateEvent )
{
var flag = false;
jQuery("#dataEntryFormDiv input[name='entryfield'],select[name='entryselect']").each(function(){
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/validationResult.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/validationResult.vm 2012-11-09 03:14:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/validationResult.vm 2012-11-14 09:37:39 +0000
@@ -5,7 +5,7 @@
<img src="../images/warning_small.png">
#end
</h3>
-
+<input type="hidden" id="violateValidation" name="violateValidation" #if( $programValidationResults.size()==0 ) value="false" #else value="true" #end />
#if( $programValidationResults.size()==0 )
<p class="bold">$encoder.htmlEncode( $i18n.getString( "successful_validation" ) )</p>
#else