← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21867: event-capture: minor fix in paging

 

------------------------------------------------------------
revno: 21867
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2016-02-03 12:03:52 +0100
message:
  event-capture: minor fix in paging
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js


--
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 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2016-01-25 10:14:50 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2016-02-03 11:03:52 +0000
@@ -117,18 +117,6 @@
             }
         }        
     });
-    
-    function checkSkipOffline() {
-        if(dhis2.ec.isOffline && $scope.selectedProgram && $scope.selectedProgram.skipOffline){
-            var dialogOptions = {
-                headerText: 'offline',
-                bodyText: 'program_is_skip_offline'
-            };
-
-            DialogService.showDialog({}, dialogOptions);
-            return;
-        }
-    }
 
     $scope.completeEnrollment = function() {
         $scope.currentEvent.status = !$scope.currentEvent.status;
@@ -175,8 +163,6 @@
         $scope.sortHeader = {};
         $scope.filterText = {};
         
-        checkSkipOffline();
-        
         if( $scope.userAuthority && $scope.userAuthority.canAddOrUpdateEvent &&
                 $scope.selectedProgram && 
                 $scope.selectedProgram.programStages && 
@@ -283,9 +269,7 @@
     };
         
     //get events for the selected program (and org unit)
-    $scope.loadEvents = function(){   
-        
-        checkSkipOffline();
+    $scope.loadEvents = function(){
         
         $scope.noteExists = false;            
         $scope.dhis2Events = [];
@@ -318,6 +302,7 @@
                 //$scope.dhis2Events = data.events; 
 
                 if( data.pager ){
+                    data.pager.pageSize = data.pager.pageSize ? data.pager.pageSize : $scope.pager.pageSize;
                     $scope.pager = data.pager;
                     $scope.pager.toolBarDisplay = 5;
 
@@ -575,9 +560,7 @@
         $scope.displayCustomForm = !$scope.displayCustomForm;
     };
     
-    $scope.addEvent = function(addingAnotherEvent){                
-        
-        checkSkipOffline();
+    $scope.addEvent = function(addingAnotherEvent){
         
         //check for form validity
         $scope.outerForm.submitted = true;        
@@ -714,8 +697,6 @@
     
     $scope.updateEvent = function(){
         
-        checkSkipOffline();
-        
         //check for form validity
         $scope.outerForm.submitted = true;        
         if( $scope.outerForm.$invalid ){
@@ -776,8 +757,6 @@
     
     $scope.updateEventDate = function () {
         
-        checkSkipOffline();
-        
         $scope.updateSuccess = false;
         
         $scope.currentElement = {id: 'eventDate'};
@@ -827,8 +806,6 @@
             
     $scope.updateEventDataValue = function(currentEvent, dataElement){
         
-        checkSkipOffline();
-        
         $scope.updateSuccess = false;
         
         //get current element