SmartIT_Extensions/BAK/dist_BAK/NTTDATA/modules/taskEmail/ntt.smartit.taskEmail.js

1 line
5.3 KiB
JavaScript

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.taskEmail=e():(t.ntt=t.ntt||{},t.ntt.smartit=t.ntt.smartit||{},t.ntt.smartit.taskEmail=e())}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function i(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.r(e),n.d(e,"taskEmail",function(){return u}),n(1),n(2);var u=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,a(e).apply(this,arguments))}var n,o,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(e,ntt.smartit.api.ICustomModule),n=e,(o=[{key:"name",value:function(){return"taskEmail"}},{key:"injectTemplates",value:function(){return{"views/field-customization/custom-field-area.html":[{id:"changeConditionCustomerLastName",method:"addAfter",mode:"partial",type:"jquery",selector:function(t){return t.find(".custom-field-inline")[0]},snippet:'<lastname-custom-field-ntt class="custom-field-inline" ng-if="field.dataType==\'text\' && $parent.$parent.$parent.$parent.ticket.ticketType==\'task\'" data="field" ticket="$parent.$parent.$parent.$parent.ticket"> </lastname-custom-field-ntt>'}],"views/ticket/task-details-v2.html":[{id:"scopeExtenderTaskAdditionalInfo",method:"add",mode:"partial",type:"jquery",selector:function(t){return t.find("div.ticket__customized-body")[0]},snippet:'<scope-controller-task-additional-info ticket="ticket" ng-If="true"></scope-controller-task-additional-info>'}]}}},{key:"injectDynTemplates",value:function(){return{}}},{key:"templates",value:function(){return[{template:"views/lastname-custom-field-ntt.html"}]}},{key:"i18nLocales",value:function(){return{}}}])&&r(n.prototype,o),u&&r(n,u),e}();ntt.smartit.api.nttSmartitModules.push(new u)},function(t,e){!function(){"use strict";angular.module("myitsmApp").directive("lastnameCustomFieldNtt",["ModuleConfigService","nttGenericService","objectValueMapperService","nttTaskAdditionalDetails",function(t,e,n,o){return{restrict:"E",replace:!1,scope:{data:"=",ticket:"="},templateUrl:"views/lastname-custom-field-ntt.html",link:["scope","element",function(t,e){}],controller:["$scope","$element","$attrs",function(e,r,i){var a=t.getModuleConfig("taskEmail");if(e.loaded=!1,e.isActive=!!a.hasOwnProperty(e.data.name),e.isActive){if(void 0===e.ticket.nttAdditionalInfos&&(e.ticket.nttAdditionalInfos={}),"requesterLastName"==e.data.name){var c=n.getFieldList();o.getAdditionalDetails("requester",e.ticket.id,c.requesterPersonId.value).then(function(t){e.ticket.nttAdditionalInfos.requester=t,e.loaded=!0})}"customerLastName"==e.data.name&&o.getAdditionalDetails("customer",e.ticket.id,e.ticket.customer.personId).then(function(t){e.ticket.nttAdditionalInfos.customer=t,e.loaded=!0}),e.forceConfig=a[e.data.name].force,r.parent().children().addClass("custom-field-inline")}}]}}])}()},function(t,e,n){"use strict";angular.module("myitsmApp").factory("nttTaskAdditionalDetails",["nttGenericService","$q",function(t,e){var n={cache:{},fetchPerson:function(e){return t.getArEntriesByFormAndQual({form:"CTM:People",qual:"'1'=\""+e+'"',fields:[1000000048]}).$promise},getAdditionalDetails:function(t,o,r){return n.cache[o]&&n.cache[o][t]&&n.cache[o][t].personId==r||(void 0===n.cache[o]&&(n.cache[o]={}),n.cache[o][t]=n.fetchPerson(r).then(function(e){return n.cache[o][t]={},n.cache[o][t].personId=r,n.cache[o][t].mail=e.items.entries[0][1000000048].value,n.cache[o][t]})),e.when(n.cache[o][t])}};return n}])}])});