"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["hr-recruitment-JobApplicantSkillViewController"],{9962:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobApplicantSkillViewController\": () => (/* binding */ JobApplicantSkillViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass JobApplicantSkillViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#job_applicant_skill_view_container',\n\n\t\t\tproficiency_array: null,\n\t\t\tqualification_array: null,\n\n\t\t\tqualification_api: null,\n\n\t\t\tsub_view_grid_autosize: true,\n\t\t\tsub_view_mode: true\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tthis.edit_view_tpl = 'JobApplicantSkillEditView.html';\n\t\tthis.permission_id = 'job_applicant';\n\t\tthis.viewId = 'JobApplicantSkill';\n\t\tthis.script_name = 'JobApplicantSkillView';\n\t\tthis.table_name_key = 'job_applicant_skill';\n\t\tthis.context_menu_name = $.i18n._( 'Skills' );\n\t\tthis.navigation_label = $.i18n._( 'Skill' );\n\t\tthis.api = TTAPI.APIJobApplicantSkill;\n\t\tthis.qualification_api = TTAPI.APIQualification;\n\t\tthis.render();\n\n\t\t//call init data in parent view\n\t\tif ( !this.sub_view_mode ) {\n\t\t\tthis.initData();\n\t\t}\n\t}\n\n\tshowNoResultCover( show_new_btn ) {\n\t\tsuper.showNoResultCover( ( this.sub_view_mode ) ? true : false );\n\t}\n\n\tonGridSelectRow() {\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\t\t\tthis.cancelOtherSubViewSelectedStatus();\n\t\t} else {\n\t\t\tthis.buildContextMenu();\n\t\t}\n\t\tthis.setDefaultMenu();\n\t}\n\n\tonGridSelectAll() {\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\t\t\tthis.cancelOtherSubViewSelectedStatus();\n\t\t}\n\t\tthis.setDefaultMenu();\n\t}\n\n\tcancelOtherSubViewSelectedStatus() {\n\t\tswitch ( true ) {\n\t\t\tcase typeof ( this.parent_view_controller.sub_job_applicant_license_view_controller ) !== 'undefined':\n\t\t\t\tthis.parent_view_controller.sub_job_applicant_license_view_controller.unSelectAll();\n\t\t\tcase typeof ( this.parent_view_controller.sub_job_applicant_language_view_controller ) !== 'undefined':\n\t\t\t\tthis.parent_view_controller.sub_job_applicant_language_view_controller.unSelectAll();\n\t\t\tcase typeof ( this.parent_view_controller.sub_job_applicant_education_view_controller ) !== 'undefined':\n\t\t\t\tthis.parent_view_controller.sub_job_applicant_education_view_controller.unSelectAll();\n\t\t\tcase typeof ( this.parent_view_controller.sub_job_applicant_membership_view_controller ) !== 'undefined':\n\t\t\t\tthis.parent_view_controller.sub_job_applicant_membership_view_controller.unSelectAll();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonMassEditClick() {\n\n\t\tvar $this = this;\n\t\t$this.is_add = false;\n\t\t$this.is_viewing = false;\n\t\t$this.is_mass_editing = true;\n\t\tLocalCacheData.current_doing_context_action = 'mass_edit';\n\t\t$this.openEditView();\n\t\tvar filter = {};\n\t\tvar grid_selected_id_array = this.getGridSelectIdArray();\n\t\tvar grid_selected_length = grid_selected_id_array.length;\n\t\tthis.mass_edit_record_ids = [];\n\n\t\t$.each( grid_selected_id_array, function( index, value ) {\n\t\t\t$this.mass_edit_record_ids.push( value );\n\t\t} );\n\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_data.id = this.mass_edit_record_ids;\n\n\t\tthis.api['getCommon' + this.api.key_name + 'Data']( filter, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\t$this.unique_columns = {};\n\n\t\t\t\t$this.linked_columns = {};\n\n\t\t\t\tif ( !result_data ) {\n\t\t\t\t\tresult_data = [];\n\t\t\t\t}\n\n\t\t\t\tif ( $this.sub_view_mode && $this.parent_key ) {\n\t\t\t\t\tresult_data[$this.parent_key] = $this.parent_value;\n\t\t\t\t}\n\n\t\t\t\t$this.current_edit_record = result_data;\n\t\t\t\t$this.initEditView();\n\n\t\t\t}\n\t\t} );\n\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'proficiency' );\n\n\t\tvar args = {};\n\t\tvar filter_data = {};\n\t\tfilter_data.type_id = [10];\n\t\tfilter_data.visibility_type_id = [20, 100]; //20=Portal Only, 100=Both\n\t\targs.filter_data = filter_data;\n\t\tthis.qualification_api.getQualification( args, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\n\t\t\t\t$this.qualification_array = res;\n\t\t\t}\n\t\t} );\n\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_skill': { 'label': $.i18n._( 'Skill' ) },\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.APIJobApplicantSkill,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_jobApplicantSkill',\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_skill = this.edit_view_tab.find( '#tab_skill' );\n\n\t\tvar tab_skill_column1 = tab_skill.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_skill_column1 );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\t// Skill\n\t\tvar args = {};\n\t\tvar filter_data = {};\n\t\tfilter_data.type_id = [10];\n\t\tfilter_data.visibility_type_id = [20, 100]; //20=Portal Only, 100=Both\n\t\targs.filter_data = filter_data;\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIQualification,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_qualification',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'qualification_id'\n\t\t} );\n\n\t\tform_item_input.setDefaultArgs( args );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Skill' ), form_item_input, tab_skill_column1, '' );\n\n\t\t// Proficiency\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'proficiency_id', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.proficiency_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Proficiency' ), form_item_input, tab_skill_column1 );\n\n\t\t// First Used Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'first_used_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'First Used Date' ), form_item_input, tab_skill_column1 );\n\n\t\t// Last Used Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'last_used_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Last Used Date' ), form_item_input, tab_skill_column1 );\n\n\t\t// Years Experience\n\t\tvar widgets = [];\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'experience', width: 50 } );\n\n\t\twidgets.push( form_item_input );\n\n\t\twidgetContainer = $( '
' );\n\t\tlabel = $( ' ' + $.i18n._( 'Automatic' ) + '' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'enable_calc_experience' } );\n\n\t\twidgets.push( form_item_input );\n\n\t\twidgetContainer.append( form_item_input );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Years Experience' ), widgets, tab_skill_column1, '', widgetContainer );\n\n\t\t// Expiry Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'expiry_date' } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Expiry Date' ), form_item_input, tab_skill_column1, '', null );\n\n\t\t// Description\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'description', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_skill_column1, '', null, null, true );\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: 391 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tags' ), form_item_input, tab_skill_column1, '', null, null, true );\n\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tif ( this.current_edit_record['enable_calc_experience'] ) {\n\t\t\tthis.edit_view_ui_dic['experience'].setEnabled( false );\n\t\t} else {\n\t\t\tthis.edit_view_ui_dic['experience'].setEnabled( true );\n\t\t}\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\n\t\tswitch ( key ) {\n\t\t\tcase 'enable_calc_experience':\n\t\t\t\tif ( c_value ) {\n\t\t\t\t\tthis.calcExperience();\n\t\t\t\t} else {\n\t\t\t\t\tthis.edit_view_ui_dic['experience'].setEnabled( true );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'last_used_date':\n\t\t\tcase 'first_used_date':\n\t\t\t\tif ( this.current_edit_record['enable_calc_experience'] ) {\n\t\t\t\t\tthis.calcExperience();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis.current_edit_record[key] = c_value;\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\n\t}\n\n\tcalcExperience() {\n\t\tthis.edit_view_ui_dic['experience'].setEnabled( false );\n\t\tvar first_used_date = this.edit_view_ui_dic['first_used_date'].getValue();\n\t\tvar last_used_date = this.edit_view_ui_dic['last_used_date'].getValue();\n\n\t\tlast_used_date = last_used_date ? last_used_date : new Date().format();\n\n\t\tif ( first_used_date !== '' && last_used_date !== '' ) {\n\t\t\tvar result = this.api.calcExperience( first_used_date, last_used_date, { async: false } );\n\t\t\tif ( result ) {\n\t\t\t\tvar experience = result.getResult();\n\t\t\t\tthis.edit_view_ui_dic['experience'].setValue( experience );\n\t\t\t}\n\t\t} else {\n\t\t\tthis.edit_view_ui_dic['experience'].setValue( 0 );\n\t\t}\n\t}\n\n\tonAddClick() {\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\t\t}\n\n\t\tsuper.onAddClick();\n\t}\n\n\tsearchDone() {\n\n\t\tsuper.searchDone();\n\n\t\tTTPromise.resolve( 'JobApplicant_Qualifications_Tab', 'JobApplicantSkillViewController' );\n\n\t}\n\n}\n\nJobApplicantSkillViewController.loadSubView = function( container, beforeViewLoadedFun, afterViewLoadedFun ) {\n\tGlobal.loadViewSource( 'JobApplicantSkill', 'SubJobApplicantSkillView.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\t\tif ( Global.isSet( container ) ) {\n\t\t\tcontainer.html( template( args ) );\n\t\t\tif (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