← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17476: local/in Maintenance RBF partner work in progress

 

------------------------------------------------------------
revno: 17476
committer: Mithilesh Kumar Thakur <mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-11-15 09:02:15 +0000
message:
  local/in Maintenance RBF partner work in progress
modified:
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PartnerService.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PartnerStore.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultPartnerService.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernatePartnerStore.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/java/org/hisp/dhis/rbf/partner/action/PartnerFundManagement.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/SavePartnerDetailsResultAction.java
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerForm.vm
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerFundManagement.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-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PartnerService.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PartnerService.java	2014-11-14 10:23:57 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PartnerService.java	2014-11-15 09:02:15 +0000
@@ -29,6 +29,6 @@
     
     Collection<Partner> getPartner( OrganisationUnit organisationUnit, DataElement dataElement );
     
-    Map<String, Integer> getOrgUnitCountFromPartner( Integer organisationUnitId, Integer dataSetId, Integer dataElementId, Integer optionId, String startDate, String endDate );
+    Map<String, Integer> getOrgUnitCountFromPartner( Integer dataSetId, Integer dataElementId, Integer optionId, String startDate, String endDate );
     
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PartnerStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PartnerStore.java	2014-11-14 10:23:57 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/api/PartnerStore.java	2014-11-15 09:02:15 +0000
@@ -29,6 +29,6 @@
     
     Collection<Partner> getPartner( OrganisationUnit organisationUnit, DataElement dataElement );
     
-    Map<String, Integer> getOrgUnitCountFromPartner( Integer organisationUnitId, Integer dataSetId, Integer dataElementId, Integer optionId, String startDate, String endDate );
+    Map<String, Integer> getOrgUnitCountFromPartner( Integer dataSetId, Integer dataElementId, Integer optionId, String startDate, String endDate );
     
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultPartnerService.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultPartnerService.java	2014-11-14 10:23:57 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultPartnerService.java	2014-11-15 09:02:15 +0000
@@ -10,10 +10,12 @@
 import org.hisp.dhis.rbf.api.Partner;
 import org.hisp.dhis.rbf.api.PartnerService;
 import org.hisp.dhis.rbf.api.PartnerStore;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * @author Mithilesh Kumar Thakur
  */
+@Transactional
 public class DefaultPartnerService implements PartnerService
 {
     // -------------------------------------------------------------------------
@@ -74,9 +76,9 @@
         return partnerStore.getPartner( organisationUnit, dataElement );
     }    
     
-    public Map<String, Integer> getOrgUnitCountFromPartner( Integer organisationUnitId, Integer dataSetId, Integer dataElementId, Integer optionId, String startDate, String endDate )
+    public Map<String, Integer> getOrgUnitCountFromPartner( Integer dataSetId, Integer dataElementId, Integer optionId, String startDate, String endDate )
     {
-        return partnerStore.getOrgUnitCountFromPartner( organisationUnitId, dataSetId, dataElementId, optionId, startDate, endDate );
+        return partnerStore.getOrgUnitCountFromPartner( dataSetId, dataElementId, optionId, startDate, endDate );
     }    
     
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernatePartnerStore.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernatePartnerStore.java	2014-11-14 10:23:57 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernatePartnerStore.java	2014-11-15 09:02:15 +0000
@@ -18,10 +18,12 @@
 import org.hisp.dhis.rbf.api.PartnerStore;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.support.rowset.SqlRowSet;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * @author Mithilesh Kumar Thakur
  */
+@Transactional
 public class HibernatePartnerStore implements PartnerStore
 {
     
@@ -125,7 +127,7 @@
     }    
     
     // get OrgUnit Count FromPartner
-    public Map<String, Integer> getOrgUnitCountFromPartner( Integer organisationUnitId, Integer dataSetId, Integer dataElementId, Integer optionId, String startDate, String endDate )
+    public Map<String, Integer> getOrgUnitCountFromPartner( Integer dataSetId, Integer dataElementId, Integer optionId, String startDate, String endDate )
     {
         Map<String, Integer> partnerOrgUnitCountMap = new HashMap<String, Integer>();
         
@@ -134,13 +136,12 @@
         
         try
         {
-            String query = "SELECT datasetid, dataelementid, optionid, startdate, enddate ,COUNT( organisationunitid) FROM partner " +
+            String query = "SELECT datasetid, dataelementid, optionid, startdate, enddate ,COUNT( organisationunitid ) FROM partner " +
                             " WHERE " +
-                                " organisationunitid = " + organisationUnitId + " AND " +
                                 " datasetid = " + dataSetId + " AND " +
                                 " dataelementid = " + dataElementId + " AND " +
                                 " optionid = " + optionId + " AND " +
-                                " startdate = '" + startDate + "' AND  enddate >= '" + endDate +"' GROUP BY datasetid, dataelementid, startdate, enddate, optionid ";
+                                " startdate >= '" + startDate + "' AND  enddate <= '" + endDate +"' GROUP BY datasetid, dataelementid, startdate, enddate, optionid ";
             
             
             SqlRowSet rs = jdbcTemplate.queryForRowSet( query );

=== 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-11-15 05:37:54 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFormAction.java	2014-11-15 09:02:15 +0000
@@ -1,15 +1,11 @@
 package org.hisp.dhis.rbf.partner.action;
 
-import java.util.ArrayList;
-import java.util.List;
-
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 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;
@@ -32,7 +28,7 @@
     private DataSetService dataSetService;
     
     @Autowired
-    private LookupService lookupService;
+    private DataElementService dataElementService;
     
     // -------------------------------------------------------------------------
     // Input & Output
@@ -59,19 +55,27 @@
         this.dataElementId = dataElementId;
     }
 
-    private List<DataSet> dataSets = new ArrayList<DataSet>();
-
-    public List<DataSet> getDataSets()
-    {
-        return dataSets;
-    }
-
-    private List<Option> options = new ArrayList<Option>();
-
-    public List<Option> getOptions()
-    {
-        return options;
-    }
+    private DataSet dataSet;
+    
+    public DataSet getDataSet()
+    {
+        return dataSet;
+    }
+
+    private DataElement dataElement;
+    
+    public DataElement getDataElement()
+    {
+        return dataElement;
+    }
+
+    private Option option;
+    
+    public Option getOption()
+    {
+        return option;
+    }
+    
     
     // -------------------------------------------------------------------------
     // Action Implementation
@@ -79,6 +83,7 @@
 
     public String execute() throws Exception
     {
+        /*
         Lookup partnerOptionSetLookup = lookupService.getLookupByName( Lookup.OPTION_SET_PARTNER );
         
         OptionSet activitesOptionSet = optionService.getOptionSet( Integer.parseInt( partnerOptionSetLookup.getValue() ) );
@@ -89,6 +94,15 @@
         }
         
         dataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
+        */
+        
+        
+        dataSet = dataSetService.getDataSet( dataSetId );
+        
+        dataElement = dataElementService.getDataElement( dataElementId );
+        
+        option = optionService.getOption( optionSetId );
+        
         
         /*
         for ( Option option : options )
@@ -102,4 +116,11 @@
         return SUCCESS;
     }
 
+
+ 
+
+
+
+
+
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFundManagement.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFundManagement.java	2014-11-14 10:31:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/PartnerFundManagement.java	2014-11-15 09:02:15 +0000
@@ -17,56 +17,62 @@
 /**
  * Created by Ganesh on 14/11/14.
  */
-public class PartnerFundManagement implements Action {
-
-	// -------------------------------------------------------------------------
-	// Dependencies
-	// -------------------------------------------------------------------------
-
-	@Autowired
-	private OptionService optionService;
-
-	@Autowired
-	private DataSetService dataSetService;
-
-	@Autowired
-	private LookupService lookupService;
-
-	// -------------------------------------------------------------------------
-	// Input & Output
-	// -------------------------------------------------------------------------
-
-	private List<DataSet> dataSets = new ArrayList<DataSet>();
-
-	public List<DataSet> getDataSets() {
-		return dataSets;
-	}
-
-	private List<Option> options = new ArrayList<Option>();
-
-	public List<Option> getOptions() {
-		return options;
-	}
-
-	// -------------------------------------------------------------------------
-	// Action Implementation
-	// -------------------------------------------------------------------------
-
-	@java.lang.Override
-	public String execute() throws Exception {
-
-		Lookup partnerOptionSetLookup = lookupService
-				.getLookupByName(Lookup.OPTION_SET_PARTNER);
-
-		OptionSet activitesOptionSet = optionService.getOptionSet(Integer
-				.parseInt(partnerOptionSetLookup.getValue()));
-
-		if (activitesOptionSet != null) {
-			options = new ArrayList<Option>(activitesOptionSet.getOptions());
-		}
-
-		dataSets = new ArrayList<DataSet>(dataSetService.getAllDataSets());
-
-		return SUCCESS;
-	}
+public class PartnerFundManagement
+    implements Action
+{
+
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    @Autowired
+    private OptionService optionService;
+
+    @Autowired
+    private DataSetService dataSetService;
+
+    @Autowired
+    private LookupService lookupService;
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private List<DataSet> dataSets = new ArrayList<DataSet>();
+
+    public List<DataSet> getDataSets()
+    {
+        return dataSets;
+    }
+
+    private List<Option> options = new ArrayList<Option>();
+
+    public List<Option> getOptions()
+    {
+        return options;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+    @java.lang.Override
+    public String execute()
+        throws Exception
+    {
+
+        Lookup partnerOptionSetLookup = lookupService.getLookupByName( Lookup.OPTION_SET_PARTNER );
+
+        OptionSet activitesOptionSet = optionService
+            .getOptionSet( Integer.parseInt( partnerOptionSetLookup.getValue() ) );
+
+        if ( activitesOptionSet != null )
+        {
+            options = new ArrayList<Option>( activitesOptionSet.getOptions() );
+        }
+
+        dataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
+
+        return SUCCESS;
+    }
 }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/SavePartnerDetailsResultAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/SavePartnerDetailsResultAction.java	2014-10-24 11:05:35 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/partner/action/SavePartnerDetailsResultAction.java	2014-11-15 09:02:15 +0000
@@ -1,7 +1,10 @@
 package org.hisp.dhis.rbf.partner.action;
 
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.dataelement.DataElement;
@@ -11,11 +14,15 @@
 import org.hisp.dhis.option.Option;
 import org.hisp.dhis.option.OptionService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.rbf.api.PBFDataValue;
 import org.hisp.dhis.rbf.api.PBFDataValueService;
+import org.hisp.dhis.rbf.api.Partner;
+import org.hisp.dhis.rbf.api.PartnerService;
+import org.hisp.dhis.user.CurrentUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
@@ -44,6 +51,15 @@
     }
     
     @Autowired
+    private OrganisationUnitService organisationUnitService;
+    
+    @Autowired
+    private PartnerService partnerService;
+
+    @Autowired
+    private CurrentUserService currentUserService;
+
+    @Autowired
     private DataSetService dataSetService;
     
     @Autowired
@@ -81,29 +97,57 @@
         this.dataElementId = dataElementId;
     }
     
+    /*
     private Integer periodId;
     
     public void setPeriodId( Integer periodId )
     {
         this.periodId = periodId;
     }
+    */
+    
+    private String startDate;
+    
+    public void setStartDate( String startDate )
+    {
+        this.startDate = startDate;
+    }
+    
+    private String endDate;
+    
+    public void setEndDate( String endDate )
+    {
+        this.endDate = endDate;
+    }
+
     
     // -------------------------------------------------------------------------
     // Action
     // -------------------------------------------------------------------------
 
-
     public String execute() throws Exception
     {
+        System.out.println( " Inside save partner" );
+        
+        SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
         
         DataSet dataSet = dataSetService.getDataSet( dataSetId );
         
         DataElement dataElement = dataElementService.getDataElement( dataElementId );
         
-        Period period = periodService.getPeriod( periodId );
+        Date sDate = dateFormat.parse( startDate );
+        Date eDate = dateFormat.parse( endDate );
+        
+        //Period period = periodService.getPeriod( periodId );
+        
+        Period period = periodService.getPeriod( sDate, eDate, dataSet.getPeriodType() );
+        //periodService.getPeriod( arg0, arg1, arg2 )
+        
         
         Option option = optionService.getOption( optionSetId );
         
+        
+        
         /*
         System.out.println( " Option name -- " + option.getName() );
         System.out.println( " dataSet name -- " + dataSet.getName() );
@@ -112,25 +156,85 @@
         */
         
         Set<OrganisationUnit> selectedOrgUnitList = new HashSet<OrganisationUnit>( selectionTreeManager.getReloadedSelectedOrganisationUnits() );
+        List<OrganisationUnit> orgUnitList = new ArrayList<OrganisationUnit>();
         
         for ( OrganisationUnit organisationUnit : selectedOrgUnitList )
         {
-            PBFDataValue pbfDataValue = pbfDataValueService.getPBFDataValue( organisationUnit, dataSet, period, dataElement );
-            
-            if ( pbfDataValue != null )
+            orgUnitList.addAll( organisationUnitService.getOrganisationUnitWithChildren( organisationUnit.getId() )  );
+        }
+        
+
+        for ( OrganisationUnit organisationUnit : orgUnitList )
+        {
+            if( period!= null )
             {
-                pbfDataValue.setOption( option );
-                pbfDataValue.setTimestamp( new Date() );
+                System.out.println( " Inside save partner PBF Data Value" );
+             // save partner in pbf datavalue
+                PBFDataValue pbfDataValue = pbfDataValueService.getPBFDataValue( organisationUnit, dataSet, period, dataElement );
+                
+                if ( pbfDataValue != null )
+                {
+                    pbfDataValue.setOption( option );
+                    pbfDataValue.setTimestamp( new Date() );
 
-                pbfDataValueService.updatePBFDataValue( pbfDataValue );
+                    pbfDataValueService.updatePBFDataValue( pbfDataValue );
+                }
             }
             
             //System.out.println( " orgUnit name -- " + organisationUnit.getName() );
         }
         
+        // save partnet in partner
+        Set<OrganisationUnit> dataSetSources = new HashSet<OrganisationUnit>( dataSet.getSources() );
+        
+        dataSetSources.retainAll( orgUnitList );
+        
+        System.out.println( " Data Set source size "  + dataSetSources.size() );
+        
+        for ( OrganisationUnit organisationUnit : dataSetSources )
+        {
+            System.out.println( " Inside save partner Partner Table"  + dataSetSources.size() );
+            Partner partner = partnerService.getPartner( organisationUnit, dataSet, dataElement, sDate, eDate );
+            
+            if ( partner == null )
+            {
+                partner = new Partner();
+                
+                partner.setOrganisationUnit( organisationUnit );
+                partner.setDataSet( dataSet );
+                partner.setDataElement( dataElement );
+                partner.setOption( option );
+                
+                partner.setStartDate( sDate );
+                partner.setEndDate( eDate );
+                partner.setTimestamp( new Date() );
+                partner.setStoredBy( currentUserService.getCurrentUsername() );
+                
+                partnerService.addPartner( partner );
+                
+            }
+            
+            else
+            {
+                partner.setOrganisationUnit( organisationUnit );
+                partner.setDataSet( dataSet );
+                partner.setDataElement( dataElement );
+                partner.setOption( option );
+                
+                partner.setOption( option );
+                
+                partner.setStartDate( sDate );
+                partner.setEndDate( eDate );
+                partner.setTimestamp( new Date() );
+                partner.setStoredBy( currentUserService.getCurrentUsername() );
+                
+                partnerService.updatePartner( partner );
+            }
+            
+        }
+        
         //System.out.println( " Size of orgUnitList First -- " + orgUnitList.size() );
         
-        
         return SUCCESS;
     }
     

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerForm.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerForm.vm	2014-11-15 05:37:54 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerForm.vm	2014-11-15 09:02:15 +0000
@@ -15,12 +15,12 @@
             //alert("Please Select Period");
             return false;
         }
-        */
+        
 
         var dataSetId = $( '#dataSetId' ).val();
         var optionSetId = $( '#optionSetId' ).val();
         var dataElementId = $( '#dataElementId' ).val();
-//	var periodId = $( '#periodId' ).val();
+		var periodId = $( '#periodId' ).val();
 
         if ( dataSetId == "-1" )
         {
@@ -40,6 +40,9 @@
             showWarningMessage( "Please Select DataElement" );
             return false;
         }
+		*/
+		
+		/*
         else if( $("#startDate").val() == ""  )
         {
             showWarningMessage( "Please Select Start Date" );
@@ -50,7 +53,7 @@
             showWarningMessage( "Please Select End Date" );
             return false;
         }
-
+		*/
 
         /*	else if( periodId == "-1" )
             {
@@ -74,38 +77,36 @@
     <table>
         <tr>
             <td><label for="dataSetId">$i18n.getString( "dataSet" )</label></td>
-            <td>
          <!--   <select id="dataSetId" name="dataSetId" style="width:220px" onchange="loadDataElementAndPeriod()" >
                 <option value="-1">[$i18n.getString( "select" )]</option>
                 #foreach( $dataSet in $dataSets )
                     <option value="$dataSet.id">$encoder.htmlEncode( $dataSet.name )</option>
                 #end
             </select> -->
-            <input type="text" id="dataSetId" name="dataSetId" value="$dataSetName" readonly>
-            </td>
+            <td><input type="hidden" id="dataSetId" name="dataSetId" value="$dataSet.id">$dataSet.name</td>
         </tr>
 
         <tr>
             <td><label for="partner">$i18n.getString( "partner" )</label></td>
-            <td>
+           
                <!-- <select id="optionSetId" name="optionSetId" style="width:220px" >
                 <option value="-1">[$i18n.getString( "select" )]</option>
                 #foreach( $option in $options )
                     <option value="$option.id">$encoder.htmlEncode( $option.name )</option>
                 #end
             </select> -->
-                <input type="text" id="optionSetId" name="optionSetId" value="$partnerName" readonly>
-            </td>
+            <td><input type="hidden" id="optionSetId" name="optionSetId" value="$option.id">$option.name</td>
+            
         </tr>
 
         <tr>
             <td><label>$i18n.getString( "dataElement" )</label></td>
-            <td>
+            
               <!--  <select id="dataElementId" name = "dataElementId" style="width:220px" >
                     <option value="-1">[$i18n.getString( "select" )]</option>
                 </select> -->
-                <input type="text"  id="dataElementId" name="dataElementId" value="$dataElementName" readonly>
-            </td>
+			  <td><input type="hidden"  id="dataElementId" name="dataElementId" value="$dataElement.id">$dataElement.name</td>
+            
         </tr>
         <!--
 	<tr>

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerFundManagement.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerFundManagement.vm	2014-11-15 05:37:54 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/partnerFundManagement.vm	2014-11-15 09:02:15 +0000
@@ -10,31 +10,41 @@
         jQuery('#addPeriod').dialog('destroy').remove();
 
 		var dataSetId = $( "#dataSetId" ).val();
-       	var partnerId = $( "#optionSetId" ).val();
+       	var optionSetId = $( "#optionSetId" ).val();
  		var dataElementId = $( "#dataElementId" ).val();
- 		
-       /* var dataSetId = document.getElementById('dataSetId');
-        var dataSetName =  dataSetId.options[ dataSetId.selectedIndex ].text;
-
-        var partnerId = document.getElementById('optionSetId');
-        var partnerName =  partnerId.options[ partnerId.selectedIndex ].text;
-
-        var dataElementId = document.getElementById('dataElementId');
-        var dataElementName = dataElementId.options[ dataElementId.selectedIndex ].text;*/
-
-
-        jQuery('<div id="addPeriod">' ).load( 'partnerForm.action?dataSetId='+ dataSetId + "&partnerId=" + partnerId + "&dataElementId=" + dataElementId).dialog({
+		
+		if ( dataSetId == "-1" )
+        {
+            showWarningMessage( "Please Select DataSet" );
+
+            return false;
+        }
+
+        else if( optionSetId == "-1" )
+        {
+            showWarningMessage( "Please Select Partner" );
+            return false;
+        }
+
+        else if( dataElementId == "-1" )
+        {
+            showWarningMessage( "Please Select DataElement" );
+            return false;
+        }
+		else
+		{ 		
+        jQuery('<div id="addNewPeriod">' ).load( 'partnerForm.action?dataSetId='+ dataSetId + "&optionSetId=" + optionSetId + "&dataElementId=" + dataElementId).dialog({
             title: 'Add New Period',
             maximize: true,
             closable: true,
             modal:true,
             overlay:{background:'#000000', opacity:0.1},
             width: 600,
-            height: 600
+            height: 500
         });
-
-        //validateAddTariff();
-    }
+	}
+        
+ }
 
 </script>