dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #11727
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3419: (local vn) Removed unused Individual func.
------------------------------------------------------------
revno: 3419
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-04-18 15:23:27 +0700
message:
(local vn) Removed unused Individual func.
removed:
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/individualReportExcel.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/individual.js
modified:
local/vn/dhis-web-excel-reporting/pom.xml
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/CopyReportExcelItemAction.java
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/DefaultPeriodGenericManager.java
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/PeriodGenericManager.java
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/action/GetPeriodsByPeriodTypeAction.java
local/vn/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml
local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml
--
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 'local/vn/dhis-web-excel-reporting/pom.xml'
--- local/vn/dhis-web-excel-reporting/pom.xml 2011-03-25 09:11:30 +0000
+++ local/vn/dhis-web-excel-reporting/pom.xml 2011-04-18 08:23:27 +0000
@@ -54,14 +54,11 @@
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
</dependency>
- <!--
<dependency>
<groupId>org.amplecode</groupId>
- <artifactId>cave-process</artifactId>
+ <artifactId>quick</artifactId>
</dependency>
- -->
-
<!-- POI Library -->
<dependency>
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/CopyReportExcelItemAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/CopyReportExcelItemAction.java 2010-12-16 04:49:14 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/CopyReportExcelItemAction.java 2011-04-18 08:23:27 +0000
@@ -44,17 +44,17 @@
public class CopyReportExcelItemAction
implements Action
{
- // -------------------------------------------
+ // -------------------------------------------------------------------------
// Dependency
- // -------------------------------------------
+ // -------------------------------------------------------------------------
private ReportExcelService reportService;
private StatementManager statementManager;
- // -------------------------------------------
+ // -------------------------------------------------------------------------
// Input
- // -------------------------------------------
+ // -------------------------------------------------------------------------
private Integer reportId;
@@ -62,9 +62,9 @@
private List<String> reportItems = new ArrayList<String>();
- // -------------------------------------------
+ // -------------------------------------------------------------------------
// Getter & Setter
- // -------------------------------------------
+ // -------------------------------------------------------------------------
public void setReportService( ReportExcelService reportService )
{
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/DefaultPeriodGenericManager.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/DefaultPeriodGenericManager.java 2010-09-22 07:30:22 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/DefaultPeriodGenericManager.java 2011-04-18 08:23:27 +0000
@@ -1,7 +1,7 @@
package org.hisp.dhis.reportexcel.period.generic;
/*
- * Copyright (c) 2004-2010, University of Oslo
+ * Copyright (c) 2004-2011, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,16 +48,14 @@
public class DefaultPeriodGenericManager
implements PeriodGenericManager
{
-
private static final Log log = LogFactory.getLog( DefaultPeriodGenericManager.class );
-
- public static final String SESSION_KEY_SELECTED_PERIOD_TYPE= "SESSION_KEY_SELECTED_PERIOD_TYPE";
+ public static final String SESSION_KEY_SELECTED_PERIOD_TYPE = "SESSION_KEY_SELECTED_PERIOD_TYPE";
public static final String SESSION_KEY_SELECTED_PERIOD_INDEX = "SESSION_KEY_SELECTED_PERIOD_INDEX";
public static final String SESSION_KEY_BASE_PERIOD = "SESSION_KEY_BASE_PERIOD";
-
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -68,12 +66,11 @@
{
this.periodService = periodService;
}
-
// -------------------------------------------------------------------------
// Period
// -------------------------------------------------------------------------
-
+
public void setSelectedPeriodIndex( Integer index )
{
getSession().put( SESSION_KEY_SELECTED_PERIOD_INDEX, index );
@@ -111,7 +108,7 @@
public List<Period> getPeriodList()
{
Period basePeriod = getBasePeriod();
-
+
CalendarPeriodType periodType = (CalendarPeriodType) getPeriodType();
List<Period> periods = periodType.generatePeriods( basePeriod );
@@ -119,7 +116,7 @@
Date now = new Date();
Iterator<Period> iterator = periods.iterator();
-
+
while ( iterator.hasNext() )
{
if ( iterator.next().getStartDate().after( now ) )
@@ -127,10 +124,10 @@
iterator.remove();
}
}
-
+
return periods;
}
-
+
public void nextPeriodSpan()
{
List<Period> periods = getPeriodList();
@@ -168,7 +165,7 @@
private Period getBasePeriod()
{
Period basePeriod = (Period) getSession().get( SESSION_KEY_BASE_PERIOD );
-
+
PeriodType periodType = getPeriodType();
if ( basePeriod == null )
@@ -197,7 +194,6 @@
@Override
public Period getSelectedPeriod( Integer index )
{
- // TODO Auto-generated method stub
return null;
}
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/PeriodGenericManager.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/PeriodGenericManager.java 2011-03-25 09:11:30 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/PeriodGenericManager.java 2011-04-18 08:23:27 +0000
@@ -1,7 +1,7 @@
package org.hisp.dhis.reportexcel.period.generic;
/*
- * Copyright (c) 2004-2010, University of Oslo
+ * Copyright (c) 2004-2011, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/action/GetPeriodsByPeriodTypeAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/action/GetPeriodsByPeriodTypeAction.java 2010-09-22 07:30:22 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/period/generic/action/GetPeriodsByPeriodTypeAction.java 2011-04-18 08:23:27 +0000
@@ -85,7 +85,6 @@
}
else
{
-
periodGenericManager.setPeriodType( periodTypeName );
}
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- local/vn/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-04-04 04:54:43 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-04-18 08:23:27 +0000
@@ -588,7 +588,6 @@
<!-- DATA SET COMPLETED BEAN -->
-
<bean
id="org.hisp.dhis.reportexcel.datasetcompleted.action.ViewCompletedReportByPeriodsAction"
class="org.hisp.dhis.reportexcel.datasetcompleted.action.ViewCompletedReportByPeriodsAction"
@@ -769,48 +768,6 @@
ref="org.hisp.dhis.reportexcel.preview.manager.InitializePOIStylesManager" />
</bean>
- <!-- INDIVIDUAL REPORT EXCEL -->
-
- <bean
- id="org.hisp.dhis.reportexcel.export.individual.action.OpenIndividualReportExcelAction"
- class="org.hisp.dhis.reportexcel.export.individual.action.OpenIndividualReportExcelAction"
- scope="prototype">
- <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- </bean>
-
- <bean
- id="org.hisp.dhis.reportexcel.export.individual.action.DataElementListFilteredByGroup"
- class="org.hisp.dhis.reportexcel.export.individual.action.DataElementListFilteredByGroup"
- scope="prototype">
- <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
- </bean>
-
- <bean
- id="org.hisp.dhis.reportexcel.export.individual.action.GenerateIndividualReportExcelAction"
- class="org.hisp.dhis.reportexcel.export.individual.action.GenerateIndividualReportExcelAction"
- scope="prototype">
- <property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
- <property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
- <property name="selectionManager"
- ref="org.hisp.dhis.reportexcel.state.SelectionManager" />
- <property name="reportService" ref="org.hisp.dhis.reportexcel.ReportExcelService" />
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- <property name="organisationUnitSelectionManager"
- ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
- <property name="reportLocationManager"
- ref="org.hisp.dhis.reportexcel.ReportLocationManager" />
- <property name="aggregationService" ref="org.hisp.dhis.aggregation.AggregationService" />
- <property name="categoryService"
- ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
- <property name="statementManager" ref="statementManager" />
- <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
- <property name="initPOIStylesManager"
- ref="org.hisp.dhis.reportexcel.preview.manager.InitializePOIStylesManager" />
- </bean>
-
<!-- Clean up Report Excel module -->
<bean id="org.hisp.dhis.reportexcel.filemanager.action.CleanUpDraftFilesAction"
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml'
--- local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml 2011-04-04 04:54:43 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml 2011-04-18 08:23:27 +0000
@@ -705,44 +705,6 @@
/dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
</action>
- <!-- INDIVIDUAL REPORT EXCEL -->
-
- <action name="openIndividualReportExcel"
- class="org.hisp.dhis.reportexcel.export.individual.action.OpenIndividualReportExcelAction">
- <interceptor-ref name="organisationUnitTreeStack" />
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-excel-reporting/individualReportExcel.vm</param>
- <param name="menu">/dhis-web-excel-reporting/menuWithTree.vm</param>
- <param name="menuTreeHeight">220</param>
- <param name="javascripts">
- javascript/individual.js,
- javascript/commons.js,
- ../dhis-web-commons/ouwt/ouwt.js
- </param>
- <param name="stylesheets">style/style.css</param>
- </action>
-
- <action name="filterAvailableDataElementsByDataElementGroup"
- class="org.hisp.dhis.reportexcel.export.individual.action.DataElementListFilteredByGroup">
- <result name="success" type="velocity-xml">
- /dhis-web-excel-reporting/responseDataElementGroup.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <action name="generateIndividualReportExcel"
- class="org.hisp.dhis.reportexcel.export.individual.action.GenerateIndividualReportExcelAction">
- <result name="success" type="velocity-xml">
- /dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
- <result name="error" type="velocity-xml">
- /dhis-web-commons/ajax/xmlResponseError.vm</result>
- </action>
-
- <action name="cleanUpDraftFile"
- class="org.hisp.dhis.reportexcel.filemanager.action.CleanUpDraftFilesAction">
- <result name="success" type="velocity-xml">
- /dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
- </action>
-
<!-- PREVIEW ADVANCED REPORT -->
<action name="previewAdvancedReportExcel"
@@ -1057,7 +1019,13 @@
</action>
<!-- IMPORT DATA -->
-
+
+ <action name="cleanUpDraftFile"
+ class="org.hisp.dhis.reportexcel.filemanager.action.CleanUpDraftFilesAction">
+ <result name="success" type="velocity-xml">
+ /dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
+ </action>
+
<action name="validateUploadExcelImport"
class="org.hisp.dhis.reportexcel.filemanager.action.ValidateUploadExcelFile">
<interceptor-ref name="fileUploadStack" />
=== removed file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/individualReportExcel.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/individualReportExcel.vm 2010-03-08 16:36:21 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/individualReportExcel.vm 1970-01-01 00:00:00 +0000
@@ -1,170 +0,0 @@
-<h3>$i18n.getString( "individual_report" ) #openHelp( "excelReportingIndividualReport" )</h3>
-<div id="tooltip"></div>
-
-<form id="editDataSetForm" name="editDataSetForm" method="post" onsubmit="submitForm(); return validateEditDataSet()">
- <div style="display:inline">
- <input type="hidden" id="dataSetId" name="dataSetId" value="$dataSet.id">
- </div>
-
- <table id="detailsList">
- <col> ## Labels
- <col> ## Input
- <thead>
- </thead>
- <tbody>
-
- <tr>
- <td>
- <!--
- Combobox with all available period types (registration frequencies.
- -->
- </td>
- </tr>
-
- </tbody>
- </table>
-
- <table id="dataElementSelectionArea">
- <col> ## Available DataElements
- <col> ## Filter
- <col> ## Selected DataElements
- <thead>
- <tr>
- <th colspan="3"><strong>Select data element</strong></th>
- </tr>
- <tr>
- <td colspan="3"> </td>
- </tr>
- <tr>
- <th>$i18n.getString( "available_data_elements" )</th>
- <th>$i18n.getString( "filter" )</th>
- <th>$i18n.getString( "selected_data_elements" )</th>
- </tr>
- </thead>
- <tbody>
-
- <tr>
- <td>
- <select id="availabeldataElementGroups" name="availabeldataElementGroups" style="width:30em ; z-index:0"
- onchange="javascript:filterByDataElementGroup( this.options[this.selectedIndex].value )">
- <option value="ALL" selected="selected">$i18n.getString( "all" )</option>
- #foreach ( $dataElementGroup in $dataElementGroups )
- <option value="$dataElementGroup.id" >$encoder.htmlEncode( $dataElementGroup.name )</option>
- #end
- </select>
- </td>
- <td> </td>
- <td></td>
- </tr>
-
- <tr>
- <td><input type="text" id="availableDataElementsFilter" name="availableDataElementsFilter" onKeyUp="filterAvailableDataElements()" style="width:30em"> </td>
- <td> </td>
- <td><input type="text" id="dataSetMembersFilter" name="dataSetMembersFilter" onkeyup="filterDataSetMembers()" style="max-width:30em;min-width:30em"></td>
- </tr>
-
- <tr>
- <td>
- <!-- List of all available DataElements -->
-
- <select size="15" onMouseOut="javascript: hideToolTip();" id="availableDataElements" name="availableDataElements" style="max-width:30em;min-width:30em;height:10em" onChange="getOptionCombos();">
- </select>
- <br><br>
- <strong>$i18n.getString('category_option_combo')</strong><br>
- <select size="15" id="availableOptionCombos" name="availableOptionCombos" style="max-width:30em;min-width:30em;height:10em" ondblclick="addDataSetMembers();">
- </select>
-</td>
- <td>
- <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="addDataSetMembers();">
- <br>
- <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="removeDataSetMembers();">
- </td>
- <td>
- <!-- List of all selected DataElements -->
- <select size="15" onMouseOut="javascript: hideToolTip();" id="selectedDataElements" name="selectedDataElements" style="max-width:30em;min-width:30em;height:22em" ondblclick="removeDataSetMembers();">
- </select>
- </td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <tr>
- <th colspan="3">Select period</th>
- </tr>
- <tr>
- <td colspan="3"> </td>
- </tr>
- <tr>
- <th>$i18n.getString( "available_periods" )</th>
- <th>$i18n.getString( "filter" )</th>
- <th>$i18n.getString( "selected_periods" )</th>
- </tr>
- <tr>
- <td>
- <select id="availabelPeriodTypes" name="availabelPeriodTypes" style="width:30em ;" onChange="javascript: getPeriodsByPeriodTypeName();">
-
- #foreach ( $periodType in $periodTypes )
-
- <option value="$periodType.name" >$i18n.getString( $periodType.name )</option>
-
- #end
-
- </select>
- </td>
- <td> </td>
- <td></td>
- </tr>
- <tr>
- <td><input name="button_previous" type="button" title="$i18n.getString('earlier_periods')" onClick="javascript: lastPeriod();" value="<<" #if( $periods.size() == 0 ) #end>
- <input name="button_later" type="button" title="$i18n.getString('later_periods')" onclick="javascript: nextPeriod();" value=">>" #if( $periods.size() == 0 ) #end></td>
- <td> </td>
- </tr>
- <tr>
- <td>
- <!-- List of all available DataElements -->
- <select size="15" id="availablePeriods" name="availablePeriods" multiple="multiple" style="max-width:30em;min-width:30em;height:20em" ondblclick="moveSelectedById( 'availablePeriods', 'selectedPeriods' );">
-
- </select>
-</td>
- <td>
- <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="moveSelectedById( 'availablePeriods', 'selectedPeriods' );">
- <br>
- <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="moveSelectedById( 'selectedPeriods', 'availablePeriods' );">
- </td>
- <td>
- <!-- List of all selected DataElements -->
- <select id="selectedPeriods" name="selectedPeriods" multiple="multiple" style="max-width:30em;min-width:30em;height:20em" ondblclick="moveSelectedById( 'selectedPeriods', 'availablePeriods' );">
- </select>
- </td>
- </tr>
-
- <tr>
- <td colspan="3">
- <input type="button" value="$i18n.getString( "generate" )" style="width:10em" onClick="generateIndividualReportExcel();">
- <!--input type="button" value="$i18n.getString( "bookmark" )" style="width:10em"-->
- </td>
- </tr>
-
- </tbody>
- </table>
-</form>
-<span id="message"></span>
-<span id="loading" style="display:none;position:fixed;"><img src="../images/ajax-loader.gif" /></span>
-
-<script type="text/javascript">
-
- var dataSetMembers = new Object();
-
- var availableAllDataElements = new Object();
- #foreach ( $availableDataElement in $dataElements )
- availableAllDataElements['$availableDataElement.id'] = '$encoder.jsEscape( $availableDataElement.name, "'" )';
- #end
-
- initLists();
-
- getPeriodsByPeriodTypeName();
-
- var i18n_choose_period = '$encoder.jsEscape($i18n.getString( 'choose_period' ) , "'")';
- var i18n_choose_dataelement = '$encoder.jsEscape($i18n.getString( 'choose_dataelement' ) , "'")';
-
-</script>
=== removed file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/individual.js'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/individual.js 2010-03-12 14:29:20 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/individual.js 1970-01-01 00:00:00 +0000
@@ -1,319 +0,0 @@
-// -----------------------------------------------------------------------------
-// Filter by data element group
-// -----------------------------------------------------------------------------
-
-function getOptionCombos(){
-
- clearListById('availableOptionCombos');
-
- var request = new Request();
- request.setResponseTypeXML( 'xmlObject' );
- request.setCallbackSuccess( getOptionCombosReceived );
- request.send( "getOptionCombos.action?dataElementId=" + byId("availableDataElements").value );
-
-}
-
-function getOptionCombosReceived( xmlObject ){
-
- xmlObject = xmlObject.getElementsByTagName('categoryOptions')[0];
-
- var optionComboList = byId( "availableOptionCombos" );
-
- optionComboList.options.length = 0;
- var optionCombos = xmlObject.getElementsByTagName( "categoryOption" );
- for ( var i = 0; i < optionCombos.length; i++)
- {
- var id = optionCombos[ i ].getAttribute('id');
- var name = optionCombos[ i ].firstChild.nodeValue;
- var option = document.createElement( "option" );
- option.value = id ;
- option.text = name;
- optionComboList.add( option, null );
- }
-}
-
-// -----------------------------------------------------------------------------
-// Filter by data element group
-// -----------------------------------------------------------------------------
-
-function filterByDataElementGroup( selectedDataElementGroup )
-{
-
- var request = new Request();
- var requestString = 'filterAvailableDataElementsByDataElementGroup.action';
- var params = 'dataElementGroupId=' + selectedDataElementGroup;
- var selectedList = byId( 'selectedDataElements' );
-
- for ( var i = 0; i < selectedList.options.length; ++i)
- {
- var selectedValue = selectedList.options[i].value;
-
- var id = selectedValue.substring(selectedValue.indexOf(".") + 1, selectedValue.length);
-
- params += '&selectedDataElements=' + id;
- }
-
- // Clear the Dataelement list
- var availableList = document.getElementById( 'availableDataElements' );
- availableList.options.length = 0;
-
- // Clear the OptionCombo list
- availableList = document.getElementById( 'availableOptionCombos' );
- availableList.options.length = 0;
-
- request.setResponseTypeXML( 'dataElementGroup' );
- request.setCallbackSuccess( filterByDataElementGroupCompleted );
- request.sendAsPost( params );
- request.send( requestString );
-
-}
-
-function filterByDataElementGroupCompleted( dataElementGroup )
-{
- var dataElements = dataElementGroup.getElementsByTagName( 'dataElements' )[0];
- var dataElementList = dataElements.getElementsByTagName( 'dataElement' );
-
- var availableList = byId( 'availableDataElements' );
-
- for ( var i = 0; i < dataElementList.length; i++ )
- {
- var dataElement = dataElementList[i];
- var value = dataElement.firstChild.nodeValue;
- var id = dataElement.getAttribute( 'id' );
- var option = new Option( value, id );
-
- option.onmousemove = function(e){
- showToolTip( e, this.text);
- }
-
- availableList.add( option , null );
- }
-
-}
-
-// -----------------------------------------------------------------------------
-// Filter available data elements
-// -----------------------------------------------------------------------------
-
-function filterAvailableDataElements()
-{
- var filter = document.getElementById( 'availableDataElementsFilter' ).value;
- var list = document.getElementById( 'availableDataElements' );
-
- list.options.length = 0;
-
- for ( var id in availableAllDataElements )
- {
- var value = availableAllDataElements[id];
-
- var option = new Option( value, id );
-
- option.onmousemove = function(e){
- showToolTip(e, name);
- }
-
- if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 )
- {
- list.add(option, null );
- }
- }
-}
-
-function initLists()
-{
- var id;
-
- for ( id in availableAllDataElements )
- {
- var option = new Option( availableAllDataElements[id], id );
-
- option.onmousemove = function(e){
- showToolTip(e, this.text);
- }
- $("#availableDataElements").append( option ) ;
- }
-}
-
-// -----------------------------------------------------------------------------
-// Add and Remove dataSet members
-// -----------------------------------------------------------------------------
-
-function addDataSetMembers()
-{
- var list = document.getElementById( 'availableDataElements' );
-
- var listOptionCombo = document.getElementById( 'availableOptionCombos' );
-
- if ( listOptionCombo.selectedIndex != -1 )
- {
- var id = list.options[list.selectedIndex].value + "." + listOptionCombo[listOptionCombo.selectedIndex].value;
-
- dataSetMembers[id] = list.options[list.selectedIndex].text + " - " + listOptionCombo[listOptionCombo.selectedIndex].text;
-
- var option = new Option( dataSetMembers[id], id );
-
- option.onmousemove = function(e){
- showToolTip( e, this.text);
- }
-
- byId( 'selectedDataElements' ).add(option, null );
-
- listOptionCombo.remove( listOptionCombo.selectedIndex );
- }
-}
-
-function removeDataSetMembers()
-{
- var listOptionCombo = document.getElementById( 'availableOptionCombos' );
-
- var list = document.getElementById( 'selectedDataElements' );
-
- var selectedIndex = list.selectedIndex;
-
- if ( selectedIndex != -1 )
- {
- var selectedValue = list.options[selectedIndex].value;
-
- var id = selectedValue.substring(selectedValue.indexOf(".") + 1, selectedValue.length);
-
- var name = dataSetMembers[selectedValue].substring(dataSetMembers[selectedValue].lastIndexOf(" - ") + 2, dataSetMembers[selectedValue].length);
-
- listOptionCombo.add( new Option( name, id ), null );
-
- list.remove( selectedIndex );
- }
-}
-
-
-function filterDataSetMembers()
-{
- var filter = document.getElementById( 'dataSetMembersFilter' ).value;
-
- var list = document.getElementById( 'selectedDataElements' );
-
- list.options.length = 0;
-
- for ( var id in dataSetMembers )
- {
- var value = dataSetMembers[id];
-
- if (value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 )
- {
- list.add( new Option( value, id ), null );
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-// Get Period by PeriodType
-// -----------------------------------------------------------------------------
-
-function getPeriods(){
-
- var request = new Request();
- request.setResponseTypeXML( 'xmlObject' );
- request.setCallbackSuccess( getListPeriodCompleted );
- request.send( '../dhis-web-commons-ajax/getPeriods.action?name=' + $("#availabelPeriodTypes").val());
-}
-
-function getListPeriodCompleted( xmlObject ){
-
- clearListById('availablePeriods');
- var nodes = xmlObject.getElementsByTagName('period');
- for ( var i = 0; i < nodes.length; i++ )
- {
- node = nodes.item(i);
- var id = node.getElementsByTagName('id')[0].firstChild.nodeValue;
- var name = node.getElementsByTagName('name')[0].firstChild.nodeValue;
- addOption('availablePeriods', name, id);
- }
-}
-
-// -----------------------------------------------------------------------------
-// Generate individual report excel
-// -----------------------------------------------------------------------------
-
-function generateIndividualReportExcel(){
- // Check operands
- var selectedDataElements = byId('selectedDataElements').options;
- var message = '';
- if( selectedDataElements.length==0)
- {
- message = i18n_choose_dataelement + '<br/>';
- }
- // Check periods
- selectedDataElements = byId('selectedPeriods').options;
- if(selectedDataElements.length==0)
- {
- message += i18n_choose_period + '<br/>';
- }
-
- if(message.length > 0 ){
- setMessage(message);
- return;
- }
- $("#loading").showAtCenter( true );
-
- var request = new Request();
- request.setResponseTypeXML( 'xmlObject' );
- request.setCallbackSuccess( generateIndividualReportExcelReceived );
- var params = getQueryStringFromList('selectedDataElements', 'operands');
- params += getQueryStringFromList('selectedPeriods', 'periods');
- request.sendAsPost(params);
- request.send( "generateIndividualReportExcel.action");
-
-}
-
-function generateIndividualReportExcelReceived(xmlObject){
-
- var type = xmlObject.getAttribute( 'type' );
-
- if(type=='error')
- {
- setMessage( xmlObject.firstChild.nodeValue);
- }else if(type=='success')
- {
- window.location = "downloadFile.action?outputFormat=";
- }
-
- deleteDivEffect();
- $("#loading").hide();
-}
-
-
-function getPeriodsByPeriodTypeName() {
-
- var request = new Request();
- request.setResponseTypeXML( 'xmlObject' );
- request.setCallbackSuccess( responseListPeriodReceived );
- request.send( 'getPeriodsByPeriodTypeDB.action?periodTypeName=' + byId("availabelPeriodTypes").value);
-}
-
-function lastPeriod() {
-
- var request = new Request();
- request.setResponseTypeXML( 'xmlObject' );
- request.setCallbackSuccess( responseListPeriodReceived );
- request.send( 'previousPeriodsDB.action' );
-}
-
-function nextPeriod() {
-
- var request = new Request();
- request.setResponseTypeXML( 'xmlObject' );
- request.setCallbackSuccess( responseListPeriodReceived );
- request.send( 'nextPeriodsDB.action' );
-}
-
-function responseListPeriodReceived( xmlObject ) {
-
- clearListById('availablePeriods');
- var list = xmlObject.getElementsByTagName('period');
- for ( var i = 0; i < list.length; i++ )
- {
- item = list[i];
- var id = item.getElementsByTagName('id')[0].firstChild.nodeValue;
- var name = item.getElementsByTagName('name')[0].firstChild.nodeValue;
- addOption('availablePeriods', name, id);
- }
-}
\ No newline at end of file