dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41705
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21268: minor
------------------------------------------------------------
revno: 21268
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-12-02 16:21:18 +0100
message:
minor
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 2015-12-02 13:43:14 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js 2015-12-02 15:21:18 +0000
@@ -60,7 +60,6 @@
$scope.currentEvent = {};
$scope.currentEventOriginialValue = {};
$scope.displayCustomForm = false;
- console.log("displayCustomForm set to false");
$scope.currentElement = {id: '', update: false};
$scope.optionSets = [];
$scope.proceedSelection = true;
@@ -338,48 +337,44 @@
if(event.notes && !$scope.noteExists){
$scope.noteExists = true;
- }
-
- //check if event is empty
- if(!angular.isUndefined(event.dataValues)){
-
- angular.forEach(event.dataValues, function(dataValue){
-
- //converting event.datavalues[i].datavalue.dataelement = value to
- //event[dataElement] = value for easier grid display.
- if($scope.prStDes[dataValue.dataElement]){
- var val = dataValue.value;
- if(angular.isObject($scope.prStDes[dataValue.dataElement].dataElement)){
- val = CommonUtils.formatDataValue(val, $scope.prStDes[dataValue.dataElement].dataElement, $scope.optionSets, 'USER');
- }
-
- event[dataValue.dataElement] = val;
-
- if($scope.prStDes[dataValue.dataElement].dataElement.valueType === 'FILE_RESOURCE'){
- FileService.get(val).then(function(response){
- if(response && response.name){
- if(!$scope.fileNames[event.event]){
- $scope.fileNames[event.event] = [];
- }
- $scope.fileNames[event.event][dataValue.dataElement] = response.name;
- }
- });
- }
- }
- });
-
- event['uid'] = event.event;
- event.eventDate = DateUtils.formatFromApiToUser(event.eventDate);
- event['eventDate'] = event.eventDate;
- if(event.status === "ACTIVE") {
- event.status = false;
- } else if(event.status === "COMPLETED") {
- event.status = true;
+ }
+
+ angular.forEach(event.dataValues, function(dataValue){
+
+ //converting event.datavalues[i].datavalue.dataelement = value to
+ //event[dataElement] = value for easier grid display.
+ if($scope.prStDes[dataValue.dataElement]){
+ var val = dataValue.value;
+ if(angular.isObject($scope.prStDes[dataValue.dataElement].dataElement)){
+ val = CommonUtils.formatDataValue(val, $scope.prStDes[dataValue.dataElement].dataElement, $scope.optionSets, 'USER');
+ }
+
+ event[dataValue.dataElement] = val;
+
+ if($scope.prStDes[dataValue.dataElement].dataElement.valueType === 'FILE_RESOURCE'){
+ FileService.get(val).then(function(response){
+ if(response && response.name){
+ if(!$scope.fileNames[event.event]){
+ $scope.fileNames[event.event] = [];
+ }
+ $scope.fileNames[event.event][dataValue.dataElement] = response.name;
+ }
+ });
+ }
}
-
-
- delete event.dataValues;
+ });
+
+ event['uid'] = event.event;
+ event.eventDate = DateUtils.formatFromApiToUser(event.eventDate);
+ event['eventDate'] = event.eventDate;
+ if(event.status === "ACTIVE") {
+ event.status = false;
+ } else if(event.status === "COMPLETED") {
+ event.status = true;
}
+
+ delete event.dataValues;
+
});
$scope.dhis2Events = data.events;