← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1992: Added AjaxLoader while getting orunitdetails in TabularAnalysis

 

------------------------------------------------------------
revno: 1992
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2010-11-03 14:47:15 +0530
message:
  Added AjaxLoader while getting orunitdetails in TabularAnalysis
added:
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/images/ajax-loader.gif
modified:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/action/GetOrgUnitsAction.java
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ta.js
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/tabularAnalysisFront.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-dashboard/src/main/java/org/hisp/dhis/dashboard/action/GetOrgUnitsAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/action/GetOrgUnitsAction.java	2010-11-02 09:31:44 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/action/GetOrgUnitsAction.java	2010-11-03 09:17:15 +0000
@@ -1,7 +1,6 @@
 package org.hisp.dhis.dashboard.action;
 
 import java.util.Collection;
-import java.util.Date;
 
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -67,7 +66,6 @@
     public String execute()
         throws Exception
     {
-        System.out.println( "StartTime: "+ new Date() );
         /* OrganisationUnit */
         if ( orgUnitId != null )
         {
@@ -75,45 +73,22 @@
         }
 
         orgUnitLevel = organisationUnitService.getLevelOfOrganisationUnit( orgUnit );
-        maxOrgUnitLevel = orgUnitLevel;
-        int maxNumberofLevels = organisationUnitService.getNumberOfOrganisationalLevels();
+        maxOrgUnitLevel = organisationUnitService.getNumberOfOrganisationalLevels();
         
         // Hardcoded : if it is Tabular Analysis, Null Reporter
         if( type != null && type.equalsIgnoreCase( "ta" ) )
         {
-            for( int i = orgUnitLevel+1; i <= maxNumberofLevels; i++ )
+            for( int i = orgUnitLevel+1; i <= maxOrgUnitLevel; i++ )
             {
                 Collection<OrganisationUnit> tempOrgUnitList = organisationUnitService.getOrganisationUnitsAtLevel( i, orgUnit );
                 if( tempOrgUnitList == null || tempOrgUnitList.size() == 0 )
                 {
-                    maxOrgUnitLevel = i;
+                    maxOrgUnitLevel = i-1;
                     break;
                 }
             }
         }
         
-        System.out.println( "EndTime: "+ new Date() );
-        
-        /*
-        orgUnitLevel = organisationUnitService.getLevelOfOrganisationUnit( orgUnit );
-        maxOrgUnitLevel = orgUnitLevel;
-        
-        // Hardcoded : if it is Tabular Analysis, Null Reporter
-        if( type != null && type.equalsIgnoreCase( "ta" ) )
-        {
-            List<OrganisationUnit> orgUnitTree = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( orgUnitId ) );
-            
-            
-            for( OrganisationUnit ou : orgUnitTree )
-            {
-                if( organisationUnitService.getLevelOfOrganisationUnit( ou ) > maxOrgUnitLevel )
-                {
-                    maxOrgUnitLevel = organisationUnitService.getLevelOfOrganisationUnit( ou );
-                }
-            }
-        }
-        */
-
         return SUCCESS;
     }
 

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/images/ajax-loader.gif'
Binary files local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/images/ajax-loader.gif	1970-01-01 00:00:00 +0000 and local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/images/ajax-loader.gif	2010-11-03 09:17:15 +0000 differ
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ta.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ta.js	2010-09-27 10:33:48 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ta.js	2010-11-03 09:17:15 +0000
@@ -441,7 +441,7 @@
 
 function getOUDeatilsForTA( orgUnitIds )
 {
-	
+	showOverlay();
     /* //var url = "getOrgUnitDetails.action?orgUnitId=" + orgUnitIds+"&type=ta";
 	
     var request = new Request();
@@ -522,7 +522,9 @@
                 getorgUnitLevels( ouLevel, maxOULevel );
             }            
         }
-    }    		
+    }   
+    
+    hideOverlay();
 }
 
 function getorgUnitLevels( ouLevel, maxOULevel )
@@ -661,3 +663,19 @@
     return true;
 } // formValidations Function End
 
+function showOverlay() 
+{
+    var o = document.getElementById('overlay');
+    o.style.visibility = 'visible';
+    jQuery("#overlay").css({
+        "height": jQuery(document).height()
+    });
+    jQuery("#overlayImg").css({
+        "top":jQuery(window).height()/2
+    });
+}
+function hideOverlay() 
+{
+    var o = document.getElementById('overlay');
+    o.style.visibility = 'hidden';
+}

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/tabularAnalysisFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/tabularAnalysisFront.vm	2010-10-28 09:17:13 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/tabularAnalysisFront.vm	2010-11-03 09:17:15 +0000
@@ -1,3 +1,22 @@
+<style>
+#overlay {
+z-index:9998;
+position:absolute;
+top:0;
+bottom:0;
+left:0;
+width:100%;
+background:#000;
+opacity:0.45;
+-moz-opacity:0.45;
+filter:alpha(opacity=45);
+visibility:hidden;
+}
+#overlayImg{ width: 50px; height: 50px; z-index: 9999; position: absolute; left:50%}
+</style>
+<div id="overlay">
+<div id="overlayImg"><img  width="50" height="50" src="images/ajax-loader.gif" /></div>
+</div>
 
 
 <script>