dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13288
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4209: local vn - Fixed "Data Entry Status".
------------------------------------------------------------
revno: 4209
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-07-26 14:21:49 +0700
message:
local vn - Fixed "Data Entry Status".
removed:
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetAction.java
added:
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetsAction.java
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/UpdateDefaultForDataStatusAction.java
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/loadDefault.vm
modified:
local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultExportReportService.java
local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateExportReportStore.java
local/vn/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/status/hibernate/DataEntryStatus.hbm.xml
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/action/NoAction.java
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/DefaultDataEntryStatusAction.java
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/UpdateDataEntryStatusAction.java
local/vn/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml
local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties
local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties
local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/addDataStatus.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataStatusShow.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataStatus.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/menu.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseDataSets.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/updateDataStatus.vm
--
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-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultExportReportService.java'
--- local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultExportReportService.java 2011-07-20 07:16:20 +0000
+++ local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultExportReportService.java 2011-07-26 07:21:49 +0000
@@ -53,9 +53,9 @@
public class DefaultExportReportService
implements ExportReportService
{
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
// Dependency
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
private ExportReportStore exportReportStore;
@@ -253,9 +253,9 @@
exportReportStore.deleteDataElementGroupOrder( id );
}
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
// Data Entry Status
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
public int countDataValueOfDataSet( DataSet arg0, OrganisationUnit arg1, Period arg2 )
{
=== modified file 'local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateExportReportStore.java'
--- local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateExportReportStore.java 2011-07-22 09:27:59 +0000
+++ local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateExportReportStore.java 2011-07-26 07:21:49 +0000
@@ -392,6 +392,7 @@
{
Criteria criteria = session.createCriteria( DataEntryStatus.class );
criteria.add( Restrictions.eq( "dataSet", dataSet ) );
+ criteria.add( Restrictions.eq( "makeDefault", true ) );
result.addAll( criteria.list() );
}
=== modified file 'local/vn/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/status/hibernate/DataEntryStatus.hbm.xml'
--- local/vn/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/status/hibernate/DataEntryStatus.hbm.xml 2011-06-06 08:12:19 +0000
+++ local/vn/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/status/hibernate/DataEntryStatus.hbm.xml 2011-07-26 07:21:49 +0000
@@ -3,15 +3,18 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
- <class name="org.hisp.dhis.reportexcel.status.DataEntryStatus"
- table="dataentrystatus">
+ <class name="org.hisp.dhis.reportexcel.status.DataEntryStatus" table="dataentrystatus">
+
<id name="id" column="datastatusid">
<generator class="native" />
</id>
+
<property name="makeDefault" column="makedefault" />
- <many-to-one name="dataSet" column="datasetid"
- foreign-key="pk_dataset_dataentrystatus" />
- <many-to-one name="periodType" column="periodtype"
- foreign-key="pk_periodtype_dataentrystatus" />
+
+ <properties name="dataset_periodtype_unique_key" unique="true">
+ <many-to-one name="dataSet" class="org.hisp.dhis.dataset.DataSet" column="datasetid" foreign-key="pk_dataset_dataentrystatus" />
+ <many-to-one name="periodType" class="org.hisp.dhis.period.PeriodType" column="periodtype" foreign-key="pk_periodtype_dataentrystatus" />
+ </properties>
+
</class>
</hibernate-mapping>
\ No newline at end of file
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/action/NoAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/action/NoAction.java 2011-03-25 09:11:30 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/action/NoAction.java 2011-07-26 07:21:49 +0000
@@ -30,15 +30,36 @@
import com.opensymphony.xwork2.Action;
/**
- * @author Tran Thanh Tri
- * @version $Id$
+ * @author Lars Helge Overland
*/
public class NoAction
implements Action
{
+ // TODO remove not required with struts2
+
+ // -------------------------------------------------------------------------
+ // Input & Output
+ // -------------------------------------------------------------------------
+
+ private String backUrl;
+
+ public String getBackUrl()
+ {
+ return backUrl;
+ }
+
+ public void setBackUrl( String backUrl )
+ {
+ this.backUrl = backUrl;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
public String execute()
- throws Exception
{
return SUCCESS;
}
+
}
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/DefaultDataEntryStatusAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/DefaultDataEntryStatusAction.java 2011-05-24 07:48:23 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/DefaultDataEntryStatusAction.java 2011-07-26 07:21:49 +0000
@@ -1,5 +1,7 @@
+package org.hisp.dhis.reportexcel.dataentrystatus.action;
+
/*
- * 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
@@ -24,8 +26,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package org.hisp.dhis.reportexcel.dataentrystatus.action;
-
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
@@ -43,7 +43,6 @@
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.period.comparator.PeriodComparator;
import org.hisp.dhis.reportexcel.ExportReportService;
import org.hisp.dhis.reportexcel.status.DataEntryStatus;
@@ -184,26 +183,28 @@
dataSets.retainAll( dataSetUserAuthorityGroups );
}
- dataStatus = new ArrayList<DataEntryStatus>( exportReportService.getDataEntryStatusDefaultByDataSets( dataSets ) );
+ dataStatus = new ArrayList<DataEntryStatus>( exportReportService
+ .getDataEntryStatusDefaultByDataSets( dataSets ) );
maps = new HashMap<DataSet, List<DataEntryStatus>>();
Calendar calendar = Calendar.getInstance();
+ List<Period> periods = null;
for ( DataEntryStatus d : dataStatus )
{
d.setNumberOfDataElement( d.getDataSet().getDataElements().size() );
- PeriodType periodType = d.getPeriodType();
-
- List<Period> periods = new ArrayList<Period>( periodService.getPeriodsBetweenDates( periodType,
- DateUtils.getFirstDayOfYear( calendar.get( Calendar.YEAR ) ), DateUtils.getLastDayOfYear( calendar
- .get( Calendar.YEAR ) ) ) );
+ periods = new ArrayList<Period>( periodService.getPeriodsBetweenDates( d.getPeriodType(), DateUtils
+ .getFirstDayOfYear( calendar.get( Calendar.YEAR ) ), DateUtils.getLastDayOfYear( calendar
+ .get( Calendar.YEAR ) ) ) );
+
+ Collections.sort( periods, new PeriodComparator() );
+
List<DataEntryStatus> ds_temp = new ArrayList<DataEntryStatus>();
- Collections.sort( periods, new PeriodComparator() );
+
for ( Period p : periods )
{
-
DataEntryStatus dataStatusNew = new DataEntryStatus();
dataStatusNew.setPeriod( p );
dataStatusNew.setNumberOfDataElement( d.getNumberOfDataElement() );
=== removed file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetAction.java 2011-07-22 09:27:59 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetAction.java 1970-01-01 00:00:00 +0000
@@ -1,119 +0,0 @@
-package org.hisp.dhis.reportexcel.dataentrystatus.action;
-
-/*
- * Copyright (c) 2004-2011, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
-import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
-import org.hisp.dhis.user.CurrentUserService;
-import org.hisp.dhis.user.UserAuthorityGroup;
-import org.hisp.dhis.user.UserCredentials;
-import org.hisp.dhis.user.UserService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Tran Thanh Tri
- * @version $Id$
- */
-public class GetDataSetAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependency
- // -------------------------------------------------------------------------
-
- private CurrentUserService currentUserService;
-
- public void setCurrentUserService( CurrentUserService currentUserService )
- {
- this.currentUserService = currentUserService;
- }
-
- private UserService userService;
-
- public void setUserService( UserService userService )
- {
- this.userService = userService;
- }
-
- private OrganisationUnitSelectionManager selectionManager;
-
- public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
- {
- this.selectionManager = selectionManager;
- }
-
- // -------------------------------------------------------------------------
- // Getter & Setter
- // -------------------------------------------------------------------------
-
- private List<DataSet> dataSets;
-
- public List<DataSet> getDataSets()
- {
- return dataSets;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- if ( selectionManager.getSelectedOrganisationUnit() != null )
- {
- dataSets = new ArrayList<DataSet>( selectionManager.getSelectedOrganisationUnit().getDataSets() );
-
- if ( !currentUserService.currentUserIsSuper() )
- {
- UserCredentials userCredentials = userService.getUserCredentials( currentUserService.getCurrentUser() );
-
- Set<DataSet> dataSetUserAuthorityGroups = new HashSet<DataSet>();
-
- for ( UserAuthorityGroup userAuthorityGroup : userCredentials.getUserAuthorityGroups() )
- {
- dataSetUserAuthorityGroups.addAll( userAuthorityGroup.getDataSets() );
- }
-
- dataSets.retainAll( dataSetUserAuthorityGroups );
- }
- }
-
- Collections.sort( dataSets, new DataSetNameComparator() );
-
- return SUCCESS;
- }
-
-}
=== added file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetsAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetsAction.java 1970-01-01 00:00:00 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetsAction.java 2011-07-26 07:21:49 +0000
@@ -0,0 +1,144 @@
+package org.hisp.dhis.reportexcel.dataentrystatus.action;
+
+/*
+ * Copyright (c) 2004-2011, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
+import org.hisp.dhis.reportexcel.ExportReportService;
+import org.hisp.dhis.reportexcel.status.DataEntryStatus;
+import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.user.UserAuthorityGroup;
+import org.hisp.dhis.user.UserCredentials;
+import org.hisp.dhis.user.UserService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Tran Thanh Tri
+ * @version $Id$
+ */
+public class GetDataSetsAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependency
+ // -------------------------------------------------------------------------
+
+ private CurrentUserService currentUserService;
+
+ public void setCurrentUserService( CurrentUserService currentUserService )
+ {
+ this.currentUserService = currentUserService;
+ }
+
+ private UserService userService;
+
+ public void setUserService( UserService userService )
+ {
+ this.userService = userService;
+ }
+
+ private DataSetService dataSetService;
+
+ public void setDataSetService( DataSetService dataSetService )
+ {
+ this.dataSetService = dataSetService;
+ }
+
+ private ExportReportService exportReportService;
+
+ public void setExportReportService( ExportReportService exportReportService )
+ {
+ this.exportReportService = exportReportService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Getter & Setter
+ // -------------------------------------------------------------------------
+
+ private Integer dataSetId;
+
+ public void setDataSetId( Integer dataSetId )
+ {
+ this.dataSetId = dataSetId;
+ }
+
+ private List<DataSet> dataSets = new ArrayList<DataSet>();
+
+ public List<DataSet> getDataSets()
+ {
+ return dataSets;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ dataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
+
+ for ( DataEntryStatus des : exportReportService.getALLDataEntryStatus() )
+ {
+ if ( dataSets.contains( des.getDataSet() ) )
+ {
+ dataSets.remove( des.getDataSet() );
+ }
+ }
+
+ if ( dataSetId != null )
+ {
+ dataSets.add( dataSetService.getDataSet( dataSetId ) );
+ }
+
+ if ( !currentUserService.currentUserIsSuper() )
+ {
+ UserCredentials userCredentials = userService.getUserCredentials( currentUserService.getCurrentUser() );
+
+ Set<DataSet> dataSetUserAuthorityGroups = new HashSet<DataSet>();
+
+ for ( UserAuthorityGroup userAuthorityGroup : userCredentials.getUserAuthorityGroups() )
+ {
+ dataSetUserAuthorityGroups.addAll( userAuthorityGroup.getDataSets() );
+ }
+
+ dataSets.retainAll( dataSetUserAuthorityGroups );
+ }
+
+ Collections.sort( dataSets, new DataSetNameComparator() );
+
+ return SUCCESS;
+ }
+}
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/UpdateDataEntryStatusAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/UpdateDataEntryStatusAction.java 2011-05-24 07:48:23 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/UpdateDataEntryStatusAction.java 2011-07-26 07:21:49 +0000
@@ -1,7 +1,7 @@
package org.hisp.dhis.reportexcel.dataentrystatus.action;
/*
- * 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
@@ -41,17 +41,27 @@
implements Action
{
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
// Dependency
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
+
+ private DataSetService dataSetService;
+
+ public void setDataSetService( DataSetService dataSetService )
+ {
+ this.dataSetService = dataSetService;
+ }
private ExportReportService exportReportService;
- private DataSetService dataSetService;
+ public void setExportReportService( ExportReportService exportReportService )
+ {
+ this.exportReportService = exportReportService;
+ }
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
// Input
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
private Integer dataSetId;
@@ -59,25 +69,15 @@
private Integer dataStatusId;
- // -------------------------------------------------
+ // -------------------------------------------------------------------------
// Getter & Setter
- // -------------------------------------------------
-
- public void setExportReportService( ExportReportService exportReportService )
- {
- this.exportReportService = exportReportService;
- }
+ // -------------------------------------------------------------------------
public void setDataStatusId( Integer dataStatusId )
{
this.dataStatusId = dataStatusId;
}
- public void setDataSetService( DataSetService dataSetService )
- {
- this.dataSetService = dataSetService;
- }
-
public void setDataSetId( Integer dataSetId )
{
this.dataSetId = dataSetId;
@@ -87,6 +87,10 @@
{
this.makeDefault = makeDefault;
}
+
+ // -------------------------------------------------------------------------
+ // Method implementation
+ // -------------------------------------------------------------------------
public String execute()
throws Exception
=== added file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/UpdateDefaultForDataStatusAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/UpdateDefaultForDataStatusAction.java 1970-01-01 00:00:00 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/UpdateDefaultForDataStatusAction.java 2011-07-26 07:21:49 +0000
@@ -0,0 +1,92 @@
+package org.hisp.dhis.reportexcel.dataentrystatus.action;
+
+/*
+ * Copyright (c) 2004-2011, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+import org.hisp.dhis.reportexcel.ExportReportService;
+import org.hisp.dhis.reportexcel.status.DataEntryStatus;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Dang Duy Hieu
+ * @version $Id$
+ */
+public class UpdateDefaultForDataStatusAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependency
+ // -------------------------------------------------------------------------
+
+ private ExportReportService exportReportService;
+
+ public void setExportReportService( ExportReportService exportReportService )
+ {
+ this.exportReportService = exportReportService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Getter & Setter
+ // -------------------------------------------------------------------------
+
+ private Integer dataStatusId;
+
+ public void setDataStatusId( Integer dataStatusId )
+ {
+ this.dataStatusId = dataStatusId;
+ }
+
+ private boolean makeDefault;
+
+ public void setMakeDefault( boolean makeDefault )
+ {
+ this.makeDefault = makeDefault;
+ }
+
+ private DataEntryStatus dataStatus;
+
+ public DataEntryStatus getDataStatus()
+ {
+ return dataStatus;
+ }
+
+ // -------------------------------------------------------------------------
+ // Method implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ dataStatus = exportReportService.getDataEntryStatus( dataStatusId );
+
+ dataStatus.setMakeDefault( makeDefault );
+
+ exportReportService.updateDataEntryStatus( dataStatus );
+
+ return SUCCESS;
+ }
+}
\ No newline at end of file
=== 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-07-20 07:16:20 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-07-26 07:21:49 +0000
@@ -624,6 +624,13 @@
</bean>
<bean
+ id="org.hisp.dhis.reportexcel.dataentrystatus.action.UpdateDefaultForDataStatusAction"
+ class="org.hisp.dhis.reportexcel.dataentrystatus.action.UpdateDefaultForDataStatusAction"
+ scope="prototype">
+ <property name="exportReportService" ref="org.hisp.dhis.reportexcel.ExportReportService" />
+ </bean>
+
+ <bean
id="org.hisp.dhis.reportexcel.dataentrystatus.action.DeleteDataEntryStatusAction"
class="org.hisp.dhis.reportexcel.dataentrystatus.action.DeleteDataEntryStatusAction"
scope="prototype">
@@ -652,13 +659,15 @@
</bean>
<bean
- id="org.hisp.dhis.reportexcel.dataentrystatus.action.GetDataSetAction"
- class="org.hisp.dhis.reportexcel.dataentrystatus.action.GetDataSetAction"
+ id="org.hisp.dhis.reportexcel.dataentrystatus.action.GetDataSetsAction"
+ class="org.hisp.dhis.reportexcel.dataentrystatus.action.GetDataSetsAction"
scope="prototype">
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
<property name="userService" ref="org.hisp.dhis.user.UserService" />
- <property name="selectionManager"
- ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
+ <property name="dataSetService"
+ ref="org.hisp.dhis.dataset.DataSetService" />
+ <property name="exportReportService"
+ ref="org.hisp.dhis.reportexcel.ExportReportService" />
</bean>
<!-- DATA SET COMPLETED BEAN -->
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties'
--- local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties 2011-07-20 07:16:20 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties 2011-07-26 07:21:49 +0000
@@ -77,6 +77,7 @@
selected_user_roles = Selected user roles
administration = Administration
select_report = Select report
+view_data_status = View Data Entry Status
data_status = Data Entry Status
data_status_management = Data Entry Status Management
make_default = Make as default
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties'
--- local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties 2011-07-11 06:03:14 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties 2011-07-26 07:21:49 +0000
@@ -102,6 +102,7 @@
select_excel_file = Ch\u1ecdn t\u1eadp tin excel
upload_file = T\u1ea3i l\u00ean
view = Xem b\u00e1o c\u00e1o
+view_data_status = Xem b\u00e1o c\u00e1o t\u00ecnh tr\u1ea1ng nh\u1eadp li\u1ec7u
data_status = T\u00ecnh tr\u1ea1ng nh\u1eadp li\u1ec7u
data_status_management = Qu\u1ea3n l\u00fd t\u00ecnh tr\u1ea1ng nh\u1eadp li\u1ec7u
make_default = M\u1eb7c \u0111\u1ecbnh
=== 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-07-20 07:16:20 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml 2011-07-26 07:21:49 +0000
@@ -537,6 +537,12 @@
</result>
<param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
</action>
+
+ <action name="updateDefault"
+ class="org.hisp.dhis.reportexcel.dataentrystatus.action.UpdateDefaultForDataStatusAction">
+ <result name="success" type="velocity">/dhis-web-excel-reporting/loadDefault.vm</result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
<action name="deleteDataEntryStatus"
class="org.hisp.dhis.reportexcel.dataentrystatus.action.DeleteDataEntryStatusAction">
@@ -545,29 +551,23 @@
<param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
</action>
+ <action name="openAddDataEntryStatus" class="org.hisp.dhis.reportexcel.action.NoAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-excel-reporting/addDataStatus.vm</param>
+ <param name="menu">/dhis-web-excel-reporting/menu.vm</param>
+ <param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
+ </action>
+
<action name="openUpdateDataEntryStatus"
class="org.hisp.dhis.reportexcel.dataentrystatus.action.GetDataEntryStatusAction">
- <interceptor-ref name="organisationUnitTreeStack" />
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-excel-reporting/updateDataStatus.vm</param>
- <param name="menu">/dhis-web-excel-reporting/menuWithTree.vm</param>
- <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/datastatus.js</param>
- <param name="menuTreeHeight">400</param>
- <param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
- </action>
-
- <action name="openAddDataEntryStatus" class="org.hisp.dhis.reportexcel.action.NoAction">
- <interceptor-ref name="organisationUnitTreeStack" />
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-excel-reporting/addDataStatus.vm</param>
- <param name="menu">/dhis-web-excel-reporting/menuWithTree.vm</param>
- <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/datastatus.js</param>
- <param name="menuTreeHeight">400</param>
+ <param name="menu">/dhis-web-excel-reporting/menu.vm</param>
<param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
</action>
<action name="getDataSets"
- class="org.hisp.dhis.reportexcel.dataentrystatus.action.GetDataSetAction">
+ class="org.hisp.dhis.reportexcel.dataentrystatus.action.GetDataSetsAction">
<result name="success" type="velocity-xml">
/dhis-web-excel-reporting/responseDataSets.vm</result>
</action>
@@ -584,7 +584,7 @@
<action name="viewByPeriodForm"
class="org.hisp.dhis.reportexcel.datasetcompleted.action.ViewByPeriodFormAction">
<result name="success" type="velocity-json">../dhis-web-commons/ajax/jsonPeriods.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
+ <param name="onExceptionReturn">plainTextError</param>
</action>
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/addDataStatus.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/addDataStatus.vm 2010-02-24 17:47:59 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/addDataStatus.vm 2011-07-26 07:21:49 +0000
@@ -1,33 +1,38 @@
-<h3>$i18n.getString( "add" ) $i18n.getString( "dataset_completed_report" )</h3>
+<script>
+ jQuery(document).ready(function(){
+ validation( 'addDataEntryStatus', function( form ){ form.submit(); } );
+ });
+</script>
+
+<h3>$i18n.getString( "add" ) $i18n.getString( "data_status" )</h3>
+
+<form id="addDataEntryStatus" action="addDataEntryStatus.action" method="post">
<table>
<tr>
- <td>$i18n.getString( 'dataset' )</td>
+ <td><label for="name">$i18n.getString( 'dataset' )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
- <select id="dataSetId" name="dataSetId">
+ <select id="dataSetId" name="dataSetId" class="{validate:{required:true}}">
</select>
</td>
</tr>
<tr>
<td>$i18n.getString( 'make_default' )</td>
- <td><input type="checkbox" id="makeDefault" name="makeDefault"/></td>
+ <td><input type="checkbox" id="makeDefault" name="makeDefault" value="true"/></td>
</tr>
<tr>
<td></td>
<td> </td>
</tr>
<tr>
- <td colspan=2 align=center>
- <input type="button" value="$i18n.getString( 'ok' )" style="width:100px" onclick="addDataStatus()"/>
- <input type="button" value="$i18n.getString( 'cancel' )" style="width:100px" onclick="window.location = 'listDataEntryStatus.action'"/>
+ <td colspan="2" align="center">
+ <input type="submit" value="$i18n.getString( 'ok' )" style="width:100px"/>
+ <input type="button" value="$i18n.getString( 'cancel' )" style="width:100px" onclick="window.location='listDataEntryStatus.action'"/>
</td>
</tr>
</table>
+</form>
<script language="javascript">
- function addDataStatus(){
- window.location = 'addDataEntryStatus.action?dataSetId=' + getFieldValue('dataSetId') + "&makeDefault=" + document.getElementById('makeDefault').checked;
- }
-
-
+
var request = new Request();
request.setCallbackSuccess( dataSetResponse );
request.setResponseTypeXML( 'xmlObject' );
@@ -37,7 +42,8 @@
var listDataSet = xmlObject.getElementsByTagName("dataset");
var dataSets = document.getElementById("dataSetId");
dataSets.options.length = 0;
- for(var i=0;i<listDataSet.length;i++){
+ for ( var i=0 ; i < listDataSet.length ; i++ )
+ {
var id = listDataSet.item(i).getElementsByTagName('id')[0].firstChild.nodeValue;
var name = listDataSet.item(i).getElementsByTagName('name')[0].firstChild.nodeValue;
dataSets.options.add(new Option(name, id),null);
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataStatusShow.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataStatusShow.vm 2010-03-08 16:36:21 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/dataStatusShow.vm 2011-07-26 07:21:49 +0000
@@ -1,4 +1,4 @@
-<h3>$i18n.getString( "dataset_completed_report" ) #openHelp( "excelReportingDataEntryStatusReport" )</h3>
+<h3>$i18n.getString( "data_status" ) #openHelp( "excelReportingDataEntryStatusReport" )</h3>
<table width="100%" class="list">
<tr>
@@ -14,9 +14,7 @@
#foreach($ds_ in $maps.get($ds.dataSet))
<tr style="background-color:white">
<td rowspan=2 style="width:150px">$format.formatPeriod($ds_.period)</td>
- <td rowspan=2 style="width:25px">
- <a href="javascript:viewData($ds.dataSet.id,$ds_.period.id,$organisationUnit.id)"><img src="../images/view_report.png" title="$i18n.getString( 'view_data' )"></a>
- </td>
+ <td rowspan=2 style="width:25px"><a href="javascript:viewData($ds.dataSet.id,$ds_.period.id,$organisationUnit.id)"><img src="../images/view_report.png" title="$i18n.getString( 'view_data' )"></a></td>
<td style="width:150px">$i18n.getString( 'number_datavalue' )</td>
<td title="$ds_.numberOfDataValue/$ds_.numberOfDataElement"><div style="text-align:center;#if($ds_.getCompletedPercent()>0) padding:2px;color:white; #end width:$ds_.getCompletedPercent()%;background-color:green;">$ds_.getCompletedPercent()%</div></td>
</tr>
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataStatus.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataStatus.vm 2010-05-26 04:01:21 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataStatus.vm 2011-07-26 07:21:49 +0000
@@ -1,4 +1,4 @@
-<h3>$i18n.getString( "data_status" ) #openHelp( "excelReportingDataEntryStatus" )</h3>
+<h3>$i18n.getString( "data_status_management" ) #openHelp( "excelReportingDataEntryStatus" )</h3>
<table width="100%">
<tr>
<td>
@@ -23,8 +23,8 @@
#foreach($ds in $dataStatus)
<tr #alternate( $mark )>
<td>$ds.dataSet.name</td>
- <td>
- <input type="checkbox" #if($ds.makeDefault) checked=true #end disabled=true/>
+ <td id="td${ds.id}">
+ <input type="checkbox" #if($ds.makeDefault) checked="true" #end value="$ds.makeDefault" onchange="updateDefault( $ds.id, $ds.makeDefault )"/>
</td>
<td>
<a href="javascript:deleteDataStatus('$ds.id');" title="$i18n.getString( 'delete' )"><img src="../images/delete.png" alt="$i18n.getString( 'delete' )"></a>
@@ -48,6 +48,12 @@
window.location = "deleteDataEntryStatus.action?dataStatusId=" + id;
}
}
+
+ function updateDefault( id, value )
+ {
+ jQuery( "#td" + id ).load( 'updateDefault.action', { dataStatusId: id, makeDefault: !value }, function() {});
+ }
+
jQuery(document).ready(function(){
tableSorter( 'listTable' );
});
=== added file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/loadDefault.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/loadDefault.vm 1970-01-01 00:00:00 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/loadDefault.vm 2011-07-26 07:21:49 +0000
@@ -0,0 +1,1 @@
+<input type="checkbox" #if($dataStatus.makeDefault) checked="true" #end value="$dataStatus.makeDefault" onchange="updateDefault( $dataStatus.id, $dataStatus.makeDefault )"/>
\ No newline at end of file
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/menu.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/menu.vm 2011-05-27 04:45:31 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/menu.vm 2011-07-26 07:21:49 +0000
@@ -2,7 +2,7 @@
<h2><a href="selectExportReportParam.action">$i18n.getString( "generate_report" ) </a></h2>
<ul>
- <li><a href="viewDataEntryStatus.action">$i18n.getString( "data_status" )</a></li>
+ <li><a href="viewDataEntryStatus.action">$i18n.getString( "view_data_status" )</a></li>
<li><a href="selectExportReportParam.action">$i18n.getString( "generate_report" ) </a></li>
<!--
<li><a href="viewJCharts.action">$i18n.getString( "chart" ) </a></li>
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseDataSets.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseDataSets.vm 2009-09-14 03:19:36 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/responseDataSets.vm 2011-07-26 07:21:49 +0000
@@ -3,7 +3,7 @@
#foreach( $dataSet in $dataSets )
<dataset>
<id>$dataSet.id</id>
- <name>$dataSet.name</name>
+ <name>$encoder.xmlEncode( $dataSet.name )</name>
</dataset>
#end
</datasets>
\ No newline at end of file
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/updateDataStatus.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/updateDataStatus.vm 2011-05-27 04:45:31 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/updateDataStatus.vm 2011-07-26 07:21:49 +0000
@@ -1,13 +1,21 @@
+<script>
+ jQuery(document).ready(function(){
+ validation( 'updateDataEntryStatus', function( form ){ form.submit(); });
+ });
+</script>
+
<h3>$i18n.getString( "edit" ) $i18n.getString( "data_status" )</h3>
+<form id="updateDataEntryStatus" action="updateDataEntryStatus.action" method="post">
+<input type="hidden" id="dataStatusId" name="dataStatusId" value="$dataStatus.id" />
<table>
<tr>
- <td>$i18n.getString( 'dataset' )</td>
- <td><select id="dataSetId" name="dataSetId"></select></td>
+ <td><label for="name">$i18n.getString( 'dataset' )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><select id="dataSetId" name="dataSetId" class="{validate:{required:true}}"></select></td>
</tr>
<tr>
<td>$i18n.getString( 'make_default' )</td>
- <td><input type="checkbox" id="makeDefault" name="makeDefault" #if($dataStatus.frontPage) checked=true #end/></td>
+ <td><input type="checkbox" id="makeDefault" name="makeDefault" #if($dataStatus.makeDefault) checked="true" #end value="true"/></td>
</tr>
<tr>
<td></td>
@@ -15,35 +23,34 @@
</tr>
<tr>
<td colspan="2" align="center">
- <input type="button" value="$i18n.getString( 'ok' )" style="width:100px" onclick="updateDataStatus()"/>
+ <input type="submit" value="$i18n.getString( 'ok' )" style="width:100px"/>
<input type="button" value="$i18n.getString( 'cancel' )" style="width:100px" onclick="window.location = 'listDataEntryStatus.action'"/>
</td>
</tr>
</table>
+</form>
<script language="javascript">
- function updateDataStatus(){
- var url = "updateDataEntryStatus.action?dataStatusId=" + $dataStatus.id + "&dataSetId=" + getFieldValue('dataSetId') + "&makeDefault=" + document.getElementById('makeDefault').checked;
- window.location = url;
- }
var request = new Request();
request.setCallbackSuccess( dataSetResponse );
request.setResponseTypeXML( 'xmlObject' );
- request.send( 'getDataSets.action' );
+ request.send( 'getDataSets.action?dataSetId=' + $!dataStatus.dataSet.id );
function dataSetResponse( xmlObject ){
var listDataSet = xmlObject.getElementsByTagName("dataset");
var dataSets = document.getElementById("dataSetId");
dataSets.options.length = 0;
- for(var i=0;i<listDataSet.length;i++){
+
+ for (var i=0 ; i < listDataSet.length ; i++ )
+ {
var id = listDataSet.item(i).getElementsByTagName('id')[0].firstChild.nodeValue;
var name = listDataSet.item(i).getElementsByTagName('name')[0].firstChild.nodeValue;
- var option = new Option(name, id);
- if(id == $dataStatus.dataSet.id){
+ var option = new Option(name, id);
+ if ( id == $dataStatus.dataSet.id )
+ {
option.selected = true;
}
dataSets.options.add(option,null);
-
}
}
</script>
\ No newline at end of file