← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9633: Hide all fields unsed when to select anonymous program in Add/Update program form.

 

------------------------------------------------------------
revno: 9633
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-01-28 16:09:20 +0700
message:
  Hide all fields unsed when to select anonymous program in Add/Update program form.
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/program.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.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-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2013-01-28 09:09:20 +0000
@@ -52,35 +52,35 @@
 			<td></td>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<th colspan="2">$i18n.getString( "enrollment_details" )</th>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "generated_events_by_enrollment_date" )</label></td>
 			<td><input type="checkbox" id="generatedByEnrollmentDate" name="generatedByEnrollmentDate" value='true'></td>
 			<td></td>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "ignore_to_generate_overdue_events" )</label></td>
 			<td><input type="checkbox" id="ignoreOverdueEvents" name="ignoreOverdueEvents" value='true'></td>
 			<td></td>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "show_incident_date" )</label></td>
 			<td><input type="checkbox" id="displayIncidentDate" name="displayIncidentDate" value='true' checked onchange='programOnChange();'></td>
 			<td></td>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "date_of_incident_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 			<td><input style="width: 330px;" type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" class="{validate:{required:true,minlength:2}}"></td>
 			<td></td>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "date_of_enrollment_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 			<td><input style="width: 330px;" type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}"></td>
 			<td></td>
@@ -90,7 +90,7 @@
 	<tbody>
 </table>
 	
-<table>
+<table name='nonAnonymous'>
 	<colgroup>
         <col style="width:400px;"/>
 		<col/>
@@ -144,6 +144,9 @@
 			<a href="javascript:moveDownPropertyList()"><img src="../images/move_down.png"/></a><br/><br/>
 		</td>  
 	</tr>
+</table>
+
+<table>
 	<tr>
 		<td colspan='3'>
 			<input type="submit" value="$i18n.getString( 'add' )" >
@@ -151,5 +154,4 @@
 		</td>
 	</tr>
 </table>
-
 </form>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2013-01-24 13:37:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2013-01-28 09:09:20 +0000
@@ -67,6 +67,8 @@
 		hideById("selectedList");
 		jQuery("[name=displayed]").attr("disabled", true);
 		jQuery("[name=displayed]").removeAttr("checked");
+		
+		jQuery("[name=nonAnonymous]").hide();
 	}
 	else{
 		jQuery("[name=displayed]").prop("disabled", false);
@@ -76,6 +78,8 @@
 		enable('dateOfEnrollmentDescription');
 		enable("displayIncidentDate");
 		enable('ignoreOverdueEvents');
+		
+		jQuery("[name=nonAnonymous]").show();
 		if( type == 2 ){
 			disable('ignoreOverdueEvents');
 		}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js	2012-10-03 04:54:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js	2013-01-28 09:09:20 +0000
@@ -22,4 +22,5 @@
 	});
 	
 	checkValueIsExist( "name", "validateProgram.action", {id:getFieldValue('id')});
+	programOnChange();
 });	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm	2013-01-28 05:28:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm	2013-01-28 09:09:20 +0000
@@ -30,8 +30,8 @@
                 
                 <td style="text-align:center">
                   <a href="showUpdatePatientAttributeForm.action?id=$patientAttribute.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
-					<a href="javascript:translate( 'PatientAttribute', '$patientAttribute.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
-					<a href="javascript:removePatientAttribute( '$patientAttribute.id', '$encoder.jsEncode( $patientAttribute.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+				  <a href="javascript:translate( 'PatientAttribute', '$patientAttribute.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
+				  <a href="javascript:removePatientAttribute( '$patientAttribute.id', '$encoder.jsEncode( $patientAttribute.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
                   <a href="javascript:showPatientAttributeDetails( $patientAttribute.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
                 </td>
                 

=== 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-01-24 13:37:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2013-01-28 09:09:20 +0000
@@ -53,40 +53,40 @@
 		
 		<tr>
 			<td><label>$i18n.getString( "block_entry_form_after_completed" )</label></td>
-			<td><input type="checkbox" id="blockEntryForm" name="blockEntryForm" value='true'  #if( $program.blockEntryForm=='true' ) checked #end ></td>
+			<td><input type="checkbox" id="blockEntryForm" name="blockEntryForm" value='true' #if( $program.blockEntryForm=='true' ) checked #end ></td>
 			<td></td>
 		</tr>
 			
-		<tr>
+		<tr name='nonAnonymous'>
 			<th colspan="2">$i18n.getString( "enrollment_details" )</th>
 		</tr>
 		
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "generated_events_by_enrollment_date" )</label></td>
 			<td><input type="checkbox" id="generatedByEnrollmentDate" name="generatedByEnrollmentDate" value='true' #if($program.generatedByEnrollmentDate=='true') checked #end #if( $program.type!='1' ) disabled #end ></td>
 			<td></td>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "ignore_to_generate_overdue_events" )</label></td>
 			<td><input type="checkbox" id="ignoreOverdueEvents" name="ignoreOverdueEvents" value='true' #if($program.ignoreOverdueEvents=='true') checked #end #if( $program.type!='1' ) disabled #end ></td>
 			<td></td>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "show_incident_date" )</label></td>
 			<td><input type="checkbox" id="displayIncidentDate" name="displayIncidentDate" value='true' onchange='programOnChange();' #if( $program.type=='3' ) disabled #elseif($program.displayIncidentDate=='true') checked #end></td>
 			<td></td>
 		</tr>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "date_of_incident_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 			<td><input style="width: 330px;" type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$!program.dateOfIncidentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.type=='2' || $program.type=='3') disabled #end ></td>
 			<td></td>
-		</tr>
+		</tr name='nonAnonymous'>
 		
-		<tr>
+		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "date_of_enrollment_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 			<td><input style="width: 330px;" type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription"  value="$!program.dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.type=='3' ) disabled #end></td>
 			<td></td>
@@ -97,7 +97,7 @@
 	<tbody>
 	</table>
 
-	<table>
+	<table name='nonAnonymous'>
 		<colgroup>
 			<col style="width:400px;"/>
 			<col/>
@@ -165,13 +165,14 @@
 				<a href="javascript:moveDownPropertyList()"><img src="../images/move_down.png"/></a><br/><br/>
 			</td>  
 	  </tr>
-      <tr>
+    </tbody>
+  </table>  
+  <table>
+	 <tr>
       	<td colspan='3'>
 			<input type="submit" value="$i18n.getString( 'update' )">
 			<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='program.action'">
 		</td>
       </tr>
-    </tbody>
-  </table>  
-
-</form> 	
+  </table>
+</form>