TimeTrex/interface/html5/dist/employees-user_default-UserDefaultViewController.bundle.js

1 line
110 KiB
JavaScript

"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["employees-user_default-UserDefaultViewController"],{4777:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UserDefaultViewController\": () => (/* binding */ UserDefaultViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass UserDefaultViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#user_default_view_container',\n\n\t\t\tcompany_api: null,\n\t\t\tuser_preference_api: null,\n\t\t\thierarchy_control_api: null,\n\n\t\t\tcountry_array: null,\n\t\t\tprovince_array: null,\n\n\t\t\tnotification_type_array: null,\n\t\t\tpriority_array: null,\n\t\t\toriginal_user_preference_notification_data: [],\n\n\t\t\te_province_array: null,\n\t\t\tlanguage_array: null,\n\t\t\tdate_format_array: null,\n\t\t\ttime_format_array: null,\n\t\t\ttime_unit_format_array: null,\n\t\t\tdistance_format_array: null,\n\t\t\ttime_zone_array: null,\n\t\t\tstart_week_day_array: null,\n\n\t\t\tuser_preference_notification_api: null,\n\t\t\tuser_default_preference_notification_api: null\n\t\t} );\n\n\t\t//Community editions can only have 1 new hire default. For those editions do not show the list view.\n\t\tif ( Global.getProductEdition() == 10 ) {\n\t\t\tdelete options.el;\n\t\t}\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\n\t\t//Community editions can only have 1 new hire default. For those editions do not show the list view.\n\t\tif ( Global.getProductEdition() > 10 ) {\n\t\t\tthis.edit_view_tpl = 'UserDefaultEditView.html';\n\t\t}\n\n\t\tthis.permission_id = 'user_default';\n\t\tthis.viewId = 'UserDefault';\n\t\tthis.script_name = 'UserDefaultView';\n\t\tthis.table_name_key = 'user_default';\n\t\tthis.context_menu_name = $.i18n._( 'New Hire Defaults' );\n\t\tthis.api = TTAPI.APIUserDefault;\n\t\tthis.company_api = TTAPI.APICompany;\n\t\tthis.user_preference_api = TTAPI.APIUserPreference;\n\t\tthis.hierarchy_control_api = TTAPI.APIHierarchyControl;\n\t\tthis.select_company_id = LocalCacheData.getCurrentCompany().id;\n\t\tthis.user_preference_notification_api = TTAPI.APIUserPreferenceNotification;\n\t\tthis.user_default_preference_notification_api = TTAPI.APIUserDefaultPreferenceNotification;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\trender() {\n\t\tsuper.render();\n\t}\n\n\tinitOptions( callBack ) {\n\n\t\tvar options = [\n\t\t\t{ option_name: 'language', field_name: 'language', api: this.user_preference_api },\n\t\t\t{ option_name: 'date_format', field_name: 'date_format', api: this.user_preference_api },\n\t\t\t{ option_name: 'time_format', field_name: 'time_format', api: this.user_preference_api },\n\t\t\t{ option_name: 'time_unit_format', field_name: 'time_unit_format', api: this.user_preference_api },\n\t\t\t{ option_name: 'distance_format', field_name: 'distance_format', api: this.user_preference_api },\n\t\t\t{ option_name: 'time_zone', field_name: 'time_zone', api: this.user_preference_api },\n\t\t\t{ option_name: 'start_week_day', field_name: 'start_week_day', api: this.user_preference_api },\n\t\t\t{ option_name: 'country', field_name: 'country', api: this.company_api },\n\t\t\t{ option_name: 'notification_type', field_name: null, api: this.user_preference_notification_api },\n\t\t\t{ option_name: 'priority', field_name: null, api: this.user_preference_notification_api }\n\t\t];\n\n\t\tthis.initDropDownOptions( options, function( result ) {\n\t\t\tif ( callBack ) {\n\t\t\t\tcallBack( result ); // First to initialize drop down options, and then to initialize edit view UI.\n\t\t\t}\n\t\t} );\n\t}\n\n\tinitInsideEditorData() {\n\t\tvar $this = this;\n\n\t\tvar filter = {};\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_data.user_default_id = $this.current_edit_record.id;\n\n\t\t$this.user_default_preference_notification_api.getUserDefaultPreferenceNotification( filter, true, {\n\t\t\tonResult: function( res ) {\n\n\t\t\t\tvar data = res.getResult();\n\t\t\t\tvar array_data = [];\n\t\t\t\tfor ( var key in data ) {\n\n\t\t\t\t\tif ( !data.hasOwnProperty( key ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_data.push( data[key] );\n\t\t\t\t}\n\t\t\t\tarray_data = array_data.sort( function( a, b ) {\n\t\t\t\t\treturn $this.notification_type_array.findIndex( p => p.id === a.type_id ) - $this.notification_type_array.findIndex( p => p.id === b.type_id );\n\t\t\t\t} );\n\n\t\t\t\t$this.original_user_preference_notification_data = _.map(array_data, _.clone);\n\n\t\t\t\t$this.editor.setValue( array_data );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tinsideEditorSetValue( val ) {\n\t\tvar len = val.length;\n\n\t\tif ( len === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.removeAllRows();\n\t\tfor ( var i = 0; i < val.length; i++ ) {\n\t\t\tif ( Global.isSet( val[i] ) ) {\n\t\t\t\tvar row = val[i];\n\t\t\t\t//converting status_id and device_id into boolean values to be used for checkboxes\n\t\t\t\trow.enabled = row.status_id == 10;\n\t\t\t\trow.web_push_enabled = row.device_id.includes( 4 );\n\t\t\t\trow.email_work_enabled = row.device_id.includes( 256 );\n\t\t\t\trow.email_home_enabled = row.device_id.includes( 512 );\n\t\t\t\trow.app_push_enabled = row.device_id.includes( 32768 );\n\t\t\t\tif ( row.type_id.startsWith( 'reminder_' ) ) {\n\t\t\t\t\trow.reminder_delay = row.reminder_delay;\n\t\t\t\t}\n\t\t\t\tthis.addRow( row );\n\t\t\t}\n\t\t}\n\t}\n\n\tinsideEditorAddRow( data, index ) {\n\t\tif ( !data ) {\n\t\t\tdata = {};\n\t\t}\n\n\t\tvar row = this.getRowRender(); //Get Row render\n\t\tvar render = this.getRender(); //get render, should be a table\n\t\tvar widgets = {}; //Save each row's widgets\n\n\t\t//Build row widgets\n\n\t\t//Enabled\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'enabled' } );\n\t\tform_item_input.setValue( data.enabled );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 0 ).append( form_item_input );\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\t//Type\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'type_id' } );\n\t\tform_item_input.setSourceData( Global.addFirstItemToArray( this.parent_controller.notification_type_array ) );\n\t\tform_item_input.setValue( data.type_id );\n\t\tform_item_input.setEnabled( false );\n\t\tform_item_input.css( 'text-align-last', 'center' );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 1 ).append( form_item_input );\n\n\t\t//Priority\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'priority_id', set_empty: false } );\n\t\tform_item_input.setSourceData( this.parent_controller.priority_array );\n\t\tform_item_input.setValue( data.priority_id );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 2 ).append( form_item_input );\n\n\t\t//Web Push\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'web_push_enabled' } );\n\t\tform_item_input.setValue( data.web_push_enabled );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 3 ).append( form_item_input );\n\n\t\t//Work Email\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'email_work_enabled' } );\n\t\tform_item_input.setValue( data.email_work_enabled );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 4 ).append( form_item_input );\n\n\t\t//Home Email\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'email_home_enabled' } );\n\t\tform_item_input.setValue( data.email_home_enabled );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 5 ).append( form_item_input );\n\n\t\t//App Push\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'app_push_enabled' } );\n\t\tform_item_input.setValue( data.app_push_enabled );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 6 ).append( form_item_input );\n\n\t\t//Settings\n\t\tif ( data.type_id.startsWith( 'reminder_' ) ) {\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tform_item_input.TTextInput( { field: 'reminder_delay', need_parser_sec: true, mode: 'time_unit' } );\n\t\t\tform_item_input.setValue( data.reminder_delay );\n\t\t\twidgets[form_item_input.getField()] = form_item_input;\n\n\t\t\tvar widgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\t\tvar label = $( '<span class=\\'widget-left-label\\'> ' + $.i18n._( 'Delay' ) + ': </span>' );\n\n\t\t\twidgetContainer.append( label );\n\t\t\twidgetContainer.append( form_item_input );\n\n\t\t\trow.children().eq( 7 ).append( widgetContainer );\n\t\t}\n\n\t\t//Save current set item\n\t\twidgets.current_edit_item = data;\n\n\t\tif ( typeof index != 'undefined' ) {\n\n\t\t\trow.insertAfter( $( render ).find( 'tr' ).eq( index ) );\n\t\t\tthis.rows_widgets_array.splice( ( index ), 0, widgets );\n\n\t\t} else {\n\t\t\t$( render ).append( row );\n\t\t\tthis.rows_widgets_array.push( widgets );\n\t\t}\n\n\t\tif ( this.parent_controller.is_viewing ) {\n\t\t\trow.find( '.control-icon' ).hide();\n\t\t}\n\n\t\tthis.removeLastRowLine();\n\t}\n\n\tinsideEditorGetValue( current_edit_item_id ) {\n\n\t\tvar len = this.rows_widgets_array.length;\n\n\t\tvar result = [];\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar row = this.rows_widgets_array[i];\n\t\t\tvar data = row.current_edit_item;\n\t\t\tdata.priority_id = row.priority_id.getValue();\n\t\t\tdata.status_id = row.enabled.getValue() === true ? 10 : 20;\n\t\t\tdata.device_id = [];\n\t\t\tif ( row.web_push_enabled.getValue() === true )\n\t\t\t\tdata.device_id.push( 4 );\n\t\t\tif ( row.email_work_enabled.getValue() === true )\n\t\t\t\tdata.device_id.push( 256 );\n\t\t\tif ( row.email_home_enabled.getValue() === true )\n\t\t\t\tdata.device_id.push( 512 );\n\t\t\tif ( row.app_push_enabled.getValue() === true )\n\t\t\t\tdata.device_id.push( 32768 );\n\n\t\t\tif ( data.type_id.startsWith( 'reminder_' ) && row.reminder_delay ) {\n\t\t\t\tdata.reminder_delay = row.reminder_delay.getValue();\n\t\t\t}\n\n\t\t\tresult.push( data );\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tonSaveResult( result ) {\n\t\tvar $this = this;\n\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\n\t\t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.onSaveDone( result );\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorMenu();\n\t\t\t$this.setErrorTips( result );\n\n\t\t}\n\t}\n\n\tonSaveDone( result ) {\n\t\tif ( result.isValid() ) {\n\t\t\tif ( Global.getProductEdition() > 10 ) {\n\t\t\t\tthis.search();\n\t\t\t}\n\t\t\tthis.removeEditView();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tsaveInsideEditorData( callBack ) {\n\n\t\tvar data = this.editor.getValue( this.refresh_id );\n\n\t\tfor ( var i = 0; i < data.length; i++ ) {\n\t\t\tdata[i].user_default_id = this.refresh_id;\n\t\t}\n\n\t\tlet changed_data = this.getChangedRecords( data, this.original_user_preference_notification_data, ['enabled', 'web_push_enabled', 'email_work_enabled', 'email_home_enabled', 'app_push_enabled'] );\n\n\t\tif ( Array.isArray( changed_data ) && changed_data.length > 0 ) {\n\t\t\tthis.user_default_preference_notification_api.setUserDefaultPreferenceNotification( changed_data, {\n\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\tif ( res.isValid() ) {\n\t\t\t\t\t\tif ( Global.isSet( callBack ) ) {\n\t\t\t\t\t\t\tcallBack();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTAlertManager.showErrorAlert( res );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tif ( Global.isSet( callBack ) ) {\n\t\t\t\tcallBack();\n\t\t\t}\n\t\t}\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model;\n\t\t//Community editions can only have 1 new hire default. For those editions do not show the list view.\n\t\tif ( Global.getProductEdition() == 10 ) {\n\t\t\tcontext_menu_model = {\n\t\t\t\texclude: ['default'],\n\t\t\t\tinclude: [\n\t\t\t\t\t'save',\n\t\t\t\t\t'cancel'\n\t\t\t\t]\n\t\t\t};\n\t\t} else {\n\t\t\tcontext_menu_model = {\n\t\t\t\texclude: ['mass_edit'],\n\t\t\t\tinclude: [\n\t\t\t\t\t'save',\n\t\t\t\t\t'cancel'\n\t\t\t\t]\n\t\t\t};\n\t\t}\n\n\t\treturn context_menu_model;\n\t}\n\n\tgetUserDefaultData( callBack ) {\n\t\tvar $this = this;\n\n\t\t// First to get current company's user default data, if no have any data to get the default data which has been set up in TTAPI.APIUserDefault.\n\n\t\t$this.api['get' + $this.api.key_name]( {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\tif ( Global.isSet( result_data[0] ) ) {\n\t\t\t\t\tcallBack( result_data[0] );\n\t\t\t\t} else {\n\t\t\t\t\t$this.api['get' + $this.api.key_name + 'DefaultData']( {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\t\t\tcallBack( result_data );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tthis.initInsideEditorData();\n\t}\n\n\topenEditView() {\n\n\t\tif ( Global.getProductEdition() > 10 ) {\n\t\t\tsuper.openEditView();\n\t\t\treturn;\n\t\t}\n\n\t\tvar $this = this;\n\n\t\tif ( $this.edit_only_mode ) {\n\n\t\t\t$this.initOptions( function( result ) {\n\n\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t$this.initEditViewUI( 'UserDefault', 'UserDefaultEditView.html' );\n\t\t\t\t}\n\n\t\t\t\t$this.getUserDefaultData( function( result ) {\n\t\t\t\t\t// Waiting for the TTAPI.API returns data to set the current edit record.\n\t\t\t\t\t$this.current_edit_record = result;\n\n\t\t\t\t\t$this.initEditView();\n\n\t\t\t\t} );\n\n\t\t\t} );\n\n\t\t} else {\n\t\t\tif ( !this.edit_view ) {\n\t\t\t\tthis.initEditViewUI( 'UserTitle', 'UserTitleEditView.html' );\n\t\t\t}\n\n\t\t}\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\n\t\tthis.setIsChanged( target );\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\t\tthis.current_edit_record[key] = c_value;\n\n\t\tif ( key === 'country' ) {\n\t\t\tvar widget = this.edit_view_ui_dic['province'];\n\t\t\twidget.setValue( null );\n\t\t\tthis.onCountryChange();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key === 'legal_entity_id' ) {\n\t\t\tvar widget = this.edit_view_ui_dic['company_deduction'];\n\t\t\tif ( this.current_edit_record && this.current_edit_record.legal_entity_id !== null ) {\n\t\t\t\t//Setting setSourceData to false allows the AComboBox to make the API call for getCompanyDeduction with\n\t\t\t\t//the correct new filter_data. Without setSourceData( false ) the AComboBox will only show the results\n\t\t\t\t//for the previous API call and potentially the wrong company_deduction data.\n\t\t\t\twidget.setSourceData( false );\n\t\t\t\tvar args = {};\n\t\t\t\targs.filter_data = { legal_entity_id: this.current_edit_record.legal_entity_id };\n\t\t\t\twidget.setDefaultArgs( args );\n\t\t\t\twidget.setValue( false );\n\t\t\t} else {\n\t\t\t\twidget.setValue( false );\n\t\t\t}\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tsetErrorMenu() {\n\n\t\tvar context_menu_array = ContextMenuManager.getMenuModelByMenuId( this.determineContextMenuMountAttributes().id );\n\t\tvar len = context_menu_array.length;\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tlet context_btn = context_menu_array[i];\n\t\t\tlet id = context_menu_array[i].id;\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\n\t\t\tswitch ( id ) {\n\t\t\t\tcase 'cancel':\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}\n\n\tonSetSearchFilterFinished() {\n\t\tvar combo;\n\t\tvar select_value;\n\t\tif ( this.search_panel.getSelectTabIndex() === 0 ) {\n\t\t\tcombo = this.basic_search_field_ui_dic['country'];\n\t\t\tselect_value = combo.getValue();\n\t\t\tthis.setSearchFilterProvince( select_value );\n\t\t}\n\t}\n\n\tonBuildBasicUIFinished() {\n\t\tthis.basic_search_field_ui_dic['country'].change( $.proxy( function() {\n\t\t\tvar combo = this.basic_search_field_ui_dic['country'];\n\t\t\tvar selectVal = combo.getValue();\n\n\t\t\tthis.setSearchFilterProvince( selectVal );\n\n\t\t\tthis.basic_search_field_ui_dic['province'].setValue( null );\n\n\t\t}, this ) );\n\t}\n\n\tsetSearchFilterProvince( val, m ) {\n\t\tvar $this = this;\n\n\t\tif ( !val || val === '-1' || val === '0' ) {\n\t\t\t$this.province_array = [];\n\t\t\tthis.basic_search_field_ui_dic['province'].setSourceData( [] );\n\n\t\t} else {\n\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\n\t\t\t\t\t$this.province_array = Global.buildRecordArray( res );\n\t\t\t\t\t$this.basic_search_field_ui_dic['province'].setSourceData( $this.province_array );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\thierarchyPermissionValidate( p_id, selected_item ) {\n\n\t\tif ( PermissionManager.validate( 'hierarchy', 'edit' ) ||\n\t\t\tPermissionManager.validate( 'user', 'edit_hierarchy' ) ) {\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tcheckTabPermissions( tab ) {\n\t\tvar retval = false;\n\n\t\tswitch ( tab ) {\n\t\t\tcase 'tab_hierarchy':\n\t\t\t\tif ( this.select_company_id === LocalCacheData.getCurrentCompany().id ) {\n\t\t\t\t\tretval = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tretval = super.checkTabPermissions( tab );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn retval;\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tvar dont_set_dic = {};\n\t\t//Set current edit record data to all widgets\n\t\tfor ( var key in this.current_edit_record ) {\n\t\t\tvar widget = this.edit_view_ui_dic[key];\n\t\t\tif ( Global.isSet( widget ) || key === 'hierarchy_control' ) {\n\t\t\t\tswitch ( key ) {\n\t\t\t\t\tcase 'country':\n\t\t\t\t\t\tthis.setCountryValue( widget, key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'hierarchy_control':\n\t\t\t\t\t\tif ( this.show_hierarchy ) {\n\t\t\t\t\t\t\tfor ( var h_key in this.current_edit_record.hierarchy_control ) {\n\t\t\t\t\t\t\t\tvar value = this.current_edit_record.hierarchy_control[h_key];\n\t\t\t\t\t\t\t\tif ( this.edit_view_ui_dic[h_key] ) {\n\t\t\t\t\t\t\t\t\twidget = this.edit_view_ui_dic[h_key];\n\t\t\t\t\t\t\t\t\tdont_set_dic[h_key] = true;\n\t\t\t\t\t\t\t\t\twidget.setValue( value );\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\tbreak;\n\t\t\t\t\tcase 'company_deduction':\n\t\t\t\t\t\tvar args = {};\n\t\t\t\t\t\targs.filter_data = { legal_entity_id: this.current_edit_record.legal_entity_id };\n\t\t\t\t\t\twidget.setDefaultArgs( args );\n\t\t\t\t\t\twidget.setValue( this.current_edit_record.company_deduction );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif ( !dont_set_dic[key] ) {\n\t\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tthis.collectUIDataToCurrentEditRecord();\n\t\tthis.setEditViewDataDone();\n\t}\n\n\tinitDropDownOptions( options, callBack ) {\n\t\tvar $this = this;\n\t\tvar len = options.length + 1;\n\t\tvar complete_count = 0;\n\t\tvar option_result = [];\n\t\tif ( this.hierarchyPermissionValidate() ) {\n\n\t\t\t$this.hierarchy_control_api.getOptions( 'object_type', {\n\t\t\t\tonResult: function( res_1 ) {\n\t\t\t\t\tvar data_1 = res_1.getResult();\n\t\t\t\t\tif ( data_1 ) {\n\t\t\t\t\t\tvar array = [];\n\n\t\t\t\t\t\tfor ( var key in data_1 ) {\n\t\t\t\t\t\t\tarray.push( { id: Global.removeSortPrefix( key ), value: data_1[key] } );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this.hierarchy_ui_model = array;\n\t\t\t\t\t}\n\n\t\t\t\t\tcomplete_count = complete_count + 1;\n\t\t\t\t\tif ( complete_count === len ) {\n\t\t\t\t\t\tcallBack( option_result );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} else {\n\t\t\tthis.show_hierarchy = false;\n\t\t\tcomplete_count = complete_count + 1;\n\t\t}\n\n\t\tfor ( var i = 0; i < len - 1; i++ ) {\n\t\t\tvar option_info = options[i];\n\n\t\t\tthis.initDropDownOption( option_info.option_name, option_info.field_name, option_info.api, onGetOptionResult );\n\n\t\t}\n\n\t\tfunction onGetOptionResult( result ) {\n\n\t\t\toption_result.push( result );\n\n\t\t\tcomplete_count = complete_count + 1;\n\n\t\t\tif ( complete_count === len ) {\n\n\t\t\t\tcallBack( option_result );\n\t\t\t}\n\t\t}\n\t}\n\n\tsetProvince( val, m ) {\n\t\tvar $this = this;\n\n\t\tif ( !val || val === '-1' || val === '0' ) {\n\t\t\t$this.province_array = [];\n\n\t\t} else {\n\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\n\t\t\t\t\t$this.province_array = Global.buildRecordArray( res );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\teSetProvince( val, refresh ) {\n\t\tvar $this = this;\n\t\tvar province_widget = $this.edit_view_ui_dic['province'];\n\n\t\tif ( !val || val === '-1' || val === '0' ) {\n\t\t\t$this.e_province_array = [];\n\t\t\tprovince_widget.setSourceData( [] );\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\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.current_edit_record.province = $this.e_province_array[0].value;\n\t\t\t\t\t\tprovince_widget.setValue( $this.current_edit_record.province );\n\t\t\t\t\t}\n\t\t\t\t\tprovince_widget.setSourceData( $this.e_province_array );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tbuildEditViewUI() {\n\t\tvar $this = this;\n\t\tsuper.buildEditViewUI();\n\n\t\tvar tab_model = {\n\t\t\t'tab_new_hire_default': { 'label': $.i18n._( 'New Hire Defaults' ) },\n\t\t\t'tab_employee_id': { 'label': $.i18n._( 'Employee Identification' ) },\n\t\t\t'tab_contact_info': { 'label': $.i18n._( 'Contact Information' ) },\n\t\t\t'tab_hierarchy': {\n\t\t\t\t'label': $.i18n._( 'Hierarchy' ),\n\t\t\t\t'html_template': this.getHierarchyTabHtml()\n\t\t\t},\n\t\t\t'tab_tax_deduction': { 'label': $.i18n._( 'Tax / Deductions' ) },\n\t\t\t'tab_employee_preference': { 'label': $.i18n._( 'Preferences' ) },\n\t\t\t'tab_preferences_notification': {\n\t\t\t\t'label': $.i18n._( 'Notifications' ),\n\t\t\t\t'html_template': this.getPreferencesNotificationTabHtml()\n\t\t\t},\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tif ( Global.getProductEdition() > 10 ) {\n\t\t\tthis.navigation.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIUserDefault,\n\t\t\t\tid: this.script_name + '_navigation',\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_user_default',\n\t\t\t\tnavigation_mode: true,\n\t\t\t\tshow_search_inputs: true\n\t\t\t} );\n\n\t\t\tthis.setNavigation();\n\t\t}\n\n\t\t//Tab 0 start\n\t\tvar tab_new_hire_default = this.edit_view_tab.find( '#tab_new_hire_default' );\n\t\tvar tab_new_hire_default_column1 = tab_new_hire_default.find( '.first-column' );\n\t\tthis.edit_view_tabs[0] = [];\n\t\tthis.edit_view_tabs[0].push( tab_new_hire_default );\n\n\t\t//Name\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'name' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_new_hire_default_column1, '' );\n\n\t\t//Display Order\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'display_order' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Display Order' ), form_item_input, tab_new_hire_default_column1, '' );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_user',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'created_by_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Created By' ), form_item_input, tab_new_hire_default_column1 );\n\n\t\t//Tab 1 start\n\t\tvar tab_employee_id = this.edit_view_tab.find( '#tab_employee_id' );\n\t\tvar tab_employee_id_column1 = tab_employee_id.find( '.first-column' );\n\t\tthis.edit_view_tabs[1] = [];\n\t\tthis.edit_view_tabs[1].push( tab_employee_id_column1 );\n\n\t\t//Legal Entity\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APILegalEntity,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_legal_entity',\n\t\t\tshow_search_inputs: true,\n//\t\t\tset_empty: true,\n\t\t\tfield: 'legal_entity_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Legal Entity' ), form_item_input, tab_employee_id_column1 );\n\n\t\t//Permission Group\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIPermissionControl,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_permission_control',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true,\n\t\t\tfield: 'permission_control_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Permission Group' ), form_item_input, tab_employee_id_column1, '' );\n\n\t\t//Terminated Permission Group\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIPermissionControl,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_permission_control',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true,\n\t\t\tfield: 'terminated_permission_control_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Terminated Permission Group' ), form_item_input, tab_employee_id_column1, '' );\n\n\t\t// Pay Period Schedule\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIPayPeriodSchedule,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_pay_period_schedule',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'pay_period_schedule_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Pay Period Schedule' ), form_item_input, tab_employee_id_column1 );\n\n\t\t//Policy Group\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIPolicyGroup,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_policy_group',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'policy_group_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Policy Group' ), form_item_input, tab_employee_id_column1 );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tfield: 'recurring_schedule',\n\t\t\tapi_class: TTAPI.APIRecurringScheduleTemplateControl,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_recurring_template_control',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Recurring Schedule' ), form_item_input, tab_employee_id_column1, 'first_last' );\n\n\t\t//Currency\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APICurrency,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_currency',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'currency_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Currency' ), form_item_input, tab_employee_id_column1 );\n\n\t\t//Title\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUserTitle,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_job_title',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'title_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Title' ), form_item_input, tab_employee_id_column1 );\n\n\t\t//Default Branch\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIBranch,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_branch',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'default_branch_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Default Branch' ), form_item_input, tab_employee_id_column1 );\n\n\t\t//Default Department\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIDepartment,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_department',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'default_department_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Default Department' ), form_item_input, tab_employee_id_column1, '' );\n\n\t\t//Tab 2 start\n\t\tvar tab_contact_info = this.edit_view_tab.find( '#tab_contact_info' );\n\t\tvar tab_contact_info_column1 = tab_contact_info.find( '.first-column' );\n\t\tthis.edit_view_tabs[2] = [];\n\t\tthis.edit_view_tabs[2].push( tab_contact_info_column1 );\n\n\t\t//City\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'city', width: 149 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'City' ), form_item_input, tab_contact_info_column1, '' );\n\n\t\t//Country\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'country', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.country_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Country' ), form_item_input, tab_contact_info_column1 );\n\n\t\t//Province / State\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'province' } );\n\t\tform_item_input.setSourceData( [] );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Province / State' ), form_item_input, tab_contact_info_column1 );\n\n\t\t//Work Phone\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'work_phone', width: 149 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Work Phone' ), form_item_input, tab_contact_info_column1 );\n\n\t\t//Work Phone Ext\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'work_phone_ext' } );\n\t\tform_item_input.css( 'width', '50' );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Work Phone Ext' ), form_item_input, tab_contact_info_column1 );\n\n\t\t//Work Email\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'work_email', width: 219 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Work Email' ), form_item_input, tab_contact_info_column1, '' );\n\n\t\t//Tab 3 start\n\t\tvar tab_hierarchy = this.edit_view_tab.find( '#tab_hierarchy' );\n\t\tvar tab_hierarchy_column1 = tab_hierarchy.find( '.first-column' );\n\t\tthis.edit_view_tabs[3] = [];\n\t\tthis.edit_view_tabs[3].push( tab_hierarchy_column1 );\n\n\t\tif ( this.hierarchyPermissionValidate() ) {\n\t\t\tvar res = this.hierarchy_control_api.getHierarchyControlOptions( { async: false } );\n\t\t\t$this.hierarchy_options_dic = {};\n\t\t\tvar data = res.getResult();\n\t\t\tfor ( var key in data ) {\n\t\t\t\tif ( parseInt( key ) === 200 && Global.getProductEdition() != 25 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$this.hierarchy_options_dic[key] = Global.buildRecordArray( data[key] );\n\t\t\t}\n\t\t\tif ( _.size( $this.hierarchy_options_dic ) > 0 ) {\n\t\t\t\t$this.show_hierarchy = true;\n\t\t\t} else {\n\t\t\t\t$this.show_hierarchy = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( this.show_hierarchy && this.hierarchy_ui_model ) {\n\t\t\tthis.edit_view_tab.find( '#tab_hierarchy' ).find( '.first-column' ).css( 'display', 'block' );\n\t\t\tthis.edit_view_tab.find( '#tab_hierarchy' ).find( '.hierarchy-div' ).css( 'display', 'none' );\n\t\t\tvar len = this.hierarchy_ui_model.length;\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\tvar ui_model = this.hierarchy_ui_model[i];\n\t\t\t\tvar options = this.hierarchy_options_dic[ui_model.id];\n\t\t\t\tif ( options ) {\n\t\t\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\t\t\t\tform_item_input.TComboBox( { field: ui_model.id } );\n\t\t\t\t\tform_item_input.setSourceData( options );\n\t\t\t\t\tthis.addEditFieldToColumn( ui_model.value, form_item_input, tab_hierarchy_column1 );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.edit_view_tab.find( '#tab_hierarchy' ).find( '.first-column' ).css( 'display', 'none' );\n\t\t\tthis.edit_view_tab.find( '#tab_hierarchy' ).find( '.hierarchy-div' ).NoHierarchyBox( { related_view_controller: this } );\n\t\t\tthis.edit_view_tab.find( '#tab_hierarchy' ).find( '.hierarchy-div' ).css( 'display', 'block' );\n\t\t}\n\n\t\t//Tab 4 start\n\t\tvar tab_tax_deduction = this.edit_view_tab.find( '#tab_tax_deduction' );\n\t\tvar tab_tax_deduction_column1 = tab_tax_deduction.find( '.first-column' );\n\t\tthis.edit_view_tabs[4] = [];\n\t\tthis.edit_view_tabs[4].push( tab_tax_deduction_column1 );\n\n\t\t// Tax / Deductions\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tfield: 'company_deduction',\n\t\t\tlayout_name: 'global_deduction',\n\t\t\tapi_class: TTAPI.APICompanyDeduction,\n\t\t\tallow_multiple_selection: true,\n\t\t\tset_empty: true\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tax / Deductions' ), form_item_input, tab_tax_deduction_column1, 'first_last' );\n\n\t\t//Tab 5 start\n\t\tvar tab_employee_preference = this.edit_view_tab.find( '#tab_employee_preference' );\n\t\tvar tab_employee_preference_column1 = tab_employee_preference.find( '.first-column' );\n\t\tthis.edit_view_tabs[5] = [];\n\t\tthis.edit_view_tabs[5].push( tab_employee_preference_column1 );\n\n\t\t// Language\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'language', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.language_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Language' ), form_item_input, tab_employee_preference_column1, '' );\n\n\t\t// Date Format\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'date_format', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.date_format_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Date Format' ), form_item_input, tab_employee_preference_column1 );\n\n\t\t// Time Format\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'time_format', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.time_format_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Time Format' ), form_item_input, tab_employee_preference_column1 );\n\n\t\t// Time Units\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'time_unit_format', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.time_unit_format_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Time Units' ), form_item_input, tab_employee_preference_column1 );\n\n\t\t// Distance Units\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'distance_format', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.distance_format_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Distance Units' ), form_item_input, tab_employee_preference_column1 );\n\n\t\t// Time Zone\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'time_zone', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.time_zone_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Time Zone' ), form_item_input, tab_employee_preference_column1 );\n\n\t\t// Time Zone Auto Detect\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'enable_time_zone_auto_detect' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Enable Time Zone Auto-Detect' ), form_item_input, tab_employee_preference_column1, '' );\n\n\t\t// Start Weeks on\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'start_week_day' } );\n\t\tform_item_input.setSourceData( $this.start_week_day_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Calendar Starts On' ), form_item_input, tab_employee_preference_column1 );\n\n\t\t// Rows per page\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'items_per_page', width: 50 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Rows per page' ), form_item_input, tab_employee_preference_column1, '' );\n\n\t\t//Tab 6 start\n\t\tvar tab_preferences_notification = this.edit_view_tab.find( '#tab_preferences_notification' );\n\t\tvar tab_preferences_notification_column1 = tab_preferences_notification.find( '.first-column' );\n\t\tthis.edit_view_tabs[6] = [];\n\t\tthis.edit_view_tabs[6].push( tab_preferences_notification_column1 );\n\n\t\tvar inside_editor_div = tab_preferences_notification.find( '.inside-editor-div' );\n\t\tvar args = {\n\t\t\tenabled: $.i18n._( 'Enabled' ),\n\t\t\tname: $.i18n._( 'Type' ),\n\t\t\tweb: $.i18n._( 'Browser' ),\n\t\t\temail_work: $.i18n._( 'Work Email' ),\n\t\t\temail_home: $.i18n._( 'Home Email' ),\n\t\t\tapp: $.i18n._( 'Mobile App' ),\n\t\t\tpriority: $.i18n._( 'Priority' ),\n\t\t\tsettings: $.i18n._( 'Settings' )\n\t\t};\n\n\t\tthis.editor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\n\t\tthis.editor.InsideEditor( {\n\t\t\ttitle: '',\n\t\t\taddRow: this.insideEditorAddRow,\n\t\t\tgetValue: this.insideEditorGetValue,\n\t\t\tsetValue: this.insideEditorSetValue,\n\t\t\tparent_controller: this,\n\t\t\trender: getRender(),\n\t\t\trender_args: args,\n\t\t\trender_inline_html: true,\n\t\t\trow_render: getRowRender()\n\t\t} );\n\n\t\tfunction getRender() {\n\t\t\treturn `\n\t\t\t<table class=\"inside-editor-render\">\n\t\t\t\t<tr class=\"title\">\n\t\t\t\t\t<td style=\"width: 50px\"><%= enabled %></td>\n\t\t\t\t\t<td style=\"width: 400px\"><%= name %></td>\n\t\t\t\t\t<td style=\"width: 150px\"><%= priority %></td>\n\t\t\t\t\t<td style=\"width: 110px\"><%= web %></td>\n\t\t\t\t\t<td style=\"width: 110px\"><%= email_work %></td>\n\t\t\t\t\t<td style=\"width: 110px\"><%= email_home %></td>\n\t\t\t\t\t<td style=\"width: 110px\"><%= app %></td>\n\t\t\t\t\t<td style=\"width: 200px\"><%= settings %></td>\n\t\t\t\t</tr>\n\t\t\t</table>`;\n\t\t}\n\n\t\tfunction getRowRender() {\n\t\t\treturn `\n\t\t\t<tr class=\"inside-editor-row data-row\">\n\t\t\t\t<td class=\"cell\"></td>\n\t\t\t\t<td class=\"cell\"></td>\n\t\t\t\t<td class=\"cell\"></td>\n\t\t\t\t<td class=\"cell\"></td>\n\t\t\t\t<td class=\"cell\"></td>\n\t\t\t\t<td class=\"cell\"></td>\n\t\t\t\t<td class=\"cell\"></td>\n\t\t\t\t<td class=\"cell\"></td>\n\t\t\t</tr>`;\n\t\t}\n\n\t\tinside_editor_div.append( this.editor );\n\t}\n\n\tbuildSearchFields() {\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'name',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Country' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'country',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.COMBO_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Province/State' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'province',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'City' ),\n\t\t\t\tfield: 'city',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tin_column: 1,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Created By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'created_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tscript_name: 'EmployeeView',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Updated By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'updated_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tscript_name: 'EmployeeView',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\n\t\t];\n\t}\n\n\tconvertHierarchyData() {\n\t\tthis.current_edit_record.hierarchy_control = {\n\t\t\t80: this.current_edit_record['80'] || TTUUID.zero_id,\n\t\t\t90: this.current_edit_record['90'] || TTUUID.zero_id,\n\t\t\t100: this.current_edit_record['100'] || TTUUID.zero_id,\n\t\t\t200: this.current_edit_record['200'] || TTUUID.zero_id,\n\t\t\t1010: this.current_edit_record['1010'] || TTUUID.zero_id,\n\t\t\t1020: this.current_edit_record['1020'] || TTUUID.zero_id,\n\t\t\t1030: this.current_edit_record['1030'] || TTUUID.zero_id,\n\t\t\t1040: this.current_edit_record['1040'] || TTUUID.zero_id,\n\t\t\t1100: this.current_edit_record['1100'] || TTUUID.zero_id\n\t\t};\n\t}\n\n\tvalidate( api ) {\n\t\tthis.convertHierarchyData();\n\t\tsuper.validate( api );\n\t}\n\n\tonSaveClick( ignoreWarning ) {\n\t\tthis.convertHierarchyData();\n\t\tsuper.onSaveClick( ignoreWarning );\n\t}\n\n\tgetPreferencesNotificationTabHtml() {\n\t\treturn `<div id=\"tab_preferences_notification\" class=\"edit-view-tab-outside\">\n\t\t\t\t\t<div class=\"edit-view-tab\" id=\"tab_preferences_notification_content_div\">\n\t\t\t\t\t\t<div class=\"first-column full-width-column\"></div>\n\t\t\t\t\t\t<div class=\"inside-editor-div full-width-column\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>`;\n\t}\n\n\tgetHierarchyTabHtml() {\n\t\treturn `<div id=\"tab_hierarchy\" class=\"edit-view-tab-outside\">\n\t\t\t\t\t<div class=\"edit-view-tab\" id=\"tab_hierarchy_content_div\">\n\t\t\t\t\t\t<div class=\"first-column full-width-column\"></div>\n\t\t\t\t\t\t<div class=\"hierarchy-div\">\n\t\t\t\t\t\t\t<span class=\"message\"></span>\n\t\t\t\t\t\t\t<div class=\"save-and-continue-button-div\">\n\t\t\t\t\t\t\t\t<button class=\"tt-button p-button p-component\" type=\"button\">\n\t\t\t\t\t\t\t\t\t<span class=\"icon\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"p-button-label\"></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>`;\n\t}\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc3Ny5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsMkJBQTJCLENBQUM7QUFDNUI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBLEtBQUssZ0ZBQWdGO0FBQ3JGLEtBQUssc0ZBQXNGO0FBQzNGLEtBQUssc0ZBQXNGO0FBQzNGLEtBQUssZ0dBQWdHO0FBQ3JHLEtBQUssOEZBQThGO0FBQ25HLEtBQUssa0ZBQWtGO0FBQ3ZGLEtBQUssNEZBQTRGO0FBQ2pHLEtBQUssc0VBQXNFO0FBQzNFLEtBQUssZ0dBQWdHO0FBQ3JHLEtBQUs7QUFDTDs7QUFFQTtBQUNBO0FBQ0Esd0JB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