← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7655: Changes in CatalogDataEntry; Added diluent Volumen in VaccineRequirement Report Formula

 

------------------------------------------------------------
revno: 7655
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-07-21 11:27:27 +0100
message:
  Changes in CatalogDataEntry; Added diluent Volumen in VaccineRequirement Report Formula
modified:
  local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogDataEntryService.java
  local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogDataEntryService.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/reports/action/GenerateCCEMReportAction.java
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/catalog.js
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/viewCatalogTypeDataEntryForm.js
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/showAddCatalogForm.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 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogDataEntryService.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogDataEntryService.java	2012-06-14 05:58:42 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogDataEntryService.java	2012-07-21 10:27:27 +0000
@@ -14,7 +14,9 @@
 {
     final Pattern INPUT_PATTERN = Pattern.compile( "(<input.*?)[/]?>", Pattern.DOTALL );
     
-    final Pattern IDENTIFIER_PATTERN_FIELD = Pattern.compile( "id=\"(\\d+)-(\\d+)-val\"" );
+    //final Pattern IDENTIFIER_PATTERN_FIELD = Pattern.compile( "id=\"(\\d+)-(\\d+)-val\"" );
+    
+    final Pattern IDENTIFIER_PATTERN_FIELD = Pattern.compile( "id=\"attr(\\d+)\"" );
     
     //--------------------------------------------------------------------------
     // ProgramDataEntryService

=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogDataEntryService.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogDataEntryService.java	2012-06-14 05:58:42 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogDataEntryService.java	2012-07-21 10:27:27 +0000
@@ -7,7 +7,9 @@
 import java.util.regex.Pattern;
 
 import org.apache.commons.lang.BooleanUtils;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.program.ProgramDataEntryService;
 
 /**
  * @author Mithilesh Kumar Thakur
@@ -119,15 +121,18 @@
                 // Get catalogType attribute ID of catalogType attribute
                 // -------------------------------------------------------------
 
-                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 2 ) );
+                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 1 ) );
                 
                 CatalogTypeAttribute catalogTypeAttribute = catalogTypeAttributeService.getCatalogTypeAttribute( catalogTypeAttributeId );
                 
-                if ( catalogTypeAttribute != null && (!CatalogTypeAttribute.TYPE_INT.equalsIgnoreCase( catalogTypeAttribute.getValueType() ) && !CatalogTypeAttribute.TYPE_STRING.equalsIgnoreCase( catalogTypeAttribute.getValueType() )) )
-                {
-                    continue;
-                }
-                
+                if ( catalogTypeAttribute != null && !CatalogTypeAttribute.TYPE_INT.equalsIgnoreCase( catalogTypeAttribute.getValueType() ) )
+                {
+                    continue;
+                }
+                else if ( catalogTypeAttribute != null && !CatalogTypeAttribute.TYPE_STRING.equalsIgnoreCase( catalogTypeAttribute.getValueType() ) )
+                {
+                    continue;
+                }
 
                 String displayValue = ( catalogTypeAttribute == null ) ? " value=\"" + CATALOG_TYPE_ATTRIBUTE_DOES_NOT_EXIST + "\" "
                     : " value=\"[ " + catalogTypeAttribute.getName() + " ]\"";
@@ -191,7 +196,7 @@
                 // Get catalogType attribute ID of catalogType attribute
                 // -------------------------------------------------------------
 
-                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 2 ) );
+                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 1 ) );
                 
                 CatalogTypeAttribute catalogTypeAttribute = catalogTypeAttributeService.getCatalogTypeAttribute( catalogTypeAttributeId );
                 
@@ -262,7 +267,7 @@
                 // -------------------------------------------------------------
                 // Get catalogType attribute ID of catalogType attribute
                 // -------------------------------------------------------------
-                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 2 ) );
+                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 1 ) );
                 
                 CatalogTypeAttribute catalogTypeAttribute = catalogTypeAttributeService.getCatalogTypeAttribute( catalogTypeAttributeId );
                 
@@ -334,7 +339,7 @@
                 // Get catalogType attribute ID of catalogType attribute
                 // -------------------------------------------------------------
                 
-                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 2 ) );
+                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 1 ) );
                 
                 CatalogTypeAttribute catalogTypeAttribute = catalogTypeAttributeService.getCatalogTypeAttribute( catalogTypeAttributeId );
 
@@ -392,7 +397,9 @@
         // ---------------------------------------------------------------------
        
         Map<Integer, CatalogTypeAttribute> catalogTypeAttributeMap = getCatalogTypeAttributeMap( catalogType );
-
+        
+        int catalogTypeId = catalogType.getId();
+        
         while ( CatalogTypeAttributeMatcher.find() )
         {
             // -----------------------------------------------------------------
@@ -412,9 +419,9 @@
                 // Get catalogType attribute ID of catalogType attribute
                 // -------------------------------------------------------------
 
-                int catalogTypeId = Integer.parseInt( identifierMatcher.group( 1 ) );
+                //int catalogTypeId = Integer.parseInt( identifierMatcher.group( 1 ) );
                 
-                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 2 ) );
+                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 1 ) );
 
                 CatalogTypeAttribute catalogTypeAttribute = null;
 
@@ -587,8 +594,6 @@
         // ---------------------------------------------------------------------
         // Pattern to match CatalogTypeAttributes in the HTML code
         // ---------------------------------------------------------------------
-
-
         
         Pattern INPUT_PATTERN = Pattern.compile( "(<input.*?)[/]?>", Pattern.DOTALL );
         
@@ -599,7 +604,7 @@
         // ---------------------------------------------------------------------
        
         Map<Integer, CatalogTypeAttribute> catalogTypeAttributeMap = getCatalogTypeAttributeMap( catalogType );
-
+        int catalogTypeId = catalogType.getId();
        // Map<Integer, DataElement> dataElementMap = getDataElementMap( programStage );
 
         while ( CatalogTypeAttributeMatcher.find() )
@@ -620,9 +625,9 @@
                 // Get catalogType attribute ID of catalogType attribute
                 // -------------------------------------------------------------
 
-                int catalogTypeId = Integer.parseInt( identifierMatcher.group( 1 ) );
+                //int catalogTypeId = Integer.parseInt( identifierMatcher.group( 1 ) );
                 
-                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 2 ) );
+                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 1 ) );
 
                 CatalogTypeAttribute catalogTypeAttribute = null;
 
@@ -794,8 +799,6 @@
         // Pattern to match CatalogTypeAttributes in the HTML code
         // ---------------------------------------------------------------------
 
-
-        
         Pattern INPUT_PATTERN = Pattern.compile( "(<input.*?)[/]?>", Pattern.DOTALL );
         
         Matcher CatalogTypeAttributeMatcher = INPUT_PATTERN.matcher( dataEntryFormCode );
@@ -805,6 +808,7 @@
         // ---------------------------------------------------------------------
        
         Map<Integer, CatalogTypeAttribute> catalogTypeAttributeMap = getCatalogTypeAttributeMap( catalogType );
+        int catalogTypeId = catalogType.getId();
 
        // Map<Integer, DataElement> dataElementMap = getDataElementMap( programStage );
 
@@ -826,9 +830,9 @@
                 // Get catalogType attribute ID of catalogType attribute
                 // -------------------------------------------------------------
 
-                int catalogTypeId = Integer.parseInt( identifierMatcher.group( 1 ) );
+                //int catalogTypeId = Integer.parseInt( identifierMatcher.group( 1 ) );
                 
-                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 2 ) );
+                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 1 ) );
 
                 CatalogTypeAttribute catalogTypeAttribute = null;
 
@@ -905,10 +909,43 @@
                     }
                 }
 
+                
+                String appendCode = catalogTypeAttributeCode.replaceFirst( "input", "select" );
+                appendCode = appendCode.replace( "name=\"entryfield\"", jsCodeForOptions );
+
+                // -------------------------------------------------------------
+                // Add title
+                // -------------------------------------------------------------
+
+                if ( catalogTypeAttributeCode.contains( "title=\"\"" ) )
+                {
+                    appendCode = appendCode.replace( "title=\"\"", "title=\"" + catalogTypeAttribute.getId() + "."
+                        + catalogTypeAttribute.getName() + "-" + catalogTypeAttributeType + "\" " );
+                }
+                else
+                {
+                    appendCode += "title=\"" + catalogTypeAttribute.getId() + "." + catalogTypeAttribute.getName() + "-"
+                        + catalogTypeAttributeType + "\" ";
+                }
+
+                appendCode += ">";
+                
+                
+                appendCode += "<option value=\"\">" + i18n.getString( "Please select" ) + "</option>";
+                
+                for( CatalogTypeAttributeOption catalogTypeAttributeOption : catalogTypeAttribute.getAttributeOptions() )
+                {
+                    appendCode += "<option value=\""+ catalogTypeAttributeOption.getId() +"\">" + catalogTypeAttributeOption.getName() + "</option>";
+                }
+                //appendCode += "<option value=\"true\">" + i18n.getString( "yes" ) + "</option>";
+                //appendCode += "<option value=\"false\">" + i18n.getString( "no" ) + "</option>";
+                
+                //--------------------------------------------------------------
                 // Insert title information - Data element id, name, type, min,
                 // max
                 // -------------------------------------------------------------
 
+                /*
                 if ( catalogTypeAttributeCode.contains( "title=\"\"" ) )
                 {
                     catalogTypeAttributeCode = catalogTypeAttributeCode.replace( "title=\"\"", "title=\"" + catalogTypeAttribute.getId() + "."
@@ -919,13 +956,14 @@
                     catalogTypeAttributeCode += "title=\"" + catalogTypeAttribute.getId() + "." + catalogTypeAttribute.getName() + " ("
                         + catalogTypeAttributeType + ")\" ";
                 }
-
+*/
                 // -------------------------------------------------------------
                 // Insert value of catalogType Attribute in output code
                 // -------------------------------------------------------------
                 
-                String appendCode = catalogTypeAttributeCode;
+                //String appendCode = catalogTypeAttributeCode;
 
+                /*
                 if ( appendCode.contains( "value=\"\"" ) )
                 {
                     appendCode = appendCode.replace( "value=\"\"", "value=\"" + catalogTypeAttributeValue + "\"" );
@@ -943,8 +981,8 @@
                 }
 
                 appendCode += " />";
-
-
+                */
+                appendCode += "</select>";
                 disabled = "";
                 
                 if ( catalogTypeId != catalogType.getId() )
@@ -966,7 +1004,7 @@
                 appendCode = appendCode.replace( "$SAVEMODE", "false" );
                 appendCode = appendCode.replaceAll( "\\$", "\\\\\\$" );
                 
-                System.out.println( "---appendCode---" + appendCode );
+                //System.out.println( "---appendCode---" + appendCode );
                 
                 CatalogTypeAttributeMatcher.appendReplacement( sb, appendCode );
             }
@@ -1017,7 +1055,7 @@
         
         Map<Integer, CatalogTypeAttribute> catalogTypeAttributeMap = getCatalogTypeAttributeMap( catalogType );
         
-
+        int catalogTypeId = catalogType.getId();
        
         while ( CatalogTypeAttributeMatcher.find() )
         {
@@ -1027,7 +1065,6 @@
 
             String mandatory = "null";
            
-           
 
             String catalogTypeAttributeCode = CatalogTypeAttributeMatcher.group( 1 );
             
@@ -1039,9 +1076,9 @@
                 // Get data element ID of data element
                 // -------------------------------------------------------------
 
-                int catalogTypeId = Integer.parseInt( identifierMatcher.group( 1 ) );
+                //int catalogTypeId = Integer.parseInt( identifierMatcher.group( 1 ) );
                 
-                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 2 ) );
+                int catalogTypeAttributeId = Integer.parseInt( identifierMatcher.group( 1 ) );
 
                 CatalogTypeAttribute catalogTypeAttribute = null;
 

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java	2012-06-14 05:58:42 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java	2012-07-21 10:27:27 +0000
@@ -45,6 +45,14 @@
     {
         this.catalogTypeId = catalogTypeId;
     }
+    
+    private Boolean isCustom;
+    
+    public Boolean getIsCustom()
+    {
+        return isCustom;
+    }
+    
 /*
     private Collection<CatalogTypeAttribute> catalogTypeAttributes;
     
@@ -54,6 +62,8 @@
     }
 */    
     
+    
+
     private List<CatalogTypeAttribute> catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>();
     
     public List<CatalogTypeAttribute> getCatalogTypeAttributes()
@@ -92,14 +102,11 @@
     // Action implementation
     // -------------------------------------------------------------------------
 
- 
-
-
-
     public String execute()
     {
+        System.out.println("entering into  ShowAddCatalogFormAction action");
         catalogType = catalogTypeService.getCatalogType( catalogTypeId );
-        
+        isCustom = false;
         String disabled = ""; 
         if ( catalogType != null )
         {
@@ -109,14 +116,20 @@
 
             DataEntryForm dataEntryForm = catalogType.getDataEntryForm();
 
+            System.out.println("dataentryform object retrieved");
+            
             if ( dataEntryForm != null )
             {
+                isCustom = true;
+                System.out.println("dataentryform object is not null");
                 Collection<CatalogDataValue> catalogDataValues = new ArrayList<CatalogDataValue>();
                 
                 customDataEntryFormCode = catalogDataEntryService.prepareDataEntryFormForCatalog( dataEntryForm.getHtmlCode(), catalogDataValues, disabled, i18n, catalogType );
+                //customDataEntryFormCode = "custom dataentry form";
             }
             
-            catalogTypeAttributes = new ArrayList<CatalogTypeAttribute> ( catalogType.getCatalogTypeAttributes());
+            catalogTypeAttributes = new ArrayList<CatalogTypeAttribute> ( catalogType.getCatalogTypeAttributes() );
+            
             //Collections.sort( catalogTypeAttributes, new CatalogTypeAttributeComparator() );
             
             /*
@@ -131,7 +144,7 @@
             */
         }
         
-
+        System.out.println("going out from  ShowAddCatalogFormAction action");
         return SUCCESS;
     }
 

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/reports/action/GenerateCCEMReportAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/reports/action/GenerateCCEMReportAction.java	2012-06-27 06:56:57 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/reports/action/GenerateCCEMReportAction.java	2012-07-21 10:27:27 +0000
@@ -613,7 +613,6 @@
         }
         else if( ccemReport.getReportType().equals( CCEMReport.VACCINE_STORAGE_CAPACITY ) )
         {
-
             ccemReportOutput = new CCEMReportOutput();
             List<String> tableHeadings = new ArrayList<String>();
             List<List<String>> tableSubHeadings = new ArrayList<List<String>>();
@@ -745,18 +744,24 @@
             String vsReqCatalogAttribIds = catalogDataParts[5];
             
             Integer vsReqPackedVol = Integer.parseInt( vsReqCatalogAttribIds.split( "," )[0] );
-            Integer vsReqDoses = Integer.parseInt( vsReqCatalogAttribIds.split( "," )[1] );
-            Integer vsReqTargetPopCat= Integer.parseInt( vsReqCatalogAttribIds.split( "," )[2] );
-            Integer vsReqUsage = Integer.parseInt( vsReqCatalogAttribIds.split( "," )[3] );
-            Integer vsReqWastage = Integer.parseInt( vsReqCatalogAttribIds.split( "," )[4] );
+            Integer vsReqDiluentVol = Integer.parseInt( vsReqCatalogAttribIds.split( "," )[1] );
+            Integer vsReqDoses = Integer.parseInt( vsReqCatalogAttribIds.split( "," )[2] );
+            Integer vsReqTargetPopCat= Integer.parseInt( vsReqCatalogAttribIds.split( "," )[3] );
+            Integer vsReqUsage = Integer.parseInt( vsReqCatalogAttribIds.split( "," )[4] );
+            Integer vsReqWastage = Integer.parseInt( vsReqCatalogAttribIds.split( "," )[5] );
 
             List<Integer> catalogIdsForRequirement = new ArrayList<Integer>( ccemReportManager.getCatalogIdsForRequirement( vsReqCatalogTypeId, vsReqStorageTempId, vsReqStorageTemp, vsReqNationalSupplyId, vsReqNationalSupply ) );
             
             Map<String, String> catalogDataForRequirement = new HashMap<String, String>( ccemReportManager.getCatalogDataForRequirement( vsReqCatalogTypeId, vsReqStorageTempId, vsReqStorageTemp, vsReqNationalSupplyId, vsReqNationalSupply, vsReqCatalogAttribIds ) );
             
+            Integer vsReqStaticDel = Integer.parseInt( partsOfCellContent[3].split( "," )[0] );
+            Integer vsReqOutReachDel = Integer.parseInt( partsOfCellContent[3].split( "," )[1] );
+            
+            String catalogOption_DataelementIds = vsReqStaticDel +"," + vsReqOutReachDel;
+            
             String[] dataelementDataParts = partsOfCellContent[1].split( "," );
             Map<String, Integer> catalogOption_DataelementMap = new HashMap<String, Integer>();
-            String catalogOption_DataelementIds = "-1";
+            
             
             for( String de_catalogOption : dataelementDataParts )
             {
@@ -877,6 +882,27 @@
                         }
                     }
                     
+                    String tempStr1 = dataElementDataForRequirement.get( vsReqStaticDel+":"+periodId+":"+orgUnit.getId() );
+                    String tempStr2 = dataElementDataForRequirement.get( vsReqOutReachDel+":"+periodId+":"+orgUnit.getId() );
+                    if( (tempStr1 != null && tempStr1.equalsIgnoreCase( "true" )) || (tempStr2 != null && tempStr2.equalsIgnoreCase( "true" )) )
+                    {
+                        Double vsReqDiluentVolData = 0.0;                        
+                        tempStr = catalogDataForRequirement.get( catalogId+":"+vsReqDiluentVol );
+                        if( tempStr != null )
+                        {
+                            try
+                            {
+                                vsReqDiluentVolData = Double.parseDouble( tempStr );
+                            }
+                            catch( Exception e )
+                            {
+                                vsReqDiluentVolData = 0.0;
+                            }
+                        }
+                        
+                        vsReqPackedVolData += vsReqDiluentVolData;
+                    }
+                    
                     Double vsReqWastageData = 0.0;
                     tempStr = catalogDataForRequirement.get( catalogId+":"+vsReqWastage );
                     if( tempStr != null )

=== 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-06-14 05:58:42 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm	2012-07-21 10:27:27 +0000
@@ -39,7 +39,7 @@
                   <a href="showUploadCatalogTypeImageForm.action?id=$catalogType.id" title="$i18n.getString( 'upload_image' )"><img src="images/upload.png" alt="$i18n.getString( 'upload_image' )"></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:removeItem( '$catalogType.id', '$encoder.jsEncode( $catalogType.name )', i18n_confirm_delete , 'removeCatalogType.action' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
-				  <!--<a href="viewCatalogDataEntryForm.action?catalogTypeId=$catalogType.id" title="$i18n.getString( 'design_data_entry_form' )"><img src="../images/edit_layout.png" alt="$i18n.getString( 'design_data_entry_form' )"></a>-->					
+				  <a href="viewCatalogDataEntryForm.action?catalogTypeId=$catalogType.id" title="$i18n.getString( 'design_data_entry_form' )"><img src="../images/edit_layout.png" alt="$i18n.getString( 'design_data_entry_form' )"></a>					
                   <a href="javascript:showCalatogTypeDetails( $catalogType.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
                 </td>
               </tr>

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/catalog.js'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/catalog.js	2012-06-27 06:56:57 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/catalog.js	2012-07-21 10:27:27 +0000
@@ -445,7 +445,7 @@
 	$.ajax({
     type: "POST",
     url: 'addCatalog.action',
-    data: getParamsForDiv('addCatalogFormDiv'),
+    data: getParamsForDiv('addEditCatalogFormDiv'),
     success: function(json) {
 		var type = json.response;
 		jQuery('#resultSearchDiv').dialog('close');

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/viewCatalogTypeDataEntryForm.js'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/viewCatalogTypeDataEntryForm.js	2012-06-14 05:58:42 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/viewCatalogTypeDataEntryForm.js	2012-07-21 10:27:27 +0000
@@ -71,7 +71,8 @@
 	var catalogTypeAttributevalueType = catalogTypeAttribute.valueType;
 	
 	var htmlCode = "";
-	var id = catalogTypeId + "-" + catalogTypeAttributeId + "-val" ;
+	//var id = catalogTypeId + "-" + catalogTypeAttributeId + "-val" ;
+	var id = "attr"+catalogTypeAttributeId;
 	
 	if ( catalogTypeAttributevalueType == "YES/NO" )
 	{
@@ -90,9 +91,7 @@
 		var titleValue = "-- " + catalogTypeAttributeId + "." + catalogTypeAttributeName +" (" + catalogTypeAttributevalueType + ") --";
 		var displayName = catalogTypeAttributeName;
 		htmlCode += "<input title=\"" + titleValue + "\" value=\"" + displayName + "\" name=\"entryfield\" id=\"" + id + "\" />";
-	}
-	
-	
+	}		
 	else if ( catalogTypeAttributevalueType == "COMBO" ) 
 	{
 		var titleValue = "-- " + catalogTypeAttributeId + "." + catalogTypeAttributeName +" (" + catalogTypeAttributevalueType + ") --";

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/showAddCatalogForm.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/showAddCatalogForm.vm	2012-06-26 08:38:56 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/showAddCatalogForm.vm	2012-07-21 10:27:27 +0000
@@ -43,7 +43,27 @@
 			<td>$i18n.getString( "catalogType" ) : </th>
 			<td>$catalogType.name</th>
 		</tr>
-	</table>	
+	</table>
+
+<table>
+<tr><td>&nbsp;</td></tr>
+<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>
+</table>	
+#if( $isCustom )
+
+	$customDataEntryFormCode
+	
+#else
+	
+<div id="defaultScreen" >		
 <!-- ATTRIBUTES -->
 <table>
 	<tr><th colspan="2" class="heading-column">$i18n.getString( "catalogType_details" )</th></tr>
@@ -52,7 +72,7 @@
 <table>
 <tr><td>&nbsp;</td></tr>
 #if ( $catalogTypeAttributes.size() > 0) 	
-	
+	<!--
 	<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>
@@ -62,7 +82,7 @@
 		<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><th colspan="2" class="heading-column">$i18n.getString( "catalogType_attribute" )</th></tr>-->
 	#foreach($attribute in $catalogTypeAttributes )
 		<tr>
@@ -98,15 +118,19 @@
 </td>
 <td>&nbsp;</td>
 <td><!--<img src="$outPutStream" alt="Catalog Image" width="100" height="100"/>-->
-	<img src="showCatalogTypeImage.action?id=$catalogType.id" style="width:200px;height:200px;">
+	<img src="showCatalogTypeImage.action?id=$catalogType.id" style="width:200px;height:200px;" />
 </td>
 </tr>
 </table>
+</div>
+
+#end
 	<p>
 		<input type="submit" class="button" value="$i18n.getString( 'add' )"/>
 		<input type="button" class="button" value="$i18n.getString( 'back' )" onclick="loadAllCatalogs();"/>
 	</p>
 </form>
+
 <script>
     var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'" )';
     var i18n_add_equipment_successfully = '$encoder.jsEscape( $i18n.getString( "add_equipment_successfully" ) , "'" )';