------------------------------------------------------------ revno: 15956 committer: Abyot Asalefew Gizaw aby...@gmail.com branch nick: dhis2 timestamp: Thu 2014-07-03 13:30:22 +0200 message: tracker capture - minor adustment in tei search buttons; relationship - WIP removed: dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html added: 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-relationship.html dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/add-relationship.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/profile/profile.html 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.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/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/scripts/tracker-capture.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/search.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-02 16:25:28 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2014-07-03 11:30:22 +0000 @@ -22,7 +22,7 @@ $rootScope.dataentryWidget = {title: 'dataentry', view: "components/dataentry/dataentry.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: 'relationship', view: "components/relationship/relationship.html", show: true, expand: true}; + $rootScope.relationshipWidget = {title: 'relationships', view: "components/relationship/relationship.html", show: true, expand: true}; $rootScope.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true, expand: true}; $rootScope.biggerDashboardWidgets.push($rootScope.enrollmentWidget); === modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html 2014-07-02 20:53:29 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html 2014-07-03 11:30:22 +0000 @@ -1,6 +1,6 @@ <div class="panel panel-default" ng-controller="ProfileController"> <div class="panel-heading handle bold"> - {{trackedEntity.name|| 'entity' | translate}} {{profileWidget.title| translate}} + {{trackedEntity.name || 'entity' | translate}} {{profileWidget.title| translate}} <span class="nav-pills" ng-show="selectedTei.attributes.length"> | <a href ng-click="enableEdit()" title="{{'edit_profile'| translate}}"><span class="bold">{{'edit'| translate}}</span></a> </span> === 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 @@ +<div class="bordered-div col-md-12" ng-controller="RegistrationController"> + <div class="registration-container"> + <form name="outerForm" novalidate> + + <div ng-if='!selectedProgram'> + <h3>{{'category' | translate}}</h3> + <table class="table-borderless table-striped"> + <tr> + <td> + {{'entity_type' | translate}} + </td> + <td> + <select class="form-control" ng-model="trackedEntities.selected" ng-options="trackedEntity.name for trackedEntity in trackedEntities.available | orderBy: 'name'"> + </select> + </td> + </tr> + </table> + <hr> + </div> + + <h3>{{'profile' | translate}}</h3> + <table class="table-borderless table-striped"> + <tr ng-repeat="attribute in attributes"> + <td> + {{attribute.name}} + </td> + <td> + <ng-form name="innerForm"> + <div ng-switch="attribute.valueType"> + <div ng-switch-when="date"> + <input type="text" name="foo" class="form-control" ng-date ng-model="attribute.value" ng-required="attribute.mandatory" /> + <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> + </div> + <div ng-switch-when="trueOnly"> + <input type="checkbox" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory" /> + <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> + </div> + <div ng-switch-when="bool"> + <select name="foo" ng-model="attribute.value" 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" class="error">{{'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" class="error">{{'required'| translate}}</span> + </div> + <div ng-switch-when="number"> + <input type="number" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/> + <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> + </div> + <div ng-switch-default> + <input type="text" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/> + <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> + </div> + </div> + </ng-form> + </td> + </tr> + </table> + + <div ng-if='selectedProgram'> + <hr> + <h3>{{'enrollment' | translate}}</h3> + <table class="dhis2-list-table-striped dhis2-table-hover"> + <tr> + <td> + {{selectedProgram.dateOfEnrollmentDescription}} + </td> + <td> + <input type="text" name="dateOfEnrollment" class="form-control" ng-date ng-model="enrollment.incidentDate" ng-required="true"/> + <span ng-show="outerForm.submitted && outerForm.dateOfEnrollment.$invalid" class="error">{{'required'| translate}}</span> + </td> + </tr> + <tr ng-if="selectedProgram.displayIncidentDate"> + <td> + {{selectedProgram.dateOfIncidentDescription}} + </td> + <td> + <input type="text" class="form-control" ng-date ng-model="enrollment.enrollmentDate" /> + </td> + </tr> + </table> + </div> + + <div class="vertical-spacing"> + <button type="button" class="btn btn-primary" ng-click="registerEntity(true)">{{'save_and_continue'| translate}}</button> + <button type="button" class="btn btn-success small-horizonal-spacing" ng-click="registerEntity(false)">{{'save_and_add_new'| translate}}</button> + <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="showRegistration()">{{'cancel'| translate}}</button> + </div> + </form> + </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/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 @@ +<div class="bordered-div col-md-12" ng-controller="RegistrationController"> + <div class="registration-container"> + <form name="outerForm" novalidate> + + <div ng-if='!selectedProgram'> + <h3>{{'category' | translate}}</h3> + <table class="table-borderless table-striped"> + <tr> + <td> + {{'entity_type' | translate}} + </td> + <td> + <select class="form-control" ng-model="trackedEntities.selected" ng-options="trackedEntity.name for trackedEntity in trackedEntities.available | orderBy: 'name'"> + </select> + </td> + </tr> + </table> + <hr> + </div> + + <h3>{{'profile' | translate}}</h3> + <table class="table-borderless table-striped"> + <tr ng-repeat="attribute in attributes"> + <td> + {{attribute.name}} + </td> + <td> + <ng-form name="innerForm"> + <div ng-switch="attribute.valueType"> + <div ng-switch-when="date"> + <input type="text" name="foo" class="form-control" ng-date ng-model="attribute.value" ng-required="attribute.mandatory" /> + <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> + </div> + <div ng-switch-when="trueOnly"> + <input type="checkbox" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory" /> + <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> + </div> + <div ng-switch-when="bool"> + <select name="foo" ng-model="attribute.value" 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" class="error">{{'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" class="error">{{'required'| translate}}</span> + </div> + <div ng-switch-when="number"> + <input type="number" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/> + <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> + </div> + <div ng-switch-default> + <input type="text" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/> + <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> + </div> + </div> + </ng-form> + </td> + </tr> + </table> + + <div ng-if='selectedProgram'> + <hr> + <h3>{{'enrollment' | translate}}</h3> + <table class="dhis2-list-table-striped dhis2-table-hover"> + <tr> + <td> + {{selectedProgram.dateOfEnrollmentDescription}} + </td> + <td> + <input type="text" name="dateOfEnrollment" class="form-control" ng-date ng-model="enrollment.incidentDate" ng-required="true"/> + <span ng-show="outerForm.submitted && outerForm.dateOfEnrollment.$invalid" class="error">{{'required'| translate}}</span> + </td> + </tr> + <tr ng-if="selectedProgram.displayIncidentDate"> + <td> + {{selectedProgram.dateOfIncidentDescription}} + </td> + <td> + <input type="text" class="form-control" ng-date ng-model="enrollment.enrollmentDate" /> + </td> + </tr> + </table> + </div> + + <div class="vertical-spacing"> + <button type="button" class="btn btn-primary" ng-click="registerEntity(true)">{{'save_and_continue'| translate}}</button> + <button type="button" class="btn btn-success small-horizonal-spacing" ng-click="registerEntity(false)">{{'save_and_add_new'| translate}}</button> + <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="showRegistration()">{{'cancel'| translate}}</button> + </div> + </form> + </div> +</div> \ 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 @@ -<div class="bordered-div col-md-12" ng-controller="RegistrationController"> - <div class="registration-container"> - <form name="outerForm" novalidate> - - <div ng-if='!selectedProgram'> - <h3>{{'category' | translate}}</h3> - <table class="table-borderless table-striped"> - <tr> - <td> - {{'entity_type' | translate}} - </td> - <td> - <select class="form-control" ng-model="trackedEntities.selected" ng-options="trackedEntity.name for trackedEntity in trackedEntities.available | orderBy: 'name'"> - </select> - </td> - </tr> - </table> - <hr> - </div> - - <h3>{{'profile' | translate}}</h3> - <table class="table-borderless table-striped"> - <tr ng-repeat="attribute in attributes"> - <td> - {{attribute.name}} - </td> - <td> - <ng-form name="innerForm"> - <div ng-switch="attribute.valueType"> - <div ng-switch-when="date"> - <input type="text" name="foo" class="form-control" ng-date ng-model="attribute.value" ng-required="attribute.mandatory" /> - <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> - </div> - <div ng-switch-when="trueOnly"> - <input type="checkbox" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory" /> - <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> - </div> - <div ng-switch-when="bool"> - <select name="foo" ng-model="attribute.value" 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" class="error">{{'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" class="error">{{'required'| translate}}</span> - </div> - <div ng-switch-when="number"> - <input type="number" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/> - <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> - </div> - <div ng-switch-default> - <input type="text" name="foo" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/> - <span ng-show="outerForm.submitted && innerForm.foo.$invalid" class="error">{{'required'| translate}}</span> - </div> - </div> - </ng-form> - </td> - </tr> - </table> - - <div ng-if='selectedProgram'> - <hr> - <h3>{{'enrollment' | translate}}</h3> - <table class="dhis2-list-table-striped dhis2-table-hover"> - <tr> - <td> - {{selectedProgram.dateOfEnrollmentDescription}} - </td> - <td> - <input type="text" name="dateOfEnrollment" class="form-control" ng-date ng-model="enrollment.incidentDate" ng-required="true"/> - <span ng-show="outerForm.submitted && outerForm.dateOfEnrollment.$invalid" class="error">{{'required'| translate}}</span> - </td> - </tr> - <tr ng-if="selectedProgram.displayIncidentDate"> - <td> - {{selectedProgram.dateOfIncidentDescription}} - </td> - <td> - <input type="text" class="form-control" ng-date ng-model="enrollment.enrollmentDate" /> - </td> - </tr> - </table> - </div> - - <div class="vertical-spacing"> - <button type="button" class="btn btn-primary" ng-click="registerEntity(true)">{{'save_and_continue'| translate}}</button> - <button type="button" class="btn btn-success small-horizonal-spacing" ng-click="registerEntity(false)">{{'save_and_add_new'| translate}}</button> - <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="showRegistration()">{{'cancel'| translate}}</button> - </div> - </form> - </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/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 @@ +<div class="modal-header page"> + <h2>{{'add_relationship'| translate}}</h2> +</div> +<div class="modal-body"> + <div class='row'> + <div class='col-md-12'> + <select ng-model="selectedRelationshipType" + class="form-control" + ng-options="relationshipType as relationshipType.name for relationshipType in relationshipTypes | orderBy: 'name'"> + <option value="">{{'please_select_a_relationship'| translate}}</option> + </select> + </div> + </div> + + <div class="row" ng-show="selectedRelationshipType"> + <hr> + <div class="col-md-12"> + <p>{{'a_is_to_b'| translate}} = {{selectedRelationshipType.aIsToB}}</p> + <p>{{'b_is_to_a'| translate}} = {{selectedRelationshipType.bIsToA}}</p> + </div> + <div class="row col-md-12"> + <div class="col-md-5"> + <h3 class='align-center'>A</h3> + <div class='bordered-div-compact'> + <table class="table table-striped table-borderless"> + <tr ng-repeat="attribute in selectedTei.attributes"> + <td> + {{attribute.displayName}} + </td> + <td> + {{attribute.value}} + </td> + </tr> + </table> + </div> + </div> + <div class="col-md-7"> + <h3 class='align-center'>B</h3> + <div class='bordered-div-compact'> + <select ng-model="selectedRelationshipSource" + class="form-control" + ng-options="relationshipSource | translate for relationshipSource in relationshipSources"> + <option value="">{{'please_select_source'| translate}}</option> + </select> + + <div id="searchDropDownParent" class="input-group vertical-spacing" ng-show="selectedRelationshipSource === 'search_from_existing' "> + <input type="text" placeholder="{{'search_from_existing'| translate}}" ng-model="searchText" class="form-control expanded" ng-class="{true: 'invalid - input'} [!searchText && emptySearchText]" ng-focus="showHideSearch()"> + <div class="input-group-btn"> + <button class="btn btn-default without-border-radius trim" type="button" title="{{'advanced_search'| translate}}" data-toggle="dropdown" ng-click="showHideSearch()"><i class="fa fa-caret-down"></i></button> + <button class="btn btn-primary trim" type="button" title="{{'search'| translate}}" ng-click="search(searchMode.freeText)"><i class="fa fa-search"></i></button> + <div id="searchDropDown" class="dropdown-menu dropdown-menu-right"> + <form ng-include="'views/search.html'"> + </form> + </div> + </div> + </div> + <div ng-show="selectedRelationshipSource === 'register_new' "> + <div ng-include="'components/registration/registration.html'"></div> + </div> + </div> + </div> + </div> + </div> + +</div> +<div class="modal-footer"> + <button class="btn btn-primary trim" data-ng-click="add()" >{{'add'| translate}}</button> + <button class="btn btn-default" data-ng-click="close()">{{'close'| translate}}</button> +</div> \ 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 @@ <div class="panel panel-default" ng-controller="RelationshipController"> <div class="panel-heading handle bold"> {{relationshipWidget.title| translate}} + <span class="nav-pills" ng-show="selectedTei"> + | <a href ng-click="showAddRelationship()" title="{{'add_relationship'| translate}}"><span class="bold">{{'add'| translate}}</span></a> + </span> <span class="pull-right"> <a class="small-horizonal-spacing" href ng-click="expandCollapse(relationshipWidget)"> <span ng-show="relationshipWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span> @@ -10,6 +13,14 @@ </span> </div> <div ng-show="relationshipWidget.expand" class="panel-body dashboard-element-container"> - This is relationships. + <div ng-show="selectedTei && !selectedTei.relationships" class="alert alert-info">{{'no_relationship'| translate}}</div> + <div ng-show="!selectedTei" class="alert alert-info">{{'relationship_not_possible'| translate}}</div> + <div ng-show="showAddRelationshipDiv"> + <select ng-model="selectedRelationshipType" + class="form-control" + ng-options="relationshipType as relationshipType.name for relationshipType in relationshipTypes | orderBy: 'name'"> + <option value="">{{'please_select_a_relationship'| translate}}</option> + </select> + </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-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 @@ </div> <div id="searchDropDownParent" class="input-group col-md-5"> - <input type="text" placeholder="{{'type_your_search_criteria_here'| translate}}" ng-model="searchText" class="form-control expanded" ng-class="{true: 'invalid - input'} [!searchText && emptySearchText]" ng-focus="showHideSearch()" ng-disabled="showRegistrationDiv"> + <input type="text" placeholder="{{'type_your_search_criteria_here'| 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"> <button class="btn btn-default without-border-radius trim" type="button" title="{{'advanced_search'| translate}}" data-toggle="dropdown" ng-click="showHideSearch()" ng-disabled="showRegistrationDiv"><i class="fa fa-caret-down"></i></button> <button class="btn btn-primary trim" type="button" title="{{'search'| translate}}" ng-disabled="showRegistrationDiv" ng-click="search(searchMode.freeText)"><i class="fa fa-search"></i></button> @@ -92,7 +92,7 @@ <!--registration form begins --> <div class="row" ng-if="showRegistrationDiv"> <div class="col-md-8"> - <div ng-include="'components/registration/registration.html'"></div> + <div ng-include="'components/registration/registration-and-enrollment.html'"></div> </div> </div> <!-- registration form ends --> === modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html 2014-07-02 16:25:28 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html 2014-07-03 11:30:22 +0000 @@ -1,5 +1,5 @@ -<div class="search-container"> - +<div class="container-1-1"> + <div class="search-container"> <table data-stop-propagation="true" class="table-borderless table-striped"> <tr> <td>{{'org_unit'| translate}}</td> @@ -86,14 +86,16 @@ </div> <div ng-switch-when="bool"> <select multiple ui-select2 ng-model="attribute.value" data-placeholder="{{'please_select'| translate}}" style="width:100%;"> - <option ng-repeat="option in boolOperators" value="{{option}}">{{option | translate}}</option> + <option ng-repeat="option in boolOperators" value="{{option}}">{{option| translate}}</option> </select> </div> </div> </td> </tr> </table> + </div> + <div class="horizonal-spacing"> <button type="button" class="btn btn-primary" ng-click="search(searchMode.attributeBased)"> @@ -109,5 +111,5 @@ ng-click="showHideSearch()"> {{'cancel'| translate}} </button> - + </div> </div> \ No newline at end of file
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp