← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2328: add select children/un select children for common selection tree and vm file in excel reporting

 

------------------------------------------------------------
revno: 2328
committer: Tri Tran Thanh <Tri Tran Thanh@compaq>
branch nick: trunk
timestamp: Thu 2010-10-07 15:40:58 +0700
message:
  add select children/un select children for common selection tree and vm file in excel reporting
added:
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/chart/jchartRoles.vm
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/customDataSetReport.vm
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompletedByDataSets.vm
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompletedByPeriods.vm
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompleteds.vm
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeMultipleSelect.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/AddSelectedOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/RemoveSelectedOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties


--
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-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeMultipleSelect.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeMultipleSelect.vm	2010-09-14 09:03:41 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeMultipleSelect.vm	2010-10-07 08:40:58 +0000
@@ -1,7 +1,7 @@
 <script type="text/javascript" src="../dhis-web-commons/oust/oust.js"></script>
 
 ## You don't have to use this template directly if you don't want to
-<table cellspacing=0 width="595px">
+<table cellspacing=0 width="760px">
 	<thead>
 		<tr>
 			<th colspan="2">$i18n.getString( "organisation_unit_selection_tree" )			
@@ -18,11 +18,13 @@
 						<select id="levelList" name="levelList" style="width:12em"/>
 						<input type="button" value="$i18n.getString( 'unselect_at_level' )" onclick="unSelectOrganisationUnitAtLevel()" style="width:12em"/>
 						<input type="button" value="$i18n.getString( 'unselect_all' )" onclick="unSelectAllTree()" style="width:12em"/>	
+						<input type="button" value="$i18n.getString( 'unselect_children' )" onclick="unSelectChildren()" style="width:12em"/>	
 						<br>
 						<input type="button" value="$i18n.getString( 'select_in_group' )" onclick="selectOrganisationUnitByGroup()" style="width:12em">
 						<select id="groupList" name="groupList" style="width:12em"/>
 						<input type="button" value="$i18n.getString( 'unselect_in_group' )" onclick="unSelectOrganisationUnitByGroup()" style="width:12em">	
 						<input type="button" value="$i18n.getString( 'select_all' )" onclick="selectAllTree()" style="width:12em"/>	
+						<input type="button" value="$i18n.getString( 'select_children' )" onclick="selectChildren()" style="width:12em"/>	
 						<div id="selectionTree" style="padding:5px;"></div>	
 					</div>
 				</div>
@@ -62,6 +64,24 @@
 		selectionTree.buildSelectionTree();
 	}	
 	
+	function unSelectChildren()
+	{
+		jQuery.get( '../dhis-web-commons/oust/removeorgunit.action',
+			{children: true},
+			function( xml ){
+				selectedOrganisationUnitXMLABCDEF( xml );
+			});
+	}
+	
+	function selectChildren()
+	{
+		jQuery.get( '../dhis-web-commons/oust/addorgunit.action',
+			{children: true},
+			function( xml ){
+				selectedOrganisationUnitXMLABCDEF( xml );
+			});
+	}
+	
 	function selectOrganisationUnitAtLevel()
 	{
 		jQuery.get( '../dhis-web-commons/oust/addorgunit.action',

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/AddSelectedOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/AddSelectedOrganisationUnitAction.java	2010-09-09 09:38:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/AddSelectedOrganisationUnitAction.java	2010-10-07 08:40:58 +0000
@@ -92,6 +92,13 @@
         this.level = level;
     }
 
+    private Boolean children;
+
+    public void setChildren( Boolean children )
+    {
+        this.children = children;
+    }
+
     private Integer organisationUnitGroupId;
 
     public void setOrganisationUnitGroupId( Integer organisationUnitGroupId )
@@ -134,6 +141,14 @@
                     .getMembers() );
             }
 
+            if ( children != null && children == true )
+            {
+                for ( OrganisationUnit selected : selectionTreeManager.getSelectedOrganisationUnits() )
+                {
+                    selectedUnits.addAll( organisationUnitService.getOrganisationUnitWithChildren( selected.getId() ) );
+                }
+            }
+
             selectionTreeManager.setSelectedOrganisationUnits( selectedUnits );
         }
         catch ( Exception e )

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/RemoveSelectedOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/RemoveSelectedOrganisationUnitAction.java	2010-09-09 09:38:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/RemoveSelectedOrganisationUnitAction.java	2010-10-07 08:40:58 +0000
@@ -28,6 +28,8 @@
  */
 
 import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -91,6 +93,13 @@
         this.level = level;
     }
 
+    private Boolean children;
+
+    public void setChildren( Boolean children )
+    {
+        this.children = children;
+    }
+
     private Integer organisationUnitGroupId;
 
     public void setOrganisationUnitGroupId( Integer organisationUnitGroupId )
@@ -133,6 +142,25 @@
                     .getOrganisationUnitGroup( organisationUnitGroupId ).getMembers() );
             }
 
+            if ( children != null && children == true )
+            {
+
+                Set<OrganisationUnit> selectedOrganisationUnits = new HashSet<OrganisationUnit>( selectedUnits );
+
+                for ( OrganisationUnit selected : selectedOrganisationUnits )
+                {
+                    OrganisationUnit parent = selected.getParent();
+
+                    if ( !selectedOrganisationUnits.contains( parent ) )
+                    {
+                        selectedUnits.removeAll( organisationUnitService.getOrganisationUnitWithChildren( selected
+                            .getId() ) );
+                        
+                        selectedUnits.add( selected );                      
+                    }                    
+                }
+            }
+
             selectionTreeManager.setSelectedOrganisationUnits( selectedUnits );
         }
         catch ( Exception e )

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2010-10-04 10:59:24 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2010-10-07 08:40:58 +0000
@@ -347,6 +347,8 @@
 select_in_group	= Select in group
 unselect_in_group	= Un-select in group
 organisation_unit_selection_tree	= Organisation Unit Tree Selection
+select_children	= Select children
+unselect_children	= Un-select children
 
 #-- Paging messages  ----------------------------------------------------------------------#
 no_of_pages 	= No. of pages

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties	2010-09-15 04:42:49 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties	2010-10-07 08:40:58 +0000
@@ -915,3 +915,5 @@
 select_in_group	= Ch\u1ecdn trong nh\u00f3m
 unselect_in_group	= B\u1ecf ch\u1ecdn trong nh\u00f3m
 organisation_unit_selection_tree = C\u00e2y \u0111\u01a1n v\u1ecb
+select_children	= Ch\u1ecdn c\u00e2y con
+unselect_children	= B\u1ecf ch\u1ecdn c\u00e2y con

=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/chart/jchartRoles.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/chart/jchartRoles.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/chart/jchartRoles.vm	2010-10-07 08:40:58 +0000
@@ -0,0 +1,56 @@
+<script>
+	jQuery( function(){
+		validation( 'userRole', function( form ){ form.submit()}, function(){ selectAllById( 'selectedList' ) } );		
+	});
+</script>
+<h3>$i18n.getString( "update_reportexcel_userrole" )</h3>
+
+<form id="userRole" action="updateJChartRoles.action" method="POST">
+<input type="hidden" name="id" value="$jchart.id"/>
+<table>
+	<tr>
+		<th colspan=3>$i18n.getString( "chart" )</th>
+	</tr>
+	<tr>
+		<td colspan=3>$encoder.htmlEncode( $jchart.title )</td>
+	</tr>
+	<tr>
+		<th>$i18n.getString( "available" )</th>
+		<td></td>
+		<th>$i18n.getString( "selected" )</th>
+	</tr>
+	<tr>
+		<td>
+			<select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelectedById( 'availableList', 'selectedList' )">
+            #foreach ( $userRole in $userRoles )
+              <option value="$userRole.id">$encoder.htmlEncode( $userRole.name )</option>
+            #end
+			</select>
+		</td>
+		<td>
+			<input type="button" value="&lt;" title="$i18n.getString('remove_selected')" onclick="moveSelectedById( 'selectedList', 'availableList' )"><br>
+			<input type="button" value="&gt;" title="$i18n.getString('move_selected')" onclick="moveSelectedById( 'availableList', 'selectedList' )">
+		</td>
+		<td>
+			<select id="selectedList" name="userRoles" multiple="multiple" style="min-width:20em;height:20em" class="{validate:{required:true}}" ondblclick="moveSelectedById( 'selectedList', 'availableList' )">
+			#foreach ( $userRole in $jchart.userRoles )
+              <option value="$userRole.id">$encoder.htmlEncode( $userRole.name )</option>
+            #end
+			</select>
+        </td>
+	</tr>
+</table>
+<br>
+<input type="submit" value="$i18n.getString( 'ok' )" style="width:100px"/>
+<input type="button" value="$i18n.getString( 'cancel' )"  style="width:100px" onclick="window.location = 'jcharts.action'"/>
+</form>
+<script>
+	function submitForm(){
+		selectAllById( 'selectedList' );
+		document.forms['userRole'].submit();
+	}
+	$(document).ready(function(){
+		sortList('availableList', 'ASC');
+		sortList('selectedList', 'ASC');
+	});
+</script>

=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/customDataSetReport.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/customDataSetReport.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/customDataSetReport.vm	2010-10-07 08:40:58 +0000
@@ -0,0 +1,1 @@
+$customDataEntryFormCode
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompletedByDataSets.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompletedByDataSets.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompletedByDataSets.vm	2010-10-07 08:40:58 +0000
@@ -0,0 +1,48 @@
+<table class="listTable" id="listTable">	
+	<thead>
+		<tr>
+			<th></th>
+		#foreach( $d in $dataSets )
+			<th>$encoder.htmlEncode( $d.name )</th>
+		#end
+		</tr>
+	</thead>
+	<tbody>
+	#foreach( $o in $organisationUnits )
+		<tr>
+			<td>$o.name</td>
+		#foreach( $d in $dataSets )
+			<td>
+			#if($!completedValues.get( "$o.id:$d.id" ))
+				#if($completedValues.get( "$o.id:$d.id" )!="null")
+					<a href='javascript:viewDataSetReport($d.id,$period.id,$o.id, "$period.name")'>
+						<img src="../images/view_report.png" title="View Data" align="absmiddle">
+					</a>
+					<img src="../images/check.png" alt="$i18n.getString( 'yes' )" align="absmiddle">				
+					[$completedValues.get( "$o.id:$d.id" )]
+				#end
+			#else
+				<a href='javascript:viewDataSetReport($d.id,$period.id,$o.id, "$period.name")'>
+						<img src="../images/view_report.png" title="View Data" align="absmiddle">
+				</a>
+				<img src="../images/warning.png" alt="$i18n.getString( 'no' )" align="absmiddle">
+			#end
+			</td>
+		#end
+		</tr>
+	#end
+	</tbody>
+	<tfoot>
+		<tr align="right">
+			<th></th>
+			<th colspan="$dataSets.size()-1">
+				<img src="../images/warning.png" alt="$i18n.getString( 'no' )" align="absmiddle">  Un-completed
+				&nbsp;&nbsp;&nbsp;&nbsp;
+				<img src="../images/check.png" alt="$i18n.getString( 'yes' )" align="absmiddle">  Completed
+				&nbsp;&nbsp;&nbsp;&nbsp;
+				<img src="../images/view_report.png" title="View Data" align="absmiddle">  View Data
+				
+			</th>				
+		</tr>		
+	</tfoot>
+</table>
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompletedByPeriods.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompletedByPeriods.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompletedByPeriods.vm	2010-10-07 08:40:58 +0000
@@ -0,0 +1,61 @@
+<h3>$encoder.htmlEncode( $dataSet.name )</h3>
+<table class="listTable" id="listTable">	
+	<thead>
+		<tr>
+			<th></th>
+		#foreach( $p in $periods )
+			<th>$format.formatPeriod($p)</th>
+		#end
+		</tr>
+	</thead>
+	<tbody id="list">
+	#foreach( $o in $organisationUnits )
+		<tr id="tr${o.id}">
+			<td><b>$encoder.htmlEncode( $o.name )</b></td>
+		#foreach( $p in $periods )
+			<td >
+				#if($!completedValues.get( "$o.id:$p.id" ))
+					#if($completedValues.get( "$o.id:$p.id" ) != "null" )
+						<a href='viewCustomDataSetReport.action?dataSetId=$dataSet.id&periodId=$p.id&organisationUnitId=$o.id' target="_blank">
+							<img src="../images/view_report.png" title="$i18n.getString( 'view_data' )" align="absmiddle">
+						</a>
+						#set ($percent = $completedValues.get( "$o.id:$p.id" ))
+						#if( $percent <= 100) 
+							<img src="../images/check.png" alt="$i18n.getString( 'yes' )" align="absmiddle">
+							<div style="background-color:#CCCCCC">
+							<div style="text-align: center; color: white; width: $percent%; background-color: green;">$percent%</div>
+							</div>
+						#else
+							<img src="../images/warning.png" alt="$i18n.getString( 'no' )" align="absmiddle">
+							#set ($percent = $percent/1000 )
+							<div style="background-color:#CCCCCC">
+							<div style="text-align: center; color: white; width: $percent%; background-color: green;">$percent%</div>
+							</div>
+						#end 
+					#end
+				#else
+					<a href='viewCustomDataSetReport.action?dataSetId=$dataSet.id&periodId=$p.id&organisationUnitId=$o.id' target="_blank">
+						<img src="../images/view_report.png" title="$i18n.getString( 'view_data' )" align="absmiddle">
+					</a>
+					<img src="../images/warning.png" alt="$i18n.getString( 'no' )" align="absmiddle">
+				#end
+			</td>
+		#end
+		</tr>
+	#end
+	</tbody>
+	<tfoot>
+		<tr align="right">
+			<th></th>
+			<th colspan="$periods.size()-1">
+				<img src="../images/warning.png" alt="$i18n.getString( 'no' )" align="absmiddle">$i18n.getString( "un_completed" )
+				&nbsp;&nbsp;&nbsp;&nbsp;
+				<img src="../images/check.png" alt="$i18n.getString( 'yes' )" align="absmiddle">$i18n.getString( "completed" )
+				&nbsp;&nbsp;&nbsp;&nbsp;
+				<img src="../images/view_report.png" title="View Data" align="absmiddle">$i18n.getString( "view_data" )
+				
+			</th>				
+		</tr>		
+	</tfoot>
+</table>
+

=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompleteds.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompleteds.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataSetCompleteds.vm	2010-10-07 08:40:58 +0000
@@ -0,0 +1,179 @@
+<script>
+	jQuery( function(){
+		var viewByPeriodForm = validation( 'viewByPeriodForm', function( form ){ form.submit()}, function(){ selectAllById( 'selectedPeriods' ) } );
+		var viewByDataSetForm = validation( 'viewByDataSetForm', function( form ){ form.submit()}, function(){ selectAllById( 'selectedDataSets' ) } );
+	});
+</script>
+
+<h3>$i18n.getString( "dataset_completed_report" )</h3>
+<br>
+<div id="dataSetCompletedReport">
+	<ul>
+		 <!--<li><a href="#bookmark"><span>$i18n.getString( "bookmark" )</span></a></li>-->
+         <li><a href="#view_by_periods"><span>$i18n.getString('view_by') $i18n.getString( "period" )</span></a></li>
+         <li><a href="#view_by_datasets"><span>$i18n.getString('view_by') $i18n.getString( "dataset" )</span></a></li>
+	</ul>
+	<!--
+	<div id="bookmark" style="padding:0px">
+		<table width="100%" class="listTable" id="listTable">
+			<tbody id="list">	
+				#foreach( $b in $bookmarks )
+				<tr id="tr${b.id}">
+					<td style="padding:5px">$encoder.htmlEncode( $b.description )</td>
+					<td></td>
+				</tr>
+				#end
+			</tbody>
+		</table>
+	</div>
+	-->
+	<div id="view_by_periods" style="padding:0px">
+		<form id="viewByPeriodForm" action="viewCompleteReportByPeriod.action" method="POST" target="_blank">
+		<table>
+			<tr>
+				<td>
+					<br>
+					<b>$i18n.getString( "dataset" )</b><br>
+					<select style="width:300px" id="dataSetId" name="dataSetId" onchange="getPeriodsAndOrganisationUnit(this.value)">
+					<option value="">$i18n.getString( "select")</option>
+					#foreach( $dataSet in $dataSets )
+						<option value="$dataSet.id">$encoder.htmlEncode( $dataSet.name )</option>
+					#end
+					</select>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					<b>$i18n.getString( "period" )</b><br>
+					<table>
+						<tr>
+							<td><select id="availablePeriods" style="width:270px;" multiple size=10" ondblclick="moveSelectedById( 'availablePeriods', 'selectedPeriods' )"/></td>
+							<td style="text-align:center">
+								<input type="button" value="&gt;" title="$i18n.getString('move_selected')" style="width:50px" onclick="moveSelectedById( 'availablePeriods', 'selectedPeriods' )"><br>
+								<input type="button" value="&lt;" title="$i18n.getString('move_all')" style="width:50px" onclick="moveSelectedById( 'selectedPeriods', 'availablePeriods' )"><br>		
+								<input type="button" value="&gt;&gt;" title="$i18n.getString('remove_selected')" style="width:50px" onclick="moveAllById( 'availablePeriods', 'selectedPeriods' )"><br>
+								<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="moveAllById( 'selectedPeriods', 'availablePeriods' )">
+							</td>
+							<td><select id="selectedPeriods" name="periodIds" style="width:270px;" class="{validate:{required:true}}" multiple size=10" ondblclick="moveSelectedById( 'selectedPeriods', 'availablePeriods' )"/></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>			
+				<td id="organisationUnitSelect">
+					<div style="padding-top:20px;width:400px;" id="organisationUnitContainer">
+						#organisationUnitSelectionTree( false, false, true )
+					</div>
+				</td>
+			</tr>
+			<tr>
+				<td><input type="submit" value="$i18n.getString( 'view' )"/></td>
+			</tr>	
+		</table>		
+		</form>	
+	</div>
+
+	<div id="view_by_datasets" style="padding:0px">
+		<form id="viewByDataSetForm" action="viewCompleteReportByDataSet.action" method="POST" target="_blank">
+		<table>
+			<tr>				
+				<td>
+					<br>
+					<b>$i18n.getString( "period_type" )</b><br>
+					<select id="periodType" style="width:300px" onchange="getPeriodsAndDataSets( this.value )">
+						<option value="">$i18n.getString( "select")</option>
+						#foreach( $periodType in $periodTypes )
+							<option value="$periodType.name">$i18n.getString( $periodType.name )</option>
+						#end
+					</select><br>					
+					<b>$i18n.getString( "period" )</b><br>
+					<select id="selectedPeriod" name="periodId" style="width:300px" class="{validate:{required:true}}" />					
+				</td>
+			</tr>
+			<tr>
+				<td>
+					<b>$i18n.getString( "dataset" )</b><br>
+					<table>
+						<tr>
+							<td><select id="availableDataSets" style="width:270px;" multiple size=10" ondblclick="moveSelectedById( 'availableDataSets', 'selectedDataSets' )"/></td>
+							<td style="text-align:center">
+								<input type="button" value="&gt;" title="$i18n.getString('move_selected')" style="width:50px" onclick="moveSelectedById( 'availableDataSets', 'selectedDataSets' )"><br>
+								<input type="button" value="&lt;" title="$i18n.getString('move_all')" style="width:50px" onclick="moveSelectedById( 'selectedDataSets', 'availableDataSets' )"><br>		
+								<input type="button" value="&gt;&gt;" title="$i18n.getString('remove_selected')" style="width:50px" onclick="moveAllById( 'availableDataSets', 'selectedDataSets' )"><br>
+								<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="moveAllById( 'selectedDataSets', 'availableDataSets' )">
+							</td>
+							<td><select id="selectedDataSets" name="dataSetIds" style="width:270px;" class="{validate:{required:true}}" multiple size=10" ondblclick="moveSelectedById( 'selectedDataSets', 'availableDataSets' )"/></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>				
+				<td id="organisationUnitSelect"></td>
+			</tr>
+			<tr>
+				<td><input type="submit" value="$i18n.getString( 'view' )"/></td>
+			</tr>	
+		</table>
+		</form>
+	</div>
+</div>
+
+
+
+
+<script>
+
+jQuery(function(){
+	jQuery("#dataSetCompletedReport").tabs();
+	
+	jQuery("a[href=#view_by_periods]").click( function(){
+		jQuery("#view_by_periods #organisationUnitSelect").append( jQuery("#organisationUnitContainer") );
+		selectionTreeSelection.setMultipleSelectionAllowed( true );
+	});
+	jQuery("a[href=#view_by_datasets]").click( function(){
+		jQuery("#view_by_datasets #organisationUnitSelect").append( jQuery("#organisationUnitContainer") );
+		selectionTreeSelection.setMultipleSelectionAllowed( true );		
+	});	
+	
+});
+
+function getPeriodsAndOrganisationUnit( id )
+{	
+	if( id != '' )
+	{
+		jQuery.postJSON("viewByPeriodForm.action",{id:id},function( json ){
+			var availablePeriods = jQuery( "#view_by_periods #availablePeriods" );
+			availablePeriods.empty();
+			jQuery( "#view_by_periods #selectedPeriods" ).empty();
+			jQuery.each( json.periods, function (i, item){
+				availablePeriods.append( "<option value='" + item.id + "'>" + item.name + "</option>");
+			});
+			selectionTree.buildSelectionTree();	
+		});
+	}
+}
+
+function getPeriodsAndDataSets( name )
+{
+	if( name != '' )
+	{
+		jQuery.postJSON("../dhis-web-commons-ajax-json/getPeriods.action",{name:name},function( json ){
+			var selectedPeriod = jQuery( "#view_by_datasets #selectedPeriod" );
+			selectedPeriod.empty();			
+			jQuery.each( json.periods, function (i, item){
+				selectedPeriod.append( "<option value='" + item.id + "'>" + item.name + "</option>");
+			});			
+		});
+		
+		jQuery.postJSON("../dhis-web-commons-ajax-json/getDataSets.action",{name:name},function( json ){
+			var availableDataSets = jQuery( "#view_by_datasets #availableDataSets" );
+			availableDataSets.empty();
+			jQuery( "#view_by_datasets #selectedDataSets" ).empty();		
+			jQuery.each( json.dataSets, function (i, item){
+				availableDataSets.append( "<option value='" + item.id + "'>" + item.name + "</option>");
+			});			
+		});
+	}
+}
+
+</script>