TimeTrex/interface/html5/dist/policy-holiday-HolidayViewController.bundle.js

1 line
9.8 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["policy-holiday-HolidayViewController"],{677:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HolidayViewController\": () => (/* binding */ HolidayViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass HolidayViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#holiday_view_container',\n\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 = 'HolidayEditView.html';\n\t\tthis.permission_id = 'holiday_policy';\n\t\tthis.viewId = 'Holiday';\n\t\tthis.script_name = 'HolidayView';\n\t\tthis.table_name_key = 'holidays';\n\t\tthis.context_menu_name = $.i18n._( 'Holiday' );\n\t\tthis.navigation_label = $.i18n._( 'Holiday' );\n\t\tthis.api = TTAPI.APIHoliday;\n\t\tthis.event_bus = new TTEventBus({ view_id: this.viewId });\n\n\t\tthis.render();\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\t\t} else {\n\t\t\tthis.buildContextMenu();\n\t\t}\n\n\t\t//call init data in parent view\n\t\tif ( !this.sub_view_mode ) {\n\t\t\tthis.initData();\n\t\t}\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\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_holiday': { 'label': $.i18n._( 'Holiday' ) },\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.APIHoliday,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_holiday_holoday',\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_holiday = this.edit_view_tab.find( '#tab_holiday' );\n\n\t\tvar tab_holiday_column1 = tab_holiday.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_holiday_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_holiday_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t//Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'date_stamp' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Date' ), form_item_input, tab_holiday_column1, '' );\n\n\t}\n\n\tonSaveResult( result ) {\n\t\tsuper.onSaveResult( result );\n\t\tif ( result && result.isValid() ) {\n\t\t\tvar system_job_queue = result.getAttributeInAPIDetails( 'system_job_queue' );\n\t\t\tif ( system_job_queue ) {\n\t\t\t\tthis.event_bus.emit( 'tt_topbar', 'toggle_job_queue_spinner', {\n\t\t\t\t\tshow: true,\n\t\t\t\t\tget_job_data: true\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n}\n\nHolidayViewController.loadSubView = function( container, beforeViewLoadedFun, afterViewLoadedFun ) {\n\n\tGlobal.loadViewSource( 'Holiday', 'SubHolidayView.html', function( result ) {\n\t\tvar args = {};\n\t\tvar template = _.template( result );\n\n\t\tif ( Global.isSet( beforeViewLoadedFun ) ) {\n\t\t\tbeforeViewLoadedFun();\n\t\t}\n\n\t\tif ( Global.isSet( container ) ) {\n\t\t\tcontainer.html( template( args ) );\n\t\t\tif ( Global.isSet( afterViewLoadedFun ) ) {\n\t\t\t\tTTPromise.wait( 'BaseViewController', 'initialize', function() {\n\t\t\t\t\tafterViewLoadedFun( sub_holiday_view_controller );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t} );\n};//# sourceURL=[module]\n//# sourceMappingURL=data:appl