dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #33014
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16799: use new available/selected plugin for degs/ings
------------------------------------------------------------
revno: 16799
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-09-24 20:09:12 +0700
message:
use new available/selected plugin for degs/ings
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/AddDataElementGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/GetDataElementGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/OpenUpdateDataElementGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/UpdateDataElementGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/AddIndicatorGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/OpenUpdateIndicatorGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/UpdateIndicatorGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupSet.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupSet.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataElementGroupSet.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupSet.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataElementGroupSet.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateIndicatorGroupSet.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.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 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/AddDataElementGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/AddDataElementGroupSetAction.java 2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/AddDataElementGroupSetAction.java 2014-09-24 13:09:12 +0000
@@ -28,14 +28,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.ArrayList;
-import java.util.List;
-
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.dataelement.DataElementGroupSet;
import org.hisp.dhis.dataelement.DataElementService;
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author Tran Thanh Tri
@@ -88,11 +87,11 @@
this.dataDimension = dataDimension;
}
- private List<String> groupMembers = new ArrayList<>();
+ private List<String> degSelected = new ArrayList<>();
- public void setGroupMembers( List<String> groupMembers )
+ public void setDegSelected( List<String> degSelected )
{
- this.groupMembers = groupMembers;
+ this.degSelected = degSelected;
}
// -------------------------------------------------------------------------
@@ -106,11 +105,9 @@
List<DataElementGroup> dataElementGroups = new ArrayList<>();
- for ( String id : this.groupMembers )
+ for ( String id : degSelected )
{
- DataElementGroup dataElementGroup = dataElementService.getDataElementGroup( Integer.parseInt( id ) );
-
- dataElementGroups.add( dataElementGroup );
+ dataElementGroups.add( dataElementService.getDataElementGroup( id ) );
}
dataElementGroupSet.setMembers( dataElementGroups );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/GetDataElementGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/GetDataElementGroupSetAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/GetDataElementGroupSetAction.java 2014-09-24 13:09:12 +0000
@@ -27,17 +27,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.dataelement.DataElementGroupSet;
import org.hisp.dhis.dataelement.DataElementService;
-import com.opensymphony.xwork2.Action;
-
/**
* @author Tran Thanh Tri
- * @version $Id$
*/
public class GetDataElementGroupSetAction
- implements Action
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies
@@ -49,7 +47,7 @@
{
this.dataElementService = dataElementService;
}
-
+
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
@@ -60,20 +58,22 @@
{
this.id = id;
}
-
+
private DataElementGroupSet dataElementGroupSet;
-
+
public DataElementGroupSet getDataElementGroupSet()
{
return dataElementGroupSet;
}
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
public String execute()
throws Exception
{
-
- dataElementGroupSet = dataElementService.getDataElementGroupSet( id );
-
+ dataElementGroupSet = dataElementService.getDataElementGroupSet( id );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/OpenUpdateDataElementGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/OpenUpdateDataElementGroupSetAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/OpenUpdateDataElementGroupSetAction.java 2014-09-24 13:09:12 +0000
@@ -28,15 +28,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.Collections;
-import java.util.List;
-
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.dataelement.DataElementGroupSet;
import org.hisp.dhis.dataelement.DataElementService;
-import com.opensymphony.xwork2.Action;
+import java.util.Collections;
+import java.util.List;
/**
* @author Tran Thanh Tri
@@ -73,22 +72,22 @@
return dataElementGroupSet;
}
- private List<DataElementGroup> selectedGroups;
+ private List<DataElementGroup> dataElementGroups;
- public List<DataElementGroup> getSelectedGroups()
+ public List<DataElementGroup> getDataElementGroups()
{
- return selectedGroups;
+ return dataElementGroups;
}
public String execute()
throws Exception
{
- dataElementGroupSet = dataElementService.getDataElementGroupSet( id, true );
-
- selectedGroups = dataElementGroupSet.getMembers();
-
- Collections.sort( selectedGroups, IdentifiableObjectNameComparator.INSTANCE );
-
+ dataElementGroupSet = dataElementService.getDataElementGroupSet( id, true );
+
+ dataElementGroups = dataElementGroupSet.getMembers();
+
+ Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/UpdateDataElementGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/UpdateDataElementGroupSetAction.java 2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/UpdateDataElementGroupSetAction.java 2014-09-24 13:09:12 +0000
@@ -29,7 +29,6 @@
*/
import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.dataelement.DataElementGroupSet;
import org.hisp.dhis.dataelement.DataElementService;
@@ -38,7 +37,6 @@
/**
* @author Tran Thanh Tri
- * @version $Id$
*/
public class UpdateDataElementGroupSetAction
implements Action
@@ -93,11 +91,11 @@
this.dataDimension = dataDimension;
}
- private List<String> groupMembers = new ArrayList<>();
+ private List<String> degSelected = new ArrayList<>();
- public void setGroupMembers( List<String> groupMembers )
+ public void setDegSelected( List<String> degSelected )
{
- this.groupMembers = groupMembers;
+ this.degSelected = degSelected;
}
// -------------------------------------------------------------------------
@@ -116,11 +114,9 @@
dataElementGroupSet.getMembers().clear();
- for ( String id : groupMembers )
+ for ( String id : degSelected )
{
- DataElementGroup dataElementGroup = dataElementService.getDataElementGroup( Integer.parseInt( id ) );
-
- dataElementGroupSet.getMembers().add( dataElementGroup );
+ dataElementGroupSet.getMembers().add( dataElementService.getDataElementGroup( id ) );
}
dataElementService.updateDataElementGroupSet( dataElementGroupSet );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/AddIndicatorGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/AddIndicatorGroupSetAction.java 2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/AddIndicatorGroupSetAction.java 2014-09-24 13:09:12 +0000
@@ -28,18 +28,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.ArrayList;
-import java.util.List;
-
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.indicator.IndicatorGroup;
import org.hisp.dhis.indicator.IndicatorGroupSet;
import org.hisp.dhis.indicator.IndicatorService;
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author Tran Thanh Tri
- * @version $Id$
*/
public class AddIndicatorGroupSetAction
implements Action
@@ -80,11 +78,11 @@
this.compulsory = compulsory;
}
- private List<String> groupMembers = new ArrayList<>();
+ private List<String> ingSelected = new ArrayList<>();
- public void setGroupMembers( List<String> groupMembers )
+ public void setIngSelected( List<String> ingSelected )
{
- this.groupMembers = groupMembers;
+ this.ingSelected = ingSelected;
}
// -------------------------------------------------------------------------
@@ -97,11 +95,9 @@
List<IndicatorGroup> indicatorGroups = new ArrayList<>();
- for ( String id : this.groupMembers )
+ for ( String id : ingSelected )
{
- IndicatorGroup indicatorGroup = indicatorService.getIndicatorGroup( Integer.parseInt( id ) );
-
- indicatorGroups.add( indicatorGroup );
+ indicatorGroups.add( indicatorService.getIndicatorGroup( id ) );
}
indicatorGroupSet.setMembers( indicatorGroups );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/OpenUpdateIndicatorGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/OpenUpdateIndicatorGroupSetAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/OpenUpdateIndicatorGroupSetAction.java 2014-09-24 13:09:12 +0000
@@ -73,11 +73,11 @@
return indicatorGroupSet;
}
- private List<IndicatorGroup> selectedGroups;
+ private List<IndicatorGroup> indicatorGroups;
- public List<IndicatorGroup> getSelectedGroups()
+ public List<IndicatorGroup> getIndicatorGroups()
{
- return selectedGroups;
+ return indicatorGroups;
}
// -------------------------------------------------------------------------
@@ -88,9 +88,9 @@
{
indicatorGroupSet = indicatorService.getIndicatorGroupSet( id, true );
- selectedGroups = indicatorGroupSet.getMembers();
+ indicatorGroups = indicatorGroupSet.getMembers();
- Collections.sort( selectedGroups, IdentifiableObjectNameComparator.INSTANCE );
+ Collections.sort( indicatorGroups, IdentifiableObjectNameComparator.INSTANCE );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/UpdateIndicatorGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/UpdateIndicatorGroupSetAction.java 2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/UpdateIndicatorGroupSetAction.java 2014-09-24 13:09:12 +0000
@@ -28,18 +28,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import com.opensymphony.xwork2.Action;
+import org.hisp.dhis.indicator.IndicatorGroupSet;
+import org.hisp.dhis.indicator.IndicatorService;
+
import java.util.ArrayList;
import java.util.List;
-import org.hisp.dhis.indicator.IndicatorGroup;
-import org.hisp.dhis.indicator.IndicatorGroupSet;
-import org.hisp.dhis.indicator.IndicatorService;
-
-import com.opensymphony.xwork2.Action;
-
/**
* @author Tran Thanh Tri
- * @version $Id$
*/
public class UpdateIndicatorGroupSetAction
implements Action
@@ -87,12 +84,12 @@
{
this.compulsory = compulsory;
}
-
- private List<String> groupMembers = new ArrayList<>();
-
- public void setGroupMembers( List<String> groupMembers )
+
+ private List<String> ingSelected = new ArrayList<>();
+
+ public void setIngSelected( List<String> ingSelected )
{
- this.groupMembers = groupMembers;
+ this.ingSelected = ingSelected;
}
// -------------------------------------------------------------------------
@@ -108,14 +105,12 @@
indicatorGroupSet.setName( name.trim() );
indicatorGroupSet.setDescription( description );
indicatorGroupSet.setCompulsory( compulsory );
-
+
indicatorGroupSet.getMembers().clear();
- for ( String id : groupMembers )
+ for ( String id : ingSelected )
{
- IndicatorGroup indicatorGroup = indicatorService.getIndicatorGroup( Integer.parseInt( id ) );
-
- indicatorGroupSet.getMembers().add( indicatorGroup );
+ indicatorGroupSet.getMembers().add( indicatorService.getIndicatorGroup( id ) );
}
indicatorService.updateIndicatorGroupSet( indicatorGroupSet );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupSet.vm 2014-03-25 08:18:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupSet.vm 2014-09-24 13:09:12 +0000
@@ -1,21 +1,12 @@
<script type="text/javascript" src="javascript/addDataElementGroupSet.js"></script>
<script type="text/javascript">
jQuery(function() {
- jQuery("#availableDataElementGroupsList").dhisAjaxSelect({
- source: "../dhis-web-commons-ajax-json/getDataElementGroups.action",
- iterator: "dataElementGroups",
- connectedTo: 'groupMembers',
- handler: function(item) {
- var option = jQuery("<option />");
- option.text( item.name );
- option.attr( "value", item.id );
-
- return option;
- },
- params: {
- filterNoGroupSet: true
- }
- });
+ $('#degAvailable').selected({
+ url: '../api/dataElementGroups.json?filter=dataElementGroupSet:null',
+ target: $('#degSelected'),
+ search: $('#degAvailableSearch'),
+ iterator: 'dataElementGroups'
+ });
});
</script>
@@ -67,38 +58,11 @@
</tr>
</table>
-<table>
- <colgroup>
- <col style="width: 500px;"/>
- <col/>
- <col style="width: 500px;"/>
- </colgroup>
-
- <tr>
- <th>$i18n.getString( "available_dataelementgroup" )</th>
- <th></th>
- <th>$i18n.getString( "group_members" )
- <select id="memberValidator" multiple="multiple" style="display:none" class="{validate:{required:true}}"/>
- </th>
- </tr>
-
- <tr>
- <td>
- <select id="availableDataElementGroupsList" name="availableDataElementGroupsList" multiple="multiple" style="height: 200px; width: 100%;"></select>
- </td>
-
- <td style="text-align:center">
- <input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableDataElementGroupsList' );"/><br/>
- <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembers' );"/><br/>
- <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableDataElementGroupsList' );"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembers' );"/>
- </td>
-
- <td>
- <select id="groupMembers" name="groupMembers" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;" class="{validate:{required:true}}"></select>
- </td>
- </tr>
-</table>
+#jqSelected({
+ "prefix": "deg",
+ "i18n_available": "available_dataelementgroup",
+ "i18n_selected": "selected_dataelementgroup"
+})
<p>
<input type="submit" value="$i18n.getString( 'add' )" style="width:10em" />
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupSet.vm 2013-07-19 08:23:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupSet.vm 2014-09-24 13:09:12 +0000
@@ -1,21 +1,12 @@
<script type="text/javascript" src="javascript/addIndicatorGroupSet.js"></script>
<script>
jQuery(function() {
- jQuery("#availableIndicatorGroupsList").dhisAjaxSelect({
- source: "../dhis-web-commons-ajax-json/getIndicatorGroups.action",
- iterator: "indicatorGroups",
- connectedTo: 'groupMembers',
- handler: function(item) {
- var option = jQuery("<option />");
- option.text( item.name );
- option.attr( "value", item.id );
-
- return option;
- },
- params: {
- filterNoGroupSet: true
- }
- });
+ $('#ingAvailable').selected({
+ url: '../api/indicatorGroups.json?filter=indicatorGroupSet:null',
+ target: $('#ingSelected'),
+ search: $('#ingAvailableSearch'),
+ iterator: 'indicatorGroups'
+ });
});
</script>
@@ -55,36 +46,11 @@
</tr>
</table>
-<table>
- <colgroup>
- <col style="width: 500px;"/>
- <col/>
- <col style="width: 500px;"/>
- </colgroup>
-
- <tr>
- <th>$i18n.getString( "available_indicatorgroup" )</th>
- <th></th>
- <th>$i18n.getString( "group_members" )</th>
- </tr>
-
- <tr>
- <td>
- <select id="availableIndicatorGroupsList" multiple="multiple" style="height: 200px; width: 100%;"></select>
- </td>
-
- <td style="text-align:center">
- <input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableIndicatorGroupsList' );"/><br/>
- <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembers' );"/><br/>
- <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableIndicatorGroupsList' );"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembers' );"/>
- </td>
-
- <td>
- <select id="groupMembers" name="groupMembers" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;" class="{validate:{required:true}}"></select>
- </td>
- </tr>
-</table>
+#jqSelected({
+ "prefix": "ing",
+ "i18n_available": "available_indicatorgroup",
+ "i18n_selected": "selected_indicatorgroup"
+})
<p>
<input type="submit" value="$i18n.getString( 'add' )" style="width:10em" />
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataElementGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataElementGroupSet.js 2011-08-19 21:33:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataElementGroupSet.js 2014-09-24 13:09:12 +0000
@@ -1,12 +1,13 @@
-jQuery( document ).ready( function()
-{
- validation2( 'addDataElementGroupSet', function( form )
- {
+jQuery(document).ready(function() {
+ validation2('addDataElementGroupSet', function( form ) {
form.submit();
}, {
- 'beforeValidateHandler' : beforeSubmit,
- 'rules' : getValidationRules( "dataElementGroupSet" )
- } );
+ 'beforeValidateHandler': function() {
+ beforeSubmit();
+ $("#degSelected").find("option").attr("selected", "selected");
+ },
+ 'rules': getValidationRules("dataElementGroupSet")
+ });
- checkValueIsExist( "name", "validateDataElementGroupSet.action" );
-} );
+ checkValueIsExist("name", "validateDataElementGroupSet.action");
+});
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupSet.js 2013-03-14 10:33:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupSet.js 2014-09-24 13:09:12 +0000
@@ -1,13 +1,11 @@
-jQuery( document ).ready( function()
-{
- validation2( 'addIndicatorGroupSet', function( form )
- {
+jQuery(document).ready(function() {
+ validation2('addIndicatorGroupSet', function( form ) {
form.submit();
}, {
- 'beforeValidateHandler' : function()
- {
- listValidator( 'memberValidator', 'groupMembers' );
+ 'beforeValidateHandler': function() {
+ listValidator('ingValidator', 'ingSelected');
+ $("#ingSelected").find("option").attr("selected", "selected");
},
- 'rules' : getValidationRules( "indicatorGroupSet" )
- } );
-} );
+ 'rules': getValidationRules("indicatorGroupSet")
+ });
+});
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js 2014-06-12 16:08:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js 2014-09-24 13:09:12 +0000
@@ -7,10 +7,10 @@
});
function beforeSubmit() {
- memberValidator = jQuery("#memberValidator");
+ memberValidator = jQuery("#degValidator");
memberValidator.children().remove();
- jQuery.each(jQuery("#groupMembers").children(), function( i, item ) {
+ jQuery.each(jQuery("#degSelected").children(), function( i, item ) {
item.selected = 'selected';
memberValidator.append('<option value="' + item.value + '" selected="selected">' + item.value + '</option>');
});
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataElementGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataElementGroupSet.js 2011-08-19 21:33:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataElementGroupSet.js 2014-09-24 13:09:12 +0000
@@ -4,7 +4,10 @@
{
form.submit();
}, {
- 'beforeValidateHandler' : beforeSubmit,
+ 'beforeValidateHandler' : function() {
+ beforeSubmit();
+ $("#degSelected").find("option").attr("selected", "selected");
+ },
'rules' : getValidationRules( "dataElementGroupSet" )
} );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateIndicatorGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateIndicatorGroupSet.js 2011-08-19 21:33:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateIndicatorGroupSet.js 2014-09-24 13:09:12 +0000
@@ -6,7 +6,8 @@
}, {
'beforeValidateHandler' : function()
{
- listValidator( 'memberValidator', 'groupMembers' );
+ $("#ingSelected").find("option").attr("selected", "selected");
+ listValidator( 'ingValidator', 'ingSelected' );
},
'rules' : getValidationRules( "indicatorGroupSet" )
} );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm 2013-12-30 09:44:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm 2014-09-24 13:09:12 +0000
@@ -1,21 +1,12 @@
<script type="text/javascript" src="javascript/updateDataElementGroupSet.js"></script>
<script type="text/javascript">
jQuery(function() {
- jQuery("#availableDataElementGroupsList").dhisAjaxSelect({
- source: "../dhis-web-commons-ajax-json/getDataElementGroups.action",
- iterator: "dataElementGroups",
- connectedTo: 'groupMembers',
- handler: function(item) {
- var option = jQuery("<option />");
- option.text( item.name );
- option.attr( "value", item.id );
-
- return option;
- },
- params: {
- filterNoGroupSet: true
- }
- });
+ $('#degAvailable').selected({
+ url: '../api/dataElementGroups.json?filter=dataElementGroupSet:null',
+ target: $('#degSelected'),
+ search: $('#degAvailableSearch'),
+ iterator: 'dataElementGroups'
+ });
});
</script>
@@ -67,43 +58,12 @@
</tr>
</table>
-<table>
- <colgroup>
- <col style="width: 500px;"/>
- <col/>
- <col style="width: 500px;"/>
- </colgroup>
-
- <tr>
- <th>$i18n.getString( "available_dataelementgroup" )</th>
- <th></th>
- <th>$i18n.getString( "group_members" )
- <select id="memberValidator" multiple="multiple" style="display:none" class="{validate:{required:true}}"/>
- </th>
- </tr>
-
- <tr>
- <td>
- <select id="availableDataElementGroupsList" name="availableDataElementGroupsList" multiple="multiple" style="height: 200px; width: 100%;"></select>
- </td>
-
- <td style="text-align:center">
- <input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableDataElementGroupsList' );"/><br/>
- <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembers' );"/><br/>
- <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableDataElementGroupsList' );"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembers' );"/>
- </td>
-
- <td>
- <select id="groupMembers" name="groupMembers" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;" class="{validate:{required:true}}">
- #foreach( $dataElementGroup in $selectedGroups )
- <option value="$dataElementGroup.id">$encoder.htmlEncode( $dataElementGroup.displayName )</option>
- #end
- </select>
- </td>
-
- </tr>
-</table>
+#jqSelected({
+ "prefix": "deg",
+ "i18n_available": "available_dataelementgroup",
+ "i18n_selected": "selected_dataelementgroup",
+ "objects": $dataElementGroups
+})
<p>
<input type="submit" value="$i18n.getString( 'update' )" style="width:10em"/>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm 2013-07-19 08:23:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm 2014-09-24 13:09:12 +0000
@@ -1,23 +1,12 @@
<script type="text/javascript" src="javascript/updateIndicatorGroupSet.js"></script>
<script type="text/javascript">
jQuery(document).ready( function() {
- jQuery("#availableIndicatorGroupsList").dhisAjaxSelect({
- source: "../dhis-web-commons-ajax-json/getIndicatorGroups.action",
- iterator: "indicatorGroups",
- connectedTo: 'groupMembers',
- handler: function(item) {
- var option = jQuery("<option />");
- option.text( item.name );
- option.attr( "value", item.id );
-
- return option;
- },
- params: {
- filterNoGroupSet: true
- }
- });
-
- // checkValueIsExist( "name", "validateIndicatorGroupSet.action", {id: $indicatorGroupSet.id});
+ $('#ingAvailable').selected({
+ url: '../api/indicatorGroups.json?filter=indicatorGroupSet:null',
+ target: $('#ingSelected'),
+ search: $('#ingAvailableSearch'),
+ iterator: 'indicatorGroups'
+ });
});
</script>
@@ -54,42 +43,12 @@
</tr>
</table>
-<table>
- <colgroup>
- <col style="width: 500px;"/>
- <col/>
- <col style="width: 500px;"/>
- </colgroup>
-
- <tr>
- <th>$i18n.getString( "available_indicatorgroup" )</th>
- <th></th>
- <th>$i18n.getString( "group_members" )
- <select id="memberValidator" class="{validate:{required:true}}" style="display:none"/>
- </th>
- </tr>
-
- <tr>
- <td>
- <select id="availableIndicatorGroupsList" multiple="multiple" style="height: 200px; width: 100%;"></select>
- </td>
-
- <td style="text-align:center">
- <input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableIndicatorGroupsList' );"/><br/>
- <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembers' );"/><br/>
- <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableIndicatorGroupsList' );"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembers' );"/>
- </td>
-
- <td>
- <select id="groupMembers" name="groupMembers" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;" class="{validate:{required:true}}">
- #foreach( $indicatorGroup in $selectedGroups )
- <option value="$indicatorGroup.id">$encoder.htmlEncode( $indicatorGroup.displayName )</option>
- #end
- </select>
- </td>
- </tr>
-</table>
+#jqSelected({
+ "prefix": "ing",
+ "i18n_available": "available_indicatorgroup",
+ "i18n_selected": "selected_indicatorgroup",
+ "objects": $indicatorGroups
+})
<p>
<input type="submit" value="$i18n.getString( 'update' )" style="width:10em"/>