TimeTrex/interface/html5/dist/company-hierarchy_control-HierarchyControlViewController.bundle.js

1 line
44 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-hierarchy_control-HierarchyControlViewController"],{3433:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HierarchyControlViewController\": () => (/* binding */ HierarchyControlViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass HierarchyControlViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#hierarchy_control_view_container',\n\n\n\n\t\t\tobject_type_array: null,\n\t\t\teditor: null,\n\t\t\toriginal_hierarchy_data: [],\n\n\t\t\thierarchy_level_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 = 'HierarchyControlEditView.html';\n\t\tthis.permission_id = 'hierarchy';\n\t\tthis.viewId = 'HierarchyControl';\n\t\tthis.script_name = 'HierarchyControlView';\n\t\tthis.table_name_key = 'hierarchy_control';\n\t\tthis.context_menu_name = $.i18n._( 'Hierarchy' );\n\t\tthis.navigation_label = $.i18n._( 'Hierarchy' );\n\t\tthis.api = TTAPI.APIHierarchyControl;\n\t\tthis.hierarchy_level_api = TTAPI.APIHierarchyLevel;\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: ['mass_edit'],\n\t\t\tinclude: []\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'object_type', 'object_type' );\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_hierarchy': {\n\t\t\t\t'label': $.i18n._( 'Hierarchy' ),\n\t\t\t\t'html_template': this.getHierarchyControlTabHtml()\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\tapi_class: TTAPI.APIHierarchyControl,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_hierarchy',\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_hierarchy = this.edit_view_tab.find( '#tab_hierarchy' );\n\n\t\tvar tab_hierarchy_column1 = tab_hierarchy.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_hierarchy_column1 );\n\n\t\t//Name\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'name', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_hierarchy_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Description\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'description', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_hierarchy_column1 );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Objects\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_option_column',\n\t\t\tshow_search_inputs: false,\n\t\t\tset_empty: true,\n\t\t\tkey: 'value',\n\t\t\tfield: 'object_type'\n\t\t} );\n\t\tform_item_input.setSourceData( $this.object_type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Objects' ), form_item_input, tab_hierarchy_column1 );\n\n\t\t// Subordinates\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_user',\n\t\t\tshow_search_inputs: true,\