1 line
33 KiB
JavaScript
1 line
33 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["policy-schedule_policy-SchedulePolicyViewController"],{7911:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SchedulePolicyViewController\": () => (/* binding */ SchedulePolicyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass SchedulePolicyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#schedule_policy_view_container',\n\n\t\t\tover_time_policy_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 = 'SchedulePolicyEditView.html';\n\t\tthis.permission_id = 'schedule_policy';\n\t\tthis.viewId = 'SchedulePolicy';\n\t\tthis.script_name = 'SchedulePolicyView';\n\t\tthis.table_name_key = 'schedule_policy';\n\t\tthis.context_menu_name = $.i18n._( 'Schedule Policy' );\n\t\tthis.navigation_label = $.i18n._( 'Schedule Policy' );\n\t\tthis.api = TTAPI.APISchedulePolicy;\n\t\tthis.over_time_policy_api = TTAPI.APIOverTimePolicy;\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\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_schedule_policy': { 'label': $.i18n._( 'Schedule Policy' ) },\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.APISchedulePolicy,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_schedule',\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_schedule_policy = this.edit_view_tab.find( '#tab_schedule_policy' );\n\n\t\tvar tab_schedule_policy_column1 = tab_schedule_policy.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_schedule_policy_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_schedule_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_schedule_policy_column1, '', null, null, true );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t//Meal Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIMealPolicy,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_meal',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_any: true,\n\t\t\tfield: 'meal_policy',\n\t\t\tcustom_first_label: $.i18n._( '-- No Meal --' ),\n\t\t\taddition_source_function: this.onMealOrBreakSourceCreate,\n\t\t\tadded_items: [\n\t\t\t\t{ value: TTUUID.zero_id, label: $.i18n._( '-- Defined By Policy Group --' ) }\n\t\t\t]\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Meal Policy' ), form_item_input, tab_schedule_policy_column1 );\n\n\t\t//Break Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIBreakPolicy,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_break',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_any: true,\n\t\t\tfield: 'break_policy',\n\t\t\tcustom_first_label: '-- ' + $.i18n._( 'No Break' ) + ' --',\n\t\t\taddition_source_function: this.onMealOrBreakSourceCreate,\n\t\t\
|