← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16479: event-capture - minor

 

------------------------------------------------------------
revno: 16479
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-08-22 13:29:33 +0200
message:
  event-capture - minor
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html
  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/eventList.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/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html	2014-08-21 16:30:01 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html	2014-08-22 11:29:33 +0000
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
-<html ng-app="eventCapture">
-<!--<html manifest="event-capture.appcache" ng-app="eventCapture">-->
+<html manifest="event-capture.appcache" ng-app="eventCapture">
     <head>
         <title>Event Capture</title>
 
@@ -46,7 +45,7 @@
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.memory.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js"></script>
-        <!--<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.appcache.js"></script>-->
+        <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.appcache.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/ouwt/ouwt.js"></script>
         
         <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angularLocalStorage.js"></script>

=== 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:45:54 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2014-08-22 11:29:33 +0000
@@ -125,8 +125,6 @@
                 
                 $scope.selectedProgramStage = programStage;   
                 
-                console.log('The stage is:  ', $scope.selectedProgramStage);
-                
                 angular.forEach($scope.selectedProgramStage.programStageSections, function(section){
                     section.open = true;
                 });
@@ -141,10 +139,8 @@
                 $scope.newDhis2Event = {dataValues: []};
                 $scope.currentEvent = {dataValues: []};
                 
-                if($scope.selectedProgramStage.preGenerateUID){
-                    $scope.eventGridColumns.push({name: 'form_id', id: 'uid', type: 'string', compulsory: false, showFilter: false, show: true});
-                    $scope.filterTypes['uid'] = 'string';
-                }
+                $scope.eventGridColumns.push({name: 'form_id', id: 'uid', type: 'string', compulsory: false, showFilter: false, show: true});
+                $scope.filterTypes['uid'] = 'string';                
                 
                 $scope.eventGridColumns.push({name: $scope.selectedProgramStage.reportDateDescription ? $scope.selectedProgramStage.reportDateDescription : 'incident_date', id: 'event_date', type: 'date', compulsory: false, showFilter: false, show: true});
                 $scope.filterTypes['event_date'] = 'date';
@@ -157,7 +153,7 @@
                     //create a template for new event
                     //for date type dataelements, filtering is based on start and end dates
                     var dataElement = prStDe.dataElement;
-                    var name = dataElement.formName || dataElement.name;
+                    var name = dataElement.formName ? dataElement.formName : dataElement.name;
                     
                     $scope.newDhis2Event.dataValues.push({id: dataElement.id, value: ''});   
                     if($scope.selectedProgramStage.captureCoordinates){

=== 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:45:54 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2014-08-22 11:29:33 +0000
@@ -11,7 +11,7 @@
             </tr>                        
         </thead>
         <tbody id="list">
-            <tr ng-if="selectedProgramStage.preGenerateUID && currentEvent['uid']">
+            <tr ng-if="selectedProgramStage.preGenerateUID || editingEventInFull">
                 <td>
                     {{'form_id' | translate}}
                 </td>
@@ -83,7 +83,7 @@
                             <div ng-switch-when="string">                                        
 
                                 <div class="container-fluid">                                
-                                    <span ng-if="!selectedProgram.dataEntryMethod || programStageDataElements[eventGridColumn.id].dataElement.optionSet.options.length > 8">
+                                    <span ng-if="!selectedProgram.dataEntryMethod || programStageDataElements[eventGridColumn.id].dataElement.optionSet.options.length > 7">
                                         <input type="text"
                                                ng-model="currentEvent[eventGridColumn.id]"                                                                    
                                                typeahead="option.code as option.name for option in programStageDataElements[eventGridColumn.id].dataElement.optionSet.options | filter:$viewValue | limitTo:20" 
@@ -214,85 +214,6 @@
                     <span ng-show="outerForm.submitted && outerForm.longitude.$invalid" class="required">{{'number_required'| translate}}[-180 ... 180]</span>
                 </td>                                            
             </tr>        
-            <!--<tr ng-repeat="eventGridColumn in eventGridColumns" ng-if="eventGridColumn.id !== 'comment' && eventGridColumn.id !== 'uid' && eventGridColumn.id !== 'event_date'">
-                <td >
-                    {{eventGridColumn.name}}                                    
-                </td>
-                <td >
-                    <ng-form name="innerForm">
-                        <div ng-switch="eventGridColumn.type">
-                            <div ng-switch-when="int">
-                                <input type="number"
-                                       ng-model="currentEvent[eventGridColumn.id]"                                                                
-                                       ng-required={{eventGridColumn.compulsory}}
-                                       name="foo" 
-                                       style="width:99%;"/>
-                                <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="required">{{'required'| translate}}</span>
-                            </div>
-                            <div ng-switch-when="string">                                        
-
-                                <div class="container-fluid">                                
-                                    <span ng-if="!selectedProgram.dataEntryMethod || programStageDataElements[eventGridColumn.id].dataElement.optionSet.options.length > 8">
-                                        <input type="text"
-                                               ng-model="currentEvent[eventGridColumn.id]"                                                                    
-                                               typeahead="option.code as option.name for option in programStageDataElements[eventGridColumn.id].dataElement.optionSet.options | filter:$viewValue | limitTo:20" 
-                                               typeahead-open-on-focus
-                                               ng-required={{eventGridColumn.compulsory}}
-                                               name="foo" 
-                                               style="width:99%;"/>
-                                        <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="required">{{'required'| translate}}</span>
-                                    </span>
-                                    <span ng-if="selectedProgram.dataEntryMethod && programStageDataElements[eventGridColumn.id].dataElement.optionSet.options.length < 7">                                    
-                                        <label>
-                                            <input type="radio" 
-                                                   name="foo" 
-                                                   ng-required={{eventGridColumn.compulsory}}
-                                                   ng-model="currentEvent[eventGridColumn.id]"
-                                                   value=""> {{'no_value' | translate}}<br>
-                                        </label>                                    
-                                        <label ng-repeat="option in  programStageDataElements[eventGridColumn.id].dataElement.optionSet.options">
-                                            <input type="radio" 
-                                                   name={{eventGridColumn.id}}   
-                                                   ng-required={{eventGridColumn.compulsory}}
-                                                   ng-model="currentEvent[eventGridColumn.id]"
-                                                   value={{option.code}}> {{option.name}}<br>                                        
-                                        </label>                                    
-                                        <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="required">{{'required'| translate}}</span>                                    
-                                    </span>
-                                </div>                            
-                            </div>
-                            <div ng-switch-when="bool">
-                                <select ng-model="currentEvent[eventGridColumn.id]"                                                                
-                                        ng-required={{eventGridColumn.compulsory}}
-                                        name="foo" 
-                                        style="width:99%;"/>
-                                <option value="">{{'please_select'| translate}}</option>                        
-                                <option value="0">{{'no'| translate}}</option>
-                                <option value="1">{{'yes'| translate}}</option>
-                                </select>
-                                <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="required">{{'required'| translate}}</span>
-                            </div>
-                            <div ng-switch-when="date">
-                                <input type="text"                                                                
-                                       placeholder="yyyy-mm-dd" 
-                                       ng-date 
-                                       ng-model="currentEvent[eventGridColumn.id]"                                                               
-                                       ng-required={{eventGridColumn.compulsory}}
-                                       name="foo" 
-                                       style="width:99%;"/>
-                                <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="required">{{'required'| translate}}</span>
-                            </div>
-                            <div ng-switch-when="trueOnly">
-                                <input type="checkbox"                                                                      
-                                       ng-model="currentEvent[eventGridColumn.id]"                                                               
-                                       ng-required={{eventGridColumn.compulsory}}
-                                       name="foo"/>
-                                <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="required">{{'required'| translate}}</span>
-                            </div>
-                        </div>
-                    </ng-form>
-                </td>
-            </tr>-->        
         </tbody>
     </table>
     
@@ -312,7 +233,7 @@
                 <tbody id="list">       
                     <tr ng-repeat="de in section.programStageDataElements">
                         <td >
-                            {{programStageDataElements[de.dataElement.id].dataElement.name}}
+                            {{programStageDataElements[de.dataElement.id].dataElement.formName ? programStageDataElements[de.dataElement.id].dataElement.formName : programStageDataElements[de.dataElement.id].dataElement.name}}
                         </td>
                         <td >
                             <ng-form name="innerForm">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html	2014-08-21 16:30:01 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html	2014-08-22 11:29:33 +0000
@@ -140,7 +140,7 @@
                                                            name="foo" 
                                                            style="width:99%;"/>                                                    
                                                 </span>
-                                                <span ng-if="eventGridColumn.id !== 'uid' && !selectedProgram.dataEntryMethod || programStageDataElements[eventGridColumn.id].dataElement.optionSet.options.length > 8">
+                                                <span ng-if="eventGridColumn.id !== 'uid' && !selectedProgram.dataEntryMethod || programStageDataElements[eventGridColumn.id].dataElement.optionSet.options.length > 7">
                                                     <input type="text" 
                                                        ng-model="dhis2Event[eventGridColumn.id]" 
                                                        ng-change="updateEventDataValue(dhis2Event, eventGridColumn.id)"