TimeTrex/interface/html5/dist/policy-holiday_policy-HolidayPolicyViewController.bundle.js

1 line
56 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["policy-holiday_policy-HolidayPolicyViewController"],{935:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HolidayPolicyViewController\": () => (/* binding */ HolidayPolicyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass HolidayPolicyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#holiday_policy_view_container',\n\n\t\t\ttype_array: null,\n\t\t\tdefault_schedule_status_array: null,\n\t\t\tshift_on_holiday_type_array: null,\n\t\t\tworked_scheduled_days_array: null,\n\t\t\tdate_api: null,\n\t\t\tsub_holiday_view_controller: 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 = 'HolidayPolicyEditView.html';\n\t\tthis.permission_id = 'holiday_policy';\n\t\tthis.viewId = 'HolidayPolicy';\n\t\tthis.script_name = 'HolidayPolicyView';\n\t\tthis.table_name_key = 'holiday_policy';\n\t\tthis.context_menu_name = $.i18n._( 'Holiday Policy' );\n\t\tthis.navigation_label = $.i18n._( 'Holiday Policy' );\n\t\tthis.api = TTAPI.APIHolidayPolicy;\n\t\tthis.date_api = TTAPI.APITTDate;\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\t/* jshint ignore:start */\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\t{ option_name: 'average_time_frequency_type', api: this.api },\n\t\t\t{ option_name: 'default_schedule_status', api: this.api },\n\t\t\t{ option_name: 'shift_on_holiday_type', api: this.api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tthis.initDropDownOption( 'scheduled_day', 'worked_scheduled_days', null, function( res ) {\n\t\t\tres = res.getResult();\n\t\t\t$this.worked_scheduled_days_array = $.extend( {}, res ); //\t Convert Array to Object\n\t\t} );\n\t}\n\n\t/* jshint ignore:end */\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_holiday_policy': { 'label': $.i18n._( 'Holiday Policy' ) },\n\t\t\t'tab_eligibility': { 'label': $.i18n._( 'Eligibility' ) },\n\t\t\t'tab_holiday_time': { 'label': $.i18n._( 'Holiday Time' ) },\n\t\t\t'tab_holidays': {\n\t\t\t\t'label': $.i18n._( 'Holidays' ),\n\t\t\t\t'init_callback': 'initSubHolidayView',\n\t\t\t\t'display_on_mass_edit': false\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.APIHolidayPolicy,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_holiday',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\tvar tab_holiday_policy = this.edit_view_tab.find( '#tab_holiday_policy' );\n\n\t\t//Tab 0 start\n\n\t\tvar tab_holiday_policy_column1 = tab_holiday_policy.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_holiday_policy_column1 );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\t//Name\n\t\tform_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_holiday_policy_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Description\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'description', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_holiday_policy_column1, '', null, null, true );\n\n\t\tform_item_input.parent().width( '45%