← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1390: Work in progress on ajaxified delete functions

 

------------------------------------------------------------
revno: 1390
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-02-04 09:29:27 +0100
message:
  Work in progress on ajaxified delete functions
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/organisationUnitGroup.js
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/popup.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.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-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js	2010-02-03 16:07:25 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js	2010-02-04 08:29:27 +0000
@@ -1,4 +1,11 @@
 
+$( document ).ready( function(){
+
+$( "table.listTable tbody tr:odd" ).addClass( "listAlternateRow" );
+$( "table.listTable tbody tr:even" ).addClass( "listRow" );
+
+});
+
 /**
  * Redirects to the translate GUI.
  * 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2010-01-19 07:28:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2010-02-04 08:29:27 +0000
@@ -14,9 +14,9 @@
 	
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         
+    <script type="text/javascript" src="../dhis-web-commons/util/jquery.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/util/commons.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/util/lists.js"></script>
-    <script type="text/javascript" src="../dhis-web-commons/util/jquery.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/css/${stylesheetDirectory}/dom.js"></script>
     <script type="text/javascript" src="../main.js"></script>
     <script type="text/javascript" src="../menu.js"></script>

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/popup.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/popup.vm	2009-12-14 17:40:23 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/popup.vm	2010-02-04 08:29:27 +0000
@@ -14,9 +14,9 @@
       <link rel="stylesheet" type="text/css" href="$stylesheet">
 	#end
 	
+    <script type="text/javascript" src="../dhis-web-commons/util/jquery.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/util/commons.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/util/lists.js"></script>
-    <script type="text/javascript" src="../dhis-web-commons/util/jquery.js"></script>
     
   </head>
   

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm	2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm	2010-02-04 08:29:27 +0000
@@ -19,20 +19,13 @@
 					<th colspan="3">$i18n.getString( "operations" )</th>
 				</tr>
 				<tbody id="list">
-				#set( $mark = false )
-				#set( $info = false )
 				#foreach( $dataDictionary in $dataDictionaries )
-				<tr>
-					<td#alternate( $mark )>$encoder.htmlEncode( $dataDictionary.name )</td>
-					<td style="text-align:center"#alternate( $mark )><a href="showUpdateDataDictionaryForm.action?id=$dataDictionary.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:removeDataDictionary( $dataDictionary.id, '$encoder.jsEncode( $dataDictionary.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:showDataDictionaryDetails( $dataDictionary.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+				<tr id="tr${dataDictionary.id}">
+					<td>$encoder.htmlEncode( $dataDictionary.name )</td>
+					<td style="text-align:center"><a href="showUpdateDataDictionaryForm.action?id=$dataDictionary.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+					<td style="text-align:center"><a href="javascript:removeDataDictionary( $dataDictionary.id, '$encoder.jsEncode( $dataDictionary.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+					<td style="text-align:center"><a href="javascript:showDataDictionaryDetails( $dataDictionary.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
 				</tr>
-					#if( $mark )
-						#set( $mark = false )
-					#else
-						#set( $mark = true )
-					#end
 				#end
 				</tbody>
 			</table>
@@ -55,7 +48,7 @@
 
 <script type="text/javascript">
 	var i18n_adding_datadictionary_failed = '$encoder.jsEscape( $i18n.getString( "adding_datadictionary_failed" ), "'")';
-	i18n_updating_datadictionary_failed = '$encoder.jsEscape( $i18n.getString( "updating_datadictionary_failed" ), "'")';
+	var i18n_updating_datadictionary_failed = '$encoder.jsEscape( $i18n.getString( "updating_datadictionary_failed" ), "'")';
 	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_data_dictionary" ), "'")';
 	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';	
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2009-11-07 14:09:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2010-02-04 08:29:27 +0000
@@ -55,27 +55,21 @@
 					<th colspan="5">$i18n.getString( "operations" )</th>
 				</tr>
 				<tbody id="list">
-				#set( $mark = false )
 				#foreach( $dataElement in $dataElements )
-				<tr>
-					<td colspan="3"#alternate( $mark )>$encoder.htmlEncode( $dataElement.name )</td>
+				<tr id="tr${dataElement.id}">
+					<td colspan="3">$encoder.htmlEncode( $dataElement.name )</td>
 					#if ( $dataDictionaryMode == "extended" )
-					<td style="text-align:center"#alternate( $mark )><a href="showUpdateExtendedDataElementForm.action?id=$dataElement.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+					<td style="text-align:center"><a href="showUpdateExtendedDataElementForm.action?id=$dataElement.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
 					#else
-					<td style="text-align:center"#alternate( $mark )><a href="showUpdateDataElementForm.action?id=$dataElement.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+					<td style="text-align:center"><a href="showUpdateDataElementForm.action?id=$dataElement.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
 					#end
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:translate( 'DataElement', '$dataElement.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:removeDataElement( $dataElement.id, '$encoder.jsEncode( $dataElement.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:showDataElementDetails( $dataElement.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+					<td style="text-align:center"><a href="javascript:translate( 'DataElement', '$dataElement.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a></td>
+					<td style="text-align:center"><a href="javascript:removeDataElement( $dataElement.id, '$encoder.jsEncode( $dataElement.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+					<td style="text-align:center"><a href="javascript:showDataElementDetails( $dataElement.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
 					#if ( $forumIntegration )
-					<td style="text-align:center"#alternate( $mark )><a href="$dataElement.url" title="$i18n.getString( "forum" )" target="_blank"><img src="../images/forum.png" alt="$i18n.getString( "forum" )"></a></td>
+					<td style="text-align:center"><a href="$dataElement.url" title="$i18n.getString( "forum" )" target="_blank"><img src="../images/forum.png" alt="$i18n.getString( "forum" )"></a></td>
 					#end
 				</tr>
-					#if( $mark )
-						#set( $mark = false )
-					#else
-						#set( $mark = true )
-					#end
 				#end
 				</tbody>
 			</table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm	2009-11-04 06:39:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm	2010-02-04 08:29:27 +0000
@@ -17,25 +17,18 @@
 					<th>$i18n.getString( "name" )</th>
 					<th width="150px">$i18n.getString( "operations" )</th>
 				</tr>
-				<tbody id="list">		
-					#set( $mark = false )
+				<tbody id="list">
 					#foreach( $dataElementGroupSet in $dataElementGroupSets )
-					<tr>
-						<td#alternate( $mark )>$encoder.htmlEncode( $dataElementGroupSet.name )</td>
-						<td style="text-align:center"#alternate( $mark )>
+					<tr id="tr${dataElementGroupSet.id}">
+						<td>$encoder.htmlEncode( $dataElementGroupSet.name )</td>
+						<td style="text-align:center">
 							<a href="openUpdateDataElementGroupSet.action?id=$dataElementGroupSet.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
 							<a href="javascript:translate( 'DataElementGroupSet', '$dataElementGroupSet.id' )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a>
 							<a href="javascript:deleteDataElementGroupSet( $dataElementGroupSet.id, '$encoder.jsEncode( $dataElementGroupSet.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
 							<a href="javascript:showDataElementGroupSetDetails( $dataElementGroupSet.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
 						</td>
 					</tr>
-						#if( $mark )
-							#set( $mark = false )
-						#else
-							#set( $mark = true )
-						#end
-					#end					
-				
+					#end
 				</tbody>
 			</table>	
 		</td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm	2009-11-03 13:11:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm	2010-02-04 08:29:27 +0000
@@ -50,24 +50,18 @@
 					<th colspan="4">$i18n.getString( "operations" )</th>
 				</tr>
 				<tbody id="list">
-				#set( $mark = false )
 				#foreach( $indicator in $indicators )
-				<tr>
-					<td colspan="3"#alternate( $mark )>$encoder.htmlEncode( $indicator.name )</td>
+				<tr id="tr${indicator.id}">
+					<td colspan="3">$encoder.htmlEncode( $indicator.name )</td>
 					#if ( $dataDictionaryMode == "extended" )
-						<td style="text-align:center"#alternate( $mark )><a href="showUpdateExtendedIndicatorForm.action?id=$indicator.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+						<td style="text-align:center"><a href="showUpdateExtendedIndicatorForm.action?id=$indicator.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
 					#else
-						<td style="text-align:center"#alternate( $mark )><a href="showUpdateIndicatorForm.action?id=$indicator.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+						<td style="text-align:center"><a href="showUpdateIndicatorForm.action?id=$indicator.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
 					#end
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:translate( 'Indicator', '$indicator.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:removeIndicator( $indicator.id, '$encoder.jsEncode( $indicator.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:showIndicatorDetails( $indicator.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+					<td style="text-align:center"><a href="javascript:translate( 'Indicator', '$indicator.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a></td>
+					<td style="text-align:center"><a href="javascript:removeIndicator( $indicator.id, '$encoder.jsEncode( $indicator.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+					<td style="text-align:center"><a href="javascript:showIndicatorDetails( $indicator.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
 				</tr>
-					#if( $mark )
-						#set( $mark = false )
-					#else
-						#set( $mark = true )
-					#end
 				#end
 				</tbody>
 			</table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm	2009-11-02 13:07:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm	2010-02-04 08:29:27 +0000
@@ -20,20 +20,14 @@
 					<th colspan="4">$i18n.getString( "operations" )</th>
 				</tr>
 				<tbody id="list">
-				#set( $mark = false )
 				#foreach( $indicatorGroup in $indicatorGroups )
-				<tr>
-					<td#alternate( $mark )>$encoder.htmlEncode( $indicatorGroup.name )</td>
-					<td style="text-align:center"#alternate( $mark )><a href="showUpdateIndicatorGroupForm.action?id=$indicatorGroup.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:translate( 'IndicatorGroup', '$indicatorGroup.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a></td>					
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:removeIndicatorGroup( $indicatorGroup.id, '$encoder.jsEncode( $indicatorGroup.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:showIndicatorGroupDetails( $indicatorGroup.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+				<tr id="tr${indicatorGroup.id}">
+					<td>$encoder.htmlEncode( $indicatorGroup.name )</td>
+					<td style="text-align:center"><a href="showUpdateIndicatorGroupForm.action?id=$indicatorGroup.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+					<td style="text-align:center"><a href="javascript:translate( 'IndicatorGroup', '$indicatorGroup.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a></td>					
+					<td style="text-align:center"><a href="javascript:removeIndicatorGroup( $indicatorGroup.id, '$encoder.jsEncode( $indicatorGroup.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+					<td style="text-align:center"><a href="javascript:showIndicatorGroupDetails( $indicatorGroup.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
 				</tr>
-					#if( $mark )
-						#set( $mark = false )
-					#else
-						#set( $mark = true )
-					#end
 				#end
 				</tbody>
 			</table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm	2009-11-04 06:39:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm	2010-02-04 08:29:27 +0000
@@ -17,25 +17,18 @@
 					<th>$i18n.getString( "name" )</th>
 					<th width="150px">$i18n.getString( "operations" )</th>
 				</tr>
-				<tbody id="list">		
-					#set( $mark = false )
+				<tbody id="list">
 					#foreach( $indicatorGroupSet in $indicatorGroupSets )
-					<tr>
-						<td#alternate( $mark )>$encoder.htmlEncode( $indicatorGroupSet.name )</td>
-						<td style="text-align:center"#alternate( $mark )>
+					<tr id="tr${indicatorGroupSet.id}">
+						<td>$encoder.htmlEncode( $indicatorGroupSet.name )</td>
+						<td style="text-align:center">
 							<a href="openUpdateIndicatorGroupSet.action?id=$indicatorGroupSet.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
 							<a href="javascript:translate( 'IndicatorGroupSet', '$indicatorGroupSet.id' )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a>
 							<a href="javascript:deleteIndicatorGroupSet( $indicatorGroupSet.id, '$encoder.jsEncode( $indicatorGroupSet.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
 							<a href="javascript:showIndicatorGroupSetDetails( $indicatorGroupSet.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
 						</td>
 					</tr>
-						#if( $mark )
-							#set( $mark = false )
-						#else
-							#set( $mark = true )
-						#end
-					#end					
-				
+					#end
 				</tbody>
 			</table>	
 		</td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm	2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm	2010-02-04 08:29:27 +0000
@@ -20,20 +20,14 @@
 					<th colspan="4">$i18n.getString( "operations" )</th>
 				</tr>
 				<tbody id="list">
-				#set( $mark = false )
 				#foreach( $indicatorType in $indicatorTypes )
-				<tr>
-					<td#alternate( $mark )>$encoder.htmlEncode( $indicatorType.name )</td>
-					<td style="text-align:center"#alternate( $mark )><a href="showUpdateIndicatorTypeForm.action?id=$indicatorType.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:translate( 'IndicatorType', '$indicatorType.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:removeIndicatorType( $indicatorType.id, '$encoder.jsEncode( $indicatorType.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
-					<td style="text-align:center"#alternate( $mark )><a href="javascript:showIndicatorTypeDetails( $indicatorType.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+				<tr id="tr${indicatorType.id}">
+					<td>$encoder.htmlEncode( $indicatorType.name )</td>
+					<td style="text-align:center"><a href="showUpdateIndicatorTypeForm.action?id=$indicatorType.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+					<td style="text-align:center"><a href="javascript:translate( 'IndicatorType', '$indicatorType.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a></td>
+					<td style="text-align:center"><a href="javascript:removeIndicatorType( $indicatorType.id, '$encoder.jsEncode( $indicatorType.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+					<td style="text-align:center"><a href="javascript:showIndicatorTypeDetails( $indicatorType.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
 				</tr>
-					#if( $mark )
-						#set( $mark = false )
-					#else
-						#set( $mark = true )
-					#end
 				#end
 				</tbody>
 			</table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js	2009-10-20 12:49:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js	2010-02-04 08:29:27 +0000
@@ -21,12 +21,7 @@
 
 function removeDataElementCategoryCombo( categoryComboId, categoryComboName )
 {
-    var result = window.confirm( i18n_confirm_delete + '\n\n' + categoryComboName );
-
-    if ( result )
-    {
-        window.location.href = 'removeDataElementCategoryCombo.action?id=' + categoryComboId;
-    }
+	removeItem( categoryComboId, categoryComboName, i18n_confirm_delete, 'removeDataElementCategoryCombo.action' );
 }
 
 // ----------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js	2010-02-04 08:29:27 +0000
@@ -43,12 +43,7 @@
 
 function removeDataDictionary( dataDictionaryId, dataDictionaryName )
 {
-    var result = window.confirm( i18n_confirm_delete + '\n\n' + dataDictionaryName );
-    
-    if ( result )
-    {
-        window.location.href = 'removeDataDictionary.action?id=' + dataDictionaryId;
-    }
+	removeItem( dataDictionaryId, dataDictionaryName, i18n_confirm_delete, 'removeDataDictionary.action' );
 }
 
 // -----------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js	2010-02-03 16:07:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js	2010-02-04 08:29:27 +0000
@@ -1,3 +1,4 @@
+
 // -----------------------------------------------------------------------------
 // View details
 // -----------------------------------------------------------------------------
@@ -22,16 +23,6 @@
 // Remove data element group
 // -----------------------------------------------------------------------------
 
-/**
- * DOM modifications at page load.
- */
-$( document ).ready( function(){
-
-$( "table.listTable tbody tr:odd" ).addClass( "listAlternateRow" );
-$( "table.listTable tbody tr:even" ).addClass( "listRow" );
-
-});
-
 function removeDataElementGroup( dataElementGroupId, dataElementGroupName )
 {
 	removeItem( dataElementGroupId, dataElementGroupName, i18n_confirm_delete, "removeDataElementGroup.action" );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js	2009-11-04 06:39:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js	2010-02-04 08:29:27 +0000
@@ -51,9 +51,8 @@
 // -----------------------------------------------------------------------------
 
 function deleteDataElementGroupSet( id ){
-	if(window.confirm(i18n_confirm_delete)){
-		window.location = "deleteDataElementGroupSet.action?id=" + id;
-	}
+	
+	deleteItem( id, "", i18n_confirm_delete, "deleteDataElementGroupSet.action" );
 }
 
 // -----------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js	2010-02-04 08:29:27 +0000
@@ -25,12 +25,7 @@
 
 function removeIndicatorGroup( indicatorGroupId, indicatorGroupName )
 {
-    var result = window.confirm( i18n_confirm_delete + '\n\n' + indicatorGroupName );
-    
-    if ( result )
-    {
-        window.location.href = 'removeIndicatorGroup.action?id=' + indicatorGroupId;
-    }
+	removeItem( indicatorGroupId, indicatorGroupName, i18n_confirm_delete, 'removeIndicatorGroup.action' );
 }
 
 // -----------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js	2009-11-04 06:39:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js	2010-02-04 08:29:27 +0000
@@ -50,9 +50,8 @@
 // -----------------------------------------------------------------------------
 
 function deleteIndicatorGroupSet( id ){
-	if(window.confirm(i18n_confirm_delete)){
-		window.location = "deleteIndicatorGroupSet.action?id=" + id;
-	}
+	
+	removeItem( id, "", i18n_confirm_delete, "deleteIndicatorGroupSet.action" );
 }
 
 // -----------------------------------------------------------------------------

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/organisationUnitGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/organisationUnitGroup.js	2009-10-26 15:39:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/organisationUnitGroup.js	1970-01-01 00:00:00 +0000
@@ -1,92 +0,0 @@
-
-// -----------------------------------------------------------------------------
-// View details
-// -----------------------------------------------------------------------------
-
-function showOrganisationUnitGroupDetails( unitId )
-{
-    var request = new Request();
-    request.setResponseTypeXML( 'organisationUnitGroup' );
-    request.setCallbackSuccess( organisationUnitGroupReceived );
-    request.send( 'getOrganisationUnitGroup.action?id=' + unitId );
-}
-
-function organisationUnitGroupReceived( unitGroupElement )
-{
-    setFieldValue( 'nameField', getElementValue( unitGroupElement, 'name' ) );
-    setFieldValue( 'memberCountField', getElementValue( unitGroupElement, 'memberCount' ) );
-    
-    showDetails();
-}
-
-// -----------------------------------------------------------------------------
-// Remove organisation unit group
-// -----------------------------------------------------------------------------
-
-function removeOrganisationUnitGroup( unitGroupId, unitGroupName )
-{
-    var result = window.confirm( confirm_to_delete_org_unit_group + '\n\n' + unitGroupName );
-    
-    if ( result )
-    {
-        window.location.href = 'removeOrganisationUnitGroup.action?id=' + unitGroupId;
-    }
-}
-
-// -----------------------------------------------------------------------------
-// Add organisation unit group
-// -----------------------------------------------------------------------------
-
-function validateAddOrganisationUnitGroup()
-{	
-	$.post("validateOrganisationUnitGroup.action",{		
-		name:$("#name").val()
-	},function( message ){
-		var messageElement = message.getElementsByTagName('message')[0];
-		var type = messageElement.getAttribute( 'type' );
-		var message = messageElement.firstChild.nodeValue;
-
-		if ( type == 'success' )
-		{
-			document.forms['addOrganisationUnitGroupForm'].submit();
-		}
-		else if ( type == 'error' )
-		{
-			setMessage(message);
-		}
-		else if ( type == 'input' )
-		{
-			setMessage(message);
-		}
-	},'xml');   
-}
-
-// -----------------------------------------------------------------------------
-// Update organisation unit group
-// -----------------------------------------------------------------------------
-
-function validateUpdateOrganisationUnitGroup()
-{	
-	
-	$.post("validateOrganisationUnitGroup.action",{
-		id:$("#id").val(),
-		name:$("#name").val()
-	},function( message ){
-		var messageElement = message.getElementsByTagName('message')[0];
-		var type = messageElement.getAttribute( 'type' );
-		var message = messageElement.firstChild.nodeValue;
-
-		if ( type == 'success' )
-		{
-			document.forms['updateOrganisationUnitGroupForm'].submit();
-		}
-		else if ( type == 'error' )
-		{
-			setMessage(message);
-		}
-		else if ( type == 'input' )
-		{
-			setMessage(message);
-		}
-	},'xml');   
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm	2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm	2010-02-04 08:29:27 +0000
@@ -20,20 +20,14 @@
           </tr>
 
           <tbody id="list">
-            #set( $mark = false )
             #foreach( $dataElementCategory in $dataElementCategories )
             #if( $dataElementCategory.id != $defaultCategory.id )
-              <tr>                
-                <td#alternate( $mark )>$encoder.htmlEncode( $dataElementCategory.name )</td>
-                <td style="text-align:center"#alternate( $mark )><a href="showUpdateDataElementCategoryForm.action?id=$dataElementCategory.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
-                <td style="text-align:center"#alternate( $mark )><a href="javascript:removeDataElementCategory( '$dataElementCategory.id', '$encoder.jsEncode( $dataElementCategory.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
-                <td style="text-align:center"#alternate( $mark )><a href="javascript:showDataElementCategoryDetails( $dataElementCategory.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>                
+              <tr id="tr${$dataElementCategory.id}">                
+                <td>$encoder.htmlEncode( $dataElementCategory.name )</td>
+                <td style="text-align:center"><a href="showUpdateDataElementCategoryForm.action?id=$dataElementCategory.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+                <td style="text-align:center"><a href="javascript:removeDataElementCategory( '$dataElementCategory.id', '$encoder.jsEncode( $dataElementCategory.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+                <td style="text-align:center"><a href="javascript:showDataElementCategoryDetails( $dataElementCategory.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>                
               </tr>
-			  #if( $mark )
-				#set( $mark = false )
-			  #else
-				#set( $mark = true )
-			  #end
 			#end
             #end
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm	2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm	2010-02-04 08:29:27 +0000
@@ -20,20 +20,14 @@
           </tr>
 
           <tbody id="list">
-            #set( $mark = false )
             #foreach( $dataElementCategoryCombo in $dataElementCategoryCombos )
             #if( $dataElementCategoryCombo.id != $defaultCombo.id )
-              <tr>
-                <td#alternate( $mark )>$encoder.htmlEncode( $dataElementCategoryCombo.name )</td>
-                <td style="text-align:center"#alternate( $mark )><a href="showUpdateDataElementCategoryComboForm.action?id=$dataElementCategoryCombo.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
-                <td style="text-align:center"#alternate( $mark )><a href="javascript:removeDataElementCategoryCombo( '$dataElementCategoryCombo.id', '$encoder.jsEncode( $dataElementCategoryCombo.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
-				<td style="text-align:center"#alternate( $mark )><a href="javascript:showDataElementCategoryComboDetails( $dataElementCategoryCombo.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>				
+              <tr id="tr${dataElementCategoryCombo.id}">
+                <td>$encoder.htmlEncode( $dataElementCategoryCombo.name )</td>
+                <td style="text-align:center"><a href="showUpdateDataElementCategoryComboForm.action?id=$dataElementCategoryCombo.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+                <td style="text-align:center"><a href="javascript:removeDataElementCategoryCombo( '$dataElementCategoryCombo.id', '$encoder.jsEncode( $dataElementCategoryCombo.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+				<td style="text-align:center"><a href="javascript:showDataElementCategoryComboDetails( $dataElementCategoryCombo.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>				
               </tr>
-			  #if( $mark )
-				#set( $mark = false )
-			  #else
-				#set( $mark = true )
-			  #end
 			#end
             #end
           </tbody>