← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3146: Add filter textbox for adding/updating programStage.

 

------------------------------------------------------------
revno: 3146
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-03-24 13:04:40 +0700
message:
  Add filter textbox for adding/updating programStage.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js
  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/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-03-23 02:10:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-03-24 06:04:40 +0000
@@ -792,7 +792,7 @@
 			<param name="page">
 				/dhis-web-maintenance-patient/addProgramStageForm.vm</param>
 			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
-			<param name="javascripts">javascript/programStage.js</param>
+			<param name="javascripts">javascript/commons.js,javascript/programStage.js</param>
 			<param name="requiredAuthorities">F_PROGRAMSTAGE_ADD</param>
 		</action>
 
@@ -823,7 +823,7 @@
 			<param name="page">
 				/dhis-web-maintenance-patient/updateProgramStageForm.vm</param>
 			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
-			<param name="javascripts">javascript/programStage.js</param>
+			<param name="javascripts">javascript/commons.js,javascript/programStage.js</param>
 			<param name="requiredAuthorities">F_PROGRAMSTAGE_UPDATE</param>
 		</action>
 
@@ -1034,7 +1034,7 @@
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-maintenance-patient/addCaseAggregation.vm</param>
 			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
-			<param name="javascripts">javascript/caseaggregation.js</param>
+			<param name="javascripts">javascript/commons.js, javascript/caseaggregation.js</param>
 		</action>
 		
 		<action name="showUpdateCaseAggregationForm"
@@ -1047,7 +1047,7 @@
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-maintenance-patient/updateCaseAggregation.vm</param>
 			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
-			<param name="javascripts">javascript/caseaggregation.js</param>
+			<param name="javascripts">javascript/commons.js, javascript/caseaggregation.js</param>
 		</action>
 		
 		<action name="addCaseAggregation"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm	2011-01-12 02:42:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm	2011-03-24 06:04:40 +0000
@@ -112,12 +112,12 @@
 			</tr>
 			<tr>
 				<td>
-					<input type='text' style="min-width:19.8em" onkeyup="filterDE(event, this.value);">
+					<input type='text' style="min-width:19.8em" onkeyup="filterDE(event, this.value, 'programstageDE');">
 				</td>
 			</tr>
 			<tr>
 				<td>
-					<select id="programstageDE" name="programstageDE" size="5" style="width:20em" ondblclick="insertInfo(this);">
+					<select id="programstageDE" name="programstageDE" size="5" style="width:20em; height: 6em" ondblclick="insertInfo(this);">
 					</select>
 				</td>
 			</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm	2011-01-20 15:25:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm	2011-03-24 06:04:40 +0000
@@ -72,9 +72,17 @@
     </thead>
   
     <tbody>
+	 <tr>
+		<td>
+			<input type='text' style="width:29.5em" onkeyup="filterDE(event, this.value, 'availableList');">
+		</td>
+		<td></td>
+		<td></td>
+	 </tr>
+	 
       <tr>
         <td>
-            <select size="15" id="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="selectDataElements( )">
+            <select size="15" id="availableList" multiple="multiple" style="width:30em;height:20em" ondblclick="selectDataElements( )">
                 #foreach ( $dataElement in $dataElements )
                     <option value="$dataElement.id">$encoder.htmlEncode( $dataElement.name )</option>
                 #end                

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js	2011-01-12 02:42:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js	2011-03-24 06:04:40 +0000
@@ -49,36 +49,6 @@
 // Get Program Stages
 //------------------------------------------------------------------------------
 
-function filterDE( event, value )
-{
-  var dataElementList = document.getElementById( 'programstageDE' );
-  
-  for ( var index = 0; index < dataElementList.options.length; index++ )
-    {
-		var option = dataElementList.options[index];
-		
-		if(value.length == 0 )
-		{
-			option.style.display = "block";
-		}
-		else
-		{
-			if (option.text.toLowerCase().indexOf( value.toLowerCase() ) != -1 )
-			{
-				option.style.display = "block";
-			}
-			else
-			{
-				option.style.display = "none";
-			}
-		}
-    }	    
-}
-
-//------------------------------------------------------------------------------
-// Get Program Stages
-//------------------------------------------------------------------------------
-
 function getProgramStages()
 {
   var program = document.getElementById( 'program' );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js	2011-01-20 02:12:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js	2011-03-24 06:04:40 +0000
@@ -51,4 +51,33 @@
 	{
 		hideById('deathDateTR');
 	}
-}
\ No newline at end of file
+}
+
+//------------------------------------------------------------------------------
+// Filter data-element
+//------------------------------------------------------------------------------
+
+function filterDE( event, value, fieldName )
+{
+	var field = byId(fieldName);
+	for ( var index = 0; index < field.options.length; index++ )
+    {
+		var option = field.options[index];
+		
+		if(value.length == 0 )
+		{
+			option.style.display = "block";
+		}
+		else
+		{
+			if (option.text.toLowerCase().indexOf( value.toLowerCase() ) != -1 )
+			{
+				option.style.display = "block";
+			}
+			else
+			{
+				option.style.display = "none";
+			}
+		}
+    }	    
+}

=== 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	2010-10-20 07:16:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm	2011-03-24 06:04:40 +0000
@@ -76,9 +76,18 @@
     </thead>
 	
 	<tbody>
+	 
+	<tr>
+		<td>
+			<input type='text' style="width:29.5em" onkeyup="filterDE(event, this.value, 'availableList');">
+		</td>
+		<td></td>
+		<td></td>
+	 </tr>
+	 
       <tr>
         <td>
-            <select size="15" id="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="selectDataElements( )">
+            <select size="15" id="availableList" multiple="multiple" style="width:30em;height:20em" ondblclick="selectDataElements( )">
                 #foreach ( $dataElement in $dataElements )
                     <option value="$dataElement.id">$encoder.htmlEncode( $dataElement.name )</option>
                 #end