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

1 line
110 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"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\