dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #32673
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16656: tracker capture - UI for marking enrollments for followup
------------------------------------------------------------
revno: 16656
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-09-08 15:35:02 +0200
message:
tracker capture - UI for marking enrollments for followup
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/en.json
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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java 2014-09-08 11:29:51 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java 2014-09-08 13:35:02 +0000
@@ -170,7 +170,6 @@
}
@JsonProperty
- @JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public Boolean getFollowup()
{
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2014-08-25 13:40:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2014-09-08 13:35:02 +0000
@@ -28,7 +28,6 @@
$scope.hasEnrollmentHistory = false;
$scope.selectedEnrollment = null;
$scope.newEnrollment = {};
- $scope.eventsForRescheduling = [];
var selections = CurrentSelection.get();
$scope.selectedTei = angular.copy(selections.tei);
$scope.selectedEntity = selections.te;
@@ -40,6 +39,7 @@
if($scope.selectedProgram){
EnrollmentService.getByEntityAndProgram($scope.selectedTei.trackedEntityInstance, $scope.selectedProgram.id).then(function(data){
$scope.enrollments = data.enrollments;
+ console.log('List of enrollments: ', $scope.enrollments);
$scope.loadEnrollmentDetails();
});
}
@@ -109,6 +109,7 @@
}
}
+ console.log('The enrollment is: ', $scope.selectedEnrollment);
$scope.broadCastSelections('dashboardWidgets');
};
@@ -240,7 +241,7 @@
ModalService.showModal({}, modalOptions).then(function(result){
- EnrollmentService.cancelled($scope.selectedEnrollment).then(function(data){
+ EnrollmentService.cancel($scope.selectedEnrollment).then(function(data){
$scope.selectedEnrollment.status = 'CANCELLED';
$scope.loadEnrollmentDetails();
});
@@ -258,7 +259,7 @@
ModalService.showModal({}, modalOptions).then(function(result){
- EnrollmentService.completed($scope.selectedEnrollment).then(function(data){
+ EnrollmentService.complete($scope.selectedEnrollment).then(function(data){
$scope.selectedEnrollment.status = 'COMPLETED';
$scope.loadEnrollmentDetails();
});
@@ -293,4 +294,9 @@
}
}
};
+
+ $scope.markForFollowup = function(){
+ EnrollmentService.update($scope.selectedEnrollment).then(function(data){
+ });
+ };
});
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html 2014-09-05 12:52:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html 2014-09-08 13:35:02 +0000
@@ -8,9 +8,6 @@
<span class="nav-pills" ng-show="terminatedEnrollments.length > 0 || completedEnrollments.length > 0">
| <a href ng-click="showEnrollmentHistory()" title="{{'history'| translate}}"><span class="bold">{{'history'| translate}}</span></a>
</span>
- <span class="nav-pills" ng-show="eventsForRescheduling.length > 0">
- | <a href ng-click="showReScheduling()" title="{{'rescheduling'| translate}}"><span class="bold">{{'rescheduling'| translate}}</span></a>
- </span>
<span class="pull-right">
<a class="small-horizonal-spacing" href ng-click="expandCollapse(enrollmentWidget)">
<span ng-show="enrollmentWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span>
@@ -39,18 +36,29 @@
<input type="text" placeholder="yyyy-mm-dd" class="form-control" ng-date ng-model="selectedEnrollment.dateOfIncident" ng-disabled="true"/>
</td>
</tr>
- </table>
- <div class="vertical-spacing small-horizonal-spacing">
+ </table>
+
+
+ <div class="vertical-spacing horizonal-spacing">
+
<button type="button"
class="btn btn-primary"
ng-click="completeEnrollment()">
{{'complete'| translate}}
</button>
<button type="button"
- class="btn btn-warning"
+ class="btn btn-danger"
ng-click="terminateEnrollment()">
{{'terminate'| translate}}
</button>
+
+
+ <span class='small-horizonal-spacing'>
+ <label>
+ {{'mark_for_followup' | translate}} <input type="checkbox" ng-change="markForFollowup()" ng-model="selectedEnrollment.followup"/>
+ </label>
+ </span>
+
</div>
</div>
<!-- operations on selected enrollment ends -->
@@ -94,46 +102,46 @@
{{attribute.name}}
</td>
<td class="col-md-6">
- <ng-form name="innerForm">
- <div ng-switch="attribute.valueType">
- <div ng-switch-when="date">
- <input type="text" placeholder="yyyy-mm-dd" class="form-control" name="foo" ng-date ng-model="attribute.value" ng-required="attribute.mandatory"/>
- <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
- </div>
- <div ng-switch-when="trueOnly">
- <input type="checkbox" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
- <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
- </div>
- <div ng-switch-when="bool">
- <select ng-model="attribute.value" name="foo" class="form-control" ng-required="attribute.mandatory">
- <option value="">{{'please_select'| translate}}</option>
- <option value="0">{{'no'| translate}}</option>
- <option value="1">{{'yes'| translate}}</option>
- </select>
- <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
- </div>
- <div ng-switch-when="optionSet">
- <input type="text"
- name="foo"
- class="form-control"
- ng-model="attribute.value"
- typeahead="option for option in attribute.optionSet.options | filter:$viewValue | limitTo:20"
- typeahead-open-on-focus
- ng-required="attribute.mandatory"
- />
- <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
- </div>
- <div ng-switch-when="number">
- <input type="number" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
- <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
- </div>
- <div ng-switch-default>
- <input type="text" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
- <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
- </div>
- </div>
- </ng-form>
- </td>
+ <ng-form name="innerForm">
+ <div ng-switch="attribute.valueType">
+ <div ng-switch-when="date">
+ <input type="text" placeholder="yyyy-mm-dd" class="form-control" name="foo" ng-date ng-model="attribute.value" ng-required="attribute.mandatory"/>
+ <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
+ </div>
+ <div ng-switch-when="trueOnly">
+ <input type="checkbox" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
+ <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
+ </div>
+ <div ng-switch-when="bool">
+ <select ng-model="attribute.value" name="foo" class="form-control" ng-required="attribute.mandatory">
+ <option value="">{{'please_select'| translate}}</option>
+ <option value="0">{{'no'| translate}}</option>
+ <option value="1">{{'yes'| translate}}</option>
+ </select>
+ <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
+ </div>
+ <div ng-switch-when="optionSet">
+ <input type="text"
+ name="foo"
+ class="form-control"
+ ng-model="attribute.value"
+ typeahead="option for option in attribute.optionSet.options | filter:$viewValue | limitTo:20"
+ typeahead-open-on-focus
+ ng-required="attribute.mandatory"
+ />
+ <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
+ </div>
+ <div ng-switch-when="number">
+ <input type="number" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
+ <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
+ </div>
+ <div ng-switch-default>
+ <input type="text" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
+ <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
+ </div>
+ </div>
+ </ng-form>
+ </td>
</tr>
</table>
<div class="vertical-spacing col-md-12">
@@ -146,7 +154,7 @@
class="btn btn-default"
ng-click="showNewEnrollment()">
{{'cancel'| translate}}
- </button>
+ </button>
</div>
</div>
</form>
@@ -157,7 +165,7 @@
enrollment history here...
</div>
<!-- operations on historical enrollment ends -->
-
+
<div ng-if="selectedProgram && !selectedEnrollment && !showEnrollmentDiv && !hasEnrollmentHistory">
<div class="alert alert-warning">{{'not_yet_enrolled_enrollment'| translate}}</div>
</div>
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-09-05 12:52:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-09-08 13:35:02 +0000
@@ -131,7 +131,7 @@
"report": "Report",
"_report": "report",
"visit_schedule": "Visit Schedule",
- "lost_to_followup": "Lost to Follow-up",
+ "mark_for_followup": "Mark for followup",
"registered_data": "Registered data",
"no_data_found": "No data found",
"no_data": "No data",
=== 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 2014-09-07 08:30:29 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-09-08 13:35:02 +0000
@@ -236,13 +236,13 @@
});
return promise;
},
- cancelled: function(enrollment){
+ cancel: function(enrollment){
var promise = $http.put('../api/enrollments/' + enrollment.enrollment + '/cancelled').then(function(response){
return response.data;
});
return promise;
},
- completed: function(enrollment){
+ complete: function(enrollment){
var promise = $http.put('../api/enrollments/' + enrollment.enrollment + '/completed').then(function(response){
return response.data;
});