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

1 line
63 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["JobApplicantEmploymentSubViewController","portal-hr-my_profile-JobApplicantSubBaseViewController","JobApplicantSubBaseViewController"],{2838:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobApplicantEmploymentSubViewController\": () => (/* binding */ JobApplicantEmploymentSubViewController)\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 JobApplicantEmploymentSubViewController 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.api.getJobApplicantEmploymentOptions( 'employment_status', {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.setSourceData( 'employment_status_id', result.getResult(), true );\n\t\t\t}\n\t\t} );\n\t\tthis.api.getJobApplicantEmploymentOptions( 'wage_type', {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.setSourceData( 'wage_type_id', result.getResult(), true );\n\t\t\t}\n\t\t} );\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\tgetJobApplicantEmployment( 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['getJobApplicantEmployment']( 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\tcase 'is_current_employer':\n\t\t\t\tcase 'is_contact_available':\n\t\t\t\t\tfield_selector = 'input[name=\"' + key + '\"]';\n\t\t\t\t\tif ( this.model.get( key ) === true ) {\n\t\t\t\t\t\tthis.$( field_selector ).prop( 'checked', 'checked' );\n\t\t\t\t\t} else if ( this.model.get( key ) === false ) {\n\t\t\t\t\t\tthis.$( field_selector ).removeAttr( 'checked' );\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}\