dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00211
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 68: Delete some file not using in GIS module
------------------------------------------------------------
revno: 68
committer: TranThanhTri tranthanhtri84@xxxxxxxxx
branch nick: trunk
timestamp: Sat 2009-03-14 17:39:22 +0530
message:
Delete some file not using in GIS module
removed:
dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/general.js
dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/selectunit.js
modified:
dhis-2/dhis-web/dhis-web-gis/pom.xml
dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/assignUnit.vm
dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/asignunit.js
=== modified file 'dhis-2/dhis-web/dhis-web-gis/pom.xml'
--- dhis-2/dhis-web/dhis-web-gis/pom.xml 2009-03-13 11:44:39 +0000
+++ dhis-2/dhis-web/dhis-web-gis/pom.xml 2009-03-14 12:09:22 +0000
@@ -10,7 +10,7 @@
</parent>
<artifactId>dhis-web-gis</artifactId>
- <packaging>jar</packaging>
+ <packaging>war</packaging>
<name>DHIS GIS</name>
<build>
=== modified file 'dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/assignUnit.vm'
--- dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/assignUnit.vm 2009-03-13 11:44:39 +0000
+++ dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/assignUnit.vm 2009-03-14 12:09:22 +0000
@@ -3,7 +3,7 @@
<a style="text-decoration:none" style="CURSOR: hand" href="javascript:validateAddFeature();">[$i18n.getString( 'assignunit_map' )]</a>
<a style="text-decoration:none" style="CURSOR: hand" href="javascript:showAllFeature();">[$i18n.getString( 'show_all_assigned' )]</a>
<a style="text-decoration:none" style="CURSOR: hand" href="javascript:deleteFeature();">[$i18n.getString( 'delete_selected' )]</a>
- <a style="text-decoration:none" style="CURSOR: hand" href="javascript:deleteAllFeature();">[$i18n.getString( 'show_all_assigned' )]</a>
+ <a style="text-decoration:none" style="CURSOR: hand" href="javascript:deleteAllFeature();">[$i18n.getString( 'delete_all' )]</a>
<a style="text-decoration:none" style="CURSOR: hand" href="javascript:showHideLabel();">[Label]</a>
<a style="text-decoration:none" style="CURSOR: hand" href="javascript:zoomIn();" title="Zoom In">[ + ]</a>
<a style="text-decoration:none" style="CURSOR: hand" href="javascript:zoomOut();" title="Zoom Out">[ - ]</a>
@@ -45,6 +45,8 @@
$(document).ready(function(){
$("#listChildren").draggable();
});
+
+ var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete" ) , "'" )';
</script>
</body>
=== modified file 'dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/asignunit.js'
--- dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/asignunit.js 2009-03-13 11:44:39 +0000
+++ dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/asignunit.js 2009-03-14 12:09:22 +0000
@@ -101,7 +101,7 @@
}
function deleteFeature(){
- if(confirm("Do you want delete ?")){
+ if(confirm(i18n_confirm_delete)){
var request = new Request();
request.setResponseTypeXML( 'message' );
request.setCallbackSuccess( deleteFeatureSuccess);
=== removed file 'dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/general.js'
--- dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/general.js 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/general.js 1970-01-01 00:00:00 +0000
@@ -1,326 +0,0 @@
-
-// -----------------------------------------------------------------------------
-// $Id: general.js 1813 2006-09-01 12:08:08Z margrsto $
-// -----------------------------------------------------------------------------
-// Selection
-// -----------------------------------------------------------------------------
-
-function organizationUnitSelected( orgUnits )
-{
- document.getElementById( 'selectForm' ).submit();
-}
-
-selection.setListenerFunction( organizationUnitSelected );
-
-function changeOrder( dataSetId )
-{
- window.open( 'getDataElementOrder.action?dataSetId=' + dataSetId, '_blank', 'width=700,height=500,scrollbars=yes' );
-}
-
-// -----------------------------------------------------------------------------
-// Comments
-// -----------------------------------------------------------------------------
-
-function commentSelected( dataElementId )
-{
- var commentSelector = document.getElementById( 'value[' + dataElementId + '].comments' );
- var commentField = document.getElementById( 'value[' + dataElementId + '].comment' );
-
- var value = commentSelector.options[commentSelector.selectedIndex].value;
-
- if ( value == 'custom' )
- {
- commentSelector.style.display = 'none';
- commentField.style.display = 'inline';
-
- commentField.select();
- commentField.focus();
- }
- else
- {
- commentField.value = value;
-
- saveComment( dataElementId, value );
- }
-}
-
-function commentLeft( dataElementId )
-{
- var commentField = document.getElementById( 'value[' + dataElementId + '].comment' );
- var commentSelector = document.getElementById( 'value[' + dataElementId + '].comments' );
-
- saveComment( dataElementId, commentField.value );
-
- var value = commentField.value;
-
- if ( value == '' )
- {
- commentField.style.display = 'none';
- commentSelector.style.display = 'inline';
-
- commentSelector.selectedIndex = 0;
- }
-}
-
-// -----------------------------------------------------------------------------
-// Save
-// -----------------------------------------------------------------------------
-
-function saveValue( dataElementId, dataElementName )
-{
- var field = document.getElementById( 'value[' + dataElementId + '].value' );
- var type = document.getElementById( 'value[' + dataElementId + '].type' ).innerHTML;
-
- field.style.backgroundColor = '#ffffcc';
-
- if ( field.value != '' )
- {
- if ( type == 'int' )
- {
- if ( !isInt( field.value ))
- {
- field.style.backgroundColor = '#ffcc00';
-
- window.alert( i18n_value_must_integer + '\n\n' + dataElementName );
-
- field.select();
- field.focus();
-
- return;
- }
- else
- {
- var minString = document.getElementById( 'value[' + dataElementId + '].min' ).innerHTML;
- var maxString = document.getElementById( 'value[' + dataElementId + '].max' ).innerHTML;
-
- if ( minString.length != 0 && maxString.length != 0 )
- {
- var value = new Number( field.value );
- var min = new Number( minString );
- var max = new Number( maxString );
-
- if ( value < min )
- {
- var valueSaver = new ValueSaver( dataSetId, dataElementId, periodId, field.value, '#ffcccc' );
- valueSaver.save();
-
- window.alert( i18n_value_of_data_element_less + '\n\n' + dataElementName );
-
- return;
- }
-
- if ( value > max )
- {
- var valueSaver = new ValueSaver( dataSetId, dataElementId, periodId, field.value, '#ffcccc' );
- valueSaver.save();
-
- window.alert( i18n_value_of_data_element_greater + '\n\n' + dataElementName);
-
- return;
- }
- }
- }
- }
- }
-
- var valueSaver = new ValueSaver( dataSetId, dataElementId, periodId, field.value, '#ccffcc' );
- valueSaver.save();
-}
-
-function saveBoolean( dataElementId )
-{
- var select = document.getElementById( 'value[' + dataElementId + '].boolean' );
-
- select.style.backgroundColor = '#ffffcc';
-
- var valueSaver = new ValueSaver( dataSetId, dataElementId, periodId, select.options[select.selectedIndex].value );
- valueSaver.save();
-}
-
-function saveComment( dataElementId, commentValue )
-{
- var field = document.getElementById( 'value[' + dataElementId + '].comment' );
- var select = document.getElementById( 'value[' + dataElementId + '].comments' );
-
- field.style.backgroundColor = '#ffffcc';
- select.style.backgroundColor = '#ffffcc';
-
- var commentSaver = new CommentSaver( dataSetId, dataElementId, periodId, commentValue );
- commentSaver.save();
-}
-
-function isInt( value )
-{
- var number = new Number( value );
-
- if ( isNaN( number ))
- {
- return false;
- }
-
- return true;
-}
-
-// -----------------------------------------------------------------------------
-// Saver objects
-// -----------------------------------------------------------------------------
-
-function ValueSaver( dataSetId_, dataElementId_, periodId_, value_, resultColor_ )
-{
- var SUCCESS = '#ccffcc';
- var ERROR = '#ccccff';
-
- var dataSetId = dataSetId_;
- var dataElementId = dataElementId_;
- var periodId = periodId_;
- var value = value_;
- var resultColor = resultColor_;
-
- this.save = function()
- {
- var request = new Request();
- request.setCallbackSuccess( handleResponse );
- request.setCallbackError( handleHttpError );
- request.setResponseTypeXML( 'status' );
- request.send( 'saveValue.action?dataSetId=' + dataSetId + '&dataElementId=' +
- dataElementId + '&periodId=' + periodId + '&value=' + value );
- };
-
- function handleResponse( rootElement )
- {
- var codeElement = rootElement.getElementsByTagName( 'code' )[0];
- var code = parseInt( codeElement.firstChild.nodeValue );
-
- if ( code == 0 )
- {
- markValue( resultColor );
-
- //var textNode;
-
- //var timestampElement = rootElement.getElementsByTagName( 'timestamp' )[0];
- //var timestampField = document.getElementById( 'value[' + dataElementId + '].timestamp' );
- //textNode = timestampElement.firstChild;
-
- //timestampField.innerHTML = ( textNode ? textNode.nodeValue : '' );
-
- //var storedByElement = rootElement.getElementsByTagName( 'storedBy' )[0];
- //var storedByField = document.getElementById( 'value[' + dataElementId + '].storedBy' );
- //textNode = storedByElement.firstChild;
-
- //storedByField.innerHTML = ( textNode ? textNode.nodeValue : '' );
- }
- else
- {
- markValue( ERROR );
- window.alert( i18n_saving_value_failed_status_code + '\n\n' + code );
- }
- }
-
- function handleHttpError( errorCode )
- {
- markValue( ERROR );
- window.alert( i18n_saving_value_failed_error_code + '\n\n' + errorCode );
- }
-
- function markValue( color )
- {
- var type = document.getElementById( 'value[' + dataElementId + '].type' ).innerText;
- var element;
-
- if ( type == 'bool' )
- {
- element = document.getElementById( 'value[' + dataElementId + '].boolean' );
- }
- else
- {
- element = document.getElementById( 'value[' + dataElementId + '].value' );
- }
-
- element.style.backgroundColor = color;
- }
-}
-
-function CommentSaver( dataSetId_, dataElementId_, periodId_, value_ )
-{
- var SUCCESS = '#ccffcc';
- var ERROR = '#ccccff';
-
- var dataSetId = dataSetId_;
- var dataElementId = dataElementId_;
- var periodId = periodId_;
- var value = value_;
-
- this.save = function()
- {
- var request = new Request();
- request.setCallbackSuccess( handleResponse );
- request.setCallbackError( handleHttpError );
- request.setResponseTypeXML( 'status' );
- request.send( 'saveComment.action?dataSetId=' + dataSetId + '&dataElementId=' +
- dataElementId + '&periodId=' + periodId + '&comment=' + value );
- };
-
- function handleResponse( rootElement )
- {
- var codeElement = rootElement.getElementsByTagName( 'code' )[0];
- var code = parseInt( codeElement.firstChild.nodeValue );
-
- if ( code == 0 )
- {
- markComment( SUCCESS );
-
- //var textNode;
-
- //var timestampElement = rootElement.getElementsByTagName( 'timestamp' )[0];
- //var timestampField = document.getElementById( 'value[' + dataElementId + '].timestamp' );
- //textNode = timestampElement.firstChild;
-
- //timestampField.innerHTML = ( textNode ? textNode.nodeValue : '' );
-
- //var storedByElement = rootElement.getElementsByTagName( 'storedBy' )[0];
- //var storedByField = document.getElementById( 'value[' + dataElementId + '].storedBy' );
- //textNode = storedByElement.firstChild;
-
- //storedByField.innerHTML = ( textNode ? textNode.nodeValue : '' );
- }
- else
- {
- markComment( ERROR );
- window.alert( i18n_saving_comment_failed_status_code + '\n\n' + code );
- }
- }
-
- function handleHttpError( errorCode )
- {
- markComment( ERROR );
- window.alert( i18n_saving_comment_failed_error_code + '\n\n' + errorCode );
- }
-
- function markComment( color )
- {
- var field = document.getElementById( 'value[' + dataElementId + '].comment' );
- var select = document.getElementById( 'value[' + dataElementId + '].comments' );
-
- field.style.backgroundColor = color;
- select.style.backgroundColor = color;
- }
-}
-
-// -----------------------------------------------------------------------------
-// View history
-// -----------------------------------------------------------------------------
-
-function viewHistory( dataElementId, periodId, dataSetId )
-{
- window.open( 'viewHistory.action?dataElementId=' + dataElementId + '&periodId=' + periodId + '&dataSetId=' + dataSetId, '_blank', 'width=560,height=550,scrollbars=yes' );
-}
-
-function showHideAll(id){
- var status = document.getElementById(id).style.display;
- //document.getElementById(id).style.height = "30px";
- if(status=='none'){
- document.getElementById(id).style.display = 'block';
- }else{
- document.getElementById(id).style.display = 'none';
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/selectunit.js'
--- dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/selectunit.js 2009-03-09 08:28:19 +0000
+++ dhis-2/dhis-web/dhis-web-gis/src/main/webapp/dhis-web-gis/javascript/selectunit.js 1970-01-01 00:00:00 +0000
@@ -1,224 +0,0 @@
-// JavaScript Document
-
-/***********************************************************
-* ************SELECT ACTION FUNCTION *****************
-************************************************************/
-
-/* Left select organisation unit list */
-
-function selectOrgunit(id,name){
- document.getElementById('orgname').value = name;
- document.getElementById('orgUnit').value = id;
-
- var listButton = document.getElementsByName('orgunitlink');
- for(var i=0;i<listButton.length;i++){
- var button = listButton.item(i);
- button.style.color="#0000CC";
- }
-
- document.getElementById(id).style.color="red";
-
- var request = new Request();
- request.setResponseTypeXML( 'features' );
- request.setCallbackSuccess( selectOrgunitSuccess);
- request.send( "selectOrgUnitAjax.action?id=" + id );
-}
-
-function selectOrgunitSuccess(feature){
- var type = feature.getAttribute( 'type' );
-
- refreshColor('#FFFFCC');
-
- document.getElementById( 'message' ).innerHTML = "";
-
- if(type=='success'){
- var id = feature.getElementsByTagName('id')[0].firstChild.nodeValue;
- var featureCode = feature.getElementsByTagName('featureCode')[0].firstChild.nodeValue;
- var orgunitName = feature.getElementsByTagName('orgunitName')[0].firstChild.nodeValue;
- document.getElementById('organisationUnitCode').value = featureCode;
- document.getElementById('featureid').value = id;
- document.getElementById('button_delete').disabled = false;
- document.getElementById('button_assign').disabled = true;
- selectOneFeature(featureCode);
- }else{
- document.getElementById('organisationUnitCode').value = '';
- document.getElementById('featureid').value = '';
- document.getElementById('button_delete').disabled = true;
- document.getElementById('button_assign').disabled = false;
-}
-
-function selectOneFeature(featureCode){
-
- if(featureCode!=""){
- var nodeList = domSVG('polygon');
- for(var i=0;i<nodeList.length;i++){
- g_element = nodeList.item(i);
- var id = g_element.getAttribute("id");
-
- if(featureCode==id){
-
- lastClickFill = g_element.getAttribute("fill");
- g_element.setAttributeNS(null, "fill", "red");
- lastFearureChoise = featureCode;
- }
-
- }
- }
- }
-}
-
-
-var lastFearureChoise;
-var lastClickFill;
-function selectedFeature(featureCode){
- if(featureCode!=""){
- var nodeList = domSVG('polygon');
- for(var i=0;i<nodeList.length;i++){
- g_element = nodeList.item(i);
- var id = g_element.getAttribute("id");
- if(featureCode==id){
- lastClickFill = g_element.getAttribute("fill");
- g_element.setAttributeNS(null, "fill", "red");
- lastFearureChoise = featureCode;
-
- }
-
- }
- }
-
-}
-
-function changeAction(element_id){
-
- var nodeList = domSVG('polygon');
- for(var i=0;i<nodeList.length;i++){
- g_element = nodeList.item(i);
- g_element.removeEventListener("mouseover", showInfo, false);
- g_element.removeEventListener("mouseout", hiddenInfo, false);
- g_element.addEventListener("click", getInfo, false);
- }
- this.layer_actived=element_id;
-}
-
-function nonSelect(element_id){
- var nodeList = domSVG('polygon');
- for(var i=0;i<nodeList.length;i++){
- g_element = nodeList.item(i);
-
- var id = g_element.getAttribute("id");
- if(lastFearureChoise==id){
- g_element.setAttributeNS(null, "fill", lastClickFill);
- }
-
- }
-}
-
-function getInfo(evt){
- var target = evt.target;
- if(lastFearureChoise){
- nonSelect(layer_actived);
- }
-
- if(layer_actived=="polyline"){
- target.setAttributeNS(null, "stroke", stroke);
- target.setAttributeNS(null, "stroke-width",stroke_width);
- }else{
- lastClickFill = target.getAttribute("fill");
- target.setAttributeNS(null, "fill", "red");
- var orgCode = target.getAttribute("id");
- lastFearureChoise = orgCode;
- document.getElementById('organisationUnitCode').value = orgCode;
-
- }
-
-}
-
-
-
-function validateAddFeature(){
- var organisationUnitCode = document.getElementById('organisationUnitCode').value;
- var orgUnit = document.getElementById('orgUnit').value;
-
- var request = new Request();
- request.setResponseTypeXML( 'message' );
- request.setCallbackSuccess( responseValidateAddFeature);
- request.send( "validateAssignMap.action?orgUnitId="+orgUnit+"&organisationUnitCode=" + organisationUnitCode);
-}
-
-function responseValidateAddFeature(message){
- var type = message.getAttribute( 'type' );
- var message = message.firstChild.nodeValue;
- if ( type == 'success' ) {
- document.getElementById('button_assign').disabled = true;
- assignUnit();
-
- }
- document.getElementById( 'message' ).innerHTML = message;
-
-
-}
-
-function assignUnit(){
- var organisationUnitCode = document.getElementById('organisationUnitCode').value;
- var orgUnit = document.getElementById('orgUnit').value;
- var comment = document.getElementById('comment').value;
-
- var request = new Request();
- request.send( "assignUnitSaveAction.action?orgUnitId="+orgUnit+"&organisationUnitCode=" + organisationUnitCode + "&comment='"+ comment +"'");
-}
-
-function assignUnitSuccess(message){
- var message = message.firstChild.nodeValue;
- document.getElementById( 'message' ).innerHTML = message;
-
-}
-
-function deleteFeature(){
- if(confirm("Do you want delete ?")){
- var featureid = document.getElementById('featureid').value;
- var request = new Request();
- request.setResponseTypeXML( 'message' );
- request.setCallbackSuccess( deleteFeatureSuccess);
- request.send( "deleteFeature.action?featureId=" + featureid);
- }else{
- return false;
- }
-
-}
-function deleteFeatureSuccess(message){
- var message = message.firstChild.nodeValue;
- document.getElementById( 'message' ).innerHTML = message;
-}
-
-function deleteAllFeature(){
- if(confirm("Do you want delete all ?")){
- var request = new Request();
- request.setResponseTypeXML( 'message' );
- request.setCallbackSuccess( deleteFeatureSuccess);
- request.send( "deleteAllFeature.action");
- }else{
- return false;
- }
-}
-
-function showAllFeature(){
- var request = new Request();
- request.setResponseTypeXML( 'features' );
- request.setCallbackSuccess( showAllSuccess);
- request.send( "showAllFeature.action");
-}
-function showAllSuccess(features){
- var featureList = features.getElementsByTagName("feature");
- for(var i=0;i<featureList.length;i++){
- var feature = featureList.item(i);
- var featureCode = feature.getElementsByTagName('featureCode')[0].firstChild.nodeValue;
- fillColor(featureCode,"RED");
- }
- var message = features.getElementsByTagName("message")[0].firstChild.nodeValue;
- document.getElementById( 'showAllAssigned' ).style.display='block';
- document.getElementById( 'showAllAssignedData' ).innerHTML = message;
-
-}
-function closeDiv(id){
- document.getElementById( id ).style.display='none';
-}
\ No newline at end of file
--
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.