"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["employees-user_preference-UserPreferenceViewController"],{8427:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UserPreferenceViewController\": () => (/* binding */ UserPreferenceViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass UserPreferenceViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#user_preference_view_container',\n\n\t\t\tdate_format_array: null,\n\t\t\tother_date_format_array: null,\n\t\t\tjs_date_format_array: null,\n\t\t\tflex_date_format_array: null,\n\t\t\tjquery_date_format_array: null,\n\t\t\ttime_format_array: null,\n\t\t\tjs_time_format_array: null,\n\t\t\tflex_time_format_array: null,\n\t\t\tdate_time_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\tlocation_timezone_array: null,\n\t\t\tarea_code_timezone_array: null,\n\t\t\ttimesheet_view_array: null,\n\t\t\tstart_week_day_array: null,\n\t\t\tschedule_icalendar_type_array: null,\n\t\t\tlanguage_array: null,\n\t\t\tuser_group_array: null,\n\t\t\tcountry_array: null,\n\t\t\tprovince_array: null,\n\n\t\t\tnotification_status_array: null,\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\tuser_api: null,\n\t\t\tuser_group_api: null,\n\t\t\tcompany_api: null,\n\n\t\t\tapi_date: null,\n\n\t\t\tuser_preference_notification_api: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'UserPreferenceEditView.html';\n\t\tthis.permission_id = 'user_preference';\n\t\tthis.viewId = 'UserPreference';\n\t\tthis.script_name = 'UserPreferenceView';\n\t\tthis.table_name_key = 'user_preference';\n\t\tthis.context_menu_name = $.i18n._( 'Preferences' );\n\t\tthis.navigation_label = $.i18n._( 'Employees' );\n\t\tthis.api = TTAPI.APIUserPreference;\n\t\tthis.api_date = TTAPI.APITTDate;\n\t\tthis.user_api = TTAPI.APIUser;\n\t\tthis.user_group_api = TTAPI.APIUserGroup;\n\t\tthis.company_api = TTAPI.APICompany;\n\t\tthis.user_preference_notification_api = TTAPI.APIUserPreferenceNotification;\n\n\t\tthis.render();\n\n\t\tthis.buildContextMenu();\n\n\t\t//call init data in parent view\n\n\t\tthis.initData();\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: [\n\t\t\t\t'add',\n\t\t\t\t'copy',\n\t\t\t\t'copy_as_new',\n\t\t\t\t'save_and_copy',\n\t\t\t\t'save_and_new',\n\t\t\t\t'delete_icon',\n\t\t\t\t'delete_and_next'\n\t\t\t],\n\t\t\tinclude: []\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tinitOptions() {\n\n\t\tvar $this = this;\n\n\t\tvar options = [\n\t\t\t{ option_name: 'status', api: this.user_api },\n\t\t\t{ option_name: 'country', field_name: 'country', api: this.company_api },\n\t\t\t{ option_name: 'language', api: this.api },\n\t\t\t{ option_name: 'date_format', api: this.api },\n\t\t\t{ option_name: 'time_format', api: this.api },\n\t\t\t{ option_name: 'time_unit_format', api: this.api },\n\t\t\t{ option_name: 'distance_format', api: this.api },\n\t\t\t{ option_name: 'time_zone', api: this.api },\n\t\t\t{ option_name: 'start_week_day', api: this.api },\n\t\t\t{ option_name: 'schedule_icalendar_type', api: this.api },\n\t\t\t{ option_name: 'default_login_screen', api: this.api },\n\t\t\t{ option_name: 'notification_status', api: this.api },\n\t\t\t{ option_name: 'notification_type', api: this.user_preference_notification_api },\n\t\t\t{ option_name: 'priority', api: this.user_preference_notification_api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tthis.user_group_api.getUserGroup( '', false, false, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\tres = Global.buildTreeRecord( res );\n\t\t\t\t$this.user_group_array = res;\n\t\t\t\tif ( !$this.sub_view_mode && $this.basic_search_field_ui_dic['group_id'] ) {\n\t\t\t\t\t$this.basic_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t\t$this.adv_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t}\n\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_id = this.current_edit_record.user_id;\n\n\t\t$this.user_preference_notification_api.getUserPreferenceNotification( 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\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\t\t\tthis.adv_search_field_ui_dic['province'].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.province_array = Global.buildRecordArray( res );\n\t\t\t\t\t$this.adv_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\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\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\tonSetSearchFilterFinished() {\n\n\t\tif ( this.search_panel.getSelectTabIndex() === 1 ) {\n\t\t\tvar combo = this.adv_search_field_ui_dic['country'];\n\t\t\tvar select_value = combo.getValue();\n\t\t\tthis.setProvince( select_value );\n\t\t}\n\t}\n\n\tonBuildAdvUIFinished() {\n\n\t\tthis.adv_search_field_ui_dic['country'].change( $.proxy( function() {\n\t\t\tvar combo = this.adv_search_field_ui_dic['country'];\n\t\t\tvar selectVal = combo.getValue();\n\n\t\t\tthis.setProvince( selectVal );\n\n\t\t\tthis.adv_search_field_ui_dic['province'].setValue( null );\n\n\t\t}, this ) );\n\t}\n\n\tbuildSearchFields() {\n\n\t\tthis.search_fields = [\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Employee' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'user_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\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._( 'Status' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'status_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( 'First Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'first_name',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( 'Last Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'last_name',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( 'Employee Number' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'employee_number',\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\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._( 'Group' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tmultiple: true,\n\t\t\t\tfield: 'group_id',\n\t\t\t\tlayout_name: 'global_tree_column',\n\t\t\t\ttree_mode: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( 'Default Branch' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'default_branch_id',\n\t\t\t\tlayout_name: 'global_branch',\n\t\t\t\tapi_class: TTAPI.APIBranch,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( 'Default Department' ),\n\t\t\t\tfield: 'default_department_id',\n\t\t\t\tin_column: 2,\n\t\t\t\tlayout_name: 'global_department',\n\t\t\t\tapi_class: TTAPI.APIDepartment,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( 'Title' ),\n\t\t\t\tfield: 'title_id',\n\t\t\t\tin_column: 2,\n\t\t\t\tlayout_name: 'global_job_title',\n\t\t\t\tapi_class: TTAPI.APIUserTitle,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\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._( 'Country' ),\n\t\t\t\tin_column: 3,\n\t\t\t\tfield: 'country',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\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: 3,\n\t\t\t\tfield: 'province',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\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\t\tthis.current_edit_record[key] = c_value;\n\n\t\tif ( key === 'schedule_icalendar_type_id' ) {\n\n\t\t\tthis.onStatusChange();\n\t\t} else if ( key === 'notification_status_id' ) {\n\t\t\tthis.initSubNotificationView();\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tbuildEditViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_preference': { 'label': $.i18n._( 'Preferences' ) },\n\t\t\t'tab_preferences_notification': {\n\t\t\t\t'label': $.i18n._( 'Notifications' ),\n\t\t\t\t'init_callback': 'initSubNotificationView',\n\t\t\t\t'html_template': this.getPreferencesNotificationTabHtml()\n\t\t\t},\n\t\t\t'tab_schedule_sync': {\n\t\t\t\t'label': $.i18n._( 'Schedule Synchronization' ),\n\t\t\t\t'init_callback': 'initSubScheduleSyncView',\n\t\t\t\t'html_template': this.getScheduleSyncronizationTabHtml()\n\t\t\t},\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\tid: this.script_name + '_navigation',\n\t\t\tapi_class: TTAPI.APIUserPreference,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_user_preference',\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_preference = this.edit_view_tab.find( '#tab_preference' );\n\n\t\tvar tab_preference_column1 = tab_preference.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_preference_column1 );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\tif ( !this.is_mass_editing ) {\n\t\t\t// Employee\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_input.TText( { field: 'full_name' } );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Employee' ), form_item_input, tab_preference_column1, '' );\n\t\t}\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_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_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_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_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_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_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_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_preference_column1 );\n\n\t\t// Default Login Screen\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'default_login_screen' } );\n\t\tform_item_input.setSourceData( $this.default_login_screen_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Default Screen' ), form_item_input, tab_preference_column1 );\n\n\t\t// Save TimeSheet State\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'enable_save_timesheet_state' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Save TimeSheet State' ), form_item_input, tab_preference_column1 );\n\n\n\t\t//Tab 1 start\n\t\tvar tab_preferences_notification = this.edit_view_tab.find( '#tab_preferences_notification' );\n\n\t\tvar tab_preferences_notification_column1 = tab_preferences_notification.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[1] = [];\n\n\t\tthis.edit_view_tabs[1].push( tab_preferences_notification_column1 );\n\n\t\t// Push Notifications Enabled\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'notification_status_id' } );\n\t\tform_item_input.setSourceData( Global.addFirstItemToArray( $this.notification_status_array ) );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Notification Status' ), form_item_input, tab_preferences_notification_column1 );\n\n\t\t// Notification duration\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'notification_duration', width: 50 } );\n\n\t\twidgetContainer = $( '
' );\n\t\tlabel = $( ' ' + $.i18n._( 'Seconds (Use 0 for infinite)' ) + '' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Display Notifications For' ), form_item_input, tab_preferences_notification_column1, '', widgetContainer );\n\n\t\tif ( this.is_mass_editing == false ) {\n\t\t\tvar inside_editor_div = tab_preferences_notification.find( '.inside-editor-div' );\n\t\t\tvar args = {\n\t\t\t\tenabled: $.i18n._( 'Enabled' ),\n\t\t\t\tname: $.i18n._( 'Type' ),\n\t\t\t\tweb: $.i18n._( 'Browser' ),\n\t\t\t\temail_work: $.i18n._( 'Work Email' ),\n\t\t\t\temail_home: $.i18n._( 'Home Email' ),\n\t\t\t\tapp: $.i18n._( 'Mobile App' ),\n\t\t\t\tpriority: $.i18n._( 'Priority' ),\n\t\t\t\tsettings: $.i18n._( 'Settings' )\n\t\t\t};\n\n\t\t\tthis.editor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\n\t\t\tthis.editor.InsideEditor( {\n\t\t\t\ttitle: '',\n\t\t\t\taddRow: this.insideEditorAddRow,\n\t\t\t\tgetValue: this.insideEditorGetValue,\n\t\t\t\tsetValue: this.insideEditorSetValue,\n\t\t\t\tparent_controller: this,\n\t\t\t\trender: getRender(),\n\t\t\t\trender_args: args,\n\t\t\t\trender_inline_html: true,\n\t\t\t\trow_render: getRowRender()\n\t\t\t} );\n\n\t\t\tfunction getRender() {\n\t\t\t\treturn `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t<%= enabled %> | \n\t\t\t\t\t<%= name %> | \n\t\t\t\t\t<%= priority %> | \n\t\t\t\t\t<%= web %> | \n\t\t\t\t\t<%= email_work %> | \n\t\t\t\t\t<%= email_home %> | \n\t\t\t\t\t<%= app %> | \n\t\t\t\t\t<%= settings %> | \n\t\t\t\t
\n\t\t\t
`;\n\t\t\t}\n\n\t\t\tfunction getRowRender() {\n\t\t\t\treturn `\n\t\t\t\n\t\t\t\t | \n\t\t\t\t | \n\t\t\t\t | \n\t\t\t\t | \n\t\t\t\t | \n\t\t\t\t | \n\t\t\t\t | \n\t\t\t\t | \n\t\t\t
`;\n\t\t\t}\n\n\t\t\tinside_editor_div.append( this.editor );\n\t\t}\n\n\t\t//Tab 2 start\n\n\t\tvar tab_schedule_sync = this.edit_view_tab.find( '#tab_schedule_sync' );\n\n\t\tvar tab_schedule_sync_column1 = tab_schedule_sync.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[2] = [];\n\n\t\tthis.edit_view_tabs[2].push( tab_schedule_sync_column1 );\n\n\t\t//// schedule icalendar type\n\t\t//form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\t//form_item_input.TComboBox( {field: 'schedule_icalendar_type_id' } );\n\t\t//form_item_input.setSourceData( $this.schedule_icalendar_type_array );\n\t\t//this.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_schedule_sync_column1, 'first-last' );\n\t\t//\n\t\t//// Calendar URL\n\t\t//form_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\t//form_item_input.TText( {field: 'calendar_url' } );\n\t\t//form_item_input.addClass( 'link' );\n\t\t//this.addEditFieldToColumn( $.i18n._( 'Calendar URL' ), form_item_input, tab_schedule_sync_column1, '', null, true );\n\n\t\t// Shifts Scheduled to Work\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );\n\t\tform_item_input.SeparatedBox( { label: $.i18n._( 'Shifts Scheduled to Work' ) } );\n\t\tthis.addEditFieldToColumn( null, form_item_input, tab_schedule_sync_column1, '', null, true, false, 'shifts_scheduled_to_work' );\n\n\t\t// Alarm 1\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'schedule_icalendar_alarm1_working', width: 90, need_parser_sec: true } );\n\n\t\twidgetContainer = $( '' );\n\t\tlabel = $( '( ' + $.i18n._( 'before schedule start time' ) + ' )' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Alarm 1' ), form_item_input, tab_schedule_sync_column1, '', widgetContainer, true );\n\n\t\t// Alarm 2\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'schedule_icalendar_alarm2_working', width: 90, need_parser_sec: true } );\n\n\t\twidgetContainer = $( '' );\n\t\tlabel = $( '( ' + $.i18n._( 'before schedule start time' ) + ' )' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Alarm 2' ), form_item_input, tab_schedule_sync_column1, '', widgetContainer, true );\n\n\t\t// Shifts Scheduled Absent\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );\n\t\tform_item_input.SeparatedBox( { label: $.i18n._( 'Shifts Scheduled Absent' ) } );\n\t\tthis.addEditFieldToColumn( null, form_item_input, tab_schedule_sync_column1, '', null, true, false, 'shifts_scheduled_absent' );\n\n\t\t// Alarm 1\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'schedule_icalendar_alarm1_absence', width: 90, need_parser_sec: true } );\n\n\t\twidgetContainer = $( '' );\n\t\tlabel = $( '( ' + $.i18n._( 'before schedule start time' ) + ' )' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Alarm 1' ), form_item_input, tab_schedule_sync_column1, '', widgetContainer, true );\n\n\t\t// Alarm 2\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'schedule_icalendar_alarm2_absence', width: 90, need_parser_sec: true } );\n\n\t\twidgetContainer = $( '' );\n\t\tlabel = $( '( ' + $.i18n._( 'before schedule start time' ) + ' )' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Alarm 2' ), form_item_input, tab_schedule_sync_column1, '', widgetContainer, true );\n\n\t\t// Modified Shifts\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );\n\t\tform_item_input.SeparatedBox( { label: $.i18n._( 'Modified Shifts' ) } );\n\t\tthis.addEditFieldToColumn( null, form_item_input, tab_schedule_sync_column1, '', null, true, false, 'modified_shifts' );\n\n\t\t// Alarm 1\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'schedule_icalendar_alarm1_modified', width: 90, need_parser_sec: true } );\n\n\t\twidgetContainer = $( '' );\n\t\tlabel = $( '( ' + $.i18n._( 'before schedule start time' ) + ' )' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Alarm 1' ), form_item_input, tab_schedule_sync_column1, '', widgetContainer, true );\n\n\t\t// Alarm 2\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'schedule_icalendar_alarm2_modified', width: 90, need_parser_sec: true } );\n\n\t\twidgetContainer = $( '' );\n\t\tlabel = $( '( ' + $.i18n._( 'before schedule start time' ) + ' )' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Alarm 2' ), form_item_input, tab_schedule_sync_column1, '', widgetContainer, true );\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\tif ( !result_data ) {\n\t\t\t\t\tresult_data = [];\n\t\t\t\t}\n\n\t\t\t\t$this.unique_columns = [];\n\t\t\t\t$this.linked_columns = [];\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\t}\n\n\tonStatusChange() {\n\n\t\tif ( this.current_edit_record.schedule_icalendar_type_id == 0 ) {\n\t\t\t//this.edit_view_form_item_dic['calendar_url'].css( 'display', 'none' );\n\t\t\tthis.detachElement( 'schedule_icalendar_alarm1_working' );\n\t\t\tthis.detachElement( 'schedule_icalendar_alarm2_working' );\n\t\t\tthis.detachElement( 'schedule_icalendar_alarm1_absence' );\n\t\t\tthis.detachElement( 'schedule_icalendar_alarm2_absence' );\n\t\t\tthis.detachElement( 'schedule_icalendar_alarm1_modified' );\n\t\t\tthis.detachElement( 'schedule_icalendar_alarm2_modified' );\n\t\t\tthis.detachElement( 'shifts_scheduled_to_work' );\n\t\t\tthis.detachElement( 'shifts_scheduled_absent' );\n\t\t\tthis.detachElement( 'modified_shifts' );\n\n\t\t} else {\n\t\t\t//this.setCalendarURL();\n\t\t\t//this.edit_view_form_item_dic['calendar_url'].css( 'display', 'block' );\n\t\t\tthis.attachElement( 'schedule_icalendar_alarm1_working' );\n\t\t\tthis.attachElement( 'schedule_icalendar_alarm2_working' );\n\t\t\tthis.attachElement( 'schedule_icalendar_alarm1_absence' );\n\t\t\tthis.attachElement( 'schedule_icalendar_alarm2_absence' );\n\t\t\tthis.attachElement( 'schedule_icalendar_alarm1_modified' );\n\t\t\tthis.attachElement( 'schedule_icalendar_alarm2_modified' );\n\t\t\tthis.attachElement( 'shifts_scheduled_to_work' );\n\t\t\tthis.attachElement( 'shifts_scheduled_absent' );\n\t\t\tthis.attachElement( 'modified_shifts' );\n\t\t}\n\n\t\tthis.editFieldResize();\n\t}\n\n\tsetCurrentEditRecordData() {\n\n\t\t//Set current edit record data to all widgets\n\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 ) ) {\n\t\t\t\tswitch ( key ) {\n\t\t\t\t\tcase 'full_name':\n\t\t\t\t\t\twidget.setValue( this.current_edit_record['first_name'] + ' ' + this.current_edit_record['last_name'] );\n\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'schedule_icalendar_alarm1_working':\n//\t\t\t\t\tcase 'schedule_icalendar_alarm2_working':\n//\t\t\t\t\tcase 'schedule_icalendar_alarm1_absence':\n//\t\t\t\t\tcase 'schedule_icalendar_alarm2_absence':\n//\t\t\t\t\tcase 'schedule_icalendar_alarm1_modified':\n//\t\t\t\t\tcase 'schedule_icalendar_alarm2_modified':\n//\t\t\t\t\t\tvar result = Global.getTimeUnit( this.current_edit_record[key] )\n//\t\t\t\t\t\twidget.setValue( result );\n//\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\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\n\t\tthis.setEditViewDataDone();\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tthis.onStatusChange();\n\t\tif ( this.is_mass_editing == false ) {\n\t\t\tthis.initInsideEditorData();\n\t\t}\n\t}\n\n\tsetCalendarURL( widget ) {\n\n\t\tif ( !Global.isSet( widget ) ) {\n\t\t\twidget = this.edit_view_ui_dic['calendar_url'];\n\t\t}\n\n\t\tif ( this.is_mass_editing ) {\n\t\t\twidget.setValue( 'Not available when mass editing' );\n\t\t\treturn;\n\t\t}\n\n\t\tthis.api['getScheduleIcalendarURL']( this.current_edit_record.user_name, this.current_edit_record.schedule_icalendar_type_id, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\twidget.setValue( ServiceCaller.root_url + result_data, true );\n\n\t\t\t\twidget.unbind( 'click' ); // First unbind all click events, otherwise, when we change the schedule icalendar type this will trigger several times click events.\n\n\t\t\t\twidget.click( function() {\n\t\t\t\t\twindow.open( widget.text() );\n\t\t\t\t} );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tinitSubScheduleSyncView() {\n\t\tif ( Global.getProductEdition() >= 15 ) {\n\t\t\tthis.edit_view_tab.find( '#tab_schedule_sync' ).find( '.first-column' ).css( 'display', 'block' );\n\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'none' );\n\t\t\tthis.buildContextMenu( true );\n\t\t\tthis.setEditMenu();\n\t\t} else {\n\t\t\tthis.edit_view_tab.find( '#tab_schedule_sync' ).find( '.first-column' ).css( 'display', 'none' );\n\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'block' );\n\t\t\tthis.edit_view.find( '.permission-message' ).html( Global.getUpgradeMessage() );\n\t\t}\n\t}\n\n\tinitSubNotificationView() {\n\t\tif ( this.current_edit_record.notification_status_id == 0 ) {\n\t\t\tthis.edit_view_tab.find( '#tab_preferences_notification' ).find( '.inside-editor-div' ).css( 'display', 'none' );\n\t\t\tthis.edit_view_ui_dic['notification_duration'].parent().parent().parent().css( 'display', 'none' );\n\t\t} else {\n\t\t\tthis.edit_view_tab.find( '#tab_preferences_notification' ).find( '.inside-editor-div' ).css( 'display', 'block' );\n\t\t\tthis.edit_view_ui_dic['notification_duration'].parent().parent().parent().css( 'display', 'block' );\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 = $( '' );\n\t\t\tvar label = $( ' ' + $.i18n._( 'Delay' ) + ': ' );\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\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\tif ( this.is_mass_editing == false ) {\n\t\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t\tvar on_save_done_result = $this.onSaveDone( result );\n\t\t\t\t\tif ( on_save_done_result == undefined || on_save_done_result == true ) {\n\t\t\t\t\t\t$this.removeEditView();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\t$this.removeEditView();\n\t\t\t}\n\n\t\t} else {\n\t\t\t$this.setErrorMenu();\n\t\t\t$this.setErrorTips( result );\n\t\t}\n\t}\n\n\tsaveInsideEditorData( callBack ) {\n\t\tvar data = this.editor.getValue( this.refresh_id );\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_preference_notification_api.setUserPreferenceNotification( changed_data, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tif ( Global.isSet( callBack ) ) {\n\t\t\t\t\t\tcallBack();\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\tonSaveDone( result ) {\n\t\t// #2224 - Don't use current_edit_record here, use getSelectedItem() instead, or it causes:\n\t\t// Uncaught Error From: UserPreferenceView Error: Unable to get property 'id' of undefined or null reference\n\t\tvar user_id = this.getSelectedItem().id;\n\n\t\tif ( user_id === LocalCacheData.getLoginUser().id ) {\n\t\t\tGlobal.updateUserPreference();\n\t\t}\n\t}\n\n\tonSaveAndContinueDone( result ) {\n\t\tthis.onSaveDone( result );\n\t\tthis.initInsideEditorData();\n\t}\n\n\tonSaveAndNextDone( result ) {\n\t\tthis.onSaveDone( result );\n\t}\n\n\tvalidate() {\n\t\tvar $this = this;\n\n\t\tvar record = {};\n\n\t\tif ( this.is_mass_editing ) {\n\t\t\tfor ( var key in this.edit_view_ui_dic ) {\n\t\t\t\tvar widget = this.edit_view_ui_dic[key];\n\n\t\t\t\tif ( Global.isSet( widget.isChecked ) ) {\n\t\t\t\t\tif ( widget.isChecked() && widget.getEnabled() ) {\n\t\t\t\t\t\trecord[key] = widget.getValue();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( this.mass_edit_record_ids.length > 0 ) {\n\t\t\t\trecord.id = this.mass_edit_record_ids[0];\n\t\t\t}\n\t\t} else {\n\t\t\trecord = this.current_edit_record;\n\t\t}\n\t\tthis.api['validate' + this.api.key_name]( record, {\n\t\t\tonResult: function( result ) {\n\n\t\t\t\t$this.validateResult( result );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetPreferencesNotificationTabHtml() {\n\t\treturn `\n\t\t\t\t\t
\n\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}\n\n\tgetScheduleSyncronizationTabHtml() {\n\t\treturn `\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\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}\n\n\tsetSubLogViewFilter() {\n\t\tif ( !this.sub_log_view_controller ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.sub_log_view_controller.getSubViewFilter = function( filter ) {\n\t\t\tfilter['table_name_object_id'] = {\n\t\t\t\t'user_preference': [this.parent_edit_record.id],\n\t\t\t\t'user_preference_notification': this.parent_view_controller.editor.getValue( this.refresh_id ).map( preference => preference.id )\n\t\t\t};\n\n\t\t\treturn filter;\n\t\t};\n\n\t\treturn true;\n\t}\n\n}\n\nUserPreferenceViewController.loadView = function() {\n\tGlobal.loadViewSource( 'UserPreference', 'UserPreferenceView.html', function( result ) {\n\t\tvar args = {};\n\t\t//var template = _.template( result, args );\n\n\t\tGlobal.contentContainer().html( result );\n\t} );\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQyNy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSxJQUFJOztBQUVKO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsMkJBQTJCLENBQUM7QUFD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