1 line
31 KiB
JavaScript
1 line
31 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-job_item-JobItemViewController"],{878:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JobItemViewController\": () => (/* binding */ JobItemViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass JobItemViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#job_item_view_container',\n\n\t\t\tstatus_array: null,\n\n\t\t\tjob_item_group_array: null,\n\t\t\tjob_item_group_api: null,\n\n\t\t\tsub_document_view_controller: null,\n\n\t\t\tdocument_object_type_id: null,\n\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 = 'JobItemEditView.html';\n\t\tthis.permission_id = 'job_item';\n\t\tthis.viewId = 'JobItem';\n\t\tthis.script_name = 'JobItemView';\n\t\tthis.table_name_key = 'job_item';\n\t\tthis.context_menu_name = $.i18n._( 'Tasks' );\n\t\tthis.navigation_label = $.i18n._( 'Tasks' );\n\n\t\tthis.document_object_type_id = 70;\n\t\tthis.api = TTAPI.APIJobItem;\n\n\t\tthis.date_api = TTAPI.APITTDate;\n\n\t\tthis.job_item_group_api = TTAPI.APIJobItemGroup;\n\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\tthis.initDropDownOption( 'status' );\n\t\tthis.job_item_group_api.getJobItemGroup( '', false, false, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\tres = Global.buildTreeRecord( res );\n\n\t\t\t\tif ( !$this.sub_view_mode && $this.basic_search_field_ui_dic['group_id'] ) {\n\t\t\t\t\t$this.basic_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t\t$this.adv_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t}\n\n\t\t\t\t$this.job_item_group_array = res;\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: [],\n\t\t\tinclude: [{\n\t\t\t\tlabel: $.i18n._( 'Import' ),\n\t\t\t\tid: 'import_icon',\n\t\t\t\tmenu_align: 'right',\n\t\t\t\taction_group: 'import_export',\n\t\t\t\tgroup: 'other',\n\t\t\t\tvue_icon: 'tticon tticon-file_download_black_24dp',\n\t\t\t\tpermission_result: PermissionManager.checkTopLevelPermission( 'ImportCSVJobItem' ),\n\t\t\t\tpermission: null,\n\t\t\t\tsort_order: 9010\n\t\t\t}]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'import_icon':\n\t\t\t\tthis.onImportClick();\n\t\t\t\tbreak;\n\n\t\t}\n\t}\n\n\tonImportClick() {\n\t\tvar $this = this;\n\t\tIndexViewController.openWizard( 'ImportCSVWizard', 'JobItem', function() {\n\t\t\t$this.search();\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_task': { 'label': $.i18n._( 'Task' ), 'is_multi_column': true },\n\t\t\t'tab_attachment': true,\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIJobItem,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_job_item',\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_task = this.edit_view_tab.find( '#tab_task' );\n\n\t\tvar tab_task_column1 = tab_task.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_task_column1 );\n\n\t\t//Status\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'status_id' } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\
|