← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11956: Fixed bug - Cannot create many message templates with send-base-on as Complete event / Complete p...

 

------------------------------------------------------------
revno: 11956
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-09-07 16:28:53 +0700
message:
  Fixed bug - Cannot create many message templates with send-base-on as Complete event / Complete program
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/javascript/addProgramStageForm.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 09:08:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2013-09-07 09:28:53 +0000
@@ -8,26 +8,10 @@
 	jQuery( document ).ready( function()
 	{	
 		validation( 'addProgramForm', function( form ){ 
-		if( duplicate==true) 
-			return false;
-		else{
-			enable('dateOfEnrollmentDescription');
-			enable('dateOfIncidentDescription');
-			form.submit();
-		}
+		enable('dateOfEnrollmentDescription');
+		enable('dateOfIncidentDescription');
+		form.submit();
 	}, function(){
-		duplicate = false;
-		var COLOR_RED = '#ff8a8a';
-		jQuery(".daysAllowedSendMessage").each( function( i, a ){ 
-			jQuery(".daysAllowedSendMessage").each( function(j, b){ 
-				if( i!=j && a.value==b.value){
-					jQuery( a ).css( 'background-color', COLOR_RED );
-					jQuery( b ).css( 'background-color', COLOR_RED );
-					duplicate = true;
-				}
-			});
-		});
-		
 		var daysAllowedSendMessages = jQuery( "#daysAllowedSendMessages" );
 		daysAllowedSendMessages.empty();
 		

=== 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-06 15:53:07 +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 09:28:53 +0000
@@ -2,23 +2,8 @@
 jQuery( document ).ready( function()
 {
 	validation( 'addProgramStageForm', function( form ){ 
-		if( duplicate==true) 
-			return false;
-		else
-			form.submit();
+		form.submit();
 	}, function(){
-		duplicate = false;
-		var COLOR_RED = '#ff8a8a';
-		jQuery(".daysAllowedSendMessage").each( function( i, a ){ 
-			jQuery(".daysAllowedSendMessage").each( function(j, b){ 
-				if( i!=j && a.value==b.value){
-					jQuery( a ).css( 'background-color', COLOR_RED );
-					jQuery( b ).css( 'background-color', COLOR_RED );
-					duplicate = true;
-				}
-			});
-		});
-		
 		var selectedDataElementsValidator = jQuery( "#selectedDataElementsValidator" );
 		selectedDataElementsValidator.empty();
 		

=== 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-06 15:53:07 +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 09:28:53 +0000
@@ -3,23 +3,8 @@
 {
 	showHideUserGroup();
 	validation( 'updateProgramStageForm', function( form ){ 
-		if( duplicate==true) 
-			return false;
-		else
-			form.submit();
+		form.submit();
 	}, function(){
-		duplicate = false;
-		var COLOR_RED = '#ff8a8a';
-		jQuery(".daysAllowedSendMessage").each( function( i, a ){ 
-			jQuery(".daysAllowedSendMessage").each( function(j, b){ 
-				if( i!=j && a.value==b.value){
-					jQuery( a ).css( 'background-color', COLOR_RED );
-					jQuery( b ).css( 'background-color', COLOR_RED );
-					duplicate = true;
-				}
-			});
-		});
-		
 		var selectedDataElementsValidator = jQuery( "#selectedDataElementsValidator" );
 		selectedDataElementsValidator.empty();
 		

=== 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 09:08:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2013-09-07 09:28:53 +0000
@@ -17,75 +17,64 @@
 				form.submit();
 			}
 			}, function(){
-				duplicate = false;
-				var COLOR_RED = '#ff8a8a';
-				jQuery(".daysAllowedSendMessage").each( function( i, a ){ 
-					jQuery(".daysAllowedSendMessage").each( function(j, b){ 
-						if( i!=j && a.value==b.value){
-							jQuery( a ).css( 'background-color', COLOR_RED );
-							jQuery( b ).css( 'background-color', COLOR_RED );
-							duplicate = true;
-						}
+				
+				var daysAllowedSendMessages = jQuery( "#daysAllowedSendMessages" );
+				daysAllowedSendMessages.empty();
+				
+				var templateMessages = jQuery( "#templateMessages" );
+				templateMessages.empty();
+				
+				var datesToCompare = jQuery( "#datesToCompare" );
+				datesToCompare.empty();
+				
+				var sendTo = jQuery( "#sendTo" );
+				sendTo.empty();
+				
+				var whenToSend = jQuery( "#whenToSend" );
+				whenToSend.empty();
+				
+				var userGroup = jQuery( "#userGroup" );
+				userGroup.empty();
+				
+				jQuery(".daysAllowedSendMessage").each( function( i, item ){ 
+					daysAllowedSendMessages.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+				});
+				
+				jQuery(".templateMessage").each( function( i, item ){ 
+					templateMessages.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
+				});
+				
+				jQuery(".dateToCompare").each( function( i, item ){ 
+					datesToCompare.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
+				});
+				
+				jQuery(".sendTo").each( function( i, item ){ 
+					sendTo.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+				});
+				
+				jQuery(".whenToSend").each( function( i, item ){ 
+					whenToSend.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
+				});
+				
+				jQuery(".userGroup").each( function( i, item ){ 
+					userGroup.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>" );
 					});
-		});
-		
-		var daysAllowedSendMessages = jQuery( "#daysAllowedSendMessages" );
-		daysAllowedSendMessages.empty();
-		
-		var templateMessages = jQuery( "#templateMessages" );
-		templateMessages.empty();
-		
-		var datesToCompare = jQuery( "#datesToCompare" );
-		datesToCompare.empty();
-		
-		var sendTo = jQuery( "#sendTo" );
-		sendTo.empty();
-		
-		var whenToSend = jQuery( "#whenToSend" );
-		whenToSend.empty();
-		
-		var userGroup = jQuery( "#userGroup" );
-		userGroup.empty();
-		
-		jQuery(".daysAllowedSendMessage").each( function( i, item ){ 
-			daysAllowedSendMessages.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
-		});
-		
-		jQuery(".templateMessage").each( function( i, item ){ 
-			templateMessages.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
-		});
-		
-		jQuery(".dateToCompare").each( function( i, item ){ 
-			datesToCompare.append( "<option value='" + item.value + "' selected='true'>" +item.value+"</option>" );
-		});
-		
-		jQuery(".sendTo").each( function( i, item ){ 
-			sendTo.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
-		});
-		
-		jQuery(".whenToSend").each( function( i, item ){ 
-			whenToSend.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
-		});
-		
-		jQuery(".userGroup").each( function( i, item ){ 
-			userGroup.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')} );
 });
 	function onchangeUserGroup( id )

=== 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 09:08:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm	2013-09-07 09:28:53 +0000
@@ -217,7 +217,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="2" #if($!reminder.whenToSend==2) selected #end >$i18n.getString("complete_event")</option>
 						</select>
 					</td>