← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8939: Possible date fields for selecting in anonymous program; open a dialog windown for update an anon...

 

------------------------------------------------------------
revno: 8939
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-11-07 21:52:49 +0700
message:
  Possible date fields for selecting in anonymous program; open a dialog windown for update an anonymous cases.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java
  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/reportDataEntryForm.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/report/TabularInitializeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java	2012-11-07 14:21:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java	2012-11-07 14:52:49 +0000
@@ -33,7 +33,6 @@
 import java.util.List;
 
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
@@ -101,13 +100,6 @@
         return orgunitGroups;
     }
 
-    private OrganisationUnit rootNode;
-
-    public OrganisationUnit getRootNode()
-    {
-        return rootNode;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -118,12 +110,7 @@
         orgunitGroups = new ArrayList<OrganisationUnitGroup>(
             organisationUnitGroupService.getAllOrganisationUnitGroups() );
         Collections.sort( orgunitGroups, IdentifiableObjectNameComparator.INSTANCE );
-
-        Collection<OrganisationUnit> rootUnits = new ArrayList<OrganisationUnit>(
-            organisationUnitService.getOrganisationUnitsAtLevel( 1 ) );
-
-        rootNode = rootUnits.size() > 0 ? rootUnits.iterator().next() : new OrganisationUnit();
-
+        
         programs = programService.getAllPrograms();
 
         levels = organisationUnitService.getOrganisationUnitLevels();

=== 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-05 11:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2012-11-07 14:52:49 +0000
@@ -42,6 +42,19 @@
 					</select>
 					<input type='hidden' class='stage-object-selected hidden'>
 				</td>
+				
+			</tr>
+			<tr>
+				<td><label>$i18n.getString('from')</label></td>
+				<td>
+					<input type="text" id='startDate' name='startDate'>
+				</td>
+			</tr>
+			<tr>
+				<td><label>$i18n.getString('to')</label></td>
+				<td>
+					<input type="text" id='endDate' name='endDate'>
+				</td>
 				<td>
 					<input type="button" class='large-button' id='listBtn' value="$i18n.getString( 'list_all_events' )" onclick='validateSearchEvents( true );' style="width:140px;">
 					<input type="button" class='large-button' id='addBtn' value='$i18n.getString( "add_new" )' onclick="setFieldValue('isShowEventList', true);showAddEventForm();" style="width:140px;">
@@ -56,14 +69,6 @@
 			<col/>
 			<col/>
 			<col width="180"/>
-			<tr>
-				<td><span id="reportDateDescriptionField">$i18n.getString('report_date')</span> $i18n.getString('from_to')</td>
-				<td>
-					<input type="text" id='startDate' name='startDate' style='width:105px'>
-					<input type="text" id='endDate' name='endDate' style='width:105px'>
-				</td>
-			</tr>
-			
 			<tbody id='advancedSearchTB'>
 				<tr id='advSearchBox0'>	
 					<td id='searchingAttributeIdTD'>
@@ -99,7 +104,7 @@
 				   datePickerValid( 'executionDate', false );
 				</script> 
 		</tr>
-	</table>
+	</table> 
 	<div id='dataEntryFormDiv'></div>
 	
 	<div id='actionDiv' class="page inputCriteria" style="width:600px;height:29px;">	
@@ -151,6 +156,8 @@
 	var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
 	var i18n_specify_search_criteria = '$encoder.jsEscape( $i18n.getString( "specify_search_criteria" ) , "'")';
 	
+	var i18n_data_entry = '$encoder.jsEscape( $i18n.getString( "data_entry" ) , "'")';
+	
 	isAjax = true;
 	contentDiv = '';
 	var unSave = false;

=== 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-01 09:28:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2012-11-07 14:52:49 +0000
@@ -29,21 +29,21 @@
 
 function disableCriteriaDiv()
 {
-	jQuery('#selectDiv :input').each( function( idx, item ){
-		disable(this.id);
-	});
+	disable('listBtn');
+	disable('addBtn');
+	disable('advancedBtn');
+	disable('removeBtn');
 	jQuery('#criteriaDiv :input').each( function( idx, item ){
 		disable(this.id);
 	});
-	enable('orgunitName');
-	enable('programId');
 }
 
 function enableCriteriaDiv()
 {
-	jQuery('#selectDiv :input').each( function( idx, item ){
-		enable(this.id);
-	});
+	enable('listBtn');
+	enable('addBtn');
+	enable('advancedBtn');
+	enable('removeBtn');
 	jQuery('#criteriaDiv :input').each( function( idx, item ){
 		enable(this.id);
 	});
@@ -190,9 +190,10 @@
 	setFieldValue('isShowEventList', listAll );
 	
 	var params = '';
+	params += '&startDate=' + getFieldValue('startDate');
+	params += '&endDate=' + getFieldValue('endDate');
+		
 	if(listAll){	
-		params += '&startDate=';
-		params += '&endDate=';
 		jQuery( '#compulsoryDE option' ).each( function( i, item ){
 			var input = jQuery( item );
 			params += '&searchingValues=de_' + input.val() + '_false_';
@@ -200,8 +201,6 @@
 		hideById('advanced-search');
 	}
 	else{
-		params += '&startDate=' + getFieldValue('startDate');
-		params += '&endDate=' + getFieldValue('endDate');
 		var value = '';
 		var searchingValue = '';
 		jQuery( '#advancedSearchTB tr' ).each( function(){
@@ -294,36 +293,37 @@
 
 function showUpdateEvent( programStageInstanceId )
 {
-	hideById('selectDiv');
-	hideById('searchDiv');
-	hideById('listDiv');
 	setFieldValue('programStageInstanceId', programStageInstanceId);
-	setInnerHTML('dataEntryFormDiv','');
-	showLoader();
-	
-	$( '#dataEntryFormDiv' ).load( "dataentryform.action", 
+	$( '#dataEntryFormDiv' ).load( "viewProgramStageRecords.action", 
 		{ 
 			programStageInstanceId: programStageInstanceId
 		},function()
 		{
-			jQuery('#inputCriteriaDiv').remove();
-			hideById('mainLinkLbl');
-			showById('actionDiv');
+			showById('patientInforTB');
+			hideById('dueDateLbl');
+			hideById('dueDateField');
 			var programName = jQuery('#programId option:selected').text();
 			var programStageId = jQuery('#programId option:selected').attr('psid');
 			jQuery('.stage-object-selected').attr('psid',programStageId);
 			setInnerHTML('programName', programName );
-			
 			if( getFieldValue('completed')=='true' ){
-				disableCompletedButton( true );
+				jQuery("#inputCriteriaDiv [id=completeBtn]").attr("disabled", false);
+				jQuery("#inputCriteriaDiv [id=uncompleteBtn]").attr("disabled", true);
 			}
 			else{
-				disableCompletedButton( false );
+				jQuery("#inputCriteriaDiv [id=completeBtn]").attr("disabled", true);
+				jQuery("#inputCriteriaDiv [id=uncompleteBtn]").attr("disabled", false);
 			}
-			hideById('loaderDiv');
-			showById('dataEntryInfor');
-			showById('entryFormContainer');
-		} );
+		}).dialog(
+		{
+			title:i18n_data_entry,
+			maximize:true, 
+			closable:true,
+			modal:false,
+			overlay:{background:'#000000', opacity:0.1},
+			width:850,
+			height:500
+		});
 }
 
 function backEventList()

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm	2012-11-05 11:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm	2012-11-07 14:52:49 +0000
@@ -36,8 +36,8 @@
 					<script type="text/javascript">
 					   datePickerValid( 'executionDate', false );
 					</script>  
-				<th><label for="dueDate"> $i18n.getString( "due_date" ) &nbsp;&nbsp;&nbsp;</label></th>
-				<th><input type="text" id="dueDate" name="dueDate" value="$!format.formatDate( $programStageInstance.dueDate )" disabled="disabled">&nbsp;&nbsp;&nbsp;</th>
+				<th id="dueDateLbl"><label for="dueDate"> $i18n.getString( "due_date" ) &nbsp;&nbsp;&nbsp;</label></th>
+				<th id="dueDateField"><input type="text" id="dueDate" name="dueDate" value="$!format.formatDate( $programStageInstance.dueDate )" disabled="disabled">&nbsp;&nbsp;&nbsp;</th>
 			</tr>
 		#end
 	</table>