"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( '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\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\tthis.setEditViewDataDone();\n\t}\n\n\tsetEditViewDataDone() {\n\t\tif ( this.model.get( 'enable_calc_experience' ) === true ) {\n\t\t\tthis.$( 'input[name=\"experience\"]' ).attr( 'readonly', 'true' );\n\t\t} else {\n\t\t\tthis.$( 'input[name=\"experience\"]' ).removeAttr( 'readonly' );\n\t\t}\n\t\t$( '.edit-view-tab-bar' ).css( 'opacity', 1 );\n\t}\n\n\tonFormItemChange( e, doNotValidate ) {\n\t\tvar key = e.currentTarget.name;\n\t\tthis.model.set( key, $( e.currentTarget ).val() );\n\t\tif ( this.model.get( 'first_used_date' ) ) {\n\t\t\tthis.model.set( 'enable_calc_experience', true );\n\t\t\tthis.$( 'input[name=\"enable_calc_experience\"]' ).prop( 'checked', 'checked' );\n\t\t\tthis.$( 'input[name=\"enable_calc_experience\"]' )[0].checked = true;\n\t\t\tthis.$( 'input[name=\"enable_calc_experience\"]' ).attr( 'disabled', 'disabled' );\n\t\t} else {\n\t\t\tthis.model.set( 'enable_calc_experience', false );\n\t\t\tif ( this.$( 'input[name=\"enable_calc_experience\"]' ) && this.$( 'input[name=\"enable_calc_experience\"]' )[0] ) {\n\t\t\t\tthis.$( 'input[name=\"enable_calc_experience\"]' ).removeAttr( 'checked' );\n\t\t\t\tthis.$( 'input[name=\"enable_calc_experience\"]' )[0].checked = false;\n\t\t\t\tthis.$( 'input[name=\"enable_calc_experience\"]' ).removeAttr( 'disabled' );\n\t\t\t}\n\t\t}\n\t\tswitch ( key ) {\n\t\t\t// case 'country':\n\t\t\t// case 'identification_country':\n\t\t\t// \tvar widget = this.$('select[name=\"' + key + '\"]');\n\t\t\t// \twidget.val( null );\n\t\t\t// \tbreak;\n\t\t\tcase 'qualification_id':\n\t\t\t\tif ( this.model.get( key ) === '' && this.enable_add_qualification ) {\n\t\t\t\t\tthis.showAddQualificationContainer();\n\t\t\t\t\tdoNotValidate = true;\n\t\t\t\t} else {\n\t\t\t\t\tthis.hideAddQualificationContainer();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'enable_calc_experience':\n\t\t\t\tif ( $( e.currentTarget ).is( ':checked' ) ) {\n\t\t\t\t\tthis.model.set( key, true );\n\t\t\t\t\tthis.calcExperience();\n\t\t\t\t} else {\n\t\t\t\t\tthis.model.set( key, false );\n\t\t\t\t\tthis.$( 'input[name=\"experience\"]' ).removeAttr( 'readonly' );\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\t// if ( this.model.get('enable_calc_experience') === true ) {\n\t\t\t\t// \tthis.calcExperience();\n\t\t\t\t// }\n\t\t\t\tthis.calcExperience();\n\t\t\t\tbreak;\n\t\t}\n\t\t// if ( key == 'country' ) {\n\t\t// \tthis.eSetProvince( this.$('select[name=\"country\"]').val(), true );\n\t\t// \t// this.clearErrorTips();\n\t\t// \t// return;\n\t\t// }\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tcalcExperience() {\n\t\tif ( this.model.get( 'enable_calc_experience' ) === true ) {\n\t\t\tthis.$( 'input[name=\"experience\"]' ).attr( 'readonly', 'true' );\n\t\t} else {\n\t\t\tthis.$( 'input[name=\"experience\"]' ).removeAttr( 'readonly' );\n\t\t}\n\t\tvar first_used_date = this.$( 'input[name=\"first_used_date\"]' ).val();\n\t\tvar last_used_date = this.$( 'input[name=\"last_used_date\"]' ).val();\n\t\tlast_used_date = last_used_date ? last_used_date : new Date().format( 'DD-MMM-YY' );\n\t\tvar experience = 0;\n\t\tif ( first_used_date !== '' && last_used_date !== '' ) {\n\t\t\texperience = this.api.calcExperience( first_used_date, last_used_date, { async: false } ).getResult();\n\t\t\tthis.$( 'input[name=\"experience\"]' ).val( experience );\n\t\t} else {\n\t\t\tthis.$( 'input[name=\"experience\"]' ).val( experience );\n\t\t}\n\t\tthis.model.set( 'experience', experience );\n\t}\n\n\t// eSetProvince: function( val, refresh ) {\n\t// \tvar $this = this;\n\t// \tif ( !val || val === '-1' || val === '0' ) {\n\t// \t\t$this.e_province_array = [];\n\t// \t\t$this.setSourceData( 'province', [] );\n\t// \t} else {\n\t// \t\tthis.company_api.getOptions( 'province', val, {\n\t// \t\t\tonResult: function( res ) {\n\t// \t\t\t\tres = res.getResult();\n\t// \t\t\t\tif ( !res ) {\n\t// \t\t\t\t\tres = [];\n\t// \t\t\t\t}\n\t// \t\t\t\t$this.e_province_array = Global.buildRecordArray( res );\n\t// \t\t\t\tif ( refresh && $this.e_province_array.length > 0 ) {\n\t// \t\t\t\t\t$this.model.set( 'province', $this.e_province_array[0].value )\n\t// \t\t\t\t\t$this.$('select[name=\"province\"]').val( $this.model.get( 'province') );\n\t// \t\t\t\t}\n\t// \t\t\t\t$this.setSourceData( 'province', res );\n\t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Y2VfYXJyYXkubGVuZ3RoID4gMCApIHtcblx0Ly8gXHRcdFx0XHRcdCR0aGlzLm1vZGVsLnNldCggJ3Byb3ZpbmNlJywgJHRoaXMuZV9wcm92aW5jZV9hcnJheVswXS52YWx1ZSApXG5cdC8vIFx0XHRcdFx0XHQkdGhpcy4kKCdzZWxlY3RbbmFtZT1cInByb3ZpbmNlXCJdJykudmFsKCAkdGhpcy5tb2RlbC5nZXQoICdwcm92aW5jZScpICk7XG5cdC8vIFx0XHRcdFx0fVxuXHQvLyBcdFx0XHRcdCR0aGlzLnNldFNvdXJjZURhdGEoICdwcm92aW5jZScsIHJlcyApO1xuXHQvLyBcdFx0XHR9XG5cdC8vIFx0XHR9ICk7XG5cdC8vIFx0fVxuXHQvLyB9LFxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9548\n")},3757:(__unused_webpack_module,__webpack_exports__,__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$( '