dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14379
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4872: Fixed "showed details" - Dataset, SqlView and Atrributes.
------------------------------------------------------------
revno: 4872
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-10-07 11:26:51 +0700
message:
Fixed "showed details" - Dataset, SqlView and Atrributes.
modified:
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/webapp/dhis-web-maintenance-dataadmin/attribute.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonAttribute.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonSqlView.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js
--
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-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-10-03 09:23:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2011-10-07 04:26:51 +0000
@@ -312,7 +312,7 @@
<!-- Sql View -->
- <action name="getSqlViewObject" class="org.hisp.dhis.dataadmin.action.sqlview.GetSqlViewObjectAction">
+ <action name="getSqlView" class="org.hisp.dhis.dataadmin.action.sqlview.GetSqlViewObjectAction">
<result name="success" type="velocity-json">
/dhis-web-maintenance-dataadmin/jsonSqlView.vm
</result>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attribute.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attribute.vm 2011-09-28 09:08:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attribute.vm 2011-10-07 04:26:51 +0000
@@ -14,6 +14,7 @@
setInnerHTML( 'dataelementField', json.attribute.dataelement );
setInnerHTML( 'indicatorField', json.attribute.indicator );
setInnerHTML( 'organisationunitField', json.attribute.organisationunit );
+ setInnerHTML( 'userField', json.attribute.user );
setInnerHTML( 'valuetypeField', json.attribute.valueType );
showDetails();
});
@@ -77,6 +78,7 @@
<p><label>$i18n.getString( "data_element" ):</label><br/><span id="dataelementField"></span></p>
<p><label>$i18n.getString( "indicator" ):</label><br/><span id="indicatorField"></span></p>
<p><label>$i18n.getString( "organisation_unit" ):</label><br/><span id="organisationunitField"></span></p>
+ <p><label>$i18n.getString( "user" ):</label><br/><span id="userField"></span></p>
</div>
<div id="warningArea" style="position:fixed;right:10px;top:200px;display:none">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js 2011-07-21 20:49:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js 2011-10-07 04:26:51 +0000
@@ -37,21 +37,16 @@
function showSqlViewDetails( viewId )
{
- var request = new Request();
- request.setResponseTypeXML( 'sqlViewObject' );
- request.setCallbackSuccess( sqlViewDetailsReceived );
- request.send( 'getSqlViewObject.action?id=' + viewId );
-}
-
-function sqlViewDetailsReceived( viewElement )
-{
- setInnerHTML( 'nameField', getElementValue( viewElement, 'name' ) );
-
- var description = getElementValue( viewElement, 'description' );
- setInnerHTML( 'descriptionField', description ? description : '[' + i18n_none + ']' );
- setInnerHTML( 'sqlQueryField', getElementValue( viewElement, 'sqlquery' ) );
-
- showDetails();
+ jQuery.postJSON( 'getSqlView.action', { id: viewId }, function ( json ) {
+
+ setInnerHTML( 'nameField', json.sqlView.name );
+
+ var description = json.sqlView.description;
+ setInnerHTML( 'descriptionField', description ? description : '[' + i18n_none + ']' );
+ setInnerHTML( 'sqlQueryField', json.sqlView.sqlquery );
+
+ showDetails();
+ });
}
/**
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonAttribute.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonAttribute.vm 2011-09-28 09:08:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonAttribute.vm 2011-10-07 04:26:51 +0000
@@ -4,8 +4,9 @@
"name": "$!encoder.jsonEncode( ${attribute.name} )",
"valueType": "$!encoder.jsonEncode( ${attribute.valueType} )",
"mandatory": "$!{attribute.mandatory}",
- "dataelement": "$!{attribute.dataElement}",
- "indicator": "$!{attribute.indicator}",
- "organisationunit": "$!{attribute.organisationUnit}"
+ "dataelement": "$!{attribute.dataElementAttribute}",
+ "indicator": "$!{attribute.indicatorAttribute}",
+ "organisationunit": "$!{attribute.organisationUnitAttribute}",
+ "user": "$!{attribute.userAttribute}"
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonSqlView.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonSqlView.vm 2011-09-28 09:08:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonSqlView.vm 2011-10-07 04:26:51 +0000
@@ -2,6 +2,6 @@
{
"name": "$!encoder.jsonEncode( ${sqlViewObject.name} )",
"description": "$!encoder.jsonEncode( ${sqlViewObject.description} )",
- "sqlquery": "$!encoder.jsonEncode( ${sqlViewObject.sqlQuery} )
+ "sqlquery": "$!encoder.jsonEncode( ${sqlViewObject.sqlQuery} )"
}
}
\ No newline at end of file
=== 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 2011-10-03 15:14:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js 2011-10-07 04:26:51 +0000
@@ -97,14 +97,9 @@
var lastUpdated = json.dataElement.lastUpdated;
setInnerHTML( 'lastUpdatedField', lastUpdated ? lastUpdated : '[' + i18n_none + ']' );
-
- var temp = '';
- var dataSets = json.dataElement.dataSets;
- for ( var i = 0 ; i < dataSets.length ; i ++ )
- {
- temp += dataSets[i].name + '<br/>';
- }
- setInnerHTML( 'dataSetsField', temp ? temp : '[' + i18n_none + ']' );
+
+ var dataSets = joinNameableObjects( json.dataElement.dataSets );
+ setInnerHTML( 'dataSetsField', dataSets ? dataSets : '[' + i18n_none + ']' );
showDetails();
});