SmartIT_Extensions/BAK/dist_BAK/NTTDATA/modules/parentShareTicket/ntt.smartit.parentShareTick...

1 line
4.0 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.parentShareTicket=e():(t.ntt=t.ntt||{},t.ntt.smartit=t.ntt.smartit||{},t.ntt.smartit.parentShareTicket=e())}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},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 r(t){return(r="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 o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e){return!e||"object"!==r(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 u(t){return(u=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,"parentShareTicket",function(){return a}),n(1);var a=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,u(e).apply(this,arguments))}var n,r,a;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,(r=[{key:"name",value:function(){return"parentShareTicket"}},{key:"injectTemplates",value:function(){return{"views/layout-configuration/title-bar-component/title-bar.html":[{id:"parentShareTicket",method:"add",mode:"partial",type:"jquery",selector:function(t){return t.find("ul.profile-action-bar__item-menu")},snippet:'<li custom-share-parent-link ng-if="ticket.parentName && ticket.type == \'task\'" ticket="ticket"></li>'},{id:"parentShareTicket2",method:"replace",mode:"attribute",attributes:{add:{"ng-if":"ticket.type !=='task'"}},type:"jquery",selector:function(t){return t.find("ul.profile-action-bar__item-menu > li")[0]}}]}}},{key:"injectDynTemplates",value:function(){return{}}},{key:"templates",value:function(){return[{},{},{},{},{},{},{}]}},{key:"i18nLocales",value:function(){return{}}}])&&o(n.prototype,r),a&&o(n,a),e}();ntt.smartit.api.nttSmartitModules.push(new a)},function(t,e){angular.module("myitsmApp").directive("customShareParentLink",["ModuleConfigService","ticketModel","ticketActionService",function(t,e,n){return{restrict:"A",scope:{ticket:"=ticket"},template:'<div class="dropdown-item" ng-click="ticketActions.shareParent()" tabindex="0" role="menuitem">{{\'action.ticket.email\' | i18n: (\'common.labels.\' + ticket.parentName | i18n) }}</div>',link:function(t,e){},controller:["$element","$attrs","$scope",function(t,r,o){o.ticketActions={},o.ticketActions.shareParent=function(){e.getTicket(o.ticket.parentId,o.ticket.parentName,!0).then(function(t){n.share(t)})}}]}}])}])});