← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17311: RBF: Functionality for maintaing Partner info

 

------------------------------------------------------------
revno: 17311
committer: Bharath chbharathk@xxxxxxxxx
branch nick: dhis2
timestamp: Wed 2014-10-29 09:07:54 +0100
message:
  RBF: Functionality for maintaing Partner info
modified:
  local/in/dhis-in-services/dhis-service-aggregationengine/src/main/java/org/hisp/dhis/aggregation/impl/indicator/IndicatorAggregation.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/Lookup.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm
  local/in/pom.xml


--
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-services/dhis-service-aggregationengine/src/main/java/org/hisp/dhis/aggregation/impl/indicator/IndicatorAggregation.java'
--- local/in/dhis-in-services/dhis-service-aggregationengine/src/main/java/org/hisp/dhis/aggregation/impl/indicator/IndicatorAggregation.java	2014-09-05 05:06:07 +0000
+++ local/in/dhis-in-services/dhis-service-aggregationengine/src/main/java/org/hisp/dhis/aggregation/impl/indicator/IndicatorAggregation.java	2014-10-29 08:07:54 +0000
@@ -164,7 +164,9 @@
             //valueMap.put( operand, aggregationCache.getAggregatedDataValue( dataElement, optionCombo, startDate, endDate, organisationUnit ) );            
         }
         
-        return expressionService.generateExpression( expression, valueMap, constantMap, constantMap1, null, false );
+        //return expressionService.generateExpression( expression, valueMap, constantMap, constantMap1, null, false );
+        
+        return null;
         
         //return expressionService.generateExpression( expression, valueMap, constantMap, null, false );
     }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/Lookup.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/Lookup.java	2014-07-30 11:58:29 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/Lookup.java	2014-10-29 08:07:54 +0000
@@ -26,6 +26,8 @@
     public static final String ORGUNITID_BY_COMMA = "ORGUNITID_BY_COMMA";
     public static final String PERIODID_BY_COMMA = "PERIODID_BY_COMMA";
     
+    public static final String OPTION_SET_PARTNER = "OPTION_SET_PARTNER";
+    
     
     private String type;
     

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java	2014-10-24 11:05:35 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java	2014-10-29 08:07:54 +0000
@@ -27,6 +27,9 @@
 import org.hisp.dhis.datavalue.DataValue;
 import org.hisp.dhis.datavalue.DataValueService;
 import org.hisp.dhis.i18n.I18nService;
+import org.hisp.dhis.option.Option;
+import org.hisp.dhis.option.OptionService;
+import org.hisp.dhis.option.OptionSet;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
@@ -34,6 +37,7 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodType;
+import org.hisp.dhis.rbf.api.Lookup;
 import org.hisp.dhis.rbf.api.LookupService;
 import org.hisp.dhis.rbf.api.PBFDataValue;
 import org.hisp.dhis.rbf.api.PBFDataValueService;
@@ -59,6 +63,10 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
+    @Autowired
+    private OptionService optionService;
+
+    
     private PBFDataValueService pbfDataValueService;
 
     public void setPbfDataValueService( PBFDataValueService pbfDataValueService )
@@ -286,10 +294,16 @@
         return locked;
     }
     
+    private Map<Integer,Option> optionsMap = new HashMap<Integer, Option>();
+    
+    public void setOptionsMap( Map<Integer, Option> optionsMap )
+    {
+        this.optionsMap = optionsMap;
+    }
+    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
-
     public String execute()
     {
         dataValueMap = new HashMap<String, String>();
@@ -302,6 +316,21 @@
             totalDataElementId = totalDataElement.getId();
         }
         
+        Lookup partnerOptionSetLookup = lookupService.getLookupByName( Lookup.OPTION_SET_PARTNER );
+        
+        OptionSet activitesOptionSet = optionService.getOptionSet( Integer.parseInt( partnerOptionSetLookup.getValue() ) );
+        
+        List<Option> options = new ArrayList<Option>();
+        if( activitesOptionSet != null )
+        {
+            options.addAll( activitesOptionSet.getOptions() );
+        }
+        
+        for( Option option : options )
+        {
+            optionsMap.put( option.getId(), option );
+        }
+        
         /*
         String abc = null;
         System.out.println( " Test ABC " +  abc );
@@ -427,6 +456,7 @@
                     pbfDataValue.setStoredBy( currentUserService.getCurrentUsername() );
                     pbfDataValue.setTariffAmount( tariffAmount );
                     pbfDataValue.setTimestamp( new Date() );
+                                        
                     pbfDataValueService.updatePBFDataValue( pbfDataValue );
                 }
             }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java	2014-10-24 11:05:35 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java	2014-10-29 08:07:54 +0000
@@ -8,6 +8,8 @@
 import org.hisp.dhis.option.Option;
 import org.hisp.dhis.option.OptionService;
 import org.hisp.dhis.option.OptionSet;
+import org.hisp.dhis.rbf.api.Lookup;
+import org.hisp.dhis.rbf.api.LookupService;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
@@ -29,6 +31,9 @@
     @Autowired
     private DataSetService dataSetService;
     
+    @Autowired
+    private LookupService lookupService;
+    
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
@@ -47,16 +52,15 @@
         return options;
     }
     
-    
     // -------------------------------------------------------------------------
     // Action Implementation
     // -------------------------------------------------------------------------
 
-
     public String execute() throws Exception
     {
+        Lookup partnerOptionSetLookup = lookupService.getLookupByName( Lookup.OPTION_SET_PARTNER );
         
-        OptionSet activitesOptionSet = optionService.getOptionSetByName( OPTION_SET_PARTNER );
+        OptionSet activitesOptionSet = optionService.getOptionSet( Integer.parseInt( partnerOptionSetLookup.getValue() ) );
         
         if( activitesOptionSet != null )
         {

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm	2014-10-29 08:07:54 +0000
@@ -90,6 +90,9 @@
     
 	<tr bgcolor="#CBDDEB">
 		<th style="width:35%;">$i18n.getString( "dataelement" )</th>
+		
+		<th style="width:35%;">$i18n.getString( "partner" )</th>
+		
 		<th style="text-align: center;width:15%;">$i18n.getString( "qty_reported" )</th>
 		
 		#if( $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityValidated") || $auth.hasAccess( "dhis-web-maintenance-rbf", "quanitityExternalVerification") || $auth.hasAccess( "dhis-web-maintenance-rbf", "pbfAdminDataEntry" ) )
@@ -118,8 +121,11 @@
         #end
 		<tr #if( $mark1 ) bgcolor = "#FFFFFF" #else bgcolor="#E0ECF8" #end>
 			<td><label>$dataElement.getDisplayName()</label></td>
-			#set( $count = 0)
-				#set( $pbfDataValue = $!pbfDataValueMap.get( $dataElement ) )
+			
+			#set( $count = 0)						
+			#set( $pbfDataValue = $!pbfDataValueMap.get( $dataElement ) )
+
+            <td><label>$!pbfDataValue.getOption().getDisplayName()</label></td>				
 				
 				#if( $auth.hasAccess( "dhis-web-maintenance-rbf", "pbfAdminDataEntry" ) )
 					<td>

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm	2014-10-24 11:05:35 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm	2014-10-29 08:07:54 +0000
@@ -2,9 +2,7 @@
 <h2>$i18n.getString( "pbf_setup" )</h2>
 <ul>	
 
-    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "partnerForm") )
-    	<li><a href="partnerForm.action">$i18n.getString( "partner_management" )</a></li>
-    #end	
+   	
 	
     #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "pbfDataEntry") )
     	<li><a href="pbfDataEntry.action">$i18n.getString( "pbf_dataentry" )</a></li>
@@ -21,6 +19,10 @@
     #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "dataElementTariffManagement") )
     	<li><a href="dataElementTariffManagement.action">$i18n.getString( "dataelement_tariff_target_management" )</a></li>
     #end	
+
+    #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "partnerForm") )
+        <li><a href="partnerForm.action">$i18n.getString( "partner_management" )</a></li>
+    #end
 	
     #if( $auth.hasAccess( "dhis-web-maintenance-rbf", "bankDetailsManagement") )
     	<li><a href="bankDetailsManagement.action">$i18n.getString( "bank_details_management" )</a></li>
@@ -30,6 +32,7 @@
     	<li><a href="utilizationRuleManagement.action">$i18n.getString( "utilization_rule_management" )</a></li>
 	#end
 	
+	
 	<!--
 	<li><a href="pbfDataEntry.action">$i18n.getString( "pbf_dataentry" )</a></li>
 

=== modified file 'local/in/pom.xml'
--- local/in/pom.xml	2014-07-25 10:59:27 +0000
+++ local/in/pom.xml	2014-10-29 08:07:54 +0000
@@ -19,7 +19,7 @@
 	
 	<module>dhis-web-maintenance-rbf</module>
 	
-	<module>dhis-web-birtreports</module>
+	<!--<module>dhis-web-birtreports</module>-->
 	
 	<!--<module>dhis-web-maintenance-ccem</module>	
 	<module>dhis-web-coldchain</module>