dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21154
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9934: Add shortName and code fields into Add/Update orgunit-group form.
------------------------------------------------------------
revno: 9934
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-03-01 12:14:56 +0700
message:
Add shortName and code fields into Add/Update orgunit-group form.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroup.hbm.xml
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/AddOrganisationUnitGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/UpdateOrganisationUnitGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/ValidateOrganisationUnitGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/org/hisp/dhis/oum/i18n_module.properties
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/javascript/organisationUnitGroup.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2013-03-01 04:09:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2013-03-01 05:14:56 +0000
@@ -375,10 +375,10 @@
/**
- * Returns a DataElementGroup with a given shortName.
+ * Returns a DataElementGroup with a given short name.
*
- * @param shortName the shortName of the DataElementGroup to return.
- * @return the DataElementGroup with the given shortName, or null if no match.
+ * @param shortName the short name of the DataElementGroup to return.
+ * @return the DataElementGroup with the given short name, or null if no match.
*/
DataElementGroup getDataElementGroupByShortName( String shortName );
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java 2013-02-04 14:57:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java 2013-03-01 05:14:56 +0000
@@ -110,6 +110,23 @@
List<OrganisationUnitGroup> getOrganisationUnitGroupByName( String name );
/**
+ * Returns the OrganisationUnitGroup with the given code.
+ *
+ * @param code the code.
+ * @return the OrganisationUnitGroup with the given code, or null if no match.
+ */
+ OrganisationUnitGroup getOrganisationUnitGroupByCode( String code );
+
+ /**
+ * Returns the OrganisationUnitGroup with the given short name.
+ *
+ * @param short name the short name.
+ * @return the OrganisationUnitGroup with the given short name, or null if no match.
+ */
+ OrganisationUnitGroup getOrganisationUnitGroupByShortName( String shortName );
+
+
+ /**
* Returns all OrganisationUnitGroups.
*
* @return a collection of all the OrganisationUnitGroups, or an empty
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java 2013-03-01 05:14:56 +0000
@@ -29,13 +29,13 @@
import java.util.Collection;
-import org.hisp.dhis.common.GenericIdentifiableObjectStore;
+import org.hisp.dhis.common.GenericNameableObjectStore;
/**
* @author Lars Helge Overland
*/
public interface OrganisationUnitGroupStore
- extends GenericIdentifiableObjectStore<OrganisationUnitGroup>
+ extends GenericNameableObjectStore<OrganisationUnitGroup>
{
Collection<OrganisationUnitGroup> getOrganisationUnitGroupsWithGroupSets();
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java 2013-02-04 14:57:16 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java 2013-03-01 05:14:56 +0000
@@ -27,21 +27,25 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.i18n.I18nUtils.getCountByName;
+import static org.hisp.dhis.i18n.I18nUtils.getObjectsBetween;
+import static org.hisp.dhis.i18n.I18nUtils.getObjectsBetweenByName;
+import static org.hisp.dhis.i18n.I18nUtils.i18n;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
import org.hisp.dhis.common.GenericIdentifiableObjectStore;
import org.hisp.dhis.i18n.I18nService;
import org.hisp.dhis.system.util.Filter;
import org.hisp.dhis.system.util.FilterUtils;
import org.springframework.transaction.annotation.Transactional;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import static org.hisp.dhis.i18n.I18nUtils.*;
-
/**
* @author Torgeir Lorange Ostby
- * @version $Id: DefaultOrganisationUnitGroupService.java 5017 2008-04-25 09:19:19Z larshelg $
+ * @version $Id: DefaultOrganisationUnitGroupService.java 5017 2008-04-25
+ * 09:19:19Z larshelg $
*/
@Transactional
public class DefaultOrganisationUnitGroupService
@@ -60,7 +64,8 @@
private GenericIdentifiableObjectStore<OrganisationUnitGroupSet> organisationUnitGroupSetStore;
- public void setOrganisationUnitGroupSetStore( GenericIdentifiableObjectStore<OrganisationUnitGroupSet> organisationUnitGroupSetStore )
+ public void setOrganisationUnitGroupSetStore(
+ GenericIdentifiableObjectStore<OrganisationUnitGroupSet> organisationUnitGroupSetStore )
{
this.organisationUnitGroupSetStore = organisationUnitGroupSetStore;
}
@@ -121,7 +126,26 @@
public List<OrganisationUnitGroup> getOrganisationUnitGroupByName( String name )
{
- return new ArrayList<OrganisationUnitGroup>( i18n( i18nService, organisationUnitGroupStore.getAllEqName( name ) ) );
+ return new ArrayList<OrganisationUnitGroup>(
+ i18n( i18nService, organisationUnitGroupStore.getAllEqName( name ) ) );
+ }
+
+ public OrganisationUnitGroup getOrganisationUnitGroupByCode( String code )
+ {
+ return i18n( i18nService, organisationUnitGroupStore.getByCode( code ) );
+ }
+
+ public OrganisationUnitGroup getOrganisationUnitGroupByShortName( String shortName )
+ {
+ List<OrganisationUnitGroup> organisationUnitGroups = new ArrayList<OrganisationUnitGroup>(
+ organisationUnitGroupStore.getAllEqShortName( shortName ) );
+
+ if ( organisationUnitGroups.isEmpty() )
+ {
+ return null;
+ }
+
+ return i18n( i18nService, organisationUnitGroups.get( 0 ) );
}
public Collection<OrganisationUnitGroup> getAllOrganisationUnitGroups()
@@ -215,7 +239,8 @@
public List<OrganisationUnitGroupSet> getOrganisationUnitGroupSetByName( String name )
{
- return new ArrayList<OrganisationUnitGroupSet>( i18n( i18nService, organisationUnitGroupSetStore.getAllEqName( name ) ) );
+ return new ArrayList<OrganisationUnitGroupSet>( i18n( i18nService,
+ organisationUnitGroupSetStore.getAllEqName( name ) ) );
}
public Collection<OrganisationUnitGroupSet> getAllOrganisationUnitGroupSets()
@@ -262,7 +287,8 @@
return null;
}
- public Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSetsNotAssignedTo( OrganisationUnit organisationUnit )
+ public Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSetsNotAssignedTo(
+ OrganisationUnit organisationUnit )
{
Collection<OrganisationUnitGroupSet> groupSets = new ArrayList<OrganisationUnitGroupSet>();
@@ -292,7 +318,8 @@
return getObjectsBetween( i18nService, organisationUnitGroupSetStore, first, max );
}
- public Collection<OrganisationUnitGroupSet> getOrganisationUnitGroupSetsBetweenByName( String name, int first, int max )
+ public Collection<OrganisationUnitGroupSet> getOrganisationUnitGroupSetsBetweenByName( String name, int first,
+ int max )
{
return getObjectsBetweenByName( i18nService, organisationUnitGroupSetStore, name, first, max );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroup.hbm.xml 2013-02-28 05:58:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroup.hbm.xml 2013-03-01 05:14:56 +0000
@@ -17,6 +17,8 @@
<property name="name" column="name" not-null="true" unique="true" length="230" />
+ <property name="shortName" column="shortname" unique="true" length="50" />
+
<property name="symbol" />
<set name="members" table="orgunitgroupmembers">
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2013-03-01 04:09:26 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2013-03-01 05:14:56 +0000
@@ -116,6 +116,16 @@
"name" : {
"required" : true,
"rangelength" : [ 2, 160 ]
+ },
+ "shortName" : {
+ "required" : true,
+ "alphanumericwithbasicpuncspaces" : true,
+ "rangelength" : [ 2, 40 ]
+ },
+ "code" : {
+ "alphanumericwithbasicpuncspaces" : true,
+ "notOnlyDigits" : false,
+ "rangelength" : [ 0, 25 ]
}
},
"organisationUnitGroupSet" : {
@@ -272,6 +282,11 @@
"alphanumericwithbasicpuncspaces" : true,
"notOnlyDigits" : true
},
+ "code" : {
+ "alphanumericwithbasicpuncspaces" : true,
+ "notOnlyDigits" : false,
+ "rangelength" : [ 0, 25 ]
+ }
},
"dataElementGroupSet" : {
"name" : {
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/AddOrganisationUnitGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/AddOrganisationUnitGroupAction.java 2013-02-28 05:58:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/AddOrganisationUnitGroupAction.java 2013-03-01 05:14:56 +0000
@@ -90,6 +90,20 @@
this.name = name;
}
+ private String shortName;
+
+ public void setShortName( String shortName )
+ {
+ this.shortName = shortName;
+ }
+
+ private String code;
+
+ public void setCode( String code )
+ {
+ this.code = code;
+ }
+
private String symbol;
public void setSymbol( String symbol )
@@ -118,8 +132,12 @@
public String execute()
throws Exception
{
+ code = (code != null && code.trim().length() == 0) ? null : code;
+
OrganisationUnitGroup organisationUnitGroup = new OrganisationUnitGroup();
organisationUnitGroup.setName( name );
+ organisationUnitGroup.setShortName( shortName );
+ organisationUnitGroup.setCode( code );
organisationUnitGroup.setSymbol( symbol );
Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager
@@ -136,9 +154,12 @@
jsonAttributeValues, attributeService );
}
- for ( String id : selectedDataSetsList )
+ if ( selectedDataSetsList != null )
{
- organisationUnitGroup.addDataSet( dataSetService.getDataSet( Integer.parseInt( id ) ) );
+ for ( String id : selectedDataSetsList )
+ {
+ organisationUnitGroup.addDataSet( dataSetService.getDataSet( Integer.parseInt( id ) ) );
+ }
}
organisationUnitGroupService.addOrganisationUnitGroup( organisationUnitGroup );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/UpdateOrganisationUnitGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/UpdateOrganisationUnitGroupAction.java 2013-02-28 05:58:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/UpdateOrganisationUnitGroupAction.java 2013-03-01 05:14:56 +0000
@@ -99,6 +99,20 @@
this.name = name;
}
+ private String shortName;
+
+ public void setShortName( String shortName )
+ {
+ this.shortName = shortName;
+ }
+
+ private String code;
+
+ public void setCode( String code )
+ {
+ this.code = code;
+ }
+
private String symbol;
public void setSymbol( String symbol )
@@ -127,9 +141,13 @@
public String execute()
throws Exception
{
+ code = (code != null && code.trim().length() == 0) ? null : code;
+
OrganisationUnitGroup organisationUnitGroup = organisationUnitGroupService.getOrganisationUnitGroup( id );
organisationUnitGroup.setName( name );
+ organisationUnitGroup.setShortName( shortName );
+ organisationUnitGroup.setCode( code );
organisationUnitGroup.setSymbol( symbol );
Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager
@@ -143,14 +161,21 @@
jsonAttributeValues, attributeService );
}
- Set<DataSet> dataSets = new HashSet<DataSet>();
-
- for ( String id : selectedDataSetsList )
- {
- dataSets.add( dataSetService.getDataSet( Integer.parseInt( id ) ) );
- }
-
- organisationUnitGroup.updateDataSets( dataSets );
+ if ( selectedDataSetsList != null )
+ {
+ Set<DataSet> dataSets = new HashSet<DataSet>();
+
+ for ( String id : selectedDataSetsList )
+ {
+ dataSets.add( dataSetService.getDataSet( Integer.parseInt( id ) ) );
+ }
+
+ organisationUnitGroup.updateDataSets( dataSets );
+ }
+ else
+ {
+ organisationUnitGroup.getDataSets().clear();
+ }
organisationUnitGroupService.updateOrganisationUnitGroup( organisationUnitGroup );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/ValidateOrganisationUnitGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/ValidateOrganisationUnitGroupAction.java 2013-02-07 12:38:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/ValidateOrganisationUnitGroupAction.java 2013-03-01 05:14:56 +0000
@@ -27,12 +27,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
+import java.util.List;
+
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
-import java.util.List;
+import com.opensymphony.xwork2.Action;
/**
* @author Torgeir Lorange Ostby
@@ -78,6 +79,20 @@
this.name = name;
}
+ private String shortName;
+
+ public void setShortName( String shortName )
+ {
+ this.shortName = shortName;
+ }
+
+ private String code;
+
+ public void setCode( String code )
+ {
+ this.code = code;
+ }
+
// -------------------------------------------------------------------------
// Output
// -------------------------------------------------------------------------
@@ -101,7 +116,8 @@
if ( name != null && !name.trim().isEmpty() )
{
- List<OrganisationUnitGroup> organisationUnitGroups = organisationUnitGroupService.getOrganisationUnitGroupByName( name );
+ List<OrganisationUnitGroup> organisationUnitGroups = organisationUnitGroupService
+ .getOrganisationUnitGroupByName( name );
if ( !organisationUnitGroups.isEmpty() && (id == null || organisationUnitGroups.get( 0 ).getId() != id) )
{
@@ -111,7 +127,35 @@
}
}
- message = "OK";
+ if ( shortName != null )
+ {
+ OrganisationUnitGroup match = organisationUnitGroupService.getOrganisationUnitGroupByShortName( shortName );
+
+ if ( match != null && (id == null || match.getId() != id) )
+ {
+ message = i18n.getString( "short_name_in_use" );
+
+ return ERROR;
+ }
+ }
+
+ if ( code != null && !code.trim().isEmpty() )
+ {
+ OrganisationUnitGroup match = organisationUnitGroupService.getOrganisationUnitGroupByCode( code );
+
+ if ( match != null && (id == null || match.getId() != id) )
+ {
+ message = i18n.getString( "code_in_use" );
+
+ return ERROR;
+ }
+ }
+
+ // ---------------------------------------------------------------------
+ // Validation success
+ // ---------------------------------------------------------------------
+
+ message = "everything_is_ok";
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/org/hisp/dhis/oum/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/org/hisp/dhis/oum/i18n_module.properties 2013-01-10 10:13:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/org/hisp/dhis/oum/i18n_module.properties 2013-03-01 05:14:56 +0000
@@ -102,4 +102,5 @@
select_symbol=Select symbol
symbol=Symbol
name_code_identifier=Name, code or identifier
-identifier=Identifier
\ No newline at end of file
+identifier=Identifier
+short_name_in_use=The short name is already in use. Please choose a different short name
\ No newline at end of file
=== 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 2013-02-28 05:58:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm 2013-03-01 05:14:56 +0000
@@ -28,6 +28,9 @@
});
checkValueIsExist( "name", "validateOrganisationUnitGroup.action" );
+ checkValueIsExist( "shortName", "validateOrganisationUnitGroup.action" );
+ checkValueIsExist( "code", "validateOrganisationUnitGroup.action" );
+
} );
</script>
@@ -45,6 +48,14 @@
<td style="width:120px"><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td colspan="2"><input type="text" id="name" name="name"></td>
</tr>
+ <tr>
+ <td><label for="shortName">$i18n.getString( "short_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="shortName" name="shortName" /></td>
+ </tr>
+ <tr>
+ <td><label for="code">$i18n.getString( "code" )</label></td>
+ <td><input type="text" id="code" name="code" /></td>
+ </tr>
<tr>
<td style="height:35px"><label for="symbol">$i18n.getString( "symbol" )</td>
<td style="width:130px"><a href="javascript:openSymbolDialog()">$i18n.getString( "select_symbol" )</a></td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js 2013-02-05 17:15:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js 2013-03-01 05:14:56 +0000
@@ -8,6 +8,8 @@
jQuery.post( 'getOrganisationUnitGroup.action', { id: unitId },
function ( json ) {
setInnerHTML( 'nameField', json.organisationUnitGroup.name );
+ setInnerHTML( 'shortNameField', json.organisationUnitGroup.shortName );
+ setInnerHTML( 'codeField', json.organisationUnitGroup.code );
setInnerHTML( 'memberCountField', json.organisationUnitGroup.memberCount );
showDetails();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm 2012-10-18 13:27:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm 2013-03-01 05:14:56 +0000
@@ -53,6 +53,8 @@
<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"/></a>
</div>
<p><label>$i18n.getString( "name" ):</label><br/><span id="nameField"></span></p>
+ <p><label>$i18n.getString( "short_name" ):</label><br/><span id="shortNameField"></span></p>
+ <p><label>$i18n.getString( "code" ):</label><br/><span id="codeField"></span></p>
<p><label>$i18n.getString( "number_of_group_members" ):</label><br/><span id="memberCountField"></span></p>
</div>
=== 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 2013-02-28 05:58:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.vm 2013-03-01 05:14:56 +0000
@@ -27,6 +27,8 @@
});
checkValueIsExist( "name", "validateOrganisationUnitGroup.action", {id:$!organisationUnitGroup.id} );
+ checkValueIsExist( "shortName", "validateOrganisationUnitGroup.action", {id:$!organisationUnitGroup.id} );
+ checkValueIsExist( "code", "validateOrganisationUnitGroup.action", {id:$!organisationUnitGroup.id} );
});
</script>
@@ -45,6 +47,14 @@
<td style="width:120px"><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td colspan="2"><input type="text" id="name" name="name" value="$!organisationUnitGroup.name"/></td>
</tr>
+ <tr>
+ <td><label for="shortName">$i18n.getString( "short_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="shortName" name="shortName" value="$!encoder.htmlEncode( $organisationUnitGroup.shortName )"></td>
+ </tr>
+ <tr>
+ <td><label for="code">$i18n.getString( "code" )</label></td>
+ <td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $organisationUnitGroup.code )"></td>
+ </tr>
<tr>
<td style="height:35px"><label for="symbol">$i18n.getString( "symbol" )</td>
<td style="width:130px"><a href="javascript:openSymbolDialog()">$i18n.getString( "select_symbol" )</a></td>