← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 312: Added URL GUI property for data element and indicator. Made the URL clickable in the details box.

 

------------------------------------------------------------
revno: 312
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Wed 2009-05-20 16:15:54 +0200
message:
  Added URL GUI property for data element and indicator. Made the URL clickable in the details box.
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/url.png
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/AddIndicatorAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/UpdateIndicatorAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.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/indicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicator.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/responseDataElement.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/responseIndicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js

=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/url.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/url.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/url.png	2009-05-20 14:15:54 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java	2009-03-13 15:24:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java	2009-05-20 14:15:54 +0000
@@ -130,6 +130,13 @@
         this.calculated = calculated;
     }
 
+    private String url;
+
+    public void setUrl( String url )
+    {
+        this.url = url;
+    }
+    
     private String saved;
 
     public void setSaved( String saved )
@@ -242,19 +249,19 @@
         }
         
         dataElement.setName( name );
-        dataElement.setShortName( shortName );
+        dataElement.setAlternativeName( alternativeName );
+        dataElement.setShortName( shortName );      
+        dataElement.setCode( code );
         dataElement.setDescription( description );
         dataElement.setActive( true );
         dataElement.setType( type );
         dataElement.setAggregationOperator( aggregationOperator );
-        dataElement.setParent( null );        
-        dataElement.setAlternativeName( alternativeName );
-        dataElement.setCode( code );
-        
+        dataElement.setParent( null );  
+        dataElement.setUrl( url );        
         dataElement.setCategoryCombo( categoryCombo );
 
         dataElementService.addDataElement( dataElement );
 
         return SUCCESS;
-    }    
+    }  
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2009-03-13 15:24:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2009-05-20 14:15:54 +0000
@@ -132,6 +132,13 @@
     {
         this.aggregationOperator = aggregationOperator;
     }
+
+    private String url;
+
+    public void setUrl( String url )
+    {
+        this.url = url;
+    }
     
     private String saved;
     
@@ -201,6 +208,7 @@
         dataElement.setActive( active );
         dataElement.setType( type );
         dataElement.setAggregationOperator( aggregationOperator );
+        dataElement.setUrl( url );
         dataElement.setCategoryCombo( categoryCombo );        
 
         // ---------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/AddIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/AddIndicatorAction.java	2009-03-13 15:24:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/AddIndicatorAction.java	2009-05-20 14:15:54 +0000
@@ -112,6 +112,13 @@
         this.indicatorTypeId = indicatorTypeId;
     }
     
+    private String url;
+
+    public void setUrl( String url )
+    {
+        this.url = url;
+    }
+    
     private String numerator;
 
     public void setNumerator( String numerator )
@@ -190,6 +197,7 @@
         indicator.setDescription( description );
         indicator.setAnnualized( annualized );
         indicator.setIndicatorType( indicatorType );
+        indicator.setUrl( url );
         indicator.setNumerator( numerator );
         indicator.setNumeratorDescription( numeratorDescription );
         indicator.setNumeratorAggregationOperator( numeratorAggregationOperator );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/UpdateIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/UpdateIndicatorAction.java	2009-03-13 15:24:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/UpdateIndicatorAction.java	2009-05-20 14:15:54 +0000
@@ -119,6 +119,13 @@
         this.indicatorTypeId = indicatorTypeId;
     }
 
+    private String url;
+
+    public void setUrl( String url )
+    {
+        this.url = url;
+    }
+    
     private String numerator;
 
     public void setNumerator( String numerator )
@@ -197,6 +204,7 @@
         indicator.setDescription( description );
         indicator.setAnnualized( annualized );
         indicator.setIndicatorType( indicatorType );
+        indicator.setUrl( url );
         indicator.setNumerator( numerator );
         indicator.setNumeratorDescription( numeratorDescription );
         indicator.setNumeratorAggregationOperator( numeratorAggregationOperator );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties	2009-03-31 15:44:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties	2009-05-20 14:15:54 +0000
@@ -338,3 +338,4 @@
 confirm_delete_indicator_group					= Do you want delete this indicator ?
 update_indicator_group_member					= Update Indicator Member
 factor_cannot_be_zero							= Factor cannot be zero
+url												= URL

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm	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/addDataElementForm.vm	2009-05-20 14:15:54 +0000
@@ -45,7 +45,11 @@
 				<option value="average">$i18n.getString( "average" )</option>
 			</select>
 		</td>
-	</tr>	
+	</tr>
+    <tr>
+        <td><label for="url">$i18n.getString( "url" )</label></td>
+        <td><input type="text" id="url" name="url" style="width:20em"></td>
+    </tr>
 	<tr>	
 		<td><label for="selectedCategoryComboId">$i18n.getString( "category_combo" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm	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/addIndicatorForm.vm	2009-05-20 14:15:54 +0000
@@ -56,6 +56,10 @@
 			</select>
 		</td>
 	</tr>
+    <tr>
+        <td><label for="url">$i18n.getString( "url" )</label></td>
+        <td><input type="text" id="url" name="url" style="width:20em"></td>
+    </tr>
 	<tr>
 		<td></td>
 		<td><input type="button" value="$i18n.getString( 'edit_numerator' )" onclick="showEditNumeratorForm()" style="width:10em"><input

=== 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-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2009-05-20 14:15:54 +0000
@@ -93,8 +93,9 @@
 				<p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
 				<p><label>$i18n.getString( "active" ):</label><br><span id="activeField"></span></p>
 				<p><label>$i18n.getString( "type" ):</label><br><span id="typeField"></span></p>
-				<p><label>$i18n.getString( "aggregation_operator" ):</label><br><span id="aggregationOperatorField"></span></p>
+				<p><label>$i18n.getString( "aggregation_operator" ):</label><br><span id="aggregationOperatorField"></span></p>                
 				<p><label>$i18n.getString( "category_combination" ):</label><br><span id="categoryComboField"></span></p>
+				<p><label>$i18n.getString( "url" ):</label><br><span id="urlField"></span></p>
 			</div>
 
             <div id="warningArea" style="display:none">

=== 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-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm	2009-05-20 14:15:54 +0000
@@ -85,8 +85,9 @@
 				<p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
 				<p><label>$i18n.getString( "annualized" ):</label><br><span id="annualizedField"></span></p>
                 <p><label>$i18n.getString( "indicator_type" ):</label><br><span id="indicatorTypeNameField"></span></p>
-				<p><label>$i18n.getString( "numerator_description" ):</label><br><span id="numeratorDescriptionField"></span></p>
+                <p><label>$i18n.getString( "numerator_description" ):</label><br><span id="numeratorDescriptionField"></span></p>
 				<p><label>$i18n.getString( "denominator_description" ):</label><br><span id="denominatorDescriptionField"></span></p>
+			    <p><label>$i18n.getString( "url" ):</label><br><span id="urlField"></span></p>                
 			</div>
 
             <div id="warningArea" style="display:none">

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.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/dataElement.js	2009-05-20 14:15:54 +0000
@@ -57,6 +57,9 @@
     
     setFieldValue( 'categoryComboField', getElementValue( dataElementElement, 'categoryCombo' ) );
     
+    var url = getElementValue( dataElementElement, 'url' );
+    setFieldValue( 'urlField', url ? '<a href="' + url + '">' + url + '</a>' : '[' + i18n_none + ']' );
+    
     showDetails();
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicator.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicator.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/indicator.js	2009-05-20 14:15:54 +0000
@@ -47,6 +47,9 @@
     var denominatorDescription = getElementValue( indicatorElement, 'denominatorDescription' );
     setFieldValue( 'denominatorDescriptionField', denominatorDescription ? denominatorDescription : '[' + i18n_none + ']' );
 
+    var url = getElementValue( indicatorElement, 'url' );
+    setFieldValue( 'urlField', url ? '<a href="' + url + '">' + url + '</a>' : '[' + i18n_none + ']' );
+    
     showDetails();
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/responseDataElement.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/responseDataElement.vm	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/responseDataElement.vm	2009-05-20 14:15:54 +0000
@@ -9,5 +9,6 @@
 	<active>$dataElement.active</active>
 	<type>$dataElement.type</type>
 	<aggregationOperator>$dataElement.aggregationOperator</aggregationOperator>
+	<url>$!encoder.xmlEncode( $dataElement.url )</url>
 	<categoryCombo>$dataElement.categoryCombo.name</categoryCombo>
 </dataElement>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/responseIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/responseIndicator.vm	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/responseIndicator.vm	2009-05-20 14:15:54 +0000
@@ -10,4 +10,5 @@
 	<indicatorTypeName>$encoder.xmlEncode( $indicatorTypeName )</indicatorTypeName>
 	<numeratorDescription>$encoder.xmlEncode( $indicator.numeratorDescription )</numeratorDescription>
 	<denominatorDescription>$encoder.xmlEncode( $indicator.denominatorDescription )</denominatorDescription>
+	<url>$!encoder.xmlEncode( $indicator.url )</url>
 </indicator>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm	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/updateDataElementForm.vm	2009-05-20 14:15:54 +0000
@@ -59,6 +59,10 @@
 			</select>
 		</td>
 	</tr>
+    <tr>
+        <td><label for="url">$i18n.getString( "url" )</label></td>
+        <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $dataElement.url )" style="width:20em"></td>
+    </tr>
 	<tr #if( $calculatedDataElement ) style="display:none" #end >	
 		<td><label for="selectedCategoryComboId">$i18n.getString( "category_combo" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm	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/updateIndicatorForm.vm	2009-05-20 14:15:54 +0000
@@ -57,6 +57,10 @@
 			</select>
 		</td>
 	</tr>
+    <tr>
+        <td><label for="url">$i18n.getString( "url" )</label></td>
+        <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $indicator.url )" style="width:20em"></td>
+    </tr>
 	<tr>
 		<td></td>
 		<td><input type="button" value="$i18n.getString( 'edit_numerator' )" onclick="showEditNumeratorForm()" style="width:10em"><input

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js	2009-05-20 11:38:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js	2009-05-20 14:15:54 +0000
@@ -37,7 +37,8 @@
     var active = getElementValue( unitElement, 'active' );
     setFieldValue( 'activeField', active == 'true' ? yes : no );
     
-    setFieldValue( 'urlField', getElementValue( unitElement, 'url' ) );
+    var url = getElementValue( unitElement, 'url' );
+    setFieldValue( 'urlField', url ? '<a href="' + url + '">' + url + '</a>' : '[' + i18n_none + ']' );
     
     showDetails();
 }



--
Trunk
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.