← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3277: Cleanup of ous templates

 

------------------------------------------------------------
revno: 3277
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-04-04 18:47:24 +0200
message:
  Cleanup of ous templates
removed:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTree.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTreeMultipleSelect.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTreeSingleSelect.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectedOrgunitError.vm
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeSelect.js
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTree.vm
  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/selectionTreeSingleSelect.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml


--
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
=== removed directory 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust'
=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTree.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTree.js	2011-03-14 09:46:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTree.js	1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-jQuery(document).ready(function()
-{
-	selectionTreeSelection.setMultipleSelectionAllowed(true);
-	selectionTree.clearSelectedOrganisationUnits();
-	selectionTree.buildSelectionTree();
-});

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTreeMultipleSelect.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTreeMultipleSelect.js	2011-03-14 09:46:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTreeMultipleSelect.js	1970-01-01 00:00:00 +0000
@@ -1,123 +0,0 @@
-var selectedOrganisationUnitListABCDEF;
-
-function addSelectedOrganisationUnitABCDEF( id )
-{
-	selectedOrganisationUnitListABCDEF.append('<option value="' + id + ' selected="selected">' + id + '</option>');
-}
-
-function selectOrganisationUnitABCDEF( ids )
-{
-	selectedOrganisationUnitListABCDEF.empty();
-
-	jQuery.each(ids, function( i, item )
-	{
-		selectedOrganisationUnitListABCDEF.append('<option value="' + item + ' selected="selected">' + item
-				+ '</option>');
-	});
-	byId('treeSelectedId').selectedIndex = 0;
-}
-
-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', {
-		level : getFieldValue('levelList')
-	}, function( xml )
-	{
-		selectedOrganisationUnitXMLABCDEF(xml);
-	});
-}
-
-function unSelectOrganisationUnitAtLevel()
-{
-	jQuery.get('../dhis-web-commons/oust/removeorgunit.action', {
-		level : getFieldValue('levelList')
-	}, function( xml )
-	{
-		selectedOrganisationUnitXMLABCDEF(xml);
-	});
-}
-
-function unSelectAllTree()
-{
-	jQuery.get('../dhis-web-commons/oust/clearSelectedOrganisationUnits.action', function( xml )
-	{
-		selectedOrganisationUnitXMLABCDEF(xml);
-	});
-}
-
-function selectAllTree()
-{
-	jQuery.get('../dhis-web-commons/oust/selectallorgunit.action', function( xml )
-	{
-		selectedOrganisationUnitXMLABCDEF(xml);
-	});
-}
-
-function selectOrganisationUnitByGroup()
-{
-	jQuery.get('../dhis-web-commons/oust/addorgunit.action', {
-		organisationUnitGroupId : getFieldValue('groupList')
-	}, function( xml )
-	{
-		selectedOrganisationUnitXMLABCDEF(xml);
-	});
-}
-
-function unSelectOrganisationUnitByGroup()
-{
-	jQuery.get('../dhis-web-commons/oust/removeorgunit.action', {
-		organisationUnitGroupId : getFieldValue('groupList')
-	}, function( xml )
-	{
-		selectedOrganisationUnitXMLABCDEF(xml);
-	});
-}
-
-function loadOrganisationUnitLevel()
-{
-	jQuery.getJSON('../dhis-web-commons-ajax-json/getOrganisationUnitLevels.action', function( json )
-	{
-		var levels = jQuery("#levelList");
-		levels.empty();
-		jQuery.each(json.levels, function( i, item )
-		{
-			levels.append('<option value="' + item.level + '">' + item.name + '</option>');
-		});
-		jQuery("#selectionTreeContainer").fadeIn();
-	});
-}
-
-function loadOrganisationUnitGroup()
-{
-	jQuery.getJSON('../dhis-web-commons-ajax-json/getOrganisationUnitGroups.action', function( json )
-	{
-		var groups = jQuery("#groupList");
-		groups.empty();
-		jQuery.each(json.organisationUnitGroups, function( i, item )
-		{
-			groups.append('<option value="' + item.id + '">' + item.name + '</option>');
-		});
-
-		loadOrganisationUnitLevel();
-	});
-}

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTreeSingleSelect.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTreeSingleSelect.js	2011-04-04 15:49:50 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/oust/selectionTreeSingleSelect.js	1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
-
-var selectedOrganisationUnitListABCDEF;
-
-function addSelectedOrganisationUnitABCDEF( id )
-{
-	selectedOrganisationUnitListABCDEF.append( '<option value="' + id + ' selected="selected">' + id + '</option>');
-}	
-
-function selectOrganisationUnitABCDEF( ids )
-{
-	selectedOrganisationUnitListABCDEF.empty();
-	
-	jQuery.each( ids, function(i, item ) {
-		selectedOrganisationUnitListABCDEF.append( '<option value="' + item + ' selected="selected">' + item + '</option>');
-	});
-}

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js	2010-12-13 21:21:33 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js	2011-04-04 16:47:24 +0000
@@ -274,8 +274,9 @@
             linkTag.className = 'selected';
 			selectedOrganisationUnit.push( childId );
 			
-			if ( typeof (window.addSelectedOrganisationUnitABCDEF) == 'function') { 
-				addSelectedOrganisationUnitABCDEF( childId );// This code is completely ridiculous and must be removed
+			if ( typeof ( window.addSelectedOrganisationUnit__ ) == 'function' )
+			{ 
+				addSelectedOrganisationUnit__( childId );// This code is bad and must be removed
 			} 
         }
 

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectedOrgunitError.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectedOrgunitError.vm	2010-09-15 04:42:49 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectedOrgunitError.vm	1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-$encoder.htmlEncode( $i18n.getString( "error_occurred" ) )
-
-#if ( !$selectedUnit )
-	<br/>
-	<br/>
-	$encoder.htmlEncode( $i18n.getString( "select_organisationunit" ) ) 
-#end
-
-<a href="javascript: history.go(-1)">$encoder.htmlEncode( $i18n.getString( "back" ) )</a><br/>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTree.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTree.vm	2011-03-14 09:46:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTree.vm	2011-04-04 16:47:24 +0000
@@ -1,4 +1,10 @@
+<script type="text/javascript">
+jQuery(document).ready(function()
+{
+	selectionTreeSelection.setMultipleSelectionAllowed(true);
+	selectionTree.clearSelectedOrganisationUnits();
+	selectionTree.buildSelectionTree();
+});
+</script>
 
-## You don't have to use this template directly if you don't want to
-<script type="text/javascript" src="../dhis-web-commons/javascripts/oust/selectionTree.js"></script>
 <div id="selectionTree"></div>

=== 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	2011-04-04 15:49:50 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeMultipleSelect.vm	2011-04-04 16:47:24 +0000
@@ -1,34 +1,35 @@
 <script type="text/javascript" src="../dhis-web-commons/oust/oust.js"></script>
-<script type="text/javascript" src="../dhis-web-commons/javascripts/oust/selectionTreeMultipleSelect.js"></script>
+<script type="text/javascript" src="../dhis-web-commons/oust/selectionTreeSelect.js"></script>
 <script type="text/javascript">
-jQuery(document).ready( function(){		
+jQuery(document).ready( function()
+{		
 	loadOrganisationUnitGroup();
 	selectionTreeSelection.setMultipleSelectionAllowed( true );
-	selectedOrganisationUnitListABCDEF = jQuery( "#treeSelectedId" );
+	selectedOrganisationUnitList__ = jQuery( "#treeSelectedId" );
 	#if( $required )
-		selectionTreeSelection.setListenerFunction( selectOrganisationUnitABCDEF );
+	selectionTreeSelection.setListenerFunction( selectOrganisationUnit__ );
 	#end
 	#if( $cleanAll )
-		selectionTree.clearSelectedOrganisationUnits();
+	selectionTree.clearSelectedOrganisationUnits();
 	#end
 	selectionTree.buildSelectionTree();
 });
 
-function selectedOrganisationUnitXMLABCDEF( xml )
+function selectedOrganisationUnitXML__( xml )
 {		
 	#if( $required )
-		selectedOrganisationUnitListABCDEF.empty();
+	selectedOrganisationUnitList__.empty();
 
-		jQuery.each( jQuery( xml ).find( 'unitId'), function(i, item) {
-			id = item.firstChild.nodeValue;
-			selectedOrganisationUnitListABCDEF.append( '<option value="' + id + ' selected="selected">' + id + '</option>');
-		});
+	jQuery.each( jQuery( xml ).find( 'unitId' ), function( i, item ) {
+		id = item.firstChild.nodeValue;
+		selectedOrganisationUnitList__.append( '<option value="' + id + ' selected="selected">' + id + '</option>' );
+	});
 	#end
 	selectionTree.buildSelectionTree();
 }
 </script>
 
-<table cellspacing=0 width="620px">
+<table cellspacing=0 width="495px">
 	<thead>
 		<tr>
 			<th colspan="2">$i18n.getString( "organisation_unit_selection_tree" )			
@@ -39,18 +40,15 @@
 	<tbody>
 		<tr>
 			<td>
-				<div style="height:360px;width:100%;background-image:url( ../images/loading.png );background-repeat:no-repeat">	
+				<div style="width:100%;background-image:url( ../images/loading.png );background-repeat:no-repeat">	
 					<div id="selectionTreeContainer" style="display:none;">
 						<input type="button" value="$i18n.getString( 'select_at_level' )" onclick="selectOrganisationUnitAtLevel()" style="width:10em"/>
 						<select id="levelList" name="levelList" style="width:10em"/>
 						<input type="button" value="$i18n.getString( 'unselect_at_level' )" onclick="unSelectOrganisationUnitAtLevel()" style="width:10em"/>
-						<input type="button" value="$i18n.getString( 'unselect_all' )" onclick="unSelectAllTree()" style="width:10em"/>	
-						<input type="button" value="$i18n.getString( 'unselect_children' )" onclick="unSelectChildren()" style="width:10em"/>	
-						<br>
+						<input type="button" value="$i18n.getString( 'unselect_all' )" onclick="unSelectAllTree()" style="width:10em"/><br>
 						<input type="button" value="$i18n.getString( 'select_in_group' )" onclick="selectOrganisationUnitByGroup()" style="width:10em">
 						<select id="groupList" name="groupList" style="width:10em"/>
 						<input type="button" value="$i18n.getString( 'unselect_in_group' )" onclick="unSelectOrganisationUnitByGroup()" style="width:10em">	
-						<input type="button" value="$i18n.getString( 'select_all' )" onclick="selectAllTree()" style="width:10em"/>	
 						<input type="button" value="$i18n.getString( 'select_children' )" onclick="selectChildren()" style="width:10em"/>	
 						<div id="selectionTree" style="padding:5px;width:100%"></div>
 					</div>

=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeSelect.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeSelect.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeSelect.js	2011-04-04 16:47:24 +0000
@@ -0,0 +1,123 @@
+var selectedOrganisationUnitList__;
+
+function addSelectedOrganisationUnit__( id )
+{
+	selectedOrganisationUnitList__.append('<option value="' + id + ' selected="selected">' + id + '</option>');
+}
+
+function selectOrganisationUnit__( ids )
+{
+	selectedOrganisationUnitList__.empty();
+
+	jQuery.each(ids, function( i, item )
+	{
+		selectedOrganisationUnitList__.append('<option value="' + item + ' selected="selected">' + item	+ '</option>');
+	});
+	
+	byId('treeSelectedId').selectedIndex = 0;
+}
+
+function unSelectChildren()
+{
+	jQuery.get('../dhis-web-commons/oust/removeorgunit.action', {
+		children : true
+	}, function( xml )
+	{
+		selectedOrganisationUnitXML__(xml);
+	});
+}
+
+function selectChildren()
+{
+	jQuery.get('../dhis-web-commons/oust/addorgunit.action', {
+		children : true
+	}, function( xml )
+	{
+		selectedOrganisationUnitXML__(xml);
+	});
+}
+
+function selectOrganisationUnitAtLevel()
+{
+	jQuery.get('../dhis-web-commons/oust/addorgunit.action', {
+		level : getFieldValue('levelList')
+	}, function( xml )
+	{
+		selectedOrganisationUnitXML__(xml);
+	});
+}
+
+function unSelectOrganisationUnitAtLevel()
+{
+	jQuery.get('../dhis-web-commons/oust/removeorgunit.action', {
+		level : getFieldValue('levelList')
+	}, function( xml )
+	{
+		selectedOrganisationUnitXML__(xml);
+	});
+}
+
+function unSelectAllTree()
+{
+	jQuery.get('../dhis-web-commons/oust/clearSelectedOrganisationUnits.action', function( xml )
+	{
+		selectedOrganisationUnitXML__(xml);
+	});
+}
+
+function selectAllTree()
+{
+	jQuery.get('../dhis-web-commons/oust/selectallorgunit.action', function( xml )
+	{
+		selectedOrganisationUnitXML__(xml);
+	});
+}
+
+function selectOrganisationUnitByGroup()
+{
+	jQuery.get('../dhis-web-commons/oust/addorgunit.action', {
+		organisationUnitGroupId : getFieldValue('groupList')
+	}, function( xml )
+	{
+		selectedOrganisationUnitXML__(xml);
+	});
+}
+
+function unSelectOrganisationUnitByGroup()
+{
+	jQuery.get('../dhis-web-commons/oust/removeorgunit.action', {
+		organisationUnitGroupId : getFieldValue('groupList')
+	}, function( xml )
+	{
+		selectedOrganisationUnitXML__(xml);
+	});
+}
+
+function loadOrganisationUnitLevel()
+{
+	jQuery.getJSON('../dhis-web-commons-ajax-json/getOrganisationUnitLevels.action', function( json )
+	{
+		var levels = jQuery("#levelList");
+		levels.empty();
+		jQuery.each(json.levels, function( i, item )
+		{
+			levels.append('<option value="' + item.level + '">' + item.name + '</option>');
+		});
+		jQuery("#selectionTreeContainer").fadeIn();
+	});
+}
+
+function loadOrganisationUnitGroup()
+{
+	jQuery.getJSON('../dhis-web-commons-ajax-json/getOrganisationUnitGroups.action', function( json )
+	{
+		var groups = jQuery("#groupList");
+		groups.empty();
+		jQuery.each(json.organisationUnitGroups, function( i, item )
+		{
+			groups.append('<option value="' + item.id + '">' + item.name + '</option>');
+		});
+
+		loadOrganisationUnitLevel();
+	});
+}

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeSingleSelect.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeSingleSelect.vm	2011-04-04 15:49:50 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/selectionTreeSingleSelect.vm	2011-04-04 16:47:24 +0000
@@ -1,23 +1,21 @@
 <script type="text/javascript" src="../dhis-web-commons/oust/oust.js"></script>
-<script type="text/javascript" src="../dhis-web-commons/javascripts/oust/selectionTreeSingleSelect.js"></script>
+<script type="text/javascript" src="../dhis-web-commons/oust/selectionTreeSelect.js"></script>
 <script type="text/javascript">
 jQuery(document).ready( function()
 {
 	selectionTreeSelection.setMultipleSelectionAllowed( false );
-	selectedOrganisationUnitListABCDEF = jQuery( "#treeSelectedId" );
-
+	selectedOrganisationUnitList__ = jQuery( "#treeSelectedId" );
 	#if( $required )
-		selectionTreeSelection.setListenerFunction( selectOrganisationUnitABCDEF );
+	selectionTreeSelection.setListenerFunction( selectOrganisationUnit__ );
 	#end
 	#if( $cleanAll )						
-		selectionTree.clearSelectedOrganisationUnits();			
-	#end	
-
+	selectionTree.clearSelectedOrganisationUnits();			
+	#end
 	selectionTree.buildSelectionTree();
 });
 </script>
 
-<table cellspacing=0 width="620px">
+<table cellspacing=0 width="495px">
 	<thead>
 		<tr>
 			<th colspan="2">$i18n.getString( "organisation_unit_selection_tree" )

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2011-04-04 15:49:50 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2011-04-04 16:47:24 +0000
@@ -106,7 +106,7 @@
 </li>
 #end
 
-#macro( organisationUnitSelectionTree $cleanAll $multipleSelectionAllowed $requied )
+#macro( organisationUnitSelectionTree $cleanAll $multipleSelectionAllowed $required )
 #if( $multipleSelectionAllowed )
 	#parse( "/dhis-web-commons/oust/selectionTreeMultipleSelect.vm" )
 #else

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2011-03-29 07:05:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2011-04-04 16:47:24 +0000
@@ -194,7 +194,7 @@
 		<action name="searchResult"
 			class="org.hisp.dhis.dataadmin.action.databrowser.DataBrowserAction">
 			<result name="success" type="velocity">/main.vm</result>
-			<result name="error" type="redirect">error.action</result>
+			<result name="error" type="velocity">/main.vm</result>
 			<param name="page">
 				/dhis-web-maintenance-dataadmin/dataBrowserResult.vm</param>
 			<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>