← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7187: (patient) Add selectedAll and deselectedAll for Adding/Updating program-stage form.

 

------------------------------------------------------------
revno: 7187
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-06-05 13:46:05 +0700
message:
  (patient) Add selectedAll and deselectedAll for Adding/Updating program-stage form.
modified:
  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/programStage.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/style/basic.css
  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/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	2012-06-04 10:03:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm	2012-06-05 06:46:05 +0000
@@ -59,10 +59,15 @@
             <select size="15" id="availableList" name='availableList' multiple="multiple" ondblclick="selectDataElements()">
             </select>
         </td>
-        <td>         
-            <input type="button" value="&gt;" onclick="selectDataElements()" class='filterButton' /><br/>    
-            <input type="button" value="&lt;" onclick="unSelectDataElements()" class='filterButton' /><br/><br/>                    
-        <td>
+        
+		<td style="text-align:center">
+        	<input type="button" value="&gt;" class='filterButton' onclick="selectDataElements();"/><br/>
+            <input type="button" value="&lt;" class='filterButton' onclick="unSelectDataElements();"/><br/>
+			<input type="button" value="&gt;&gt;" class='filterButton' onclick="selectAllDataElements();"/><br/>
+			<input type="button" value="&lt;&lt;" class='filterButton' onclick="unSelectAllDataElements();"/>
+		</td>
+		
+		<td>
 			<div class="dataElementDiv">
 				<table>
 					<thead>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js	2012-06-04 10:03:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js	2012-06-05 06:46:05 +0000
@@ -73,6 +73,20 @@
 	});
 }
 
+
+function selectAllDataElements()
+{
+	var selectedList = jQuery("#selectedList");
+	jQuery("#availableList").children().each(function(i, item){
+		html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectDataElement( this )'><td onclick='select(this)'>" + item.text + "</td>";
+		html += "<td align='center'><input type='checkbox' name='compulsory' value='" + item.value + "'></td>";
+		html += "<td align='center'><input type='checkbox' name='allowProvided' value='" + item.value + "'></td>";
+		html += "</tr>";
+		selectedList.append( html );
+		jQuery( item ).remove();
+	});
+}
+
 function unSelectDataElements()
 {
 	var availableList = jQuery("#availableList");
@@ -86,6 +100,17 @@
 	});
 }
 
+
+function unSelectAllDataElements()
+{
+	var availableList = jQuery("#availableList");
+	jQuery("#selectedList").find("tr").each( function( i, item ){
+		item = jQuery(item);
+		availableList.append( "<option value='" + item.attr( "id" ) + "' selected='true'>" + item.find("td:first").text() + "</option>" );
+		item.remove();
+	});
+}
+
 //-----------------------------------------------------------------------------
 //Move Table Row Up and Down
 //-----------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/style/basic.css'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/style/basic.css	2012-06-04 04:06:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/style/basic.css	2012-06-05 06:46:05 +0000
@@ -27,7 +27,7 @@
 
 input.filterButton
 {
-	width: 30px;
+	width: 50px;
 	padding-left:5px;
 	padding-right:5px;
 	text-align:center;

=== 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	2012-06-04 10:03:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm	2012-06-05 06:46:05 +0000
@@ -59,9 +59,14 @@
 				<select size="15" id="availableList" multiple="multiple" ondblclick="selectDataElements( )">
 				</select>
 			</td>
-			<td valign="top" align="center">         
-				<input type="button" value="&gt;" onclick="selectDataElements()" class='filterButton' /><br/>    
-				<input type="button" value="&lt;" onclick="unSelectDataElements()" class='filterButton' /><br/><br/>                    
+			
+			<td style="text-align:center">
+				<input type="button" value="&gt;" class='filterButton' onclick="selectDataElements();"/><br/>
+				<input type="button" value="&lt;" class='filterButton' onclick="unSelectDataElements();"/><br/>
+				<input type="button" value="&gt;&gt;" class='filterButton' onclick="selectAllDataElements();"/><br/>
+				<input type="button" value="&lt;&lt;" class='filterButton' onclick="unSelectAllDataElements();"/>
+			</td>
+			
 			<td>
 				<div class="dataElementDiv">
 					<table>