=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm 2012-06-01 12:17:31 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm 2012-06-01 13:05:54 +0000 @@ -18,7 +18,6 @@ } ); -

$i18n.getString( "edit_indicator" )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm 2012-06-01 12:17:31 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm 2012-06-01 13:05:54 +0000 @@ -39,7 +39,7 @@ - + === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java 2012-01-25 17:11:43 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java 1970-01-01 00:00:00 +0000 @@ -1,132 +0,0 @@ -package org.hisp.dhis.oum.action.organisationunit; - -/* - * 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.Date; -import java.util.List; - -import org.hisp.dhis.attribute.Attribute; -import org.hisp.dhis.attribute.AttributeService; -import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; -import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; -import org.hisp.dhis.dataset.DataSet; -import org.hisp.dhis.dataset.DataSetService; -import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; -import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet; -import org.hisp.dhis.period.Cal; - -import com.opensymphony.xwork2.Action; - -/** - * @author Nguyen Dang Quang - * @version $Id$ - */ -public class PrepareAddOrganisationUnitAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private DataSetService dataSetService; - - public void setDataSetService( DataSetService dataSetService ) - { - this.dataSetService = dataSetService; - } - - private OrganisationUnitGroupService organisationUnitGroupService; - - public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService ) - { - this.organisationUnitGroupService = organisationUnitGroupService; - } - - private AttributeService attributeService; - - public void setAttributeService( AttributeService attributeService ) - { - this.attributeService = attributeService; - } - - // ------------------------------------------------------------------------- - // Input & Output - // ------------------------------------------------------------------------- - - private Date defaultDate; - - public Date getDefaultDate() - { - return defaultDate; - } - - private List dataSets; - - public List getDataSets() - { - return dataSets; - } - - private List groupSets; - - public List getGroupSets() - { - return groupSets; - } - - private List attributes; - - public List getAttributes() - { - return attributes; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - defaultDate = new Cal().set( 1900, 1, 1 ).time(); - - dataSets = new ArrayList( dataSetService.getAllDataSets() ); - - groupSets = new ArrayList( - organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSetsWithMembers() ); - - attributes = new ArrayList( attributeService.getOrganisationUnitAttributes() ); - - Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE ); - Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE ); - Collections.sort( attributes, new AttributeSortOrderComparator() ); - - return SUCCESS; - } -} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ShowAddOrganisationUnitFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ShowAddOrganisationUnitFormAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ShowAddOrganisationUnitFormAction.java 2012-06-01 13:05:54 +0000 @@ -0,0 +1,129 @@ +package org.hisp.dhis.oum.action.organisationunit; + +/* + * 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 com.opensymphony.xwork2.Action; +import org.hisp.dhis.attribute.Attribute; +import org.hisp.dhis.attribute.AttributeService; +import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; +import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet; +import org.hisp.dhis.period.Cal; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +/** + * @author Nguyen Dang Quang + */ +public class ShowAddOrganisationUnitFormAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private DataSetService dataSetService; + + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + private OrganisationUnitGroupService organisationUnitGroupService; + + public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService ) + { + this.organisationUnitGroupService = organisationUnitGroupService; + } + + private AttributeService attributeService; + + public void setAttributeService( AttributeService attributeService ) + { + this.attributeService = attributeService; + } + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private Date defaultDate; + + public Date getDefaultDate() + { + return defaultDate; + } + + private List dataSets; + + public List getDataSets() + { + return dataSets; + } + + private List groupSets; + + public List getGroupSets() + { + return groupSets; + } + + private List attributes; + + public List getAttributes() + { + return attributes; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + { + defaultDate = new Cal().set( 1900, 1, 1 ).time(); + + dataSets = new ArrayList( dataSetService.getAllDataSets() ); + + groupSets = new ArrayList( + organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSetsWithMembers() ); + + attributes = new ArrayList( attributeService.getOrganisationUnitAttributes() ); + + Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE ); + Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE ); + Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE ); + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/GetOrganisationUnitGroupAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/GetOrganisationUnitGroupAction.java 2012-02-01 10:50:31 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/GetOrganisationUnitGroupAction.java 2012-06-01 13:05:54 +0000 @@ -27,16 +27,19 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import com.opensymphony.xwork2.Action; +import org.hisp.dhis.attribute.Attribute; +import org.hisp.dhis.attribute.AttributeService; +import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; import org.hisp.dhis.organisationunit.OrganisationUnitGroup; import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; import org.hisp.dhis.oust.manager.SelectionTreeManager; +import org.hisp.dhis.system.util.AttributeUtils; -import com.opensymphony.xwork2.Action; +import java.util.*; /** * @author Torgeir Lorange Ostby - * @version $Id: GetOrganisationUnitGroupAction.java 1901 2006-09-22 14:42:40Z - * torgeilo $ */ public class GetOrganisationUnitGroupAction implements Action @@ -57,7 +60,14 @@ public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager ) { this.selectionTreeManager = selectionTreeManager; - } + } + + private AttributeService attributeService; + + public void setAttributeService( AttributeService attributeService ) + { + this.attributeService = attributeService; + } // ------------------------------------------------------------------------- // Input/output @@ -84,6 +94,20 @@ return memberCount; } + private List attributes; + + public List getAttributes() + { + return attributes; + } + + public Map attributeValues = new HashMap(); + + public Map getAttributeValues() + { + return attributeValues; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -94,11 +118,17 @@ organisationUnitGroup = organisationUnitGroupService.getOrganisationUnitGroup( id ); memberCount = organisationUnitGroup.getMembers().size(); - + selectionTreeManager.clearSelectedOrganisationUnits(); selectionTreeManager.setSelectedOrganisationUnits( organisationUnitGroup.getMembers() ); + attributes = new ArrayList( attributeService.getOrganisationUnitGroupAttributes() ); + + attributeValues = AttributeUtils.getAttributeValueMap( organisationUnitGroup.getAttributeValues() ); + + Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE ); + return SUCCESS; } } === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/ShowAddOrganisationUnitGroupFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/ShowAddOrganisationUnitGroupFormAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/ShowAddOrganisationUnitGroupFormAction.java 2012-06-01 13:05:54 +0000 @@ -0,0 +1,75 @@ +package org.hisp.dhis.oum.action.organisationunitgroup; + +/* + * 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 com.opensymphony.xwork2.Action; +import org.hisp.dhis.attribute.Attribute; +import org.hisp.dhis.attribute.AttributeService; +import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ShowAddOrganisationUnitGroupFormAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private AttributeService attributeService; + + public void setAttributeService( AttributeService attributeService ) + { + this.attributeService = attributeService; + } + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private List attributes; + + public List getAttributes() + { + return attributes; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + { + attributes = new ArrayList( attributeService.getOrganisationUnitGroupAttributes() ); + Collections.sort( attributes, new AttributeSortOrderComparator() ); + + return SUCCESS; + } +} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/PrepareUpdateGroupSetAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/PrepareUpdateGroupSetAction.java 2012-02-01 10:50:31 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/PrepareUpdateGroupSetAction.java 1970-01-01 00:00:00 +0000 @@ -1,98 +0,0 @@ -package org.hisp.dhis.oum.action.organisationunitgroupset; - -/* - * Copyright (c) 2004-2012, 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.common.comparator.IdentifiableObjectNameComparator; -import org.hisp.dhis.organisationunit.OrganisationUnitGroup; -import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; -import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - */ -public class PrepareUpdateGroupSetAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitGroupService organisationUnitGroupService; - - public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService ) - { - this.organisationUnitGroupService = organisationUnitGroupService; - } - - // ------------------------------------------------------------------------- - // Input/output - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - private OrganisationUnitGroupSet organisationUnitGroupSet; - - public OrganisationUnitGroupSet getOrganisationUnitGroupSet() - { - return organisationUnitGroupSet; - } - - private List selectedGroups; - - public List getSelectedGroups() - { - return selectedGroups; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - organisationUnitGroupSet = organisationUnitGroupService.getOrganisationUnitGroupSet( id, true ); - - selectedGroups = new ArrayList( organisationUnitGroupSet.getOrganisationUnitGroups() ); - - Collections.sort( selectedGroups, IdentifiableObjectNameComparator.INSTANCE ); - - return SUCCESS; - } -} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/ShowUpdateGroupSetFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/ShowUpdateGroupSetFormAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/ShowUpdateGroupSetFormAction.java 2012-06-01 13:05:54 +0000 @@ -0,0 +1,98 @@ +package org.hisp.dhis.oum.action.organisationunitgroupset; + +/* + * Copyright (c) 2004-2012, 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.common.comparator.IdentifiableObjectNameComparator; +import org.hisp.dhis.organisationunit.OrganisationUnitGroup; +import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; +import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet; + +import com.opensymphony.xwork2.Action; + +/** + * @author Lars Helge Overland + */ +public class ShowUpdateGroupSetFormAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private OrganisationUnitGroupService organisationUnitGroupService; + + public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService ) + { + this.organisationUnitGroupService = organisationUnitGroupService; + } + + // ------------------------------------------------------------------------- + // Input/output + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + private OrganisationUnitGroupSet organisationUnitGroupSet; + + public OrganisationUnitGroupSet getOrganisationUnitGroupSet() + { + return organisationUnitGroupSet; + } + + private List selectedGroups; + + public List getSelectedGroups() + { + return selectedGroups; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + organisationUnitGroupSet = organisationUnitGroupService.getOrganisationUnitGroupSet( id, true ); + + selectedGroups = new ArrayList( organisationUnitGroupSet.getOrganisationUnitGroups() ); + + Collections.sort( selectedGroups, IdentifiableObjectNameComparator.INSTANCE ); + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/META-INF/dhis/beans.xml 2012-06-01 11:35:55 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/META-INF/dhis/beans.xml 2012-06-01 13:05:54 +0000 @@ -96,7 +96,7 @@ - @@ -124,6 +124,10 @@ + + + + @@ -139,6 +143,7 @@ + - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml 2012-02-22 15:04:08 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml 2012-06-01 13:05:54 +0000 @@ -33,7 +33,7 @@ plainTextError - + /main.vm /dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm javascript/shortName.js,../dhis-web-commons/ouwt/ouwt.js @@ -115,7 +115,7 @@ plainTextError - + /main.vm /dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm F_ORGUNITGROUP_ADD @@ -188,7 +188,7 @@ F_ORGUNITGROUPSET_ADD - + /main.vm /dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm javascript/organisationUnitGroupSet.js === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm 2011-10-06 07:36:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm 2012-06-01 13:05:54 +0000 @@ -1,13 +1,36 @@ - +

$i18n.getString( "crease_new_org_unit_group" ) #openHelp( "ou_groups_edit" )

-

$i18n.getString( "name" ) - * - -

+
$i18n.getString( "details" )
+ + + + + + + +
$i18n.getString( "details" )
+ +#tblDynamicAttributes( { "attributes": $attributes } ) @@ -15,9 +38,11 @@ #organisationUnitSelectionTree( true true false ) -
+ +

-

+

+
\ No newline at end of file === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupForm.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupForm.js 2011-08-19 21:33:57 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupForm.js 1970-01-01 00:00:00 +0000 @@ -1,11 +0,0 @@ -jQuery( document ).ready( function() -{ - validation2( 'addOrganisationUnitGroupForm', function( form ) - { - form.submit(); - }, { - 'rules' : getValidationRules( "organisationUnitGroup" ) - } ); - - checkValueIsExist( "name", "validateOrganisationUnitGroup.action" ); -} ); === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupForm.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupForm.js 2011-08-19 21:33:57 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupForm.js 1970-01-01 00:00:00 +0000 @@ -1,9 +0,0 @@ -jQuery( document ).ready( function() -{ - validation2( 'updateOrganisationUnitGroupForm', function( form ) - { - form.submit(); - }, { - 'rules' : getValidationRules( "organisationUnitGroup" ) - } ); -} ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.vm 2012-04-03 10:52:58 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.vm 2012-06-01 13:05:54 +0000 @@ -1,6 +1,16 @@ - @@ -8,21 +18,31 @@

$i18n.getString( "edit_org_unit_group" ) #openHelp( "ou_groups_edit" )

- + -

$i18n.getString( "name" ) - * - -

- - - - -
- #organisationUnitSelectionTree( false, true, false ) -
-

- - -

+ + + + + + + + +
$i18n.getString( "details" )
+ +#tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } ) + + + + + +
+ #organisationUnitSelectionTree( false, true, false ) +
+ +

+ + +

+