TimeTrex/interface/html5/dist/hr-recruitment-JobApplicationViewController.bundle.js

1 line
71 KiB
JavaScript

(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["hr-recruitment-JobApplicationViewController"],{6719:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"JobApplicationViewController\": () => (/* binding */ JobApplicationViewController)\n});\n\n// EXTERNAL MODULE: ./node_modules/pdfjs-dist/build/pdf.js\nvar pdf = __webpack_require__(9299);\n// EXTERNAL MODULE: ./node_modules/pdfjs-dist/web/pdf_viewer.js\nvar pdf_viewer = __webpack_require__(7963);\n;// CONCATENATED MODULE: ./interface/html5/components/pdf_viewer/ttpdfviewer.js\n/* provided dependency */ var $ = __webpack_require__(9755);\n/*\n * For future reference, quite a lot of this code is based on the following, and potentially more, but these are the links I remember:\n * https://github.com/mozilla/pdf.js/tree/master/examples/components\n * https://github.com/mozilla/pdf.js/tree/master/examples/acroforms\n * https://github.com/mozilla/pdfjs-dist/tree/master/web\n * https://github.com/mozilla/pdf.js/tree/master/web\n *\n * JSFiddle examples: https://jsfiddle.net/redfox05/btaqyse6/ , https://jsfiddle.net/redfox05/xvpzwLc2/ , https://jsfiddle.net/redfox05/rdyzef3o/\n */\n\n\n\n\n\n// window.pdfjsLib = pdfjsLib;\n// window.pdfjsViewer = pdfjsViewer;\n\nclass TTPDFViewer {\n\tconstructor( options ) {\n\t\tthis.pdf_count = 0;\n\t\tthis.url_array = [];\n\t\tthis.target = null;\n\n\t\treturn this.initPDFViewer( options.urls, options.target );\n\t}\n\n\tinitPDFViewer( url_array, target ) {\n\t\tthis.url_array = url_array; // needed as a global for the eventBus to trigger the next document load.\n\t\tthis.target = target; // Also needed for the eventBus next doc loading.\n\n\t\tif( !Array.isArray( url_array )) {\n\t\t\turl_array = [ url_array ];\n\t\t}\n\n\t\tif( url_array.length > 1 ) {\n\t\t\t$('.resume-label .label' ).text( $.i18n._( 'Resume' ) + ' (' + url_array.length + ' ' + $.i18n._( 'documents' ) + ')');\n\t\t}\n\t\tthis.loadMultiplePDF( url_array, target );\n\t}\n\n\tloadMultiplePDF( url_array, target ) {\n\t\t// Load first PDF via initPDFViewer, and loads the rest in callbacks.\n\t\tif( Array.isArray( url_array ) && url_array.length > 0 ) {\n\t\t\tvar current_url = url_array.pop();\n\n\t\t\t// If not the first page, then add a divider between multiple PDF documents.\n\t\t\tif( this.pdf_count !== 0 ) {\n\t\t\t\tvar document_divider = document.createElement( 'hr' );\n\t\t\t\ttarget.appendChild( document_divider );\n\t\t\t}\n\n\t\t\t// Start to cycle through each pdf, loading the first one\n\t\t\tvar container = document.createElement( 'div' );\n\t\t\tcontainer.className = 'pdfContainer';\n\t\t\tcontainer.setAttribute('data-document-index', this.pdf_count);\n\t\t\ttarget.appendChild( container );\n\n\t\t\tthis.loadPDF( current_url, container, this.pdf_count );\n\n\t\t\tthis.pdf_count++;\n\t\t}\n\t}\n\n\tloadPDF( pdf_url, container, pdf_id ) {\n\t\tif (!pdf.getDocument || !pdf_viewer.PDFPageView) {\n\t\t\talert(\"Please build the pdfjs-dist library using\\n `gulp dist-install`\");\n\t\t}\n\n\t\t// The workerSrc property shall be specified.\n\t\t// pdfjsLib.GlobalWorkerOptions.workerSrc = \"../../node_modules/pdfjs-dist/build/pdf.worker.js\";\n\t\tpdf.GlobalWorkerOptions.workerSrc = \"dist/pdf.worker.js\";\n\n\t\t// Some PDFs need external cmaps.\n\t\t// var CMAP_URL = \"../../node_modules/pdfjs-dist/cmaps/\";\n\t\tvar CMAP_URL = \"dist/pdfjs-cmaps/\"; // This cmap directory is automatically copied by webpack config from from node_modules into dist at build.\n\t\tvar CMAP_PACKED = true;\n\n\t\t// var DEFAULT_URL = \"../../web/compressed.tracemonkey-pldi-09.pdf\";\n\t\tvar DEFAULT_URL = pdf_url;\n\t\tvar DEFAULT_SCALE = 1.0;\n\t\tvar CSS_UNITS = 96/72; // Fixed scale calculations by taking into account CSS units. https://github.com/mozilla/pdf.js/issues/5628#issuecomment-367399215\n\n\t\t// Already passed into the function.\n\t\t// var container = document.getElementById(\"pageContainer\");\n\n\t\tvar eventBus = new pdf_viewer.EventBus();\n\n\t\t// AlternativeLoadNextPDFDocument - In case the current logic does not work out. See code at bottom of loadingTask.\n\t\t// eventBus.on(\"pagesloaded\", () => {\n\t\t// \tconsole.log('pagesloaded');\n\t\t// \tthis.loadMultiplePDF( this.url_array, this.target );\n\t\t// });\n\n\t\t// Loading document.\n\t\tvar loadingTask = pdf.getDocument({\n\t\t\turl: DEFAULT_URL,\n\t\t\tcMapUrl: CMAP_URL,\n\t\t\tcMapPacked: CMAP_PACKED,\n\t\t});\n\n\t\t// Most of this logic is taken from the pdfjs acroforms example at https://github.com/mozilla/pdf.js/blob/master/examples/acroforms/acroforms.js\n\n\t\tloadingTask.promise.then((pdfDocument) => {\n\t\t\t// Use a promise to fetch and render the next page.\n\t\t\tvar promise = Promise.resolve();\n\n\t\t\tfor (var i = 1; i <= pdfDocument.numPages; i++) {\n\t\t\t\tpromise = promise.then(function( pageNum ) {\n\n\t\t\t\t\t// Document loaded, retrieving the page.\n\t\t\t\t\treturn pdfDocument.getPage( pageNum ).then(function (pdfPage) {\n\n\t\t\t\t\t\tvar available_space = container.clientWidth;\n\t\t\t\t\t\tvar desired_width = available_space - 10 - 5 - 20;// 10px: margin on row, 5px: margin-right on column. The extra 20px was trial and error, likely the scrollbar, which will vary on browser.\n\t\t\t\t\t\tvar viewport = pdfPage.getViewport({ scale: DEFAULT_SCALE });\n\t\t\t\t\t\tvar scaled_scale = desired_width / (viewport.width * CSS_UNITS); // Fixed scale calculations by taking into account CSS units. https://github.com/mozilla/pdf.js/issues/5628#issuecomment-367399215\n\t\t\t\t\t\t// var scaled_viewport = pdfPage.getViewport({ scale: scaled_scale });\n\n\n\t\t\t\t\t\t// Creating the page view with default parameters.\n\t\t\t\t\t\tvar pdfPageView = new pdf_viewer.PDFPageView({\n\t\t\t\t\t\t\tcontainer: container,\n\t\t\t\t\t\t\tid: pageNum,\n\t\t\t\t\t\t\t// scale: SCALE,\n\t\t\t\t\t\t\tscale: scaled_scale,\n\t\t\t\t\t\t\tdefaultViewport: pdfPage.getViewport({ scale: scaled_scale }),\n\t\t\t\t\t\t\teventBus: eventBus,\n\t\t\t\t\t\t\t// We can enable text/annotations layers, if needed\n\t\t\t\t\t\t\ttextLayerFactory: new pdf_viewer.DefaultTextLayerFactory(),\n\t\t\t\t\t\t\tannotationLayerFactory: new pdf_viewer.DefaultAnnotationLayerFactory(),\n\t\t\t\t\t\t\trenderInteractiveForms: true, // inspired from the acroforms example at https://github.com/mozilla/pdf.js/tree/master/examples/acroforms - a quick one-line win, so might as well enable it.\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// Associates the actual page with the view, and drawing it\n\t\t\t\t\t\tpdfPageView.setPdfPage(pdfPage);\n\t\t\t\t\t\treturn pdfPageView.draw().then(() => {\n\t\t\t\t\t\t\t$('.pdfContainer a').attr('target', '_blank'); // #2662 and #2819 Needed to open PDF links in a new window, rather than active. PDFJS documentation is lacking on how to do this properly. So this will change the link target to _blank for all the PDF docs on the page. For future attemps, I looked into LinkService, externalLinkTarget, and newWindow, but examples did not work for our solution.\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}.bind(null, i) );\n\t\t\t}\n\t\t\t// Either load the next file here, or use the eventBus code, which is commented out further up. See AlternativeLoadNextPDFDocument\n\t\t\tthis.loadMultiplePDF( this.url_array, this.target );\n\t\t});\n\n\t}\n}\n\nwindow.TTPDFViewer = TTPDFViewer;\n\n;// CONCATENATED MODULE: ./interface/html5/views/hr/recruitment/JobApplicationViewController.js\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var JobApplicationViewController_$ = __webpack_require__(9755);\n\n\nclass JobApplicationViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#job_application_view_container',\n\n\t\t\t// _required_files: {\n\t\t\t// \t15: ['leaflet-timetrex']\n\t\t\t// },\n\n\t\t\tstatus_array: null,\n\t\t\ttype_array: null,\n\t\t\tpriority_array: null,\n\t\t\tdocument_object_type_id: null,\n\t\t\tuser_api: null,\n\t\t\tjob_applicant_api: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'JobApplicationEditView.html';\n\t\tthis.permission_id = 'job_application';\n\t\tthis.viewId = 'JobApplication';\n\t\tthis.script_name = 'JobApplicationView';\n\t\tthis.table_name_key = 'job_application';\n\t\tthis.context_menu_name = JobApplicationViewController_$.i18n._( 'Job Application' );\n\t\tthis.navigation_label = JobApplicationViewController_$.i18n._( 'Job Application' );\n\t\tthis.api = TTAPI.APIJobApplication;\n\t\tthis.document_api = TTAPI.APIDocument;\n\t\tthis.user_api = TTAPI.APIUser;\n\t\tthis.job_applicant_api = TTAPI.APIJobApplicant;\n\t\tthis.document_object_type_id = 170;\n\t\tthis.job_applicant_document_object_type_id = 160;\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tif ( !this.sub_view_mode ) {\n\t\t\tthis.initData();\n\t\t}\n\t}\n\n\tinitOptions() {\n\t\tvar options = [\n\t\t\t{ option_name: 'status', api: this.api },\n\t\t\t{ option_name: 'type', api: this.api },\n\t\t\t{ option_name: 'priority', api: this.api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\t}\n\n\tbuildEditViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_job_application': {\n\t\t\t\t'label': JobApplicationViewController_$.i18n._( 'Job Application' )\n\t\t\t},\n\t\t\t'tab_attachment': true,\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIJobApplication,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_job_application',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\n\t\tvar tab_job_application = this.edit_view_tab.find( '#tab_job_application' );\n\n\t\tvar tab_job_application_column1 = tab_job_application.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_job_application_column1 );\n\n\t\t// Job Applicant\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIJobApplicant,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_job_applicant',\n\t\t\tfield: 'job_applicant_id',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tvar widgetContainer = JobApplicationViewController_$( '<div class=\\'widget-h-box\\'></div>' );\n\t\tvar email_button = JobApplicationViewController_$( '<a href =\"\" target=\"_blank\" id =\"job-email-link\"> <input class=\\'t-button\\' style=\\'margin-left: 5px; height: 25px;\\' type=\\'button\\' value=\\'' + JobApplicationViewController_$.i18n._( 'Email' ) + '\\'> </a>' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( email_button );\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Job Applicant' ), form_item_input, tab_job_application_column1, '', widgetContainer );\n\n\t\t// Job Vacancy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIJobVacancy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_job_vacancy',\n\t\t\tfield: 'job_vacancy_id',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Job Vacancy' ), form_item_input, tab_job_application_column1 );\n\n\t\t// Type\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'type_id' } );\n\t\tform_item_input.setSourceData( $this.type_array );\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Type' ), form_item_input, tab_job_application_column1 );\n\n\t\t// Status\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'status_id' } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Status' ), form_item_input, tab_job_application_column1 );\n\n\t\t// Priority\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'priority_id' } );\n\t\tform_item_input.setSourceData( $this.priority_array );\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Priority' ), form_item_input, tab_job_application_column1 );\n\n\t\t// Interviewer\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_user',\n\t\t\tfield: 'interviewer_user_id',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tvar default_args = {};\n\t\tdefault_args.permission_section = 'job_application';\n\t\tform_item_input.setDefaultArgs( default_args );\n\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Interviewer' ), form_item_input, tab_job_application_column1 );\n\n\t\t// Next Action Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'next_action_date' } );\n\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Next Action Date' ), form_item_input, tab_job_application_column1, '', null );\n\n\t\t// Interview Date\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'interview_date' } );\n\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Interview Date' ), form_item_input, tab_job_application_column1, '', null );\n\n\t\t// Notes\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'note', width: '100%' } );\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Note' ), form_item_input, tab_job_application_column1, '', null, null, true );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t//Tags\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TAG_INPUT );\n\n\t\tform_item_input.TTagInput( { field: 'tag', object_type_id: 950 } );\n\t\tthis.addEditFieldToColumn( JobApplicationViewController_$.i18n._( 'Tags' ), form_item_input, tab_job_application_column1, '', null, null, true );\n\n\t\t// Resume Header\n\t\t// The resume itself will be added with manual code, not widgets, as we do not need the label, and do not want it tied into any standard widget logic/cleanup/update code.\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );\n\t\tform_item_input.SeparatedBox( { label: JobApplicationViewController_$.i18n._( 'Resume' ) } );\n\t\tform_item_input.addClass('resume-label');\n\t\tthis.addEditFieldToColumn( null, form_item_input, tab_job_application_column1 );\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tif ( this.is_add ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateEmailLink();\n\n\t\tthis.removeFormItemResumePdf();\n\n\t\t// TODO: Remove the old pdfjs framework code, and remove the requirejs calls for it.\n\t\t// TODO: Also figure out how we can put the cmap stuff into webpack generated dist folder, so that we dont have to manually update it in framework directorty.\n\n\t\tvar $this = this;\n\n\t\tvar pdf_form_item_div = JobApplicationViewController_$('<div></div>').addClass('edit-view-form-item-div form_item_resume_pdf');\n\t\t$this.edit_view_tab.find( '#tab_job_application' ).find( '.first-column' ).append( pdf_form_item_div );\n\n\t\t// API call to get the document URLs\n\t\tvar args = {};\n\t\targs.filter_data = {};\n\t\targs.filter_columns = {\n\t\t\t'id': true,\n\t\t\t'document_revision_id': true\n\t\t};\n\t\targs.filter_data.object_id = this.current_edit_record.job_applicant_id;\n\t\targs.filter_data.object_type_id = this.job_applicant_document_object_type_id;\n\t\tthis.document_api['get' + this.document_api.key_name]( args, {\n\t\t\tonResult: function( resp ) {\n\t\t\t\tvar urls = [];\n\t\t\t\tvar result_data = resp.getResult();\n\t\t\t\tif ( result_data !== true && _.isArray( result_data ) ) {\n\t\t\t\t\t// Once we have the document URL's put them into an Array.\n\t\t\t\t\t_.each( result_data, function( row ) {\n\t\t\t\t\t\tvar url = ServiceCaller.getURLByObjectType( 'file_download' ) + '&object_type=document&parent_id=' + row.id;\n\t\t\t\t\t\turl = url + '&parent_object_type_id=' + $this.job_applicant_document_object_type_id;\n\t\t\t\t\t\turl = url + '&object_id=' + row.document_revision_id;\n\t\t\t\t\t\turls.push( url );\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tpdf_form_item_div.append('<p class=\"no-documents-message\">' + JobApplicationViewController_$.i18n._( 'Sorry, no documents have been attached yet.' ) + '</p>' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Now that we have retrieved the array of PDF documents, initiate the PDF Viewer.\n\t\t\t\tnew TTPDFViewer({\n\t\t\t\t\turls: urls,\n\t\t\t\t\ttarget: pdf_form_item_div[0]\n\t\t\t\t});\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\n\t\tvar default_args = {};\n\t\tdefault_args.permission_section = 'job_application';\n\n\t\tthis.search_fields = [\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Job Applicant' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'job_applicant_id',\n\t\t\t\tlayout_name: 'global_job_applicant',\n\t\t\t\tapi_class: TTAPI.APIJobApplicant,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Job Vacancy' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'job_vacancy_id',\n\t\t\t\tlayout_name: 'global_job_vacancy',\n\t\t\t\tapi_class: TTAPI.APIJobVacancy,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Interviewer' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'interviewer_user_id',\n\t\t\t\tdefault_args: default_args,\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Type' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'type_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Status' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'status_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Priority' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'priority_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Tags' ),\n\t\t\t\tfield: 'tag',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tin_column: 1,\n\t\t\t\tobject_type_id: 950,\n\t\t\t\tform_item_type: FormItemType.TAG_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Created By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'created_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Updated By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'updated_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\t\t];\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['copy'],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Hire Applicant' ),\n\t\t\t\t\tid: 'edit_employee',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\t//action_group: 'jump_to',\n\t\t\t\t\t//group: 'navigation',\n\t\t\t\t\tvue_icon: 'tticon tticon-add_black_24dp',\n\t\t\t\t\tsort_order: 7100\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Map' ),\n\t\t\t\t\tid: 'map',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\t//action_group: 'jump_to',\n\t\t\t\t\t//group: 'navigation',\n\t\t\t\t\tvue_icon: 'tticon tticon-map_black_24dp',\n\t\t\t\t\tsort_order: 8000,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Jump To' ),\n\t\t\t\t\tid: 'jump_to_header',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\taction_group_header: true,\n\t\t\t\t\tpermission_result: false, // to hide it in legacy context menu and avoid errors in legacy parsers.\n\t\t\t\t\tsort_order: 9050,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: JobApplicationViewController_$.i18n._( 'Edit Applicant' ),\n\t\t\t\t\tid: 'edit_job_applicant',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\tgroup: 'navigation',\n\t\t\t\t\tsort_order: 9050,\n\t\t\t\t},\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tremoveFormItemResumePdf() {\n\t\tif ( this.edit_view && this.edit_view.find( '.form_item_resume_pdf' ).length > 0 ) {\n\t\t\tthis.edit_view.find( '.form_item_resume_pdf' ).remove();\n\t\t}\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'map':\n\t\t\t\tthis.onMapClick();\n\t\t\t\tbreak;\n\t\t\tcase 'edit_job_applicant':\n\t\t\tcase 'edit_employee':\n\t\t\tcase 'export_excel':\n\t\t\t\tthis.onNavigationClick( id );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonMapClick() {\n\t\t// only trigger map load in specific product editions.\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\tthis.is_viewing = false;\n\t\t\tvar cells = this.getSelectedItems();\n\t\t\tif ( !this.is_mass_editing ) {\n\t\t\t\tPromise.all(/* import() | leaflet-timetrex */[__webpack_require__.e(\"vendors-node_modules_leaflet_dist_images_marker-icon-2x_png-node_modules_leaflet_dist_images_-78d511\"), __webpack_require__.e(\"interface_html5_framework_leaflet_leaflet-timetrex_js\"), __webpack_require__.e(\"leaflet-timetrex\")]).then(__webpack_require__.bind(__webpack_require__, 6889)).then(( module )=>{\n\t\t\t\t\tvar processed_data_for_map = module.TTConvertMapData.processBasicFromGenericViewController( cells );\n\t\t\t\t\tIndexViewController.openEditView( this, 'Map', processed_data_for_map );\n\t\t\t\t}).catch( Global.importErrorHandler );\n\t\t\t}\n\t\t}\n\t}\n\n\tgetFilterColumnsFromDisplayColumns() {\n\t\tvar column_filter = super.getFilterColumnsFromDisplayColumns();\n\t\t//Fixes cannot set property job_applicant_id of undefined\n\t\tif ( column_filter == undefined ) {\n\t\t\tcolumn_filter = {};\n\t\t}\n\t\tcolumn_filter.job_applicant_id = true;\n\t\tcolumn_filter.latitude = true;\n\t\tcolumn_filter.longitude = true;\n\t\treturn this._getFilterColumnsFromDisplayColumns( column_filter );\n\t}\n\n\tonNavigationClick( iconName ) {\n\t\tvar $this = this;\n\t\tvar filter;\n\t\tvar temp_filter;\n\t\tvar selected_record;\n\n\t\tswitch ( iconName ) {\n\t\t\tcase 'edit_job_applicant':\n\t\t\t\tvar current_item = this.getSelectedItem();\n\t\t\t\tIndexViewController.openEditView( $this, 'JobApplicant', current_item.job_applicant_id );\n\t\t\t\tbreak;\n\t\t\tcase 'edit_employee':\n\t\t\t\tfilter = { filter_data: {} };\n\t\t\t\tgetUserDefaultData( function( data ) {\n\t\t\t\t\ttemp_filter = {};\n\t\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t\tselected_record = $this.getSelectedItem();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselected_record = $this.current_edit_record;\n\t\t\t\t\t}\n\t\t\t\t\ttemp_filter.filter_data = {};\n\t\t\t\t\ttemp_filter.filter_data.id = [selected_record.job_applicant_id];\n\t\t\t\t\t$this.job_applicant_api.getJobApplicant( temp_filter, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\t\t\tif ( Global.isArray(result_data) && result_data[0] ) {\n\t\t\t\t\t\t\t\tresult_data = result_data[0];\n\t\t\t\t\t\t\t\tfor ( var key in data ) {\n\t\t\t\t\t\t\t\t\tif ( !result_data[key] ) {\n\t\t\t\t\t\t\t\t\t\tresult_data[key] = data[key];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresult_data = [];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tIndexViewController.openEditView( $this, 'Employee', result_data );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t} );\n\n\t\t\tfunction getUserDefaultData( callBack ) {\n\t\t\t\t$this.user_api.getUserDefaultData( {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tvar data = result.getResult();\n\t\t\t\t\t\tcallBack( data );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'export_excel':\n\t\t\t\tthis.onExportClick( 'export' + this.api.key_name );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetCustomDefaultMenuIcon( id, context_btn, grid_selected_length ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'edit_job_applicant':\n\t\t\tcase 'edit_employee':\n\t\t\t\tthis.setDefaultMenuEditIcon( context_btn, grid_selected_length, 'user' );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetDefaultMenuMapIcon( context_btn ) {\n\t\tif ( Global.getProductEdition() <= 10 ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tvar show = false;\n\t\tif ( this.grid ) {\n\t\t\tvar selected_items = this.getSelectedItems();\n\t\t\tif ( selected_items.length > 0 ) {\n\t\t\t\tfor ( var x = 0; x < selected_items.length; x++ ) {\n\t\t\t\t\tif ( selected_items[x] && selected_items[x].latitude && selected_items[x].longitude ) {\n\t\t\t\t\t\tshow = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( show ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetEditMenuMapIcon( context_btn ) {\n\t\tthis.setDefaultMenuMapIcon( context_btn );\n\t}\n\n\tsearchDone() {\n\t\tsuper.searchDone();\n\t\tTTPromise.resolve( 'JobAppView', 'init' );\n\t}\n\n\tgetDefaultDisplayColumns( callBack ) {\n\t\tif ( this.sub_view_mode && this.parent_view_controller.viewId === 'JobApplicant' ) {\n\t\t\tthis.default_display_columns = ['job_vacancy', 'status', 'priority', 'created_date'];\n\t\t\tif ( callBack ) {\n\t\t\t\tcallBack();\n\t\t\t}\n\t\t} else if ( this.sub_view_mode && this.parent_view_controller.viewId === 'JobVacancy' ) {\n\t\t\tthis.default_display_columns = ['first_name', 'last_name', 'status', 'type', 'priority', 'created_date'];\n\t\t\tif ( callBack ) {\n\t\t\t\tcallBack();\n\t\t\t}\n\t\t} else {\n\t\t\tsuper.getDefaultDisplayColumns( callBack );\n\t\t}\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\n\t\tif ( !this.current_edit_record ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\t\tthis.current_edit_record[key] = target.getValue();\n\n\t\tif ( key === 'job_applicant_id' ) {\n\t\t\tthis.updateEmailLink();\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tupdateEmailLink() {\n\t\t// Get job applicants email address and update mailto link.\n\t\tvar data = {};\n\t\tdata.filter_data = { id: this.current_edit_record.job_applicant_id };\n\t\tdata.filter_columns = { email: true };\n\n\t\tthis.job_applicant_api.getJobApplicant( data, {\n\t\t\tonResult: ( res ) => {\n\t\t\t\tvar result = res.getResult();\n\t\t\t\tif ( Array.isArray( result ) && result[0].email ) {\n\t\t\t\t\tdocument.getElementById( 'job-email-link' ).href = 'mailto:' + result[0].email + '?subject=' + JobApplicationViewController_$.i18n._( 'Re' ) + ': ' + this.current_edit_record.job_vacancy + ' ' + JobApplicationViewController_$.i18n._( 'Application' );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\t/* jshint ignore:end */\n\n}\n\nJobApplicationViewController.loadSubView = function( container, beforeViewLoadedFun, afterViewLoadedFun ) {\n\n\tGlobal.loadViewSource( 'JobApplication', 'SubApplicationView.html', function( result ) {\n\t\tvar args = {};\n\t\tvar template = _.template( result );\n\n\t\tif ( Global.isSet( beforeViewLoadedFun ) ) {\n\t\t\tbeforeViewLoadedFun();\n\t\t}\n\n\t\tif ( Global.isSet( container ) ) {\n\t\t\tcontainer.html( template( args ) );\n\t\t\tif ( Global.isSet( afterViewLoadedFun ) ) {\n\t\t\t\tafterViewLoadedFun( sub_job_application_view_controller );\n\t\t\t}\n\t\t}\n\t} );\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uI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