TimeTrex/interface/html5/dist/my_account-request_authorization-RequestAuthorizationViewController.bundle.js

1 line
91 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["my_account-request_authorization-RequestAuthorizationViewController"],{5396:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RequestAuthorizationViewController\": () => (/* binding */ RequestAuthorizationViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass RequestAuthorizationViewController extends RequestViewCommonController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#request_authorization_view_container',\n\n\t\t\ttype_array: null,\n\t\t\toverlap_type_array: null,\n\t\t\thierarchy_level_array: null,\n\n\t\t\tmessages: null,\n\n\t\t\tauthorization_api: null,\n\t\t\tapi_request: null,\n\t\t\tapi_absence_policy: null,\n\t\t\tmessage_control_api: null,\n\t\t\tschedule_api: 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\tauthorization_history_columns: [],\n\n\t\t\tauthorization_history_default_display_columns: [],\n\n\t\t\tauthorization_history_grid: null,\n\t\t\tpre_request_schedule: true,\n\n\t\t\toverlapping_shift_data: {},\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 = 'RequestAuthorizationEditView.html';\n\t\tthis.permission_id = 'request';\n\t\tthis.viewId = 'RequestAuthorization';\n\t\tthis.script_name = 'RequestAuthorizationView';\n\t\tthis.table_name_key = 'request';\n\t\tthis.context_menu_name = $.i18n._( 'Request (Authorizations)' );\n\t\tthis.navigation_label = $.i18n._( 'Requests' );\n\t\tthis.api = TTAPI.APIRequest;\n\t\tthis.authorization_api = TTAPI.APIAuthorization;\n\t\tthis.api_request = TTAPI.APIRequest;\n\t\tthis.api_absence_policy = TTAPI.APIAbsencePolicy;\n\t\tthis.message_control_api = TTAPI.APIMessageControl;\n\n\t\tif( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\tthis.schedule_api = TTAPI.APISchedule;\n\t\t}\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\t\tthis.message_control_api = TTAPI.APIMessageControl;\n\t\tthis.event_bus = new TTEventBus({ view_id: this.viewId });\n\n\t\tthis.initPermission();\n\t\tthis.render();\n\n\t\tthis.buildContextMenu( true );\n\n\t\tthis.initData();\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tvar options = [\n\t\t\t{ option_name: 'type', api: this.api }\n\t\t];\n\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\toptions.push( { option_name: 'overlap_type', api: TTAPI.APIRequestSchedule } );\n\t\t}\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tvar res = this.api.getHierarchyLevelOptions( [-1], { async: false } );\n\t\tvar data = res.getResult();\n\t\t$this['hierarchy_level_array'] = Global.buildRecordArray( data );\n\t\tif ( Global.isSet( $this.basic_search_field_ui_dic['hierarchy_level'] ) ) {\n\t\t\t$this.basic_search_field_ui_dic['hierarchy_level'].setSourceData( Global.buildRecordArray( data ) );\n\t\t}\n\t}\n\n\tinitPermission() {\n\t\tsuper.initPermission();\n\n\t\tif ( this.jobUIValidate() ) {\n\t\t\tthis.show_job_ui = true;\n\t\t} else {\n\t\t\tthis.show_job_ui = false;\n\t\t}\n\n\t\tif ( this.jobItemUIValidate() ) {\n\t\t\tthis.show_job_item_ui = true;\n\t\t} else {\n\t\t\tthis.show_job_item_ui = false;\n\t\t}\n\n\t\tif ( this.punchTagUIValidate() ) {\n\t\t\tthis.show_punch_tag_ui = true;\n\t\t} else {\n\t\t\tthis.show_punch_tag_ui = false;\n\t\t}\n\n\t\tif ( this.branchUIValidate() ) {\n\t\t\tthis.show_branch_ui = true;\n\t\t} else {\n\t\t\tthis.show_branch_ui = false;\n\t\t}\n\n\t\tif ( this.departmentUIValidate() ) {\n\t\t\tthis.show_department_ui = true;\n\t\t} else {\n\t\t\tthis.show_department_ui = false;\n\t\t}\n\n\t\t// Error: Uncaught TypeError: (