=== 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-01 14:01:37 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js 2015-12-02 13:43:14 +0000 @@ -60,6 +60,7 @@ $scope.currentEvent = {}; $scope.currentEventOriginialValue = {}; $scope.displayCustomForm = false; + console.log("displayCustomForm set to false"); $scope.currentElement = {id: '', update: false}; $scope.optionSets = []; $scope.proceedSelection = true; @@ -149,6 +150,7 @@ $scope.updateSuccess = false; $scope.currentGridColumnId = ''; $scope.displayCustomForm = false; + console.log("displayCustomForm set to false"); if (angular.isObject($scope.selectedOrgUnit)) { ProgramFactory.getProgramsByOu($scope.selectedOrgUnit, $scope.selectedProgram).then(function(response){ @@ -369,6 +371,12 @@ 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; } @@ -520,7 +528,8 @@ }; $scope.showEventRegistration = function(){ - $scope.displayCustomForm = $scope.customForm ? true:false; + $scope.displayCustomForm = $scope.customForm ? true:false; + console.log("displayCustomForm set to "+$scope.displayCustomForm); $scope.currentEvent = {}; $scope.eventRegistration = !$scope.eventRegistration; $scope.currentEvent = angular.copy($scope.newDhis2Event); @@ -549,6 +558,7 @@ $scope.showEditEventInFull = function(){ $scope.note = {}; $scope.displayCustomForm = $scope.customForm ? true:false; + console.log("displayCustomForm set to "+$scope.displayCustomForm); $scope.currentEvent = ContextMenuSelectedItem.getSelectedItem(); $scope.editingEventInFull = !$scope.editingEventInFull; @@ -571,6 +581,8 @@ $scope.switchDataEntryForm = function(){ $scope.displayCustomForm = !$scope.displayCustomForm; + console.log("displayCustomForm set to "+$scope.displayCustomForm); + }; $scope.addEvent = function(addingAnotherEvent){ @@ -622,7 +634,7 @@ program: $scope.selectedProgram.id, programStage: $scope.selectedProgramStage.id, orgUnit: $scope.selectedOrgUnit.id, - status: 'ACTIVE', + status: $scope.currentEvent.status ? 'COMPLETED' : 'ACTIVE', eventDate: DateUtils.formatFromUserToApi(newEvent.eventDate), dataValues: dataValues }; @@ -735,7 +747,7 @@ program: $scope.currentEvent.program, programStage: $scope.currentEvent.programStage, orgUnit: $scope.currentEvent.orgUnit, - status: 'ACTIVE', + status: $scope.currentEvent.status ? 'COMPLETED' : 'ACTIVE', eventDate: DateUtils.formatFromUserToApi($scope.currentEvent.eventDate), event: $scope.currentEvent.event, dataValues: dataValues === 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-12-01 14:01:37 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html 2015-12-02 13:43:14 +0000 @@ -2,6 +2,7 @@ +i just write somehitn
@@ -61,6 +62,7 @@
+ it is here
{{category.name}}
@@ -116,13 +118,17 @@

- {{'event_details'| translate}} - {{'new_event'| translate}} + {{'event_details'| translate}} + {{'new_event'| translate}}

+
+
Completed
+ +