dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #42545
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21756: Added fix to prevent the display of audit icon when registering a new event
------------------------------------------------------------
revno: 21756
committer: jijukjose <jijukjose@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-01-15 14:38:46 +0100
message:
Added fix to prevent the display of audit icon when registering a new event
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.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/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html 2016-01-13 17:09:07 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html 2016-01-15 13:38:46 +0000
@@ -46,24 +46,24 @@
<script type="text/javascript" src="../dhis-web-commons/javascripts/moment/moment-with-langs.min.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/underscore.min.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.util.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.util.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/commons.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/commons.ajax.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.availability.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.trigger.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.availability.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.trigger.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/lists.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/periodTypeNoDep.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/json2.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.validation.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.ss.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.ls.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.idb.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.memory.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.validation.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.storage.ss.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.storage.ls.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.storage.idb.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.storage.memory.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.storage.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.contextmenu.js"></script>
<script src="../dhis-web-commons/ouwt/ouwt.js"></script>
- <script src="../dhis-web-commons/javascripts/dhis2/dhis2.tracker.metadata.js"></script>
+ <script src="scripts/dhis2/dhis2.tracker.metadata.js"></script>
<script src="scripts/tracker-capture.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/select.js"></script>
@@ -72,12 +72,12 @@
<script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angularLocalStorage.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angular-translate.min.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/ng-infinite-scroll.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.map.directive.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.validations.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.filters.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.angular.controllers.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.angular.directives.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.angular.map.directive.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.angular.services.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.angular.validations.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.angular.filters.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.angular.controllers.js"></script>
<script type="text/javascript" src="scripts/app.js"></script>
<script type="text/javascript" src="scripts/services.js"></script>
@@ -110,9 +110,9 @@
<script type="text/javascript" src="components/rulebound/rulebound-controller.js"></script>
<!-- Menu scripts -->
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.translate.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.menu.js"></script>
- <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.translate.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.menu.js"></script>
+ <script type="text/javascript" src="scripts/dhis2/dhis2.menu.ui.js"></script>
<link type="text/css" rel="stylesheet" href="../dhis-web-commons/font-awesome/css/font-awesome.min.css"/>
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js 2016-01-13 16:58:28 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js 2016-01-15 13:38:46 +0000
@@ -381,50 +381,61 @@
}
};
})
+
.directive('d2Audit', function () {
- return {
- restrict: 'E',
- template: '<i class="glyphicon glyphicon-user audit-icon" data-ng-click="showAuditHistory()"></i>',
- scope:{
- dataElementId: '@dataelementId',
- dataElementName: '@dataelementName',
- currentEvent:'@',
- type:'@',
- selectedTeiId:'@'
- },
- controller:function($scope, $modal) {
- if (!$scope.dataElementId) {
- return;
- }
-
- $scope.showAuditHistory = function() {
-
- $modal.open({
- templateUrl: "../dhis-web-commons/angular-forms/audit-history.html",
- controller: "AuditHistoryController",
- resolve: {
- dataElementId: function () {
- return $scope.dataElementId;
- },
- dataElementName: function () {
- return $scope.dataElementName;
- },
- dataType: function() {
- return $scope.type;
- },
- currentEvent: function() {
- return $scope.currentEvent;
- },
- selectedTeiId: function() {
- return $scope.selectedTeiId;
+ return {
+ restrict: 'E',
+ template: '<i class="glyphicon glyphicon-user audit-icon" data-ng-click="showAuditHistory()" ng-if="showAuditIcon()"></i>',
+ scope:{
+ dataElementId: '@dataelementId',
+ dataElementName: '@dataelementName',
+ currentEvent:'@',
+ type:'@',
+ selectedTeiId:'@'
+ },
+ controller:function($scope, $modal) {
+ if (!$scope.dataElementId) {
+ return;
+ }
+
+ $scope.showAuditIcon = function() {
+ if ($scope.currentEvent && $scope.currentEvent !== 'SINGLE_EVENT') {
+ return true;
+ }
+ return false;
+ }
+
+ $scope.showAuditHistory = function() {
+
+ $modal.open({
+ templateUrl: "../dhis-web-commons/angular-forms/audit-history.html",
+ controller: "AuditHistoryController",
+ resolve: {
+ dataElementId: function () {
+ return $scope.dataElementId;
+ },
+ dataElementName: function () {
+ return $scope.dataElementName;
+ },
+ dataType: function() {
+ return $scope.type;
+ },
+ currentEvent: function() {
+ if($scope.currentEvent === "SINGLE_EVENT") {
+ alert("Single Event !!!");
+ }
+ return $scope.currentEvent;
+ },
+ selectedTeiId: function() {
+ return $scope.selectedTeiId;
+ }
}
- }
- })
+ })
+
+ }
}
-
- }
- };
-});
+ };
+ });