TimeTrex/interface/html5/dist/JobApplicantLocationSubViewController.bundle.js

1 line
61 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["JobApplicantLocationSubViewController","portal-hr-my_profile-JobApplicantSubBaseViewController","JobApplicantSubBaseViewController"],{8157:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobApplicantLocationSubViewController\": () => (/* binding */ JobApplicantLocationSubViewController)\n/* harmony export */ });\n/* harmony import */ var _views_portal_hr_my_profile_JobApplicantSubBaseViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3757);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass JobApplicantLocationSubViewController extends _views_portal_hr_my_profile_JobApplicantSubBaseViewController__WEBPACK_IMPORTED_MODULE_0__.JobApplicantSubBaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {} );\n\n\t\tsuper( options );\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\t\tthis.company_api.getOptions( 'country', {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result = result.getResult();\n\t\t\t\t$this.setSourceData( 'country', result, true );\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetJobApplicantLocation( callback ) {\n\t\tvar $this = this;\n\t\tvar filter = {};\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_data.id = this.model.id;\n\t\tthis.api['getJobApplicantLocation']( filter, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\tif ( !result_data ) {\n\t\t\t\t\t\tresult_data = [];\n\t\t\t\t\t}\n\t\t\t\t\tresult_data = result_data[0];\n\t\t\t\t\t$this.model.set( result_data );\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this.showErrorAlert( result );\n\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tsuper.setCurrentEditRecordData();\n\t\tvar field_selector;\n\t\tvar field_control;\n\t\t//Set current edit record data to all widgets\n\t\tfor ( var key in this.model.attributes ) {\n\t\t\tif ( !this.model.has( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// if ( this.current_edit_record[key] === false ) {\n\t\t\t// \tthis.current_edit_record[key] = '';\n\t\t\t// }\n\t\t\tswitch ( key ) {\n\t\t\t\tcase 'country':\n\t\t\t\t\t// if ( this.current_edit_record[key] === false ) {\n\t\t\t\t\t// \tthis.current_edit_record[key] = '';\n\t\t\t\t\t// }\n\t\t\t\t\tfield_selector = 'select[name=\"' + key + '\"]';\n\t\t\t\t\tthis.$( field_selector ).val( this.model.get( key ) );\n\t\t\t\t\tif ( key === 'country' ) {\n\t\t\t\t\t\tthis.eSetProvince( this.model.get( key ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ( this.model.get( key ) === false ) {\n\t\t\t\t\t\tthis.model.set( key, '' );\n\t\t\t\t\t}\n\t\t\t\t\tfield_selector = '.form-control[name=\"' + key + '\"]';\n\t\t\t\t\tfield_control = this.$( field_selector );\n\t\t\t\t\tif ( field_control && field_control[0] ) {\n\t\t\t\t\t\tthis.$( field_selector ).val( this.model.get( key ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\t\t// this.collectUIDataToCurrentEditRecord();\n\t\t// this.setEditViewDataDone();\n\t}\n\n\tonFormItemChange( e, doNotValidate ) {\n\t\tvar key = e.currentTarget.name;\n\t\tvar $this = this;\n\t\tthis.model.set( key, $( e.currentTarget ).val() );\n\t\t// switch ( key ) {\n\t\t// case 'country':\n\t\t// case 'identification_country':\n\t\t// \tvar widget = this.$('select[name=\"' + key + '\"]');\n\t\t// \twidget.val( null );\n\t\t// \tbreak;\n\t\t// case 'is_current_employer':\n\t\t// case 'is_contact_available':\n\t\t// \tif ( $(e.currentTarget).is(':checked' ) ) {\n\t\t// \t\tthis.model.set( key, true )\n\t\t// \t} else {\n\t\t// \t\tthis.model.set( key, false )\n\t\t// \t}\n\t\t// \tbreak;\n\t\t// }\n\t\tif ( key == 'country' ) {\n\t\t\tthis.eSetProvince( this.$( 'select