dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17141
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6729: CCEM_catalogtype work in progress
------------------------------------------------------------
revno: 6729
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-04-25 11:22:37 +0530
message:
CCEM_catalogtype work in progress
removed:
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogType.js
added:
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeFormAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/GetCatalogTypeAttributesAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeFormAction.java
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/addCatalogTypeForm.vm
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/addCatalogTypeForm.js
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/catalogType.js
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/updateCatalogTypeForm.js
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/jsonCatalogTypeAttributes.vm
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/updateCatalogTypeForm.vm
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/xmlCatalogTypeAttributes.vm
modified:
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeAttributeService.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeService.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeStore.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogTypeService.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeAttributeStore.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeStore.java
local/in/dhis-web-coldchain/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties
local/in/dhis-web-coldchain/src/main/resources/struts.xml
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/css/basic.css
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/css/style.css
--
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 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeAttributeService.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeAttributeService.java 2012-04-21 10:23:39 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeAttributeService.java 2012-04-25 05:52:37 +0000
@@ -15,6 +15,8 @@
CatalogTypeAttribute getCatalogTypeAttribute( int id );
CatalogTypeAttribute getCatalogTypeAttributeByName( String name );
+
+ //CatalogType getCatalogTypeByAttribute( CatalogType catalogType, CatalogTypeAttribute catalogTypeAttribute);
Collection<CatalogTypeAttribute> getAllCatalogTypeAttributes();
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeService.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeService.java 2012-04-16 11:29:53 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeService.java 2012-04-25 05:52:37 +0000
@@ -11,6 +11,10 @@
void updateCatalogType( CatalogType catalogType );
void deleteCatalogType( CatalogType catalogType );
+
+ CatalogType getCatalogType( int id );
+
+ CatalogType getCatalogTypeByName( String name );
Collection<CatalogType> getAllCatalogTypes();
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeStore.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeStore.java 2012-04-16 11:29:53 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeStore.java 2012-04-25 05:52:37 +0000
@@ -11,6 +11,12 @@
void updateCatalogType( CatalogType catalogType );
void deleteCatalogType( CatalogType catalogType );
+
+ CatalogType getCatalogType( int id );
+
+ CatalogType getCatalogTypeByName( String name );
+
+ //CatalogType getCatalogTypeByAttribute( CatalogType catalogType, CatalogTypeAttribute catalogTypeAttribute);
Collection<CatalogType> getAllCatalogTypes();
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogTypeService.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogTypeService.java 2012-04-21 10:23:39 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogTypeService.java 2012-04-25 05:52:37 +0000
@@ -48,4 +48,20 @@
{
catalogTypeStore.updateCatalogType( catalogType );
}
+
+ @Transactional
+ @Override
+ public CatalogType getCatalogType( int id )
+ {
+ return catalogTypeStore.getCatalogType( id );
+ }
+
+ @Transactional
+ @Override
+ public CatalogType getCatalogTypeByName( String name )
+ {
+ return catalogTypeStore.getCatalogTypeByName( name );
+ }
+
+
}
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeAttributeStore.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeAttributeStore.java 2012-04-21 10:23:39 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeAttributeStore.java 2012-04-25 05:52:37 +0000
@@ -73,7 +73,6 @@
Criteria criteria = session.createCriteria( CatalogTypeAttribute.class );
criteria.add( Restrictions.eq( "name", name ) );
-
return (CatalogTypeAttribute) criteria.uniqueResult();
}
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeStore.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeStore.java 2012-04-16 11:29:53 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeStore.java 2012-04-25 05:52:37 +0000
@@ -2,9 +2,12 @@
import java.util.Collection;
+import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import org.hibernate.criterion.Restrictions;
import org.hisp.dhis.coldchain.catalog.CatalogType;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute;
import org.hisp.dhis.coldchain.catalog.CatalogTypeStore;
public class HibernateCatalogTypeStore implements CatalogTypeStore
@@ -55,5 +58,37 @@
session.update( catalogType );
}
-
+
+ @Override
+ public CatalogType getCatalogType( int id )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ return (CatalogType) session.get( CatalogType.class, id );
+ }
+
+ @Override
+ public CatalogType getCatalogTypeByName( String name )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( CatalogType.class );
+ criteria.add( Restrictions.eq( "name", name ) );
+
+ return (CatalogType) criteria.uniqueResult();
+
+ }
+ /*
+ @Override
+ public CatalogType getCatalogTypeByAttribute( CatalogType catalogType, CatalogTypeAttribute catalogTypeAttribute)
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( CatalogType.class );
+ criteria.add( Restrictions.eq( "name", catalogTypeAttribute ) );
+
+ return (CatalogType) criteria.uniqueResult();
+
+ }
+ */
}
=== added file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeAction.java 2012-04-25 05:52:37 +0000
@@ -0,0 +1,92 @@
+package org.hisp.dhis.coldchain.catalog.action;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.hisp.dhis.coldchain.catalog.CatalogType;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeService;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeService;
+
+import com.opensymphony.xwork2.Action;
+
+public class AddCatalogTypeAction
+implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private CatalogTypeService catalogTypeService;
+
+ public void setCatalogTypeService( CatalogTypeService catalogTypeService )
+ {
+ this.catalogTypeService = catalogTypeService;
+ }
+
+ private CatalogTypeAttributeService catalogTypeAttributeService;
+
+ public void setCatalogTypeAttributeService( CatalogTypeAttributeService catalogTypeAttributeService )
+ {
+ this.catalogTypeAttributeService = catalogTypeAttributeService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input/Output
+ // -------------------------------------------------------------------------
+
+
+ private String name;
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ private String description;
+
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+ private List<Integer> selectedCatalogTypeAttributesValidator = new ArrayList<Integer>();
+
+
+ public void setSelectedCatalogTypeAttributesValidator( List<Integer> selectedCatalogTypeAttributesValidator )
+ {
+ this.selectedCatalogTypeAttributesValidator = selectedCatalogTypeAttributesValidator;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+
+ CatalogType catalogType = new CatalogType();
+
+ catalogType.setName( name );
+ catalogType.setDescription( description );
+ //catalogType.getCatalogTypeAttributes().add( arg0 )
+ //catalogTypeService.addCatalogType( catalogType );
+
+ Set<CatalogTypeAttribute> catalogTypeAttributes = new HashSet<CatalogTypeAttribute>();
+
+ for ( int i = 0; i < this.selectedCatalogTypeAttributesValidator.size(); i++ )
+ {
+ CatalogTypeAttribute catalogTypeAttribute = catalogTypeAttributeService.getCatalogTypeAttribute( selectedCatalogTypeAttributesValidator.get( i ) );
+
+ catalogTypeAttributes.add( catalogTypeAttribute );
+
+ }
+ catalogType.setCatalogTypeAttributes( catalogTypeAttributes );
+
+ catalogTypeService.addCatalogType( catalogType );
+
+ return SUCCESS;
+ }
+}
=== added file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeFormAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeFormAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeFormAction.java 2012-04-25 05:52:37 +0000
@@ -0,0 +1,32 @@
+package org.hisp.dhis.coldchain.catalog.action;
+
+import com.opensymphony.xwork2.Action;
+
+public class AddCatalogTypeFormAction
+implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+
+
+ // -------------------------------------------------------------------------
+ // Input/Output
+ // -------------------------------------------------------------------------
+
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+ //program = programService.getProgram( id );
+
+ //selectionTreeManager.setSelectedOrganisationUnits( program.getOrganisationUnits() );
+
+ return SUCCESS;
+ }
+}
+
=== added file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/GetCatalogTypeAttributesAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/GetCatalogTypeAttributesAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/GetCatalogTypeAttributesAction.java 2012-04-25 05:52:37 +0000
@@ -0,0 +1,135 @@
+package org.hisp.dhis.coldchain.catalog.action;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeService;
+import org.hisp.dhis.coldchain.catalog.comparator.CatalogTypeAttributeComparator;
+import org.hisp.dhis.common.IdentifiableObjectUtils;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
+
+import com.opensymphony.xwork2.Action;
+
+public class GetCatalogTypeAttributesAction implements Action
+{
+
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private CatalogTypeAttributeService catalogTypeAttributeService;
+
+ public void setCatalogTypeAttributeService( CatalogTypeAttributeService catalogTypeAttributeService )
+ {
+ this.catalogTypeAttributeService = catalogTypeAttributeService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & output
+ // -------------------------------------------------------------------------
+
+
+ private String key;
+
+ public void setKey( String key )
+ {
+ this.key = key;
+ }
+
+
+ private List<CatalogTypeAttribute> catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>();
+
+ public List<CatalogTypeAttribute> getCatalogTypeAttributes()
+ {
+ return catalogTypeAttributes;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+
+ catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>(catalogTypeAttributeService.getAllCatalogTypeAttributes());
+ Collections.sort( catalogTypeAttributes, new CatalogTypeAttributeComparator() );
+
+ /*
+ if ( key != null )
+ {
+ catalogTypeAttributes = IdentifiableObjectUtils.filterNameByKey( catalogTypeAttributes, key, true );
+ }
+
+ Collections.sort( catalogTypeAttributes, IdentifiableObjectNameComparator.INSTANCE );
+ */
+
+
+ /*
+ if ( id != null && id != ALL )
+ {
+ DataElementGroup dataElementGroup = dataElementService.getDataElementGroup( id );
+
+ if ( dataElementGroup != null )
+ {
+ dataElements = new ArrayList<DataElement>( dataElementGroup.getMembers() );
+ }
+ }
+ else if ( categoryComboId != null && categoryComboId != ALL )
+ {
+ DataElementCategoryCombo categoryCombo = categoryService.getDataElementCategoryCombo( categoryComboId );
+
+ if ( categoryCombo != null )
+ {
+ dataElements = new ArrayList<DataElement>(
+ dataElementService.getDataElementByCategoryCombo( categoryCombo ) );
+ }
+ }
+ else if ( dataSetId != null )
+ {
+ DataSet dataset = dataSetService.getDataSet( dataSetId );
+
+ if ( dataset != null )
+ {
+ dataElements = new ArrayList<DataElement>( dataset.getDataElements() );
+ }
+ }
+ else if ( periodTypeName != null )
+ {
+ PeriodType periodType = periodService.getPeriodTypeByName( periodTypeName );
+
+ if ( periodType != null )
+ {
+ dataElements = new ArrayList<DataElement>( dataElementService.getDataElementsByPeriodType( periodType ) );
+ }
+ }
+ else if ( domain != null )
+ {
+ dataElements = new ArrayList<DataElement>(
+ dataElementService.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_PATIENT ) );
+ }
+ else
+ {
+ dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
+
+ ContextUtils.clearIfNotModified( ServletActionContext.getRequest(), ServletActionContext.getResponse(), dataElements );
+ }
+
+ if ( key != null )
+ {
+ dataElements = IdentifiableObjectUtils.filterNameByKey( dataElements, key, true );
+ }
+
+ Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );
+
+ if ( aggregate )
+ {
+ FilterUtils.filter( dataElements, new AggregatableDataElementFilter() );
+ }
+ */
+
+ return SUCCESS;
+ }
+
+}
=== added file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeAction.java 2012-04-25 05:52:37 +0000
@@ -0,0 +1,110 @@
+package org.hisp.dhis.coldchain.catalog.action;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.hisp.dhis.coldchain.catalog.CatalogType;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeService;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeService;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageDataElement;
+
+import com.opensymphony.xwork2.Action;
+
+public class UpdateCatalogTypeAction
+implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private CatalogTypeService catalogTypeService;
+
+ public void setCatalogTypeService( CatalogTypeService catalogTypeService )
+ {
+ this.catalogTypeService = catalogTypeService;
+ }
+
+ private CatalogTypeAttributeService catalogTypeAttributeService;
+
+ public void setCatalogTypeAttributeService( CatalogTypeAttributeService catalogTypeAttributeService )
+ {
+ this.catalogTypeAttributeService = catalogTypeAttributeService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input/Output
+ // -------------------------------------------------------------------------
+
+ private int id;
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ private String name;
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ private String description;
+
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+ private List<Integer> selectedCatalogTypeAttributesValidator = new ArrayList<Integer>();
+
+ public void setSelectedCatalogTypeAttributesValidator( List<Integer> selectedCatalogTypeAttributesValidator )
+ {
+ this.selectedCatalogTypeAttributesValidator = selectedCatalogTypeAttributesValidator;
+ }
+
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+
+ CatalogType catalogType = catalogTypeService.getCatalogType( id );
+
+ catalogType.setName( name );
+ catalogType.setDescription( description );
+
+
+ //catalogTypeService.updateCatalogType( catalogType );
+ if( catalogType != null)
+ {
+ catalogType.getCatalogTypeAttributes().clear();
+ }
+ //catalogType.getCatalogTypeAttributes().clear();
+
+ Set<CatalogTypeAttribute> catalogTypeAttributes = new HashSet<CatalogTypeAttribute>( );
+
+
+
+ for ( int i = 0; i < this.selectedCatalogTypeAttributesValidator.size(); i++ )
+ {
+ CatalogTypeAttribute catalogTypeAttribute = catalogTypeAttributeService.getCatalogTypeAttribute( selectedCatalogTypeAttributesValidator.get( i ) );
+
+ catalogTypeAttributes.add( catalogTypeAttribute );
+ }
+
+ catalogType.setCatalogTypeAttributes( catalogTypeAttributes );
+ catalogTypeService.updateCatalogType( catalogType );
+
+
+ return SUCCESS;
+ }
+}
+
=== added file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeFormAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeFormAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeFormAction.java 2012-04-25 05:52:37 +0000
@@ -0,0 +1,82 @@
+package org.hisp.dhis.coldchain.catalog.action;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.hisp.dhis.coldchain.catalog.CatalogType;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute;
+import org.hisp.dhis.coldchain.catalog.CatalogTypeService;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.program.ProgramStageDataElement;
+
+import com.opensymphony.xwork2.Action;
+
+public class UpdateCatalogTypeFormAction
+implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private CatalogTypeService catalogTypeService;
+
+ public void setCatalogTypeService( CatalogTypeService catalogTypeService )
+ {
+ this.catalogTypeService = catalogTypeService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input/Output
+ // -------------------------------------------------------------------------
+
+ private int id;
+
+ public int getId()
+ {
+ return id;
+ }
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ private CatalogType catalogType;
+
+ public CatalogType getCatalogType()
+ {
+ return catalogType;
+ }
+
+ private Collection<CatalogTypeAttribute> catalogTypeAttributes;
+
+ public Collection<CatalogTypeAttribute> getCatalogTypeAttributes()
+ {
+ return catalogTypeAttributes;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+
+ //System.out.println( id );
+ catalogType = catalogTypeService.getCatalogType( id );
+
+ //System.out.println( catalogType.getId() + "-----"+catalogType.getDescription());
+
+ catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>( catalogType.getCatalogTypeAttributes());
+ //catalogTypeAttributes = catalogType.getCatalogTypeAttributes();
+
+ //programStage = programStageService.getProgramStage( id );
+
+ //programStageDataElements = programStage.getProgramStageDataElements();
+
+ return SUCCESS;
+ }
+}
+
=== modified file 'local/in/dhis-web-coldchain/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-coldchain/src/main/resources/META-INF/dhis/beans.xml 2012-04-21 12:57:24 +0000
+++ local/in/dhis-web-coldchain/src/main/resources/META-INF/dhis/beans.xml 2012-04-25 05:52:37 +0000
@@ -95,7 +95,49 @@
ref="org.hisp.dhis.coldchain.catalog.CatalogTypeService" />
</bean>
-
+ <!-- Add Catalog Type Form -->
+ <bean id="org.hisp.dhis.coldchain.catalog.action.AddCatalogTypeFormAction"
+ class="org.hisp.dhis.coldchain.catalog.action.AddCatalogTypeFormAction"
+ scope="prototype">
+ </bean>
+
+ <!-- Catalog Type Attributes -->
+ <bean id="org.hisp.dhis.coldchain.catalog.action.GetCatalogTypeAttributesAction"
+ class="org.hisp.dhis.coldchain.catalog.action.GetCatalogTypeAttributesAction"
+ scope="prototype">
+ <property name="catalogTypeAttributeService"
+ ref="org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeService" />
+ </bean>
+
+ <!-- Add -->
+ <bean id="org.hisp.dhis.coldchain.catalog.action.AddCatalogTypeAction"
+ class="org.hisp.dhis.coldchain.catalog.action.AddCatalogTypeAction"
+ scope="prototype">
+ <property name="catalogTypeService"
+ ref="org.hisp.dhis.coldchain.catalog.CatalogTypeService" />
+ <property name="catalogTypeAttributeService"
+ ref="org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeService" />
+ </bean>
+
+
+ <!-- Update Form -->
+ <bean id="org.hisp.dhis.coldchain.catalog.action.UpdateCatalogTypeFormAction"
+ class="org.hisp.dhis.coldchain.catalog.action.UpdateCatalogTypeFormAction"
+ scope="prototype">
+ <property name="catalogTypeService"
+ ref="org.hisp.dhis.coldchain.catalog.CatalogTypeService" />
+ </bean>
+
+ <!-- Update -->
+ <bean id="org.hisp.dhis.coldchain.catalog.action.UpdateCatalogTypeAction"
+ class="org.hisp.dhis.coldchain.catalog.action.UpdateCatalogTypeAction"
+ scope="prototype">
+ <property name="catalogTypeService"
+ ref="org.hisp.dhis.coldchain.catalog.CatalogTypeService" />
+ <property name="catalogTypeAttributeService"
+ ref="org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeService" />
+ </bean>
+
<!-- Inventory -->
<bean id="org.hisp.dhis.coldchain.inventory.action.GetInventoryTypeAttributeListAction"
class="org.hisp.dhis.coldchain.inventory.action.GetInventoryTypeAttributeListAction"
=== modified file 'local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties'
--- local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties 2012-04-21 12:57:24 +0000
+++ local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties 2012-04-25 05:52:37 +0000
@@ -26,6 +26,15 @@
catalogType = Catalog Type
confirm_delete = Are you sure you want to delete this catalog type?
catalogType_management = Catalog Type management
+available_catalogType_attribute = Available Catalog Type Attributes
+selected_catalogType_attribute = Selected Data Catalog Type Attributes
+create_new_catalogType = Create new catalog type
+catalogType_attributes = Catalog type attributes
+edit_catalogType = Edit catalog type
+catalog_type_details = Details of Catalog Type
+
+
+
inventorytype_attribute_management = Inventorytype Attribute Management
inventorytype_attribute = Inventorytype Attribute
=== modified file 'local/in/dhis-web-coldchain/src/main/resources/struts.xml'
--- local/in/dhis-web-coldchain/src/main/resources/struts.xml 2012-04-21 12:57:24 +0000
+++ local/in/dhis-web-coldchain/src/main/resources/struts.xml 2012-04-25 05:52:37 +0000
@@ -87,6 +87,42 @@
<param name="javascripts">javascript/catalogType.js</param>
</action>
+ <!-- Add Catalog Type Form -->
+ <action name="addCatalogTypeForm" class="org.hisp.dhis.coldchain.catalog.action.AddCatalogTypeFormAction">
+ <result name="input" type="velocity-xml">/dhis-web-commons/ajax/xmlResponseInput.vm</result>
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-coldchain/addCatalogTypeForm.vm</param>
+ <param name="menu">/dhis-web-coldchain/menu.vm</param>
+ <param name="javascripts">javascript/catalogType.js</param>
+ <param name="stylesheets">css/style.css</param>
+
+ </action>
+
+ <!-- Catalog Type Attributes -->
+ <action name="getCatalogTypeAttributes" class="org.hisp.dhis.coldchain.catalog.action.GetCatalogTypeAttributesAction">
+ <result name="success" type="velocity-json">/dhis-web-coldchain/jsonCatalogTypeAttributes.vm</result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+
+ <!-- Add -->
+ <action name="addCataligType" class="org.hisp.dhis.coldchain.catalog.action.AddCatalogTypeAction">
+ <result name="success" type="redirect">catalogType.action</result>
+ </action>
+
+ <!-- Update Form -->
+ <action name="editCatalogTypeForm" class="org.hisp.dhis.coldchain.catalog.action.UpdateCatalogTypeFormAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-coldchain/updateCatalogTypeForm.vm</param>
+ <param name="javascripts">javascript/catalogType.js</param>
+ <param name="stylesheets">css/style.css</param>
+ </action>
+
+ <!-- Update -->
+ <action name="updateCatalogType" class="org.hisp.dhis.coldchain.catalog.action.UpdateCatalogTypeAction">
+ <result name="success" type="redirect">catalogType.action</result>
+ </action>
+
<!-- Inventory -->
<action name="inventoryTypeAttributeList" class="org.hisp.dhis.coldchain.inventory.action.GetInventoryTypeAttributeListAction">
<result name="success" type="velocity">/main.vm</result>
=== added file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/addCatalogTypeForm.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/addCatalogTypeForm.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/addCatalogTypeForm.vm 2012-04-25 05:52:37 +0000
@@ -0,0 +1,73 @@
+<script type="text/javascript" src="javascript/addCatalogTypeForm.js"></script>
+
+<h3>$i18n.getString( "create_new_catalogType" )</h3>
+
+<form id="addCatalogTypeForm" name="addCatalogTypeForm" action="addCataligType.action" method="post">
+
+<table>
+ <tr>
+ <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="name" name="name" class="{validate:{required:true,rangelength:[4,160]}}"/></td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "description" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="description" name="description" class="{validate:{required:true,minlength:4}}"/></td>
+ </tr>
+
+ <tr><td> </td><td> </td></tr>
+</table>
+
+<table id="catalogTypeMembersArea">
+ <thead>
+ <tr>
+ <th>$i18n.getString( "available_catalogType_attribute" )</th>
+ <th></th>
+ <th>$i18n.getString( "selected_catalogType_attribute" )
+ <select id="selectedCatalogTypeAttributesValidator" name='selectedCatalogTypeAttributesValidator' multiple="multiple" class="{validate:{required:true}} hidden" ></select>
+ </th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+ <td>
+ <select size="15" id="availableList" name='availableList' multiple="multiple" ondblclick="selectCatalogTypeAttributes()">
+ </select>
+ </td>
+ <td>
+ <input type="button" value=">" onclick="selectCatalogTypeAttributes()" class='filterButton' /><br/>
+ <input type="button" value="<" onclick="unselectCatalogTypeAttributes()" class='filterButton' /><br/><br/>
+ <td>
+ <div class="catalogTypeAttributeDiv">
+ <table>
+ <thead>
+ <tr>
+ <th>$i18n.getString( "catalogType_attributes" )</th>
+
+ </thead>
+ <tbody id="selectedList"></tbody>
+ </table>
+ </div>
+ </td>
+
+ <td>
+ <a href="javascript:moveUpCatalogTypeAttribute()"><img src="../images/move_up.png"/></a><br/><br/>
+ <a href="javascript:moveDownCatalogTypeAttribute()"><img src="../images/move_down.png"/></a><br/><br/>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<p>
+ <input type="submit" value="$i18n.getString( 'add' )"/>
+ <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='catalogType.action'" />
+</p>
+
+</form>
+
+<script type="text/javascript">
+ var i18n_invalid_min_max_days = '$encoder.jsEscape( $i18n.getString( "invalid_min_max_days" ) , "'")';
+ var i18n_value_must_positive = '$encoder.jsEscape( $i18n.getString( "value_must_positive" ) , "'")';
+ var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
+ var i18n_compulsory_checkbox_title = '$encoder.jsEscape( $i18n.getString( "compulsory_checkbox_title" ) , "'")';
+</script>
\ No newline at end of file
=== removed file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogType.js'
=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm 2012-04-21 10:23:39 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm 2012-04-25 05:52:37 +0000
@@ -35,7 +35,7 @@
<tr id="tr${catalogType.id}">
<td onclick="showCalatogTypeDetails( $catalogType.id )">$encoder.htmlEncode( $catalogType.name )</td>
<td style="text-align:right">
- <a href="editCatalogTypeForm.action?catalogTypeId=$catalogType.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
+ <a href="editCatalogTypeForm.action?id=$catalogType.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
<a href="javascript:removeCatalogType( '$catalogType.id', '$encoder.jsEncode( $catalogType.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
<a href="javascript:showCalatogTypeDetails( $catalogType.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
</td>
=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/css/basic.css'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/css/basic.css 2012-04-21 12:57:24 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/css/basic.css 2012-04-25 05:52:37 +0000
@@ -87,4 +87,15 @@
{
width:25em;
text-align:left;
+}
+.catalogTypeAttributeDiv
+{
+ overflow:auto;
+ height:20em;
+ width:30em;
+ border:1px solid #9DA1AA;
+}
+.catalogTypeAttributeDiv table
+{
+ width:100%;
}
\ No newline at end of file
=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/css/style.css'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/css/style.css 2012-04-18 09:24:36 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/css/style.css 2012-04-25 05:52:37 +0000
@@ -87,4 +87,15 @@
{
width:25em;
text-align:left;
+}
+.catalogTypeAttributeDiv
+{
+ overflow:auto;
+ height:20em;
+ width:30em;
+ border:1px solid #9DA1AA;
+}
+.catalogTypeAttributeDiv table
+{
+ width:100%;
}
\ No newline at end of file
=== added file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/addCatalogTypeForm.js'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/addCatalogTypeForm.js 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/addCatalogTypeForm.js 2012-04-25 05:52:37 +0000
@@ -0,0 +1,30 @@
+jQuery( document ).ready( function()
+{
+ validation( 'addCatalogTypeForm', function( form ){
+ form.submit();
+ }, function(){
+ selectedCatalogTypeAttributesValidator = jQuery( "#selectedCatalogTypeAttributesValidator" );
+ selectedCatalogTypeAttributesValidator.empty();
+
+ jQuery("#selectedList").find("tr").each( function( i, item ){
+ selectedCatalogTypeAttributesValidator.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
+ });
+ });
+
+ jQuery("#availableList").dhisAjaxSelect({
+ source: "getCatalogTypeAttributes.action",
+ iterator: "catalogTypeAttributes",
+ connectedTo: 'selectedCatalogTypeAttributesValidator',
+ handler: function(item) {
+ var option = jQuery("<option />");
+ option.text( item.name );
+ option.attr( "value", item.id );
+
+ return option;
+
+ }
+ });
+
+ //checkValueIsExist( "name", "validateProgramStage.action");
+});
+
=== added file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/catalogType.js'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/catalogType.js 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/catalogType.js 2012-04-25 05:52:37 +0000
@@ -0,0 +1,85 @@
+// -----------------------------------------------------------------------------
+// select/ Catalog Type Attributes
+// -----------------------------------------------------------------------------
+
+function selectCatalogTypeAttributes()
+{
+ var selectedList = jQuery("#selectedList");
+ jQuery("#availableList").children().each(function(i, item){
+ if( item.selected ){
+ html = "<tr class='selected' id='" + item.value + "' ondblclick='unCatalogTypeAttribute( this )'><td onclick='select(this)'>" + item.text + "</td>";
+ html += "</tr>";
+ selectedList.append( html );
+ jQuery( item ).remove();
+ }
+ });
+}
+
+function unselectCatalogTypeAttributes()
+{
+ var availableList = jQuery("#availableList");
+ jQuery("#selectedList").find("tr").each( function( i, item ){
+ item = jQuery(item);
+ if( item.hasClass("selected") )
+ {
+ availableList.append( "<option value='" + item.attr( "id" ) + "' selected='true'>" + item.find("td:first").text() + "</option>" );
+ item.remove();
+ }
+ });
+}
+
+
+
+
+//-----------------------------------------------------------------------------
+//Move Table Row Up and Down
+//-----------------------------------------------------------------------------
+
+
+function moveUpCatalogTypeAttribute()
+{
+ var selectedList = jQuery("#selectedList");
+
+ jQuery("#selectedList").find("tr").each( function( i, item ){
+ item = jQuery(item);
+ if( item.hasClass("selected") )
+ {
+ var prev = item.prev('#selectedList tr');
+ if (prev.length == 1)
+ {
+ prev.before(item);
+ }
+ }
+ });
+}
+
+function moveDownCatalogTypeAttribute()
+{
+ var selectedList = jQuery("#selectedList");
+
+ jQuery("#selectedList").find("tr").each( function( i, item ){
+ item = jQuery(item);
+ if( item.hasClass("selected") )
+ {
+ var next = item.next('#selectedList tr');
+ if (next.length == 1)
+ {
+ next.after(item);
+ }
+ }
+ });
+}
+
+function unCatalogTypeAttribute( element )
+{
+ element = jQuery(element);
+ jQuery("#availableList").append( "<option value='" + element.attr( "id" ) + "' selected='true'>" + element.find("td:first").text() + "</option>" );
+ element.remove();
+}
+
+function select( element )
+{
+ element = jQuery( element ).parent();
+ if( element.hasClass( 'selected') ) element.removeClass( 'selected' );
+ else element.addClass( 'selected' );
+}
=== added file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/updateCatalogTypeForm.js'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/updateCatalogTypeForm.js 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/updateCatalogTypeForm.js 2012-04-25 05:52:37 +0000
@@ -0,0 +1,37 @@
+jQuery( document ).ready( function()
+{validation( 'updateCatalogTypeForm', function( form ){
+ form.submit() ;
+ }, function(){
+ selectedCatalogTypeAttributesValidator = jQuery( "#selectedCatalogTypeAttributesValidator" );
+ selectedCatalogTypeAttributesValidator.empty();
+
+ jQuery("#selectedList").find("tr").each( function( i, item ){
+ selectedCatalogTypeAttributesValidator.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
+
+ });
+ });
+
+ //checkValueIsExist( "name", "validateProgramStage.action", {id:getFieldValue('id')});
+
+ jQuery("#availableList").dhisAjaxSelect({
+ source: "getCatalogTypeAttributes.action",
+ iterator: "catalogTypeAttributes",
+ connectedTo: 'selectedCatalogTypeAttributesValidator',
+ handler: function(item) {
+ var option = jQuery("<option />");
+ option.text( item.name );
+ option.attr( "value", item.id );
+
+ var flag = false;
+ jQuery("#selectedList").find("tr").each( function( k, selectedItem ){
+ if(selectedItem.id == item.id )
+ {
+ flag = true;
+ return;
+ }
+ });
+
+ if(!flag) return option;
+ }
+ });
+});
\ No newline at end of file
=== added file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/jsonCatalogTypeAttributes.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/jsonCatalogTypeAttributes.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/jsonCatalogTypeAttributes.vm 2012-04-25 05:52:37 +0000
@@ -0,0 +1,13 @@
+
+#set( $size = $catalogTypeAttributes.size() )
+{ "catalogTypeAttributes": [
+#foreach( $catalogTypeAttribute in $catalogTypeAttributes )
+{
+ "id": ${catalogTypeAttribute.id},
+ "name": "$!encoder.jsonEncode( ${catalogTypeAttribute.name} )",
+ "description": "$!encoder.jsonEncode( ${catalogTypeAttribute.description} )",
+ "valueType": "$!encoder.jsonEncode( ${catalogTypeAttribute.valueType} )"
+}#if( $velocityCount < $size ),#end
+#end
+]
+}
\ No newline at end of file
=== added file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/updateCatalogTypeForm.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/updateCatalogTypeForm.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/updateCatalogTypeForm.vm 2012-04-25 05:52:37 +0000
@@ -0,0 +1,87 @@
+<script type="text/javascript" src="javascript/updateCatalogTypeForm.js"></script>
+
+<h3>$i18n.getString( "edit_catalogType" )</h3>
+
+<form id="updateCatalogTypeForm" name="updateCatalogTypeForm" action="updateCatalogType.action" method="post">
+ <input type="hidden" id="id" name="id" value="$catalogType.id"/>
+
+ <table id="detailsList">
+ <thead>
+ <tr><th colspan="2">$i18n.getString( "catalog_type_details" )</th></tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $catalogType.name )" class="{validate:{required:true,rangelength:[4,160]}}"/></td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "description" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $catalogType.description )" class="{validate:{required:true,minlength:4}}"/></td>
+ </tr>
+ <tr><td> </td></tr>
+
+ </tbody>
+ </table>
+
+ <table id="catalogTypeMembersArea">
+ <thead>
+ <tr>
+ <th>$i18n.getString( "available_catalogType_attribute" )</th>
+ <th></th>
+ <th>$i18n.getString( "selected_catalogType_attribute" )
+ <select id="selectedCatalogTypeAttributesValidator" name='selectedCatalogTypeAttributesValidator' multiple="multiple" class="{validate:{required:true}} hidden" > </select>
+ </th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+ <tr>
+ <td>
+ <select size="15" id="availableList" name='availableList' multiple="multiple" ondblclick="selectCatalogTypeAttributes()">
+ </select>
+ </td>
+ <td valign="top" align="center">
+ <input type="button" value=">" onclick="selectCatalogTypeAttributes()" class='filterButton' /><br/>
+ <input type="button" value="<" onclick="unselectCatalogTypeAttributes()" class='filterButton' /><br/><br/>
+ <td>
+ <div class="catalogTypeAttributeDiv">
+ <table>
+ <thead>
+ <tr>
+ <th>$i18n.getString( "catalogType_attributes" )</th>
+ </tr>
+ </thead>
+ <tbody id="selectedList">
+ #foreach ( $catalogTypeAttribute in $catalogTypeAttributes )
+ <tr ondblclick="unselectCatalogTypeAttributes( this )" id="$catalogTypeAttribute.id">
+ <td onclick="select(this)">$encoder.htmlEncode( $catalogTypeAttribute.name )</td>
+ </tr>
+ #end
+ </tbody>
+ </table>
+ </div>
+ </td>
+
+ <td>
+ <a href="javascript:moveUpCatalogTypeAttribute()"><img src="../images/move_up.png"/></a><br/><br/>
+ <a href="javascript:moveDownCatalogTypeAttribute()"><img src="../images/move_down.png"/></a><br/><br/>
+ </td>
+
+ </tr>
+ </tbody>
+ </table>
+ <p>
+ <input type="submit" value="$i18n.getString( 'update' )" />
+ <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='catalogType.action'" />
+ </p>
+
+</form>
+
+<script type="text/javascript">
+ var i18n_invalid_min_max_days = '$encoder.jsEscape( $i18n.getString( "invalid_min_max_days" ) , "'")';
+ var i18n_value_must_positive = '$encoder.jsEscape( $i18n.getString( "value_must_positive" ) , "'")';
+ var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
+ var i18n_compulsory_checkbox_title = '$encoder.jsEscape( $i18n.getString( "compulsory_checkbox_title" ) , "'")';
+</script>
\ No newline at end of file
=== added file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/xmlCatalogTypeAttributes.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/xmlCatalogTypeAttributes.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/xmlCatalogTypeAttributes.vm 2012-04-25 05:52:37 +0000
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<catalogTypeAttributes>
+#foreach( $catalogTypeAttribute in $catalogTypeAttributes )
+ <catalogTypeAttribute>
+ <id>$catalogTypeAttribute.id</id>
+ <name>$encoder.xmlEncode( $catalogTypeAttribute.name )</name>
+ <description>$!encoder.xmlEncode( $catalogTypeAttribute.description )</description>
+ <valueType>$catalogTypeAttribute.valueType</valueType>
+ <mandatory>$catalogTypeAttribute.mandatory</mandatory>
+ </catalogTypeAttribute>
+#end
+</catalogTypeAttributes>
\ No newline at end of file