TimeTrex/interface/html5/dist/my_account-request-RequestViewController.bundle.js

1 line
125 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["my_account-request-RequestViewController"],{926:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RequestViewController\": () => (/* binding */ RequestViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass RequestViewController extends RequestViewCommonController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#request_view_container',\n\n\t\t\ttype_array: null,\n\t\t\trequest_type_array: null,\n\t\t\tstatus_array: null,\n\n\t\t\tapi_request_schedule: null,\n\t\t\tauthorization_api: null,\n\t\t\tschedule_api: null,\n\t\t\thierarchy_type_id: false,\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\toverlapping_shift_data: {},\n\n\t\t\tmessages: 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 = 'RequestEditView.html';\n\t\tthis.permission_id = 'request';\n\t\tthis.viewId = 'Request';\n\t\tthis.script_name = 'RequestView';\n\t\tthis.table_name_key = 'request';\n\t\tthis.context_menu_name = $.i18n._( 'Requests' );\n\t\tthis.navigation_label = $.i18n._( 'Request' );\n\t\tthis.api = TTAPI.APIRequest;\n\t\tthis.api_absence_policy = TTAPI.APIAbsencePolicy;\n\t\tthis.api_schedule = TTAPI.APISchedule;\n\t\tthis.message_control_api = TTAPI.APIMessageControl;\n\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\tthis.api_request_schedule = TTAPI.APIRequestSchedule;\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\n\t\tthis.authorization_api = TTAPI.APIAuthorization;\n\n\t\tthis.initPermission();\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\t// override allows a callback after initOptions when run as sub view (from EmployeeViewController)\n\tinitOptions( callBack ) {\n\n\t\tvar options = [\n\t\t\t{ option_name: 'status' },\n\t\t\t{ option_name: 'type' }\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, function( result ) {\n\n\t\t\tif ( callBack ) {\n\t\t\t\tcallBack( result ); // First to initialize drop down options, and then to initialize edit view UI.\n\t\t\t}\n\n\t\t} );\n\t}\n\n\tbuildEditViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar tab_model = {\n\t\t\t'tab_request': { 'label': $.i18n._( 'Message' ) },\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\t//This hides the audit tab as this view is always used for creating/replying to an existing request.\n\t\t//For some reason removing 'tab_audit' from the model above results in a blank tab appearing.\n\t\tvar tab_audit_label = this.edit_view.find( 'a[ref=tab_audit]' );\n\t\ttab_audit_label.css( 'display', 'none' );\n\n\t\t//Tab 0 start\n\n\t\tvar tab_request = this.edit_view_tab.find( '#tab_request' );\n\t\tvar tab_request_column1 = tab_request.find( '.first-column' );\n\t\tvar tab_request_column2 = tab_request.find( '.second-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\t\tthis.edit_view_tabs[0].push( tab_request_column1 );\n\n\t\t// Subject\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'subject', width: 359 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Subject' ), form_item_input, tab_request_column1, '' );\n\n\t\t// Body\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\n\t\tform_item_input.TTextArea( { field: 'body', width: 600, height: 40