← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16471: minor

 

------------------------------------------------------------
revno: 16471
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-08-21 18:45:54 +0200
message:
  minor
modified:
  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/views/defaultForm.html


--
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	2014-08-21 16:30:01 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2014-08-21 16:45:54 +0000
@@ -126,6 +126,10 @@
                 $scope.selectedProgramStage = programStage;   
                 
                 console.log('The stage is:  ', $scope.selectedProgramStage);
+                
+                angular.forEach($scope.selectedProgramStage.programStageSections, function(section){
+                    section.open = true;
+                });
 
                 //$scope.customForm = CustomFormService.processCustomForm($scope.selectedProgramStage);
                 $scope.customForm = $scope.selectedProgramStage.dataEntryForm ? $scope.selectedProgramStage.dataEntryForm.htmlCode : null; 
@@ -394,7 +398,10 @@
         
         //check for form validity
         $scope.outerForm.submitted = true;        
-        if( $scope.outerForm.$invalid ){
+        if( $scope.outerForm.$invalid ){            
+            angular.forEach($scope.selectedProgramStage.programStageSections, function(section){
+                section.open = true;
+            });
             return false;
         }
         
@@ -486,6 +493,9 @@
         //check for form validity
         $scope.outerForm.submitted = true;        
         if( $scope.outerForm.$invalid ){
+            angular.forEach($scope.selectedProgramStage.programStageSections, function(section){
+                section.open = true;
+            });
             return false;
         }
         

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2014-08-21 16:30:01 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2014-08-21 16:45:54 +0000
@@ -297,7 +297,7 @@
     </table>
     
     <accordion close-others='false'>
-        <accordion-group heading="{{section.name}}" ng-repeat='section in selectedProgramStage.programStageSections'>
+        <accordion-group heading="{{section.name}}" is-open="section.open" ng-repeat='section in selectedProgramStage.programStageSections'>
             <table class="dhis2-list-table-striped">                    
                 <thead>                        
                     <tr>