TimeTrex/interface/html5/dist/company-station-StationViewController.bundle.js

1 line
101 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-station-StationViewController"],{132:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StationViewController\": () => (/* binding */ StationViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass StationViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#station_view_container',\n\n\t\t\tuser_group_api: null,\n\t\t\tstatus_array: null,\n\t\t\ttype_array: null,\n\n\t\t\ttime_zone_array: null,\n\t\t\ttime_clock_command_array: null,\n\t\t\tmode_flag_array: null,\n\t\t\tdefault_mode_flag_array: null,\n\t\t\tface_recognition_match_threshold_array: null,\n\t\t\tface_recognition_required_matches_array: null,\n\t\t\tpoll_frequency_array: null,\n\t\t\tpush_frequency_array: null,\n\t\t\tpartial_push_frequency_array: null,\n\t\t\tgroup_selection_type_array: null,\n\t\t\tbranch_selection_type_array: null,\n\t\t\tdepartment_selection_type_array: null,\n\t\t\tuser_group_array: null,\n\n\t\t\tpunch_tag_api: null,\n\t\t\tdefault_punch_tag: [],\n\t\t\tprevious_punch_tag_selection: [],\n\n\t\t\tuser_preference_api: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'StationEditView.html';\n\t\tthis.permission_id = 'station';\n\t\tthis.viewId = 'Station';\n\t\tthis.script_name = 'StationView';\n\t\tthis.table_name_key = 'station';\n\t\tthis.context_menu_name = $.i18n._( 'Station' );\n\t\tthis.navigation_label = $.i18n._( 'Station' );\n\t\tthis.api = TTAPI.APIStation;\n\t\tthis.user_group_api = TTAPI.APIUserGroup;\n\t\tthis.user_preference_api = TTAPI.APIUserPreference;\n\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\tthis.job_api = TTAPI.APIJob;\n\t\t\tthis.job_item_api = TTAPI.APIJobItem;\n\t\t\tthis.punch_tag_api = TTAPI.APIPunchTag;\n\t\t}\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['copy'],\n\t\t\tinclude: []\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tinitOptions( callBack ) {\n\n\t\tvar $this = this;\n\n\t\tvar options = [\n\t\t\t{ option_name: 'status', field_name: null, api: null },\n\t\t\t{ option_name: 'type', field_name: null, api: null },\n\t\t\t{ option_name: 'time_zone', field_name: 'time_zone', api: $this.user_preference_api },\n\t\t\t{ option_name: 'time_clock_command', field_name: null, api: null },\n\t\t\t{ option_name: 'poll_frequency', field_name: null, api: null },\n\t\t\t{ option_name: 'push_frequency', field_name: null, api: null },\n\t\t\t{ option_name: 'partial_push_frequency', field_name: null, api: null },\n\t\t\t{ option_name: 'group_selection_type', field_name: null, api: null },\n\t\t\t{ option_name: 'branch_selection_type', field_name: null, api: null },\n\t\t\t{ option_name: 'department_selection_type', field_name: null, api: null }\n\n\t\t];\n\n\t\tthis.initDropDownOptions( options, function( result ) {\n\n\t\t\t$this.user_group_api.getUserGroup( '', false, false, {\n\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\tres = res.getResult();\n\t\t\t\t\tres = Global.buildTreeRecord( res );\n\t\t\t\t\t$this.user_group_array = res;\n\n\t\t\t\t\tif ( callBack ) {\n\t\t\t\t\t\tcallBack( result ); // First to initialize drop down options, and then to initialize edit view UI.\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tvar $this = this;\n\t\t// When mass editing, these fields may not be the common data, so their value will be undefined, so this will cause their change event cannot work properly.\n\t\tthis.setDefaultData( {\n\t\t\t'type_id': 10,\n\t\t\t'user_group_selection_type_id': 10,\n\t\t\t'branch_selection_type_id': 1