=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/i18n/en.json 2014-06-22 07:04:04 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/i18n/en.json 2014-07-05 09:16:51 +0000
@@ -37,6 +37,7 @@
"hide": "Hide",
"select_columns_to_show": "Select columns to show",
"show_details": "Show details",
+ "add_your_comment_here": "Add your comment here",
"new_event": "New Event",
"data_element": "Data element",
"value": "Value",
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html 2014-06-25 05:31:09 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html 2014-07-05 09:16:51 +0000
@@ -1,5 +1,6 @@
-
+
+
Event Capture
@@ -45,7 +46,7 @@
-
+
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js 2014-06-13 06:12:21 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js 2014-07-05 09:16:51 +0000
@@ -36,6 +36,7 @@
$scope.displayCustomForm = false;
$scope.currentElement = {id: '', update: false};
$scope.selectedOrgUnit = '';
+ $scope.note = {};
//watch for selection of org unit from tree
$scope.$watch('selectedOrgUnit', function(newObj, oldObj) {
@@ -125,7 +126,12 @@
//for date type dataelements, filtering is based on start and end dates
var dataElement = prStDe.dataElement;
var name = dataElement.formName || dataElement.name;
- $scope.newDhis2Event.dataValues.push({id: dataElement.id, value: ''});
+
+ $scope.newDhis2Event.dataValues.push({id: dataElement.id, value: ''});
+ if($scope.selectedProgramStage.captureCoordinates){
+ $scope.newDhis2Event.coordinate = {};
+ }
+
$scope.eventGridColumns.push({name: name, id: dataElement.id, type: dataElement.type, compulsory: prStDe.compulsory, showFilter: false, show: prStDe.displayInReports});
$scope.filterTypes[dataElement.id] = dataElement.type;
@@ -304,11 +310,11 @@
$scope.showEventRegistration = function(){
$scope.displayCustomForm = $scope.customForm ? true:false;
- $scope.eventRegistration = !$scope.eventRegistration;
- $scope.currentEvent = $scope.newDhis2Event;
+ $scope.eventRegistration = !$scope.eventRegistration;
+ $scope.currentEvent = angular.copy($scope.newDhis2Event);
$scope.outerForm.submitted = false;
- $scope.currentEvent = {};
+ //$scope.currentEvent = {};
};
$scope.showEditEventInGrid = function(){
@@ -356,7 +362,7 @@
dataValues.push({dataElement: dataElement, value: $scope.currentEvent[dataElement]});
}
- var newEvent = angular.copy($scope.currentEvent);
+ var newEvent = angular.copy($scope.currentEvent);
//prepare the event to be created
var dhis2Event = {
@@ -366,7 +372,12 @@
status: 'ACTIVE',
eventDate: $filter('date')(newEvent.eventDate, 'yyyy-MM-dd'),
dataValues: dataValues
- };
+ };
+
+ if(!angular.isUndefined($scope.note.value) && $scope.note.value != ''){
+ console.log('the note is: ', $scope.note.value);
+ dhis2Event.notes = [{value: $scope.note.value}];
+ }
if($scope.selectedProgramStage.captureCoordinates){
dhis2Event.coordinate = {latitude: $scope.currentEvent.coordinate.latitude ? $scope.currentEvent.coordinate.latitude : '',
@@ -400,7 +411,9 @@
$scope.editingEventInGrid = false;
$scope.outerForm.submitted = false;
}
- $scope.currentEvent = {};
+ //reset form
+ $scope.currentEvent = angular.copy($scope.newDhis2Event);
+ $scope.note = {};
$scope.outerForm.submitted = false;
}
});
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js 2014-06-03 06:19:46 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js 2014-07-05 09:16:51 +0000
@@ -223,7 +223,30 @@
element.draggable();
}
};
-})
+})
+
+.directive('d2PopOver', function($compile, $templateCache){
+ return {
+ restrict: 'EA',
+ link: function(scope, element, attrs){
+ var content = $templateCache.get("note.html");
+ content = $compile(content)(scope);
+ var options = {
+ content: content,
+ placement: 'bottom',
+ trigger: 'hover',
+ html: true,
+ title: scope.title
+ };
+ $(element).popover(options);
+ },
+ scope: {
+ content: '=',
+ title: '@details',
+ template: "@template"
+ }
+ };
+})
.directive('serversidePaginator', function factory() {
return {
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css 2014-06-24 12:23:55 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css 2014-07-05 09:16:51 +0000
@@ -504,4 +504,8 @@
}
select {
padding: 3px;
+}
+
+.clear {
+ clear: both
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html 2014-06-24 12:23:55 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html 2014-07-05 09:16:51 +0000
@@ -47,4 +47,23 @@
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+ {{note.value}}
+
+
+ |
+
+
+
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html 2014-06-24 12:23:55 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html 2014-07-05 09:16:51 +0000
@@ -114,6 +114,24 @@
-
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+ {{note.value}}
+
+
+ |
+
+
\ No newline at end of file