← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13522: Disable Add new and List All Persons buttons if no program is selected in Single event with regis...

 

------------------------------------------------------------
revno: 13522
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-31 21:40:08 +0700
message:
  Disable Add new and List All Persons buttons if no program is selected in Single event with registration management.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.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/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java	2013-10-24 08:31:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java	2013-12-31 14:40:08 +0000
@@ -119,7 +119,6 @@
         if ( organisationUnit != null )
         {
             programs = programService.getProgramsByCurrentUser( organisationUnit );
-            programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION, organisationUnit ) );
             programs.removeAll( programService
                 .getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, organisationUnit ) );
         }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2013-12-30 03:19:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2013-12-31 14:40:08 +0000
@@ -25,6 +25,7 @@
 			}
 			else if(count>1){
 				jQuery( '#programIdAddPatient').prepend( '<option value="" selected>' + i18n_please_select + '</option>' );
+				enable('addPatientBtn');
 			}
 			
 			enableBtn();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2013-12-30 03:19:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2013-12-31 14:40:08 +0000
@@ -1,17 +1,25 @@
 <script>
 	jQuery(document).ready(	function(){
-		jQuery("#programIdAddPatient option").each(function(){
-			var item = jQuery(this);
-			if(item.attr('type')!=2 ){
-				item.remove();
-			}
-		});
-		if(jQuery("#programIdAddPatient option").length==1)
+		jQuery("#programIdAddPatient option").each(function() {
+            var item = jQuery(this);
+            if( item.attr('type') != 2 ) {
+                item.remove();
+            }
+        });
+		jQuery("#programIdAddPatient [value=]").remove();
+	
+		if(jQuery("#programIdAddPatient option").length==0)
 		{
-			jQuery("#programIdAddPatient [value=]").remove();
 			jQuery( '#programIdAddPatient').append( '<option value="" type="">' + i18n_none_program + '</option>' );
+			disable('listPatientBtn');
+			disable('addPatientBtn');
+		}
+		else{
+			enable('listPatientBtn');
+			enable('addPatientBtn');
 		}
 		
+		showById('advancedSearchBtn');
 		disable('advancedSearchBtn');
 		hideById('removeEventLink');
 		setFieldValue('isSearchByProgram', true);
@@ -19,7 +27,6 @@
 		$("#searchObjectId option[value='prg']").remove();
 		setFieldValue('startDueDate','');
 		setFieldValue('endDueDate','');
-		showById('advancedSearchBtn');
 	});
 </script>