dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #36411
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18629: metadata attributes for TEA implemented
------------------------------------------------------------
revno: 18629
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-03-19 16:29:29 +0700
message:
metadata attributes for TEA implemented
removed:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddAttributeFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowUpdateAttributeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/addAttributeForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateAttributeForm.js
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddUpdateAttributeAction.java
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addAttributeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteForm.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
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddAttributeFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddAttributeFormAction.java 2015-02-24 23:41:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddAttributeFormAction.java 1970-01-01 00:00:00 +0000
@@ -1,113 +0,0 @@
-package org.hisp.dhis.trackedentity.action.trackedentityattribute;
-
-/*
- * Copyright (c) 2004-2015, 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.legend.LegendService;
-import org.hisp.dhis.legend.LegendSet;
-import org.hisp.dhis.option.OptionService;
-import org.hisp.dhis.option.OptionSet;
-import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.PeriodType;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- *
- * @version $ ShowAddAttributeFormAction.java Jan 23, 2014 3:01:44 PM $
- */
-public class ShowAddAttributeFormAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependency
- // -------------------------------------------------------------------------
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- @Autowired
- private OptionService optionService;
-
- @Autowired
- private LegendService legendService;
-
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private List<PeriodType> periodTypes;
-
- public List<PeriodType> getPeriodTypes()
- {
- return periodTypes;
- }
-
- private List<OptionSet> optionSets;
-
- public List<OptionSet> getOptionSets()
- {
- return optionSets;
- }
-
- private List<LegendSet> legendSets;
-
- public List<LegendSet> getLegendSets()
- {
- return legendSets;
- }
-
- // -------------------------------------------------------------------------
- // Getters && Setters
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- throws Exception
- {
- periodTypes = periodService.getAllPeriodTypes();
- optionSets = new ArrayList<>( optionService.getAllOptionSets() );
- legendSets = legendService.getAllLegendSets();
-
- Collections.sort( optionSets );
- Collections.sort( legendSets );
-
- return SUCCESS;
- }
-
-}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddUpdateAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddUpdateAttributeAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddUpdateAttributeAction.java 2015-03-19 09:29:29 +0000
@@ -0,0 +1,169 @@
+package org.hisp.dhis.trackedentity.action.trackedentityattribute;
+
+/*
+ * Copyright (c) 2004-2015, 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.legend.LegendService;
+import org.hisp.dhis.legend.LegendSet;
+import org.hisp.dhis.option.OptionService;
+import org.hisp.dhis.option.OptionSet;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.system.util.AttributeUtils;
+import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
+import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Chau Thu Tran
+ */
+public class ShowAddUpdateAttributeAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependency
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private TrackedEntityAttributeService trackedEntityAttributeService;
+
+ @Autowired
+ private ProgramService programService;
+
+ @Autowired
+ private PeriodService periodService;
+
+ @Autowired
+ private OptionService optionService;
+
+ @Autowired
+ private LegendService legendService;
+
+ @Autowired
+ private AttributeService attributeService;
+
+ // -------------------------------------------------------------------------
+ // Input/Output
+ // -------------------------------------------------------------------------
+
+ private Integer id;
+
+ public void setId( Integer id )
+ {
+ this.id = id;
+ }
+
+ private TrackedEntityAttribute attribute;
+
+ public TrackedEntityAttribute getAttribute()
+ {
+ return attribute;
+ }
+
+ private List<Program> programs;
+
+ public List<Program> getPrograms()
+ {
+ return programs;
+ }
+
+ private List<PeriodType> periodTypes;
+
+ public List<PeriodType> getPeriodTypes()
+ {
+ return periodTypes;
+ }
+
+ private List<OptionSet> optionSets;
+
+ public List<OptionSet> getOptionSets()
+ {
+ return optionSets;
+ }
+
+ private List<LegendSet> legendSets;
+
+ public List<LegendSet> getLegendSets()
+ {
+ return legendSets;
+ }
+
+ private List<Attribute> attributes;
+
+ public List<Attribute> getAttributes()
+ {
+ return attributes;
+ }
+
+ private Map<Integer, String> attributeValues = new HashMap<>();
+
+ public Map<Integer, String> getAttributeValues()
+ {
+ return attributeValues;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ if ( id != null )
+ {
+ attribute = trackedEntityAttributeService.getTrackedEntityAttribute( id );
+ attributeValues = AttributeUtils.getAttributeValueMap( attribute.getAttributeValues() );
+
+ programs = new ArrayList<>( programService.getAllPrograms() );
+ programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
+ Collections.sort( programs );
+ }
+
+ periodTypes = periodService.getAllPeriodTypes();
+ optionSets = new ArrayList<>( optionService.getAllOptionSets() );
+ legendSets = legendService.getAllLegendSets();
+ attributes = new ArrayList<>( attributeService.getTrackedEntityAttributeAttributes() );
+
+ Collections.sort( optionSets );
+ Collections.sort( legendSets );
+
+ return SUCCESS;
+ }
+}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowUpdateAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowUpdateAttributeAction.java 2015-02-24 23:41:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowUpdateAttributeAction.java 1970-01-01 00:00:00 +0000
@@ -1,153 +0,0 @@
-package org.hisp.dhis.trackedentity.action.trackedentityattribute;
-
-/*
- * Copyright (c) 2004-2015, 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.legend.LegendService;
-import org.hisp.dhis.legend.LegendSet;
-import org.hisp.dhis.option.OptionService;
-import org.hisp.dhis.option.OptionSet;
-import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.PeriodType;
-import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- */
-public class ShowUpdateAttributeAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependency
- // -------------------------------------------------------------------------
-
- private TrackedEntityAttributeService attributeService;
-
- public void setAttributeService( TrackedEntityAttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- private ProgramService programService;
-
- public void setProgramService( ProgramService programService )
- {
- this.programService = programService;
- }
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- @Autowired
- private OptionService optionService;
-
- @Autowired
- private LegendService legendService;
-
- // -------------------------------------------------------------------------
- // Input/Output
- // -------------------------------------------------------------------------
-
- private int id;
-
- public void setId( int id )
- {
- this.id = id;
- }
-
- private TrackedEntityAttribute attribute;
-
- public TrackedEntityAttribute getAttribute()
- {
- return attribute;
- }
-
- private List<Program> programs;
-
- public List<Program> getPrograms()
- {
- return programs;
- }
-
- private List<PeriodType> periodTypes;
-
- public List<PeriodType> getPeriodTypes()
- {
- return periodTypes;
- }
-
- private List<OptionSet> optionSets;
-
- public List<OptionSet> getOptionSets()
- {
- return optionSets;
- }
-
- private List<LegendSet> legendSets;
-
- public List<LegendSet> getLegendSets()
- {
- return legendSets;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- throws Exception
- {
- attribute = attributeService.getTrackedEntityAttribute( id );
- programs = new ArrayList<Program>( programService.getAllPrograms() );
- programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
- periodTypes = periodService.getAllPeriodTypes();
- optionSets = new ArrayList<>( optionService.getAllOptionSets() );
- legendSets = legendService.getAllLegendSets();
-
- Collections.sort( programs );
- Collections.sort( optionSets );
- Collections.sort( legendSets );
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml 2015-03-19 09:11:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml 2015-03-19 09:29:29 +0000
@@ -120,20 +120,9 @@
</bean>
<bean
- id="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddAttributeFormAction"
- class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddAttributeFormAction"
- scope="prototype">
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- </bean>
-
- <bean
- id="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowUpdateAttributeAction"
- class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowUpdateAttributeAction"
- scope="prototype">
- <property name="attributeService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
- <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+ id="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddUpdateAttributeAction"
+ class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddUpdateAttributeAction"
+ scope="prototype">
</bean>
<bean
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml 2015-03-19 09:11:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml 2015-03-19 09:29:29 +0000
@@ -114,7 +114,7 @@
<param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
</action>
- <action name="showAddAttributeForm" class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddAttributeFormAction">
+ <action name="showAddAttributeForm" class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddUpdateAttributeAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-program/addAttributeForm.vm</param>
<param name="javascripts">javascript/attribute.js</param>
@@ -123,7 +123,7 @@
</action>
<action name="showUpdateAttributeForm"
- class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowUpdateAttributeAction">
+ class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddUpdateAttributeAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-program/updateAttibuteForm.vm</param>
<param name="javascripts">javascript/attribute.js</param>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addAttributeForm.vm 2015-02-24 21:48:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addAttributeForm.vm 2015-03-19 09:29:29 +0000
@@ -1,5 +1,20 @@
-<script type="text/javascript" src="javascript/addAttributeForm.js"></script>
+<script>
+ jQuery(document).ready( function(){
+ validation2( 'addAttributeForm', function( form )
+ {
+ form.submit();
+ }, {
+ 'rules' : getValidationRules( "trackedEntityAttribute" ),
+ 'beforeValidateHandler' : function() {
+ #tblDynamicAttributesJavascript()
+ }
+ } );
+ checkValueIsExist( "name", "validateAttribute.action");
+ checkValueIsExist( "shortName", "validateAttribute.action");
+ checkValueIsExist( "code", "validateAttribute.action");
+ });
+</script>
<h3>$i18n.getString( "create_new_tracked_entity_attribute" ) #openHelp( "tracked_entity_attribute_information" )</h3>
#sharingCreateNotification( "trackedEntityAttribute" )
@@ -109,7 +124,11 @@
</td>
</tr>
</tbody>
-
+</table>
+
+#tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } )
+
+<table>
<tr>
<td></td>
<td>
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/addAttributeForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/addAttributeForm.js 2014-08-06 15:20:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/addAttributeForm.js 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
-jQuery(document).ready( function(){
- validation2( 'addAttributeForm', function( form )
- {
- form.submit();
- }, {
- 'rules' : getValidationRules( "trackedEntityAttribute" )
- } );
-
- checkValueIsExist( "name", "validateAttribute.action");
- checkValueIsExist( "shortName", "validateAttribute.action");
- checkValueIsExist( "code", "validateAttribute.action");
-});
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateAttributeForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateAttributeForm.js 2014-08-06 15:20:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateAttributeForm.js 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
-jQuery(document).ready( function(){
- validation2( 'updateAttributeForm', function( form )
- {
- form.submit();
- }, {
- 'rules' : getValidationRules( "trackedEntityAttribute" )
- } );
-
-
- checkValueIsExist( "name", "validateAttribute.action", {id:getFieldValue('id')});
- checkValueIsExist( "shortName", "validateAttribute.action", {id:getFieldValue('id')});
- checkValueIsExist( "code", "validateAttribute.action", {id:getFieldValue('id')});
-});
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteForm.vm 2015-02-24 21:48:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteForm.vm 2015-03-19 09:29:29 +0000
@@ -1,5 +1,20 @@
-<script type="text/javascript" src="javascript/updateAttributeForm.js"></script>
+<script>
+ jQuery(document).ready( function(){
+ validation2( 'updateAttributeForm', function( form )
+ {
+ form.submit();
+ }, {
+ 'rules' : getValidationRules( "trackedEntityAttribute" ),
+ 'beforeValidateHandler' : function() {
+ #tblDynamicAttributesJavascript()
+ }
+ } );
+ checkValueIsExist( "name", "validateAttribute.action", {id:getFieldValue('id')});
+ checkValueIsExist( "shortName", "validateAttribute.action", {id:getFieldValue('id')});
+ checkValueIsExist( "code", "validateAttribute.action", {id:getFieldValue('id')});
+ });
+</script>
<h3>$i18n.getString( "edit_tracked_entity_attribute" ) #openHelp( "tracked_entity_attribute_information" )</h3>
<form id="updateAttributeForm" name="updateAttributeForm" action="updateAttribute.action" method="post" class="inputForm">
@@ -106,7 +121,11 @@
</td>
</tr>
</tbody>
-
+</table>
+
+#tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } )
+
+<table>
<tr>
<td></td>
<td>