1 line
61 KiB
JavaScript
1 line
61 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-geo_fence-GEOFenceViewController","leaflet-timetrex"],{7191:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"GEOFenceViewController\": () => (/* binding */ GEOFenceViewController)\n/* harmony export */ });\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5243);\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(leaflet__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var leaflet_draw__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1787);\n/* harmony import */ var leaflet_draw__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(leaflet_draw__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _global_widgets_color_picker_TColorPicker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3161);\n/* harmony import */ var _framework_leaflet_leaflet_timetrex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6889);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n// CSS\n\n\n\n// JS\n\n\n\n\n// Note: If markers are ever used in GeoFence Editor/Viewer, then see image fix in leaflet-timetrex. https://github.com/Leaflet/Leaflet/issues/4968\n\nclass GEOFenceViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#geo_fence_view_container',\n\n\t\t\t// _required_files: {\n\t\t\t// \t15: ['leaflet-timetrex', 'TColorPicker']\n\t\t\t// },\n\t\t\ttype_array: null,\n\n\t\t\tcompany_api: null,\n\t\t\tdrawControl: null,\n\t\t\tbounds: null,\n\t\t\tdrawnItems: null,\n\t\t\tsearch_key_delay: 0,\n\t\t\tstart_coordinates: null,\n\t\t\tmap_html_id: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit() {\n\t\t//this._super('initialize' );\n\t\tthis.edit_view_tpl = 'GEOFenceEditView.html';\n\t\tthis.permission_id = 'geo_fence';\n\t\tthis.viewId = 'GEOFence';\n\t\tthis.script_name = 'GEOFenceView';\n\t\tthis.table_name_key = 'geo_fence';\n\t\tthis.context_menu_name = $.i18n._( 'GEO Fence' );\n\t\tthis.navigation_label = $.i18n._( 'GEO Fence' );\n\t\tthis.api = TTAPI.APIGEOFence;\n\t\tthis.company_api = TTAPI.APICompany;\n\n\t\tif ( this.map ) {\n\t\t\tdelete ( this.map );\n\t\t}\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\t\tthis.initData();\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\tgroups: {\n\t\t\t\tmap: {\n\t\t\t\t\tlabel: $.i18n._( 'Map' ),\n\t\t\t\t\tid: this.viewId + 'Navigation'\n\t\t\t\t}\n\t\t\t},\n\t\t\texclude: ['export_excel', 'mass_edit'],\n\t\t\tinclude: [{\n\t\t\t\tlabel: $.i18n._( 'Map' ),\n\t\t\t\tid: 'map',\n\t\t\t\tmenu_align: 'right',\n\t\t\t\tgroup: 'map',\n\t\t\t\tvue_icon: 'tticon tticon-map_black_24dp',\n\t\t\t\tsort_order: 8000,\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 'map':\n\t\t\t\tthis.onMapClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonSaveAndContinueClick() {\n\t\tsuper.onSaveAndContinueClick();\n\t}\n\n\tonMapClick() {\n\t\t// only trigger map load in specific product editions.\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\tvar geo_fences;\n\t\t\tif ( this.edit_view ) {\n\t\t\t\tgeo_fences = [this.current_edit_record];\n\t\t\t} else if ( this.getGridSelectIdArray().length > 0 ) {\n\t\t\t\tgeo_fences = this.getSelectedItems();\n\t\t\t} else {\n\t\t\t\tgeo_fences = this.grid.getGridParam( 'data' );\n\t\t\t}\n\t\t\t// Currently not doing pre-processing for geofences, handling this directly in MapViewController\n\t\t\t// var processed_data_for_map = TTMapLib.TTConvertMapData.processBasicFromGenericViewController(geo_fences);\n\t\t\tIndexViewController.openEditView( this, 'Map', geo_fences );\n\t\t}\n\t}\n\n\tonAddClick() {\n\t\tTTPromise.add( 'init', 'init' );\n\t\tsuper.onAddCli
|