YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Vtiger/resources/PDF.min.js.map

Summary

Maintainability
Test Coverage
{"version":3,"file":"PDF.min.js","sources":["PDF.js"],"sourcesContent":["/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */\n'use strict';\n\n$.Class('Vtiger_PDF_Js', {\n\t/**\n\t * Proceed form submission\n\t */\n\tproceedSubmit(mode) {\n\t\tconst loader = $.progressIndicator({\n\t\t\tmessage: app.vtranslate('JS_PDF_GENERATING'),\n\t\t\tposition: 'html',\n\t\t\tblockInfo: {\n\t\t\t\tenabled: true\n\t\t\t}\n\t\t});\n\t\tswitch (mode) {\n\t\t\tcase 'generate_pdf':\n\t\t\t\tthis.container.find('#pdfExportModal').submit();\n\t\t\t\tbreak;\n\t\t\tcase 'single_pdf':\n\t\t\t\tthis.container.find('[name=\"single_pdf\"]').val(1);\n\t\t\t\tthis.container.find('#pdfExportModal').submit();\n\t\t\t\tbreak;\n\t\t\tcase 'email_pdf':\n\t\t\t\tthis.container.find('[name=\"email_pdf\"]').val(1);\n\t\t\t\tthis.container.find('#pdfExportModal').submit();\n\t\t\t\tbreak;\n\t\t}\n\t\tloader.progressIndicator({ mode: 'hide' });\n\t\tapp.hideModalWindow();\n\t},\n\n\t/*\n\t * Function to register the click event for generate button\n\t */\n\tregisterPreSubmitEvent: function (container) {\n\t\tconst self = this;\n\t\tcontainer.find('#generate_pdf, #single_pdf, #email_pdf').on('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\tself.proceedSubmit.apply(self, [$(e.currentTarget).attr('id')]);\n\t\t});\n\t},\n\n\t/**\n\t * Register list view check records\n\t *\n\t * @param   {jQuery}  container\n\t */\n\tregisterListViewCheckRecords(container) {\n\t\tlet templateElements = container.find('[name=\"pdf_template[]\"]');\n\t\ttemplateElements.on('change', function () {\n\t\t\tdocument.progressLoader = $.progressIndicator({\n\t\t\t\tmessage: app.vtranslate('JS_PDF_RECALCULATING'),\n\t\t\t\tposition: 'html',\n\t\t\t\tblockInfo: {\n\t\t\t\t\tenabled: true\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlet templateContainer = $(this).closest('.js-pdf-template-content');\n\t\t\ttemplateContainer.find('.js-pdf-user-variable').toggleClass('d-none');\n\n\t\t\tlet templates = [];\n\t\t\ttemplateElements.filter(':checked').each(function () {\n\t\t\t\ttemplates.push($(this).val());\n\t\t\t});\n\n\t\t\tlet params = container.find('form').serializeFormData();\n\t\t\tparams.mode = 'validateRecords';\n\t\t\tparams.templates = templates;\n\n\t\t\tAppConnector.request(params)\n\t\t\t\t.done(function (data) {\n\t\t\t\t\tvar response = data.result;\n\t\t\t\t\tif (data.success) {\n\t\t\t\t\t\tlet valid = response.valid;\n\t\t\t\t\t\tlet info = container.find('.js-records-info').text(response.message).removeClass('d-none');\n\t\t\t\t\t\tif (valid) {\n\t\t\t\t\t\t\tinfo.addClass('d-none');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\tdocument.progressLoader.progressIndicator({ mode: 'hide' });\n\t\t\t\t\t\t}, 500);\n\n\t\t\t\t\t\tcontainer.find('.js-submit-button').each(function () {\n\t\t\t\t\t\t\t$(this).attr('disabled', !valid);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.fail(function (data, err) {\n\t\t\t\t\tapp.errorLog(data, err);\n\t\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * Register select custom columns change\n\t */\n\tregisterSelectCustomColumnsChange() {\n\t\tthis.container.find('[name=\"isCustomMode\"]').on('change', (ev) => {\n\t\t\tif ($(ev.target).is(':checked')) {\n\t\t\t\tthis.container.find('[name=\"inventoryColumns[]\"]').prop('disabled', null);\n\t\t\t\tthis.container.find('.js-save-scheme').prop('disabled', null);\n\t\t\t} else {\n\t\t\t\tthis.container.find('[name=\"inventoryColumns[]\"]').prop('disabled', 'disabled');\n\t\t\t\tthis.container.find('.js-save-scheme').prop('disabled', 'disabled');\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Register save scheme button click\n\t */\n\tregisterSaveInventoryColumnSchemeClick() {\n\t\tthis.container.find('.js-save-scheme').on('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconst loader = $.progressIndicator({\n\t\t\t\tposition: 'html',\n\t\t\t\tblockInfo: {\n\t\t\t\t\tenabled: true\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlet params = this.container.find('form').serializeFormData();\n\t\t\tparams.mode = 'saveInventoryColumnScheme';\n\t\t\tparams.isCustomMode = this.container.find('[name=\"isCustomMode\"]').is(':checked');\n\n\t\t\tAppConnector.request(params)\n\t\t\t\t.done(function (data) {\n\t\t\t\t\tconst response = data['result'];\n\t\t\t\t\tif (data['success']) {\n\t\t\t\t\t\tloader.progressIndicator({ mode: 'hide' });\n\t\t\t\t\t}\n\t\t\t\t\tif (response['message'] && data['success']) {\n\t\t\t\t\t\tapp.showNotify({\n\t\t\t\t\t\t\ttext: response['message'],\n\t\t\t\t\t\t\ttype: 'success'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.fail(function (data, err) {\n\t\t\t\t\tapp.errorLog(data, err);\n\t\t\t\t});\n\t\t});\n\t},\n\t/**\n\t * Register events\n\t */\n\tregisterEvents() {\n\t\tconst container = (this.container = $('#pdfExportModal').closest('.js-modal-container'));\n\t\tthis.dynamicTemplatesCount = 0;\n\t\tthis.recordId = parseInt(container.find('[name=\"record\"]').val());\n\t\tthis.registerPreSubmitEvent(container);\n\t\tthis.registerSaveInventoryColumnSchemeClick();\n\t\tthis.registerSelectCustomColumnsChange();\n\t\tthis.registerListViewCheckRecords(container);\n\t}\n});\n$(function () {\n\tnew Vtiger_PDF_Js().registerEvents();\n});\n"],"names":["$","Class","proceedSubmit","mode","loader","progressIndicator","message","app","vtranslate","position","blockInfo","enabled","container","find","submit","val","hideModalWindow","registerPreSubmitEvent","self","on","e","preventDefault","apply","currentTarget","attr","registerListViewCheckRecords","templateElements","document","progressLoader","templateContainer","closest","toggleClass","templates","filter","each","push","params","serializeFormData","AppConnector","request","done","data","response","result","success","valid","info","text","removeClass","addClass","setTimeout","fail","err","errorLog","registerSelectCustomColumnsChange","_this","ev","target","is","prop","registerSaveInventoryColumnSchemeClick","_this2","stopPropagation","isCustomMode","showNotify","type","registerEvents","dynamicTemplatesCount","recordId","parseInt","Vtiger_PDF_Js"],"mappings":";;AAAA,kKACA,YAAY,CAEZA,CAAC,CAACC,KAAK,CAAC,eAAe,CAAE;AAEzB;AACA,IACCC,aAAa,CAAA,SAAAA,aAACC,CAAAA,IAAI,CAAE,CACnB,IAAMC,MAAM,CAAGJ,CAAC,CAACK,iBAAiB,CAAC,CAClCC,OAAO,CAAEC,GAAG,CAACC,UAAU,CAAC,mBAAmB,CAAC,CAC5CC,QAAQ,CAAE,MAAM,CAChBC,SAAS,CAAE,CACVC,OAAO,CACR,CAAA,CAAA,CACD,CAAC,CAAC,CAEI,cAAc,GADZR,IAAI,CAEV,IAAI,CAACS,SAAS,CAACC,IAAI,CAAC,iBAAiB,CAAC,CAACC,MAAM,EAAE,CAE3C,YAAY,GAJVX,IAAI,EAKV,IAAI,CAACS,SAAS,CAACC,IAAI,CAAC,uBAAqB,CAAC,CAACE,GAAG,CAAC,CAAC,CAAC,CACjD,IAAI,CAACH,SAAS,CAACC,IAAI,CAAC,iBAAiB,CAAC,CAACC,MAAM,EAAE,EAE3C,WAAW,GARTX,IAAI,EASV,IAAI,CAACS,SAAS,CAACC,IAAI,CAAC,sBAAoB,CAAC,CAACE,GAAG,CAAC,CAAC,CAAC,CAChD,IAAI,CAACH,SAAS,CAACC,IAAI,CAAC,iBAAiB,CAAC,CAACC,MAAM,EAAE,EAGjDV,KAAAA,CAAAA,CAAAA,MAAM,CAACC,iBAAiB,CAAC,CAAEF,IAAI,CAAE,MAAO,CAAC,CAAC,CAC1CI,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