TimeTrex/interface/html5/dist/company-department-DepartmentViewController.bundle.js

1 line
44 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-department-DepartmentViewController"],{6993:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DepartmentViewController\": () => (/* binding */ DepartmentViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass DepartmentViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#department_view_container',\n\n\t\t\tuser_group_selection_type_id_array: null,\n\t\t\tuser_title_selection_type_id_array: null,\n\t\t\tuser_punch_branch_selection_type_id_array: null,\n\t\t\tuser_default_department_selection_type_id_array: null,\n\n\t\t\tuser_group_array: null,\n\n\t\t\tstatus_array: 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 = 'DepartmentEditView.html';\n\t\tthis.permission_id = 'department';\n\t\tthis.viewId = 'Department';\n\t\tthis.script_name = 'DepartmentView';\n\t\tthis.table_name_key = 'department';\n\t\tthis.context_menu_name = $.i18n._( 'Departments' );\n\t\tthis.navigation_label = $.i18n._( 'Department' );\n\t\tthis.api = TTAPI.APIDepartment;\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\tthis.user_group_api = TTAPI.APIUserGroup;\n\t\t}\n\n\t\tthis.render();\n\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tlet options = [\n\t\t\t{ option_name: 'status', api: this.api }\n\t\t];\n\n\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\n\t\t\toptions.push(\n\t\t\t\t{ option_name: 'user_group_selection_type_id', api: this.api },\n\t\t\t\t{ option_name: 'user_title_selection_type_id', api: this.api },\n\t\t\t\t{ option_name: 'user_punch_branch_selection_type_id', api: this.api },\n\t\t\t\t{ option_name: 'user_default_department_selection_type_id', api: this.api },\n\t\t\t);\n\n\t\t\tthis.user_group_api.getUserGroup( '', false, false, {\n\t\t\t\tonResult: function( res ) {\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\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tthis.initDropDownOptions( options );\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\n\t\tthis.current_edit_record[key] = target.getValue();\n\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\tif ( key === 'user_group_selection_type_id' ) {\n\t\t\t\tthis.onEmployeeGroupSelectionTypeChange();\n\t\t\t}\n\t\t\tif ( key === 'user_title_selection_type_id' ) {\n\t\t\t\tthis.onEmployeeTitleSelectionTypeChange();\n\t\t\t}\n\t\t\tif ( key === 'user_punch_branch_selection_type_id' ) {\n\t\t\t\tthis.onEmployeePunchBranchSelectionTypeChange();\n\t\t\t}\n\t\t\tif ( key === 'user_default_department_selection_type_id' ) {\n\t\t\t\tthis.onEmployeeDefaultDepartmentSelectionTypeChange();\n\t\t\t}\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tonEmployeeGroupSelectionTypeChange() {\n\t\tif ( this.current_edit_record['user_group_selection_type_id'] == 10 ) {\n\t\t\tthis.edit_view_ui_dic['user_group_ids'].setEnabled( false );\n\t\t} else {\n\t\t\tthis.edit_view_ui_dic['user_group_ids'].setEnabled( true );\n\t\t}\n\t}\n\n\tonEmployeeTitleSelectionTypeChange() {\n\t\tif ( this.current_edit_record['user_title_selection_type_id'] == 10 ) {\n\t\t\tthis.edit_view_ui_dic['user_title_ids'].setEnabled( false );\n\t\t} else {\n\t\t\tthis.edit_view_ui_dic['user_title_ids'].setEnabled( true );\n\t\t}\n\t}\n\n\tonEmployeePunchBranchSelectionTypeChange() {\n\t\tif ( this.current_edit_record['user_punch_branch_selection_type_id'] == 10 ) {\n\t\t\tthis.edit_view_ui_dic['user_punch_branc