- {{trackedEntity.name|| 'entity' | translate}} {{profileWidget.title| translate}}
+ {{trackedEntity.name || 'entity' | translate}} {{profileWidget.title| translate}}
| {{'edit'| translate}}
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-and-enrollment.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-and-enrollment.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-and-enrollment.html 2014-07-03 11:30:22 +0000
@@ -0,0 +1,102 @@
+
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-and-relationship.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-and-relationship.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-and-relationship.html 2014-07-03 11:30:22 +0000
@@ -0,0 +1,102 @@
+
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html 2014-07-02 16:25:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html 1970-01-01 00:00:00 +0000
@@ -1,102 +0,0 @@
-
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/add-relationship.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/add-relationship.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/add-relationship.html 2014-07-03 11:30:22 +0000
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
{{'a_is_to_b'| translate}} = {{selectedRelationshipType.aIsToB}}
+
{{'b_is_to_a'| translate}} = {{selectedRelationshipType.bIsToA}}
+
+
+
+
A
+
+
+
+
+ {{attribute.displayName}}
+ |
+
+ {{attribute.value}}
+ |
+
+
+
+
+
+
B
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js 2014-06-06 13:35:06 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js 2014-07-03 11:30:22 +0000
@@ -1,7 +1,65 @@
trackerCapture.controller('RelationshipController',
function($scope,
+ $modal,
+ CurrentSelection,
+ RelationshipFactory,
TranslationService) {
- TranslationService.translate();
-
+ TranslationService.translate();
+
+ $scope.relationshipTypes = [];
+
+ RelationshipFactory.getAll().then(function(rels){
+ $scope.relationshipTypes = rels;
+ });
+
+ //listen for the selected entity
+ $scope.$on('dashboard', function(event, args) {
+ var selections = CurrentSelection.get();
+ $scope.selectedTei = angular.copy(selections.tei);
+ $scope.trackedEntity = selections.te;
+ $scope.selectedProgram = selections.pr;
+ $scope.selectedEnrollment = selections.enrollment;
+
+ });
+
+ $scope.showAddRelationship = function() {
+
+ var modalInstance = $modal.open({
+ templateUrl: 'components/relationship/add-relationship.html',
+ controller: 'AddRelationshipController',
+ resolve: {
+ relationshipTypes: function () {
+ return $scope.relationshipTypes;
+ },
+ selectedTei: function(){
+ return $scope.selectedTei;
+ }
+ }
+ });
+
+ modalInstance.result.then(function (relationships) {
+ $scope.selectedTei.relationships = relationships;
+ });
+ };
+})
+
+//Controller for adding new relationship
+.controller('AddRelationshipController',
+ function($scope,
+ $modalInstance,
+ relationshipTypes,
+ selectedTei){
+
+ $scope.relationshipTypes = relationshipTypes;
+ $scope.selectedTei = selectedTei;
+ $scope.relationshipSources = ['search_from_existing','register_new'];
+
+ $scope.close = function () {
+ $modalInstance.close('');
+ };
+
+ $scope.add = function(){
+ console.log('I will add new relationship');
+ };
});
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html 2014-07-02 20:53:29 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html 2014-07-03 11:30:22 +0000
@@ -1,6 +1,9 @@
- This is relationships.
+
{{'no_relationship'| translate}}
+
{{'relationship_not_possible'| translate}}
+
+
+
\ 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-02 16:25:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-07-03 11:30:22 +0000
@@ -5,6 +5,9 @@
"please_select": "[Please select]",
"please_select_a_program": "[Please select a program]",
"please_select_a_program_for_enrollment": "Please select a program for enrollment.",
+ "please_select_a_relationship": "Please select a relationship",
+ "no_relationship": "No relationship exists.",
+ "relationship_not_possible": "No tracked entity instance, relationship not possible.",
"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.",
@@ -70,6 +73,13 @@
"enrollment_date": "Enrollment date",
"notes": "Notes",
"relationship": "Relationship",
+ "relationships": "Relationships",
+ "add_relationship": "Add relationship",
+ "a_is_to_b": "A is to B",
+ "b_is_to_a": "B is to A",
+ "please_select_source": "Please select source",
+ "register_new": "Register new",
+ "search_from_existing": "Search from existing",
"dataentry": "Data Entry",
"current_selections": "Current selections",
"org_unit": "Organisation unit",
=== 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-02 16:25:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-07-03 11:30:22 +0000
@@ -292,8 +292,6 @@
//$rootScope.showAdvancedSearchDiv = false;
};
-
-
$scope.showHideColumns = function(){
$scope.hiddenGridColumns = 0;
=== 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-02 21:21:15 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-07-03 11:30:22 +0000
@@ -33,8 +33,42 @@
};
})
+/* Factory to fetch relationships */
+.factory('RelationshipFactory', function($q, $rootScope, StorageService) {
+ return {
+ getAll: function(){
+
+ var def = $q.defer();
+
+ StorageService.currentStore.open().done(function(){
+ StorageService.currentStore.getAll('relationshipTypes').done(function(relationshipTypes){
+ $rootScope.$apply(function(){
+ def.resolve(relationshipTypes);
+ });
+ });
+ });
+
+ return def.promise;
+ },
+ get: function(uid){
+
+ var def = $q.defer();
+
+ StorageService.currentStore.open().done(function(){
+ StorageService.currentStore.get('relationshipTypes', uid).done(function(relationshipType){
+ $rootScope.$apply(function(){
+ def.resolve(relationshipType);
+ });
+ });
+ });
+ return def.promise;
+ }
+ };
+})
+
+
/* Factory to fetch programs */
-.factory('ProgramFactory', function($q, $rootScope, StorageService, ProgramStageFactory) {
+.factory('ProgramFactory', function($q, $rootScope, StorageService) {
return {
getAll: function(){
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js 2014-07-02 11:34:41 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js 2014-07-03 11:30:22 +0000
@@ -23,7 +23,7 @@
dhis2.tc.store = new dhis2.storage.Store({
name: TC_STORE_NAME,
adapters: [dhis2.storage.IndexedDBAdapter, dhis2.storage.DomSessionStorageAdapter, dhis2.storage.InMemoryAdapter],
- objectStores: ['trackerCapturePrograms', 'programStages', 'trackedEntities','attributes','optionSets']
+ objectStores: ['trackerCapturePrograms', 'programStages', 'trackedEntities', 'attributes', 'relationshipTypes', 'optionSets']
});
(function($) {
@@ -58,6 +58,7 @@
promise = promise.then( dhis2.tc.store.open );
promise = promise.then( getUserProfile );
+ promise = promise.then( getRelationships );
promise = promise.then( getAttributes );
promise = promise.then( getOptionSetsForAttributes );
promise = promise.then( getTrackedEntities );
@@ -186,6 +187,22 @@
return def.promise();
}
+
+function getRelationships()
+{
+ var def = $.Deferred();
+
+ $.ajax({
+ url: '../api/relationshipTypes.json?paging=false&fields=id,name,aIsToB,bIsToA,displayName',
+ type: 'GET'
+ }).done(function(response) {
+ dhis2.tc.store.setAll( 'relationshipTypes', response.relationshipTypes );
+ def.resolve();
+ });
+
+ return def.promise();
+}
+
function getAttributes()
{
var def = $.Deferred();
@@ -340,7 +357,7 @@
return $.ajax( {
url: '../api/programs.json',
type: 'GET',
- data: 'paging=false&filter=id:eq:' + id +'&fields=id,name,version,dateOfEnrollmentDescription,dateOfIncidentDescription,displayIncidentDate,ignoreOverdueEvents,realionshipText,trackedEntity[id,name,description],userRoles[id,name],organisationUnits[id,name],programStages[id,name,version,minDaysFromStart,reportDateDescription,repeatable],programTrackedEntityAttributes[displayInList,mandatory,attribute[id]]'
+ data: 'paging=false&filter=id:eq:' + id +'&fields=id,name,version,relationshipText,relationshipFromA,dateOfEnrollmentDescription,dateOfIncidentDescription,displayIncidentDate,ignoreOverdueEvents,realionshipText,trackedEntity[id,name,description],userRoles[id,name],organisationUnits[id,name],programStages[id,name,version,minDaysFromStart,reportDateDescription,repeatable],programTrackedEntityAttributes[displayInList,mandatory,attribute[id]]'
}).done( function( response ){
_.each( _.values( response.programs ), function ( program ) {
=== 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-03 11:15:13 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-07-03 11:30:22 +0000
@@ -362,6 +362,12 @@
margin-bottom: 20px;
}
+.bordered-div-compact {
+ border: 1px solid #c2c2c2;
+ border-radius: 5px;
+ padding: 5px;
+}
+
.nav, .pagination, .carousel, .panel-title a {
cursor: pointer;
text-decoration: none;
@@ -518,9 +524,7 @@
.container-1-1 {
width: 100%;
float: left;
- margin-top: 50px;
height: 100%;
- min-height: 100%;
}
.container-1-2 {
@@ -704,6 +708,7 @@
}
.modal-body {
position: relative;
+ font-size: 14px;
}
.modal-footer {
padding: 19px 20px 20px;
@@ -736,7 +741,7 @@
}
@media screen and (min-width: 768px) {
.modal-dialog {
- width: 600px;
+ width: 75%;
padding-top: 30px;
padding-bottom: 30px;
}
@@ -967,8 +972,8 @@
border-color: #d1d1d1;
}
-
.dropdown-menu-right{
right: 0;
left: auto;
-}
\ No newline at end of file
+}
+
=== 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-02 11:34:41 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html 2014-07-03 11:30:22 +0000
@@ -55,7 +55,7 @@