1 line
25 KiB
JavaScript
1 line
25 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["policy-recurring_holiday-RecurringHolidayViewController"],{2625:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RecurringHolidayViewController\": () => (/* binding */ RecurringHolidayViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass RecurringHolidayViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#recurring_holiday_view_container',\n\n\t\t\tspecial_day_array: null,\n\t\t\ttype_array: null,\n\t\t\tday_of_month_array: null,\n\t\t\tday_of_week_array: null,\n\t\t\tmonth_of_year_array: null,\n\n\t\t\talways_week_day_array: null,\n\t\t\tweek_interval_array: null,\n\t\t\tpivot_day_direction_array: null,\n\t\t\tdate_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 = 'RecurringHolidayEditView.html';\n\t\tthis.permission_id = 'holiday_policy';\n\t\tthis.viewId = 'RecurringHoliday';\n\t\tthis.script_name = 'RecurringHolidayView';\n\t\tthis.table_name_key = 'recurring_holiday';\n\t\tthis.context_menu_name = $.i18n._( 'Recurring Holiday' );\n\t\tthis.navigation_label = $.i18n._( 'Recurring Holiday' );\n\t\tthis.api = TTAPI.APIRecurringHoliday;\n\t\tthis.date_api = TTAPI.APITTDate;\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\tvar options = [\n\t\t\t{ option_name: 'special_day', field_name: 'special_day', api: this.api },\n\t\t\t{ option_name: 'week_interval', field_name: 'week_interval', api: this.api },\n\t\t\t{ option_name: 'type', api: this.api },\n\t\t\t{ option_name: 'pivot_day_direction', api: this.api },\n\t\t\t{ option_name: 'always_week_day', field_name: 'always_week_day', api: this.api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tthis.date_api.getDayOfMonthArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.day_of_month_array = res;\n\t\t\t}\n\t\t} );\n\t\tthis.date_api.getMonthOfYearArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.month_of_year_array = res;\n\t\t\t}\n\t\t} );\n\t\tthis.date_api.getDayOfWeekArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.day_of_week_array = res;\n\t\t\t}\n\t\t} );\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_recurring_holiday': { 'label': $.i18n._( 'Recurring 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.APIRecurringHoliday,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_recurring_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\t//Tab 0 start\n\n\t\tvar tab_recurring_holiday = this.edit_view_tab.find( '#tab_recurring_holiday' );\n\n\t\tvar tab_recurring_holiday_column1 = tab_recurring_holiday.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_recurring_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_recurring_holiday_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Special Day\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'special_day' } );\n\t\tform_item_input.setSourceData( $this.special_day_array );
|