← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6839: CCEM work in progress

 

------------------------------------------------------------
revno: 6839
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-05-03 12:32:57 +0530
message:
  CCEM work in progress
modified:
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java
  local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentInstanceList.vm
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentMenu.vm
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/equipment.js
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/selectEquipment.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-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-04-30 11:24:11 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java	2012-05-03 07:02:57 +0000
@@ -1,10 +1,14 @@
 package org.hisp.dhis.coldchain.catalog.action;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
 
 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.coldchain.catalog.comparator.CatalogTypeAttributeComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -32,13 +36,21 @@
     {
         this.catalogTypeId = catalogTypeId;
     }
-
+/*
     private Collection<CatalogTypeAttribute> catalogTypeAttributes;
     
     public Collection<CatalogTypeAttribute> getCatalogTypeAttributes()
     {
         return catalogTypeAttributes;
     }
+*/    
+    
+    private List<CatalogTypeAttribute> catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>();
+    
+    public List<CatalogTypeAttribute> getCatalogTypeAttributes()
+    {
+        return catalogTypeAttributes;
+    }
     
     // -------------------------------------------------------------------------
     // Action implementation
@@ -49,7 +61,11 @@
         
         CatalogType catalogType = catalogTypeService.getCatalogType( catalogTypeId );
         
-        catalogTypeAttributes = catalogType.getCatalogTypeAttributes();
+        //catalogTypeAttributes =  catalogType.getCatalogTypeAttributes();
+        
+        catalogTypeAttributes = new ArrayList<CatalogTypeAttribute> ( catalogType.getCatalogTypeAttributes());
+        Collections.sort( catalogTypeAttributes, new CatalogTypeAttributeComparator() );
+        
         /*
         System.out.println( "Name of CatalogType is ======  :" + catalogType.getName() );
         System.out.println( "Size of catalogTypeAttributes  :" + catalogTypeAttributes.size() );

=== 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-05-02 06:03:10 +0000
+++ local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties	2012-05-03 07:02:57 +0000
@@ -64,3 +64,22 @@
 edit_inventorytype = Edit inventorytype
 inventorytype_details = Details inventorytype
 edit_inventorytype_attribute = Edit inventorytype attribute
+
+
+equipment_registration = Equipment registration
+equipment_management = Equipment management
+registering_unit = Registering unit
+select_inventorytype = Please select inventorytype
+list_all_equipments = List all equipments
+equipmentstatus = Equipment status
+search_equipment_by_attributes = Search equipment by attributes
+search_result_matching_the_search_criteria = Search result matching the search criteria
+total_result = Total result
+reporting_date = Reporting date
+date_of_updation = Date of updation
+please_select = Please select
+status = Status
+working = Working
+notworking = Not working
+repair = Repair
+

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentInstanceList.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentInstanceList.vm	2012-05-02 09:18:42 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentInstanceList.vm	2012-05-03 07:02:57 +0000
@@ -5,7 +5,7 @@
         <td>&nbsp;</td>
         <td>
         #if($!listAll)
-            $i18n.getString( "list_all_equipment" )
+            $i18n.getString( "list_all_equipments" )
         #else
             $i18n.getString( "search_equipment_by_attributes" )
         #end

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentMenu.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentMenu.vm	2012-04-26 10:00:48 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentMenu.vm	2012-05-03 07:02:57 +0000
@@ -2,45 +2,9 @@
 <a href="index.action"><h2>$i18n.getString( "coldchain_management" )&nbsp;</h2></a>
 
 <ul>
-    <li><a href="enquipmentSelect.action">$i18n.getString( "equipment_registration " )</a></li>
+    <li><a href="enquipmentSelect.action">$i18n.getString( "equipment_registration" )</a></li>
 </ul>
 
 <br>
 #parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
 
-<script>
-function organisationUnitSelected( orgUnits )
-{   
-	document.getElementById('selectedOrgunitID').value = orgUnits;
-    
-	showById('selectDiv');
-    disable('listAllEquipmentBtn');
-    
-    hideById('searchEquipmentDiv');
-    hideById('listEquipmentDiv');
-    hideById('editEquipmentDiv');
-	hideById('resultSearchDiv');
-    
-	   $.getJSON( 'getOrganisationUnit.action', {orgunitId:orgUnits[0]}
-        , function( json ) 
-        {
-            var type = json.response;
-            setFieldValue('selectedOrgunitText', json.message );
-                
-            if( type == 'success' )
-            {
-                //showById('searchEquipmentDiv');
-				enable('listAllEquipmentBtn');
-                setInnerHTML('warnmessage','');
-                setFieldValue('selectedOrgunitText', json.message );
-            }
-            else if( type == 'input' )
-            {
-                setInnerHTML('warnmessage', i18n_can_not_register_patient_for_orgunit);
-                disable('listPatientBtn');
-            }
-        } );
-}
-selection.setListenerFunction( organisationUnitSelected );
-
-</script>

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/equipment.js'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/equipment.js	2012-05-02 09:18:42 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/equipment.js	2012-05-03 07:02:57 +0000
@@ -1,3 +1,39 @@
+// ----------------------------------------------------------------
+// organization Unit Selected
+// ----------------------------------------------------------------
+function organisationUnitSelected( orgUnits )
+{   
+	document.getElementById('selectedOrgunitID').value = orgUnits;
+    
+	showById('selectDiv');
+    disable('listAllEquipmentBtn');
+    
+    hideById('searchEquipmentDiv');
+    hideById('listEquipmentDiv');
+    hideById('editEquipmentDiv');
+	hideById('resultSearchDiv');
+    
+	   $.getJSON( 'getOrganisationUnit.action', {orgunitId:orgUnits[0]}
+        , function( json ) 
+        {
+            var type = json.response;
+            setFieldValue('selectedOrgunitText', json.message );
+                
+            if( type == 'success' )
+            {
+            	//showById('searchEquipmentDiv');
+				enable('listAllEquipmentBtn');
+                setInnerHTML('warnmessage','');
+                setFieldValue('selectedOrgunitText', json.message );
+            }
+            else if( type == 'input' )
+            {
+                setInnerHTML('warnmessage', i18n_can_not_register_patient_for_orgunit);
+                disable('listPatientBtn');
+            }
+        } );
+}
+selection.setListenerFunction( organisationUnitSelected );
 
 // ----------------------------------------------------------------
 // On InventoryType Change - Loading InventoryTypeAttributes
@@ -62,7 +98,8 @@
 	
 	if( inventoryTypeId == 0 )
 	{	
-		alert("Plese select Inventorytype");
+		//alert("Plese select Inventorytype");
+		showWarningMessage( i18n_select_inventorytype );
 		return;
 	}
 	

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/selectEquipment.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/selectEquipment.vm	2012-05-02 09:18:42 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/selectEquipment.vm	2012-05-03 07:02:57 +0000
@@ -60,6 +60,7 @@
 #parse( "/dhis-web-commons/loader/loader.vm" )
 
 <script>
+    var i18n_select_inventorytype = '$encoder.jsEscape( $i18n.getString( "select_inventorytype" ) , "'")';
     var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
     var i18n_can_not_register_patient_for_orgunit = '$encoder.jsEscape( $i18n.getString( "can_not_register_patient_for_orgunit" ), "'")';   
     var i18n_please_select_village = '[' + '$encoder.jsEscape( $i18n.getString( "please_select_village" ), "'")' + ']';