=== 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 2014-12-08 15:06:43 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties 2014-12-09 23:24:16 +0000 @@ -29,6 +29,7 @@ go_back=Go back form_invalid=Form is invalid. Please check for required fields. required=Required +value_must_be=Value must be int_required=Value must be a number string_required=Value must be a text date_required=Value must be a date @@ -113,3 +114,9 @@ update_event=Update Event missing_translation_file=Missing Translation File missing_translation_using_default=No translation file is found for the selected locale. Using default translation (English). +number=Number +posInt=Positive Integer +negInt=Negative Integer +zeroPostitiveInt=Zero or Positive Integer + + === 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-12-08 15:06:43 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html 2014-12-09 23:24:16 +0000 @@ -33,8 +33,8 @@ - - + + === 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-12-08 16:37:23 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js 2014-12-09 23:24:16 +0000 @@ -216,21 +216,18 @@ var val = dataValue.value; if(angular.isObject($scope.prStDes[dataValue.dataElement].dataElement)){ - //converting int string value to integer for proper sorting. + //converting int string value to number for proper sorting. if($scope.prStDes[dataValue.dataElement].dataElement.type === 'int'){ - if( !isNaN(parseInt(val)) ){ - val = parseInt(val); - } - else{ - val = ''; - } + if( dhis2.validation.isNumber(val) ){ + val = new Number(val); + } } if($scope.prStDes[dataValue.dataElement].dataElement.type === 'string'){ if($scope.prStDes[dataValue.dataElement].dataElement.optionSet && $scope.prStDes[dataValue.dataElement].dataElement.optionSet.id && $scope.optionSets[$scope.prStDes[dataValue.dataElement].dataElement.optionSet.id] && $scope.optionSets[$scope.prStDes[dataValue.dataElement].dataElement.optionSet.id].options ){ - val = OptionSetService.getNameOrCode($scope.optionSets[$scope.prStDes[dataValue.dataElement].dataElement.optionSet.id].options, val); + val = OptionSetService.getName($scope.optionSets[$scope.prStDes[dataValue.dataElement].dataElement.optionSet.id].options, val); } } if($scope.prStDes[dataValue.dataElement].dataElement.type === 'date'){ @@ -428,7 +425,7 @@ valueExists = true; if($scope.prStDes[dataElement].dataElement.type === 'string'){ if($scope.prStDes[dataElement].dataElement.optionSet){ - val = OptionSetService.getNameOrCode($scope.optionSets[$scope.prStDes[dataElement].dataElement.optionSet.id].options,val); //$scope.optionSets[].options$scope.optionCodesByName[ '"' + val + '"']; + val = OptionSetService.getCode($scope.optionSets[$scope.prStDes[dataElement].dataElement.optionSet.id].options,val); } } @@ -545,7 +542,7 @@ if(val && $scope.prStDes[dataElement].dataElement.type === 'string'){ if($scope.prStDes[dataElement].dataElement.optionSet){ - val = OptionSetService.getNameOrCode($scope.optionSets[$scope.prStDes[dataElement].dataElement.optionSet.id].options,val); + val = OptionSetService.getCode($scope.optionSets[$scope.prStDes[dataElement].dataElement.optionSet.id].options,val); } } if(val && $scope.prStDes[dataElement].dataElement.type === 'date'){ @@ -613,7 +610,7 @@ var oldValue = $scope.currentEventOrginialValue[dataElement]; //check for form validity - $scope.outerForm.submitted = true; + $scope.outerForm.submitted = true; if( $scope.outerForm.$invalid ){ $scope.currentElement.updated = false; currentEvent[dataElement] = oldValue; @@ -630,7 +627,7 @@ if($scope.prStDes[dataElement].dataElement.type === 'string'){ if($scope.prStDes[dataElement].dataElement.optionSet){ - newValue = OptionSetService.getNameOrCode($scope.optionSets[$scope.prStDes[dataElement].dataElement.optionSet.id].options, newValue);//$scope.optionCodesByName[ '"' + newValue + '"']; + newValue = OptionSetService.getCode($scope.optionSets[$scope.prStDes[dataElement].dataElement.optionSet.id].options, newValue);//$scope.optionCodesByName[ '"' + newValue + '"']; } } if($scope.prStDes[dataElement].dataElement.type === 'date'){ === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/directives.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/directives.js 2014-12-03 17:48:48 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/directives.js 2014-12-09 23:24:16 +0000 @@ -2,5 +2,4 @@ /* Directives */ -var eventCaptureDirectives = angular.module('eventCaptureDirectives', []); - +var eventCaptureDirectives = angular.module('eventCaptureDirectives', []); \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js 2014-12-03 17:48:48 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js 2014-12-09 23:24:16 +0000 @@ -436,7 +436,7 @@ { return function() { return $.ajax( { - url: '../api/programStages.json?filter=id:eq:' + id +'&fields=id,name,version,description,reportDateDescription,captureCoordinates,dataEntryForm,minDaysFromStart,repeatable,preGenerateUID,programStageSections[id,name,programStageDataElements[dataElement[id]]],programStageDataElements[displayInReports,sortOrder,allowProvidedElsewhere,allowFutureDate,compulsory,dataElement[id,name,type,formName,optionSet[id]]]', + url: '../api/programStages.json?filter=id:eq:' + id +'&fields=id,name,version,description,reportDateDescription,captureCoordinates,dataEntryForm,minDaysFromStart,repeatable,preGenerateUID,programStageSections[id,name,programStageDataElements[dataElement[id]]],programStageDataElements[displayInReports,sortOrder,allowProvidedElsewhere,allowFutureDate,compulsory,dataElement[id,name,type,numberType,formName,optionSet[id]]]', type: 'GET' }).done( function( response ){ _.each( _.values( response.programStages ), function( programStage ) { === 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-11-19 12:45:44 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html 2014-12-09 23:24:16 +0000 @@ -56,7 +56,7 @@ {{'longitude'| translate}}
+ {{'form_id'| translate}} + | ++ + | +
+ {{selectedProgramStage.reportDateDescription ? selectedProgramStage.reportDateDescription : 'incident_date'| translate }} + | ++ + {{'date_required'| translate}} + | +
+ {{'lat_lng' | translate}} + | ++ + + {{'int_required'| translate}} [-90 ... 90] + + + + {{'int_required'| translate}}[-180 ... 180] + + + | +
+ {{'recorded_comments'| translate}} + | +
---|
+ {{note.value}} +{{'created_by'| translate}}: {{note.storedBy}} +{{'date'| translate}}: {{note.storedDate}} + |
+