"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["portal-hr-my_profile-JobApplicantEducationSubViewController","portal-hr-my_profile-JobApplicantSubBaseViewController","JobApplicantEducationSubViewController","JobApplicantSubBaseViewController"],{6042:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobApplicantEducationSubViewController\": () => (/* binding */ JobApplicantEducationSubViewController)\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\n\nclass JobApplicantEducationSubViewController 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 = 20;\n\t}\n\n\tgetJobApplicantEducation( 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['getJobApplicantEducation']( 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\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\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\tif ( key === 'qualification_id' && this.enable_add_qualification ) {\n\t\t\t\t\t\t\tthis.showAddQualificationContainer();\n\t\t\t\t\t\t}\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//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjA0Mi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBbUg7O0FBRTVHLHFEQUFxRCw0SEFBaUM7QUFDN0YsMkJBQTJCO0FBQzNCLEVBQUUsQ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__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobApplicantSubBaseViewController\": () => (/* binding */ JobApplicantSubBaseViewController)\n/* harmony export */ });\n/* harmony import */ var _views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7526);\n/* harmony import */ var _global_TTUUID__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4936);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\nclass JobApplicantSubBaseViewController extends _views_portal_PortalBaseViewController__WEBPACK_IMPORTED_MODULE_0__.PortalBaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tevents: {\n\t\t\t\t'change input[type=\"text\"]': 'onFormItemChange',\n\t\t\t\t'change input[type=\"checkbox\"]': 'onFormItemChange',\n\t\t\t\t'change select.form-control': 'onFormItemChange',\n\t\t\t\t'change textarea.form-control': 'onFormItemChange'\n\t\t\t\t// 'click .styled-select .glyphicon': 'onSelectClick',\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tpreInit( options ) { //Since this is an intermediary class between *SubViewController and PortalBaseViewController, we need to use preInit() so this is called before init() of each child class.\n\t\tthis.api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIJobApplicantPortal */ .y.APIJobApplicantPortal;\n\t\tthis.qualification_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIQualificationPortal */ .y.APIQualificationPortal;\n\t\tthis.company_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APICompanyPortal */ .y.APICompanyPortal;\n\t\tthis.sub_view_id = options.sub_view_id;\n\t\tthis.display_columns = options.display_columns;\n\t\tthis.table_container = options.table_container;\n\t\tthis.available_fields = options.available_fields;\n\t\tthis._delegate = options._delegate;\n\t\tthis.edit_view_error_ui_dic = {};\n\t\tthis.enable_add_qualification = options.enable_add_qualification || false;\n\n\t}\n\n\tpostInit() {\n\t\tif ( !this.model.id ) {\n\t\t\tthis.setEditView();\n\t\t} else {\n\t\t\tthis.render();\n\t\t}\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tvar list_tpl = Global.loadWidget( 'views/portal/hr/my_profile/MyProfileSubView.html' );\n\t\tvar unique_id = this.sub_view_id + '-' + this.model.id;\n\t\tthis.unique_id = unique_id;\n\t\tthis.sub_view = _.template( list_tpl )( {} );\n\t\tif ( this.table_container.find( '.table-container' ).length == 0 ) {\n\t\t\tthis.table_container.html( '
' );\n\t\t}\n\t\tif ( this.table_container.find( '#' + unique_id ).length === 0 ) {\n\t\t\tvar tbody = $( '' ).attr( 'id', unique_id );\n\t\t\t$( this.table_container.find( 'tbody' )[0] ).append( tbody );\n\t\t} else {\n\t\t\tthis.table_container.find( '#' + unique_id ).html( '' );\n\t\t}\n\t\tvar thead = $( '
' );\n\t\tfor ( var column in this.display_columns ) {\n\t\t\tif ( !this.display_columns.hasOwnProperty( column ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// comment this, this will cause some default display columns cannot be shown.\n\t\t\t// if ( !this.available_fields.hasOwnProperty( column ) ) {\n\t\t\t// \tcontinue;\n\t\t\t// }\n\t\t\tvar column_val;\n\t\t\tswitch ( column ) {\n\t\t\t\tcase 'is_current_employer':\n\t\t\t\tcase 'is_contact_available':\n\t\t\t\t\tif ( this.model.get( column ) ) {\n\t\t\t\t\t\tcolumn_val = $.i18n._( 'Yes' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolumn_val = $.i18n._( 'No' );\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( column ) ) {\n\t\t\t\t\t\tcolumn_val = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolumn_val = this.model.get( column );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthead.append( '' + this.display_columns[column] + ' | ' );\n\t\t\tthis.table_container.find( '#' + unique_id ).append( '' + column_val + ' | ' );\n\t\t}\n\t\tthead.append( '' + $.i18n._( 'Action' ) + ' | ' );\n\t\tif ( this.table_container.find( 'thead' ).html() === '' ) {\n\t\t\tthis.table_container.find( 'thead' ).html( thead );\n\t\t}\n\t\tthis.table_container.find( '#' + unique_id ).append( this.sub_view );\n\t\tthis.table_container.find( '#' + unique_id ).find( '.edit-icon' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$this['get' + $this.sub_view_id]( function() {\n\t\t\t\t$this.setEditView();\n\t\t\t} );\n\t\t} );\n\t\tthis.table_container.find( '#' + unique_id ).find( '.delete-icon' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$this['get' + $this.sub_view_id]( function() {\n\t\t\t\t$this.onDeleteClick();\n\t\t\t} );\n\t\t} );\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\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\tonSelectClick( e ) {\n\t\tvar elem = $( e.currentTarget ).parent().find( 'select' );\n\t\tif ( document.createEvent ) {\n\t\t\tvar e = document.createEvent( 'MouseEvents' );\n\t\t\te.initMouseEvent( 'mousedown', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null );\n\t\t\telem[0].dispatchEvent( e );\n\t\t} else if ( element.fireEvent ) {\n\t\t\telem[0].fireEvent( 'onmousedown' );\n\t\t}\n\t}\n\n\tsetEditView() {\n\t\tvar tpl = Global.loadWidget( 'views/portal/hr/my_profile/' + this.sub_view_id + 'SubEditView.html' );\n\t\tthis.setElement( _.template( tpl )( {\n\t\t\tavailable_fields: this.available_fields,\n\t\t\tenable_add_qualification: this.enable_add_qualification\n\t\t} ) );\n\t\tthis.initOptions();\n\t\tthis.registerDatePicker();\n\t\tthis.setCurrentEditRecordData();\n\t\tthis.openEditView();\n\t}\n\n\tonDeleteClick() {\n\t\tvar $this = this;\n\t\tIndexViewController.instance.router.showConfirmModal( Global.delete_confirm_message, {\n\t\t\ttitle: '',\n\t\t\tactions: [\n\t\t\t\t{ label: 'No', isClose: true },\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Yes', callBack: function( e ) {\n\t\t\t\t\t\t$this.closeConfirmModal();\n\t\t\t\t\t\tProgressBar.showOverlay();\n\t\t\t\t\t\t$this.api['delete' + $this.sub_view_id]( $this.model.id, {\n\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\t\t\t// $this.remove();\n\t\t\t\t\t\t\t\t\t// $this.table_container.find('#'+$this.unique_id).remove();\n\t\t\t\t\t\t\t\t\t$this._delegate.setSubViews( $this.sub_view_id, $this.display_columns );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this.showErrorAlert( result );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t} );\n\t}\n\n\tsetSourceData( field, source_data, set_empty ) {\n\t\tvar $this = this;\n\t\tvar field_selector = 'select[name=\"' + field + '\"]';\n\t\tif ( this.$( field_selector ) && this.$( field_selector )[0] ) {\n\t\t\tthis.$( field_selector ).empty();\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\tif ( !Global.isSet( this.model.get( field ) ) ) {\n\t\t\tthis.model.set( field, '' ); // initialize a value;\n\t\t}\n\t\tif ( _.size( source_data ) == 0 ) {\n\t\t\tset_empty = true;\n\t\t\tthis.model.set( field, '' );\n\t\t}\n\t\tswitch ( field ) {\n\t\t\tcase 'qualification_id':\n\t\t\t\tif ( this.enable_add_qualification ) {\n\t\t\t\t\tvar option_name;\n\t\t\t\t\tswitch ( this.sub_view_id ) {\n\t\t\t\t\t\tcase 'JobApplicantSkill':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Skill' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'JobApplicantEducation':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Course' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'JobApplicantLicense':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Type' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'JobApplicantLanguage':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Language' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'JobApplicantMembership':\n\t\t\t\t\t\t\toption_name = $.i18n._( 'Add New Membership' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tset_empty = false;\n\t\t\t\t\tthis.$( field_selector ).append( $( '' ).prop( 'value', '' ).text( '-- ' + option_name + ' --' ) );\n\t\t\t\t}\n\t\t\t//break; -- Do not break here, it should fall through to default.\n\t\t\tdefault:\n\t\t\t\tif ( set_empty === true ) {\n\t\t\t\t\tthis.$( field_selector ).append( $( '' ).prop( 'value', '' ).text( '-- ' + $.i18n._( 'None' ) + ' --' ) );\n\t\t\t\t}\n\t\t\t\tif ( _.size( source_data ) > 0 ) {\n\t\t\t\t\t$.each( source_data, function( value, label ) {\n\t\t\t\t\t\t$this.$( field_selector ).append( $( '' ).prop( 'value', value ).text( label ) );\n\t\t\t\t\t\tif ( $this.model.get( field ) == value ) {\n\t\t\t\t\t\t\t$this.$( field_selector ).val( value );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\t$this.$( field_selector ).selectpicker();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tregisterDatePicker() {\n\t\tvar time_format = 'h:mm TT';\n\t\tvar format = 'dd-M-y';\n\t\tvar focus_out_timer;\n\t\tvar is_open = false;\n\t\t// When portal mode, no user preference.\n\t\t// if ( LocalCacheData.getLoginUserPreference() ) {\n\t\t// \tformat = LocalCacheData.getLoginUserPreference().date_format_1;\n\t\t// \ttime_format = LocalCacheData.getLoginUserPreference().time_format_1;\n\t\t// }\n\t\tvar day_name_min = [\n\t\t\t$.i18n._( 'Sun' ), $.i18n._( 'Mon' ), $.i18n._( 'Tue' ),\n\t\t\t$.i18n._( 'Wed' ), $.i18n._( 'Thu' ), $.i18n._( 'Fri' ), $.i18n._( 'Sat' )\n\t\t];\n\t\tvar month_name_short = [\n\t\t\t$.i18n._( 'Jan' ), $.i18n._( 'Feb' ),\n\t\t\t$.i18n._( 'Mar' ), $.i18n._( 'Apr' ), $.i18n._( 'May' ),\n\t\t\t$.i18n._( 'Jun' ), $.i18n._( 'Jul' ), $.i18n._( 'Aug' ),\n\t\t\t$.i18n._( 'Sep' ), $.i18n._( 'Oct' ), $.i18n._( 'Nov' ),\n\t\t\t$.i18n._( 'Dec' )\n\t\t];\n\t\tvar current_text = $.i18n._( 'Today' );\n\t\tvar close_text = $.i18n._( 'Close' );\n\t\tvar options = {\n\t\t\tshowTime: false,\n\t\t\tdateFormat: format,\n\t\t\tshowHour: false,\n\t\t\tshowMinute: false,\n\t\t\tchangeMonth: true,\n\t\t\tchangeYear: true,\n\t\t\tshowButtonPanel: true,\n\t\t\tduration: '',\n\t\t\tshowAnim: '',\n\t\t\tyearRange: '-100:+10',\n\t\t\tshowOn: '',\n\t\t\tdayNamesMin: day_name_min,\n\t\t\tcurrentText: current_text,\n\t\t\tmonthNamesShort: month_name_short,\n\t\t\tcloseText: close_text,\n\t\t\tbeforeShow: function() {\n\t\t\t},\n\t\t\tonSelect: function( dateText ) {\n\t\t\t\t$( this ).change();\n\t\t\t},\n\t\t\tonClose: function() {\n\t\t\t\tfocus_out_timer = setTimeout( function() {\n\t\t\t\t\tis_open = false;\n\t\t\t\t}, 100 );\n\t\t\t}\n\n\t\t};\n\t\tthis.$( 'input[type=\"text\"].datepicker' ).datepicker( options );\n\t\tthis.$( 'input[type=\"text\"].datepicker' ).attr( 'placeholder', 'dd-mmm-yy' );\n\t\tthis.$( 'input[type=\"text\"].datepicker' ).bind( 'mouseup', function() {\n\t\t\tif ( !is_open ) {\n\t\t\t\t$( this ).datepicker( 'show' );\n\t\t\t\tis_open = true;\n\t\t\t} else {\n\t\t\t\tis_open = false;\n\t\t\t\tif ( focus_out_timer ) {\n\t\t\t\t\tclearTimeout( focus_out_timer );\n\t\t\t\t\tfocus_out_timer = null;\n\t\t\t\t}\n\t\t\t}\n\t\t} ).next('.glyphicon').bind( 'mouseup', function() { $(this).prev().trigger( 'mouseup' ) } ); // this allows clicking on the calendar icon as well as the input box\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tvar self = this;\n\t\tvar unindexed_array = this.$( '.detail-form' ).serializeArray();\n\t\t$.map( unindexed_array, function( row, i ) {\n\t\t\tif ( !Global.isSet( self.model.get( row['name'] ) ) ) {\n\t\t\t\tself.model.set( row['name'], row['value'] );\n\t\t\t}\n\t\t} );\n\t\tif ( !this.model.has( 'qualification_id' ) ) {\n\t\t\tthis.model.set( 'qualification_id', false );\n\t\t}\n\t}\n\n\taddQualification() {\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\targs.type_id = this.qualification_type_id;\n\t\tvar name = args.name = this.getQualificationWidget().val();\n\t\tthis.qualification_api.setQualification( args, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tif ( !res.isValid() ) {\n\t\t\t\t\t$this.setErrorTips( res );\n\t\t\t\t} else {\n\t\t\t\t\t$this.$( 'select[name=\\'qualification_id\\']' ).selectpicker( 'destroy' );\n\t\t\t\t\tvar new_id = res.getResult();\n\t\t\t\t\t$( '