dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31429
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16003: tracker capture - report, WIP
------------------------------------------------------------
revno: 16003
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Mon 2014-07-07 17:04:56 +0200
message:
tracker capture - report, WIP
added:
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/report-controller.js
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/report.html
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/teiReport.html
modified:
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets-controller.js
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/widgets.html
--
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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2014-07-07 11:46:45 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2014-07-07 15:04:56 +0000
@@ -17,9 +17,10 @@
//dashboard items
$rootScope.biggerDashboardWidgets = [];
- $rootScope.smallerDashboardWidgets = [];//{bigger: [], smaller: []};
+ $rootScope.smallerDashboardWidgets = [];
$rootScope.enrollmentWidget = {title: 'enrollment', view: "components/enrollment/enrollment.html", show: true, expand: true};
$rootScope.dataentryWidget = {title: 'dataentry', view: "components/dataentry/dataentry.html", show: true, expand: true};
+ $rootScope.reportWidget = {title: 'report', view: "components/report/teiReport.html", show: true, expand: true};
$rootScope.selectedWidget = {title: 'current_selections', view: "components/selected/selected.html", show: false, expand: true};
$rootScope.profileWidget = {title: 'profile', view: "components/profile/profile.html", show: true, expand: true};
$rootScope.relationshipWidget = {title: 'relationships', view: "components/relationship/relationship.html", show: true, expand: true};
@@ -27,6 +28,7 @@
$rootScope.biggerDashboardWidgets.push($rootScope.enrollmentWidget);
$rootScope.biggerDashboardWidgets.push($rootScope.dataentryWidget);
+ $rootScope.biggerDashboardWidgets.push($rootScope.reportWidget);
$rootScope.smallerDashboardWidgets.push($rootScope.selectedWidget);
$rootScope.smallerDashboardWidgets.push($rootScope.profileWidget);
$rootScope.smallerDashboardWidgets.push($rootScope.relationshipWidget);
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets-controller.js 2014-06-19 15:27:17 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets-controller.js 2014-07-07 15:04:56 +0000
@@ -7,6 +7,6 @@
TranslationService.translate();
$scope.close = function () {
- $modalInstance.close($scope.eventGridColumns);
+ $modalInstance.close();
};
});
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2014-07-07 11:46:45 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2014-07-07 15:04:56 +0000
@@ -53,7 +53,7 @@
$scope.getEvents = function(){
$scope.dhis2Events = '';
- DHIS2EventFactory.getEvents($scope.selectedEntity.trackedEntityInstance, $scope.selectedOrgUnit.id, $scope.selectedProgram.id, 'ACTIVE').then(function(data){
+ DHIS2EventFactory.getEventsByStatus($scope.selectedEntity.trackedEntityInstance, $scope.selectedOrgUnit.id, $scope.selectedProgram.id, 'ACTIVE').then(function(data){
$scope.dhis2Events = data;
if(angular.isObject($scope.dhis2Events)){
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html 2014-07-07 11:46:45 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html 2014-07-07 15:04:56 +0000
@@ -13,7 +13,7 @@
</span>
</div>
<div ng-show="notesWidget.expand" class="panel-body dashboard-widget-container">
-
+
<div class="add-note" ng-show="addNoteField">
<textarea class="form-control" rows="3" ng-model="note" placeholder="{{'add_your_note_here'| translate}}"></textarea>
<button type="button"
@@ -27,32 +27,27 @@
{{'cancel'| translate}}
</button>
</div>
-
+
<div ng-show='selectedEnrollment' class='remove-default-padding'>
<table class="table table-with-fixed-layout">
<tr ng-repeat="note in selectedEnrollment.notes| filter:noteSearchText">
<td class="over-flow-hidden">
- <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
- <div>{{note.value}}</div>
- </d2-pop-over>
- <script type="text/ng-template" id="note.html">
- <p>{{content.value}}</p>
- <hr>
- <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
- <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>
- </script>
- </td>
+ <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
+ <div>{{note.value}}</div>
+ </d2-pop-over>
+ <script type="text/ng-template" id="note.html">
+ <p>{{content.value}}</p>
+ <hr>
+ <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
+ <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>
+ </script>
+ </td>
</tr>
</table>
</div>
- <div ng-show="!selectedEnrollment">
- <div class="alert alert-warning vertical-spacing">{{'not_yet_enrolled_note'| translate}}</div>
- </div>
- <div ng-show="selectedEnrollment && !selectedEnrollment.notes">
- <div class="alert alert-info">{{'empty_notes'| translate}}</div>
- </div>
-
+ <div ng-show="!selectedEnrollment" class="alert alert-warning">{{'not_yet_enrolled_note'| translate}}</div>
+ <div ng-show="selectedEnrollment && !selectedEnrollment.notes" class="alert alert-info">{{'empty_notes'| translate}}</div>
</div>
</div>
\ No newline at end of file
=== added directory 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report'
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/report-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/report-controller.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/report-controller.js 2014-07-07 15:04:56 +0000
@@ -0,0 +1,95 @@
+trackerCapture.controller('ReportController',
+ function($scope,
+ CurrentSelection,
+ storage,
+ DateUtils,
+ EventUtils,
+ TranslationService,
+ DHIS2EventFactory) {
+
+ TranslationService.translate();
+
+ $scope.ouModes = [{name: 'SELECTED'},
+ {name: 'CHILDREN'},
+ {name: 'DESCENDANTS'},
+ {name: 'ACCESSIBLE'}
+ ];
+ $scope.selectedOuMode = $scope.ouModes[0];
+
+ $scope.$on('dashboard', function(event, args) {
+ var selections = CurrentSelection.get();
+ $scope.selectedOrgUnit = storage.get('SELECTED_OU');
+ $scope.selectedEntity = selections.tei;
+ $scope.selectedProgram = selections.pr;
+ $scope.selectedEnrollment = selections.enrollment;
+
+ if($scope.selectedOrgUnit &&
+ $scope.selectedProgram &&
+ $scope.selectedEntity &&
+ $scope.selectedEnrollment){
+
+ $scope.getEvents();
+ }
+ });
+
+ $scope.getEvents = function(){
+
+ $scope.dhis2Events = '';
+ $scope.dataExists = false;
+ DHIS2EventFactory.getEventsByProgram($scope.selectedEntity.trackedEntityInstance, $scope.selectedOrgUnit.id, $scope.selectedProgram.id).then(function(data){
+ $scope.dhis2Events = data;
+ if(!angular.isUndefined($scope.dhis2Events) ){
+ for(var i=0; i<$scope.dhis2Events.length && !$scope.dataExists; i++){
+ if(!angular.isUndefined($scope.dhis2Events[i].dataValues)){
+ $scope.dataExists = true;
+ }
+ }
+ }
+ });
+ };
+})
+
+//conroller for tei report
+.controller('TeiReportController',
+ function($scope,
+ CurrentSelection,
+ storage,
+ DateUtils,
+ EventUtils,
+ TranslationService,
+ DHIS2EventFactory) {
+
+ TranslationService.translate();
+
+ $scope.$on('dashboard', function(event, args) {
+ var selections = CurrentSelection.get();
+ $scope.selectedOrgUnit = storage.get('SELECTED_OU');
+ $scope.selectedEntity = selections.tei;
+ $scope.selectedProgram = selections.pr;
+ $scope.selectedEnrollment = selections.enrollment;
+
+ if($scope.selectedOrgUnit &&
+ $scope.selectedProgram &&
+ $scope.selectedEntity &&
+ $scope.selectedEnrollment){
+
+ $scope.getEvents();
+ }
+ });
+
+ $scope.getEvents = function(){
+
+ $scope.dhis2Events = '';
+ $scope.dataExists = false;
+ DHIS2EventFactory.getEventsByProgram($scope.selectedEntity.trackedEntityInstance, $scope.selectedOrgUnit.id, $scope.selectedProgram.id).then(function(data){
+ $scope.dhis2Events = data;
+ if(!angular.isUndefined($scope.dhis2Events) ){
+ for(var i=0; i<$scope.dhis2Events.length && !$scope.dataExists; i++){
+ if(!angular.isUndefined($scope.dhis2Events[i].dataValues)){
+ $scope.dataExists = true;
+ }
+ }
+ }
+ });
+ };
+});
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/report.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/report.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/report.html 2014-07-07 15:04:56 +0000
@@ -0,0 +1,57 @@
+<div class="bordered-div" ng-controller="ReportController">
+
+ <div class="report-container">
+ <form name="outerForm" novalidate>
+ <h3>{{selectedProgram.name}} {{'report'| translate}}</h3>
+ <hr>
+ <table class="table-borderless">
+ <tr>
+ <td>{{'org_unit'| translate}}</td>
+ <td>
+ <label><input type="radio" ng-model="selectedOuMode.name" name="selected" value="SELECTED"> {{'SELECTED'| translate}}</label><br/>
+ <label><input type="radio" ng-model="selectedOuMode.name" name="children" value="CHILDREN"> {{'CHILDREN'| translate}}</label><br/>
+ <label><input type="radio" ng-model="selectedOuMode.name" name="descendants" value="DESCENDANTS"> {{'DESCENDANTS'| translate}}</label><br/>
+ <label><input type="radio" ng-model="selectedOuMode.name" name="accessible" value="ACCESSIBLE"> {{'ACCESSIBLE'| translate}}</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="text" name="startDate" placeholder="{{'start_date'| translate}}" class="form-control" ng-date ng-model="startDate" ng-required="true"/>
+ </td>
+ <td>
+ <input type="text" name="endDate" placeholder="{{'end_date'| translate}}" class="form-control" ng-date ng-model="endDate" ng-required="true"/>
+ </td>
+ </tr>
+ </table>
+ <div class="row col-md-12 vertical-spacing">
+ <button type="button" class="btn btn-primary" ng-click="generateReport()">{{'generate'| translate}}</button>
+ <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="showReport()">{{'close'| translate}}</button>
+ </div>
+ </form>
+ <!--<h3>{{selectedProgram.name}} {{'report'| translate}}</h3>
+ <hr>
+ <table class="table-borderless">
+ <tr>
+ <td>{{'org_unit'| translate}}</td>
+ <td>
+ <label><input type="radio" ng-model="selectedOuMode.name" name="selected" value="SELECTED"> {{'SELECTED'| translate}}</label><br/>
+ <label><input type="radio" ng-model="selectedOuMode.name" name="children" value="CHILDREN"> {{'CHILDREN'| translate}}</label><br/>
+ <label><input type="radio" ng-model="selectedOuMode.name" name="descendants" value="DESCENDANTS"> {{'DESCENDANTS'| translate}}</label><br/>
+ <label><input type="radio" ng-model="selectedOuMode.name" name="accessible" value="ACCESSIBLE"> {{'ACCESSIBLE'| translate}}</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="text" name="startDate" placeholder="{{'start_date'| translate}}" class="form-control" ng-date ng-model="startDate" ng-required="true"/>
+ </td>
+ <td>
+ <input type="text" name="endDate" placeholder="{{'end_date'| translate}}" class="form-control" ng-date ng-model="endDate" ng-required="true"/>
+ </td>
+ </tr>
+ </table>
+ <div class="row col-md-12 vertical-spacing">
+ <button type="button" class="btn btn-primary" ng-click="generateReport()">{{'generate'| translate}}</button>
+ <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="showReport()">{{'close'| translate}}</button>
+ </div>-->
+ </div>
+</div>
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/teiReport.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/teiReport.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/report/teiReport.html 2014-07-07 15:04:56 +0000
@@ -0,0 +1,18 @@
+<div class="panel panel-default" ng-controller="TeiReportController">
+ <div class="panel-heading handle bold">
+ {{reportWidget.title| translate}}
+ <span class="pull-right">
+ <a class="small-horizonal-spacing" href ng-click="expandCollapse(reportWidget)">
+ <span ng-show="reportWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span>
+ <span ng-show="!reportWidget.expand"><i class="fa fa-chevron-down" title="{{'expand'| translate}}"></i></span>
+ </a>
+ <a class="small-horizonal-spacing" href ng-click="removeWidget(reportWidget)" title="{{'remove'| translate}}"><i class="fa fa-times-circle"></i></a>
+ </span>
+ </div>
+ <div ng-show="reportWidget.expand" class="panel-body dashboard-widget-container">
+
+ <div ng-if="!dataExists && selectedEnrollment" class="alert alert-warning">{{'no_data_report'| translate}}</div>
+ <div ng-if="!selectedEnrollment" class="alert alert-warning">{{'not_yet_enrolled_report'| translate}}</div>
+
+ </div>
+</div>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-07-07 11:46:45 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-07-07 15:04:56 +0000
@@ -11,6 +11,8 @@
"no_program_exists": "No program exists for the selected org unit. Enrollment not possible.",
"not_yet_enrolled_data_entry": "Not yet enrolled. Data entry not possible.",
"not_yet_enrolled_note": "Not yet enrolled. Note recording not possible.",
+ "not_yet_enrolled_report": "Not yet enrolled. Reporting not possible",
+ "no_data_report": "No record exists for reporting",
"empty_notes": "Empty notes list.",
"no_event_is_yet_created": "No event is available for data entry. Please create one from below.",
"event_creation": "Please create one from below",
@@ -86,6 +88,7 @@
"register_new": "Register new",
"search_from_existing": "Search from existing",
"dataentry": "Data Entry",
+ "report": "Report",
"current_selections": "Current selections",
"org_unit": "Organisation unit",
"SELECTED": "Selected",
@@ -102,6 +105,7 @@
"show_hide_widgets": "Show/hide widgets",
"select_widgets_to_show": "Select widgets to show",
"close": "Close",
+ "generate": "Generate",
"list_programs": "List programs",
"program_stage": "Program stage",
"due_date": "Due date",
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html 2014-07-07 11:46:45 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html 2014-07-07 15:04:56 +0000
@@ -69,6 +69,7 @@
<script type="text/javascript" src="components/registration/registration-controller.js"></script>
<script type="text/javascript" src="components/enrollment/enrollment-controller.js"></script>
<script type="text/javascript" src="components/dataentry/dataentry-controller.js"></script>
+ <script type="text/javascript" src="components/report/report-controller.js"></script>
<script type="text/javascript" src="components/selected/selected-controller.js"></script>
<script type="text/javascript" src="components/relationship/relationship-controller.js"></script>
<script type="text/javascript" src="components/profile/profile-controller.js"></script>
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-07-04 10:10:13 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-07-07 15:04:56 +0000
@@ -52,6 +52,9 @@
//Registration
$scope.showRegistrationDiv = false;
+ //Reporting
+ $scope.showReportDiv = false;
+
//watch for selection of org unit from tree
$scope.$watch('selectedOrgUnit', function() {
@@ -110,7 +113,7 @@
}
};
- $scope.getProgramAttributes = function(program, doSearch){
+ $scope.getProgramAttributes = function(program){
$scope.trackedEntityList = null;
$scope.selectedProgram = program;
@@ -136,9 +139,13 @@
});
}, 100);
});
- }
-
- if(doSearch){
+ }
+
+ if($scope.showRegistrationDiv || $scope.showReportDiv){
+ $scope.doSearch = false;
+ }
+
+ if($scope.doSearch){
$scope.search($scope.searchMode);
}
};
@@ -151,6 +158,7 @@
$scope.emptySearchAttribute = false;
//$scope.showSearchDiv = false;
$scope.showRegistrationDiv = false;
+ $scope.showReportDiv = false;
$scope.showTrackedEntityDiv = false;
$scope.trackedEntityList = null;
$scope.teiCount = null;
@@ -188,10 +196,10 @@
}
}
- $scope.doSearch();
+ $scope.fetchTeis();
};
- $scope.doSearch = function(){
+ $scope.fetchTeis = function(){
//get events for the specified parameters
TEIService.search($scope.selectedOrgUnit.id,
@@ -219,6 +227,7 @@
$scope.trackedEntityList = TEIGridService.format(data);
$scope.showTrackedEntityDiv = true;
$scope.teiFetched = true;
+ $scope.doSearch = true;
});
};
@@ -284,11 +293,22 @@
$scope.showRegistrationDiv = !$scope.showRegistrationDiv;
$scope.showTrackedEntityDiv = false;
$scope.showSearchDiv = false;
+
+ if(!$scope.showRegistrationDiv){
+ $scope.doSearch = true;
+ $scope.getProgramAttributes($scope.selectedProgram);
+ }
};
- $scope.hideSearch = function(){
- //$scope.showSearchDiv = false;
- //$rootScope.showAdvancedSearchDiv = false;
+ $scope.showReport = function(){
+ $scope.showReportDiv = !$scope.showReportDiv;
+ $scope.showTrackedEntityDiv = false;
+ $scope.showSearchDiv = false;
+
+ if(!$scope.showReportDiv){
+ $scope.doSearch = true;
+ $scope.getProgramAttributes($scope.selectedProgram);
+ }
};
$scope.showHideColumns = function(){
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-07-07 11:46:45 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-07-07 15:04:56 +0000
@@ -447,12 +447,18 @@
return {
- getEvents: function(entity, orgUnit, program, programStatus){
+ getEventsByStatus: function(entity, orgUnit, program, programStatus){
var promise = $http.get( '../api/events.json?' + 'trackedEntityInstance=' + entity + '&orgUnit=' + orgUnit + '&program=' + program + '&programStatus=' + programStatus + '&paging=false').then(function(response){
return response.data.events;
});
return promise;
},
+ getEventsByProgram: function(entity, orgUnit, program){
+ var promise = $http.get( '../api/events.json?' + 'trackedEntityInstance=' + entity + '&orgUnit=' + orgUnit + '&program=' + program + '&paging=false').then(function(response){
+ return response.data.events;
+ });
+ return promise;
+ },
get: function(eventUid){
var promise = $http.get('../api/events/' + eventUid + '.json').then(function(response){
return response.data;
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-07-07 11:46:45 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-07-07 15:04:56 +0000
@@ -594,7 +594,7 @@
overflow-y: scroll;
}
-.registration-container{
+.registration-container, report-container {
margin-top: 20px;
margin-bottom: 10px;
}
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html 2014-07-04 10:10:13 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html 2014-07-07 15:04:56 +0000
@@ -37,7 +37,7 @@
<input type="text" selected-org-unit ng-model="selectedOrgUnit.name" ng-hide=true>
<!--- selected org unit ends -->
- <!--- search and registration menu begins -->
+ <!--- search, registration and reporting menu begins -->
<div class="row">
<div id="selectDropDownParent" class="input-group col-md-3">
<button type="button" class="select-drop-down-button form-control" >{{selectedProgram ? selectedProgram.name : 'please_select_a_program'| translate}}</button>
@@ -45,15 +45,14 @@
<button class="btn btn-default trim" type="button" title="{{'list_programs'| translate}}" data-toggle="dropdown"><i class="fa fa-caret-down"></i></button>
<ul id="selectDropDown" class="dropdown-menu dropdown-menu-right">
<li>
- <a href ng-click="getProgramAttributes(null, true)">{{'please_select_a_program'| translate}}</a>
+ <a href ng-click="getProgramAttributes(null)">{{'please_select_a_program'| translate}}</a>
</li>
<li ng-repeat="program in programs| orderBy: 'name'">
- <a href ng-click="getProgramAttributes(program, true)">{{program.name}}</a>
+ <a href ng-click="getProgramAttributes(program)">{{program.name}}</a>
</li>
</ul>
</div>
</div>
-
<div id="searchDropDownParent" class="input-group col-md-5">
<input type="text" placeholder="{{'type_here_for_simple_search'| translate}}" ng-model="searchText" class="form-control expanded" ng-class="{true: 'invalid-input'} [!searchText && emptySearchText]" ng-focus="showHideSearch()" ng-disabled="showRegistrationDiv">
<div class="input-group-btn">
@@ -68,18 +67,25 @@
<div class="col-md-4 trim">
<button type="button"
class="btn btn-success"
- ng-disabled="showRegistrationDiv"
+ ng-disabled="showRegistrationDiv || showReportDiv"
ng-click="search(searchMode.listAll)">
{{'list_all'| translate}}
</button>
<button type="button"
- class="btn btn-primary small-horizonal-spacing"
+ class="btn btn-primary"
+ ng-disabled="showReportDiv"
ng-click="showRegistration()">
{{'register'| translate}} {{selectedProgram.trackedEntity.name}}
</button>
+ <button type="button"
+ class="btn btn-primary"
+ ng-disabled="showRegistrationDiv"
+ ng-click="showReport()">
+ {{'report'| translate}}
+ </button>
</div>
</div>
- <!--- search and registration menu ends -->
+ <!--- search, registration and reporting menu ends -->
<!--- Error display for search begins -->
<div class="row" ng-if="emptySearchAttribute || !searchText && emptySearchText">
@@ -96,6 +102,14 @@
</div>
</div>
<!-- registration form ends -->
+
+ <!--report div begins -->
+ <div class="row" ng-if="showReportDiv">
+ <div class="col-md-8">
+ <div ng-include="'components/report/report.html'"></div>
+ </div>
+ </div>
+ <!-- report div ends -->
<!-- entity grid begins -->
<div class="row" ng-if="showTrackedEntityDiv">
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/widgets.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/widgets.html 2014-04-04 11:55:55 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/widgets.html 2014-07-07 15:04:56 +0000
@@ -4,7 +4,7 @@
<div class="modal-body">
<table class="listTable dhis2-table-striped-border">
- <tr ng-repeat="biggerWidget in dashboardWidgets.bigger">
+ <tr ng-repeat="biggerWidget in biggerDashboardWidgets">
<td>
{{biggerWidget.title | translate}}
</td>
@@ -12,7 +12,7 @@
<input type="checkbox" ng-model="biggerWidget.show">
</td>
</tr>
- <tr ng-repeat="smallerWidget in dashboardWidgets.smaller">
+ <tr ng-repeat="smallerWidget in smallerDashboardWidgets">
<td>
{{smallerWidget.title | translate}}
</td>