dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #35855
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18370: minor
------------------------------------------------------------
revno: 18370
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-02-20 17:29:28 +0100
message:
minor
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.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-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2015-02-20 15:06:35 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2015-02-20 16:29:28 +0000
@@ -129,7 +129,7 @@
if(stage.repeatable){
for(var j=0; j<$scope.eventsByStage[stage.id].length; j++){
- if(!$scope.eventsByStage[stage.id][j].eventDate){
+ if(!$scope.eventsByStage[stage.id][j].eventDate && $scope.eventsByStage[stage.id][j].status !== 'SKIPPED'){
return false;
}
}
@@ -641,13 +641,10 @@
return style;
};
- $scope.getColumnWidth = function(weight){
- var col = 1;
- if($scope.totalEvents > 0){
- col = weight <=1 ? 1 : weight;
- col = Math.round(col*12/$scope.totalEvents);
- }
- return "col-sm-" + col;
+ $scope.getColumnWidth = function(weight){
+ var width = weight <= 1 ? 1 : weight;
+ width = (width/$scope.totalEvents)*100;
+ return "width: " + width + '%';
};
var sortEventsByStage = function(){
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2015-02-20 15:06:35 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2015-02-20 16:29:28 +0000
@@ -1317,7 +1317,7 @@
}
}
},
- getEventDueDate: function(eventsPerStage, programStage, enrollment){
+ getEventDueDate: function(eventsByStage, programStage, enrollment){
var referenceDate = enrollment.dateOfIncident ? enrollment.dateOfIncident : enrollment.dateOfEnrollment,
offset = programStage.minDaysFromStart,
calendarSetting = CalendarService.getSetting();
@@ -1327,16 +1327,16 @@
}
if(programStage.repeatable){
- /*var eventsPerStage = [];
- angular.forEach(events, function(event){
- if(event.programStage === programStage.id){
- eventsPerStage.push(event);
+ var evs = [];
+ angular.forEach(eventsByStage, function(ev){
+ if(ev.eventDate){
+ evs.push(ev);
}
- });*/
-
- if(eventsPerStage.length > 0){
- eventsPerStage = orderByFilter(eventsPerStage, '-eventDate');
- referenceDate = eventsPerStage[0].eventDate;
+ });
+
+ if(evs.length > 0){
+ evs = orderByFilter(evs, '-eventDate');
+ referenceDate = evs[0].eventDate;
offset = programStage.standardInterval;
}
}