213 lines
5.7 KiB
JavaScript
213 lines
5.7 KiB
JavaScript
|
||
var bootstrapOld = angular.bootstrap;
|
||
|
||
angular.bootstrap = function() {
|
||
|
||
bootstrapOld.apply(bootstrapOld,arguments);
|
||
console.log(bootstrapOld );
|
||
console.log("bootstrap overriden");
|
||
|
||
nttTest();
|
||
}
|
||
|
||
/*var oldConfigMethod = angular.module('myitsmApp').config;
|
||
|
||
angular.module('myitsmApp').config = function() {
|
||
oldConfigMethod.apply(oldConfigMethod,arguments);
|
||
}*/
|
||
|
||
/*(function () {
|
||
'use strict';
|
||
|
||
angular.module("myitsmApp")
|
||
.controller("CustomMainController", function($scope, $controller) {
|
||
|
||
var vm = this;
|
||
|
||
vm.alertHallo = alertHallo;
|
||
|
||
function alertHallo() {
|
||
alert('HALLLOOO');
|
||
}
|
||
|
||
//angular.extend(vm, $controller('MainController', {$scope: $scope}));
|
||
|
||
var x = 0;
|
||
|
||
});
|
||
|
||
|
||
})();*/
|
||
|
||
/*"use strict";
|
||
(function () {
|
||
'use strict';
|
||
|
||
angular.module("myitsmApp")
|
||
.controller("MyCustomController", function($scope, $controller) {
|
||
|
||
var vm = this;
|
||
|
||
vm.alertHallo = alertHallo;
|
||
|
||
function alertHallo() {
|
||
alert('HALLLOOO');
|
||
}
|
||
|
||
angular.extend(vm, $controller('MainController', {$scope: $scope}));
|
||
|
||
var x = 0;
|
||
|
||
});
|
||
|
||
|
||
})(); */
|
||
|
||
/*var services = (function () {
|
||
const injector = angular.element(document).injector()
|
||
const originalHasOwnProperty = Object.prototype.hasOwnProperty
|
||
Object.prototype.hasOwnProperty = () => true
|
||
Object.defineProperty(Object.prototype, '__self__', { configurable: true, enumerable: false, get() { return this } })
|
||
const cache = injector.get('__self__')
|
||
Object.prototype.hasOwnProperty = originalHasOwnProperty
|
||
return cache
|
||
})()*/
|
||
|
||
/*function allServices(mod, r) {
|
||
var inj = angular.element(document).injector().get;
|
||
if (!r) r = {};
|
||
angular.forEach(angular.module(mod).requires, function(m) {allServices(m,r)});
|
||
angular.forEach(angular.module(mod)._invokeQueue, function(a) {
|
||
try { r[a[2][0]] = inj(a[2][0]); } catch (e) {}
|
||
});
|
||
return r;
|
||
};
|
||
|
||
allMyServices = allServices('myitsmApp');*/
|
||
|
||
/*var inj;
|
||
function allServices(mod, r) {
|
||
if (!r) {
|
||
r = {};
|
||
inj = angular.element(document.querySelector('[ng-app]')).injector();
|
||
}
|
||
angular.forEach(angular.module(mod).requires, function(m) {allServices(m,r)});
|
||
angular.forEach(angular.module(mod)._invokeQueue, function(a) {
|
||
try { r[a[2][0]] = inj(a[2][0]); } catch (e) {}
|
||
});
|
||
return r;
|
||
};
|
||
|
||
var allMyServices = allServices('myitsmApp');*/
|
||
|
||
|
||
|
||
|
||
var servicesX;
|
||
|
||
|
||
var nttTest = function($stateProvider) {
|
||
|
||
servicesX = allServices();
|
||
function allServices() {
|
||
const injector = angular.element(document).injector();
|
||
const originalHasOwnProperty = Object.prototype.hasOwnProperty
|
||
Object.prototype.hasOwnProperty = () => true
|
||
Object.defineProperty(Object.prototype, '__self__', { configurable: true, enumerable: false, get() { return this } })
|
||
const cache = injector.get('__self__')
|
||
Object.prototype.hasOwnProperty = originalHasOwnProperty
|
||
return cache
|
||
|
||
}
|
||
|
||
//var assetConsoleTemplate = servicesX.$injector.get("$state").get("assetConsole").template;
|
||
|
||
//var originalTempl = servicesX.$templateCache.get("views/console/console.html");
|
||
//servicesX.$templateCache.put("views/console/console.html", "<a>x</a>");
|
||
|
||
//servicesX.$injector.get("$state").get("assetConsole").template = assetConsoleTemplate + "<a>hallo</a>";
|
||
|
||
//OBSOLETE WENN <20>ber angular.run die modifizierten Templates bei Start schon geladen werden!
|
||
|
||
/*var oldRequstProvider = servicesX.$templateRequest;
|
||
|
||
servicesX.$templateRequest= function() {
|
||
return oldRequstProvider.apply(oldRequstProvider,arguments);
|
||
}
|
||
|
||
console.log("XXXXTemplate:"+servicesX.$templateCache.get("views/console/console.html"));*/
|
||
|
||
|
||
|
||
|
||
var startAppNTT = function(data) {
|
||
servicesX.i18nService.dictionary = $.extend(servicesX.i18nService.dictionary, data);
|
||
}
|
||
|
||
//Override i18n locale
|
||
|
||
$.when($.getJSON('NTT/scripts/i18n/ntt-resources-locale_' + myitsmLocale + '.json'))
|
||
.fail(function(err) {
|
||
return $.when($.getJSON('NTT/scripts/i18n/ntt-resources-locale_' + myitsmLocale + '.json')).then(startAppNTT);
|
||
})
|
||
.then(startAppNTT);
|
||
|
||
};
|
||
|
||
|
||
angular.module("myitsmApp").run(["$rootScope","$templateCache","$templateRequest","i18nService", function($rootScope,$templateCache,$templateRequest,i18nService) {
|
||
|
||
//var oldRequstProvider = $templateRequest; //angular.module('myitsmApp').controller;
|
||
|
||
|
||
|
||
/* $rootScope.$apply($templateRequest= function() {
|
||
|
||
console.log("Custom Request handler");
|
||
return oldRequstProvider.apply(oldRequstProvider,arguments);
|
||
} );*/
|
||
//nttTest();
|
||
|
||
|
||
|
||
|
||
/*$.when($.getJSON('NTT/scripts/app/i18n/ntt-resources-locale_' + myitsmLocale + '.json', function(data) {
|
||
var items=[];
|
||
$.each(data, function(key,val) {
|
||
console.log(key+":"+value);
|
||
});
|
||
});*/
|
||
|
||
|
||
//Override Templates
|
||
var x = $templateRequest("NTT/views/ticket/incident-details-v2.html");
|
||
|
||
Promise.resolve(x).then(function(value) {
|
||
$templateCache.put("views/ticket/incident-details-v2.html", value);
|
||
|
||
});
|
||
|
||
|
||
|
||
}]);
|
||
|
||
|
||
angular.module('ticketModule')
|
||
.directive('nttTicketGtw', ['ticketModel', 'relationModel', 'userModel', '$q', '$filter', '$modal', 'events', '$timeout',
|
||
'$state', 'i18nService', 'systemAlertService', 'objectValueMapperService',
|
||
function (ticketModel, relationModel, userModel, $q, $filter, $modal, events, $timeout, $state, i18nService, systemAlertService, objectValueMapperService) {
|
||
return {
|
||
|
||
restrict: 'E',
|
||
templateUrl: 'NTT/views/ticket/ticket-tasks.html',
|
||
scope: {
|
||
ticket: '=',
|
||
relationCounters: '=',
|
||
tasksDisabled: '='
|
||
}
|
||
|
||
|
||
}
|
||
}]);
|
||
|