TimeTrex/interface/html5/dist/reports-report_schedule-ReportScheduleViewController.bundle.js

1 line
25 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["reports-report_schedule-ReportScheduleViewController"],{649:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ReportScheduleViewController\": () => (/* binding */ ReportScheduleViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass ReportScheduleViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#report_schedule_view_container',\n\n\t\t\tstatus_array: null,\n\t\t\tpriority_array: null,\n\t\t\tminute_array: null,\n\t\t\thour_array: null,\n\t\t\tday_of_month_array: null,\n\t\t\tmonth_array: null,\n\t\t\tday_of_week_array: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\n\t\tthis.edit_view_tpl = 'ReportScheduleEditView.html';\n\t\tthis.permission_id = 'report';\n\t\tthis.viewId = 'ReportSchedule';\n\t\tthis.script_name = 'ReportScheduleView';\n\t\tthis.table_name_key = 'report_schedule';\n\t\tthis.context_menu_name = $.i18n._( 'Report Schedule' );\n\t\tthis.navigation_label = $.i18n._( 'Report Schedule' );\n\t\tthis.api = TTAPI.APIReportSchedule;\n\n\t\tthis.render();\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\t\t\t//call init data in parent view, don't call initData\n\t\t} else {\n\t\t\tthis.buildContextMenu();\n\t\t\tif ( !this.sub_view_mode ) {\n\t\t\t\tthis.initData();\n\t\t\t}\n\t\t}\n\t}\n\n\tonAddResult( result ) {\n\t\tvar $this = this;\n\t\tvar result_data = result.getResult();\n\n\t\tif ( !result_data ) {\n\t\t\tresult_data = [];\n\t\t}\n\n\t\tresult_data.company = LocalCacheData.current_company.name;\n\n\t\tif ( $this.sub_view_mode && $this.parent_key ) {\n\t\t\tresult_data[$this.parent_key] = $this.parent_value;\n\t\t}\n\n\t\t$this.current_edit_record = result_data;\n\t\t$this.current_edit_record[this.parent_key] = this.parent_value;\n\t\t$this.initEditView();\n\t}\n\n\tinitOptions() {\n\t\tvar options = [\n\t\t\t{ option_name: 'status', api: this.api },\n\t\t\t{ option_name: 'priority', api: this.api },\n\t\t\t{ option_name: 'minute', api: this.api },\n\t\t\t{ option_name: 'hour', api: this.api },\n\t\t\t{ option_name: 'day_of_month', api: this.api },\n\t\t\t{ option_name: 'month', api: this.api },\n\t\t\t{ option_name: 'day_of_week', api: this.api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_report_schedule': { 'label': $.i18n._( 'Report Schedule' ) },\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.APIUserReportData,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_branch',\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_report_schedule = this.edit_view_tab.find( '#tab_report_schedule' );\n\n\t\tvar tab_report_schedule_column1 = tab_report_schedule.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_report_schedule_column1 );\n\n\t\t//Status\n\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'status_id', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_report_schedule_column1, '' );\n\n\t\t// Name\n\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_report_schedule_column1 );\n\t\tform_item_inp