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

1 line
70 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["JobApplicantSkillSubViewController","portal-hr-my_profile-JobApplicantSubBaseViewController","JobApplicantSubBaseViewController"],{9548:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobApplicantSkillSubViewController\": () => (/* binding */ JobApplicantSkillSubViewController)\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 JobApplicantSkillSubViewController 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\tinit( options ) {\n\t\tthis.qualification_type_id = 10;\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\t\tthis.api.getJobApplicantSkillOptions( 'proficiency', {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.setSourceData( 'proficiency_id', result.getResult(), true );\n\t\t\t}\n\t\t} );\n\t\tvar args = {};\n\t\tvar filter_data = {};\n\t\tfilter_data.type_id = [this.qualification_type_id];\n\t\targs.filter_data = filter_data;\n\t\targs.filter_columns = {\n\t\t\t'id': true,\n\t\t\t'name': true\n\t\t};\n\t\tthis.qualification_api.getQualification( args, true, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar res = result.getResult();\n\t\t\t\tvar options = {};\n\t\t\t\tfor ( var i in res ) {\n\t\t\t\t\tif ( !res.hasOwnProperty( i ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar row = res[i];\n\t\t\t\t\toptions[row.id] = $.i18n._( row.name );\n\t\t\t\t}\n\t\t\t\t$this.setSourceData( 'qualification_id', options, true );\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetJobApplicantSkill( 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['getJobApplicantSkill']( 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\tif ( !Global.isSet( this.model.get( 'enable_calc_experience' ) ) ) {\n\t\t\tthis.model.set( 'enable_calc_experience', false );\n\t\t}\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\t// case '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 'enable_calc_experience':\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( '