← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13516: disable scheduled visits when program is not selected (disable by default, on pageload)

 

------------------------------------------------------------
revno: 13516
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-31 12:20:33 +0100
message:
  disable scheduled visits when program is not selected (disable by default, on pageload)
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.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/javascript/multiDataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js	2013-12-30 02:57:37 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js	2013-12-31 11:20:33 +0000
@@ -1,21 +1,20 @@
 isAjax = true;
 
-function multiDataEntryOrgunitSelected( orgUnits, orgUnitNames )
-{
-	hideById('patientDashboard');
-	showById('searchDiv');
-	showById('mainLinkLbl');
-	var width = jQuery('#programIdAddPatient').width();
-	jQuery('#programIdAddPatient').width(width-30);
-	showById( "programLoader" );
-	disable('programIdAddPatient');
-	setFieldValue('orgunitName', orgUnitNames[0]);
-	setFieldValue('orgunitId', orgUnits[0]);
-	hideById("listPatientDiv");
-	clearListById('programIdAddPatient');
-	$('#contentDataRecord').html('');
+function multiDataEntryOrgunitSelected( orgUnits, orgUnitNames ) {
+    hideById('patientDashboard');
+    showById('searchDiv');
+    showById('mainLinkLbl');
+    var width = jQuery('#programIdAddPatient').width();
+    jQuery('#programIdAddPatient').width(width - 30);
+    showById("programLoader");
+    disable('programIdAddPatient');
+    setFieldValue('orgunitName', orgUnitNames[0]);
+    setFieldValue('orgunitId', orgUnits[0]);
+    hideById("listPatientDiv");
+    clearListById('programIdAddPatient');
+    $('#contentDataRecord').html('');
 
-	jQuery.get("getPrograms.action",{}, function(json) {
+    jQuery.get("getPrograms.action", {}, function( json ) {
         var count = 0;
 
         for( i in json.programs ) {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2013-12-30 02:57:37 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2013-12-31 11:20:33 +0000
@@ -1,31 +1,32 @@
 <script>
-	jQuery(document).ready(	function(){
-		jQuery("#programIdAddPatient option").each(function(){
-			var item = jQuery(this);
-			if( item.attr('type')!=1 && item.val()!='' ){
-				item.remove();
-			}
-		});
-		if(jQuery("#programIdAddPatient option").length==1)
-		{
-			jQuery("#programIdAddPatient [value=]").remove();
-		}
-		
-		hideById('addPatientBtn');
-		var i18n_list_events = '$encoder.jsEscape( $i18n.getString( "list_events" ) , "'")';
-		setFieldValue('listPatientBtn', i18n_list_events);
-		showById('dueDateTR');
-		showById('programStageAddPatientTR');
-		showById('scheduleVisitTR');
-		showById('advancedSearchBtn');
-		
-		jQuery("#searchObjectId [value=prg]").remove();
-		registration = false;
-		
-		jQuery('#searchByIdTR').remove();
-		jQuery('#listPatientBtnTD').attr('rowspan',5);
-		jQuery('#listPatientBtnTD').attr('valign','bottom');
-	});	
+    jQuery(document).ready(function() {
+        jQuery("#programIdAddPatient option").each(function() {
+            var item = jQuery(this);
+            if( item.attr('type') != 1 && item.val() != '' ) {
+                item.remove();
+            }
+        });
+
+        if( jQuery("#programIdAddPatient option").length == 1 ) {
+            jQuery("#programIdAddPatient [value=]").remove();
+        }
+
+        disable('scheduledVisitDays');
+        hideById('addPatientBtn');
+        var i18n_list_events = '$encoder.jsEscape( $i18n.getString( "list_events" ) , "'")';
+        setFieldValue('listPatientBtn', i18n_list_events);
+        showById('dueDateTR');
+        showById('programStageAddPatientTR');
+        showById('scheduleVisitTR');
+        showById('advancedSearchBtn');
+
+        jQuery("#searchObjectId [value=prg]").remove();
+        registration = false;
+
+        jQuery('#searchByIdTR').remove();
+        jQuery('#listPatientBtnTD').attr('rowspan', 5);
+        jQuery('#listPatientBtnTD').attr('valign', 'bottom');
+    });
 </script>
 
 <h3 id='mainLinkLbl'>$i18n.getString( "multiple_individual_records_management" ) #openHelp('multiple_individual_records')</h3>