dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #08861
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2220: Merged r 2056 from 2.0.5
------------------------------------------------------------
revno: 2220
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2010-11-29 17:43:07 +0100
message:
Merged r 2056 from 2.0.5
removed:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SortOrderSection.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/GetSectionListSortOrderAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionSortOrderAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortSectionForm.vm
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/SectionOrderComparator.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.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-api/src/main/java/org/hisp/dhis/dataset/comparator/SectionOrderComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/SectionOrderComparator.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/SectionOrderComparator.java 2010-11-29 16:43:07 +0000
@@ -36,6 +36,6 @@
{
public int compare( Section o1, Section o2 )
{
- return o1.getSortOrder() - o2.getSortOrder();
+ return o2.getSortOrder() - o1.getSortOrder();
}
}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/GetSectionListSortOrderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/GetSectionListSortOrderAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/GetSectionListSortOrderAction.java 2010-11-29 16:43:07 +0000
@@ -0,0 +1,79 @@
+package org.hisp.dhis.dataset.action.section;
+
+/*
+ * Copyright (c) 2004-2010, 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.List;
+
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.Section;
+import org.hisp.dhis.dataset.comparator.SectionOrderComparator;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Lars Helge Overland
+ * @version $Id$
+ */
+public class GetSectionListSortOrderAction
+ implements Action
+{
+ private DataSetService dataSetService;
+
+ public void setDataSetService( DataSetService dataSetService )
+ {
+ this.dataSetService = dataSetService;
+ }
+
+ private Integer dataSetId;
+
+ public void setDataSetId( Integer dataSetId )
+ {
+ this.dataSetId = dataSetId;
+ }
+
+ private List<Section> sections;
+
+ public List<Section> getSections()
+ {
+ return sections;
+ }
+
+ public String execute()
+ {
+ DataSet dataSet = dataSetService.getDataSet( dataSetId );
+
+ sections = new ArrayList<Section>( dataSet.getSections() );
+
+ Collections.sort( sections, new SectionOrderComparator() );
+
+ return SUCCESS;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionSortOrderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionSortOrderAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionSortOrderAction.java 2010-11-29 16:43:07 +0000
@@ -0,0 +1,75 @@
+package org.hisp.dhis.dataset.action.section;
+
+/*
+ * Copyright (c) 2004-2010, 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.List;
+
+import org.hisp.dhis.dataset.Section;
+import org.hisp.dhis.dataset.SectionService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Lars Helge Overland
+ * @version $Id$
+ */
+public class SaveSectionSortOrderAction
+ implements Action
+{
+ private SectionService sectionService;
+
+ public void setSectionService( SectionService sectionService )
+ {
+ this.sectionService = sectionService;
+ }
+
+ private List<String> sections;
+
+ public void setSections( List<String> sections )
+ {
+ this.sections = sections;
+ }
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ int sortOrder = 1;
+
+ for ( String id : sections )
+ {
+ Section section = sectionService.getSection( Integer.parseInt( id ) );
+
+ section.setSortOrder( sortOrder++ );
+
+ sectionService.updateSection( section );
+ }
+
+ return SUCCESS;
+ }
+}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SortOrderSection.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SortOrderSection.java 2010-07-07 10:22:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SortOrderSection.java 1970-01-01 00:00:00 +0000
@@ -1,134 +0,0 @@
-package org.hisp.dhis.dataset.action.section;
-
-/*
- * Copyright (c) 2004-2010, 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.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.Section;
-import org.hisp.dhis.dataset.SectionService;
-
-import com.opensymphony.xwork2.Action;
-
-public class SortOrderSection
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private SectionService sectionService;
-
- private DataSetService dataSetService;
-
- public void setDataSetService( DataSetService dataSetService )
- {
- this.dataSetService = dataSetService;
- }
-
- public void setSectionService( SectionService sectionService )
- {
- this.sectionService = sectionService;
- }
-
- // -------------------------------------------------------------------------
- // Input & output
- // -------------------------------------------------------------------------
-
- private Integer dataSetId;
-
- private List<String> selectedList = new ArrayList<String>();;
-
- private DataSet dataSet;
-
- private Set<Section> sections = new HashSet<Section>();
-
- public Set<Section> getSections()
- {
- return sections;
- }
-
- public DataSet getDataSet()
- {
- return dataSet;
- }
-
- public Integer getDataSetId()
- {
- return dataSetId;
- }
-
- public void setDataSetId( Integer dataSetId )
- {
- this.dataSetId = dataSetId;
- }
-
- public void setSelectedList( List<String> selectedList )
- {
- this.selectedList = selectedList;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
-
- if ( dataSetId != null )
- {
- dataSet = dataSetService.getDataSet( dataSetId.intValue() );
- sections = dataSet.getSections();
-
- return INPUT;
- }
-
-
- if ( selectedList.size() == 0 )
- {
- return INPUT;
- }
-
- int i = 0;
-
- for ( String id : selectedList )
- {
- Section temp = sectionService.getSection( Integer.parseInt( id ) );
- temp.setSortOrder( i++ );
-
- sectionService.updateSection( temp );
- }
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml 2010-11-29 16:21:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml 2010-11-29 16:43:07 +0000
@@ -141,6 +141,22 @@
</property>
</bean>
+ <bean id="org.hisp.dhis.dataset.action.section.SaveSectionSortOrderAction"
+ class="org.hisp.dhis.dataset.action.section.SaveSectionSortOrderAction"
+ scope="prototype">
+ <property name="sectionService">
+ <ref bean="org.hisp.dhis.dataset.SectionService"/>
+ </property>
+ </bean>
+
+ <bean id="org.hisp.dhis.dataset.action.section.GetSectionListSortOrderAction"
+ class="org.hisp.dhis.dataset.action.section.GetSectionListSortOrderAction"
+ scope="prototype">
+ <property name="dataSetService">
+ <ref bean="org.hisp.dhis.dataset.DataSetService"/>
+ </property>
+ </bean>
+
<!-- DataSet -->
<bean id="org.hisp.dhis.dataset.action.DefineDataSetAssociationsAction"
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties 2010-10-29 15:38:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties 2010-11-29 16:43:07 +0000
@@ -127,4 +127,5 @@
datasets_different_orgunitlist = These selected datasets are not the same the list of organsation unit.
optional = Optional expansion
dataelement_is_inserted = Data Element was inserted
-done = Done
\ No newline at end of file
+done = Done
+section_sort_order = Section sort order
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-11-29 16:21:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-11-29 16:43:07 +0000
@@ -61,15 +61,7 @@
<result name="error" type="velocity-json">../dhis-web-commons/ajax/jsonResponseError.vm</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
-
- <action name="sortOrderSection" class="org.hisp.dhis.dataset.action.section.SortOrderSection">
- <result name="input" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-maintenance-dataset/sortOrderSection.vm</param>
- <param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
- <result name="success" type="chain">section</result>
- <param name="javascripts">javascript/dataSet.js</param>
- </action>
-
+
<action name="getSection"
class="org.hisp.dhis.dataset.action.section.GetSectionAction">
<result name="success" type="velocity-xml">/dhis-web-maintenance-dataset/responseSectionObject.vm</result>
@@ -106,6 +98,19 @@
<result name="success" type="velocity">status.vm</result>
<result name="onExceptionReturn">plainTextError</result>
</action>
+
+ <action name="showSortSectionForm"
+ class="org.hisp.dhis.dataset.action.section.GetSectionListSortOrderAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-dataset/sortSectionForm.vm</param>
+ <param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
+ <param name="javascripts">javascript/dataSet.js,javascript/section.js</param>
+ </action>
+
+ <action name="saveSectionSortOrder"
+ class="org.hisp.dhis.dataset.action.section.SaveSectionSortOrderAction">
+ <result name="success" type="redirect">section.action</result>
+ </action>
<!-- Sort order -->
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js 2010-11-29 16:21:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/section.js 2010-11-29 16:43:07 +0000
@@ -26,7 +26,7 @@
if( datasetId == "null" ) {
window.alert( i18n_please_select_dataset );
} else {
- window.location = "sortOrderSection.action?dataSetId=" + datasetId;
+ window.location = "showSortSectionForm.action?dataSetId=" + datasetId;
}
}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm 2010-09-21 06:16:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm 1970-01-01 00:00:00 +0000
@@ -1,67 +0,0 @@
-
-<h3>$i18n.getString( "add_section" )</h3>
-
-<form id="sortOrderForm" name="sortOrderForm" action="sortOrderSection.action" method="post" onsubmit="selectAllById( 'selectedList' );">
- <table id="detailsList">
- <col/> ## Labels
- <col/> ## Input
- <thead>
- <tr>
- <th colspan="2">$i18n.getString( "sort_section" )</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="dataSetName" name="dataSetName" style="width:20em" value="$encoder.htmlEncode( $dataSet.name )" disabled="disabled"/></td>
- </tr>
-
- <tr><td> </td><td> </td></tr>
- </tbody>
- </table>
-
- <table id="dataElementSelectionArea">
- <col/> ## Selected DataElements
- <col/> ## Actions
- <col/> ## Available DataElements
- <thead>
- <tr>
- <th>$i18n.getString( "available_sections" )</th>
- <th></th>
- <th>$i18n.getString( "selected_sections" )</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelected( this, document.getElementById( 'selectedList' ) )">
- #foreach ( $section in $sections )
- <option value="$section.id">$encoder.htmlEncode( $section.name )</option>
- #end
- </select>
- </td>
- <td valign="top">
- <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="moveSelected( document.getElementById( 'availableList' ), document.getElementById( 'selectedList' ) )"/>
- <br/>
- <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="moveSelected( document.getElementById( 'selectedList' ), document.getElementById( 'availableList' ) )"/>
- </td>
- <td>
- <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelected( this, document.getElementById( 'availableList' ) )">
- </select>
- </td>
- </tr>
-
- <tr>
- <td colspan="4">
- <span id="message"></span>
- </td>
- </tr>
-
- <tr>
- <td colspan="4">
- <input type="submit" value="$i18n.getString( 'save' )"/><input type="button"
- onclick="window.location.href='section.action'" value="$i18n.getString( 'cancel' )"/></td>
- </tr>
- </tbody>
- </table>
-</form>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortSectionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortSectionForm.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortSectionForm.vm 2010-11-29 16:43:07 +0000
@@ -0,0 +1,34 @@
+
+<h3>$i18n.getString( "section_sort_order" )</h3>
+
+<form id="sortOrderForm" action="saveSectionSortOrder.action" method="post">
+
+<p>
+<input type="button" value="$i18n.getString( 'move_up' )" style="width:130px" onclick="moveUpSelectedOption( 'sections' )"><input
+type="button" value="$i18n.getString( 'move_down' )" style="width:130px" onclick="moveDownSelectedOption( 'sections' )"><input
+type="button" value="$i18n.getString( 'move_to_top' )" style="width:130px" onclick="moveSelectedOptionToTop( 'sections' )"><input
+type="button" value="$i18n.getString( 'move_to_bottom' )" style="width:130px" onclick="moveSelectedOptionToBottom( 'sections' )">
+</p>
+
+<p>
+<select multiple id="sections" name="sections" size="25" style="width:680px">
+#foreach ( $section in $sections )
+ <option value="$section.id">$section.name</option>
+#end
+</select>
+</p>
+
+<p>
+<input type="button" value="$i18n.getString( 'save' )" style="width:130px" onclick="submitForm()"><input
+type="button" value="$i18n.getString( 'cancel' )" style="width:130px" onclick="window.location.href='section.action'">
+</p>
+
+</form>
+
+<script type="text/javascript">
+ function submitForm()
+ {
+ selectAllById( "sections" );
+ document.getElementById( "sortOrderForm" ).submit();
+ }
+</script>