Your IP : 18.222.71.13


Current Path : /home/bitrix/ext_www/crm.klimatlend.ua/bitrix/js/crm/
Upload File :
Current File : /home/bitrix/ext_www/crm.klimatlend.ua/bitrix/js/crm/export.min.js

BX.namespace("BX.Crm");if(typeof BX.Crm.ExportManager==="undefined"){BX.Crm.ExportManager=function(){this._id="";this._settings={};this._componentName="";this._processDialog=null;this._siteId="";this._entityType="";this._sToken="";this._cToken="";this._token="";this._initialOptions={}};BX.Crm.ExportManager.prototype={initialize:function(t,e){this._id=BX.type.isNotEmptyString(t)?t:BX.util.getRandomString(4);this._settings=e?e:{};this._siteId=this.getSetting("siteId","");if(!BX.type.isNotEmptyString(this._siteId))throw"BX.Crm.ExportManager: parameter 'siteId' is not found.";this._componentName=this.getSetting("componentName","");if(!BX.type.isNotEmptyString(this._componentName))throw"BX.Crm.ExportManager: parameter 'componentName' is not found.";this._entityType=this.getSetting("entityType","");if(!BX.type.isNotEmptyString(this._entityType))throw"BX.Crm.ExportManager: parameter 'entityType' is not found.";this._sToken=this.getSetting("sToken","");if(!BX.type.isNotEmptyString(this._sToken))throw"BX.Crm.ExportManager: parameter 'sToken' is not found.";this._initialOptions=this.getSetting("initialOptions",{})},getId:function(){return this._id},getSetting:function(t,e){return this._settings.hasOwnProperty(t)?this._settings[t]:e},callAction:function(t){this._processDialog.setAction(t);this._processDialog.start()},startExport:function(t){if(!BX.type.isNotEmptyString(t))throw"BX.Crm.ExportManager: parameter 'exportType' has invalid value.";this._cToken="c"+Date.now();this._token=this._sToken+this._cToken;var e={SITE_ID:this._siteId,PROCESS_TOKEN:this._token,ENTITY_TYPE:this._entityType,EXPORT_TYPE:t,COMPONENT_NAME:this._componentName,signedParameters:this.getSetting("componentParams",{})};var i=t.charAt(0).toUpperCase()+t.slice(1);this._processDialog=BX.CrmLongRunningProcessDialog.create(this._id+"_LrpDlg",{controller:"crm.api.export",action:"dispatcher",params:e,initialOptions:this._initialOptions,title:this.getMessage("stExport"+i+"DlgTitle"),summary:this.getMessage("stExport"+i+"DlgSummary"),isSummaryHtml:false,requestHandler:function(t){if(BX.type.isNotEmptyString(t["STATUS"])&&t["STATUS"]=="COMPLETED"){if(BX.type.isNotEmptyString(t["DOWNLOAD_LINK"])){t["SUMMARY_HTML"]+="<br><br>"+'<a href="'+t["DOWNLOAD_LINK"]+'" class="ui-btn ui-btn-sm ui-btn-success ui-btn-icon-download">'+t["DOWNLOAD_LINK_NAME"]+"</a>"+'<button onclick="BX.Crm.ExportManager.currentInstance().callAction(\'clear\')" class="ui-btn ui-btn-sm ui-btn-default ui-btn-icon-remove">'+t["CLEAR_LINK_NAME"]+"</button>"}}}});this._processDialog.show()},destroy:function(){this._id="";this._settings={};this._processDialog=null;this._siteId="";this._entityType="";this._sToken="";this._cToken="";this._token="";this._initialOptions={}}};BX.Crm.ExportManager.prototype.getMessage=function(t){var e=t;var i=this.getSetting("messages",null);if(i!==null&&typeof i==="object"&&i.hasOwnProperty(t)){e=i[t]}else{i=BX.Crm.ExportManager.messages;if(i!==null&&typeof i==="object"&&i.hasOwnProperty(t)){e=i[t]}}return e};if(typeof BX.Crm.ExportManager.messages==="undefined"){BX.Crm.ExportManager.messages={}}if(typeof BX.Crm.ExportManager.items==="undefined"){BX.Crm.ExportManager.items={}}BX.Crm.ExportManager.create=function(t,e){var i=new BX.Crm.ExportManager;i.initialize(t,e);BX.Crm.ExportManager.items[t]=i;BX.Crm.ExportManager.currentId=t;return i};BX.Crm.ExportManager.delete=function(t){if(BX.Crm.ExportManager.items.hasOwnProperty(t)){BX.Crm.ExportManager.items[t].destroy();delete BX.Crm.ExportManager.items[t]}};BX.Crm.ExportManager.currentId="";BX.Crm.ExportManager.currentInstance=function(){return BX.Crm.ExportManager.items[BX.Crm.ExportManager.currentId]}}
//# sourceMappingURL=export.map.js