← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19359: event-capture: section selector

 

------------------------------------------------------------
revno: 19359
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-06-11 13:18:14 +0200
message:
  event-capture: section selector
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties
  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
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.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/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties	2015-06-02 12:25:03 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties	2015-06-11 11:18:14 +0000
@@ -27,6 +27,7 @@
 discard=Discard
 back=Back
 go_back=Go back
+section=Section
 form_invalid=Form is invalid. Please check for required fields.
 required=Required
 int_required=Value must be a number

=== 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	2015-06-11 09:09:20 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-06-11 11:18:14 +0000
@@ -33,6 +33,7 @@
     //selected org unit
     $scope.selectedOrgUnit = '';
     $scope.treeLoaded = false;    
+    $scope.selectedSection = {id: 'ALL'};
     
     $scope.calendarSetting = CalendarService.getSetting();
     
@@ -472,6 +473,7 @@
         //check for form validity
         $scope.outerForm.submitted = true;        
         if( $scope.outerForm.$invalid ){
+            $scope.selectedSection.id = 'ALL';
             angular.forEach($scope.selectedProgramStage.programStageSections, function(section){
                 section.open = true;
             });
@@ -600,6 +602,7 @@
         //check for form validity
         $scope.outerForm.submitted = true;        
         if( $scope.outerForm.$invalid ){
+            $scope.selectedSection.id = 'ALL';
             angular.forEach($scope.selectedProgramStage.programStageSections, function(section){
                 section.open = true;
             });

=== 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	2015-06-10 11:58:22 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2015-06-11 11:18:14 +0000
@@ -249,7 +249,10 @@
         </tbody>
     </table>    
     <accordion close-others='false'>
-        <accordion-group heading="{{section.name}}" is-open="section.open" ng-repeat='section in selectedProgramStage.programStageSections'>
+        <accordion-group heading="{{section.name}}"
+                         is-open="section.open"
+                         ng-repeat='section in selectedProgramStage.programStageSections'
+                         ng-if="section.id === selectedSection.id || selectedSection.id === 'ALL'">
             <table class="dhis2-list-table-striped">                    
                 <thead>                        
                     <tr>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html	2015-05-07 08:21:29 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html	2015-06-11 11:18:14 +0000
@@ -60,7 +60,18 @@
                         <span ng-if="editingEventInFull">{{'print_details'| translate}}</span>
                     </button>  
                 </td> 
-            </tr>                       
+            </tr>
+            <tr ng-if="selectedProgramStage && selectedProgramStage.programStageSections.length  && eventRegistration || editingEventInFull">
+                <td><label>{{'section'| translate}}</label></td>
+                <td>
+                    <select class="fixed-width-select"
+                            name="section"                             
+                            ng-model="selectedSection.id">
+                        <option value="ALL">{{'show_all'| translate}}</option>
+                        <option ng-repeat="section in selectedProgramStage.programStageSections" value={{section.id}}>{{section.name}}</option>
+                    </select>
+                </td>
+            </tr>
         </table>        
         <!-- selection ends -->