TimeTrex/interface/html5/dist/company-branch-BranchViewController.bundle.js

1 line
64 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-branch-BranchViewController"],{2424:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BranchViewController\": () => (/* binding */ BranchViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass BranchViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#branch_view_container',\n\n\t\t\tstatus_array: null,\n\t\t\tcountry_array: null,\n\t\t\tprovince_array: null,\n\n\t\t\te_province_array: null,\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_default_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\tcompany_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 = 'BranchEditView.html';\n\t\tthis.permission_id = 'branch';\n\t\tthis.viewId = 'Branch';\n\t\tthis.script_name = 'BranchView';\n\t\tthis.table_name_key = 'branch';\n\t\tthis.context_menu_name = $.i18n._( 'Branch' );\n\t\tthis.navigation_label = $.i18n._( 'Branch' );\n\t\tthis.api = TTAPI.APIBranch;\n\t\tthis.company_api = TTAPI.APICompany;\n\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\tthis.user_group_api = TTAPI.APIUserGroup;\n\t\t}\n\n\t\tthis.render();\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\t{ option_name: 'country', field_name: 'country', api: this.company_api },\n\t\t];\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_default_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\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: [],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Import' ),\n\t\t\t\t\tid: 'import_icon',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'import_export',\n\t\t\t\t\tgroup: 'other',\n\t\t\t\t\tvue_icon: 'tticon tticon-file_download_black_24dp',\n\t\t\t\t\tpermission_result: PermissionManager.checkTopLevelPermission( 'ImportCSVBranch' ),\n\t\t\t\t\tpermission: null,\n\t\t\t\t\tsort_order: 9010\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tonSetSearchFilterFinished() {\n\t\tvar combo;\n\t\tvar select_value;\n\t\tif ( this.search_panel.getSelectTabIndex() === 0 ) {\n\t\t\tcombo = this.basic_search_field_ui_dic['country'];\n\t\t\tselect_value = combo.getValue();\n\t\t\tthis.setProvince( select_value );\n\t\t} else if ( this.search_panel.getSelectTabIndex() === 1 ) {\n\t\t\tcombo = this.adv_search_field_ui_dic['country'];\n\t\t\tselect_value = combo.getValue();\n\t\t\tthis.setProvince( select_value );\n\t\t}\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'import_icon':\n\t\t\t\tthis.onImportClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonImportClick() {\n\t\tvar $this = this;\n\t\tIndexViewController.openWizard( 'ImportCSVWizard', 'Branch', function() {\n\t\t\t$this.search();\n\t\t} );\n\t}\n\n\tonBuildAdvUIFinished() {\n\n\t\tthis.adv_search_field_ui_