dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #07692
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2236: Report excel module - Added missing file
------------------------------------------------------------
revno: 2236
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Sun 2010-09-26 02:21:27 +0700
message:
Report excel module - Added missing file
added:
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseDataElementOrder.vm
modified:
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.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-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js 2010-08-18 10:18:39 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js 2010-09-25 19:21:27 +0000
@@ -1,6 +1,19 @@
+
+function addOptionToListWithToolTip( list, optionValue, optionText )
+{
+ var option = document.createElement( "option" );
+ option.value = optionValue;
+ option.text = optionText;
+ option.onmousemove = function(e) {
+ showToolTip(e, optionText);
+ }
+ list.add( option, null );
+}
+
/*
* Open Add Data Element Group Order
*/
+
function openAddDataElementGroupOrder(){
getALLDataElementGroups();
document.forms['dataElementGroups'].action = "addDataElementGroupOrder.action";
@@ -20,13 +33,13 @@
function getALLDataElementGroupsReceived(xmlObject){
- var availableDataElementGroups = document.getElementById('availableDataElementGroups');
+ var availableDataElementGroups = byId('availableDataElementGroups');
availableDataElementGroups.options.length = 0;
var dataElementGroups = xmlObject.getElementsByTagName('dataElementGroup');
availableDataElementGroups.options.add(new Option("ALL", null));
for(var i=0;i<dataElementGroups.length;i++){
- var id = dataElementGroups.item(i).getElementsByTagName('id')[0].firstChild.nodeValue;
- var name = dataElementGroups.item(i).getElementsByTagName('name')[0].firstChild.nodeValue;
+ var id = getElementValue(dataElementGroups.item(i), 'id');
+ var name = getElementValue(dataElementGroups.item(i), 'name');
availableDataElementGroups.options.add(new Option(name, id));
}
getDataElementsByGroup(byId("availableDataElementGroups").value);
@@ -46,22 +59,17 @@
function getDataElementsByGroupReceived( datalement ){
var dataElements = datalement.getElementsByTagName( "dataElement" );
- var listDataElement = document.getElementById('availableDataElements');
+ var listDataElement = byId('availableDataElements');
listDataElement.options.length = 0;
for ( var i = 0; i < dataElements.length; i++ )
{
- var id = dataElements[ i ].getElementsByTagName( "id" )[0].firstChild.nodeValue;
- var name = dataElements[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue;
- //listDataElement.options.add(new Option(name, id));
- var option = new Option( name, id );
- option.onmousemove = function(e){
- showToolTip( e, this.text);
- }
- listDataElement.add( option, null );
+ var id = getElementValue(dataElements[i], 'id');
+ var name = getElementValue(dataElements[i], 'name');
+ addOptionToListWithToolTip( listDataElement, id, name );
}
- var availableDataElements = document.getElementById('availableDataElements');
- var selectedDataElements = document.getElementById('dataElementIds');
+ var availableDataElements = byId('availableDataElements');
+ var selectedDataElements = byId('dataElementIds');
for(var i=0;i<availableDataElements.options.length;i++){
for(var j=0;j<selectedDataElements.options.length;j++){
if(availableDataElements.options[i].value==selectedDataElements.options[j].value){
@@ -114,26 +122,22 @@
var request = new Request();
request.setResponseTypeXML( 'xmlObject' );
request.setCallbackSuccess( openUpdateDataElementOrderReceived );
- var url = "getDataElementGroupOrder.action?id=" + id;
+ var url = "getDataElementGroupOrderForCategory.action?id=" + id;
request.send(url);
}
function openUpdateDataElementOrderReceived(xmlObject)
{
- var listDataElement = document.getElementById('dataElementIds');
+ var listDataElement = byId('dataElementIds');
listDataElement.options.length = 0;
- byId("name").value = xmlObject.getElementsByTagName('name')[0].firstChild.nodeValue;
- byId("code").value = getElementValue(xmlObject,'code');
+ byId("name").value = getElementValue(xmlObject, 'name');
+ byId("code").value = getElementValue(xmlObject, 'code');
var dataElements = xmlObject.getElementsByTagName('dataElements')[0].getElementsByTagName('dataElement');
for(var i=0;i<dataElements.length;i++){
- var name = dataElements[i].getElementsByTagName('name')[0].firstChild.nodeValue;
- var id = dataElements[i].getElementsByTagName('id')[0].firstChild.nodeValue;
- var option = new Option( name, id );
- option.onmousemove = function(e){
- showToolTip( e, this.text);
- }
- listDataElement.options.add(option);
+ var name = getElementValue(dataElements[i], 'name');
+ var id = getElementValue(dataElements[i], 'id');
+ addOptionToListWithToolTip( listDataElement, id, name );
}
document.forms['dataElementGroups'].action = "updateDataElementGroupOrder.action";
@@ -162,4 +166,3 @@
window.location = url;
}
-
=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseDataElementOrder.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseDataElementOrder.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseDataElementOrder.vm 2010-09-25 19:21:27 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataElementGroupOrder>
+ <name>$dataElementGroupOrder.name</name>
+ <code>$dataElementGroupOrder.code</code>
+ <dataElements>
+ #foreach( $dataElement in $dataElementGroupOrder.dataElements )
+ <dataElement>
+ <id>$dataElement.id</id>
+ <name>$encoder.xmlEncode( $dataElement.name )</name>
+ </dataElement>
+ #end
+ </dataElements>
+</dataElementGroupOrder>
\ No newline at end of file