diff --git a/unionvms-web-2/src/angular/app/auth/auth-endpoints.ts b/unionvms-web-2/src/angular/app/auth/auth-endpoints.ts index a3bd0d81a..ccfa3c407 100644 --- a/unionvms-web-2/src/angular/app/auth/auth-endpoints.ts +++ b/unionvms-web-2/src/angular/app/auth/auth-endpoints.ts @@ -1,6 +1,7 @@ export const AUTH_ENDPOINTS = { userLogin: '/usm-administration/rest/authenticate', getUserContexts: '/usm-administration/rest/userContexts', - userLogout: '/usm-administration/rest/sessions/' + userLogout: '/usm-administration/rest/sessions/', + getIsReviewContactDetailsEnabled: '/usm-administration/rest/persons/isReviewContactDetailsEnabled' }; diff --git a/unionvms-web-2/src/angular/app/auth/auth.service.ts b/unionvms-web-2/src/angular/app/auth/auth.service.ts index 562e16600..754f29415 100644 --- a/unionvms-web-2/src/angular/app/auth/auth.service.ts +++ b/unionvms-web-2/src/angular/app/auth/auth.service.ts @@ -29,4 +29,8 @@ export class AuthService { logOut(sessionId) { return this.http.delete(`${environment.baseURL}${AUTH_ENDPOINTS.userLogout}${sessionId}`).toPromise(); } + + getUserIsReviewContactDetailsEnabled() { + return this.http.get(`${environment.baseURL}${AUTH_ENDPOINTS.getIsReviewContactDetailsEnabled}`); + } } diff --git a/unionvms-web-2/src/angular/app/core/main/footer/footer.component.html b/unionvms-web-2/src/angular/app/core/main/footer/footer.component.html new file mode 100644 index 000000000..57dfd5d22 --- /dev/null +++ b/unionvms-web-2/src/angular/app/core/main/footer/footer.component.html @@ -0,0 +1,6 @@ +
+ +
+ diff --git a/unionvms-web-2/src/angular/app/core/main/footer/footer.component.scss b/unionvms-web-2/src/angular/app/core/main/footer/footer.component.scss new file mode 100644 index 000000000..ed21e498d --- /dev/null +++ b/unionvms-web-2/src/angular/app/core/main/footer/footer.component.scss @@ -0,0 +1,15 @@ +footer { + bottom: 0; + background-color: #ecf0f1; + color: white; + width: 100%; + padding-top: 4px; + margin-top: 100px; + min-width: 992px; + border-top: 1px solid #dddddd; + p { + margin-bottom: 5px; + font-size: 13px; + color: #666666; + } +} diff --git a/unionvms-web-2/src/angular/app/core/main/footer/footer.component.ts b/unionvms-web-2/src/angular/app/core/main/footer/footer.component.ts new file mode 100644 index 000000000..26c0d0647 --- /dev/null +++ b/unionvms-web-2/src/angular/app/core/main/footer/footer.component.ts @@ -0,0 +1,23 @@ +import { Component, OnInit } from '@angular/core'; +import { MainService } from './../main.service'; + +@Component({ + selector: 'app-footer', + templateUrl: './footer.component.html', + styleUrls: ['./footer.component.scss'] +}) + +export class FooterComponent implements OnInit { + platformVersion: string; + constructor(private mainService: MainService) { } + + ngOnInit() { + this.updatePlatformDependencies(); + } + + async updatePlatformDependencies() { + const result: any = await this.mainService.getPlatformVersion(); + this.platformVersion = result.data.platformVersion; + } + +} diff --git a/unionvms-web-2/src/angular/app/core/main/main-endpoints.ts b/unionvms-web-2/src/angular/app/core/main/main-endpoints.ts index f3a31137d..3ac1260fc 100644 --- a/unionvms-web-2/src/angular/app/core/main/main-endpoints.ts +++ b/unionvms-web-2/src/angular/app/core/main/main-endpoints.ts @@ -1,4 +1,5 @@ export const MAIN_ENDPOINTS = { countOpenAlarms: '/rules/rest/alarms/countopen', countUserOpenTickets: '/rules/rest/tickets/countopen', + getPlatformVersion: '/config/rest/module/all' }; diff --git a/unionvms-web-2/src/angular/app/core/main/main.component.html b/unionvms-web-2/src/angular/app/core/main/main.component.html index f80bd1891..455b678e9 100644 --- a/unionvms-web-2/src/angular/app/core/main/main.component.html +++ b/unionvms-web-2/src/angular/app/core/main/main.component.html @@ -2,4 +2,5 @@
+
diff --git a/unionvms-web-2/src/angular/app/core/main/main.module.ts b/unionvms-web-2/src/angular/app/core/main/main.module.ts index 429397ea4..ed0e49839 100644 --- a/unionvms-web-2/src/angular/app/core/main/main.module.ts +++ b/unionvms-web-2/src/angular/app/core/main/main.module.ts @@ -5,16 +5,15 @@ import { SharedModule } from '../../shared/shared.module'; import { MainRoutingModule } from './main-routing.module'; import { HeaderComponent } from './header/header.component'; import { NavigationComponent } from './navigation/navigation.component'; - - - +import { FooterComponent } from './footer/footer.component' @NgModule({ declarations: [ MainComponent, HeaderComponent, NavigationComponent, - ClockComponent + ClockComponent, + FooterComponent ], imports: [ SharedModule, diff --git a/unionvms-web-2/src/angular/app/core/main/main.service.ts b/unionvms-web-2/src/angular/app/core/main/main.service.ts index aa4c25143..6ecdb58ed 100644 --- a/unionvms-web-2/src/angular/app/core/main/main.service.ts +++ b/unionvms-web-2/src/angular/app/core/main/main.service.ts @@ -5,7 +5,6 @@ import { HttpClient } from '@angular/common/http'; import { environment } from '../../../environments/environment'; import { ResponseDto } from 'app/features/features.model'; - // provide in main module? @Injectable({ providedIn: 'root', @@ -21,4 +20,9 @@ export class MainService { countUserOpenTickets(username): Promise> { return this.http.get>(`${environment.baseURL}${MAIN_ENDPOINTS.countUserOpenTickets}/${username}`).toPromise(); } + + async getPlatformVersion() { + return this.http.get(`${environment.baseURL}${MAIN_ENDPOINTS.getPlatformVersion}`).toPromise(); + } + } diff --git a/unionvms-web-2/src/angular/app/core/main/navigation/navigation-tabs.ts b/unionvms-web-2/src/angular/app/core/main/navigation/navigation-tabs.ts index b06d74973..8ffb95625 100644 --- a/unionvms-web-2/src/angular/app/core/main/navigation/navigation-tabs.ts +++ b/unionvms-web-2/src/angular/app/core/main/navigation/navigation-tabs.ts @@ -4,85 +4,64 @@ export const NAVIGATION_TABS = [ { id: 1, name: 'Today', - href: `${environment.oldBaseURL}/#/today`, - // permissions: [300001] + href: `${environment.oldBaseURL}/#/today` }, { id: 2, name: 'Reports', href: `${environment.oldBaseURL}/#/reporting`, - // permissions: [300001] + permissions: [21] //LIST_REPORTS }, { id: 3, name: 'Area management', href: `${environment.oldBaseURL}/#/areas`, - // permissions: [100041] + permissions: [100036] //VIEW_AREA_MANAGEMENT_UI }, { id: 4, name: 'Subscriptions', route: '/subscriptions', - // permissions: [300001] + permissions: [300000] //VIEW_SUBSCRIPTION }, { id: 5, name: 'Activity', href: `${environment.oldBaseURL}/#/activity`, - // permissions: [279] + permissions: [100026] //ACTIVITY_ALLOWED }, { id: 6, - name: 'Positions', - href: `${environment.oldBaseURL}/#/movement`, - // permissions: [300001] + name: 'Positions' }, { id: 7, name: 'Sales', href: `${environment.oldBaseURL}/#/sales`, - // permissions: [300001] + permissions: [300002] //viewSalesReports }, { id: 8, name: 'Exchange', href: `${environment.oldBaseURL}/#/exchange`, - // permissions: [300001] + permissions: [249] //viewExchange }, { id: 9, - name: 'Polling', - href: `${environment.oldBaseURL}/#/polling/logs`, - // permissions: [100034] + name: 'Assets', + href: `${environment.oldBaseURL}/#/assets`, + permissions: [292] //viewVesselsAndMobileTerminals }, { id: 10, - name: 'Mobile terminals', - href: `${environment.oldBaseURL}/#/communication`, - // permissions: [300001] + name: 'Alerts' }, { id: 11, - name: 'Assets', - href: `${environment.oldBaseURL}/#/assets`, - // permissions: [300001] + name: 'User' }, { id: 12, - name: 'Alerts', - href: `${environment.oldBaseURL}/#/alerts/holdingtable`, - // permissions: [300001] - }, - { - id: 13, - name: 'User', - href: `${environment.oldBaseURL}/#/usm/users`, - // permissions: [300001] - }, - { - id: 14, - name: 'Admin', - href: `${environment.oldBaseURL}/#/admin/auditlog`, - // permissions: [300001] + name: 'Admin' } ]; diff --git a/unionvms-web-2/src/angular/app/core/main/navigation/navigation.component.ts b/unionvms-web-2/src/angular/app/core/main/navigation/navigation.component.ts index 70bb2982b..b68897cfe 100644 --- a/unionvms-web-2/src/angular/app/core/main/navigation/navigation.component.ts +++ b/unionvms-web-2/src/angular/app/core/main/navigation/navigation.component.ts @@ -1,14 +1,16 @@ -import { Component, OnInit, OnDestroy, ElementRef } from '@angular/core'; -import { Router, ActivatedRoute } from '@angular/router'; -import { Store } from '@ngrx/store'; +import {Component, OnInit} from '@angular/core'; +import {ActivatedRoute} from '@angular/router'; +import {Store} from '@ngrx/store'; import * as fromRoot from '../../../app.reducer'; -import { take, throttleTime } from 'rxjs/operators'; - -import { AuthResponse } from 'app/auth/auth-response.model'; -import { Observable, fromEvent } from 'rxjs'; -import { NAVIGATION_TABS } from './navigation-tabs'; -import { NavigationTab } from './navigation-tab.model'; +import {throttleTime} from 'rxjs/operators'; +import {AuthResponse} from 'app/auth/auth-response.model'; +import {fromEvent, Observable} from 'rxjs'; +import {NAVIGATION_TABS} from './navigation-tabs'; +import {NavigationTab} from './navigation-tab.model'; +import {environment} from "../../../../environments/environment"; +import {AuthService} from "../../../auth/auth.service"; +import {Context, Feature, UserContexts} from "../../../auth/user-contexts.model"; @Component({ @@ -24,21 +26,78 @@ export class NavigationComponent implements OnInit { // currentUrl$: Observable<>; - constructor(private store: Store, private activatedRoute: ActivatedRoute) { } + constructor(private store: Store, private activatedRoute: ActivatedRoute, private authService: AuthService) { } ngOnInit() { - // this.authenticatedUser$.pipe(take(1)).subscribe( - // authUser => { - // this.userPemissions = authUser.permissions; - // } - // ); - // A tab can be shown if appropriate permission exists withing the jwt token features array - // this.availableTabs = NAVIGATION_TABS.filter(element => element.permissions.some(entry => this.userPemissions.includes(entry))); - - // No checks for now - this.availableTabs = NAVIGATION_TABS; + let scopeName = localStorage.getItem('scopeName'); + let roleName = localStorage.getItem('roleName'); + this.authService.getUserContexts().toPromise().then((contexts: UserContexts) => { + let currentContext: Context = contexts.contextSet.contexts.find((context:Context) => { + return context.scope.scopeName === scopeName && context.role.roleName === roleName; + }); + this.userPemissions = currentContext.role.features.map((feature: Feature) => { + return feature.featureId; + }); + this.setAvailableTabs(); + }); this.setUpAutoResize(); + } + + private setAvailableTabs() { + + let movementTab = NAVIGATION_TABS[5]; + if(this.userPemissions.includes(267)) { //viewMovements + movementTab['href'] = `${environment.oldBaseURL}/#/movement`; + } else if (this.userPemissions.includes(276)) { //viewManualMovements + movementTab['href'] = `${environment.oldBaseURL}/#/movement/manual`; + } else { + movementTab['permissions'] = [-1]; //tab is not shown + } + + let alarmsTab = NAVIGATION_TABS[9]; + if(this.userPemissions.includes(208)) { //viewAlarmsHoldingTable + alarmsTab['href'] = `${environment.oldBaseURL}/#/alerts/holdingtable`; + } else if (this.userPemissions.includes(210)) { //viewAlarmsOpenTickets + alarmsTab['href'] = `${environment.oldBaseURL}/#/alerts/notifications`; + } else if (this.userPemissions.includes(206)) { //viewAlarmRules + alarmsTab['href'] = `${environment.oldBaseURL}/#/alerts/rules`; + } else { + alarmsTab['permissions'] = [-1]; //tab is not shown + } + + let usersTab = NAVIGATION_TABS[10]; + if(this.userPemissions.includes(100001) || this.userPemissions.includes(100000)) { // manageUsers or viewUsers + usersTab['href'] = `${environment.oldBaseURL}/#/usm/users`; + } else if (this.userPemissions.includes(100004) || this.userPemissions.includes(100003)) { //manageOrganisations or viewOrganisations + usersTab['href'] = `${environment.oldBaseURL}/#/usm/organisations`; + } else if (this.userPemissions.includes(100011) || this.userPemissions.includes(100010)) { //manageRoles or viewRoles + usersTab['href'] = `${environment.oldBaseURL}/#/usm/roles`; + } else if (this.userPemissions.includes(100015) || this.userPemissions.includes(100014)) { //manageScopes or viewScopes + usersTab['href'] = `${environment.oldBaseURL}/#/usm/scopes`; + } else if (this.userPemissions.includes(100006) || this.userPemissions.includes(100005)) { //manageApplications or viewApplications + usersTab['href'] = `${environment.oldBaseURL}/#/usm/applications`; + } else if (this.userPemissions.includes(100018)) { //configurePolicies + usersTab['href'] = `${environment.oldBaseURL}/#/usm/policies`; + } else if (this.userPemissions.includes(100001)) { //manageUsers + this.authService.getUserIsReviewContactDetailsEnabled().toPromise().then( resp => { + if(!resp['result']) { + usersTab['href'] = `${environment.oldBaseURL}/#/usm/changes`; + this.availableTabs = NAVIGATION_TABS.filter(element =>!element.permissions || element.permissions.some(entry => this.userPemissions.includes(entry))); + } + }); + } else { + usersTab['permissions'] = [-1]; //tab is not shown + } + let adminTab = NAVIGATION_TABS[11]; + if (this.userPemissions.includes(286)) { //viewAudit + adminTab['href'] = `${environment.oldBaseURL}/#/admin/auditlog`; + } else if (this.userPemissions.includes(214)) { //viewConfiguration + adminTab['href'] = `${environment.oldBaseURL}/#/admin/configuration`; + } else { + adminTab['permissions'] = [-1]; //tab is not shown + } + this.availableTabs = NAVIGATION_TABS.filter(element =>!element.permissions || element.permissions.some(entry => this.userPemissions.includes(entry))); } diff --git a/unionvms-web/app/app.js b/unionvms-web/app/app.js index ce1e402fe..9efc57785 100644 --- a/unionvms-web/app/app.js +++ b/unionvms-web/app/app.js @@ -293,98 +293,6 @@ unionvmsWebApp.config(function($stateProvider, $compileProvider, tmhDynamicLocal pageTitle: 'header.page_title_assets' } }) - .state('app.communication', { - url: '/communication', - views: { - modulepage: { - templateUrl: 'partial/mobileTerminal/mobileTerminal.html', - controller: 'MobileTerminalCtrl' - } - }, - resolve: { - config : function(initService){ - return initService.loadConfigFor(["MOBILETERMINAL", "MOBILE_TERMINAL_TRANSPONDERS", "VESSEL"]); - } - }, - data: { - access: 'viewVesselsAndMobileTerminals', - pageTitle: 'header.page_title_mobile_terminals' - }, - }) - .state('app.communication-id', { - url: '/communication/:id', - views: { - modulepage: { - templateUrl: 'partial/mobileTerminal/mobileTerminal.html', - controller: 'MobileTerminalCtrl' - } - }, - resolve: { - config : function(initService){ - return initService.loadConfigFor(["MOBILETERMINAL", "MOBILE_TERMINAL_TRANSPONDERS", "VESSEL"]); - } - }, - data: { - access: 'viewVesselsAndMobileTerminals', - pageTitle: 'header.page_title_mobile_terminals' - }, - }) - .state('app.polling', { - url: '/polling', - params: { - cfr: null, - externalMarking: null, - ircs: null, - name: null - }, - views: { - modulepage: { - templateUrl: 'partial/polling/newPollWizard/newPollWizard.html', - controller: 'newPollWizardCtrl' - } - }, - resolve: {}, - data: { - access: 'managePolls', - pageTitle: 'header.page_title_new_poll' - }, - }) - .state('app.pollingLogs', { - url: '/polling/logs', - views: { - modulepage: { - templateUrl: 'partial/polling/pollingLogs/pollingLogs.html', - controller: 'pollingLogsCtrl' - } - }, - resolve: { - config : function(initService){ - return initService.loadConfigFor(["EXCHANGE", "MOBILE_TERMINAL_TRANSPONDERS"]); - } - }, - data: { - access: 'viewMobileTerminalPolls', - pageTitle: 'header.page_title_polling_logs' - }, - }) - .state('app.pollingLogs-id', { - url: '/polling/logs/:id', - views: { - modulepage: { - templateUrl: 'partial/polling/pollingLogs/pollingLogs.html', - controller: 'pollingLogsCtrl' - } - }, - resolve: { - config : function(initService){ - return initService.loadConfigFor(["EXCHANGE", "MOBILE_TERMINAL_TRANSPONDERS"]); - } - }, - data: { - access: 'viewMobileTerminalPolls', - pageTitle: 'header.page_title_polling_logs' - }, - }) .state('app.auditLog', { url: '/admin/auditlog', views: { diff --git a/unionvms-web/app/app.less b/unionvms-web/app/app.less index b1fa67487..bd3a56d20 100644 --- a/unionvms-web/app/app.less +++ b/unionvms-web/app/app.less @@ -116,6 +116,7 @@ copy of the GNU General Public License along with the IFDM Suite. If not, see } */ + this._deferreds = []; + + doResolve(fn, this); +} + +function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function() { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); +} + +function resolve(self, newValue) { + try { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } +} + +function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); +} + +function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function() { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; +} + +/** + * @constructor + */ +function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; +} + +/** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ +function doResolve(fn, self) { + var done = false; + try { + fn( + function(value) { + if (done) return; + done = true; + resolve(self, value); + }, + function(reason) { + if (done) return; + done = true; + reject(self, reason); + } + ); + } catch (ex) { + if (done) return; + done = true; + reject(self, ex); + } +} + +Promise.prototype['catch'] = function(onRejected) { + return this.then(null, onRejected); +}; + +Promise.prototype.then = function(onFulfilled, onRejected) { + // @ts-ignore + var prom = new this.constructor(noop); + + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; +}; + +Promise.prototype['finally'] = finallyConstructor; + +Promise.all = function(arr) { + return new Promise(function(resolve, reject) { + if (!isArray(arr)) { + return reject(new TypeError('Promise.all accepts an array')); + } + + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call( + val, + function(val) { + res(i, val); + }, + reject + ); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); +}; + +Promise.allSettled = allSettled; + +Promise.resolve = function(value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function(resolve) { + resolve(value); + }); +}; + +Promise.reject = function(value) { + return new Promise(function(resolve, reject) { + reject(value); + }); +}; + +Promise.race = function(arr) { + return new Promise(function(resolve, reject) { + if (!isArray(arr)) { + return reject(new TypeError('Promise.race accepts an array')); + } + + for (var i = 0, len = arr.length; i < len; i++) { + Promise.resolve(arr[i]).then(resolve, reject); + } + }); +}; + +// Use polyfill for setImmediate for performance gains +Promise._immediateFn = + // @ts-ignore + (typeof setImmediate === 'function' && + function(fn) { + // @ts-ignore + setImmediate(fn); + }) || + function(fn) { + setTimeoutFunc(fn, 0); + }; + +Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console + } +}; + +/** @suppress {undefinedVars} */ +var globalNS = (function() { + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. + if (typeof self !== 'undefined') { + return self; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof global !== 'undefined') { + return global; + } + throw new Error('unable to locate global object'); +})(); + +// Expose the polyfill if Promise is undefined or set to a +// non-function value. The latter can be due to a named HTMLElement +// being exposed by browsers for legacy reasons. +// https://github.com/taylorhakes/promise-polyfill/issues/114 +if (typeof globalNS['Promise'] !== 'function') { + globalNS['Promise'] = Promise; +} else if (!globalNS.Promise.prototype['finally']) { + globalNS.Promise.prototype['finally'] = finallyConstructor; +} else if (!globalNS.Promise.allSettled) { + globalNS.Promise.allSettled = allSettled; +} + +}))); diff --git a/unionvms-web/app/directive/common/menuBar/menuBar.js b/unionvms-web/app/directive/common/menuBar/menuBar.js index dae1f7211..9af2f8c97 100644 --- a/unionvms-web/app/directive/common/menuBar/menuBar.js +++ b/unionvms-web/app/directive/common/menuBar/menuBar.js @@ -1,83 +1,80 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . - */ - -angular.module('unionvmsWeb') - .directive('menuBar', function() { - return { - restrict: 'E', - replace: true, - require: "^ngModel", - scope: { - header : '=', - modeltype : '=', - isCreateNewMode : '=', - disableForm : '=', - ngModel : '=', - functions : '=' - }, - templateUrl: 'directive/common/menuBar/menuBar.html', - controller: 'MenuBarCtrl', - }; -}); - - -angular.module('unionvmsWeb') - .controller('MenuBarCtrl', function($scope, searchService, searchUtilsService, SearchField){ - //Set form partial depending on modelType - switch($scope.modeltype) { - case "VESSEL": - $scope.formPartial = 'directive/common/menuBar/vessel/vesselMenuBar.html'; - break; - case "MOBILE_TERMINAL": - $scope.formPartial = 'directive/common/menuBar/mobileTerminal/mobileTerminalMenuBar.html'; - break; - default: - console.error("ModelType is missing for menu bar. " + $scope.modeltype); - } - - $scope.includeSaveUpdate = function() { - if (angular.isDefined($scope.functions.saveCallback && $scope.functions.updateCallback && $scope.functions.showSave)) { - return $scope.functions.showSave($scope.ngModel); - } - }; - $scope.includeCSVDownload = function() { - if (angular.isDefined($scope.functions.exportToCsvCallback && $scope.functions.showExport)) { - return $scope.functions.showExport($scope.ngModel); - } - }; - $scope.includeArchive = function() { - if (angular.isDefined($scope.functions.archiveCallback && $scope.functions.showArchive)) { - return $scope.functions.showArchive($scope.ngModel); - } - }; - $scope.includeHistory = function() { - if (angular.isDefined($scope.functions.historyCallback && $scope.functions.showHistory)) { - return $scope.functions.showHistory($scope.ngModel); - } - }; - $scope.includeUnlink = function() { - if (angular.isDefined($scope.functions.unlinkCallback && $scope.functions.showUnlink)) { - return $scope.functions.showUnlink($scope.ngModel); - } - }; - $scope.includeRemove = function() { - if (angular.isDefined($scope.functions.removeCallback && $scope.functions.showRemove)) { - return $scope.functions.showRemove($scope.ngModel); - } - }; - $scope.includeCancel = function() { - if (angular.isDefined($scope.functions.cancelCallback && $scope.functions.showCancel)) { - return $scope.functions.showCancel($scope.ngModel); - } - }; - -}); +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . + */ + +angular.module('unionvmsWeb') + .directive('menuBar', function() { + return { + restrict: 'E', + replace: true, + require: "^ngModel", + scope: { + header : '=', + modeltype : '=', + isCreateNewMode : '=', + disableForm : '=', + ngModel : '=', + functions : '=' + }, + templateUrl: 'directive/common/menuBar/menuBar.html', + controller: 'MenuBarCtrl', + }; +}); + + +angular.module('unionvmsWeb') + .controller('MenuBarCtrl', function($scope, searchService, searchUtilsService, SearchField){ + //Set form partial depending on modelType + switch($scope.modeltype) { + case "VESSEL": + $scope.formPartial = 'directive/common/menuBar/vessel/vesselMenuBar.html'; + break; + default: + console.error("ModelType is missing for menu bar. " + $scope.modeltype); + } + + $scope.includeSaveUpdate = function() { + if (angular.isDefined($scope.functions.saveCallback && $scope.functions.updateCallback && $scope.functions.showSave)) { + return $scope.functions.showSave($scope.ngModel); + } + }; + $scope.includeCSVDownload = function() { + if (angular.isDefined($scope.functions.exportToCsvCallback && $scope.functions.showExport)) { + return $scope.functions.showExport($scope.ngModel); + } + }; + $scope.includeArchive = function() { + if (angular.isDefined($scope.functions.archiveCallback && $scope.functions.showArchive)) { + return $scope.functions.showArchive($scope.ngModel); + } + }; + $scope.includeHistory = function() { + if (angular.isDefined($scope.functions.historyCallback && $scope.functions.showHistory)) { + return $scope.functions.showHistory($scope.ngModel); + } + }; + $scope.includeUnlink = function() { + if (angular.isDefined($scope.functions.unlinkCallback && $scope.functions.showUnlink)) { + return $scope.functions.showUnlink($scope.ngModel); + } + }; + $scope.includeRemove = function() { + if (angular.isDefined($scope.functions.removeCallback && $scope.functions.showRemove)) { + return $scope.functions.showRemove($scope.ngModel); + } + }; + $scope.includeCancel = function() { + if (angular.isDefined($scope.functions.cancelCallback && $scope.functions.showCancel)) { + return $scope.functions.showCancel($scope.ngModel); + } + }; + +}); diff --git a/unionvms-web/app/directive/common/tableFilterHeaders/tableFilterHeaders.html b/unionvms-web/app/directive/common/tableFilterHeaders/tableFilterHeaders.html index 7253ea9ae..b8a08a339 100644 --- a/unionvms-web/app/directive/common/tableFilterHeaders/tableFilterHeaders.html +++ b/unionvms-web/app/directive/common/tableFilterHeaders/tableFilterHeaders.html @@ -21,7 +21,7 @@ {{item[column.srcProp] + ' ' + item.durationMeasure}} {{item['translated' + column.srcProp]}} {{item[column.srcProp]}} - {{item[column.srcProp] | negateSubractedCatchType: item | number:2}} + {{item[column.srcProp] | negateSubractedCatchType: item | number:2}} diff --git a/unionvms-web/app/directive/common/tableFilterHeaders/tableFilterHeaders.less b/unionvms-web/app/directive/common/tableFilterHeaders/tableFilterHeaders.less index 97d85c8df..37399fdc9 100644 --- a/unionvms-web/app/directive/common/tableFilterHeaders/tableFilterHeaders.less +++ b/unionvms-web/app/directive/common/tableFilterHeaders/tableFilterHeaders.less @@ -41,4 +41,8 @@ copy of the GNU General Public License along with the IFDM Suite. If not, see 0) { return; } - + tip = locale.getString(data.node.data.optionsTip); $('') .appendTo($title) @@ -251,13 +279,13 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer openSettingsModal(data); }); }; - + //Options modal var openModal = function(type){ if (angular.isDefined(reportService.autoRefreshInterval)){ reportService.stopAutoRefreshInterval(); } - + var modalInstance = $modal.open({ templateUrl: 'partial/spatial/reportsPanel/reportForm/mapConfigurationModal/mapConfigurationModal.html', controller: 'MapconfigurationmodalCtrl', @@ -276,7 +304,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer } displayStatus.push(status); }); - + var components = { fromLayerTree: locale.getString('spatial.' + type + '_config_modal_title'), styles: { @@ -285,19 +313,19 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer alarm: displayStatus[2] } }; - + if (type !== 'alarms'){ components.visibility = { position: displayStatus[0], - segment: displayStatus[1] + segment: displayStatus[1] }; } - + return components; } } }); - + modalInstance.result.then(function(data){ if (!angular.equals(reportFormService.liveView.currentReport.currentMapConfig.mapConfiguration, data.mapSettings)){ reportFormService.liveView.currentReport.currentMapConfig.mapConfiguration = data.mapSettings; @@ -314,7 +342,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer spatialHelperService.configureFullscreenModal(modalInstance); }; - + var openSettingsModal = function(data){ var type = data.node.data.type; if (!angular.isDefined(reportFormService.liveView.currentReport)){ @@ -322,7 +350,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer var report = new Report(); report = report.fromJson(response); reportFormService.liveView.originalReport = report; - + reportFormService.liveView.currentReport = new Report(); angular.copy(report, reportFormService.liveView.currentReport); openModal(type); @@ -335,7 +363,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer openModal(type); } }; - + //add label button for vectors var addLabel = function(data){ var tip, @@ -350,7 +378,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer var cls = 'fa fa-tag fancytree-clickable'; var empty = false; - if ((data.node.data.type === 'vmspos' && mapService.labelVisibility.positions.length === 0) || + if ((data.node.data.type === 'vmspos' && mapService.labelVisibility.positions.length === 0) || (data.node.data.type === 'vmsseg' && mapService.labelVisibility.segments.length === 0) || (data.node.data.type === 'ers' && mapService.labelVisibility.activities.length === 0)){ tip = locale.getString('spatial.layer_tree_empty_popup_label_visibility_settings'); @@ -540,7 +568,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer scope.$tree.reload( source ); updateMap(); }; - + //nodes is an array layerPanelService.addLayerTreeNode = function(nodes) { var root = scope.$tree.getRootNode(); @@ -595,7 +623,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer return selectedNodes; }; - + layerPanelService.getChildrenByStatus = function(checkedStatus, parentType){ var root = scope.$tree.getRootNode(); var targetNode = root.findAll(function(node){ @@ -609,7 +637,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer nodes.push(child.data.filterType); } }); - + return nodes; }; @@ -627,7 +655,7 @@ angular.module('unionvmsWeb').directive('layerTree', function($q, $modal, mapSer } }); }; - + layerPanelService.toggleCheckNode = function(type, status){ var root = scope.$tree.getRootNode(); var node = root.findAll(function(node){ diff --git a/unionvms-web/app/directive/spatial/legendPanel/legendPanel.js b/unionvms-web/app/directive/spatial/legendPanel/legendPanel.js index 3f1792b94..05eddcd84 100644 --- a/unionvms-web/app/directive/spatial/legendPanel/legendPanel.js +++ b/unionvms-web/app/directive/spatial/legendPanel/legendPanel.js @@ -1,130 +1,130 @@ /* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').directive('imageOnLoad', function(){ - return { - restrict: 'A', - link: function(scope, element, attrs){ - element.bind('error', function(){ - scope.$emit('legendError', scope.$parent.$parent.record); - }); - }, - controller: function($scope){ - var record = $scope.$parent.$parent.record; - $scope.$parent.$on('legendError', function(evt, record){ - record.visibility = false; - }); - } - }; -}) -.directive('legendPanel', function(locale, mapService, unitConversionService, $localStorage, $compile, layerPanelService) { - return { - restrict: 'EA', - replace: true, - scope: false, - templateUrl: 'directive/spatial/legendPanel/legendPanel.html', - controller: function(){ - - //For WMS layers - this.buildRecWMS = function(layer){ - var isInternal = layer.get('isInternal'); - var record = { - isLabelOnly: false - }; - var src = layer.getSource(); - var params = src.getParams(); - - var url = src.getUrls()[0]; - if (url.substr(url.length - 1) !== '?'){ - url += '?'; - } - url += 'REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=25&HEIGHT=25&LAYER=' + params.LAYERS; - if (params.STYLES !== '' && angular.isDefined(params.STYLES)){ - if (params.STYLES.indexOf('label') !== -1 && params.STYLES.indexOf('geom') === -1){ - url = undefined; - record.isLabelOnly = true; - } else { - url += '&STYLE=' + params.STYLES; - } - } - - if (angular.isDefined(url)){ - url += '&SCALE=' + mapService.getCurrentScale(); - - if (isInternal){ - this.getLegendWithUsm(url, record); - record.isInternal = true; - } else { - record.src = url; - record.isInternal = false; - } - } - - record.title = layer.get('title'); - record.type = 'wms'; - record.visibility = layer.get('visible'); - - return record; - }; - - this.getLegendWithUsm = function(url, record){ - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.withCredentials = true; - xhr.setRequestHeader('Authorization', $localStorage.token); - xhr.responseType = 'arraybuffer'; - xhr.onload = function(){ - if (typeof window.btoa === 'function'){ - if (this.status === 200){ - var uInt8Array = new Uint8Array(this.response); - var i = uInt8Array.length; - var binaryString = new Array(i); - while (i--){ - binaryString[i] = String.fromCharCode(uInt8Array[i]); - } - var data = binaryString.join(''); - var type = xhr.getResponseHeader('content-type'); - if (type.indexOf('image') === 0) { - record.src = 'data:' + type + ';base64,' + window.btoa(data); - } - } - } - }; - xhr.send(); - }; - - //VMS positions - this.buildRecVmsPos = function(layer){ - var record = { - title: layer.get('title'), - subtitle: this.getSubtitle('positions'), - type: 'vmspos', - visibility: layer.get('visible'), - styles: this.getStyles('positions') - }; - - return record; - }; - - //VMS segments - this.buildRecVmsSeg = function(layer){ - var record = { - title: layer.get('title'), - subtitle: this.getSubtitle('segments'), - type: 'vmsseg', - visibility: layer.get('visible'), - styles: this.getStyles('segments') - }; - - return record; +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').directive('imageOnLoad', function(){ + return { + restrict: 'A', + link: function(scope, element, attrs){ + element.bind('error', function(){ + scope.$emit('legendError', scope.$parent.$parent.record); + }); + }, + controller: function($scope){ + var record = $scope.$parent.$parent.record; + $scope.$parent.$on('legendError', function(evt, record){ + record.visibility = false; + }); + } + }; +}) +.directive('legendPanel', function(locale, mapService, unitConversionService, $localStorage, $compile, layerPanelService) { + return { + restrict: 'EA', + replace: true, + scope: false, + templateUrl: 'directive/spatial/legendPanel/legendPanel.html', + controller: function(){ + + //For WMS layers + this.buildRecWMS = function(layer){ + var isInternal = layer.get('isInternal'); + var record = { + isLabelOnly: false + }; + var src = layer.getSource(); + var params = src.getParams(); + + var url = src.getUrls()[0]; + if (url.substr(url.length - 1) !== '?'){ + url += '?'; + } + url += 'REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=25&HEIGHT=25&LAYER=' + params.LAYERS; + if (params.STYLES !== '' && angular.isDefined(params.STYLES)){ + if (params.STYLES.indexOf('label') !== -1 && params.STYLES.indexOf('geom') === -1){ + url = undefined; + record.isLabelOnly = true; + } else { + url += '&STYLE=' + params.STYLES; + } + } + + if (angular.isDefined(url)){ + url += '&SCALE=' + mapService.getCurrentScale(); + + if (isInternal){ + this.getLegendWithUsm(url, record); + record.isInternal = true; + } else { + record.src = url; + record.isInternal = false; + } + } + + record.title = layer.get('title'); + record.type = 'wms'; + record.visibility = layer.get('visible'); + + return record; + }; + + this.getLegendWithUsm = function(url, record){ + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.withCredentials = true; + xhr.setRequestHeader('Authorization', $localStorage.token); + xhr.responseType = 'arraybuffer'; + xhr.onload = function(){ + if (typeof window.btoa === 'function'){ + if (this.status === 200){ + var uInt8Array = new Uint8Array(this.response); + var i = uInt8Array.length; + var binaryString = new Array(i); + while (i--){ + binaryString[i] = String.fromCharCode(uInt8Array[i]); + } + var data = binaryString.join(''); + var type = xhr.getResponseHeader('content-type'); + if (type.indexOf('image') === 0) { + record.src = 'data:' + type + ';base64,' + window.btoa(data); + } + } + } + }; + xhr.send(); + }; + + //VMS positions + this.buildRecVmsPos = function(layer){ + var record = { + title: layer.get('title'), + subtitle: this.getSubtitle('positions'), + type: 'vmspos', + visibility: layer.get('visible'), + styles: this.getStyles('positions') + }; + + return record; + }; + + //VMS segments + this.buildRecVmsSeg = function(layer){ + var record = { + title: layer.get('title'), + subtitle: this.getSubtitle('segments'), + type: 'vmsseg', + visibility: layer.get('visible'), + styles: this.getStyles('segments') + }; + + return record; }; //Fishing activities @@ -138,59 +138,59 @@ angular.module('unionvmsWeb').directive('imageOnLoad', function(){ }; return record; - }; - - //Alarms - this.buildRecAlarms = function(layer){ - var record = { - title: layer.get('title'), - subtitle: locale.getString('spatial.styles_attr_status'), - type: 'alarms', - visibility: layer.get('visible'), - styles: this.getAlarmStyles() - }; - - return record; - }; - - this.getSubtitle = function(type){ - var srcDef = mapService.styles[type]; - var withSpeed = ['reportedSpeed', 'calculatedSpeed', 'speedOverGround']; - var withCourse = ['reportedCourse', 'courseOverGround']; - - var subTitle = locale.getString('spatial.styles_attr_' + srcDef.attribute); - if (_.indexOf(withSpeed, srcDef.attribute) !== -1){ - var srcUnit = unitConversionService.speed.getUnit(); - subTitle += ' (' + locale.getString('common.speed_unit_' + srcUnit) + ')'; - } - - if (_.indexOf(withCourse, srcDef.attribute) !== -1){ - subTitle += ' (' + String.fromCharCode(parseInt('00B0', 16)) + ')'; - } - - if (srcDef.attribute === 'distance'){ - subTitle += ' (' + unitConversionService.distance.getUnit() + ')'; - } - - return subTitle; - }; - - //Get styles for alarms - this.getAlarmStyles = function(){ - var srcDef = mapService.styles.alarms; - var keys = Object.keys(srcDef); - - var finalStyles = []; - for (var i = 0; i < keys.length; i++){ - if (keys[i] !== 'size'){ - finalStyles.push({ - title: locale.getString('spatial.legend_panel_alarms_' + keys[i]), - color: {"color": srcDef[keys[i]]} - }); - } - } - - return finalStyles; + }; + + //Alarms + this.buildRecAlarms = function(layer){ + var record = { + title: layer.get('title'), + subtitle: locale.getString('spatial.styles_attr_status'), + type: 'alarms', + visibility: layer.get('visible'), + styles: this.getAlarmStyles() + }; + + return record; + }; + + this.getSubtitle = function(type){ + var srcDef = mapService.styles[type]; + var withSpeed = ['reportedSpeed', 'calculatedSpeed', 'speedOverGround']; + var withCourse = ['reportedCourse', 'courseOverGround']; + + var subTitle = locale.getString('spatial.styles_attr_' + srcDef.attribute); + if (_.indexOf(withSpeed, srcDef.attribute) !== -1){ + var srcUnit = unitConversionService.speed.getUnit(); + subTitle += ' (' + locale.getString('common.speed_unit_' + srcUnit) + ')'; + } + + if (_.indexOf(withCourse, srcDef.attribute) !== -1){ + subTitle += ' (' + String.fromCharCode(parseInt('00B0', 16)) + ')'; + } + + if (srcDef.attribute === 'distance'){ + subTitle += ' (' + unitConversionService.distance.getUnit() + ')'; + } + + return subTitle; + }; + + //Get styles for alarms + this.getAlarmStyles = function(){ + var srcDef = mapService.styles.alarms; + var keys = Object.keys(srcDef); + + var finalStyles = []; + for (var i = 0; i < keys.length; i++){ + if (keys[i] !== 'size'){ + finalStyles.push({ + title: locale.getString('spatial.legend_panel_alarms_' + keys[i]), + color: {"color": srcDef[keys[i]]} + }); + } + } + + return finalStyles; }; //Get styles for fishing activities @@ -201,140 +201,140 @@ angular.module('unionvmsWeb').directive('imageOnLoad', function(){ color: {"color": '#078dbe'} }]; }; - - - //Get styles definition for both positions and segments as type - this.getStyles = function(type){ - var styleDef = mapService.styles[type]; - var keys = Object.keys(styleDef.style); - - var finalStyles = []; - var i; - switch (styleDef.attribute) { - case 'activity': //Positions - case 'type': - case 'segmentCategory': //Segments - var defaultObj = {}; - for (i = 0; i < keys.length; i++){ - if (_.indexOf(['lineWidth', 'lineStyle'], keys[i]) === -1){ - var styleObj = { - title: keys[i] === 'default' ? locale.getString('spatial.legend_panel_all_other_values') : keys[i].toUpperCase(), - color: {"color" : styleDef.style[keys[i]]} - }; - if (keys[i] === 'default'){ - angular.copy(styleObj, defaultObj); - } else { - finalStyles.push(styleObj); - } - } - } - //Add default color for all other values - if (_.keys(defaultObj).length !== 0){ - finalStyles.push(defaultObj); - } - break; - case 'countryCode': - for (i = 0; i < keys.length; i++){ - if (styleDef.displayedCodes.indexOf(keys[i]) !== -1){ - finalStyles.push({ - title: keys[i].toUpperCase(), - color: {"color" : styleDef.style[keys[i]]} - }); - } - } - break; - case 'reportedCourse': //Positions - case 'calculatedSpeed': - case 'reportedSpeed': - case 'speedOverGround': //Segments - case 'distance': - case 'courseOverGround': - for (i = 0; i < styleDef.breaks.intervals.length; i++){ - finalStyles.push({ - title: styleDef.breaks.intervals[i][0] + ' - ' + styleDef.breaks.intervals[i][1], - color: {"color" : styleDef.style[styleDef.breaks.intervals[i][0] + '-' + styleDef.breaks.intervals[i][1]]} - }); - } - //Finally, add default color for all other values - finalStyles.push({ - title: locale.getString('spatial.legend_panel_all_other_values'), - color: {"color" : styleDef.breaks.defaultColor} - }); - break; - default: - break; - } - - return finalStyles; - }; - - this.init = function(){ - if (!angular.isDefined(mapService.map)){ - return; - } - - var records = []; - var layers = mapService.map.getLayers(); - - layers.forEach(function(layer, idx){ + + + //Get styles definition for both positions and segments as type + this.getStyles = function(type){ + var styleDef = mapService.styles[type]; + var keys = Object.keys(styleDef.style); + + var finalStyles = []; + var i; + switch (styleDef.attribute) { + case 'activity': //Positions + case 'type': + case 'segmentCategory': //Segments + var defaultObj = {}; + for (i = 0; i < keys.length; i++){ + if (_.indexOf(['lineWidth', 'lineStyle'], keys[i]) === -1){ + var styleObj = { + title: keys[i] === 'default' ? locale.getString('spatial.legend_panel_all_other_values') : keys[i].toUpperCase(), + color: {"color" : styleDef.style[keys[i]]} + }; + if (keys[i] === 'default'){ + angular.copy(styleObj, defaultObj); + } else { + finalStyles.push(styleObj); + } + } + } + //Add default color for all other values + if (_.keys(defaultObj).length !== 0){ + finalStyles.push(defaultObj); + } + break; + case 'countryCode': + for (i = 0; i < keys.length; i++){ + if (styleDef.displayedCodes.indexOf(keys[i]) !== -1){ + finalStyles.push({ + title: keys[i].toUpperCase(), + color: {"color" : styleDef.style[keys[i]]} + }); + } + } + break; + case 'reportedCourse': //Positions + case 'calculatedSpeed': + case 'reportedSpeed': + case 'speedOverGround': //Segments + case 'distance': + case 'courseOverGround': + for (i = 0; i < styleDef.breaks.intervals.length; i++){ + finalStyles.push({ + title: styleDef.breaks.intervals[i][0] + ' - ' + styleDef.breaks.intervals[i][1], + color: {"color" : styleDef.style[styleDef.breaks.intervals[i][0] + '-' + styleDef.breaks.intervals[i][1]]} + }); + } + //Finally, add default color for all other values + finalStyles.push({ + title: locale.getString('spatial.legend_panel_all_other_values'), + color: {"color" : styleDef.breaks.defaultColor} + }); + break; + default: + break; + } + + return finalStyles; + }; + + this.init = function(){ + if (!angular.isDefined(mapService.map)){ + return; + } + + var records = []; + var layers = mapService.map.getLayers(); + + layers.forEach(function(layer, idx){ if (layer.get('visible')){ var lyrSrc = layer.getSource(); - - if (lyrSrc instanceof ol.source.TileWMS){ - records.push(this.buildRecWMS(layer)); - } - - if (lyrSrc instanceof ol.source.Vector || lyrSrc instanceof ol.source.ImageVector){ - switch (layer.get('type')){ - case 'vmspos': - if (lyrSrc.getSource().getFeatures().length !== 0){ - records.push(this.buildRecVmsPos(layer)); - } - break; - case 'vmsseg': - if (lyrSrc.getSource().getFeatures().length !== 0){ - records.push(this.buildRecVmsSeg(layer)); - } + + if (lyrSrc instanceof ol.source.TileWMS){ + records.push(this.buildRecWMS(layer)); + } + + if (lyrSrc instanceof ol.source.Vector || lyrSrc instanceof ol.source.ImageVector){ + switch (layer.get('type')){ + case 'vmspos': + if (lyrSrc.getSource().getFeatures().length !== 0){ + records.push(this.buildRecVmsPos(layer)); + } + break; + case 'vmsseg': + if (lyrSrc.getSource().getFeatures().length !== 0){ + records.push(this.buildRecVmsSeg(layer)); + } break; case 'ers': if (lyrSrc.getFeatures().length !== 0){ records.push(this.buildRecActivity(layer)); } - break; - case 'alarms': - if (lyrSrc.getFeatures().length !== 0){ - records.push(this.buildRecAlarms(layer)); - } - break; - default: - return; - } - } - } - }, this); - - if (records.length > 0){ - records.reverse(); - } - - return records; - }; - }, - link: function(scope, element, attrs, ctrl) { - if(!scope.initialized){ - scope.initialized = true; - scope.legendRecords = ctrl.init(); - - layerPanelService.panelToReload.push(function(){ - scope.legendRecords = ctrl.init(); - }); - /*scope.$on('reloadLegend', function(){ - scope.legendRecords = ctrl.init(); - });*/ - $compile(element)(scope); - } - - } - }; -}); - + break; + case 'alarms': + if (lyrSrc.getFeatures().length !== 0){ + records.push(this.buildRecAlarms(layer)); + } + break; + default: + return; + } + } + } + }, this); + + if (records.length > 0){ + records.reverse(); + } + + return records; + }; + }, + link: function(scope, element, attrs, ctrl) { + if(!scope.initialized){ + scope.initialized = true; + scope.legendRecords = ctrl.init(); + + layerPanelService.panelToReload.push(function(){ + scope.legendRecords = ctrl.init(); + }); + /*scope.$on('reloadLegend', function(){ + scope.legendRecords = ctrl.init(); + });*/ + $compile(element)(scope); + } + + } + }; +}); + diff --git a/unionvms-web/app/directive/spatial/stResetSearch/stResetSearch.js b/unionvms-web/app/directive/spatial/stResetSearch/stResetSearch.js index 390187962..f6b3cff0f 100644 --- a/unionvms-web/app/directive/spatial/stResetSearch/stResetSearch.js +++ b/unionvms-web/app/directive/spatial/stResetSearch/stResetSearch.js @@ -1,71 +1,74 @@ /* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').directive('stResetSearch', function() { - return { - restrict: 'E', - require: '^stTable', - scope: { - formId: '@', +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').directive('stResetSearch', function() { + return { + restrict: 'E', + require: '^stTable', + scope: { + formId: '@', + lastXId: '@', clearDates: '&', - clearCombos: '&' - }, - templateUrl: 'directive/spatial/stResetSearch/stResetSearch.html', - link: function(scope, element, attrs, ctrl) { - scope.getTableState = function(){ - return ctrl.tableState(); - }; - - scope.resetFields = function(){ - var coordFields = ['lon|dd', 'lat|dd', 'lon|deg', 'lat|deg', 'lon|min', 'lat|min']; - $('#' + scope.formId + ' [name]').each( - function(index){ - var input = $(this); + clearCombos: '&' + }, + templateUrl: 'directive/spatial/stResetSearch/stResetSearch.html', + link: function(scope, element, attrs, ctrl) { + scope.getTableState = function(){ + return ctrl.tableState(); + }; + + scope.resetFields = function(){ + var coordFields = ['lon|dd', 'lat|dd', 'lon|deg', 'lat|deg', 'lon|min', 'lat|min']; + $('[id^=' + scope.formId + '] [name]').each( + function(index){ + var input = $(this); var name = input.attr('name'); - input.val(''); - if (_.indexOf(coordFields, name) !== -1 && input.is(':visible') && input.hasClass('coordError')){ - input.removeClass('coordError'); - var qtipEl; - if (name.indexOf('dd') !== -1){ - qtipEl = '#qtip-' + name.replace('|', '-') + ' i'; - } else { - qtipEl = '#qtip-' + name.split('|')[0] + '-ddm i'; - } - $(qtipEl).removeClass('hasError'); - } - } - ); - - if (angular.isDefined(attrs.clearDates)){ - scope.clearDates(); + input.val(''); + if (_.indexOf(coordFields, name) !== -1 && input.is(':visible') && input.hasClass('coordError')){ + input.removeClass('coordError'); + var qtipEl; + if (name.indexOf('dd') !== -1){ + qtipEl = '#qtip-' + name.replace('|', '-') + ' i'; + } else { + qtipEl = '#qtip-' + name.split('|')[0] + '-ddm i'; + } + $(qtipEl).removeClass('hasError'); + } + } + ); + + $('#'+scope.lastXId).val(''); + + if (angular.isDefined(attrs.clearDates)){ + scope.clearDates(); } if (angular.isDefined(attrs.clearCombos)){ scope.clearCombos(); - } - }; - - scope.resetFilters = function(){ - scope.resetFields(); - var state = scope.getTableState(); - state.search.predicateObject = {}; - state.pagination.start = 0; - return ctrl.pipe(); - }; - - scope.$watch('executedReport.isReportExecuting', function(newVal){ - if (newVal){ - scope.resetFilters(); - } - }); - } - }; -}); + } + }; + + scope.resetFilters = function(){ + scope.resetFields(); + var state = scope.getTableState(); + state.search.predicateObject = {}; + state.pagination.start = 0; + return ctrl.pipe(); + }; + + scope.$watch('executedReport.isReportExecuting', function(newVal){ + if (newVal){ + scope.resetFilters(); + } + }); + } + }; +}); diff --git a/unionvms-web/app/filter/spatial/stFieldSearchGeoJson/stFieldSearchGeoJson.js b/unionvms-web/app/filter/spatial/stFieldSearchGeoJson/stFieldSearchGeoJson.js index 9fa2883af..8478e8b04 100644 --- a/unionvms-web/app/filter/spatial/stFieldSearchGeoJson/stFieldSearchGeoJson.js +++ b/unionvms-web/app/filter/spatial/stFieldSearchGeoJson/stFieldSearchGeoJson.js @@ -1,413 +1,490 @@ -angular.module('smart-table').filter('stFieldSearchGeoJson', function($filter, unitConversionService, coordinateFormatService){ - return function(array, predictedObject){ - //check predicted object type and parse it back - var pKey = _.keys(predictedObject); - var srcObject = {}; - var type = 'tracks'; - if (pKey.length === 1){ - srcObject = JSON.parse(predictedObject[pKey[0]]); - type = pKey[0]; - } - - //Filter - var filterFilter = $filter('filter'); - var filteredRecs = []; - - - var searchableKeys = _.keys(srcObject); - var searchObj = {}; - var additionalFilters = { - doSearch: false, - recs: [] - }; - - var timeFields = ['duration', 'totalTimeAtSea']; - var numberFields = ['reportedSpeed', 'calculatedSpeed', 'speedOverGround', 'distance']; - - if (type !== 'tracks' && type !== 'trips'){ - searchObj.properties = {}; - } - - //HELPER FUNCTIONS - var getNumDecimals = function(num){ - if (_.isNumber(num)){ - num = num.toString(); - } - - var numSplit = num.split(".")[1]; - var decimals = 0; - if (angular.isDefined(numSplit)){ - decimals = numSplit.length; - } - return decimals; - }; - - var getDecimalsAsString = function(num){ - if (_.isNumber(num)){ - num = num.toString(); - } - return num.split(".")[1]; - }; - - var fixDecimalNotation = function(numStr){ - return numStr.replace(',','.'); - }; - - var checkDecimalDegrees = function(dd, geomCoord){ - //src dd filter - var numerical = parseFloat(fixDecimalNotation(dd)); - var decimals = getNumDecimals(numerical); - - var resp = false; - if (Math.sign(geomCoord) === Math.sign(numerical)){ - if (decimals === 0){ - resp = Math.abs(numerical) === Math.abs(Math.trunc(geomCoord)); - } else { - resp = Math.abs(Math.trunc(numerical)) === Math.abs(Math.trunc(geomCoord)) && getDecimalsAsString(geomCoord).indexOf(getDecimalsAsString(numerical)) === 0; - } - } - - return resp; - }; - - var getMinutesFromDD = function(dd){ - var num = dd.toString(); - var numSplit = num.split('.'); - - var minutes; - if (angular.isDefined(numSplit[1])){ - var decimals = numSplit[1].length; - minutes = parseInt(numSplit[1]) / Math.pow(10, decimals) * 60; - } - - return minutes; - }; - - var checkDecimalMinutes = function(minutes, geomCoord){ - var decimals = getNumDecimals(minutes); - minutes = parseFloat(minutes).toString(); - var coordMin = getMinutesFromDD(geomCoord); - if (decimals === 0){ - coordMin = Math.trunc(coordMin).toString(); - } else { - coordMin = coordMin.toFixed(decimals); - } - - var resp = false; - if (coordMin.indexOf(minutes) === 0){ - resp = true; - } - - return resp; - }; - - //Function to calculate upper boundary when filtering fields with duration/time - var dehumanizeTimeAndCalculateUpBoundary = function(time){ - var parsedStr = time.match(/([0-9]+[dhms]{1})/ig); - var secondsToAdd = 0; - var fixedSeconds = 0; - if (_.isArray(parsedStr)){ - for (var i = 0; i < parsedStr.length; i++){ - //days - if (parsedStr[i].toUpperCase().indexOf('D') !== -1){ - fixedSeconds += parseInt(parsedStr[i]) * 24 * 3600; - if (i + 1 === parsedStr.length){ - secondsToAdd += 24 * 3600; - } - } - //hours - if (parsedStr[i].toUpperCase().indexOf('H') !== -1){ - fixedSeconds += parseInt(parsedStr[i]) * 3600; - if (i + 1 === parsedStr.length){ - secondsToAdd += 3600; - } - } - //minutes - if (parsedStr[i].toUpperCase().indexOf('M') !== -1){ - fixedSeconds += parseInt(parsedStr[i]) * 60; - if (i + 1 === parsedStr.length){ - secondsToAdd += 60; - } - } - //seconds - if (parsedStr[i].toUpperCase().indexOf('S') !== -1){ - fixedSeconds += parseInt(parsedStr[i]); - } - } - - //return converted input and seconds as miliseconds to add for upper boundary - return [fixedSeconds * 1000, secondsToAdd * 1000]; - } - }; - - //LET'S DO THE ACTUAL FILTERING - var comps; - for (var i = 0; i < searchableKeys.length; i++){ - var keyIn = false; - if (_.indexOf(numberFields, searchableKeys[i]) !== -1){ - keyIn = true; - additionalFilters[searchableKeys[i]] = srcObject[searchableKeys[i]]; - additionalFilters.doSearch = true; - } - - if (_.indexOf(timeFields, searchableKeys[i]) !== -1){ - var calcTimes = dehumanizeTimeAndCalculateUpBoundary(srcObject[searchableKeys[i]]); - if (_.isArray(calcTimes)){ - keyIn = true; - additionalFilters[searchableKeys[i]] = srcObject[searchableKeys[i]]; - additionalFilters.doSearch = true; - - additionalFilters.srcTime = calcTimes[0]; - additionalFilters.secondsToAdd = calcTimes[1]; - additionalFilters.upBoundary = calcTimes[0] + calcTimes[1]; - } else { - continue; - } - } - - if (type !== 'tracks'){ - if (_.indexOf(numberFields, searchableKeys[i]) === -1 && _.indexOf(timeFields, searchableKeys[i]) === -1){ - if (searchableKeys[i].indexOf('lon') !== -1){ - keyIn = true; - if (!angular.isDefined(additionalFilters.lon)){ - additionalFilters.lon = {}; - } - additionalFilters.doSearch = true; - comps = searchableKeys[i].split('|'); - if (comps[1] === 'dd'){ - additionalFilters.lon.dd = srcObject[searchableKeys[i]]; - } else if (comps[1] === 'deg') { - additionalFilters.lon.deg = srcObject[searchableKeys[i]]; - } else { - additionalFilters.lon.min = srcObject[searchableKeys[i]]; - } - } else if (searchableKeys[i].indexOf('lat') !== -1){ - keyIn = true; - if(!angular.isDefined(additionalFilters.lat)){ - additionalFilters.lat = {}; - } - additionalFilters.doSearch = true; - comps = searchableKeys[i].split('|'); - if (comps[1] === 'dd'){ - additionalFilters.lat.dd = srcObject[searchableKeys[i]]; - } else if (comps[1] === 'deg'){ - additionalFilters.lat.deg = srcObject[searchableKeys[i]]; - } else { - additionalFilters.lat.min = srcObject[searchableKeys[i]]; - } - } else if (searchableKeys[i] === 'startDate' || searchableKeys[i] === 'endDate' || searchableKeys[i] === 'alarmStartDate' || searchableKeys[i] === 'alarmEndDate') { - keyIn = true; - additionalFilters[searchableKeys[i]] = srcObject[searchableKeys[i]]; - var name = searchableKeys[i] + 'Field'; - if (type === 'positions'){ - additionalFilters[name] = 'positionTime'; - } else if (type === 'alarms'){ - additionalFilters[name] = 'ticketOpenDate'; - } else if (type === 'trips'){ - if (searchableKeys[i] === 'startDate'){ - additionalFilters[name] = 'firstFishingActivityDateTime'; - } else { - additionalFilters[name] = 'lastFishingActivityDateTime'; - } - } - - additionalFilters.doSearch = true; - } else if (searchableKeys[i] === 'tripId'){ - keyIn = true; - additionalFilters['tripId'] = srcObject[searchableKeys[i]]; - additionalFilters.doSearch = true; - } - } - } - - if (!keyIn){ - if (type === 'tracks' || type === 'trips'){ - searchObj[searchableKeys[i]] = srcObject[searchableKeys[i]]; //this is the default - } else { - searchObj.properties[searchableKeys[i]] = srcObject[searchableKeys[i]]; //this is the default - } - - } - } - - var tempRecs = []; - if (!angular.equals({}, searchObj)){ - tempRecs = filterFilter(array, searchObj); - } else { - tempRecs = array; - } - - var updateInclude = function(temp, include){ - if (temp === false){ - include = false; - } - return include; - }; - - if (additionalFilters.doSearch === true){ - var additionalKeys = _.keys(additionalFilters); - additionalKeys.splice(0,1); - var temp; - angular.forEach(tempRecs, function(rec, idx){ - var filterDate, recDate; - var includeArray = []; - var include = true; - if (angular.isDefined(this.lon)){ - //decimal degrees - if (angular.isDefined(this.lon.dd)){ - temp = checkDecimalDegrees(this.lon.dd, rec.geometry.coordinates[0]); - } - - //degrees decimal minutes - if (angular.isDefined(this.lon.deg)){ - //degrees - temp = checkDecimalDegrees(this.lon.deg, rec.geometry.coordinates[0]); - - //decimal minutes - if (angular.isDefined(this.lon.min) && temp){ - temp = checkDecimalMinutes(this.lon.min, rec.geometry.coordinates[0]); - } - } - include = updateInclude(temp, include); - } - - if (angular.isDefined(this.lat)){ - //decimal degrees - if (angular.isDefined(this.lat.dd)){ - temp = checkDecimalDegrees(this.lat.dd, rec.geometry.coordinates[1]); - } - - //degrees decimal minutes - if (angular.isDefined(this.lat.deg)){ - //degrees - temp = checkDecimalDegrees(this.lat.deg, rec.geometry.coordinates[1]); - - //decimal minutes - if (angular.isDefined(this.lat.min) && include){ - temp = checkDecimalMinutes(this.lat.min, rec.geometry.coordinates[1]); - } - } - include = updateInclude(temp, include); - } - - var srcRec = rec; - if (angular.isDefined(this.startDate)){ - if (type !== 'trips'){ - srcRec = rec.properties; - } - recDate = moment.utc(srcRec[this.startDateField]); - filterDate = moment.utc(this.startDate); - - temp = recDate.isAfter(filterDate); - include = updateInclude(temp, include); - } - - if (angular.isDefined(this.endDate)){ - if (type !== 'trips'){ - srcRec = rec.properties; - } - - recDate = moment.utc(srcRec[this.endDateField]); - filterDate = moment.utc(this.endDate); - - temp = recDate.isBefore(filterDate); - include = updateInclude(temp, include); - } - - var srcSpeed; - if (angular.isDefined(this.reportedSpeed)){ - srcSpeed = $filter('number')(rec.properties.reportedSpeed, 5); - temp = srcSpeed.indexOf(fixDecimalNotation(this.reportedSpeed)) === 0; - include = updateInclude(temp, include); - } - - if (angular.isDefined(this.calculatedSpeed)){ - srcSpeed = $filter('number')(rec.properties.calculatedSpeed, 5); - temp = srcSpeed.indexOf(fixDecimalNotation(this.calculatedSpeed)) === 0; - include = updateInclude(temp, include); - } - - if (angular.isDefined(this.speedOverGround)){ - srcSpeed = $filter('number')(rec.properties.speedOverGround, 5); - temp = srcSpeed.indexOf(fixDecimalNotation(this.speedOverGround)) === 0; - include = updateInclude(temp, include); - } - - var srcDist; - if (angular.isDefined(this.distance)){ - if (type === 'tracks'){ - srcDist = $filter('number')(rec.distance, 5); - } else { - srcDist = $filter('number')(rec.properties.distance, 5); - } - temp = srcDist.indexOf(fixDecimalNotation(this.distance)) === 0; - include = updateInclude(temp, include); - } - - if (angular.isDefined(this.duration)){ - temp = false; - var srcProp; - if (type === 'tracks'){ - srcProp = rec.duration; - } else if (type === 'trips'){ - srcProp = rec.tripDuration; - } else { - srcProp = rec.properties.duration; - } - - - if (this.upBoundary && srcProp >= this.srcTime && srcProp < this.upBoundary){ - temp = true; - } - - if (srcProp === this.srcTime){ - temp = true; - } - - if (this.secondsToAdd === 0 && srcProp > this.upBoundary - 1 && srcProp <= this.upBoundary){ - temp = true; - } - - include = updateInclude(temp, include); - } - - if (angular.isDefined(this.totalTimeAtSea)){ - temp = false; - if (this.upBoundary && rec.totalTimeAtSea >= this.srcTime && rec.totalTimeAtSea < this.upBoundary){ - temp = true; - } - - if (rec.totalTimeAtSea === this.srcTime){ - temp = true; - } - - if (this.secondsToAdd === 0 && rec.totalTimeAtSea > this.upBoundary - 1 && rec.totalTimeAtSea <= this.upBoundary){ - temp = true; - } - - include = updateInclude(temp, include); - } - - if (angular.isDefined(this.tripId)){ - temp = false; - var tripName = rec.schemeId + ':' + rec.tripId; - if (tripName.indexOf(this.tripId.toUpperCase()) !== -1){ - temp = true; - } - include = updateInclude(temp, include); - } - - if (include){ - this.recs.push(rec); - } - - }, additionalFilters); - angular.copy(additionalFilters.recs, filteredRecs); - additionalFilters.recs = []; - } else { - filteredRecs = tempRecs; - } - - return filteredRecs; - }; -}); \ No newline at end of file +angular.module('smart-table').filter('stFieldSearchGeoJson', function($filter, unitConversionService, coordinateFormatService){ + return function(array, predictedObject){ + var filteredRecs = []; + + //check predicted object type and parse it back + var pKey = _.keys(predictedObject); + var srcObjects = []; + var dataObject; + var lastX; + var type = 'tracks'; + if (pKey.length === 1){ + dataObject = JSON.parse(predictedObject[pKey[0]]); + srcObjects = dataObject.objects; + if(angular.isDefined(dataObject.lastX) && dataObject.lastX !== ''){ + lastX = parseInt(dataObject.lastX); + } + if(isNaN(lastX)){ + lastX = undefined; + } + type = pKey[0]; + } + + //Filter + var filterFilter = $filter('filter'); + + //HELPER FUNCTIONS + var getNumDecimals = function(num){ + if (_.isNumber(num)){ + num = num.toString(); + } + + var numSplit = num.split(".")[1]; + var decimals = 0; + if (angular.isDefined(numSplit)){ + decimals = numSplit.length; + } + return decimals; + }; + + var getDecimalsAsString = function(num){ + if (_.isNumber(num)){ + num = num.toString(); + } + return num.split(".")[1]; + }; + + var fixDecimalNotation = function(numStr){ + return numStr.replace(',','.'); + }; + + var checkDecimalDegrees = function(dd, geomCoord){ + //src dd filter + var numerical = parseFloat(fixDecimalNotation(dd)); + var decimals = getNumDecimals(numerical); + + var resp = false; + if (Math.sign(geomCoord) === Math.sign(numerical)){ + if (decimals === 0){ + resp = Math.abs(numerical) === Math.abs(Math.trunc(geomCoord)); + } else { + resp = Math.abs(Math.trunc(numerical)) === Math.abs(Math.trunc(geomCoord)) && getDecimalsAsString(geomCoord).indexOf(getDecimalsAsString(numerical)) === 0; + } + } + + return resp; + }; + + var getMinutesFromDD = function(dd){ + var num = dd.toString(); + var numSplit = num.split('.'); + + var minutes; + if (angular.isDefined(numSplit[1])){ + var decimals = numSplit[1].length; + minutes = parseInt(numSplit[1]) / Math.pow(10, decimals) * 60; + } + + return minutes; + }; + + var checkDecimalMinutes = function(minutes, geomCoord){ + var decimals = getNumDecimals(minutes); + minutes = parseFloat(minutes).toString(); + var coordMin = getMinutesFromDD(geomCoord); + if (decimals === 0){ + coordMin = Math.trunc(coordMin).toString(); + } else { + coordMin = coordMin.toFixed(decimals); + } + + var resp = false; + if (coordMin.indexOf(minutes) === 0){ + resp = true; + } + + return resp; + }; + + var getIdentifier = function (obj) { + if(type === 'trips') { + return obj['tripId']; + } else { + return obj['id']; + } + }; + + //Function to calculate upper boundary when filtering fields with duration/time + var dehumanizeTimeAndCalculateUpBoundary = function(time){ + var parsedStr = time.match(/([0-9]+[dhms]{1})/ig); + var secondsToAdd = 0; + var fixedSeconds = 0; + if (_.isArray(parsedStr)){ + for (var i = 0; i < parsedStr.length; i++){ + //days + if (parsedStr[i].toUpperCase().indexOf('D') !== -1){ + fixedSeconds += parseInt(parsedStr[i]) * 24 * 3600; + if (i + 1 === parsedStr.length){ + secondsToAdd += 24 * 3600; + } + } + //hours + if (parsedStr[i].toUpperCase().indexOf('H') !== -1){ + fixedSeconds += parseInt(parsedStr[i]) * 3600; + if (i + 1 === parsedStr.length){ + secondsToAdd += 3600; + } + } + //minutes + if (parsedStr[i].toUpperCase().indexOf('M') !== -1){ + fixedSeconds += parseInt(parsedStr[i]) * 60; + if (i + 1 === parsedStr.length){ + secondsToAdd += 60; + } + } + //seconds + if (parsedStr[i].toUpperCase().indexOf('S') !== -1){ + fixedSeconds += parseInt(parsedStr[i]); + } + } + + //return converted input and seconds as miliseconds to add for upper boundary + return [fixedSeconds * 1000, secondsToAdd * 1000]; + } + }; + + var timeFields = ['duration', 'totalTimeAtSea']; + var numberFields = ['reportedSpeed', 'calculatedSpeed', 'speedOverGround', 'distance']; + + if(srcObjects.length === 0) { + srcObjects.push({}); + } + var lastXVessels; + if(angular.isDefined(lastX)){ + lastXVessels = { + last_x_count : lastX + }; + } + for(var idx =0; idx < srcObjects.length; idx++) { + var srcObject = srcObjects[idx]; + var searchableKeys = _.keys(srcObject); + var searchObj = {}; + var additionalFilters = { + doSearch: false, + vessels : lastXVessels, + recs: [] + }; + + if (type !== 'tracks' && type !== 'trips'){ + searchObj.properties = {}; + } + + //LET'S DO THE ACTUAL FILTERING + var comps; + for (var i = 0; i < searchableKeys.length; i++){ + var keyIn = false; + if (_.indexOf(numberFields, searchableKeys[i]) !== -1){ + keyIn = true; + additionalFilters[searchableKeys[i]] = srcObject[searchableKeys[i]]; + additionalFilters.doSearch = true; + } + + if (_.indexOf(timeFields, searchableKeys[i]) !== -1){ + var calcTimes = dehumanizeTimeAndCalculateUpBoundary(srcObject[searchableKeys[i]]); + if (_.isArray(calcTimes)){ + keyIn = true; + additionalFilters[searchableKeys[i]] = srcObject[searchableKeys[i]]; + additionalFilters.doSearch = true; + + additionalFilters.srcTime = calcTimes[0]; + additionalFilters.secondsToAdd = calcTimes[1]; + additionalFilters.upBoundary = calcTimes[0] + calcTimes[1]; + } else { + continue; + } + } + + if (type !== 'tracks'){ + if (_.indexOf(numberFields, searchableKeys[i]) === -1 && _.indexOf(timeFields, searchableKeys[i]) === -1){ + if (searchableKeys[i].indexOf('lon') !== -1){ + keyIn = true; + if (!angular.isDefined(additionalFilters.lon)){ + additionalFilters.lon = {}; + } + additionalFilters.doSearch = true; + comps = searchableKeys[i].split('|'); + if (comps[1] === 'dd'){ + additionalFilters.lon.dd = srcObject[searchableKeys[i]]; + } else if (comps[1] === 'deg') { + additionalFilters.lon.deg = srcObject[searchableKeys[i]]; + } else { + additionalFilters.lon.min = srcObject[searchableKeys[i]]; + } + } else if (searchableKeys[i].indexOf('lat') !== -1){ + keyIn = true; + if(!angular.isDefined(additionalFilters.lat)){ + additionalFilters.lat = {}; + } + additionalFilters.doSearch = true; + comps = searchableKeys[i].split('|'); + if (comps[1] === 'dd'){ + additionalFilters.lat.dd = srcObject[searchableKeys[i]]; + } else if (comps[1] === 'deg'){ + additionalFilters.lat.deg = srcObject[searchableKeys[i]]; + } else { + additionalFilters.lat.min = srcObject[searchableKeys[i]]; + } + } else if (searchableKeys[i] === 'startDate' || searchableKeys[i] === 'endDate' || searchableKeys[i] === 'alarmStartDate' || searchableKeys[i] === 'alarmEndDate') { + keyIn = true; + additionalFilters[searchableKeys[i]] = srcObject[searchableKeys[i]]; + var name = searchableKeys[i] + 'Field'; + if (type === 'positions'){ + additionalFilters[name] = 'positionTime'; + } else if (type === 'alarms'){ + additionalFilters[name] = 'ticketOpenDate'; + } else if (type === 'trips'){ + if (searchableKeys[i] === 'startDate'){ + additionalFilters[name] = 'firstFishingActivityDateTime'; + } else { + additionalFilters[name] = 'lastFishingActivityDateTime'; + } + } + + additionalFilters.doSearch = true; + } else if (searchableKeys[i] === 'tripId'){ + keyIn = true; + additionalFilters['tripId'] = srcObject[searchableKeys[i]]; + additionalFilters.doSearch = true; + } else if (searchableKeys[i] === 'tripIds') { + keyIn = true; + additionalFilters['tripIds'] = srcObject[searchableKeys[i]]; + additionalFilters.doSearch = true; + } + } + } + + if (!keyIn){ + if (type === 'tracks' || type === 'trips'){ + searchObj[searchableKeys[i]] = srcObject[searchableKeys[i]]; //this is the default + } else { + searchObj.properties[searchableKeys[i]] = srcObject[searchableKeys[i]]; //this is the default + } + + } + } + + var tempRecs = []; + if (!angular.equals({}, searchObj)){ + tempRecs = filterFilter(array, searchObj); + } else { + tempRecs = array; + } + + var updateInclude = function(temp, include){ + if (temp === false){ + include = false; + } + return include; + }; + if(angular.isDefined(additionalFilters.vessels)){ + additionalFilters.doSearch = true; + } + + if (additionalFilters.doSearch === true){ + var additionalKeys = _.keys(additionalFilters); + additionalKeys.splice(0,1); + var temp; + if (type === 'segments' && angular.isDefined(lastX)){ + tempRecs = tempRecs.sort(function(a, b){ + return new Date(b.properties.positionTime) - new Date(a.properties.positionTime); + }); + } + angular.forEach(tempRecs, function(rec, idx){ + var filterDate, recDate; + var includeArray = []; + var include = true; + if (angular.isDefined(this.lon)){ + //decimal degrees + if (angular.isDefined(this.lon.dd)){ + temp = checkDecimalDegrees(this.lon.dd, rec.geometry.coordinates[0]); + } + + //degrees decimal minutes + if (angular.isDefined(this.lon.deg)){ + //degrees + temp = checkDecimalDegrees(this.lon.deg, rec.geometry.coordinates[0]); + //decimal minutes + if (angular.isDefined(this.lon.min) && temp){ + temp = checkDecimalMinutes(this.lon.min, rec.geometry.coordinates[0]); + } + } + include = updateInclude(temp, include); + } + + if (angular.isDefined(this.lat)){ + //decimal degrees + if (angular.isDefined(this.lat.dd)){ + temp = checkDecimalDegrees(this.lat.dd, rec.geometry.coordinates[1]); + } + + //degrees decimal minutes + if (angular.isDefined(this.lat.deg)){ + //degrees + temp = checkDecimalDegrees(this.lat.deg, rec.geometry.coordinates[1]); + + //decimal minutes + if (angular.isDefined(this.lat.min) && include){ + temp = checkDecimalMinutes(this.lat.min, rec.geometry.coordinates[1]); + } + } + include = updateInclude(temp, include); + } + + var srcRec = rec; + if (angular.isDefined(this.startDate)){ + if (type !== 'trips'){ + srcRec = rec.properties; + } + recDate = moment.utc(srcRec[this.startDateField]); + filterDate = moment.utc(this.startDate); + + temp = recDate.isAfter(filterDate); + include = updateInclude(temp, include); + } + + if (angular.isDefined(this.endDate)){ + if (type !== 'trips'){ + srcRec = rec.properties; + } + + recDate = moment.utc(srcRec[this.endDateField]); + filterDate = moment.utc(this.endDate); + + temp = recDate.isBefore(filterDate); + include = updateInclude(temp, include); + } + + var srcSpeed; + if (angular.isDefined(this.reportedSpeed)){ + srcSpeed = $filter('number')(rec.properties.reportedSpeed, 5); + temp = srcSpeed.indexOf(fixDecimalNotation(this.reportedSpeed)) === 0; + include = updateInclude(temp, include); + } + + if (angular.isDefined(this.calculatedSpeed)){ + srcSpeed = $filter('number')(rec.properties.calculatedSpeed, 5); + temp = srcSpeed.indexOf(fixDecimalNotation(this.calculatedSpeed)) === 0; + include = updateInclude(temp, include); + } + + if (angular.isDefined(this.speedOverGround)){ + srcSpeed = $filter('number')(rec.properties.speedOverGround, 5); + temp = srcSpeed.indexOf(fixDecimalNotation(this.speedOverGround)) === 0; + include = updateInclude(temp, include); + } + + var srcDist; + if (angular.isDefined(this.distance)){ + if (type === 'tracks'){ + srcDist = $filter('number')(rec.distance, 5); + } else { + srcDist = $filter('number')(rec.properties.distance, 5); + } + temp = srcDist.indexOf(fixDecimalNotation(this.distance)) === 0; + include = updateInclude(temp, include); + } + + if (angular.isDefined(this.duration)){ + temp = false; + var srcProp; + if (type === 'tracks'){ + srcProp = rec.duration; + } else if (type === 'trips'){ + srcProp = rec.tripDuration; + } else { + srcProp = rec.properties.duration; + } + + if (this.upBoundary && srcProp >= this.srcTime && srcProp < this.upBoundary){ + temp = true; + } + + if (srcProp === this.srcTime){ + temp = true; + } + if (this.secondsToAdd === 0 && srcProp > this.upBoundary - 1 && srcProp <= this.upBoundary){ + temp = true; + } + + include = updateInclude(temp, include); + } + + if (angular.isDefined(this.totalTimeAtSea)){ + temp = false; + if (this.upBoundary && rec.totalTimeAtSea >= this.srcTime && rec.totalTimeAtSea < this.upBoundary){ + temp = true; + } + + if (rec.totalTimeAtSea === this.srcTime){ + temp = true; + } + + if (this.secondsToAdd === 0 && rec.totalTimeAtSea > this.upBoundary - 1 && rec.totalTimeAtSea <= this.upBoundary){ + temp = true; + } + + include = updateInclude(temp, include); + } + + if (angular.isDefined(this.tripId)){ + temp = false; + var tripName = rec.schemeId + ':' + rec.tripId; + if (tripName.indexOf(this.tripId.toUpperCase()) !== -1){ + temp = true; + } + include = updateInclude(temp, include); + } + + if (include && angular.isDefined(this.vessels)){ + if (type === 'positions' || type === 'segments') { + var connectId = rec.properties.connectionId; + if (angular.isDefined(connectId)) { + if (!angular.isDefined(this.vessels[connectId])) { + this.vessels[connectId] = 1; + } + if (this.vessels[connectId] <= this.vessels.last_x_count) { + this.vessels[connectId] += 1; + } else { + include = false; + } + } + } + } + + if (angular.isDefined(this.tripIds)) { + temp = rec.tripIds.includes(this.tripIds); + include = updateInclude(temp, include); + } + + if (include){ + this.recs.push(rec); + } + + }, additionalFilters); + additionalFilters.recs.forEach(function(val){filteredRecs.push(Object.assign({}, val))}); + additionalFilters.recs = []; + } else { + if(filteredRecs.length === 0) { + filteredRecs = filteredRecs.concat(tempRecs); + } + else if(tempRecs.length > 0){ + for(var y = 0; y < tempRecs.length; y++) { + var tempRec = tempRecs[y]; + var added = false; + for(var innerY=0; innerY < filteredRecs.length; innerY++){ + if(getIdentifier(tempRec) === getIdentifier(filteredRecs[innerY])){ + added = true; + break; + } + } + if(!added){ + filteredRecs.push(tempRec); + } + } + } + } + } + + return filteredRecs; + }; +}); diff --git a/unionvms-web/app/i18n/bg-bg/activity.lang.json b/unionvms-web/app/i18n/bg-bg/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/bg-bg/activity.lang.json +++ b/unionvms-web/app/i18n/bg-bg/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/bg-bg/audit.lang.json b/unionvms-web/app/i18n/bg-bg/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/bg-bg/audit.lang.json +++ b/unionvms-web/app/i18n/bg-bg/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/bg-bg/spatial.lang.json b/unionvms-web/app/i18n/bg-bg/spatial.lang.json index c863c7a5d..d22d9f769 100644 --- a/unionvms-web/app/i18n/bg-bg/spatial.lang.json +++ b/unionvms-web/app/i18n/bg-bg/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -248,6 +248,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/cs-cz/activity.lang.json b/unionvms-web/app/i18n/cs-cz/activity.lang.json index beeaf7901..ed21b5d05 100644 --- a/unionvms-web/app/i18n/cs-cz/activity.lang.json +++ b/unionvms-web/app/i18n/cs-cz/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/cs-cz/audit.lang.json b/unionvms-web/app/i18n/cs-cz/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/cs-cz/audit.lang.json +++ b/unionvms-web/app/i18n/cs-cz/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/cs-cz/spatial.lang.json b/unionvms-web/app/i18n/cs-cz/spatial.lang.json index c863c7a5d..d22d9f769 100644 --- a/unionvms-web/app/i18n/cs-cz/spatial.lang.json +++ b/unionvms-web/app/i18n/cs-cz/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -248,6 +248,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/da-dk/activity.lang.json b/unionvms-web/app/i18n/da-dk/activity.lang.json index beeaf7901..ed21b5d05 100644 --- a/unionvms-web/app/i18n/da-dk/activity.lang.json +++ b/unionvms-web/app/i18n/da-dk/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/da-dk/audit.lang.json b/unionvms-web/app/i18n/da-dk/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/da-dk/audit.lang.json +++ b/unionvms-web/app/i18n/da-dk/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/da-dk/spatial.lang.json b/unionvms-web/app/i18n/da-dk/spatial.lang.json index c863c7a5d..d22d9f769 100644 --- a/unionvms-web/app/i18n/da-dk/spatial.lang.json +++ b/unionvms-web/app/i18n/da-dk/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -248,6 +248,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/de-at/activity.lang.json b/unionvms-web/app/i18n/de-at/activity.lang.json index beeaf7901..ed21b5d05 100644 --- a/unionvms-web/app/i18n/de-at/activity.lang.json +++ b/unionvms-web/app/i18n/de-at/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/de-at/audit.lang.json b/unionvms-web/app/i18n/de-at/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/de-at/audit.lang.json +++ b/unionvms-web/app/i18n/de-at/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/de-at/spatial.lang.json b/unionvms-web/app/i18n/de-at/spatial.lang.json index c863c7a5d..d22d9f769 100644 --- a/unionvms-web/app/i18n/de-at/spatial.lang.json +++ b/unionvms-web/app/i18n/de-at/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -248,6 +248,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/de-de/activity.lang.json b/unionvms-web/app/i18n/de-de/activity.lang.json index beeaf7901..ed21b5d05 100644 --- a/unionvms-web/app/i18n/de-de/activity.lang.json +++ b/unionvms-web/app/i18n/de-de/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/de-de/audit.lang.json b/unionvms-web/app/i18n/de-de/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/de-de/audit.lang.json +++ b/unionvms-web/app/i18n/de-de/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/de-de/spatial.lang.json b/unionvms-web/app/i18n/de-de/spatial.lang.json index c863c7a5d..d22d9f769 100644 --- a/unionvms-web/app/i18n/de-de/spatial.lang.json +++ b/unionvms-web/app/i18n/de-de/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -248,6 +248,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/de-lu/activity.lang.json b/unionvms-web/app/i18n/de-lu/activity.lang.json index beeaf7901..ed21b5d05 100644 --- a/unionvms-web/app/i18n/de-lu/activity.lang.json +++ b/unionvms-web/app/i18n/de-lu/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/de-lu/audit.lang.json b/unionvms-web/app/i18n/de-lu/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/de-lu/audit.lang.json +++ b/unionvms-web/app/i18n/de-lu/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/de-lu/spatial.lang.json b/unionvms-web/app/i18n/de-lu/spatial.lang.json index c863c7a5d..d22d9f769 100644 --- a/unionvms-web/app/i18n/de-lu/spatial.lang.json +++ b/unionvms-web/app/i18n/de-lu/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -248,6 +248,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/el-cy/activity.lang.json b/unionvms-web/app/i18n/el-cy/activity.lang.json index beeaf7901..ed21b5d05 100644 --- a/unionvms-web/app/i18n/el-cy/activity.lang.json +++ b/unionvms-web/app/i18n/el-cy/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/el-cy/audit.lang.json b/unionvms-web/app/i18n/el-cy/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/el-cy/audit.lang.json +++ b/unionvms-web/app/i18n/el-cy/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/el-cy/spatial.lang.json b/unionvms-web/app/i18n/el-cy/spatial.lang.json index c863c7a5d..d22d9f769 100644 --- a/unionvms-web/app/i18n/el-cy/spatial.lang.json +++ b/unionvms-web/app/i18n/el-cy/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -248,6 +248,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/el-gr/activity.lang.json b/unionvms-web/app/i18n/el-gr/activity.lang.json index beeaf7901..ed21b5d05 100644 --- a/unionvms-web/app/i18n/el-gr/activity.lang.json +++ b/unionvms-web/app/i18n/el-gr/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/el-gr/audit.lang.json b/unionvms-web/app/i18n/el-gr/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/el-gr/audit.lang.json +++ b/unionvms-web/app/i18n/el-gr/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/el-gr/spatial.lang.json b/unionvms-web/app/i18n/el-gr/spatial.lang.json index c863c7a5d..d22d9f769 100644 --- a/unionvms-web/app/i18n/el-gr/spatial.lang.json +++ b/unionvms-web/app/i18n/el-gr/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -248,6 +248,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/en-gb/activity.lang.json b/unionvms-web/app/i18n/en-gb/activity.lang.json index 834098778..69d83af21 100644 --- a/unionvms-web/app/i18n/en-gb/activity.lang.json +++ b/unionvms-web/app/i18n/en-gb/activity.lang.json @@ -227,6 +227,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/en-gb/areas.lang.json b/unionvms-web/app/i18n/en-gb/areas.lang.json index 0ec2d9c50..e0dd3ef44 100644 --- a/unionvms-web/app/i18n/en-gb/areas.lang.json +++ b/unionvms-web/app/i18n/en-gb/areas.lang.json @@ -84,6 +84,7 @@ "area_upload_modal_parsing_error": "There was an error while parsing your file. Please check if your file and settings are correct and try again.", "area_upload_modal_invalid_polygon": "Your uploaded polygon is not valid. Please fix your data and try to upload again.", "area_upload_modal_parsing_error_wkt": "There was an error while parsing your file. Please check that your WKT file is valid.", + "area_upload_modal_parsing_error_gml": "There was an error while parsing your file. Please check that your GML file is valid.", "area_upload_modal_wkt_no_polygon": "Only POLYGON geometries are supported.", "area_upload_modal_wkt_no_multipolygon": "You have provided a MULTIPOLYGON geometry. Parsing this is possible but it will only extract the first POLYGON geometry.", "area_upload_modal_form_errors": "There are errors in your settings. Please fix them and try again.", diff --git a/unionvms-web/app/i18n/en-gb/audit.lang.json b/unionvms-web/app/i18n/en-gb/audit.lang.json index 8bea9ba46..f49b1a24f 100644 --- a/unionvms-web/app/i18n/en-gb/audit.lang.json +++ b/unionvms-web/app/i18n/en-gb/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_activity": "Activity", "system_status_module_audit": "Audit", diff --git a/unionvms-web/app/i18n/en-gb/spatial.lang.json b/unionvms-web/app/i18n/en-gb/spatial.lang.json index facc8742d..1d3ac749f 100644 --- a/unionvms-web/app/i18n/en-gb/spatial.lang.json +++ b/unionvms-web/app/i18n/en-gb/spatial.lang.json @@ -260,6 +260,7 @@ "tab_vms_pos_table_header_source": "Source", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", + "tab_vms_table_header_last_x": "Last X", "rule_table_details_btn_title": "Alert details", "tab_vms_pos_table_lat_dd_qtip": "

Lat

Value must be between -90 and 90
e.g. 10.5", "tab_vms_pos_table_lon_dd_qtip": "

Lon

Value must be between -180 and 180
e.g. 47.5", @@ -401,6 +402,10 @@ "visibility_configuration_label": "Map Labels", "visibility_configuration_table": "VMS Table", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "catch_figures_tresholds":"Catch Figures Thresholds", "general_configuration_geoserver_url": "Geoserver URL", diff --git a/unionvms-web/app/i18n/en-ie/activity.lang.json b/unionvms-web/app/i18n/en-ie/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/en-ie/activity.lang.json +++ b/unionvms-web/app/i18n/en-ie/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/en-ie/audit.lang.json b/unionvms-web/app/i18n/en-ie/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/en-ie/audit.lang.json +++ b/unionvms-web/app/i18n/en-ie/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/en-ie/spatial.lang.json b/unionvms-web/app/i18n/en-ie/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/en-ie/spatial.lang.json +++ b/unionvms-web/app/i18n/en-ie/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/es-es/activity.lang.json b/unionvms-web/app/i18n/es-es/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/es-es/activity.lang.json +++ b/unionvms-web/app/i18n/es-es/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/es-es/audit.lang.json b/unionvms-web/app/i18n/es-es/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/es-es/audit.lang.json +++ b/unionvms-web/app/i18n/es-es/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/es-es/spatial.lang.json b/unionvms-web/app/i18n/es-es/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/es-es/spatial.lang.json +++ b/unionvms-web/app/i18n/es-es/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/et-ee/activity.lang.json b/unionvms-web/app/i18n/et-ee/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/et-ee/activity.lang.json +++ b/unionvms-web/app/i18n/et-ee/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/et-ee/spatial.lang.json b/unionvms-web/app/i18n/et-ee/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/et-ee/spatial.lang.json +++ b/unionvms-web/app/i18n/et-ee/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/fi-fi/activity.lang.json b/unionvms-web/app/i18n/fi-fi/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/fi-fi/activity.lang.json +++ b/unionvms-web/app/i18n/fi-fi/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/fi-fi/audit.lang.json b/unionvms-web/app/i18n/fi-fi/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/fi-fi/audit.lang.json +++ b/unionvms-web/app/i18n/fi-fi/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/fi-fi/spatial.lang.json b/unionvms-web/app/i18n/fi-fi/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/fi-fi/spatial.lang.json +++ b/unionvms-web/app/i18n/fi-fi/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/fr-fr/activity.lang.json b/unionvms-web/app/i18n/fr-fr/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/fr-fr/activity.lang.json +++ b/unionvms-web/app/i18n/fr-fr/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/fr-fr/audit.lang.json b/unionvms-web/app/i18n/fr-fr/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/fr-fr/audit.lang.json +++ b/unionvms-web/app/i18n/fr-fr/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/fr-fr/spatial.lang.json b/unionvms-web/app/i18n/fr-fr/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/fr-fr/spatial.lang.json +++ b/unionvms-web/app/i18n/fr-fr/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/fr-lu/activity.lang.json b/unionvms-web/app/i18n/fr-lu/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/fr-lu/activity.lang.json +++ b/unionvms-web/app/i18n/fr-lu/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/fr-lu/audit.lang.json b/unionvms-web/app/i18n/fr-lu/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/fr-lu/audit.lang.json +++ b/unionvms-web/app/i18n/fr-lu/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/fr-lu/spatial.lang.json b/unionvms-web/app/i18n/fr-lu/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/fr-lu/spatial.lang.json +++ b/unionvms-web/app/i18n/fr-lu/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/hr-hr/activity.lang.json b/unionvms-web/app/i18n/hr-hr/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/hr-hr/activity.lang.json +++ b/unionvms-web/app/i18n/hr-hr/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/hr-hr/audit.lang.json b/unionvms-web/app/i18n/hr-hr/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/hr-hr/audit.lang.json +++ b/unionvms-web/app/i18n/hr-hr/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/hr-hr/spatial.lang.json b/unionvms-web/app/i18n/hr-hr/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/hr-hr/spatial.lang.json +++ b/unionvms-web/app/i18n/hr-hr/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/hu-hu/activity.lang.json b/unionvms-web/app/i18n/hu-hu/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/hu-hu/activity.lang.json +++ b/unionvms-web/app/i18n/hu-hu/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/hu-hu/audit.lang.json b/unionvms-web/app/i18n/hu-hu/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/hu-hu/audit.lang.json +++ b/unionvms-web/app/i18n/hu-hu/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/hu-hu/spatial.lang.json b/unionvms-web/app/i18n/hu-hu/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/hu-hu/spatial.lang.json +++ b/unionvms-web/app/i18n/hu-hu/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/im-im/activity.lang.json b/unionvms-web/app/i18n/im-im/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/im-im/activity.lang.json +++ b/unionvms-web/app/i18n/im-im/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/im-im/audit.lang.json b/unionvms-web/app/i18n/im-im/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/im-im/audit.lang.json +++ b/unionvms-web/app/i18n/im-im/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/im-im/spatial.lang.json b/unionvms-web/app/i18n/im-im/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/im-im/spatial.lang.json +++ b/unionvms-web/app/i18n/im-im/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/it-it/activity.lang.json b/unionvms-web/app/i18n/it-it/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/it-it/activity.lang.json +++ b/unionvms-web/app/i18n/it-it/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/it-it/audit.lang.json b/unionvms-web/app/i18n/it-it/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/it-it/audit.lang.json +++ b/unionvms-web/app/i18n/it-it/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/it-it/spatial.lang.json b/unionvms-web/app/i18n/it-it/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/it-it/spatial.lang.json +++ b/unionvms-web/app/i18n/it-it/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/lt-lt/activity.lang.json b/unionvms-web/app/i18n/lt-lt/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/lt-lt/activity.lang.json +++ b/unionvms-web/app/i18n/lt-lt/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/lt-lt/audit.lang.json b/unionvms-web/app/i18n/lt-lt/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/lt-lt/audit.lang.json +++ b/unionvms-web/app/i18n/lt-lt/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/lt-lt/spatial.lang.json b/unionvms-web/app/i18n/lt-lt/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/lt-lt/spatial.lang.json +++ b/unionvms-web/app/i18n/lt-lt/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/lv-lv/activity.lang.json b/unionvms-web/app/i18n/lv-lv/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/lv-lv/activity.lang.json +++ b/unionvms-web/app/i18n/lv-lv/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/lv-lv/audit.lang.json b/unionvms-web/app/i18n/lv-lv/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/lv-lv/audit.lang.json +++ b/unionvms-web/app/i18n/lv-lv/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/lv-lv/spatial.lang.json b/unionvms-web/app/i18n/lv-lv/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/lv-lv/spatial.lang.json +++ b/unionvms-web/app/i18n/lv-lv/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/mt/activity.lang.json b/unionvms-web/app/i18n/mt/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/mt/activity.lang.json +++ b/unionvms-web/app/i18n/mt/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/mt/audit.lang.json b/unionvms-web/app/i18n/mt/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/mt/audit.lang.json +++ b/unionvms-web/app/i18n/mt/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/mt/spatial.lang.json b/unionvms-web/app/i18n/mt/spatial.lang.json index c863c7a5d..120f8cf60 100644 --- a/unionvms-web/app/i18n/mt/spatial.lang.json +++ b/unionvms-web/app/i18n/mt/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -246,6 +246,7 @@ "tab_vms_pos_table_header_msg_type": "Msg.Type", "tab_vms_pos_table_header_activity_type": "Act. type", "tab_vms_pos_table_header_source": "Source", + "tab_vms_table_header_last_x": "Last X", "tab_vms_pos_table_zoom_btn_title": "Zoom to position", "tab_vms_pos_table_pan_btn_title": "Pan to position", "rule_table_details_btn_title": "Alert details", @@ -295,10 +296,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +317,6 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,6 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +388,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +404,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +413,6 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +444,6 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +455,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +475,6 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +491,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/nl-be/activity.lang.json b/unionvms-web/app/i18n/nl-be/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/nl-be/activity.lang.json +++ b/unionvms-web/app/i18n/nl-be/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/nl-be/audit.lang.json b/unionvms-web/app/i18n/nl-be/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/nl-be/audit.lang.json +++ b/unionvms-web/app/i18n/nl-be/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/nl-be/spatial.lang.json b/unionvms-web/app/i18n/nl-be/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/nl-be/spatial.lang.json +++ b/unionvms-web/app/i18n/nl-be/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/nl-nl/activity.lang.json b/unionvms-web/app/i18n/nl-nl/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/nl-nl/activity.lang.json +++ b/unionvms-web/app/i18n/nl-nl/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/nl-nl/audit.lang.json b/unionvms-web/app/i18n/nl-nl/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/nl-nl/audit.lang.json +++ b/unionvms-web/app/i18n/nl-nl/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/nl-nl/spatial.lang.json b/unionvms-web/app/i18n/nl-nl/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/nl-nl/spatial.lang.json +++ b/unionvms-web/app/i18n/nl-nl/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/nl/activity.lang.json b/unionvms-web/app/i18n/nl/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/nl/activity.lang.json +++ b/unionvms-web/app/i18n/nl/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/nl/audit.lang.json b/unionvms-web/app/i18n/nl/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/nl/audit.lang.json +++ b/unionvms-web/app/i18n/nl/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/nl/spatial.lang.json b/unionvms-web/app/i18n/nl/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/nl/spatial.lang.json +++ b/unionvms-web/app/i18n/nl/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/pl/activity.lang.json b/unionvms-web/app/i18n/pl/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/pl/activity.lang.json +++ b/unionvms-web/app/i18n/pl/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/pl/audit.lang.json b/unionvms-web/app/i18n/pl/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/pl/audit.lang.json +++ b/unionvms-web/app/i18n/pl/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/pl/spatial.lang.json b/unionvms-web/app/i18n/pl/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/pl/spatial.lang.json +++ b/unionvms-web/app/i18n/pl/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/pt-pt/activity.lang.json b/unionvms-web/app/i18n/pt-pt/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/pt-pt/activity.lang.json +++ b/unionvms-web/app/i18n/pt-pt/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/pt-pt/audit.lang.json b/unionvms-web/app/i18n/pt-pt/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/pt-pt/audit.lang.json +++ b/unionvms-web/app/i18n/pt-pt/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/pt-pt/spatial.lang.json b/unionvms-web/app/i18n/pt-pt/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/pt-pt/spatial.lang.json +++ b/unionvms-web/app/i18n/pt-pt/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/ro-ro/activity.lang.json b/unionvms-web/app/i18n/ro-ro/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/ro-ro/activity.lang.json +++ b/unionvms-web/app/i18n/ro-ro/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/ro-ro/audit.lang.json b/unionvms-web/app/i18n/ro-ro/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/ro-ro/audit.lang.json +++ b/unionvms-web/app/i18n/ro-ro/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/ro-ro/spatial.lang.json b/unionvms-web/app/i18n/ro-ro/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/ro-ro/spatial.lang.json +++ b/unionvms-web/app/i18n/ro-ro/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/si-si/activity.lang.json b/unionvms-web/app/i18n/si-si/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/si-si/activity.lang.json +++ b/unionvms-web/app/i18n/si-si/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/si-si/audit.lang.json b/unionvms-web/app/i18n/si-si/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/si-si/audit.lang.json +++ b/unionvms-web/app/i18n/si-si/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/si-si/spatial.lang.json b/unionvms-web/app/i18n/si-si/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/si-si/spatial.lang.json +++ b/unionvms-web/app/i18n/si-si/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/sk-sk/activity.lang.json b/unionvms-web/app/i18n/sk-sk/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/sk-sk/activity.lang.json +++ b/unionvms-web/app/i18n/sk-sk/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/sk-sk/audit.lang.json b/unionvms-web/app/i18n/sk-sk/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/sk-sk/audit.lang.json +++ b/unionvms-web/app/i18n/sk-sk/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/sk-sk/spatial.lang.json b/unionvms-web/app/i18n/sk-sk/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/sk-sk/spatial.lang.json +++ b/unionvms-web/app/i18n/sk-sk/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/sv/activity.lang.json b/unionvms-web/app/i18n/sv/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/sv/activity.lang.json +++ b/unionvms-web/app/i18n/sv/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/sv/audit.lang.json b/unionvms-web/app/i18n/sv/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/sv/audit.lang.json +++ b/unionvms-web/app/i18n/sv/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/sv/spatial.lang.json b/unionvms-web/app/i18n/sv/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/sv/spatial.lang.json +++ b/unionvms-web/app/i18n/sv/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/i18n/tr-cy/activity.lang.json b/unionvms-web/app/i18n/tr-cy/activity.lang.json index 9a0ba8e12..801641836 100644 --- a/unionvms-web/app/i18n/tr-cy/activity.lang.json +++ b/unionvms-web/app/i18n/tr-cy/activity.lang.json @@ -149,6 +149,7 @@ "catch_panel_see_catch_evolution": "See catch evolution", "catch_panel_see_catch_details": "See catch details", "advanced_search_placeholder_com_channel": "Communication Channel", + "advanced_search_placeholder_flux_fa_report_id": "FA report Id", "advanced_search_placeholder_from_id": "From (ID)", "advanced_search_placeholder_owner": "Owner", "advanced_search_placeholder_start_date": "Start Date", diff --git a/unionvms-web/app/i18n/tr-cy/audit.lang.json b/unionvms-web/app/i18n/tr-cy/audit.lang.json index 6e6abd96d..f0ba0c45d 100644 --- a/unionvms-web/app/i18n/tr-cy/audit.lang.json +++ b/unionvms-web/app/i18n/tr-cy/audit.lang.json @@ -78,6 +78,7 @@ "system_status_name": "System name", "system_status_online_timestamp": "Date", + "system_status_version": "Version", "system_status_module_audit": "Audit", "system_status_module_exchange": "Exchange", diff --git a/unionvms-web/app/i18n/tr-cy/spatial.lang.json b/unionvms-web/app/i18n/tr-cy/spatial.lang.json index c863c7a5d..83609f152 100644 --- a/unionvms-web/app/i18n/tr-cy/spatial.lang.json +++ b/unionvms-web/app/i18n/tr-cy/spatial.lang.json @@ -72,7 +72,7 @@ "map_export_filename": "map_export", "map_export_title_label": "Title", "map_export_layout_portrait": "Portrait", - "map_export_layout_landscape": "Landscape", + "map_export_layout_landscape": "Landscape", "map_export_copyright": "Generated by", "map_speed_label": "Speed", "map_start_date_label": "Start date", @@ -295,10 +295,10 @@ "area_selection_modal_area_is_selected_warning": "This area is already added to you current selection", "area_selection_modal_get_sys_layers_error": "There was an error while getting the list of available system areas. Please try again.", "area_selection_modal_get_sys_area_details_error": "There was an error while getting the details for the selected area. Please try again.", - "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", + "area_selection_modal_get_sys_area_details_empty_result": "There is no selectable area on the specified location.", "area_selection_modal_get_selected_sys_area_details_error": "There was an error while getting the details of previously selected areas. Please try again.", "area_selection_modal_get_selected_area_search_error": "There was an error while searching for areas. Please try again.", - + "area_selection_type_label": "Selection", "area_selection_type_all_areas": "All", "area_selection_type_custom": "Custom", @@ -316,7 +316,7 @@ "gfcm_config_modal_title": "GFCM settings", "fao_config_modal_title": "FAO settings", "fmz_config_modal_title": "FMZ settings", - + "save_as_modal_title": "Save report as...", "map_configuration_map_projection": "Map projection", "map_configuration_display_projection": "Display projection", @@ -332,9 +332,9 @@ "map_configuration_scale_bar_units_degrees": "Degrees", "map_configuration_scale_bar_units_nautical": "Nautical miles", "map_configuration_scale_bar_units_imperial": "Miles", - + "map_configuration_error_loading_configs": "There was an error while loading available map configurations. Please try again.", - + "layer_panel_layers": "Layers", "layer_panel_legend": "Legend", "layer_panel_copyright": "Copyright", @@ -379,7 +379,7 @@ "preferences_auto_refresh_status": "Auto refresh status", "preferences_alarm_status_category_title": "Alert status", "tab_config_table_header_vessel_color": "Asset color", - + "settings_reset_btn": "Reset to defaults", "map_settings": "Map settings", "style_settings": "Style settings", @@ -389,6 +389,10 @@ "visibility_configuration_label": "Label contents", "visibility_configuration_table": "Table contents", "visibility_show_attr_names": "Show attribute names", + "visibility_show_attr_name": "Show this attribute name", + "visibility_show_all_attr_name": "Show all attribute names", + "visibility_show_all_attr": "Show all attributes", + "visibility_show_attr_val": "Show this attribute value", "general_settings": "General settings", "general_configuration_geoserver_url": "Geoserver URL", "general_configuration_bing_api_key": "Bing Maps Api Key", @@ -401,7 +405,7 @@ "layer_settings_user_areas": "User areas", "layer_settings_group_areas": "Area groups", "layer_settings_port": "Ports", - "layer_tree": "Layer Tree", + "layer_tree": "Layer Tree", "base_layers_error": "There must be at least one background layer", "segment_property": "Segment property", "position_property": "Position property", @@ -410,7 +414,7 @@ "property_add_rule": "Add rule", "property_rm_rule": "Remove rule", "default_color": "Default color", - + "user_preferences_error_saving": "There was an error while saving your preferences. Please try again.", "user_preferences_success_saving": "Your preferences were successfuly saved. Please re-run your report, in order to reflect the changes onto the report result. Be aware that some of the settings might be overridden by report level preferences.", "user_preferences_reset_map_settings_success": "Your map settings were successfuly reset.", @@ -442,7 +446,7 @@ "invalid_range_error_message_2": "Must be between 1 and 6", "not_numeric_error_message": "Value shall be numeric", "base_list_error": "There should be at least one selected background layer", - + "styles_attr_countryCode": "F.S", "styles_attr_type": "Msg. Type", "styles_attr_activity": "Act. Type", @@ -454,11 +458,11 @@ "styles_attr_speedOverGround": "Speed", "styles_attr_courseOverGround": "Course", "styles_attr_status": "Status", - + "line_style": "Line style", "line_width": "Line width", "size": "Size", - + "ref_data_label": "Reference data", "ref_data_type_label": "Data type", "ref_data_group_selection": "Group selection", @@ -474,7 +478,7 @@ "ref_data_group_already_added_msg": "This group is already selected.", "ref_data_empty_search_by_click_msg": "There is no data at the selected location.", "ref_data_empty_search_by_prop_msg": "There is no data that matches your search criteria.", - + "previous": "Previous", "next": "Next", "more_details": "More...", @@ -491,11 +495,11 @@ "loading_preferences": "Loading preferences", "saving_preferences": "Saving preferences", "reseting_preferences": "Reseting preferences", - + "reset": "Reset", "clear_all_btn": "Clear all", "add_all_btn": "Add all", - + "saving_report_message": "Saving report", "reseting_report_message": "Reseting report", diff --git a/unionvms-web/app/index.html b/unionvms-web/app/index.html index d85b5f5ff..f98f23b76 100644 --- a/unionvms-web/app/index.html +++ b/unionvms-web/app/index.html @@ -13,6 +13,12 @@ + + UnionVMS @@ -263,6 +269,7 @@ + diff --git a/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.html b/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.html index dc0ff7be3..733306fd8 100644 --- a/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.html +++ b/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.html @@ -13,6 +13,12 @@
+
+ +
+
+ +
@@ -51,7 +57,7 @@
@@ -63,7 +69,7 @@
@@ -75,7 +81,7 @@
@@ -87,7 +93,7 @@
@@ -99,7 +105,7 @@
@@ -111,7 +117,7 @@
@@ -123,7 +129,7 @@
@@ -159,12 +165,12 @@ ng-if="column === 'startDate'">{{'activity.header_fa_start_date' | i18n }}
{{'activity.header_fa_end_date' | i18n }}
-
{{'spatial.reports_form_vessel_search_table_header_cfr' | i18n }}
-
{{'spatial.reports_form_vessel_search_table_header_ircs' | i18n }}
-
{{'spatial.reports_form_vessel_search_table_header_external_marking' | i18n }}
-
{{'activity.header_fa_uvi' | i18n }}
-
{{'activity.header_fa_iccat' | i18n }}
-
{{'activity.header_fa_gfcm' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_cfr' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_ircs' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_external_marking' | i18n }}
+
{{'activity.header_fa_uvi' | i18n }}
+
{{'activity.header_fa_iccat' | i18n }}
+
{{'activity.header_fa_gfcm' | i18n }}
{{'activity.header_fa_areas' | i18n }}
{{'activity.header_fa_port' | i18n }}
{{'activity.header_fa_gear' | i18n }}
@@ -231,4 +237,4 @@ - \ No newline at end of file + diff --git a/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.js b/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.js index bdf0043fd..a1a6d406a 100644 --- a/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.js +++ b/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.js @@ -29,6 +29,16 @@ angular.module('unionvmsWeb').controller('ActivityreportslistCtrl',function($sco $scope.attrVisibility = visibilityService; $scope.visServ = visibilityService; + $scope.selectionsDropdown = { + 'selection' : '' + }; + $scope.dropdownItems = [{'text':'Export results to CSV','code':'EXPORT'}]; + $scope.selectFromDropdown = function(selectedItem) { + if(selectedItem.code === 'EXPORT') { + activityService.exportActivityListToCsv(); + } + }; + /** * Update the Activvity list * diff --git a/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.less b/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.less index 7bf03b0bb..48c3e5a55 100644 --- a/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.less +++ b/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.less @@ -1,74 +1,81 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -.activityReportsList { - border: 1px solid #dddddd; - border-top: 0; - .buttonSection { - padding-left: 30px; - margin-top: 10px; - margin-bottom: 20px; - .dropdown-menu { - width: 300px; - max-width: 300px; - .row { - margin-right: 15px; - margin-left: 15px; - .checkbox { - margin-top: 5px; - margin-bottom: 5px; - } - } - } - .btn-left { - display: table-cell; - text-align: left; - button { - padding: 5px; - span { - margin-left: 5px; - } - } - } - .btn-right { - display: table-cell; - text-align: right; - button { - text-transform: uppercase; - } - } - } - .table-responsive-force { - width: 100%; - overflow-y: hidden; - overflow-x: auto; - -ms-overflow-style: -ms-autohiding-scrollbar; - -webkit-overflow-scrolling: touch; - table > thead > tr > th { - position: relative; - padding: 8px; - } - .fa-trash-o, .fa-ban { - color: @errorColor; - } - } - .notSortable { - cursor: default; - } - .with-icon { - color: @primaryColor; - /*font-size: 16px;*/ - } - - .activity-reports-pagination { - padding-right: 10px; - } -} +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +.activityReportsList { + border: 1px solid #dddddd; + border-top: 0; + .buttonSection { + padding-left: 30px; + margin-top: 10px; + margin-bottom: 20px; + .dropdown-menu { + width: 300px; + max-width: 300px; + .row { + margin-right: 15px; + margin-left: 15px; + .checkbox { + margin-top: 5px; + margin-bottom: 5px; + } + } + } + .btn-left { + display: table-cell; + text-align: left; + button { + padding: 5px; + span { + margin-left: 5px; + } + } + } + .btn-right { + display: table-cell; + text-align: right; + button { + text-transform: uppercase; + } + } + .spinner { + height: 30px; + width: 30px; + padding-left: 15px; + padding-right: 45px; + margin-left: -15px; + } + } + .table-responsive-force { + width: 100%; + overflow-y: hidden; + overflow-x: auto; + -ms-overflow-style: -ms-autohiding-scrollbar; + -webkit-overflow-scrolling: touch; + table > thead > tr > th { + position: relative; + padding: 8px; + } + .fa-trash-o, .fa-ban { + color: @errorColor; + } + } + .notSortable { + cursor: default; + } + .with-icon { + color: @primaryColor; + /*font-size: 16px;*/ + } + + .activity-reports-pagination { + padding-right: 10px; + } +} diff --git a/unionvms-web/app/partial/activity/advancedSearchForm/advancedSearchForm.html b/unionvms-web/app/partial/activity/advancedSearchForm/advancedSearchForm.html index 84e3dde19..abfa64276 100644 --- a/unionvms-web/app/partial/activity/advancedSearchForm/advancedSearchForm.html +++ b/unionvms-web/app/partial/activity/advancedSearchForm/advancedSearchForm.html @@ -109,6 +109,10 @@
{{'activity.advanced_search_max' | i18n}}
+
+ + +
diff --git a/unionvms-web/app/partial/activity/advancedSearchForm/advancedSearchForm.js b/unionvms-web/app/partial/activity/advancedSearchForm/advancedSearchForm.js index b991c04e3..a4387d2c8 100644 --- a/unionvms-web/app/partial/activity/advancedSearchForm/advancedSearchForm.js +++ b/unionvms-web/app/partial/activity/advancedSearchForm/advancedSearchForm.js @@ -68,7 +68,8 @@ angular.module('unionvmsWeb').controller('AdvancedsearchformCtrl',function($scop master: undefined, minWeight: undefined, maxWeight: undefined, - tripId: undefined + tripId: undefined, + fluxFaReportId: undefined }; /** @@ -266,7 +267,8 @@ angular.module('unionvmsWeb').controller('AdvancedsearchformCtrl',function($scop maxWeight: 'QUANTITY_MAX', comChannel: 'SOURCE', activityType: 'ACTIVITY_TYPE', - tripId: 'TRIP_ID' + tripId: 'TRIP_ID', + fluxFaReportId: 'FLUX_FA_REPORT_ID' }; var formatedSearch = {}; diff --git a/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.html b/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.html index 90a169007..1298e6b1b 100644 --- a/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.html +++ b/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.html @@ -1,6 +1,12 @@
+
+ +
+
+ +
@@ -59,14 +65,14 @@
@@ -95,7 +101,7 @@
@@ -116,13 +122,13 @@
{{'activity.tab_trip_table_header_id' | i18n }}
-
{{'spatial.tab_vms_pos_table_header_fs' | i18n }}
-
{{'spatial.reports_form_vessel_search_table_header_external_marking' | i18n }}
-
{{'spatial.reports_form_vessel_search_table_header_ircs' | i18n }}
-
{{'spatial.reports_form_vessel_search_table_header_cfr' | i18n }}
-
{{'activity.fa_details_item_uvi' | i18n }}
-
{{'activity.fa_details_item_iccat' | i18n }}
-
{{'activity.fa_details_item_gfcm' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_fs' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_external_marking' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_ircs' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_cfr' | i18n }}
+
{{'activity.fa_details_item_uvi' | i18n }}
+
{{'activity.fa_details_item_iccat' | i18n }}
+
{{'activity.fa_details_item_gfcm' | i18n }}
{{'activity.tab_trip_table_header_first_event' | i18n }}
{{'activity.tab_trip_table_header_first_event_time' | i18n }}
{{'activity.tab_trip_table_header_last_event' | i18n }}
diff --git a/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.js b/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.js index acfba346a..fd1aae900 100644 --- a/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.js +++ b/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.js @@ -21,7 +21,7 @@ copy of the GNU General Public License along with the IFDM Suite. If not, see . ---> -
-
- - - - - - - - - - - - - - - -
- {{ "audit.system_status_name" | i18n }} - - {{ "audit.system_status_online_timestamp" | i18n }} -
- - {{ statusLabel(status) | i18n | uppercase }} - - {{ "audit.system_status_module_" + system | i18n }}{{ status.lastPing | confDateFormat }}
-
-
\ No newline at end of file + +
+
+ + + + + + + + + + + + + + + + + +
+ {{ "audit.system_status_name" | i18n }} + + {{ "audit.system_status_version" | i18n }} + + {{ "audit.system_status_online_timestamp" | i18n }} +
+ + {{ statusLabel(status) | i18n | uppercase }} + + {{ "audit.system_status_module_" + system | i18n }}{{ platformVersionData[system] }}{{ status.lastPing | confDateFormat }}
+
+
diff --git a/unionvms-web/app/partial/admin/adminConfiguration/configurationModule/systemMonitor.js b/unionvms-web/app/partial/admin/adminConfiguration/configurationModule/systemMonitor.js index 3022502c5..4365c22e1 100644 --- a/unionvms-web/app/partial/admin/adminConfiguration/configurationModule/systemMonitor.js +++ b/unionvms-web/app/partial/admin/adminConfiguration/configurationModule/systemMonitor.js @@ -1,29 +1,34 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . - */ -angular.module('unionvmsWeb').controller('SystemMonitorController', function($scope, $resource, locale) { - - $scope.searchResults = { - loading: true, - zeroResultsErrorMessage: locale.getString('config.no_pings_message') - }; - - $resource("config/rest/pings").get(function(response) { - $scope.searchResults.loading = false; - $scope.searchResults.items = response.data; - $scope.searchResults.showZeroResultsMessage = Object.keys(response.data).length === 0; - }); - - $scope.statusLabel = function(status) { - return status.online ? 'config.online' : 'config.offline'; - }; - -}); \ No newline at end of file +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . + */ +angular.module('unionvmsWeb').controller('SystemMonitorController', function($scope, $resource, locale) { + + $scope.searchResults = { + loading: true, + zeroResultsErrorMessage: locale.getString('config.no_pings_message') + }; + $scope.platformVersionData = {} + + $resource("config/rest/pings").get(function(response) { + $scope.searchResults.loading = false; + $scope.searchResults.items = response.data; + $scope.searchResults.showZeroResultsMessage = Object.keys(response.data).length === 0; + }); + + $resource("config/rest/module/all").get(function(response) { + $scope.platformVersionData = response.data.modules; + }); + + $scope.statusLabel = function(status) { + return status.online ? 'config.online' : 'config.offline'; + }; + +}); diff --git a/unionvms-web/app/partial/areas/uploadAreaModal/uploadAreaModal.js b/unionvms-web/app/partial/areas/uploadAreaModal/uploadAreaModal.js index 01ce55906..c2e040393 100644 --- a/unionvms-web/app/partial/areas/uploadAreaModal/uploadAreaModal.js +++ b/unionvms-web/app/partial/areas/uploadAreaModal/uploadAreaModal.js @@ -1,285 +1,333 @@ /* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').controller('UploadareamodalCtrl',function($scope, $modalInstance, locale, FileUploader, projectionService, srcProjections, defaultProjection, $timeout){ - $scope.hasError = false; - $scope.hasWarning = false; - $scope.errorMessage = undefined; - $scope.isMulti = false; - - $scope.uploader = new FileUploader(); - $scope.reader = new FileReader(); - $scope.srcProjections = srcProjections; - $scope.projections = projectionService; - $scope.defaultProjection = defaultProjection; //This is an array like [1, 'EPSG:4326'] - - if ($scope.projections.items.length > 0){ - $scope.selProjection = defaultProjection[0]; - } - - //Uploader Filters and events - $scope.uploader.filters.push({ - name: 'singleUpload', - fn: function(item){ - if (this.queue.length > 0){ - this.queue.pop(); - } - return item; - } - }); - - $scope.uploader.filters.push({ - name: 'fileExtension', - fn: function(item){ - var supportedTypes = ['csv', 'txt', 'wkt']; - var splitedItemName = item.name.split('.'); - - for (var i = 0; i < supportedTypes.length; i++){ - if (supportedTypes[i].toLowerCase() === splitedItemName[splitedItemName.length - 1].toLowerCase()){ - return item; - } - } - } - }); - - //Read uploaded file contents - $scope.uploader.onAfterAddingFile = function(item) { - $scope.isFileLoading = true; - try { - $scope.reader.readAsText(item._file); - } catch (e) { - $scope.fileCommitted = true; - $scope.fileReadingSuccess = false; - $scope.isFileLoading = false; - } - }; - - //Set intial status - $scope.setStatus = function(){ - $scope.fileCommitted = false; - $scope.isFileLoading = false; - $scope.fileReadingSuccess = true; - if ($scope.uploader.queue.length > 0){ - $scope.uploader.clearQueue(); - $scope.fileContent = undefined; - } - }; - $scope.setStatus(); - - //Reader events - $scope.reader.onloadend = function(){ - $scope.fileContent = $scope.reader.result; - $scope.isFileLoading = false; - $scope.fileReadingSuccess = true; - $scope.fileCommitted = true; - }; - - //Format combobox - $scope.format = 'csv'; - $scope.formatItems = []; - $scope.formatItems.push({"text": locale.getString('areas.area_upload_modal_csv'), "code": "csv"}); - $scope.formatItems.push({"text": locale.getString('areas.area_upload_modal_wkt'), "code": "wkt"}); - //$scope.formatItems.push({"text": locale.getString('areas.area_upload_modal_gml'), "code": "gml"}); - - //CSV stuff - $scope.containsFirstRow = false; - - //CSV delimiters combobox - $scope.delimiter = ','; - $scope.delimiterItems = []; - $scope.delimiterItems.push({"text": locale.getString('areas.area_upload_modal_comma'), "code": ","}); - $scope.delimiterItems.push({"text": locale.getString('areas.area_upload_modal_semicolon'), "code": ";"}); - $scope.delimiterItems.push({"text": locale.getString('areas.area_upload_modal_colon'), "code": ":"}); - - //CSV parser - $scope.parseCSV = function(){ - var lines = $scope.fileContent.split('\n'); - var columns = lines[0].split($scope.delimiter).length; - - var start = 0; - var headers = []; - if ($scope.containsFirstRow){ - headers = lines[0].split($scope.delimiter); - start = 1; - } else { - if (columns !== 2){ - $scope.errorMessage = locale.getString('areas.area_upload_modal_only_two_columns'); - $scope.setError(); - return; - } - } - - var coords = []; - for (var i = start; i < lines.length; i++){ - var currentLine = lines[i].split(new RegExp($scope.delimiter+'(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)')); - if (currentLine.length === columns){ - var x,y; - if (!$scope.containsFirstRow){ - x = parseFloat(currentLine[0]); - y = parseFloat(currentLine[1]); - } else { - for (var j = 0; j < headers.length; j++){ - if (headers[j].trim() === $scope.xField.trim()){ - x = parseFloat(currentLine[j]); - } else if (headers[j].trim() === $scope.yField.trim()){ - y = parseFloat(currentLine[j]); - } - } - } - if (!isNaN(x) && !isNaN(y)){ - coords.push([x,y]); - } - } - } - - if (coords.length !== 0){ - //Lets validate if last pair of coordinates is the same as the first and if not we add it - var firstCoord = coords[0]; - var lastCoord = coords[coords.length - 1]; - var diff = _.difference(firstCoord, lastCoord); - - if (diff.length > 0){ - coords.push(firstCoord); - } - - //Build geometry - var geom = new ol.geom.Polygon(); - geom.setCoordinates([coords]); - - if (geom.getArea() === 0){ - $scope.errorMessage = locale.getString('areas.area_upload_modal_invalid_polygon'); - $scope.setError(); - return; - } else { - geom = $scope.checkAndWarpGeometry(geom); - return geom; - } - } else { - $scope.errorMessage = locale.getString('areas.area_upload_modal_parsing_error'); - $scope.setError(); - return; - } - }; - - //WKT Parser - $scope.parseWKT = function(){ - $scope.isMulti = false; - if ($scope.fileContent.indexOf('POLYGON') === -1){ - $scope.errorMessage = locale.getString('areas.area_upload_modal_wkt_no_polygon'); - $scope.setError(); - return; - } - - if ($scope.fileContent.indexOf('MULTIPOLYGON') !== -1){ - $scope.errorMessage = locale.getString('areas.area_upload_modal_wkt_no_multipolygon'); - $scope.setWarning(); - $scope.isMulti = true; - } - - if ($scope.isMulti){ - $timeout(function(){ - return $scope.buildGeometryFromWKT(); - }, 3000); - } else { - return $scope.buildGeometryFromWKT(); - } - }; - - $scope.buildGeometryFromWKT = function(){ - var geomFormat = new ol.format.WKT(); - var srcProj = 'EPSG:' + $scope.projections.getProjectionEpsgById($scope.selProjection); - - try { - var geom = geomFormat.readGeometry($scope.fileContent, { - dataProjection: srcProj, - featureProjection: $scope.defaultProjection[1] - }); - - if ($scope.isMulti){ - geom = geom.getPolygon(0); - $modalInstance.close(geom); - } - - var firstCoord = geom.getFirstCoordinate(); - var lastCoord = geom.getLastCoordinate(); - - if (geom.getArea() === 0){ - $scope.errorMessage = locale.getString('areas.area_upload_modal_invalid_polygon'); - $scope.setError(); - return; - } else { - if (!(firstCoord[0] === lastCoord[0] && firstCoord[1] === lastCoord[1])){ - var coords = geom.getCoordinates(); - coords[0].push(firstCoord); - geom.setCoordinates(coords); - } - return geom; - } - } catch (e) { - $scope.errorMessage = locale.getString('areas.area_upload_modal_parsing_error_wkt'); - $scope.setError(); - return; - } - }; - - //Check if selected projection differs from that of the map and, if so, warp it - $scope.checkAndWarpGeometry = function(geom){ - var sourceProj = 'EPSG:' + $scope.projections.getProjectionEpsgById($scope.selProjection); - if (sourceProj !== $scope.defaultProjection[1]){ - geom.transform(sourceProj, $scope.defaultProjection[1]); - } - return geom; - }; - - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - - $scope.upload = function(){ - $scope.uploaded = true; - if ($scope.uploadAreaForm.$valid && $scope.fileCommitted && $scope.fileReadingSuccess){ - var geom; - if ($scope.format === 'csv'){ - geom = $scope.parseCSV(); - } else if ($scope.format === 'wkt'){ - geom = $scope.parseWKT(); - } - - if (angular.isDefined(geom)){ - $modalInstance.close(geom); - } - } else { - $scope.setError(); - $scope.errorMessage = locale.getString('areas.area_upload_modal_form_errors'); - } - }; - - //Error functions - $scope.setError = function(){ - $scope.hasWarning = false; - $scope.hasError = true; - $scope.hideError(); - }; - - $scope.setWarning = function(){ - $scope.hasWarning = true; - $scope.hasError = true; - $scope.hideError(); - }; - - $scope.hideError = function(){ - $timeout(function(){ - $scope.hasError = false; - $scope.hasWarning = false; - }, 3000); - }; - -}); +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').controller('UploadareamodalCtrl',function($scope, $modalInstance, locale, FileUploader, projectionService, srcProjections, defaultProjection, $timeout){ + $scope.hasError = false; + $scope.hasWarning = false; + $scope.errorMessage = undefined; + $scope.isMulti = false; + + $scope.uploader = new FileUploader(); + $scope.reader = new FileReader(); + $scope.srcProjections = srcProjections; + $scope.projections = projectionService; + $scope.defaultProjection = defaultProjection; //This is an array like [1, 'EPSG:4326'] + + if ($scope.projections.items.length > 0){ + $scope.selProjection = defaultProjection[0]; + } + + //Uploader Filters and events + $scope.uploader.filters.push({ + name: 'singleUpload', + fn: function(item){ + if (this.queue.length > 0){ + this.queue.pop(); + } + return item; + } + }); + + $scope.uploader.filters.push({ + name: 'fileExtension', + fn: function(item){ + var supportedTypes = ['csv', 'txt', 'wkt', "gml", "xml"]; + var splitedItemName = item.name.split('.'); + + for (var i = 0; i < supportedTypes.length; i++){ + if (supportedTypes[i].toLowerCase() === splitedItemName[splitedItemName.length - 1].toLowerCase()){ + return item; + } + } + } + }); + + //Read uploaded file contents + $scope.uploader.onAfterAddingFile = function(item) { + $scope.isFileLoading = true; + try { + $scope.reader.readAsText(item._file); + } catch (e) { + $scope.fileCommitted = true; + $scope.fileReadingSuccess = false; + $scope.isFileLoading = false; + } + }; + + //Set intial status + $scope.setStatus = function(){ + $scope.fileCommitted = false; + $scope.isFileLoading = false; + $scope.fileReadingSuccess = true; + if ($scope.uploader.queue.length > 0){ + $scope.uploader.clearQueue(); + $scope.fileContent = undefined; + } + }; + $scope.setStatus(); + + //Reader events + $scope.reader.onloadend = function(){ + $scope.fileContent = $scope.reader.result; + $scope.isFileLoading = false; + $scope.fileReadingSuccess = true; + $scope.fileCommitted = true; + }; + + //Format combobox + $scope.format = 'csv'; + $scope.formatItems = []; + $scope.formatItems.push({"text": locale.getString('areas.area_upload_modal_csv'), "code": "csv"}); + $scope.formatItems.push({"text": locale.getString('areas.area_upload_modal_wkt'), "code": "wkt"}); + $scope.formatItems.push({"text": locale.getString('areas.area_upload_modal_gml'), "code": "gml"}); + + //CSV stuff + $scope.containsFirstRow = false; + + //CSV delimiters combobox + $scope.delimiter = ','; + $scope.delimiterItems = []; + $scope.delimiterItems.push({"text": locale.getString('areas.area_upload_modal_comma'), "code": ","}); + $scope.delimiterItems.push({"text": locale.getString('areas.area_upload_modal_semicolon'), "code": ";"}); + $scope.delimiterItems.push({"text": locale.getString('areas.area_upload_modal_colon'), "code": ":"}); + + //CSV parser + $scope.parseCSV = function(){ + var lines = $scope.fileContent.split('\n'); + var columns = lines[0].split($scope.delimiter).length; + + var start = 0; + var headers = []; + if ($scope.containsFirstRow){ + headers = lines[0].split($scope.delimiter); + start = 1; + } else { + if (columns !== 2){ + $scope.errorMessage = locale.getString('areas.area_upload_modal_only_two_columns'); + $scope.setError(); + return; + } + } + + var coords = []; + for (var i = start; i < lines.length; i++){ + var currentLine = lines[i].split(new RegExp($scope.delimiter+'(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)')); + if (currentLine.length === columns){ + var x,y; + if (!$scope.containsFirstRow){ + x = parseFloat(currentLine[0]); + y = parseFloat(currentLine[1]); + } else { + for (var j = 0; j < headers.length; j++){ + if (headers[j].trim() === $scope.xField.trim()){ + x = parseFloat(currentLine[j]); + } else if (headers[j].trim() === $scope.yField.trim()){ + y = parseFloat(currentLine[j]); + } + } + } + if (!isNaN(x) && !isNaN(y)){ + coords.push([x,y]); + } + } + } + + if (coords.length !== 0){ + //Lets validate if last pair of coordinates is the same as the first and if not we add it + var firstCoord = coords[0]; + var lastCoord = coords[coords.length - 1]; + var diff = _.difference(firstCoord, lastCoord); + + if (diff.length > 0){ + coords.push(firstCoord); + } + + //Build geometry + var geom = new ol.geom.Polygon(); + geom.setCoordinates([coords]); + + if (geom.getArea() === 0){ + $scope.errorMessage = locale.getString('areas.area_upload_modal_invalid_polygon'); + $scope.setError(); + return; + } else { + geom = $scope.checkAndWarpGeometry(geom); + return geom; + } + } else { + $scope.errorMessage = locale.getString('areas.area_upload_modal_parsing_error'); + $scope.setError(); + return; + } + }; + + $scope.parseGML = function() { + try { + var srcProj = 'EPSG:' + $scope.projections.getProjectionEpsgById($scope.selProjection); + var wfsFormat = new ol.format.WFS(); + var geometries = wfsFormat.readFeatures($scope.fileContent, { + defaultProjection: srcProj, + featureProjection: $scope.defaultProjection[1] + }); + + var geom = geometries[0].getGeometry(); + + geom.setCoordinates($scope.transformXYZCoordsToXY(geom.getCoordinates()[0])); + var firstCoord = geom.getFirstCoordinate(); + var lastCoord = geom.getLastCoordinate(); + + if (geom.getArea() === 0){ + $scope.errorMessage = locale.getString('areas.area_upload_modal_invalid_polygon'); + $scope.setError(); + return; + } else { + if (!(firstCoord[0] === lastCoord[0] && firstCoord[1] === lastCoord[1])){ + var coords = geom.getCoordinates(); + coords[0].push(firstCoord); + geom.setCoordinates(coords); + } + return $scope.checkAndWarpGeometry(geom); + } + } catch (e) { + $scope.errorMessage = locale.getString('areas.area_upload_modal_parsing_error_gml'); + $scope.setError(); + return; + } + }; + + $scope.transformXYZCoordsToXY = function(coords) { + var xyCoords = []; + xyCoords.push([]); + angular.forEach(coords, function (xyzCoors) { + var innerCoords = []; + innerCoords.push(xyzCoors[1]); + innerCoords.push(xyzCoors[0]); + xyCoords[0].push(innerCoords) + }, this); + return xyCoords; + }; + + //WKT Parser + $scope.parseWKT = function(){ + $scope.isMulti = false; + if ($scope.fileContent.indexOf('POLYGON') === -1){ + $scope.errorMessage = locale.getString('areas.area_upload_modal_wkt_no_polygon'); + $scope.setError(); + return; + } + + if ($scope.fileContent.indexOf('MULTIPOLYGON') !== -1){ + $scope.errorMessage = locale.getString('areas.area_upload_modal_wkt_no_multipolygon'); + $scope.setWarning(); + $scope.isMulti = true; + } + + if ($scope.isMulti){ + $timeout(function(){ + return $scope.buildGeometryFromWKT(); + }, 3000); + } else { + return $scope.buildGeometryFromWKT(); + } + }; + + $scope.buildGeometryFromWKT = function(){ + var geomFormat = new ol.format.WKT(); + var srcProj = 'EPSG:' + $scope.projections.getProjectionEpsgById($scope.selProjection); + + try { + var geom = geomFormat.readGeometry($scope.fileContent, { + dataProjection: srcProj, + featureProjection: $scope.defaultProjection[1] + }); + + if ($scope.isMulti){ + geom = geom.getPolygon(0); + $modalInstance.close(geom); + } + + var firstCoord = geom.getFirstCoordinate(); + var lastCoord = geom.getLastCoordinate(); + + if (geom.getArea() === 0){ + $scope.errorMessage = locale.getString('areas.area_upload_modal_invalid_polygon'); + $scope.setError(); + return; + } else { + if (!(firstCoord[0] === lastCoord[0] && firstCoord[1] === lastCoord[1])){ + var coords = geom.getCoordinates(); + coords[0].push(firstCoord); + geom.setCoordinates(coords); + } + return geom; + } + } catch (e) { + $scope.errorMessage = locale.getString('areas.area_upload_modal_parsing_error_wkt'); + $scope.setError(); + return; + } + }; + + //Check if selected projection differs from that of the map and, if so, warp it + $scope.checkAndWarpGeometry = function(geom){ + var sourceProj = 'EPSG:' + $scope.projections.getProjectionEpsgById($scope.selProjection); + if (sourceProj !== $scope.defaultProjection[1]){ + geom.transform(sourceProj, $scope.defaultProjection[1]); + } + return geom; + }; + + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; + + $scope.upload = function(){ + $scope.uploaded = true; + if ($scope.uploadAreaForm.$valid && $scope.fileCommitted && $scope.fileReadingSuccess){ + var geom; + if ($scope.format === 'csv'){ + geom = $scope.parseCSV(); + } else if ($scope.format === 'wkt'){ + geom = $scope.parseWKT(); + } else if ($scope.format === 'gml'){ + geom = $scope.parseGML(); + } + + if (angular.isDefined(geom)){ + $modalInstance.close(geom); + } + } else { + $scope.setError(); + $scope.errorMessage = locale.getString('areas.area_upload_modal_form_errors'); + } + }; + + //Error functions + $scope.setError = function(){ + $scope.hasWarning = false; + $scope.hasError = true; + $scope.hideError(); + }; + + $scope.setWarning = function(){ + $scope.hasWarning = true; + $scope.hasError = true; + $scope.hideError(); + }; + + $scope.hideError = function(){ + $timeout(function(){ + $scope.hasError = false; + $scope.hasWarning = false; + }, 3000); + }; + +}); diff --git a/unionvms-web/app/partial/footer/footer.html b/unionvms-web/app/partial/footer/footer.html index 82ac82458..6a851e116 100644 --- a/unionvms-web/app/partial/footer/footer.html +++ b/unionvms-web/app/partial/footer/footer.html @@ -1,18 +1,18 @@ - -
-
-
-

© {{fullYear}} UnionVMS - {{envName}}(REST API URL: {{apiURL}})

-
-
-
\ No newline at end of file + +
+
+
+

© {{fullYear}} UnionVMS - {{envName}}(REST API URL: {{apiURL}}) - Platform version: {{platformVersion}}

+
+
+
diff --git a/unionvms-web/app/partial/footer/footer.js b/unionvms-web/app/partial/footer/footer.js index d9bc4fc2f..811884af2 100644 --- a/unionvms-web/app/partial/footer/footer.js +++ b/unionvms-web/app/partial/footer/footer.js @@ -1,16 +1,21 @@ /* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . - */ -angular.module('unionvmsWeb').controller('FooterCtrl',function($scope, envConfig){ - $scope.envName = envConfig.env_name; - $scope.apiURL = envConfig.rest_api_base; - $scope.fullYear = new Date().getFullYear(); -}); \ No newline at end of file +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . + */ +angular.module('unionvmsWeb').controller('FooterCtrl',function($scope, $resource, envConfig){ + $scope.envName = envConfig.env_name; + $scope.apiURL = envConfig.rest_api_base; + $scope.fullYear = new Date().getFullYear(); + $scope.platformVersion = "" + + $resource("config/rest/module/all").get(function(response) { + $scope.platformVersion = response.data.platformVersion; + }); +}); diff --git a/unionvms-web/app/partial/header/headerMenu/headerMenu.js b/unionvms-web/app/partial/header/headerMenu/headerMenu.js index ea5771ddd..d2a275c7f 100644 --- a/unionvms-web/app/partial/header/headerMenu/headerMenu.js +++ b/unionvms-web/app/partial/header/headerMenu/headerMenu.js @@ -101,16 +101,6 @@ angular.module('unionvmsWeb').controller('HeaderMenuCtrl',function($scope, $root $scope.addMenuItem(locale.getString('header.menu_exchange'), '/exchange', 'exchange'); } - // Polling - if (checkAccess('Union-VMS', 'viewMobileTerminalPolls')) { - $scope.addMenuItem(locale.getString('header.menu_polling'), '/polling/logs', 'polling-logs'); - } - - // Mobile Terminals - if (checkAccess('Union-VMS', 'viewVesselsAndMobileTerminals')) { - $scope.addMenuItem(locale.getString('header.menu_communication'), '/communication', 'communication'); - } - // Assets if (checkAccess('Union-VMS', 'viewVesselsAndMobileTerminals')) { $scope.addMenuItem(locale.getString('header.menu_assets'), '/assets', 'assets'); @@ -137,7 +127,30 @@ angular.module('unionvmsWeb').controller('HeaderMenuCtrl',function($scope, $root // User if (userFeatureAccess.accessToAnyFeatureInList('USM')) { - $scope.addMenuItem(locale.getString('header.menu_user'), '/usm/users', 'users'); + var usersLink = false; + var usersElemId; + + if (checkAccess('USM', 'manageUsers') || checkAccess('USM', 'viewUsers')) { + usersLink = 'usm/users'; + usersElemId = 'users'; + } else if (checkAccess('USM', 'manageOrganisations') || checkAccess('USM', 'viewOrganisations')) { + usersLink = 'usm/organisations'; + usersElemId = 'organisations'; + } else if (checkAccess('USM', 'manageRoles') || checkAccess('USM', 'viewRoles')) { + usersLink = 'usm/roles'; + usersElemId = 'roles'; + } else if (checkAccess('USM', 'manageScopes') || checkAccess('USM', 'viewScopes')) { + usersLink = 'usm/scopes'; + usersElemId = 'scopes'; + } else if (checkAccess('USM', 'manageApplications') || checkAccess('USM', 'viewApplications')) { + usersLink = 'usm/applications'; + usersElemId = 'applications'; + } else if (checkAccess('USM', 'configurePolicies')) { + usersLink = 'usm/policies'; + usersElemId = 'policies'; + } + + $scope.addMenuItem(locale.getString('header.menu_user'), usersLink, usersElemId); } // Admin diff --git a/unionvms-web/app/partial/spatial/configurations/spatialConfigModel.js b/unionvms-web/app/partial/spatial/configurations/spatialConfigModel.js index 85ae70252..60220b071 100644 --- a/unionvms-web/app/partial/spatial/configurations/spatialConfigModel.js +++ b/unionvms-web/app/partial/spatial/configurations/spatialConfigModel.js @@ -1,472 +1,499 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').factory('SpatialConfig',function() { - - function SpatialConfig(){ - this.toolSettings = { - control: [], - tbControl: [] - }; - this.stylesSettings = { - positions: { - attribute: undefined, - style: {} - }, - segments: { - attribute: undefined, - style: {} - }, - alarms: { - size: undefined, - open: undefined, - closed: undefined, - pending: undefined, - none: undefined - } - }; - this.systemSettings = { - geoserverUrl: undefined, - bingApiKey: undefined - }; - this.layerSettings = { - additionalLayers: [], - areaLayers: [], - baseLayers: [], - portLayers: [] - - }; - this.mapSettings = { - mapProjectionId: undefined, - displayProjectionId: undefined, - coordinatesFormat: undefined, - scaleBarUnits: undefined, - refreshStatus: false, - refreshRate: undefined - }; - this.visibilitySettings = { - positions: { - table: {}, - popup: {}, - labels: {} - }, - segments: { - table: {}, - popup: {}, - labels: {} - }, - tracks: { - table: {} - } - }; - this.referenceDataSettings = {}; - } - - //Admin level configs - SpatialConfig.prototype.forAdminConfigFromJson = function(data, ports){ - var config = new SpatialConfig(); - - config.systemSettings = data.systemSettings; - config.mapSettings = data.mapSettings; - config.visibilitySettings = data.visibilitySettings; - config.stylesSettings = data.stylesSettings; - config.toolSettings = data.toolSettings; - config.layerSettings = data.layerSettings; - config.referenceDataSettings = data.referenceDataSettings; - - return config; - }; - - SpatialConfig.prototype.forAdminConfigToJson = function(form){ - var config = new SpatialConfig(); - - config = checkSystemSettings(this,config); - config = checkMapSettings(this,'admin',config,form.mapSettingsForm.$dirty); - config = checkStylesSettings(this,'admin',config,form.stylesSettingsForm.$dirty); - config = checkVisibilitySettings(this,'admin',config,form.visibilitySettingsForm.$dirty); - config = checkLayerSettings(this,'admin',config,form.layerSettingsForm.$dirty); - config = checkReferenceDataSettings(this,'admin',config,form.referenceDataSettingsForm.$dirty); - config.toolSettings = this.toolSettings; - - return angular.toJson(config); - }; - - //User level configs - SpatialConfig.prototype.forUserPrefFromJson = function(data){ - var config = new SpatialConfig(); - config.toolSettings = undefined; - config.systemSettings = undefined; - - if (angular.isDefined(data.mapSettings)){ - config.mapSettings = data.mapSettings; - } - - if (angular.isDefined(data.stylesSettings)){ - config.stylesSettings = data.stylesSettings; - } - - if (angular.isDefined(data.visibilitySettings)){ - config.visibilitySettings = data.visibilitySettings; - } - - if (angular.isDefined(data.layerSettings)){ - config.layerSettings = data.layerSettings; - } - - if (angular.isDefined(data.referenceDataSettings)){ - config.referenceDataSettings = data.referenceDataSettings; - } - - return config; - }; - - SpatialConfig.prototype.forUserPrefToServer = function(form){ - var config = new SpatialConfig(); - config.toolSettings = undefined; - config.systemSettings = undefined; - - config = checkMapSettings(this,'user',config,form.mapSettingsForm.$dirty); - config = checkStylesSettings(this,'user',config,form.stylesSettingsForm.$dirty); - config = checkVisibilitySettings(this,'user',config,form.visibilitySettingsForm.$dirty); - config = checkLayerSettings(this,'user',config,form.layerSettingsForm.$dirty); - config = checkReferenceDataSettings(this,'user',config,form.referenceDataSettingsForm.$dirty); - - return angular.toJson(config); - }; - - //Report level configs - SpatialConfig.prototype.forReportConfig = function(form,userConfig){ - var config = {}; - var formStatus = { - mapSettingsForm: angular.isDefined(form.mapSettingsForm) ? form.mapSettingsForm.$dirty : false, - stylesSettingsForm: angular.isDefined(form.stylesSettingsForm) ? form.stylesSettingsForm.$dirty : false, - visibilitySettings: angular.isDefined(form.visibilitySettings) ? form.visibilitySettings.$dirty : false, - layerSettingsForm: angular.isDefined(form.layerSettingsForm) ? form.layerSettingsForm.$dirty : false, - referenceDataSettingsForm: angular.isDefined(form.referenceDataSettingsForm) ? form.referenceDataSettingsForm.$dirty : false - }; - - if(userConfig.mapSettings.spatialConnectId !== this.mapSettings.spatialConnectId || userConfig.mapSettings.mapProjectionId !== this.mapSettings.mapProjectionId || - userConfig.mapSettings.displayProjectionId !== this.mapSettings.displayProjectionId || userConfig.mapSettings.coordinatesFormat !== this.mapSettings.coordinatesFormat || - userConfig.mapSettings.scaleBarUnits !== this.mapSettings.scaleBarUnits || formStatus.mapSettingsForm){ - config = checkMapSettings(this,'report',config,formStatus.mapSettingsForm); - }else{ - config.mapSettings = {}; - } - - if(!angular.equals(userConfig.stylesSettings,this.stylesSettings) || formStatus.stylesSettingsForm){ - config.mapSettings = checkStylesSettings(this,'report',config.mapSettings,formStatus.stylesSettingsForm); - } - - if(!angular.equals(userConfig.visibilitySettings.positions,this.visibilitySettings.positions) || - !angular.equals(userConfig.visibilitySettings.segments,this.visibilitySettings.segments) || - !angular.equals(userConfig.visibilitySettings.tracks,this.visibilitySettings.tracks) || - formStatus.visibilitySettingsForm){ - config.mapSettings = checkVisibilitySettings(this,'report',config.mapSettings,formStatus.visibilitySettingsForm); - } - - removeLayerHashKeys(this.layerSettings); - fixIndividualUserAreas(userConfig.layerSettings); - fixIndividualUserAreas(this.layerSettings); - if((!angular.equals(userConfig.layerSettings,this.layerSettings) || formStatus.layerSettingsForm) && !this.layerSettings.reseted){ - config.mapSettings = checkLayerSettings(this,'report',config.mapSettings,formStatus.layerSettingsForm); - } - - if(!angular.equals(userConfig.referenceDataSettings,this.referenceDataSettings) || formStatus.referenceDataSettingsForm){ - config.mapSettings = checkReferenceDataSettings(this,'report',config.mapSettings,formStatus.referenceDataSettingsForm); - } - - return config; - }; - - //Used in the report form map configuration modal - SpatialConfig.prototype.forReportConfigFromJson = function(data){ - var config = new SpatialConfig(); - config.toolSettings = undefined; - config.systemSettings = undefined; - - if (angular.isDefined(data)){ - config.mapSettings = {}; - config.mapSettings.spatialConnectId = data.spatialConnectId; - config.mapSettings.mapProjectionId = data.mapProjectionId; - config.mapSettings.displayProjectionId = data.displayProjectionId; - config.mapSettings.coordinatesFormat = data.coordinatesFormat; - config.mapSettings.scaleBarUnits = data.scaleBarUnits; - - if (angular.isDefined(data.stylesSettings)){ - config.stylesSettings = data.stylesSettings; - } - - if (angular.isDefined(data.visibilitySettings)){ - config.visibilitySettings = data.visibilitySettings; - } - - if (angular.isDefined(data.layerSettings)){ - config.layerSettings = data.layerSettings; - } - - if (angular.isDefined(data.referenceDataSettings)){ - config.referenceDataSettings = data.referenceDataSettings; - } - } - - return config; - }; - - var checkSystemSettings = function(model,config){ - //Validate geoserver URL - if (angular.isDefined(model.systemSettings.geoserverUrl)){ - var lastLetter = model.systemSettings.geoserverUrl.substr(model.systemSettings.geoserverUrl.length - 1); - if (lastLetter !== '/'){ - model.systemSettings.geoserverUrl += '/'; - } - } - config.systemSettings = model.systemSettings; - return config; - }; - - var checkMapSettings = function(model,settingsLevel,config,changed){ - if(!changed && model.mapSettings && model.mapSettings.reseted){ - config.mapSettings = undefined; - }else if(changed && model.mapSettings){ - config.mapSettings = {}; - if(settingsLevel !== 'report'){ - config.mapSettings.refreshStatus = model.mapSettings.refreshStatus; - config.mapSettings.refreshRate = model.mapSettings.refreshRate; - } - config.mapSettings.spatialConnectId = model.mapSettings.spatialConnectId; - config.mapSettings.mapProjectionId = model.mapSettings.mapProjectionId; - config.mapSettings.displayProjectionId = model.mapSettings.displayProjectionId; - config.mapSettings.coordinatesFormat = model.mapSettings.coordinatesFormat; - config.mapSettings.scaleBarUnits = model.mapSettings.scaleBarUnits; - }else if(!changed){ - if(settingsLevel === 'user'){ - config.mapSettings = undefined; - }else{ - config.mapSettings = {}; - if(settingsLevel === 'admin'){ - config.mapSettings.refreshStatus = model.mapSettings.refreshStatus; - config.mapSettings.refreshRate = model.mapSettings.refreshRate; - } - config.mapSettings.spatialConnectId = model.mapSettings.spatialConnectId; - config.mapSettings.mapProjectionId = model.mapSettings.mapProjectionId; - config.mapSettings.displayProjectionId = model.mapSettings.displayProjectionId; - config.mapSettings.coordinatesFormat = model.mapSettings.coordinatesFormat; - config.mapSettings.scaleBarUnits = model.mapSettings.scaleBarUnits; - } - } - - if(settingsLevel === 'report' && !angular.isDefined(config.mapSettings)){ - config.mapSettings = {}; - } - - return config; - }; - - var checkStylesSettings = function(model,settingsLevel,config,changed){ - if(!changed && model.stylesSettings && model.stylesSettings.reseted){ - config.stylesSettings = undefined; - }else if(changed && model.stylesSettings){ - config.stylesSettings = {}; - var styleTypes = ['position','segment','alarm']; - - angular.forEach(styleTypes,function(item){ - if (angular.isDefined(model[item + 'Style'])){ - var properties = {}; - - if(item==='alarm'){ - properties.size = model.alarmStyle.size; - for (var i = 0; i < model.alarmStyle.style.length; i++){ - properties[model.alarmStyle.style[i].id] = model.alarmStyle.style[i].color; - } - }else{ - properties.attribute = model[item + 'Style'].attribute; - properties.style = {}; - - if(item==='segment'){ - properties.style.lineStyle = model.segmentStyle.lineStyle; - properties.style.lineWidth = model.segmentStyle.lineWidth; - } - - switch (properties.attribute) { - case "speedOverGround": - case "distance": - case "duration": - case "courseOverGround": - case "reportedSpeed": - case "calculatedSpeed": - case "reportedCourse": - angular.forEach(model[item + 'Style'].style, function(item){ - properties.style[item.propertyFrom + "-" + item.propertyTo] = item.color; - }); - properties.style["default"] = model[item + 'Style'].defaultColor; - break; - case "countryCode": - angular.forEach(model[item + 'Style'].style, function(item){ - properties.style[item.code] = item.color; - }); - break; - case "activity": - case "type": - case "segmentCategory": - angular.forEach(model[item + 'Style'].style, function(item){ - properties.style[item.code] = item.color; - }); - properties.style["default"] = model[item + 'Style'].defaultColor; - break; - default: - break; - } - } - config.stylesSettings[item + 's'] = properties; - } - }); - }else if(!changed){ - if(settingsLevel === 'user'){ - config.stylesSettings = undefined; - }else{ - config.stylesSettings = model.stylesSettings; - delete config.stylesSettings.positionStyle; - delete config.stylesSettings.segmentStyle; - delete config.stylesSettings.alarmStyle; - } - } - - return config; - }; - - var checkVisibilitySettings = function(model,settingsLevel,config,changed){ - var visibilityTypes = ['position','segment','track']; - var contentTypes = ['Table','Popup','Label']; - if(!changed && (model.visibilitySettings && model.visibilitySettings.reseted || settingsLevel === 'user')){ - config.visibilitySettings = undefined; - }else if((changed && model.visibilitySettings) || (!changed && settingsLevel !== 'user')){ - config.visibilitySettings = {}; - angular.forEach(visibilityTypes, function(visibType) { - config.visibilitySettings[visibType + 's'] = {}; - angular.forEach(contentTypes, function(contentType) { - config.visibilitySettings[visibType + 's'][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()] = []; - if(visibType !== 'track' || visibType === 'track' && contentType === 'Table'){ - var visibilityCurrentSettings = model.visibilitySettings[visibType + 's'][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; - var visibilityCurrentAttrs = model.visibilitySettings[visibType + contentType + 'Attrs']; - var visibilities = {}; - visibilities.values = []; - visibilities.order = []; - visibilities.isAttributeVisible = visibilityCurrentSettings.isAttributeVisible; - var content; - for(var i = 0; i < visibilityCurrentAttrs.length; i++){ - visibilities.order.push(visibilityCurrentAttrs[i].value); - } - - if(angular.isDefined(visibilityCurrentSettings.values)){ - for(var j = 0; j < visibilities.order.length; j++){ - if(visibilityCurrentSettings.values.indexOf(visibilities.order[j]) !== -1){ - visibilities.values.push(visibilities.order[j]); - } - } - angular.copy(visibilities,visibilityCurrentSettings); - } - } - config.visibilitySettings[visibType + 's'][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()] = - model.visibilitySettings[visibType + 's'][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; - //delete config.visibilitySettings[visibType + contentType + 'Attrs']; - }); - }); - } - - if (angular.isDefined(config.visibilitySettings)){ - angular.forEach(visibilityTypes, function(visibType){ - angular.forEach(contentTypes, function(contentType){ - delete config.visibilitySettings[visibType + contentType + 'Attrs']; - }); - }); - } - - return config; - }; - - - var checkLayerSettings = function(model,settingsLevel,config,changed){ - if(settingsLevel === 'report'){ - config.layerSettings = model.layerSettings; - }else if(!changed && (model.layerSettings && model.layerSettings.reseted || settingsLevel === 'user')){ - config.layerSettings = undefined; - }else if((changed && model.layerSettings) || (!changed && settingsLevel !== 'user')){ - config.layerSettings = {}; - var layerTypes = ['port','area','additional','base']; - - angular.forEach(layerTypes,function(item){ - if(angular.isDefined(model.layerSettings[item + 'Layers']) && !_.isEmpty(model.layerSettings[item + 'Layers'])){ - var layers = []; - angular.forEach(model.layerSettings[item + 'Layers'], function(value,key) { - var layer; - if(item === 'area'){ - switch (value.areaType) { - case 'sysarea': - layer = {'serviceLayerId': value.serviceLayerId, 'areaType': value.areaType, 'order': key}; - break; - case 'userarea': - layer = {'serviceLayerId': value.serviceLayerId, 'areaType': value.areaType, 'gid': value.gid, 'order': key}; - break; - case 'areagroup': - layer = {'serviceLayerId': value.serviceLayerId, 'areaType': value.areaType, 'areaGroupName': value.name, 'order': key}; - break; - } - }else{ - layer = {'serviceLayerId': value.serviceLayerId, 'order': key}; - } - layers.push(layer); - }); - config.layerSettings[item + 'Layers'] = []; - angular.copy(layers,config.layerSettings[item + 'Layers']); - }else{ - config.layerSettings[item + 'Layers'] = undefined; - } - }); - } - return config; - }; - - var checkReferenceDataSettings = function(model,settingsLevel,config,changed){ - if(!changed && (model.referenceDataSettings && model.referenceDataSettings.reseted || settingsLevel === 'user')){ - config.referenceDataSettings = undefined; - }else if((changed && model.referenceDataSettings) || (!changed && settingsLevel !== 'user')){ - config.referenceDataSettings = model.referenceDataSettings; - } - return config; - }; - - var sortArray = function(data){ - var temp = _.clone(data); - temp.sort(); - - return temp; - }; - - var fixIndividualUserAreas = function (layerSettings){ - if (angular.isDefined(layerSettings.areaLayers) && layerSettings.areaLayers.length > 0){ - angular.forEach(layerSettings.areaLayers, function(item) { - if (item.areaType === 'userarea'){ - item.name = item.areaName; - } - }, layerSettings.areaLayers); - } - }; - - var removeLayerHashKeys = function(obj){ - angular.forEach(obj, function(type) { - angular.forEach(type, function(item) { - delete item.$$hashKey; - }); - }); - }; - - return SpatialConfig; -}); +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').factory('SpatialConfig',function() { + function SpatialConfig(){ + this.toolSettings = { + control: [], + tbControl: [] + }; + this.stylesSettings = { + positions: { + attribute: undefined, + style: {} + }, + segments: { + attribute: undefined, + style: {} + }, + alarms: { + size: undefined, + open: undefined, + closed: undefined, + pending: undefined, + none: undefined + } + }; + this.systemSettings = { + geoserverUrl: undefined, + bingApiKey: undefined, + spatialServerUrl: undefined + }; + this.layerSettings = { + additionalLayers: [], + areaLayers: [], + baseLayers: [], + portLayers: [] + }; + this.mapSettings = { + mapProjectionId: undefined, + displayProjectionId: undefined, + coordinatesFormat: undefined, + scaleBarUnits: undefined, + refreshStatus: false, + refreshRate: undefined + }; + this.visibilitySettings = { + positions: { + table: { + values:{} + }, + popup: { + names:{}, + values:{} + }, + labels: { + names:{}, + values:{} + }, + titles:{} + }, + segments: { + table: { + values:{} + }, + popup: { + names:{}, + values:{} + }, + labels: { + names:{}, + values:{} + }, + titles:{} + }, + tracks: { + table: { + values:{} + } + } + }; + this.referenceDataSettings = {}; + } + + //Admin level configs + SpatialConfig.prototype.forAdminConfigFromJson = function(data, ports){ + var config = new SpatialConfig(); + + config.systemSettings = data.systemSettings; + config.mapSettings = data.mapSettings; + config.visibilitySettings = data.visibilitySettings; + config.stylesSettings = data.stylesSettings; + config.toolSettings = data.toolSettings; + config.layerSettings = data.layerSettings; + config.referenceDataSettings = data.referenceDataSettings; + + return config; + }; + + SpatialConfig.prototype.forAdminConfigToJson = function(form){ + var config = new SpatialConfig(); + + config = checkSystemSettings(this,config); + config = checkMapSettings(this,'admin',config,form.mapSettingsForm.$dirty); + config = checkStylesSettings(this,'admin',config,form.stylesSettingsForm.$dirty); + config = checkVisibilitySettings(this,'admin',config,form.visibilitySettingsForm.$dirty); + config = checkLayerSettings(this,'admin',config,form.layerSettingsForm.$dirty); + config = checkReferenceDataSettings(this,'admin',config,form.referenceDataSettingsForm.$dirty); + config.toolSettings = this.toolSettings; + + return angular.toJson(config); + }; + + //User level configs + SpatialConfig.prototype.forUserPrefFromJson = function(data){ + var config = new SpatialConfig(); + config.toolSettings = undefined; + config.systemSettings = undefined; + if (angular.isDefined(data.mapSettings)){ + config.mapSettings = data.mapSettings; + } + + if (angular.isDefined(data.stylesSettings)){ + config.stylesSettings = data.stylesSettings; + } + + if (angular.isDefined(data.visibilitySettings)){ + config.visibilitySettings = data.visibilitySettings; + } + + if (angular.isDefined(data.layerSettings)){ + config.layerSettings = data.layerSettings; + } + + if (angular.isDefined(data.referenceDataSettings)){ + config.referenceDataSettings = data.referenceDataSettings; + } + + return config; + }; + + SpatialConfig.prototype.forUserPrefToServer = function(form){ + var config = new SpatialConfig(); + config.toolSettings = undefined; + config.systemSettings = undefined; + config = checkMapSettings(this,'user',config,form.mapSettingsForm.$dirty); + config = checkStylesSettings(this,'user',config,form.stylesSettingsForm.$dirty); + config = checkVisibilitySettings(this,'user',config,form.visibilitySettingsForm.$dirty); + config = checkLayerSettings(this,'user',config,form.layerSettingsForm.$dirty); + config = checkReferenceDataSettings(this,'user',config,form.referenceDataSettingsForm.$dirty); + + return angular.toJson(config); + }; + + //Report level configs + SpatialConfig.prototype.forReportConfig = function(form,userConfig){ + var config = {}; + var formStatus = { + mapSettingsForm: angular.isDefined(form.mapSettingsForm) ? form.mapSettingsForm.$dirty : false, + stylesSettingsForm: angular.isDefined(form.stylesSettingsForm) ? form.stylesSettingsForm.$dirty : false, + visibilitySettings: angular.isDefined(form.visibilitySettings) ? form.visibilitySettings.$dirty : false, + layerSettingsForm: angular.isDefined(form.layerSettingsForm) ? form.layerSettingsForm.$dirty : false, + referenceDataSettingsForm: angular.isDefined(form.referenceDataSettingsForm) ? form.referenceDataSettingsForm.$dirty : false + }; + if(userConfig.mapSettings.spatialConnectId !== this.mapSettings.spatialConnectId || userConfig.mapSettings.mapProjectionId !== this.mapSettings.mapProjectionId || + userConfig.mapSettings.displayProjectionId !== this.mapSettings.displayProjectionId || userConfig.mapSettings.coordinatesFormat !== this.mapSettings.coordinatesFormat || + userConfig.mapSettings.scaleBarUnits !== this.mapSettings.scaleBarUnits || formStatus.mapSettingsForm){ + config = checkMapSettings(this,'report',config,formStatus.mapSettingsForm); + }else{ + config.mapSettings = {}; + } + + if(!angular.equals(userConfig.stylesSettings,this.stylesSettings) || formStatus.stylesSettingsForm){ + config.mapSettings = checkStylesSettings(this,'report',config.mapSettings,formStatus.stylesSettingsForm); + } + + if(!angular.equals(userConfig.visibilitySettings.positions,this.visibilitySettings.positions) || + !angular.equals(userConfig.visibilitySettings.segments,this.visibilitySettings.segments) || + !angular.equals(userConfig.visibilitySettings.tracks,this.visibilitySettings.tracks) || + formStatus.visibilitySettingsForm){ + config.mapSettings = checkVisibilitySettings(this,'report',config.mapSettings,formStatus.visibilitySettingsForm); + } + + removeLayerHashKeys(this.layerSettings); + fixIndividualUserAreas(userConfig.layerSettings); + fixIndividualUserAreas(this.layerSettings); + if((!angular.equals(userConfig.layerSettings,this.layerSettings) || formStatus.layerSettingsForm) && !this.layerSettings.reseted){ + config.mapSettings = checkLayerSettings(this,'report',config.mapSettings,formStatus.layerSettingsForm); + } + + if(!angular.equals(userConfig.referenceDataSettings,this.referenceDataSettings) || formStatus.referenceDataSettingsForm){ + config.mapSettings = checkReferenceDataSettings(this,'report',config.mapSettings,formStatus.referenceDataSettingsForm); + } + + return config; + }; + //Used in the report form map configuration modal + SpatialConfig.prototype.forReportConfigFromJson = function(data){ + var config = new SpatialConfig(); + config.toolSettings = undefined; + config.systemSettings = undefined; + + if (angular.isDefined(data)){ + config.mapSettings = {}; + config.mapSettings.spatialConnectId = data.spatialConnectId; + config.mapSettings.mapProjectionId = data.mapProjectionId; + config.mapSettings.displayProjectionId = data.displayProjectionId; + config.mapSettings.coordinatesFormat = data.coordinatesFormat; + config.mapSettings.scaleBarUnits = data.scaleBarUnits; + + if (angular.isDefined(data.stylesSettings)){ + config.stylesSettings = data.stylesSettings; + } + + if (angular.isDefined(data.visibilitySettings)){ + config.visibilitySettings = data.visibilitySettings; + } + + if (angular.isDefined(data.layerSettings)){ + config.layerSettings = data.layerSettings; + } + + if (angular.isDefined(data.referenceDataSettings)){ + config.referenceDataSettings = data.referenceDataSettings; + } + } + + return config; + }; + + var checkSystemSettings = function(model,config){ + //Validate geoserver URL + if (angular.isDefined(model.systemSettings.geoserverUrl)){ + var lastLetter = model.systemSettings.geoserverUrl.substr(model.systemSettings.geoserverUrl.length - 1); + if (lastLetter !== '/'){ + model.systemSettings.geoserverUrl += '/'; + } + } + config.systemSettings = model.systemSettings; + return config; + }; + + var checkMapSettings = function(model,settingsLevel,config,changed){ + if(!changed && model.mapSettings && model.mapSettings.reseted){ + config.mapSettings = undefined; + }else if(changed && model.mapSettings){ + config.mapSettings = {}; + if(settingsLevel !== 'report'){ + config.mapSettings.refreshStatus = model.mapSettings.refreshStatus; + config.mapSettings.refreshRate = model.mapSettings.refreshRate; + } + config.mapSettings.spatialConnectId = model.mapSettings.spatialConnectId; + config.mapSettings.mapProjectionId = model.mapSettings.mapProjectionId; + config.mapSettings.displayProjectionId = model.mapSettings.displayProjectionId; + config.mapSettings.coordinatesFormat = model.mapSettings.coordinatesFormat; + config.mapSettings.scaleBarUnits = model.mapSettings.scaleBarUnits; + }else if(!changed){ + if(settingsLevel === 'user'){ + config.mapSettings = undefined; + }else{ + config.mapSettings = {}; + if(settingsLevel === 'admin'){ + config.mapSettings.refreshStatus = model.mapSettings.refreshStatus; + config.mapSettings.refreshRate = model.mapSettings.refreshRate; + } + config.mapSettings.spatialConnectId = model.mapSettings.spatialConnectId; + config.mapSettings.mapProjectionId = model.mapSettings.mapProjectionId; + config.mapSettings.displayProjectionId = model.mapSettings.displayProjectionId; + config.mapSettings.coordinatesFormat = model.mapSettings.coordinatesFormat; + config.mapSettings.scaleBarUnits = model.mapSettings.scaleBarUnits; + } + } + + if(settingsLevel === 'report' && !angular.isDefined(config.mapSettings)){ + config.mapSettings = {}; + } + + return config; + }; + + var checkStylesSettings = function(model,settingsLevel,config,changed){ + if(!changed && model.stylesSettings && model.stylesSettings.reseted){ + config.stylesSettings = undefined; + }else if(changed && model.stylesSettings){ + config.stylesSettings = {}; + var styleTypes = ['position','segment','alarm']; + + angular.forEach(styleTypes,function(item){ + if (angular.isDefined(model[item + 'Style'])){ + var properties = {}; + + if(item==='alarm'){ + properties.size = model.alarmStyle.size; + for (var i = 0; i < model.alarmStyle.style.length; i++){ + properties[model.alarmStyle.style[i].id] = model.alarmStyle.style[i].color; + } + }else{ + properties.attribute = model[item + 'Style'].attribute; + properties.style = {}; + if(item==='segment'){ + properties.style.lineStyle = model.segmentStyle.lineStyle; + properties.style.lineWidth = model.segmentStyle.lineWidth; + } + + switch (properties.attribute) { + case "speedOverGround": + case "distance": + case "duration": + case "courseOverGround": + case "reportedSpeed": + case "calculatedSpeed": + case "reportedCourse": + angular.forEach(model[item + 'Style'].style, function(item){ + properties.style[item.propertyFrom + "-" + item.propertyTo] = item.color; + }); + properties.style["default"] = model[item + 'Style'].defaultColor; + break; + case "countryCode": + angular.forEach(model[item + 'Style'].style, function(item){ + properties.style[item.code] = item.color; + }); + break; + case "activity": + case "type": + case "segmentCategory": + angular.forEach(model[item + 'Style'].style, function(item){ + properties.style[item.code] = item.color; + }); + properties.style["default"] = model[item + 'Style'].defaultColor; + break; + default: + break; + } + } + config.stylesSettings[item + 's'] = properties; + } + }); + }else if(!changed){ + if(settingsLevel === 'user'){ + config.stylesSettings = undefined; + }else{ + config.stylesSettings = model.stylesSettings; + delete config.stylesSettings.positionStyle; + delete config.stylesSettings.segmentStyle; + delete config.stylesSettings.alarmStyle; + } + } + + return config; + }; + + var checkVisibilitySettings = function(model,settingsLevel,config,changed){ + var visibilityTypes = ['position','segment','track']; + var contentTypes = ['Table','Popup','Label']; + if(!changed && (model.visibilitySettings && model.visibilitySettings.reseted || settingsLevel === 'user')){ + config.visibilitySettings = undefined; + }else if((changed && model.visibilitySettings) || (!changed && settingsLevel !== 'user')){ + config.visibilitySettings = {}; + angular.forEach(visibilityTypes, function(visibType) { + config.visibilitySettings[visibType + 's'] = {}; + angular.forEach(contentTypes, function(contentType) { + config.visibilitySettings[visibType + 's'][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()] = []; + if(visibType !== 'track' || visibType === 'track' && contentType === 'Table'){ + var visibilityCurrentSettings = model.visibilitySettings[visibType + 's'][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; + var visibilityCurrentAttrs = model.visibilitySettings[visibType + contentType + 'Attrs']; + var visibilityCurrentTitles = model.visibilitySettings[visibType + "s"]["form" + contentType + 'Titles']; + var visibilities = {}; + visibilities.names = []; + visibilities.values = []; + visibilities.order = []; + visibilities.titles = []; + visibilities.isAttributeVisible = visibilityCurrentSettings.isAttributeVisible; + var attr; + for(var i = 0; i < visibilityCurrentAttrs.length; i++){ + var code = visibilityCurrentAttrs[i].value; + visibilities.order.push(code); + if(angular.isDefined(visibilityCurrentTitles)){ + attr = visibilityCurrentTitles[code]; + if(angular.isDefined(attr) && attr.trim().length > 0) { + visibilities.titles.push({"code":code,"title":attr}); + } + } + } + + if(angular.isDefined(visibilityCurrentSettings.values)){ + for(var j = 0; j < visibilities.order.length; j++){ + attr = visibilities.order[j]; + if(visibilityCurrentSettings.values.indexOf(attr) !== -1){ + visibilities.values.push(attr); + } + if(angular.isDefined(visibilityCurrentSettings.names) && visibilityCurrentSettings.names.indexOf(attr) !== -1){ + visibilities.names.push(attr); + } + } + + angular.copy(visibilities,visibilityCurrentSettings); + } + } + config.visibilitySettings[visibType + 's'][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()] = + model.visibilitySettings[visibType + 's'][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; + //delete config.visibilitySettings[visibType + contentType + 'Attrs']; + }); + }); + } + if (angular.isDefined(config.visibilitySettings)){ + angular.forEach(visibilityTypes, function(visibType){ + angular.forEach(contentTypes, function(contentType){ + delete config.visibilitySettings[visibType + contentType + 'Attrs']; + }); + }); + } + return config; + }; + + + var checkLayerSettings = function(model,settingsLevel,config,changed){ + if(settingsLevel === 'report'){ + config.layerSettings = model.layerSettings; + }else if(!changed && (model.layerSettings && model.layerSettings.reseted || settingsLevel === 'user')){ + config.layerSettings = undefined; + }else if((changed && model.layerSettings) || (!changed && settingsLevel !== 'user')){ + config.layerSettings = {}; + var layerTypes = ['port','area','additional','base']; + + angular.forEach(layerTypes,function(item){ + if(angular.isDefined(model.layerSettings[item + 'Layers']) && !_.isEmpty(model.layerSettings[item + 'Layers'])){ + var layers = []; + angular.forEach(model.layerSettings[item + 'Layers'], function(value,key) { + var layer; + if(item === 'area'){ + switch (value.areaType) { + case 'sysarea': + layer = {'serviceLayerId': value.serviceLayerId, 'areaType': value.areaType, 'order': key}; + break; + case 'userarea': + layer = {'serviceLayerId': value.serviceLayerId, 'areaType': value.areaType, 'gid': value.gid, 'order': key}; + break; + case 'areagroup': + layer = {'serviceLayerId': value.serviceLayerId, 'areaType': value.areaType, 'areaGroupName': value.name, 'order': key}; + break; + } + }else{ + layer = {'serviceLayerId': value.serviceLayerId, 'order': key}; + } + layers.push(layer); + }); + config.layerSettings[item + 'Layers'] = []; + angular.copy(layers,config.layerSettings[item + 'Layers']); + }else{ + config.layerSettings[item + 'Layers'] = undefined; + } + }); + } + return config; + }; + + var checkReferenceDataSettings = function(model,settingsLevel,config,changed){ + if(!changed && (model.referenceDataSettings && model.referenceDataSettings.reseted || settingsLevel === 'user')){ + config.referenceDataSettings = undefined; + }else if((changed && model.referenceDataSettings) || (!changed && settingsLevel !== 'user')){ + config.referenceDataSettings = model.referenceDataSettings; + } + return config; + }; + + var sortArray = function(data){ + var temp = _.clone(data); + temp.sort(); + + return temp; + }; + + var fixIndividualUserAreas = function (layerSettings){ + if (angular.isDefined(layerSettings.areaLayers) && layerSettings.areaLayers.length > 0){ + angular.forEach(layerSettings.areaLayers, function(item) { + if (item.areaType === 'userarea'){ + item.name = item.areaName; + } + }, layerSettings.areaLayers); + } + }; + + var removeLayerHashKeys = function(obj){ + angular.forEach(obj, function(type) { + angular.forEach(type, function(item) { + delete item.$$hashKey; + }); + }); + }; + + return SpatialConfig; +}); diff --git a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/positionsVisibility/positionsVisibility.html b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/positionsVisibility/positionsVisibility.html index 967b661e3..3ab46fb10 100644 --- a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/positionsVisibility/positionsVisibility.html +++ b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/positionsVisibility/positionsVisibility.html @@ -1,93 +1,88 @@ - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
- {{'spatial.visibility_configuration_table' | i18n}} - - - {{'spatial.visibility_configuration_popup' | i18n}} - - - {{'spatial.visibility_configuration_label' | i18n}} - -
-
    -
  • -
    :::
    - {{attr.title}} - -
  • -
-
-
    -
  • -
    :::
    - {{attr.title}} - -
  • -
-
-
    -
  • -
    :::
    - {{attr.title}} - -
  • -
-
- {{'spatial.visibility_show_attr_names' | i18n}} - - - {{'spatial.visibility_show_attr_names' | i18n}} - -
-
-
-
- + +
+
+
+ + + + + + + + + + + + + + + + + + +
+ {{'spatial.visibility_configuration_table' | i18n}} + + + {{'spatial.visibility_configuration_popup' | i18n}} + + + + {{'spatial.visibility_configuration_label' | i18n}} + + +
+
    +
  • +
    :::
    + {{attr.title}} + +
  • +
+
+
    +
  • +
    :::
    + {{attr.title}} + + + +
  • +
+
+
    +
  • +
    :::
    + {{attr.title}} + + + +
  • +
+
+
+
+
+ diff --git a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/positionsVisibility/positionsVisibility.js b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/positionsVisibility/positionsVisibility.js index e8a85d8f0..bab9ee128 100644 --- a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/positionsVisibility/positionsVisibility.js +++ b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/positionsVisibility/positionsVisibility.js @@ -1,195 +1,213 @@ /* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').controller('PositionsvisibilityCtrl',function($scope, locale){ - $scope.isPositionVisLoading = false; - - $scope.$watch('configModel.visibilitySettings.positions', function(newVal) { - $scope.isPositionVisLoading = false; - if(newVal){ - - $scope.configModel.visibilitySettings.positionTableAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_date'), - value: 'posTime' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_lon'), - value: 'lon' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_lat'), - value: 'lat' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_status'), - value: 'stat' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_measured_speed'), - value: 'm_spd' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_calculated_speed'), - value: 'c_spd' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_course'), - value: 'crs' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_msg_type'), - value: 'msg_tp' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_activity_type'), - value: 'act_tp' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_source'), - value: 'source' - }]; - - $scope.configModel.visibilitySettings.positionPopupAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_date'), - value: 'posTime' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_lon'), - value: 'lon' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_lat'), - value: 'lat' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_status'), - value: 'stat' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_measured_speed'), - value: 'm_spd' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_calculated_speed'), - value: 'c_spd' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_course'), - value: 'crs' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_msg_type'), - value: 'msg_tp' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_activity_type'), - value: 'act_tp' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_source'), - value: 'source' - }]; - - $scope.configModel.visibilitySettings.positionLabelAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_date'), - value: 'posTime' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_lon'), - value: 'lon' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_lat'), - value: 'lat' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_status'), - value: 'stat' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_measured_speed'), - value: 'm_spd' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_calculated_speed'), - value: 'c_spd' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_course'), - value: 'crs' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_msg_type'), - value: 'msg_tp' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_activity_type'), - value: 'act_tp' - },{ - title: locale.getString('spatial.tab_vms_pos_table_header_source'), - value: 'source' - }]; - - var contentTypes = ['Table','Popup','Label']; - angular.forEach(contentTypes, function(contentType) { - var positions = []; - var positionVisibilitySettings = $scope.configModel.visibilitySettings.positions[contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; - var positionVisibilityAttrs = $scope.configModel.visibilitySettings['position' + contentType + 'Attrs']; - - if(positionVisibilitySettings.order && positionVisibilitySettings.order.length > 0){ - angular.forEach(positionVisibilitySettings.order, function(item) { - for(var i=0;i. +*/ +angular.module('unionvmsWeb').controller('PositionsvisibilityCtrl',function($scope, locale){ + $scope.isPositionVisLoading = false; + + $scope.$watch('configModel.visibilitySettings.positions', function(newVal) { + $scope.isPositionVisLoading = false; + if(newVal){ + + $scope.configModel.visibilitySettings.positionTableAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_date'), + value: 'posTime' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_lon'), + value: 'lon' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_lat'), + value: 'lat' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_status'), + value: 'stat' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_measured_speed'), + value: 'm_spd' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_calculated_speed'), + value: 'c_spd' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_course'), + value: 'crs' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_msg_type'), + value: 'msg_tp' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_activity_type'), + value: 'act_tp' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_source'), + value: 'source' + }]; + + $scope.configModel.visibilitySettings.positionPopupAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_date'), + value: 'posTime' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_lon'), + value: 'lon' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_lat'), + value: 'lat' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_status'), + value: 'stat' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_measured_speed'), + value: 'm_spd' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_calculated_speed'), + value: 'c_spd' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_course'), + value: 'crs' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_msg_type'), + value: 'msg_tp' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_activity_type'), + value: 'act_tp' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_source'), + value: 'source' + }]; + $scope.configModel.visibilitySettings.positions.formPopupTitles = {}; + + $scope.configModel.visibilitySettings.positionLabelAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_date'), + value: 'posTime' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_lon'), + value: 'lon' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_lat'), + value: 'lat' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_status'), + value: 'stat' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_measured_speed'), + value: 'm_spd' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_calculated_speed'), + value: 'c_spd' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_course'), + value: 'crs' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_msg_type'), + value: 'msg_tp' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_activity_type'), + value: 'act_tp' + },{ + title: locale.getString('spatial.tab_vms_pos_table_header_source'), + value: 'source' + }]; + $scope.configModel.visibilitySettings.positions.formLabelTitles = {}; + + var contentTypes = ['Table','Popup','Label']; + angular.forEach(contentTypes, function(contentType) { + var positions = []; + var contentTypeLocal = contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase(); + var positionVisibilitySettings = $scope.configModel.visibilitySettings.positions[contentTypeLocal]; + var positionVisibilityAttrs = $scope.configModel.visibilitySettings['position' + contentType + 'Attrs']; + var positionVisibilityTitles = $scope.configModel.visibilitySettings.positions[contentTypeLocal].titles; + + if(positionVisibilitySettings.order && positionVisibilitySettings.order.length > 0){ + angular.forEach(positionVisibilitySettings.order, function(item) { + for(var i=0;i. -*/ -.positionsVisiblity { - .table-no-border { - border: 0; - th { - border-bottom: 0; - text-align: center; - text-transform: uppercase; - color: #777; - } - td { - text-align: center; - } - td:first-child { - text-align: justify; - font-weight: bold; - color: #777; - } - } - .noPadding { - padding: 0px !important; - } - .form-group { - margin-bottom: 0px; - } -} +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +.positionsVisiblity { + .table-no-border { + border: 0; + th { + border-bottom: 0; + text-align: center; + text-transform: uppercase; + color: #777; + } + td { + text-align: center; + } + td:first-child { + text-align: justify; + font-weight: bold; + color: #777; + } + } + .noPadding { + padding: 0px !important; + } + .form-group { + margin-bottom: 0px; + } + .lb-name { + right: 30px !important; + } + table > tbody > tr > td > ul > li input.replacement { + width: auto; + right: initial; + margin-left: 10px; + top: 5px; + height: 30px; + } +} diff --git a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/segmentsVisibility/segmentsVisibility.html b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/segmentsVisibility/segmentsVisibility.html index eab6ba9bc..ae4ae3320 100644 --- a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/segmentsVisibility/segmentsVisibility.html +++ b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/segmentsVisibility/segmentsVisibility.html @@ -1,89 +1,84 @@ - -
-
-
- - - - - - - - - - - - - - - - - - - - -
- {{'spatial.visibility_configuration_table' | i18n}} - - - {{'spatial.visibility_configuration_popup' | i18n}} - - - {{'spatial.visibility_configuration_label' | i18n}} - -
-
    -
  • -
    :::
    - {{attr.title}} - -
  • -
-
-
    -
  • -
    :::
    - {{attr.title}} - -
  • -
-
-
    -
  • -
    :::
    - {{attr.title}} - -
  • -
-
- {{'spatial.visibility_show_attr_names' | i18n}} - - - {{'spatial.visibility_show_attr_names' | i18n}} - -
-
-
-
+ +
+
+
+ + + + + + + + + + + + + + + +
+ {{'spatial.visibility_configuration_table' | i18n}} + + + {{'spatial.visibility_configuration_popup' | i18n}} + + + + {{'spatial.visibility_configuration_label' | i18n}} + + +
+
    +
  • +
    :::
    + {{attr.title}} + +
  • +
+
+
    +
  • +
    :::
    + {{attr.title}} + + + +
  • +
+
+
    +
  • +
    :::
    + {{attr.title}} + + + +
  • +
+
+
+
+
diff --git a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/segmentsVisibility/segmentsVisibility.js b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/segmentsVisibility/segmentsVisibility.js index 048f4e894..8300d8746 100644 --- a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/segmentsVisibility/segmentsVisibility.js +++ b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/segmentsVisibility/segmentsVisibility.js @@ -1,147 +1,166 @@ /* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').controller('SegmentsvisibilityCtrl',function($scope, locale){ - - $scope.$watch('configModel.visibilitySettings.segments', function(newVal) { - if(newVal){ - $scope.configModel.visibilitySettings.segmentTableAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_distance'), - value: 'dist' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_duration'), - value: 'dur' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_speed_ground'), - value: 'spd' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_course_ground'), - value: 'crs' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_category'), - value: 'cat' - }]; - - $scope.configModel.visibilitySettings.segmentPopupAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_distance'), - value: 'dist' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_duration'), - value: 'dur' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_speed_ground'), - value: 'spd' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_course_ground'), - value: 'crs' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_category'), - value: 'cat' - }]; - - $scope.configModel.visibilitySettings.segmentLabelAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_distance'), - value: 'dist' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_duration'), - value: 'dur' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_speed_ground'), - value: 'spd' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_course_ground'), - value: 'crs' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_category'), - value: 'cat' - }]; - - var contentTypes = ['Table','Popup','Label']; - angular.forEach(contentTypes, function(contentType) { - var segments = []; - var segmentVisibilitySettings = $scope.configModel.visibilitySettings.segments[contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; - var segmentVisibilityAttrs = $scope.configModel.visibilitySettings['segment' + contentType + 'Attrs']; - - if(segmentVisibilitySettings.order && segmentVisibilitySettings.order.length > 0){ - angular.forEach(segmentVisibilitySettings.order, function(item) { - for(var i=0;i. +*/ +angular.module('unionvmsWeb').controller('SegmentsvisibilityCtrl',function($scope, locale){ + + $scope.$watch('configModel.visibilitySettings.segments', function(newVal) { + if(newVal){ + $scope.configModel.visibilitySettings.segmentTableAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_distance'), + value: 'dist' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_duration'), + value: 'dur' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_speed_ground'), + value: 'spd' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_course_ground'), + value: 'crs' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_category'), + value: 'cat' + }]; + + $scope.configModel.visibilitySettings.segmentPopupAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_distance'), + value: 'dist' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_duration'), + value: 'dur' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_speed_ground'), + value: 'spd' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_course_ground'), + value: 'crs' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_category'), + value: 'cat' + }]; + $scope.configModel.visibilitySettings.segments.formPopupTitles = {}; + + $scope.configModel.visibilitySettings.segmentLabelAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_distance'), + value: 'dist' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_duration'), + value: 'dur' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_speed_ground'), + value: 'spd' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_course_ground'), + value: 'crs' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_category'), + value: 'cat' + }]; + $scope.configModel.visibilitySettings.segments.formLabelTitles = {}; + + var contentTypes = ['Table','Popup','Label']; + angular.forEach(contentTypes, function(contentType) { + var segments = []; + var contentTypeLocal = contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase(); + var segmentVisibilitySettings = $scope.configModel.visibilitySettings.segments[contentTypeLocal]; + var segmentVisibilityAttrs = $scope.configModel.visibilitySettings['segment' + contentType + 'Attrs']; + var segmentVisibilityTitles = $scope.configModel.visibilitySettings.segments[contentTypeLocal].titles; + + if(segmentVisibilitySettings.order && segmentVisibilitySettings.order.length > 0){ + angular.forEach(segmentVisibilitySettings.order, function(item) { + for(var i=0;i. -*/ -.segmentsVisiblity { - .table-no-border { - border: 0; - th { - border-bottom: 0; - text-align: center; - text-transform: uppercase; - color: #777; - } - td { - text-align: center; - } - td:first-child { - text-align: justify; - font-weight: bold; - color: #777; - } - } - .noPadding { - padding: 0px !important; - } - .form-group { - margin-bottom: 0px; - } -} +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +.segmentsVisiblity { + .table-no-border { + border: 0; + th { + border-bottom: 0; + text-align: center; + text-transform: uppercase; + color: #777; + } + td { + text-align: center; + } + td:first-child { + text-align: justify; + font-weight: bold; + color: #777; + } + } + .noPadding { + padding: 0px !important; + } + .form-group { + margin-bottom: 0px; + } + .lb-name { + right: 30px !important; + } + table > tbody > tr > td > ul > li input.replacement { + width: auto; + right: initial; + margin-left: 10px; + top: 5px; + height: 30px; + } +} diff --git a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/tracksVisibility/tracksVisibility.html b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/tracksVisibility/tracksVisibility.html index dc6c18f0f..8b31a9b26 100644 --- a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/tracksVisibility/tracksVisibility.html +++ b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/tracksVisibility/tracksVisibility.html @@ -1,45 +1,45 @@ - -
-
-
- - - - - - - - - - - -
- {{'spatial.visibility_configuration_table' | i18n}} - -
-
    -
  • -
    :::
    - {{attr.title}} - -
  • -
-
-
-
-
- + +
+
+
+ + + + + + + + + + + +
+ {{'spatial.visibility_configuration_table' | i18n}} + +
+
    +
  • +
    :::
    + {{attr.title}} + +
  • +
+
+
+
+
+ diff --git a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/tracksVisibility/tracksVisibility.js b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/tracksVisibility/tracksVisibility.js index 1c5813f9a..789b023d0 100644 --- a/unionvms-web/app/partial/spatial/configurations/visibilitySettings/tracksVisibility/tracksVisibility.js +++ b/unionvms-web/app/partial/spatial/configurations/visibilitySettings/tracksVisibility/tracksVisibility.js @@ -1,129 +1,129 @@ /* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').controller('TracksvisibilityCtrl',function($scope, locale){ - - $scope.$watch('configModel.visibilitySettings.tracks', function(newVal) { - if(newVal){ - $scope.configModel.visibilitySettings.trackTableAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_distance'), - value: 'dist' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_duration'), - value: 'dur' - },{ - title: locale.getString('spatial.reports_form_vms_tracks_time_at_sea'), - value: 'timeSea' - }]; - - $scope.configModel.visibilitySettings.trackPopupAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_distance'), - value: 'dist' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_duration'), - value: 'dur' - },{ - title: locale.getString('spatial.reports_form_vms_tracks_time_at_sea'), - value: 'timeSea' - }]; - - $scope.configModel.visibilitySettings.trackLabelAttrs = [{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), - value: 'fs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), - value: 'extMark' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), - value: 'ircs' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), - value: 'cfr' - },{ - title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), - value: 'name' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_distance'), - value: 'dist' - },{ - title: locale.getString('spatial.tab_vms_seg_table_header_duration'), - value: 'dur' - },{ - title: locale.getString('spatial.reports_form_vms_tracks_time_at_sea'), - value: 'timeSea' - }]; - - var contentTypes = ['Table']; - angular.forEach(contentTypes, function(contentType) { - var tracks = []; - var trackVisibilitySettings = $scope.configModel.visibilitySettings.tracks[contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; - var trackVisibilityAttrs = $scope.configModel.visibilitySettings['track' + contentType + 'Attrs']; - - if(trackVisibilitySettings.order && trackVisibilitySettings.order.length > 0){ - angular.forEach(trackVisibilitySettings.order, function(item) { - for(var i=0;i. +*/ +angular.module('unionvmsWeb').controller('TracksvisibilityCtrl',function($scope, locale){ + + $scope.$watch('configModel.visibilitySettings.tracks', function(newVal) { + if(newVal){ + $scope.configModel.visibilitySettings.trackTableAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_distance'), + value: 'dist' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_duration'), + value: 'dur' + },{ + title: locale.getString('spatial.reports_form_vms_tracks_time_at_sea'), + value: 'timeSea' + }]; + + $scope.configModel.visibilitySettings.trackPopupAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_distance'), + value: 'dist' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_duration'), + value: 'dur' + },{ + title: locale.getString('spatial.reports_form_vms_tracks_time_at_sea'), + value: 'timeSea' + }]; + + $scope.configModel.visibilitySettings.trackLabelAttrs = [{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_flag_state'), + value: 'fs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_external_marking'), + value: 'extMark' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_ircs'), + value: 'ircs' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_cfr'), + value: 'cfr' + },{ + title: locale.getString('spatial.reports_form_vessel_search_table_header_name'), + value: 'name' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_distance'), + value: 'dist' + },{ + title: locale.getString('spatial.tab_vms_seg_table_header_duration'), + value: 'dur' + },{ + title: locale.getString('spatial.reports_form_vms_tracks_time_at_sea'), + value: 'timeSea' + }]; + + var contentTypes = ['Table']; + angular.forEach(contentTypes, function(contentType) { + var tracks = []; + var trackVisibilitySettings = $scope.configModel.visibilitySettings.tracks[contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; + var trackVisibilityAttrs = $scope.configModel.visibilitySettings['track' + contentType + 'Attrs']; + + if(trackVisibilitySettings.order && trackVisibilitySettings.order.length > 0){ + angular.forEach(trackVisibilitySettings.order, function(item) { + for(var i=0;i. -*/ -angular.module('unionvmsWeb').controller('VisibilitysettingsCtrl',function($scope, locale, $anchorScroll, spatialConfigRestService, spatialConfigAlertService, SpatialConfig, $location, loadingStatus){ - - $scope.status = { - isOpen: false - }; - - $scope.selectedMenu = 'position'; - - var setMenus = function(){ - return [ - { - 'menu': 'position', - 'title': locale.getString('spatial.tab_movements') - }, - { - 'menu': 'segment', - 'title': locale.getString('spatial.tab_segments') - }, - { - 'menu': 'track', - 'title': locale.getString('spatial.tab_tracks') - } - ]; - }; - - $scope.checkComponents = function(){ - var status = false; - var menuToSelect = []; - var counter = 0; - angular.forEach($scope.components.visibility, function(value, key) { - if (!value){ - status = true; - } - menuToSelect.push(value); - counter += 1; - }); - - if (status){ - var states = _.countBy(menuToSelect, function(state){return state;}); - if (states.true === 1){ - var idx = _.indexOf(menuToSelect, true); - if (idx !== -1){ - $scope.selectedMenu = $scope.headerMenus[idx].menu; - } - } - } - - return status; - }; - - $scope.selectAll = { - positions: { - table: true, - popup: true, - label: true - }, - segments: { - table: true, - popup: true, - label: true - }, - tracks: { - table: true - } - }; - - locale.ready('spatial').then(function(){ - $scope.headerMenus = setMenus(); - }); - - $scope.selectMenu = function(menu){ - $scope.selectedMenu = menu; - }; - - $scope.dropItem = function(item, list){ - var itemIndex = list.indexOf(item); - if(itemIndex !== 1){ - list.splice(itemIndex, 1); - } - return item; - }; - - $scope.selectAllChange = function(visibilityType,contentType,isListItem,newVal){ - var currentVisibilities = $scope.configModel.visibilitySettings[visibilityType][contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase()]; - if(isListItem){ - var checked = this.checked === true ? 1 : -1; - if(angular.isDefined(currentVisibilities.values) && currentVisibilities.values.length + checked === currentVisibilities.order.length){ - $scope.selectAll[visibilityType][contentType] = true; - }else{ - $scope.selectAll[visibilityType][contentType] = false; - } - }else{ - currentVisibilities.values = []; - if($scope.selectAll[visibilityType][contentType]){ - angular.forEach(currentVisibilities.order, function(item) { - currentVisibilities.values.push(item); - }); - } - - } - }; -}); - +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').controller('VisibilitysettingsCtrl',function($scope, locale, $anchorScroll, spatialConfigRestService, spatialConfigAlertService, SpatialConfig, $location, loadingStatus){ + + $scope.status = { + isOpen: false + }; + + $scope.selectedMenu = 'position'; + + var setMenus = function(){ + return [ + { + 'menu': 'position', + 'title': locale.getString('spatial.tab_movements') + }, + { + 'menu': 'segment', + 'title': locale.getString('spatial.tab_segments') + }, + { + 'menu': 'track', + 'title': locale.getString('spatial.tab_tracks') + } + ]; + }; + + $scope.checkComponents = function(){ + var status = false; + var menuToSelect = []; + var counter = 0; + angular.forEach($scope.components.visibility, function(value, key) { + if (!value){ + status = true; + } + menuToSelect.push(value); + counter += 1; + }); + + if (status){ + var states = _.countBy(menuToSelect, function(state){return state;}); + if (states.true === 1){ + var idx = _.indexOf(menuToSelect, true); + if (idx !== -1){ + $scope.selectedMenu = $scope.headerMenus[idx].menu; + } + } + } + + return status; + }; + + $scope.selectAll = { + positions: { + table: { + values : true + }, + popup: { + names : true, + values : true + }, + label: { + names : true, + values : true + } + }, + segments: { + table: { + values : true + }, + popup: { + names : true, + values : true + }, + label: { + names : true, + values : true + } + }, + tracks: { + table: { + values : true + } + } + }; + + locale.ready('spatial').then(function(){ + $scope.headerMenus = setMenus(); + }); + + $scope.selectMenu = function(menu){ + $scope.selectedMenu = menu; + }; + + $scope.dropItem = function(item, list){ + var itemIndex = list.indexOf(item); + if(itemIndex !== 1){ + list.splice(itemIndex, 1); + } + return item; + }; + + $scope.isDisabledName = function(visibilityType,contentType,name) { + if($scope.configModel.visibilitySettings[visibilityType][contentType].values.length > 0) { + return !$scope.configModel.visibilitySettings[visibilityType][contentType].values.includes(name); + } + return true; + }; + + $scope.isAllNamesDisabled = function(visibilityType,contentType) { + return $scope.configModel.visibilitySettings[visibilityType][contentType].values.length === 0; + }; + + $scope.onListItemChange = function(columnType,visibilityType,contentType){ + var contentTypeLocal = contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase(); + var currentVisibilities = $scope.configModel.visibilitySettings[visibilityType][contentTypeLocal]; + var checked = this.checked === true ? 1 : -1; + + if(columnType === 'values'){ + if(angular.isDefined(currentVisibilities.values) && currentVisibilities.values.length + checked === currentVisibilities.order.length){ + $scope.selectAll[visibilityType][contentType].values = true; + }else{ + $scope.selectAll[visibilityType][contentType].values = false; + } + + if(angular.isDefined($scope.configModel.visibilitySettings[visibilityType][contentTypeLocal].names)){ + if(checked === -1) { + var itemIndex = $scope.configModel.visibilitySettings[visibilityType][contentTypeLocal].names.indexOf(this.$parent.attr.value); + if(itemIndex !== -1){ + $scope.configModel.visibilitySettings[visibilityType][contentTypeLocal].names.splice(itemIndex, 1); + } + } + var valuesLength = currentVisibilities.values.length + checked; + if(angular.isDefined(currentVisibilities.names) && currentVisibilities.names.length === valuesLength && valuesLength > 0){ + $scope.selectAll[visibilityType][contentType].names = true; + }else{ + $scope.selectAll[visibilityType][contentType].names = false; + } + } + } + else{ + if(angular.isDefined(currentVisibilities.names) && currentVisibilities.names.length + checked === currentVisibilities.values.length){ + $scope.selectAll[visibilityType][contentType].names = true; + }else{ + $scope.selectAll[visibilityType][contentType].names = false; + } + } + }; + + $scope.selectAllNamesChange = function(visibilityType,contentType,newVal){ + var contentTypeLocal = contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase(); + var currentVisibilities = $scope.configModel.visibilitySettings[visibilityType][contentTypeLocal]; + currentVisibilities.names = []; + if($scope.selectAll[visibilityType][contentType].names){ + angular.forEach(currentVisibilities.values, function(item) { + currentVisibilities.names.push(item); + }); + } + }; + $scope.selectAllChange = function(visibilityType,contentType,newVal){ + var contentTypeLocal = contentType.toLowerCase() === 'label' ? contentType.toLowerCase() + 's' : contentType.toLowerCase(); + var currentVisibilities = $scope.configModel.visibilitySettings[visibilityType][contentTypeLocal]; + currentVisibilities.values = []; + if($scope.selectAll[visibilityType][contentType].values){ + angular.forEach(currentVisibilities.order, function(item) { + currentVisibilities.values.push(item); + }); + } + else{ + $scope.selectAll[visibilityType][contentType].names = this.checked; + $scope.configModel.visibilitySettings[visibilityType][contentTypeLocal].names = []; + } + }; +}); + diff --git a/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/layerPanel/layerTreeModel.js b/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/layerPanel/layerTreeModel.js index a8a447677..6c6059f0e 100644 --- a/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/layerPanel/layerTreeModel.js +++ b/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/layerPanel/layerTreeModel.js @@ -1,591 +1,649 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').factory('TreeModel',function(locale, mapService, userService) { - - function TreeModel(){} - - var baseLayerCounter = 0; - - //Build tree node for OSM based layers - var buildOsmBasedNodes = function(src){ - if (src.isBaseLayer === true){ - baseLayerCounter += 1; - } - - var node = { - title: src.title, - selected: src.isBaseLayer === false ? undefined : (baseLayerCounter === 1 ? true : false), - extraClasses: src.isBaseLayer === true ? 'layertree-basemap' : undefined, - data: { - type: src.type, - isBaseLayer: src.isBaseLayer, - title: src.title - } - }; - - return node; - }; - - //Build tree node for Bing based layers - var buildBingBasedNodes = function(src){ - if (angular.isDefined(src.apiKey) && src.apiKey !== ''){ - baseLayerCounter += 1; - - var layerTitle = locale.getString('spatial.layer_tree_' + src.title); - var node = { - title: layerTitle, - selected: baseLayerCounter === 1 ? true : false, - extraClasses: 'layertree-basemap', - data: { - type: src.type, - isBaseLayer: true, - title: layerTitle, - layerGeoName: src.layerGeoName, - apiKey: src.apiKey - } - }; - - return node; - } - }; - - //Build a tree node for WMS layers - var buildWmsNode = function(src){ - var stylesForObject = []; - var selected = false; - if (angular.isDefined(src.styles)){ - stylesForObject = checkWmStylesAvailability(src.styles); - } - - var filtersForObject; - //This is for user areas only - if (angular.isDefined(src.filters)){ - filtersForObject = buildCqlContext(src.filters, 'USERAREAS'); - } - - //This is for system areas and port data - if (angular.isDefined(src.groupFilter)){ - filtersForObject = buildCqlContext(src.groupFilter, 'REFDATA'); - } - - if (src.isBaseLayer === true){ - baseLayerCounter += 1; - if (baseLayerCounter === 1){ - selected = true; - } - } - - if (!angular.isDefined(src.cql)){ - src.cql = null; - } - - //Final node - var mapExtent = mapService.map.getView().getProjection().getExtent(); - var node = { - title: src.title, - selected: selected, - extraClasses: src.isBaseLayer === true ? 'layertree-basemap' : undefined, - data: { - type: 'WMS', - title: src.title, - typeName: angular.isDefined(src.typeName) ? src.typeName : undefined, - isBaseLayer: src.isBaseLayer, - attribution: src.shortCopyright, - longAttribution: angular.isDefined(src.longCopyright) ? src.longCopyright : undefined, - url: src.url, - serverType: angular.isDefined(src.serverType) ? src.serverType : undefined, - params: { - time_: (new Date()).getTime(), - 'LAYERS': src.layerGeoName, - 'TILED': true, - 'TILESORIGIN': mapExtent[0] + ',' + mapExtent[1], - 'STYLES': angular.isDefined(stylesForObject) === true ? stylesForObject[0] : '', - 'cql_filter': src.cql - } - } - }; - - if (angular.isDefined(filtersForObject)){ - node.data.contextItems = filtersForObject; - } - - - var menuSep = { - className: 'context-menu-item context-menu-separator context-menu-not-selectable' - }; - - if (stylesForObject.length > 1){ - if (angular.isDefined(node.data.contextItems)){ - _.extend(node.data.contextItems, {sep1: menuSep}); - _.extend(node.data.contextItems, stylesForObject[1]); - } else { - node.data.contextItems = stylesForObject[1]; - } - } - - if ((angular.isDefined(src.areaType) && src.areaType === 'SYSAREA') || (angular.isDefined(src.typeName) && (src.typeName === 'PORT' || src.typeName === 'PORTAREA'))){ - _.extend(node.data.contextItems, {sep2: menuSep}); - var settings = { - settingsMenu: { - name: locale.getString('spatial.layer_tree_tip_context_menu'), - icon: function(opt, $itemElement, itemKey, item){ - $itemElement.html('' + item.name); - return 'context-menu-icon-settings'; - } - } - }; - _.extend(node.data.contextItems, settings); - } - - if (angular.isDefined(node.data.contextItems)){ - node.data.contextTip = locale.getString('spatial.layer_tree_tip_context_menu'); - _.extend(node.data.contextItems, {sep3: menuSep}); - } - - return node; - }; - - //Build area nodes - var buildAreaNode = function(src){ - var node; - if (src.areaType === 'SYSAREA'){ - if (angular.isDefined(src.cql)){ - src.groupFilter = { - baseCql: src.cql, - allCql: null - }; - } - node = buildWmsNode(src); - } else if (src.areaType === 'AREAGROUP'){ - node = buildUserAreaGroupNode(src); - } else { - node = buildUserAreaNode(src); - } - - return node; - }; - - //User area group specific node - var buildUserAreaGroupNode = function(src){ - var cql = "(user_name = '" + userService.getUserName() + "' OR scopes ilike '%#" + userService.getCurrentContext().scope.scopeName +"#%')"; - - var newDef = { - isBaseLayer: src.isBaseLayer, - layerGeoName: src.layerGeoName, - longCopyright: src.longCopyright, - shortCopyright: src.shortCopyright, - serverType: src.serverType, - styles: src.styles, - type: src.url, - url: src.url, - title: src.title, - cql: cql + ' AND ' + src.cql_all + ' AND ' +src.cql_active, - filters: { - baseCql: cql, - allCql: src.cql_all, - activeCql: src.cql_active - } - }; - - return buildWmsNode(newDef); - }; - - //User area specific node - var buildUserAreaNode = function(src){ - var filter; - if (src.areaType === 'USERAREA'){ - filter = 'gid = ' + src.gid; - } else { - filter = "user_name = '" + userService.getUserName() + "' AND " + src.cql; - } - - var newDef = { - isBaseLayer: src.isBaseLayer, - layerGeoName: src.layerGeoName, - longCopyright: src.longCopyright, - shortCopyright: src.shortCopyright, - serverType: src.serverType, - styles: src.styles, - type: src.url, - url: src.url, - title: src.title, - cql: filter - }; - - return buildWmsNode(newDef); - }; - - //Check how many WMS styles are available, set the default style and build the style context menu - var checkWmStylesAvailability = function(styles){ - var finalStyles = []; - var styleKeys = Object.keys(styles); - var defaultStyle = styles[styleKeys[0]]; - - finalStyles.push(defaultStyle); - if (styleKeys.length > 1){ - var contextMenuItems = buildStyleContext(styles, defaultStyle); - finalStyles.push(contextMenuItems); - } - - return finalStyles; - }; - - //Cql options for user area group layers (type is USERAREAS), and for ref data (type is REFDATA) - var buildCqlContext = function(filters, type){ - var cqlContext = { - cqlHeader: { - name: locale.getString('spatial.layer_tree_context_menu_show_title'), - disabled: true, - className: 'layer-menu-header' - } - }; - - var name_1, name_2, cql_1, cql_2; - if (type === 'USERAREAS'){ - name_1 = locale.getString('spatial.layer_tree_context_menu_active_areas_title'); - cql_1 = filters.baseCql + ' AND ' + filters.allCql + ' AND ' + filters.activeCql; - name_2 = locale.getString('spatial.layer_tree_context_menu_all_areas_title'); - cql_2 = filters.baseCql + ' AND ' + filters.allCql; - } else { - name_1 = locale.getString('spatial.layer_tree_context_menu_active_groups_title'); - cql_1 = filters.baseCql; - name_2 = locale.getString('spatial.layer_tree_context_menu_all_groups_title'); - cql_2 = filters.allCql; - } - - cqlContext.activeAreas = { - name: name_1, - type: 'radio', - radio: 'filter', - value: 'activeAreas', - cql: cql_1, - selected: true - }; - - cqlContext.allAreas = { - name: name_2, - type: 'radio', - radio: 'filter', - value: 'allAreas', - cql: cql_2, - selected: false - }; - - return cqlContext; - }; - - //Build style contextmenu object - var buildStyleContext = function(styles, defaultStyle){ - var styleContext = { - styleHeader: { - name: locale.getString('spatial.layer_tree_context_menu_style_title'), - disabled: true, - className: 'layer-menu-header' - } - }; - - if (angular.isDefined(styles.geom)){ - styleContext.geomStyle = { - name: locale.getString('spatial.layer_tree_context_menu_geom_style'), - type: 'radio', - radio: 'style', - value: styles.geom, - selected: styles.geom === defaultStyle ? true : false - }; - } - - if (angular.isDefined(styles.labelGeom)){ - styleContext.geomLabelStyle = { - name: locale.getString('spatial.layer_tree_context_menu_geom_label_style'), - type: 'radio', - radio: 'style', - value: styles.labelGeom, - selected: styles.labelGeom === defaultStyle ? true : false - }; - } - - if (angular.isDefined(styles.label)){ - styleContext.labelStyle = { - name: locale.getString('spatial.layer_tree_context_menu_label_style'), - type: 'radio', - radio: 'style', - value: styles.label, - selected: styles.label === defaultStyle ? true : false - }; - } - - return styleContext; - }; - - var loopAndBuildNode = function(nodeFromServer){ - var nodeArray = []; - for (var i = 0; i < nodeFromServer.length; i++){ - var def = nodeFromServer[i]; - switch(def.type){ - case 'WMS': - if (angular.isDefined(def.areaType)){ - nodeArray.push(buildAreaNode(def)); - } else { - nodeArray.push(buildWmsNode(def)); - } - break; - case 'OSM': - nodeArray.push(buildOsmBasedNodes(def)); - break; - case 'OSEA': - nodeArray.push(buildOsmBasedNodes(def)); - break; - case 'BING': - var node = buildBingBasedNodes(def); - if (angular.isDefined(node)){ - nodeArray.push(node); - } - break; - } - } - - return nodeArray; - }; - - //Check if ports and port areas have been configured with group selection - var setAdditionalPortSettings = function(data){ - angular.forEach(data, function(rec) { - if (angular.isDefined(rec.cql)){ - rec.groupFilter = { - baseCql: rec.cql, - allCql: null - }; - } - }); - - return data; - }; - - TreeModel.prototype.fromConfig = function(config){ - var tree = []; - - //Ports - if (angular.isDefined(config.port)){ - var portNodes = loopAndBuildNode(setAdditionalPortSettings(config.port)); - tree.push({ - title: locale.getString('spatial.layer_tree_ports'), - folder: true, - expanded: false, - children: portNodes - }); - } - - //Areas - if (angular.isDefined(config.areas) && config.areas.length > 0){ - var areaNodes = loopAndBuildNode(config.areas); - var areaFolder = { - title: locale.getString('spatial.layer_tree_areas'), - folder: true, - expanded: false, - children: areaNodes - }; - - tree.push(areaFolder); - } - - //Additional cartography - if (angular.isDefined(config.additional)){ - var additionalNodes = loopAndBuildNode(config.additional); - tree.push({ - title: locale.getString('spatial.layer_tree_additional_cartography'), - folder: true, - expanded: false, - children: additionalNodes - }); - } - - //Baselayers - if (angular.isDefined(config.baseLayers)){ - var baseNodes = loopAndBuildNode(config.baseLayers); - tree.push({ - title: locale.getString('spatial.layer_tree_background_layers'), - folder: true, - expanded: true, - unselectable: true, - hideCheckbox: true, - extraClasses: 'layertree-baselayer-node', - key: 'basemap', - children: baseNodes - }); - } - - baseLayerCounter = 0; - return tree; - }; - - //Build vector nodes for positions and segments - var buildVectorNodes = function(type, data){ - var title, lyrType, longCopyright, extraCls; - var selected = false; - - switch (type) { - case 'positions': - title = locale.getString('spatial.layer_tree_positions'); - selected = true; - lyrType = 'vmspos'; - longCopyright = locale.getString('spatial.vms_positions_long_copyright'); - break; - case 'segments': - title = locale.getString('spatial.layer_tree_segments'); - lyrType = 'vmsseg'; - longCopyright = locale.getString('spatial.vms_positions_long_copyright'); - break; - case 'activities': - title = locale.getString('spatial.layer_tree_activities'); - lyrType = 'ers'; - longCopyright = locale.getString('spatial.activities_long_copyright'); - break; - default: - break; - } - - var node = { - title: title, - selected: selected, - extraClasses: extraCls, - data: { - excludeDnd: true, - title: title, - type: lyrType, - isBaseLayer: false, - optionsEnabled: true, - optionsTip: 'spatial.layer_tree_tip_context_menu', - labelEnabled: true, - labelTip: 'spatial.layer_tree_tip_label_vector', - longAttribution: longCopyright.length > 0 ? longCopyright : undefined, - geoJson: data - } - }; - - var childNodes = []; - - - if (type === 'activities'){ - node.data.optionsEnabled = false; //FIXME this should be removed when we implement conmtext menu options for activities layer - node.data.filterProperty = 'activityType'; - - var activityTypes = _.map(data.features, function(feat){ - return feat.properties.activityType; - }); - - activityTypes = _.sortBy(_.uniq(activityTypes), function(type){ - return type; - }); - - if (activityTypes.length > 0){ - angular.forEach(activityTypes, function(type){ - var abbr = locale.getString('abbreviations.activity_' + type); - childNodes.push({ - title: abbr !== "%%KEY_NOT_FOUND%%" ? abbr : type, - filterType: type, - type: 'ers-type', - excludeDnd: true, - selected: false - }); - }); - - node.children = childNodes; - } - } - - if (type === 'positions'){ - node.data.filterProperty = 'source'; - var sourceArray = _.map(data.features, function(feat){ - return feat.properties.source; - }); - - sourceArray = _.sortBy(_.uniq(sourceArray), function(src){ - return src; - }); - - if (sourceArray.length > 0){ - angular.forEach(sourceArray, function(source){ - childNodes.push({ - title: source, - filterType: source, - type: 'vmspos-type', - excludeDnd: true, - selected: true - }); - }); - - node.children = childNodes; - } - } - - return node; - }; - - //Build parent folder node for vms layers - TreeModel.prototype.nodeFromData = function(data){ - var finalNodes = []; - var vectorNodes = []; - //FIXME uncomment - if (data.movements.features.length > 0){ - vectorNodes.push(buildVectorNodes('positions', data.movements)); - } - if (data.segments.features.length > 0){ - vectorNodes.push(buildVectorNodes('segments', data.segments)); - } - - if (vectorNodes.length > 0){ - var node = { - title: locale.getString('spatial.layer_tree_vms'), - type: 'vmsdata', - folder: true, - expanded: true, - children: vectorNodes - }; - finalNodes.push(node); - } - - if (data.activities.features.length > 0){ - finalNodes.push(buildVectorNodes('activities', data.activities)); - } - - if (finalNodes.length > 0){ - return finalNodes; - } - - }; - - //Build node for alarms - TreeModel.prototype.nodeForAlarms = function(data){ - var longCopyright = locale.getString('spatial.alarms_long_copyright'); - var title = locale.getString('spatial.layer_tree_alarms'); - var node = { - title: title, - type: 'alarms', - folder: false, - selected: true, - extraClasses: 'layertree-alarms', - data: { - excludeDnd: true, - title: title, - type: 'alarms', - optionsEnabled: true, - optionsTip: 'spatial.layer_tree_tip_context_menu', - longAttribution: longCopyright.length > 0 ? longCopyright : undefined, - geoJson: data - } - }; - - return [node]; - }; - - return TreeModel; -}); +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').factory('TreeModel',function(locale, mapService, userService) { + + function TreeModel(){} + + var baseLayerCounter = 0; + + //Build tree node for OSM based layers + var buildOsmBasedNodes = function(src, layerConfig){ + if (src.isBaseLayer === true){ + baseLayerCounter += 1; + } + + var selectedOsmBaseNode = src.isBaseLayer === false ? undefined : (baseLayerCounter === 1 ? true : false); + + if (src.type === 'OSM' && layerConfig.hasOwnProperty('OSM')) { + selectedOsmBaseNode = layerConfig['OSM']; + } + + if (src.type === 'OSEA' && layerConfig.hasOwnProperty('OSEA')) { + selectedOsmBaseNode = layerConfig['OSEA']; + } + + var node = { + title: src.title, + selected: selectedOsmBaseNode, + extraClasses: src.isBaseLayer === true ? 'layertree-basemap' : undefined, + data: { + type: src.type, + isBaseLayer: src.isBaseLayer, + title: src.title + } + }; + + return node; + }; + + //Build tree node for Bing based layers + var buildBingBasedNodes = function(src, layerConfig){ + if (angular.isDefined(src.apiKey) && src.apiKey !== ''){ + baseLayerCounter += 1; + + var layerTitle = locale.getString('spatial.layer_tree_' + src.title); + var node = { + title: layerTitle, + selected: baseLayerCounter === 1 ? true : false, + extraClasses: 'layertree-basemap', + data: { + type: src.type, + isBaseLayer: true, + title: layerTitle, + layerGeoName: src.layerGeoName, + apiKey: src.apiKey + } + }; + + return node; + } + }; + + + //Build a tree node for WMS layers + var buildWmsNode = function(src, layerConfig){ + var stylesForObject = []; + var selected = false; + if (angular.isDefined(src.styles)){ + stylesForObject = checkWmStylesAvailability(src.styles); + } + + var filtersForObject; + //This is for user areas only + if (angular.isDefined(src.filters)){ + filtersForObject = buildCqlContext(src.filters, 'USERAREAS'); + } + + //This is for system areas and port data + if (angular.isDefined(src.groupFilter)){ + filtersForObject = buildCqlContext(src.groupFilter, 'REFDATA'); + } + + if (src.isBaseLayer === true){ + baseLayerCounter += 1; + if (baseLayerCounter === 1){ + selected = true; + } + } + + if (!angular.isDefined(src.cql)){ + src.cql = null; + } + + var finalSelected = false; + + switch(src.typeName) { + case 'PORT': + finalSelected = layerConfig.hasOwnProperty('PORT') ? layerConfig['PORT'] : selected; + break; + case'PORTAREA': + finalSelected = layerConfig.hasOwnProperty('PORTAREA') ? layerConfig['PORTAREA'] : selected; + break; + case'RFMO': + finalSelected = layerConfig.hasOwnProperty('RFMO') ? layerConfig['RFMO'] : selected; + break; + case'EEZ': + finalSelected = layerConfig.hasOwnProperty('EEZ') ? layerConfig['EEZ'] : selected; + break; + default: + finalSelected = selected; + } + + //Final node + var mapExtent = mapService.map.getView().getProjection().getExtent(); + var node = { + title: src.title, + selected: finalSelected, + extraClasses: src.isBaseLayer === true ? 'layertree-basemap' : undefined, + data: { + type: 'WMS', + title: src.title, + typeName: angular.isDefined(src.typeName) ? src.typeName : undefined, + isBaseLayer: src.isBaseLayer, + attribution: src.shortCopyright, + longAttribution: angular.isDefined(src.longCopyright) ? src.longCopyright : undefined, + url: src.url, + serverType: angular.isDefined(src.serverType) ? src.serverType : undefined, + params: { + time_: (new Date()).getTime(), + 'LAYERS': src.layerGeoName, + 'TILED': true, + 'TILESORIGIN': mapExtent[0] + ',' + mapExtent[1], + 'STYLES': angular.isDefined(stylesForObject) === true ? stylesForObject[0] : '', + 'cql_filter': src.cql + } + } + }; + + if (angular.isDefined(filtersForObject)){ + node.data.contextItems = filtersForObject; + } + + + var menuSep = { + className: 'context-menu-item context-menu-separator context-menu-not-selectable' + }; + + if (stylesForObject.length > 1){ + if (angular.isDefined(node.data.contextItems)){ + _.extend(node.data.contextItems, {sep1: menuSep}); + _.extend(node.data.contextItems, stylesForObject[1]); + } else { + node.data.contextItems = stylesForObject[1]; + } + } + + if ((angular.isDefined(src.areaType) && src.areaType === 'SYSAREA') || (angular.isDefined(src.typeName) && (src.typeName === 'PORT' || src.typeName === 'PORTAREA'))){ + _.extend(node.data.contextItems, {sep2: menuSep}); + var settings = { + settingsMenu: { + name: locale.getString('spatial.layer_tree_tip_context_menu'), + icon: function(opt, $itemElement, itemKey, item){ + $itemElement.html('' + item.name); + return 'context-menu-icon-settings'; + } + } + }; + _.extend(node.data.contextItems, settings); + } + + if (angular.isDefined(node.data.contextItems)){ + node.data.contextTip = locale.getString('spatial.layer_tree_tip_context_menu'); + _.extend(node.data.contextItems, {sep3: menuSep}); + } + + return node; + }; + + //Build area nodes + var buildAreaNode = function(src, layerConfig){ + var node; + if (src.areaType === 'SYSAREA'){ + if (angular.isDefined(src.cql)){ + src.groupFilter = { + baseCql: src.cql, + allCql: null + }; + } + node = buildWmsNode(src, layerConfig); + } else if (src.areaType === 'AREAGROUP'){ + node = buildUserAreaGroupNode(src, layerConfig); + } else { + node = buildUserAreaNode(src, layerConfig); + } + + return node; + }; + + //User area group specific node + var buildUserAreaGroupNode = function(src, layerConfig){ + var cql = "(user_name = '" + userService.getUserName() + "' OR scopes ilike '%#" + userService.getCurrentContext().scope.scopeName +"#%')"; + + var newDef = { + isBaseLayer: src.isBaseLayer, + layerGeoName: src.layerGeoName, + longCopyright: src.longCopyright, + shortCopyright: src.shortCopyright, + serverType: src.serverType, + styles: src.styles, + type: src.url, + url: src.url, + title: src.title, + cql: cql + ' AND ' + src.cql_all + ' AND ' +src.cql_active, + filters: { + baseCql: cql, + allCql: src.cql_all, + activeCql: src.cql_active + } + }; + + return buildWmsNode(newDef, layerConfig); + }; + + //User area specific node + var buildUserAreaNode = function(src, layerConfig){ + var filter; + if (src.areaType === 'USERAREA'){ + filter = 'gid = ' + src.gid; + } else { + filter = "user_name = '" + userService.getUserName() + "' AND " + src.cql; + } + + var newDef = { + isBaseLayer: src.isBaseLayer, + layerGeoName: src.layerGeoName, + longCopyright: src.longCopyright, + shortCopyright: src.shortCopyright, + serverType: src.serverType, + styles: src.styles, + type: src.url, + url: src.url, + title: src.title, + cql: filter + }; + + return buildWmsNode(newDef, layerConfig); + }; + + //Check how many WMS styles are available, set the default style and build the style context menu + var checkWmStylesAvailability = function(styles){ + var finalStyles = []; + var styleKeys = Object.keys(styles); + var defaultStyle = styles[styleKeys[0]]; + + finalStyles.push(defaultStyle); + if (styleKeys.length > 1){ + var contextMenuItems = buildStyleContext(styles, defaultStyle); + finalStyles.push(contextMenuItems); + } + + return finalStyles; + }; + + //Cql options for user area group layers (type is USERAREAS), and for ref data (type is REFDATA) + var buildCqlContext = function(filters, type){ + var cqlContext = { + cqlHeader: { + name: locale.getString('spatial.layer_tree_context_menu_show_title'), + disabled: true, + className: 'layer-menu-header' + } + }; + + var name_1, name_2, cql_1, cql_2; + if (type === 'USERAREAS'){ + name_1 = locale.getString('spatial.layer_tree_context_menu_active_areas_title'); + cql_1 = filters.baseCql + ' AND ' + filters.allCql + ' AND ' + filters.activeCql; + name_2 = locale.getString('spatial.layer_tree_context_menu_all_areas_title'); + cql_2 = filters.baseCql + ' AND ' + filters.allCql; + } else { + name_1 = locale.getString('spatial.layer_tree_context_menu_active_groups_title'); + cql_1 = filters.baseCql; + name_2 = locale.getString('spatial.layer_tree_context_menu_all_groups_title'); + cql_2 = filters.allCql; + } + + cqlContext.activeAreas = { + name: name_1, + type: 'radio', + radio: 'filter', + value: 'activeAreas', + cql: cql_1, + selected: true + }; + + cqlContext.allAreas = { + name: name_2, + type: 'radio', + radio: 'filter', + value: 'allAreas', + cql: cql_2, + selected: false + }; + + return cqlContext; + }; + + //Build style contextmenu object + var buildStyleContext = function(styles, defaultStyle){ + var styleContext = { + styleHeader: { + name: locale.getString('spatial.layer_tree_context_menu_style_title'), + disabled: true, + className: 'layer-menu-header' + } + }; + + if (angular.isDefined(styles.geom)){ + styleContext.geomStyle = { + name: locale.getString('spatial.layer_tree_context_menu_geom_style'), + type: 'radio', + radio: 'style', + value: styles.geom, + selected: styles.geom === defaultStyle ? true : false + }; + } + + if (angular.isDefined(styles.labelGeom)){ + styleContext.geomLabelStyle = { + name: locale.getString('spatial.layer_tree_context_menu_geom_label_style'), + type: 'radio', + radio: 'style', + value: styles.labelGeom, + selected: styles.labelGeom === defaultStyle ? true : false + }; + } + + if (angular.isDefined(styles.label)){ + styleContext.labelStyle = { + name: locale.getString('spatial.layer_tree_context_menu_label_style'), + type: 'radio', + radio: 'style', + value: styles.label, + selected: styles.label === defaultStyle ? true : false + }; + } + + return styleContext; + }; + + var loopAndBuildNode = function(nodeFromServer, layerConfig){ + var nodeArray = []; + for (var i = 0; i < nodeFromServer.length; i++){ + var def = nodeFromServer[i]; + switch(def.type){ + case 'WMS': + if (angular.isDefined(def.areaType)){ + nodeArray.push(buildAreaNode(def, layerConfig)); + } else { + nodeArray.push(buildWmsNode(def, layerConfig)); + } + break; + case 'OSM': + nodeArray.push(buildOsmBasedNodes(def, layerConfig)); + break; + case 'OSEA': + nodeArray.push(buildOsmBasedNodes(def, layerConfig)); + break; + case 'BING': + var node = buildBingBasedNodes(def, layerConfig); + if (angular.isDefined(node)){ + nodeArray.push(node); + } + break; + } + } + + return nodeArray; + }; + + //Check if ports and port areas have been configured with group selection + var setAdditionalPortSettings = function(data){ + angular.forEach(data, function(rec) { + if (angular.isDefined(rec.cql)){ + rec.groupFilter = { + baseCql: rec.cql, + allCql: null + }; + } + }); + + return data; + }; + + TreeModel.prototype.fromConfig = function(config, layerConfig){ + var tree = []; + + //Ports + if (angular.isDefined(config.port)){ + var portNodes = loopAndBuildNode(setAdditionalPortSettings(config.port), layerConfig); + tree.push({ + title: locale.getString('spatial.layer_tree_ports'), + folder: true, + expanded: false, + children: portNodes, + data: { + type: 'PortMain' + } + }); + } + + //Areas + if (angular.isDefined(config.areas) && config.areas.length > 0){ + var areaNodes = loopAndBuildNode(config.areas, layerConfig); + var areaFolder = { + title: locale.getString('spatial.layer_tree_areas'), + folder: true, + expanded: false, + children: areaNodes, + data: { + type: 'AreasMain' + } + }; + + tree.push(areaFolder); + } + + //Additional cartography + if (angular.isDefined(config.additional)){ + var additionalNodes = loopAndBuildNode(config.additional, layerConfig); + tree.push({ + title: locale.getString('spatial.layer_tree_additional_cartography'), + folder: true, + expanded: false, + children: additionalNodes, + data: { + type: 'CartographyMain' + } + }); + } + + //Baselayers + if (angular.isDefined(config.baseLayers)){ + var baseNodes = loopAndBuildNode(config.baseLayers, layerConfig); + tree.push({ + title: locale.getString('spatial.layer_tree_background_layers'), + folder: true, + expanded: true, + unselectable: true, + hideCheckbox: true, + extraClasses: 'layertree-baselayer-node', + key: 'basemap', + children: baseNodes, + data: { + type: 'BaseMain' + } + }); + } + + baseLayerCounter = 0; + return tree; + }; + + //Build vector nodes for positions and segments + var buildVectorNodes = function(type, data, layerConfiguration){ + var title, lyrType, longCopyright, extraCls; + var selected = false; + + switch (type) { + case 'positions': + title = locale.getString('spatial.layer_tree_positions'); + selected = layerConfiguration.hasOwnProperty('vmspos') ? layerConfiguration['vmspos'] : true; + lyrType = 'vmspos'; + longCopyright = locale.getString('spatial.vms_positions_long_copyright'); + break; + case 'segments': + selected = layerConfiguration.hasOwnProperty('vmsseg') ? layerConfiguration['vmsseg'] : selected; + title = locale.getString('spatial.layer_tree_segments'); + lyrType = 'vmsseg'; + longCopyright = locale.getString('spatial.vms_positions_long_copyright'); + break; + case 'activities': + title = locale.getString('spatial.layer_tree_activities'); + lyrType = 'ers'; + longCopyright = locale.getString('spatial.activities_long_copyright'); + break; + default: + break; + } + + var node = { + title: title, + selected: selected, + extraClasses: extraCls, + data: { + excludeDnd: true, + title: title, + type: lyrType, + isBaseLayer: false, + optionsEnabled: true, + optionsTip: 'spatial.layer_tree_tip_context_menu', + labelEnabled: true, + labelTip: 'spatial.layer_tree_tip_label_vector', + longAttribution: longCopyright.length > 0 ? longCopyright : undefined, + geoJson: data + } + }; + + var childNodes = []; + + + if (type === 'activities'){ + node.data.optionsEnabled = false; //FIXME this should be removed when we implement conmtext menu options for activities layer + node.data.filterProperty = 'activityType'; + + var activityTypes = _.map(data.features, function(feat){ + return feat.properties.activityType; + }); + + activityTypes = _.sortBy(_.uniq(activityTypes), function(type){ + return type; + }); + + if (activityTypes.length > 0){ + angular.forEach(activityTypes, function(type){ + var selectedByType = false; + if (type === 'ARRIVAL') { + selectedByType = layerConfiguration.hasOwnProperty('ARRIVAL') ? layerConfiguration['ARRIVAL'] : selectedByType; + } else if (type === 'DEPARTURE') { + selectedByType = layerConfiguration.hasOwnProperty('DEPARTURE') ? layerConfiguration['DEPARTURE'] : selectedByType; + } else if (type === 'FISHING_OPERATION') { + selectedByType = layerConfiguration.hasOwnProperty('FISHING_OPERATION') ? layerConfiguration['FISHING_OPERATION'] : selectedByType; + } + var abbr = locale.getString('abbreviations.activity_' + type); + childNodes.push({ + title: abbr !== "%%KEY_NOT_FOUND%%" ? abbr : type, + filterType: type, + type: 'ers-type', + excludeDnd: true, + selected: selectedByType + }); + }); + + node.children = childNodes; + } + } + + if (type === 'positions'){ + node.data.filterProperty = 'source'; + var sourceArray = _.map(data.features, function(feat){ + return feat.properties.source; + }); + + sourceArray = _.sortBy(_.uniq(sourceArray), function(src){ + return src; + }); + + var selectedVmsPosType = false; + if (layerConfiguration.hasOwnProperty('vmspos') && layerConfiguration['vmspos'] === false) { + selectedVmsPosType = false; + } else { + selectedVmsPosType = layerConfiguration.hasOwnProperty('vmspos-type') ? layerConfiguration['vmspos-type'] : false; + } + + if (sourceArray.length > 0){ + angular.forEach(sourceArray, function(source){ + childNodes.push({ + title: source, + filterType: source, + type: 'vmspos-type', + excludeDnd: true, + selected: selectedVmsPosType + }); + }); + + node.children = childNodes; + } + } + + return node; + }; + + //Build parent folder node for vms layers + TreeModel.prototype.nodeFromData = function(data, layerConfiguration){ + var finalNodes = []; + var vectorNodes = []; + //FIXME uncomment + if (data.movements.features.length > 0){ + vectorNodes.push(buildVectorNodes('positions', data.movements, layerConfiguration)); + } + if (data.segments.features.length > 0){ + vectorNodes.push(buildVectorNodes('segments', data.segments, layerConfiguration)); + } + + if (vectorNodes.length > 0){ + var node = { + title: locale.getString('spatial.layer_tree_vms'), + type: 'vmsdata', + folder: true, + expanded: true, + children: vectorNodes + }; + finalNodes.push(node); + } + + if (data.activities.features.length > 0){ + finalNodes.push(buildVectorNodes('activities', data.activities, layerConfiguration)); + } + + if (finalNodes.length > 0){ + return finalNodes; + } + + }; + + //Build node for alarms + TreeModel.prototype.nodeForAlarms = function(data){ + var longCopyright = locale.getString('spatial.alarms_long_copyright'); + var title = locale.getString('spatial.layer_tree_alarms'); + var node = { + title: title, + type: 'alarms', + folder: false, + selected: true, + extraClasses: 'layertree-alarms', + data: { + excludeDnd: true, + title: title, + type: 'alarms', + optionsEnabled: true, + optionsTip: 'spatial.layer_tree_tip_context_menu', + longAttribution: longCopyright.length > 0 ? longCopyright : undefined, + geoJson: data + } + }; + + return [node]; + }; + + return TreeModel; +}); diff --git a/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.html b/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.html index 792776338..777e66cc3 100644 --- a/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.html +++ b/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.html @@ -1,298 +1,301 @@ - -
- -
-
-
- -
-
- {{'spatial.map_label_auto_refresh_status' | i18n }} - -
- - - - - -
-
- - - - - -
-
-
-
-
- - - -
-
-
-
- -
- -
-
- - -
-
- {{'spatial.map_tip_bookmarks' | i18n}} - - - -
-
- -
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
{{'spatial.map_bookmarks_table_name_header' | i18n}}
{{'spatial.table_no_data' | i18n}}
{{bookmark.name}} - - -
-
-
-
-
-
- - -
-
-
-
-
- {{'spatial.more_details' | i18n}} -
- -
-
- -
-
-
- {{'spatial.map_measure_window_title' | i18n}} - - - -
-
-
-
- - -
-
- -
- -
{{'spatial.reports_form_vms_field_label_speed_unit_knots' | i18n }}
-
-
-
- - -
-
-
- - - -
-
-
- {{'spatial.map_print_window_title' | i18n}} - - - -
-
-
- - - - - -
-
-
-
- -
-
+ +
+ +
+
+
+ +
+
+ {{'spatial.map_label_auto_refresh_status' | i18n }} + +
+ + + + + +
+
+ + + + + +
+
+ +
+
+
+
+
+ + + +
+
+
+
+ +
+ +
+
+ + +
+
+ {{'spatial.map_tip_bookmarks' | i18n}} + + + +
+
+ +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
{{'spatial.map_bookmarks_table_name_header' | i18n}}
{{'spatial.table_no_data' | i18n}}
{{bookmark.name}} + + +
+
+
+
+
+
+ + +
+
+
+
+
+ {{'spatial.more_details' | i18n}} +
+ +
+
+ +
+
+
+ {{'spatial.map_measure_window_title' | i18n}} + + + +
+
+
+
+ + +
+
+ +
+ +
{{'spatial.reports_form_vms_field_label_speed_unit_knots' | i18n }}
+
+
+
+ + +
+
+
+ + + +
+
+
+ {{'spatial.map_print_window_title' | i18n}} + + + +
+
+
+ + + + + +
+
+
+
+ +
+
diff --git a/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.js b/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.js index 8a1b85fcf..2f93bfce2 100644 --- a/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.js +++ b/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.js @@ -282,6 +282,7 @@ angular.module('unionvmsWeb').controller('MapCtrl',function($log, $scope, locale var payload = new MapFishPayload(); var positions = payload.getIconPayload('positions'); + var activities = payload.getIconPayload('activity'); var segments = payload.getIconPayload('segments'); var alarms = payload.getIconPayload('alarms'); @@ -292,6 +293,10 @@ angular.module('unionvmsWeb').controller('MapCtrl',function($log, $scope, locale iconPayload.positions = positions; } + if (angular.isDefined(activities) && angular.isDefined(mapService.getLayerByType('ers')) && mapService.getLayerByType('ers').get('visible')){ + iconPayload.activities = activities; + } + if (angular.isDefined(segments) && angular.isDefined(mapService.getLayerByType('vmsseg')) && mapService.getLayerByType('vmsseg').get('visible')){ iconPayload.segments = segments; } diff --git a/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.less b/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.less index b882c5167..32140859f 100644 --- a/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.less +++ b/unionvms-web/app/partial/spatial/liveViewPanel/mapPanel/mapPanel.less @@ -1,813 +1,820 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -#mapPanelContainer{ - position: relative; - &.fullscreen{ - &, - & .map-container, - & #map { - width: 100% !important; - height: 100% !important; - } - } -} - -.map-container{ - /*width: 100%; - height: 100%;*/ - min-height: 30px; - /*margin-left: 3px;*/ - .map-over-btn { - z-index: 1035; - position: absolute; - top: 57px; - width: 100%; - text-align: center; - pointer-events: none; - button { - color: @primaryColor; - pointer-events: initial; - } - .fa { - color: red; - } - } -} - -.map { - width: 100%; - min-width: 992px; //According to header.less - overflow: hidden; - height: 100%; - display: block; - position: relative; -} - -.map:focus { - outline: 0px solid transparent !important; -} - - .modal-lg { - width: 1192px; - } - -//Map top Toolbar -#areaMap-toolbar, -#map-toolbar { - position: absolute; - width: 100%; - min-width: 992px; //According to header.less - margin: auto; - display: inline-flex; - flex-wrap: nowrap; - z-index: 1035; - background-color: rgba(54, 54, 54, 0.3); - height: 50px; - line-height: 50px; - justify-content: space-between; - > div { - padding: 0 3px; - } - .btn-group { - margin-left: 6px; - .btn { - padding: 0; - } - } - .btn-group-left, - .btn-group-right { - padding: 0; - padding-left: 4px; - >div button { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 2px; - color: @profileColor_blue; - font-size: 14px; - background-color: #fff; - border: solid 1px #c2c9cc; - border-radius: 2px; - box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.09); - &:focus, - &.active, - &:active, - &:hover { - background-color: #f2f2f2; - } - } - >div button:first-child { - margin-left: -2px; - } - } - .btn-group-left { - text-align: left; - .combo-report-history { - vertical-align: middle; - margin-left: 7px; - width: 150px; - display: inline-block; - line-height: 20px; - .dropdown-toggle { - height: 25px; - .dropdowntext { - line-height: 16px; - } - } - } - .refresh-btn { - border-top-left-radius: 0 !important; - border-bottom-left-radius: 0 !important; - margin-left: 0 !important; - } - .refresh-container { - margin-top: 3px; - height: 25px; - line-height: 22px; - border-right: 0; - padding-right: 5px; - padding-left: 5px; - span { - color: @profileColor_darkgray; - font-weight: bold; - } - &.disabled { - cursor: default; - .toggle-switch { - background-color: #aaa; - cursor: default; - pointer-events: none; - div { - pointer-events: none; - cursor: default; - } - span { - pointer-events: none; - cursor: default; - } - > div > span.knob { - pointer-events: none; - background-color: inherit; - } - } - } - &:active, - &:focus, - &:hover{ - background-color: white; - cursor: default; - } - .toggle-switch { - min-width: 42px; - width: 20px; - margin-bottom: 2px; - .toggle-switch-animate { - width: 150%; - height: 15px; - > span { - font-size: 12px; - padding: 0 10px 0 2px; - line-height: 15px; - } - .switch-left { - background-color: @profileColor_green; - color: #fff; - } - .switch-right { - background-color: @profileColor_gray; - color: #000; - } - } - } - } - } - .btn-group-right { - text-align: right; - padding-right: 8px; - display: flex; - align-items: center; - } - .alarms-icon { - color: @errorColor; - } -} - -.btn-fullscreen { - span { - font-size: 12px; - font-weight: 100; - } -} - -//Map bottom bar -.map-bottom{ - width: 100%; - min-height: 30px; - margin-left: 3px; - border: 1px solid #DDD; - line-height: 25px; - > .row { - margin-left: 0; - } -} - -//OL Controls -.ol-control { - padding: 0; - border-radius: 0; - margin: 0; - &, - &:active, - &:hover { - background-color: rgba(255,255,255,0); - } - button { - width: 25px; - height: 25px; - color: @profileColor_blue; - border: solid 1px #c2c9cc; - border-radius: 2px; - box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.09); - font-size: 14px; - &, - &:focus, - &:active { - background-color: #fff; - &:hover { - background-color: #f2f2f2; - } - } - } -} - -//Zoom -.ol-zoom-right-side { - top: 7px; - right: 7px; - left: auto; -} - -.ol-zoom-liveview { - top: 57px; - right: 7px; - left: auto; -} - -//Reset cql -.ol-resetCql { - top: 65px; -} - -.ol-resetCql-default { - left: 7px; -} - -.ol-resetCql-right-side { - top: 144px; - right: 7px; - float: right; -} - -.ol-resetCql-right-side-with-switcher { - top: 202px; - right: 7px; - float: right; -} - -//Scale line -.scale-line { - display: inline-block; - height: 20px; -} - -.ol-scale-line { - bottom: 5px; - left: 10px; - background-color: #ecf0f1 !important; - border: 1px solid @profileColor_gray; - padding: 5px; -} - -.ol-scale-line-inner { - height: 15px; - line-height: 11px; - font-weight: bold; - font-size: 12px !important; - color: @profileColor_blue !important; - border-color: @profileColor_blue !important; -} - -.ol-dragzoom { - border-color: @primaryColor; - border-width: 1px; - background-color: rgba(255,255,255,0.4); -} - -//Mouse coordinates -.mouse-position { - display: inherit; - text-align: right; - color: white; - font-size: 18px; - margin-right: 20px; -} - -//Attribution -.ol-attribution { - display: inline-table; - bottom: 5px !important; - &.reporting-map { - margin-left: 180px; - } - ul { - line-height: 12px; - } - li { - font-size: 12px !important; - position: relative; - } - &, - &:not(.ol-collapsed){ - background-color: transparent; - } -} - -//History -.ol-history { - top: 115px; - right: 7px; -} - -.ol-history-back { - border-radius: 2px 2px 0px 0px !important; -} - -.ol-history-forward { - border-radius: 0px 0px 2px 2px !important; -} - -//Full extent -.ol-zoom-extent { - &, - &.ol-touch { - top: 173px !important; - right: 7px; - left: auto; - } -} - -.ol-zoomextent-areamap { - top: 115px; - right: 7px; -} - -//Toolbar map toolbar controls -.btn-toolbar { - width: 25px !important; - height: 25px !important; -} - -/* -.btn-toolbar:focus { - background-color: rgba(0,60,136,0.5); -} - -.btn-toolbar.active { - background-color: rgba(0,60,136,0.7) !important; -} - -.btn-toolbar:hover { - background-color: rgba(0,60,136,0.7) !important; -}*/ - -//Vector labels -.vector-label { - background-color: white; - -webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); - filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); - border-radius: 5px; - padding: 3px 3px 1px 3px; - font-size: 12px; - table{ - tr { - line-height: 13px; - td { - white-space: nowrap; - div { - overflow: hidden; - max-width: 200px; - text-overflow: ellipsis; - } - } - } - } - .close-icon { - color: #e21e27; - cursor: pointer; - } - .label-content { - padding-left: 0px; - padding-right: 0px; - } -} - -.vector-label-vmspos { - border-left: 8px solid @profileColor_blue; -} - -.vector-label-vmsseg { - border-left: 8px solid #50629e; -} - -.vector-label-ers { - border-left: 8px solid #1ca07a; -} - -//Info popup -.ol-popup { - display: none; - position: absolute; - background-color: white; - -webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); - filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); - padding: 15px 5px 15px 5px; - border-radius: 10px; - border: 1px solid #cccccc; - bottom: 12px; - left: -50px; - min-width: 280px; -} - -.ol-popup:after, .ol-popup:before { - top: 100%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.ol-popup:after { - border-top-color: white; - border-width: 10px; - left: 48px; - margin-left: -10px; -} - -.ol-popup:before { - border-top-color: #cccccc; - border-width: 11px; - left: 48px; - margin-left: -11px; -} - -.ol-popup-closer { - text-decoration: none; - position: absolute; - top: 2px; - right: 8px; - span { - color: #e21e27; - } -} - -.ol-popup-details-btn { - //position: absolute; -} - -.ol-popup-header { - .header { - font-size: 14px; - font-weight: bold; - text-transform: uppercase; - color: #777; - background-color: white; - margin-right: 15px; - line-height: 30px; - } - .btn-container { - display: inline-block; - } -} - -.tabular-view, -.alarms-preview, -#popup-content { - .alarm-status { - display: inline-block; - border-radius: 4px; - padding: 2px 5px; - font-weight: bold; - text-transform: capitalize; - color: #fff; - font-size: 12px; - } -} - -.tabular-view { - .alarm-status { - text-align: center; - } -} - -.alarms-preview, -#popup-content{ - .alarm-status { - margin-top: 2px; - float: right; - } -} - -.alarms-preview, -#popup-content { - .name { - font-size: 14px; - font-weight: bold; - text-transform: uppercase; - } - - .alarm-header { - font-size: 14px; - font-weight: bold; - text-transform: uppercase; - color: #777; - background-color: white; - margin-right: 15px; - line-height: 30px; - } - - .info-content{ - margin-top: 10px; - font-size: 12px; - span.title { - font-weight: bold; - } - &.alarm { - margin-top: 0px; - } - .form-separator { - border-top: 1px solid #ddd; - margin-bottom: 5px; - margin-top: -5px; - } - .rule-definition { - width: 100%; - display: inline-block; - background-color: #e4e4e4; - border: 1px solid #aaa; - border-radius: 4px; - padding: 3px; - text-align: center; - max-height: 125px; - overflow-y: auto; - } - } - - .table-condensed > tbody > tr > td { - padding: 2px !important; - } - - .table { - margin-bottom: 0px !important; - } -} - -.popup-paginator { - margin-top: 5px; - margin-bottom: -5px !important; - .pagination { - margin-bottom: 0px; - margin-top: 0px; - color: @primaryColor; - li.disabled { - color: #BCBCBC; - cursor: default; - } - } -} - -//Measure tooltip -.map-tooltip { - position: relative; - background: rgba(120, 120, 120, 0.8); - border-radius: 4px; - color: white; - padding: 4px 8px; - opacity: 1; - white-space: nowrap; - font-size: 12px; - line-height: 1.4; -} - -.map-tooltip-small { - width: 130px; -} - -.map-tooltip-large { - width: 158px; -} - -//Measure config window -.map-toolbar-control-panel { - width: 190px; - position: fixed; - background-color: white; - z-index: 1038; - border: 1px solid #DDD; - border-radius: 6px; - box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2); - &.ui-draggable { - height: auto !important; - } - .panel-collapsible-body { - max-height: 0; - min-height: 0; - overflow: hidden; - -moz-transition: max-height 0.3s; - -webkit-transition: max-height 0.3s; - -o-transition: max-height 0.3s; - -ms-transition: max-height 0.3s; - transition: max-height 0.3s; - &.panel-body-visible { - max-height: 500px; - } - } -} - -.window-top-tools { - .fa{ - margin-left: 0; - } - .title { - margin-left: 7px; - line-height: 24px; - color: @profileColor_blue; - font-weight: bold; - &.title-export { - margin-left: 10px; - } - } -} - -#buffer-config { - width: 250px; - .noPadding { - padding: 0; - &.withLeftPadding{ - padding-left: 15px; - } - &.withRightPadding { - padding-right: 10px; - } - } -} - -#bookmarks { - width: 285px; - .map-control-subpanel { - background-color: #fff; - border-radius: 6px; - padding: 0; - .title { - margin-left: 14px; - line-height: 24px; - color: @profileColor_blue; - font-weight: bold; - } - .fa { - margin-left: 0; - } - } - .book-panel-body { - background-color: #fff; - overflow-y: hidden; - border-radius: 6px; - .table-responsive-force { - padding: 10px 0 0 0; - tbody { - td { - padding: 2px; - } - } - .btn-xs { - height: 20px; - padding: 1px 4px; - font-size: 12px; - } - .pagination-simple { - margin: 2px 0; - li a { - font-size: 10px; - padding: 4px 7px; - } - } - tfoot { - td { - padding: 3px 0 0 0; - } - } - } - .btn-bookmark-add { - max-height: 0; - -moz-transition: max-height 0.3s; - -webkit-transition: max-height 0.3s; - -o-transition: max-height 0.3s; - -ms-transition: max-height 0.3s; - transition: max-height 0.3s; - &.add-bookmark-visible { - max-height: 500px; - } - button { - margin: 10px 0; - } - } - } - .btn-more-details { - color: #fff; - font-size: 15px; - line-height: 10px; - cursor: pointer; - background-color: @primaryColor; - border-bottom-right-radius: 6px; - border-bottom-left-radius: 6px; - .details-text { - position: absolute; - top: -100%; - color: #000; - font-size: 13px; - left: 0; - bottom: 100%; - background-color: #fff; - } - } -} - -.mapfish-spinner { - color: #fff; - top: 0px; -} - -.mapfish-error { - margin: 0px 7px 7px 7px; -} - -.mapfish-progress { - margin: 0px 7px 7px 7px; -} - -#map-fish-print-config { - width: 450px; - input[type="checkbox"]{ - margin: 0; - } - cursor: default; -} - -.print-row { - margin: 0px -5px; -} -.print-content { - padding: 0px 15px; - .print-content-control { - position: relative; - } -} - -.print-checkbox-content { - margin-top: 20px; - line-height: 30px; - input { - vertical-align: middle; - margin: 0; - } -} - -.measure-content { - padding: 0px 22px; - margin-bottom: 8px; - &.btn-measure-group { - padding: 0px 15px; - } -} - -.drag-icon { - color: @profileColor_blue; - margin-top: 5px; - margin-bottom: 5px; - margin-right: 5px; - cursor: move; -} - -.mapPanelContainer.fullscreen { - background-color: @pageBackgroundColor; -} - +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +#mapPanelContainer{ + position: relative; + &.fullscreen{ + &, + & .map-container, + & #map { + width: 100% !important; + height: 100% !important; + } + } +} + +.map-container{ + /*width: 100%; + height: 100%;*/ + min-height: 30px; + /*margin-left: 3px;*/ + .map-over-btn { + z-index: 1035; + position: absolute; + top: 57px; + width: 100%; + text-align: center; + pointer-events: none; + button { + color: @primaryColor; + pointer-events: initial; + } + .fa { + color: red; + } + } +} + +.map { + width: 100%; + min-width: 992px; //According to header.less + overflow: hidden; + height: 100%; + display: block; + position: relative; +} + +.map:focus { + outline: 0px solid transparent !important; +} + + .modal-lg { + width: 1192px; + } + +//Map top Toolbar +#areaMap-toolbar, +#map-toolbar { + position: absolute; + width: 100%; + min-width: 992px; //According to header.less + margin: auto; + display: inline-flex; + flex-wrap: nowrap; + z-index: 1035; + background-color: rgba(54, 54, 54, 0.3); + height: 50px; + line-height: 50px; + justify-content: space-between; + > div { + padding: 0 3px; + } + .btn-group { + margin-left: 6px; + .btn { + padding: 0; + } + } + .btn-group-left, + .btn-group-right { + padding: 0; + padding-left: 4px; + >div button { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 2px; + color: @profileColor_blue; + font-size: 14px; + background-color: #fff; + border: solid 1px #c2c9cc; + border-radius: 2px; + box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.09); + &:focus, + &.active, + &:active, + &:hover { + background-color: #f2f2f2; + } + } + >div button:first-child { + margin-left: -2px; + } + } + .btn-group-left { + text-align: left; + .combo-report-history { + vertical-align: middle; + margin-left: 7px; + width: 150px; + display: inline-block; + line-height: 20px; + .dropdown-toggle { + height: 25px; + .dropdowntext { + line-height: 16px; + } + } + } + .refresh-btn { + border-top-left-radius: 0 !important; + border-bottom-left-radius: 0 !important; + margin-left: 0 !important; + } + .refresh-container { + margin-top: 3px; + height: 25px; + line-height: 22px; + border-right: 0; + padding-right: 5px; + padding-left: 5px; + span { + color: @profileColor_darkgray; + font-weight: bold; + } + &.disabled { + cursor: default; + .toggle-switch { + background-color: #aaa; + cursor: default; + pointer-events: none; + div { + pointer-events: none; + cursor: default; + } + span { + pointer-events: none; + cursor: default; + } + > div > span.knob { + pointer-events: none; + background-color: inherit; + } + } + } + &:active, + &:focus, + &:hover{ + background-color: white; + cursor: default; + } + .toggle-switch { + min-width: 42px; + width: 20px; + margin-bottom: 2px; + .toggle-switch-animate { + width: 150%; + height: 15px; + > span { + font-size: 12px; + padding: 0 10px 0 2px; + line-height: 15px; + } + .switch-left { + background-color: @profileColor_green; + color: #fff; + } + .switch-right { + background-color: @profileColor_gray; + color: #000; + } + } + } + } + } + .btn-group-right { + text-align: right; + padding-right: 8px; + display: flex; + align-items: center; + } + .alarms-icon { + color: @errorColor; + } +} + +.btn-fullscreen { + span { + font-size: 12px; + font-weight: 100; + } +} + +//Map bottom bar +.map-bottom{ + width: 100%; + min-height: 30px; + margin-left: 3px; + border: 1px solid #DDD; + line-height: 25px; + > .row { + margin-left: 0; + } +} + +//OL Controls +.ol-control { + padding: 0; + border-radius: 0; + margin: 0; + &, + &:active, + &:hover { + background-color: rgba(255,255,255,0); + } + button { + width: 25px; + height: 25px; + color: @profileColor_blue; + border: solid 1px #c2c9cc; + border-radius: 2px; + box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.09); + font-size: 14px; + &, + &:focus, + &:active { + background-color: #fff; + &:hover { + background-color: #f2f2f2; + } + } + } +} + +//Zoom +.ol-zoom-right-side { + top: 7px; + right: 7px; + left: auto; +} + +.ol-zoom-liveview { + top: 57px; + right: 7px; + left: auto; +} + +//Reset cql +.ol-resetCql { + top: 65px; +} + +.ol-resetCql-default { + left: 7px; +} + +.ol-resetCql-right-side { + top: 144px; + right: 7px; + float: right; +} + +.ol-resetCql-right-side-with-switcher { + top: 202px; + right: 7px; + float: right; +} + +//Scale line +.scale-line { + display: inline-block; + height: 20px; +} + +.ol-scale-line { + bottom: 5px; + left: 10px; + background-color: #ecf0f1 !important; + border: 1px solid @profileColor_gray; + padding: 5px; +} + +.ol-scale-line-inner { + height: 15px; + line-height: 11px; + font-weight: bold; + font-size: 12px !important; + color: @profileColor_blue !important; + border-color: @profileColor_blue !important; +} + +.ol-dragzoom { + border-color: @primaryColor; + border-width: 1px; + background-color: rgba(255,255,255,0.4); +} + +//Mouse coordinates +.mouse-position { + display: inherit; + text-align: right; + color: white; + font-size: 18px; + margin-right: 20px; +} + +//Attribution +.ol-attribution { + display: inline-table; + bottom: 5px !important; + &.reporting-map { + margin-left: 180px; + } + ul { + line-height: 12px; + } + li { + font-size: 12px !important; + position: relative; + } + &, + &:not(.ol-collapsed){ + background-color: transparent; + } +} + +//History +.ol-history { + top: 115px; + right: 7px; +} + +.ol-history-back { + border-radius: 2px 2px 0px 0px !important; +} + +.ol-history-forward { + border-radius: 0px 0px 2px 2px !important; +} + +//Full extent +.ol-zoom-extent { + &, + &.ol-touch { + top: 173px !important; + right: 7px; + left: auto; + } +} + +.ol-zoomextent-areamap { + top: 115px; + right: 7px; +} + +//Toolbar map toolbar controls +.btn-toolbar { + width: 25px !important; + height: 25px !important; +} + +/* +.btn-toolbar:focus { + background-color: rgba(0,60,136,0.5); +} + +.btn-toolbar.active { + background-color: rgba(0,60,136,0.7) !important; +} + +.btn-toolbar:hover { + background-color: rgba(0,60,136,0.7) !important; +}*/ + +//Vector labels +.vector-label { + background-color: white; + -webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); + filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); + border-radius: 5px; + padding: 3px 3px 1px 3px; + font-size: 12px; + table{ + tr { + line-height: 13px; + td { + white-space: nowrap; + div { + overflow: hidden; + max-width: 200px; + text-overflow: ellipsis; + } + } + } + } + .close-icon { + color: #e21e27; + cursor: pointer; + } + .label-content { + padding-left: 0px; + padding-right: 0px; + + tr { + height: 13px; + } + } +} + +.vector-label-vmspos { + border-left: 8px solid @profileColor_blue; +} + +.vector-label-vmsseg { + border-left: 8px solid #50629e; +} + +.vector-label-ers { + border-left: 8px solid #1ca07a; +} + +//Info popup +.ol-popup { + display: none; + position: absolute; + background-color: white; + -webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); + filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); + padding: 15px 5px 15px 5px; + border-radius: 10px; + border: 1px solid #cccccc; + bottom: 12px; + left: -50px; + min-width: 280px; +} + +.ol-popup:after, .ol-popup:before { + top: 100%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; +} + +.ol-popup:after { + border-top-color: white; + border-width: 10px; + left: 48px; + margin-left: -10px; +} + +.ol-popup:before { + border-top-color: #cccccc; + border-width: 11px; + left: 48px; + margin-left: -11px; +} + +.ol-popup-closer { + text-decoration: none; + position: absolute; + top: 2px; + right: 8px; + span { + color: #e21e27; + } +} + +.ol-popup-details-btn { + //position: absolute; +} + +.ol-popup-header { + .header { + font-size: 14px; + font-weight: bold; + text-transform: uppercase; + color: #777; + background-color: white; + margin-right: 15px; + line-height: 30px; + } + .btn-container { + display: inline-block; + } +} + +.tabular-view, +.alarms-preview, +#popup-content { + .alarm-status { + display: inline-block; + border-radius: 4px; + padding: 2px 5px; + font-weight: bold; + text-transform: capitalize; + color: #fff; + font-size: 12px; + } +} + +.tabular-view { + .alarm-status { + text-align: center; + } +} + +.alarms-preview, +#popup-content{ + .alarm-status { + margin-top: 2px; + float: right; + } +} + +.alarms-preview, +#popup-content { + .name { + font-size: 14px; + font-weight: bold; + text-transform: uppercase; + } + + .alarm-header { + font-size: 14px; + font-weight: bold; + text-transform: uppercase; + color: #777; + background-color: white; + margin-right: 15px; + line-height: 30px; + } + + .info-content{ + margin-top: 10px; + font-size: 12px; + span.title { + font-weight: bold; + } + &.alarm { + margin-top: 0px; + } + .form-separator { + border-top: 1px solid #ddd; + margin-bottom: 5px; + margin-top: -5px; + } + .rule-definition { + width: 100%; + display: inline-block; + background-color: #e4e4e4; + border: 1px solid #aaa; + border-radius: 4px; + padding: 3px; + text-align: center; + max-height: 125px; + overflow-y: auto; + } + tr { + height: 22px; + } + } + + .table-condensed > tbody > tr > td { + padding: 2px !important; + } + + .table { + margin-bottom: 0px !important; + } +} + +.popup-paginator { + margin-top: 5px; + margin-bottom: -5px !important; + .pagination { + margin-bottom: 0px; + margin-top: 0px; + color: @primaryColor; + li.disabled { + color: #BCBCBC; + cursor: default; + } + } +} + +//Measure tooltip +.map-tooltip { + position: relative; + background: rgba(120, 120, 120, 0.8); + border-radius: 4px; + color: white; + padding: 4px 8px; + opacity: 1; + white-space: nowrap; + font-size: 12px; + line-height: 1.4; +} + +.map-tooltip-small { + width: 130px; +} + +.map-tooltip-large { + width: 158px; +} + +//Measure config window +.map-toolbar-control-panel { + width: 190px; + position: fixed; + background-color: white; + z-index: 1038; + border: 1px solid #DDD; + border-radius: 6px; + box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2); + &.ui-draggable { + height: auto !important; + } + .panel-collapsible-body { + max-height: 0; + min-height: 0; + overflow: hidden; + -moz-transition: max-height 0.3s; + -webkit-transition: max-height 0.3s; + -o-transition: max-height 0.3s; + -ms-transition: max-height 0.3s; + transition: max-height 0.3s; + &.panel-body-visible { + max-height: 500px; + } + } +} + +.window-top-tools { + .fa{ + margin-left: 0; + } + .title { + margin-left: 7px; + line-height: 24px; + color: @profileColor_blue; + font-weight: bold; + &.title-export { + margin-left: 10px; + } + } +} + +#buffer-config { + width: 250px; + .noPadding { + padding: 0; + &.withLeftPadding{ + padding-left: 15px; + } + &.withRightPadding { + padding-right: 10px; + } + } +} + +#bookmarks { + width: 285px; + .map-control-subpanel { + background-color: #fff; + border-radius: 6px; + padding: 0; + .title { + margin-left: 14px; + line-height: 24px; + color: @profileColor_blue; + font-weight: bold; + } + .fa { + margin-left: 0; + } + } + .book-panel-body { + background-color: #fff; + overflow-y: hidden; + border-radius: 6px; + .table-responsive-force { + padding: 10px 0 0 0; + tbody { + td { + padding: 2px; + } + } + .btn-xs { + height: 20px; + padding: 1px 4px; + font-size: 12px; + } + .pagination-simple { + margin: 2px 0; + li a { + font-size: 10px; + padding: 4px 7px; + } + } + tfoot { + td { + padding: 3px 0 0 0; + } + } + } + .btn-bookmark-add { + max-height: 0; + -moz-transition: max-height 0.3s; + -webkit-transition: max-height 0.3s; + -o-transition: max-height 0.3s; + -ms-transition: max-height 0.3s; + transition: max-height 0.3s; + &.add-bookmark-visible { + max-height: 500px; + } + button { + margin: 10px 0; + } + } + } + .btn-more-details { + color: #fff; + font-size: 15px; + line-height: 10px; + cursor: pointer; + background-color: @primaryColor; + border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; + .details-text { + position: absolute; + top: -100%; + color: #000; + font-size: 13px; + left: 0; + bottom: 100%; + background-color: #fff; + } + } +} + +.mapfish-spinner { + color: #fff; + top: 0px; +} + +.mapfish-error { + margin: 0px 7px 7px 7px; +} + +.mapfish-progress { + margin: 0px 7px 7px 7px; +} + +#map-fish-print-config { + width: 450px; + input[type="checkbox"]{ + margin: 0; + } + cursor: default; +} + +.print-row { + margin: 0px -5px; +} +.print-content { + padding: 0px 15px; + .print-content-control { + position: relative; + } +} + +.print-checkbox-content { + margin-top: 20px; + line-height: 30px; + input { + vertical-align: middle; + margin: 0; + } +} + +.measure-content { + padding: 0px 22px; + margin-bottom: 8px; + &.btn-measure-group { + padding: 0px 15px; + } +} + +.drag-icon { + color: @profileColor_blue; + margin-top: 5px; + margin-bottom: 5px; + margin-right: 5px; + cursor: move; +} + +.mapPanelContainer.fullscreen { + background-color: @pageBackgroundColor; +} + diff --git a/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.html b/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.html index c401175fe..b0753d1aa 100644 --- a/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.html +++ b/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.html @@ -24,695 +24,798 @@
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ {{isSegFilterVisible === false ? 'spatial.table_filters_activate' : 'spatial.table_filters_deactivate' | i18n}} + +
+ +
+
+
+
+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+
+ + +
+
+
+
+ + + + +
+
+
+
{{'spatial.tab_vms_pos_table_header_fs' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_ext_mark' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_ircs' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_cfr' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_name' | i18n }}
+
{{'spatial.tab_vms_seg_table_header_distance' | i18n }}
+
{{'spatial.tab_vms_seg_table_header_duration' | i18n }}
+
{{'spatial.tab_vms_seg_table_header_speed_ground' | i18n }}
+
{{'spatial.tab_vms_seg_table_header_course_ground' | i18n }}
+
{{'spatial.tab_vms_seg_table_header_category' | i18n }}
+
{{'spatial.table_header_actions' | i18n }}
{{'spatial.table_no_data' | i18n}}
+
{{ segment.properties.countryCode }}
+
{{ segment.properties.externalMarking }}
+
{{ segment.properties.ircs }}
+
{{ segment.properties.cfr }}
+
{{ segment.properties.name }}
+
{{ segment.properties.distance | stDistanceUnit : 5 }}
+
{{ segment.properties.duration | stHumanizeTime }}
+
{{ segment.properties.speedOverGround | stSpeedUnit : 5 }}
+
{{ segment.properties.courseOverGround }}°
+
{{ segment.properties.segmentCategory }}
+
+ + +
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ {{isTrackFilterVisible === false ? 'spatial.table_filters_activate' : 'spatial.table_filters_deactivate' | i18n}} + +
+ +
+
+
+
+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+ + + + +
+
+
+
{{'spatial.tab_vms_pos_table_header_fs' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_ext_mark' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_ircs' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_cfr' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_name' | i18n }}
+
{{'spatial.tab_vms_seg_table_header_distance' | i18n }}
+
{{'spatial.tab_vms_seg_table_header_duration' | i18n }}
+
{{'spatial.tab_vms_tracks_table_header_time_at_sea' | i18n }}
+
{{'spatial.table_header_actions' | i18n }}
{{'spatial.table_no_data' | i18n}}
+
{{ track.countryCode }}
+
{{ track.externalMarking }}
+
{{ track.ircs }}
+
{{ track.cfr }}
+
{{ track.name }}
+
{{ track.distance | stDistanceUnit : 5 }}
+
{{ track.duration | stHumanizeTime }}
+
{{ track.totalTimeAtSea | stHumanizeTime: track }}
+
+ + +
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ {{isAlarmFilterVisible === false ? 'spatial.table_filters_activate' : 'spatial.table_filters_deactivate' | i18n}} + +
+ +
+
+
+
+
+
+ +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+ +
+ + +
+
+
+
+
+
+
+ + +
+
+
+
+ + + + +
+
+
+
{{'spatial.tab_vms_pos_table_header_fs' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_ext_mark' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_ircs' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_cfr' | i18n }}
+
{{'spatial.reports_form_details_modal_vessel_name_header' | i18n }}
+
{{'spatial.rule_table_header_name' | i18n }}
+
{{'spatial.rule_table_header_desc' | i18n }}
+
{{'spatial.rule_open_date' | i18n }}
+
{{'spatial.rule_status' | i18n }}
+
{{'spatial.table_header_actions' | i18n }}
{{'spatial.table_no_data' | i18n}}
+
{{ alarm.properties.fs }}
+
{{ alarm.properties.extMark }}
+
{{ alarm.properties.ircs }}
+
{{ alarm.properties.cfr }}
+
{{ alarm.properties.name }}
+
{{alarm.properties.ruleName}}
+
{{alarm.properties.ruleDesc}}
+
{{alarm.properties.ticketOpenDate | stDateUtc}}
+
{{ alarm.properties.ticketStatus }}
+
+ + + +
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ {{isTripFilterVisible === false ? 'spatial.table_filters_activate' : 'spatial.table_filters_deactivate' | i18n}} + +
+ +
+
+
+
+
+
+ +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+
+ + + + +
+
+
+
{{'activity.tab_trip_table_header_id' | i18n }}
+
{{'spatial.tab_vms_pos_table_header_fs' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_external_marking' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_ircs' | i18n }}
+
{{'spatial.reports_form_vessel_search_table_header_cfr' | i18n }}
+
{{'activity.fa_details_item_uvi' | i18n }}
+
{{'activity.fa_details_item_iccat' | i18n }}
+
{{'activity.fa_details_item_gfcm' | i18n }}
+
{{'activity.tab_trip_table_header_first_event' | i18n }}
+
{{'activity.tab_trip_table_header_first_event_time' | i18n }}
+
{{'activity.tab_trip_table_header_last_event' | i18n }}
+
{{'activity.tab_trip_table_header_last_event_time' | i18n }}
+
{{'activity.tab_trip_table_header_duration' | i18n }}
+
{{'activity.tab_trip_table_header_nCorrections' | i18n }}
+
{{'activity.tab_trip_table_header_nPositions' | i18n }}
+
{{'activity.tab_trip_table_header_alarm' | i18n }}
+
{{'spatial.table_header_actions' | i18n }}
{{'spatial.table_no_data' | i18n}}
+
{{ trip.schemeId}}:{{ trip.tripId }}
+
{{ trip.flagState}}
+
{{ trip.EXT_MARK }}
+
{{ trip.CFR }}
+
{{ trip.IRCS }}
+
{{ trip.UVI }}
+
{{ trip.ICCAT }}
+
{{ trip.GFCM }}
+
{{ 'abbreviations.activity_' + trip.firstFishingActivity | i18n }}
+
{{ trip.firstFishingActivityDateTime | stDateUtc }}
+
{{ 'abbreviations.activity_' + trip.lastFishingActivity | i18n }}
+
{{ trip.lastFishingActivityDateTime | stDateUtc }}
+
{{ trip.tripDuration | stHumanizeTime }}
+
{{ trip.noOfCorrections }}
+
{{ trip.vmsPositionCount }}
+
+ + + +
+
+ + +
+
+
+
+
+
+
- \ No newline at end of file + diff --git a/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.js b/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.js index ea960aa3b..2962b5eef 100644 --- a/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.js +++ b/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.js @@ -20,15 +20,27 @@ angular.module('unionvmsWeb').controller('VmspanelCtrl',function($scope, locale, $scope.itemsByPageModal = 15; $scope.modalCollapsed = false; $scope.executedReport = reportService; - $scope.startDate = undefined; - $scope.endDate = undefined; - $scope.alarmStartDate = undefined; - $scope.alarmEndDate = undefined; + $scope.startDates = []; + $scope.endDates = []; + $scope.alarmStartDates = []; + $scope.alarmEndDates = []; + $scope.firstEventDates = []; + $scope.lastEventDates = []; + $scope.firstFishingActivityTypes = []; + $scope.lastFishingActivityTypes = []; $scope.decimalDegrees = true; $scope.attrVisibility = visibilityService; $scope.tripSummServ = tripSummaryService; $scope.activityTypes = []; - + $scope.dynamicSearchArray = { + 'positions' : [0], + 'segments' : [0], + 'tracks' : [0], + 'alarms' : [0], + 'trips' : [0] + }; + $scope.lastX = undefined; + //Define VMS tabs var setVmsTabs = function(){ var tabs = [{ @@ -56,7 +68,20 @@ angular.module('unionvmsWeb').controller('VmspanelCtrl',function($scope, locale, return tabs; }; - + + $scope.addDynamicForm = function(tab){ + this.dynamicSearchArray[tab].push(this.dynamicSearchArray[tab][this.dynamicSearchArray[tab].length-1]+1); + this.isPosFilterVisible = true; + }; + $scope.removeDynamicForm = function(index,tab){ + if($scope.dynamicSearchArray[tab].length > 1){ + if (index > 0) { + this.dynamicSearchArray[tab].splice(index, 1); + this.isPosFilterVisible = true; + } + } + }; + locale.ready('spatial').then(function(){ $scope.vmsTabMenu = setVmsTabs(); $scope.getActivityTypes(); @@ -120,20 +145,24 @@ angular.module('unionvmsWeb').controller('VmspanelCtrl',function($scope, locale, $scope.clearDateFilters = function(){ if ($scope.selectedVmsTab === 'MOVEMENTS'){ - $scope.startDate = undefined; - $scope.endDate = undefined; + $scope.startDates = []; + $scope.endDates = []; } else if ($scope.selectedVmsTab === 'ALARMS'){ - $scope.alarmStartDate = undefined; - $scope.alarmEndDate = undefined; + $scope.alarmStartDates = []; + $scope.alarmEndDates = []; } else if ($scope.selectedVmsTab === 'TRIPS'){ - $scope.firstEventDate = undefined; - $scope.lastEventDate = undefined; + $scope.firstEventDates = []; + $scope.lastEventDates = []; } }; + $scope.clearDynamicForms = function(tab) { + $scope.dynamicSearchArray[tab] = [0]; + }; + $scope.clearComboFilters = function(){ - $scope.firstFishingActivityType = undefined; - $scope.lastFishingActivityType = undefined; + $scope.firstFishingActivityTypes = []; + $scope.lastFishingActivityTypes = []; }; //Positions table config @@ -291,7 +320,7 @@ angular.module('unionvmsWeb').controller('VmspanelCtrl',function($scope, locale, case 'alarms': formId = 'alarmFiltersForm'; break; - case 'trip': + case 'trips': formId = 'tripFiltersForm'; } @@ -300,124 +329,137 @@ angular.module('unionvmsWeb').controller('VmspanelCtrl',function($scope, locale, formId += 'Modal'; } var el = angular.element(elId); - - var data = $scope.getFilterData(formId); - - valid = $scope.validateDDMCoords(data); - + + var data = $scope.getFilterData(formId,type); + + valid = $scope.validateDDMCoords(formId,type,data.objects); + if (valid){ el.val(JSON.stringify(data)); el.trigger('input'); } }; - - $scope.getFilterData = function(selector){ - var obj = {}; - var comboInputs = ['firstFishingActivity', 'lastFishingActivity']; - $('#' + selector + ' [name]').each( - function(index){ - var input = $(this); - var value = input.val(); - - if (_.indexOf(comboInputs, input.attr('name')) !== -1){ - value = $scope[input.attr('name') + 'Type']; - } - - obj[input.attr('name')] = value; - } - ); - - //Get the dates for positions - if (selector.indexOf('posFilters') !== -1){ - if (angular.isDefined($scope.startDate)){ - obj.startDate = $scope.startDate; - } - - if (angular.isDefined($scope.endDate)){ - obj.endDate = $scope.endDate; - } - } - - //Get the dates for alarms - if (selector.indexOf('alarmFilters') !== -1){ - if (angular.isDefined($scope.alarmStartDate)){ - obj.startDate = $scope.alarmStartDate; - } - - if (angular.isDefined($scope.alarmEndDate)){ - obj.endDate = $scope.alarmEndDate; - } - } - - if (selector.indexOf('tripFilters') !== -1){ - if (angular.isDefined($scope.firstEventDate)){ - obj.startDate = $scope.firstEventDate; - } - - if (angular.isDefined($scope.lastEventDate)){ - obj.endDate = $scope.lastEventDate; - } - } - - - - obj = _.pick(obj, function(value, key, obj){ - return value !== ''; - }); - - return obj; - }; - - $scope.validateDDMCoords = function(data){ + + $scope.getFilterData = function(selectorByType,type){ + var objects = []; + var comboInputs = ['firstFishingActivity', 'lastFishingActivity']; + + for(var i=0; i < this.dynamicSearchArray[type].length;i++) { + var selector = selectorByType + (i); + objects[i] = {}; + $('#' + selector+' [name]').each( + function(index){ + var input = $(this); + var value = input.val(); + + if (_.indexOf(comboInputs, input.attr('name')) !== -1){ + var values = $scope[input.attr('name') + 'Types']; + if(values[i]){ + value = values[i]; + } + } + + objects[i][input.attr('name')] = value; + } + ); + //Get the dates for positions + if (selector.indexOf('posFilters') !== -1){ + if (this.startDates[i] !== null){ + objects[i].startDate = this.startDates[i]; + } + + if (this.endDates[i] !== null){ + objects[i].endDate = this.endDates[i]; + } + } + + //Get the dates for alarms + if (selector.indexOf('alarmFilters') !== -1){ + if (this.alarmStartDates[i] !== null){ + objects[i].startDate = this.alarmStartDates[i]; + } + + if (this.alarmEndDates[i] !== null){ + objects[i].endDate = this.alarmEndDates[i]; + } + } + + if (selector.indexOf('tripFilters') !== -1){ + if (this.firstEventDates[i] !== null){ + objects[i].startDate = this.firstEventDates[i]; + } + + if (this.lastEventDates[i] !== null){ + objects[i].endDate = this.lastEventDates[i]; + } + } + objects[i] = _.pick(objects[i], function(value, key, obj){ + return value !== ''; + }); + } + var lastXInput = $('#' + type+'-lastX'); + var data = { + "lastX" : lastXInput.val(), + "objects" : objects + }; + return data; + }; + + + $scope.validateDDMCoords = function(formId,type,data){ var keys = _.keys(data); var valid = true; var i, value, keysToSearch, comps, qtipEl, qtipContent; - if ($scope.decimalDegrees){ - keysToSearch = ['lon|dd', 'lat|dd']; - for (i = 0; i < keysToSearch.length; i++){ - $('input[name="' + keysToSearch[i] + '"]:visible').removeClass('coordError'); - qtipEl = '#qtip-' + keysToSearch[i].replace('|', '-') + ' i'; - $(qtipEl).removeClass('hasError'); - if (_.indexOf(keys, keysToSearch[i]) !== -1){ - value = data[keysToSearch[i]].replace(',', '.'); - if (isNaN(value) || (keysToSearch[i] === 'lon|dd' && (value > 180 || value < -180)) || (keysToSearch[i] === 'lat|dd' && (value > 90 || value < -90))){ - $('input[name="' + keysToSearch[i] + '"]:visible').addClass('coordError'); - $(qtipEl).addClass('hasError'); - valid = false; - } - } - } - } else { - keysToSearch = ['lon|deg', 'lon|min', 'lat|deg', 'lat|min']; - for (i = 0; i < keysToSearch.length; i++){ - $('input[name="' + keysToSearch[i] + '"]:visible').removeClass('coordError'); - qtipEl = '#qtip-' + keysToSearch[i].split('|')[0] + '-ddm i'; - $(qtipEl).removeClass('hasError'); - if (_.indexOf(keys, keysToSearch[i]) !== -1){ - comps = keysToSearch[i].split('|'); - value = data[keysToSearch[i]].replace(',', '.'); - if (comps[1] === 'deg'){ - if ( (isNaN(value) || value.indexOf('.') !== -1 || (keysToSearch[i] === 'lon|deg' && (value > 180 || value < -180)) || (keysToSearch[i] === 'lat|deg' && (value > 90 || value < -90))) ){ - $('input[name="' + keysToSearch[i] + '"]:visible').addClass('coordError'); - $(qtipEl).addClass('hasError'); - valid = false; - } - } else { - if ( isNaN(value) || (value >= 60 || value < 0)){ - $('input[name="' + keysToSearch[i] + '"]:visible').addClass('coordError'); - $(qtipEl).addClass('hasError'); - valid = false; - } else { - var degKey = keysToSearch[i].replace('min', 'deg'); - if (!angular.isDefined(data[degKey])){ - $('input[name="' + degKey + '"]:visible').addClass('coordError'); - $(qtipEl).addClass('hasError'); - valid = false; - } - } - } - } - } + for(var idx =0; idx < this.dynamicSearchArray[type].length;idx++){ + var formIdx = formId+idx; + + if ($scope.decimalDegrees){ + keysToSearch = ['lon|dd', 'lat|dd']; + for (i = 0; i < keysToSearch.length; i++){ + $(formIdx+' input[name="' + keysToSearch[i] +'"]:visible').removeClass('coordError'); + qtipEl = formIdx+' #qtip-' + keysToSearch[i].replace('|', '-') +' i'; + $(qtipEl).removeClass('hasError'); + if (_.indexOf(keys, keysToSearch[i]) !== -1){ + value = data[keysToSearch[i]].replace(',', '.'); + if (isNaN(value) || (keysToSearch[i] === 'lon|dd' && (value > 180 || value < -180)) || (keysToSearch[i] === 'lat|dd' && (value > 90 || value < -90))){ + $(formIdx+' input[name="' + keysToSearch[i] +'"]:visible').addClass('coordError'); + $(qtipEl).addClass('hasError'); + valid = false; + } + } + } + } else { + keysToSearch = ['lon|deg', 'lon|min', 'lat|deg', 'lat|min']; + for (i = 0; i < keysToSearch.length; i++){ + $(formIdx+' input[name="' + keysToSearch[i] +i+ '"]:visible').removeClass('coordError'); + qtipEl = formIdx+' #qtip-' + keysToSearch[i].split('|')[0] + '-ddm i'; + $(qtipEl).removeClass('hasError'); + if (_.indexOf(keys, keysToSearch[i]) !== -1){ + comps = keysToSearch[i].split('|'); + value = data[keysToSearch[i]].replace(',', '.'); + if (comps[1] === 'deg'){ + if ( (isNaN(value) || value.indexOf('.') !== -1 || (keysToSearch[i] === 'lon|deg' && (value > 180 || value < -180)) || (keysToSearch[i] === 'lat|deg' && (value > 90 || value < -90))) ){ + $(formIdx+' input[name="' + keysToSearch[i] +'"]:visible').addClass('coordError'); + $(qtipEl).addClass('hasError'); + valid = false; + } + } else { + if ( isNaN(value) || (value >= 60 || value < 0)){ + $(formIdx+' input[name="' + keysToSearch[i] +'"]:visible').addClass('coordError'); + $(qtipEl).addClass('hasError'); + valid = false; + } else { + var degKey = keysToSearch[i].replace('min', 'deg'); + if (!angular.isDefined(data[degKey])){ + $(formIdx+' input[name="' + degKey +'"]:visible').addClass('coordError'); + $(qtipEl).addClass('hasError'); + valid = false; + } + } + } + } + } + } } return valid; @@ -795,4 +837,4 @@ angular.module('unionvmsWeb').controller('VmspanelCtrl',function($scope, locale, console.log(item); console.log(collection); }; -}); \ No newline at end of file +}); diff --git a/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.less b/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.less index be82d6f79..e8a8ba688 100644 --- a/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.less +++ b/unionvms-web/app/partial/spatial/liveViewPanel/vmsPanel/vmsPanel.less @@ -1,288 +1,299 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -.tabular-view { - .modal-header { - height: 65px; - padding: 0 !important; - .pointer { - padding-top: 20px; - padding-right: 30px; - } - .collapseicon { - padding-right: 5px; - } - &.tab-panel-layout { - height: 42px; - ul { - height: 42px; - li { - a { - line-height: 40px; - border-top: 1px solid @profileColor_neutralgray; - } - &.active { - a { - border-bottom: 1px solid @profileColor_neutralgray; - &:hover { - border-bottom: 1px solid @profileColor_neutralgray; - } - } - } - } - } - } - } - .top-tabs { - height: 65px; - li { - &.active { - background-color: white; - border-bottom: 0; - a { - background-color: white; - color: @profileColor_darkgray; - border-bottom: 1px solid white; - &:hover { - background-color: white; - color: @profileColor_darkgray; - border-bottom: 1px solid white; - } - } - } - a { - padding: 0 15px; - line-height: 64px; - color: @primaryColor; - background-color: @profileColor_lightgray; - border: 1px solid @profileColor_neutralgray; - border-top: 0; - border-left: 0; - &:hover { - border: 1px solid @profileColor_neutralgray; - border-top: 0; - border-left: 0; - } - } - &:first-child { - a { - border-left: 1px solid @profileColor_neutralgray; - } - } - } - } - .modal-body { - padding-top: 10px !important; - .table-tools { - cursor: auto !important; - } - .btnTools { - height: 25px; - width: 25px; - float: right; - margin-right: 17px; - i { - line-height: 25px; - font-size: 14px; - color: @primaryColor; - text-align: center; - } - } - .no-border { - border: 0; - } - .with-bottom-border { - border-bottom-width: 1px; - } - .alarms-icon { - color: red; - } - } -} - -.filter-combo { - z-index: 1073; -} - -.vmspages { - padding-top: 2px !important; - padding-left: 5px !important; - display: table-cell; -} - -.vmstables { - padding-top: 5px !important; - padding-left: 5px !important; - border: 0px !important; - float: left; -} - -.vms-search-btns { - margin-top: 5px; - margin-bottom: 5px; -} - -/*.vmssourcetab { - >a { - font-weight: bold; - } -} - -.vmssourcetab.active:hover, -.vmssourcetab.active{ - >a { - background-color: @primaryColor !important; - color: #fff !important; - } -} - -.vmssourcetab:hover { - >a { - background-color: #fff !important; - } -}*/ - -.vmstab-content { - margin-top: 5px; -} - -.hidden-st-control{ - display: none; -} - -.st-table-filters { - margin-bottom: 5px; - padding-right: 35px; - p.datepicker { - width: 100%; - } - .info-qtip { - right: 15px; - } -} - -.filter-form { - margin-left: -15px; -} - -.twin-controls { - input { - border-color: @primaryColor; - } -} - -.coord-label { - padding: 0; - color: #999999; - line-height: 30px; -} - -input[name="lon|dd"], -input[name="lat|dd"] { - &.coordError{ - border: 1px solid red; - } -} -.coord-deg { - padding: 0; - > input, >input:focus { - border-right: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - &.coordError{ - border: 1px solid red; - } - } - &:after { - content: '\00b0'; - position: absolute; - top: 0; - right: 0; - color: #999999; - font-size: 18px; - } -} - -.coord-min{ - padding: 0; - > input, >input:focus { - border-left: 0; - border-top-left-radius: 0; - border-bottom-left-radius: 0; - &.coordError{ - border: 1px solid red; - } - } - - &:after { - content: '\2019'; - position: absolute; - top: 0; - right: 4px; - color: #999999; - font-size: 18px; - } -} - -.table-tools { - cursor: auto !important; - i { - color: @primaryColor; - cursor: pointer; - font-style: normal; - } - .btnTools { - float: right; - line-height: 1em; - } -} - -.table-tools i:first-child { - padding-right: 8px; -} - -div.table-tools i { - margin-left: 2px; -} - -.lr-drop-target-before{ - border-left: 5px solid @primaryColor; -} - -th:first-child .lr-drop-target-before { - display: none; -} - -.lr-drop-target-after{ - border-right: 5px solid @primaryColor; -} - -.vmspanel-modal { - overflow: auto; - z-index: 1072 !important; - &.collapsed { - bottom: auto; - .modal-dialog { - margin: 30px auto 5px auto; - } - } -} - -.fullscreen, -.is-loading-new-tab - { - .vmspanel-modal { - pointer-events: none; - .modal-dialog { - pointer-events: auto; - } - } -} +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +.tabular-view { + .modal-header { + height: 65px; + padding: 0 !important; + .pointer { + padding-top: 20px; + padding-right: 30px; + } + .collapseicon { + padding-right: 5px; + } + &.tab-panel-layout { + height: 42px; + ul { + height: 42px; + li { + a { + line-height: 40px; + border-top: 1px solid @profileColor_neutralgray; + } + &.active { + a { + border-bottom: 1px solid @profileColor_neutralgray; + &:hover { + border-bottom: 1px solid @profileColor_neutralgray; + } + } + } + } + } + } + } + .top-tabs { + height: 65px; + li { + &.active { + background-color: white; + border-bottom: 0; + a { + background-color: white; + color: @profileColor_darkgray; + border-bottom: 1px solid white; + &:hover { + background-color: white; + color: @profileColor_darkgray; + border-bottom: 1px solid white; + } + } + } + a { + padding: 0 15px; + line-height: 64px; + color: @primaryColor; + background-color: @profileColor_lightgray; + border: 1px solid @profileColor_neutralgray; + border-top: 0; + border-left: 0; + &:hover { + border: 1px solid @profileColor_neutralgray; + border-top: 0; + border-left: 0; + } + } + &:first-child { + a { + border-left: 1px solid @profileColor_neutralgray; + } + } + } + } + .modal-body { + padding-top: 10px !important; + .table-tools { + cursor: auto !important; + } + .btnTools { + height: 25px; + width: 25px; + float: right; + margin-right: 17px; + i { + line-height: 25px; + font-size: 14px; + color: @primaryColor; + text-align: center; + } + } + .no-border { + border: 0; + } + .with-bottom-border { + border-bottom-width: 1px; + } + .alarms-icon { + color: red; + } + .wrapper { + max-height: 320px; + overflow: auto; + .minus { + margin-bottom: 5px; + margin-left: 15px; + } + } + .plus { + margin-left: 10px; + } + } +} + +.filter-combo { + z-index: 1073; +} + +.vmspages { + padding-top: 2px !important; + padding-left: 5px !important; + display: table-cell; +} + +.vmstables { + padding-top: 5px !important; + padding-left: 5px !important; + border: 0px !important; + float: left; +} + +.vms-search-btns { + margin-top: 5px; + margin-bottom: 5px; +} + +/*.vmssourcetab { + >a { + font-weight: bold; + } +} + +.vmssourcetab.active:hover, +.vmssourcetab.active{ + >a { + background-color: @primaryColor !important; + color: #fff !important; + } +} + +.vmssourcetab:hover { + >a { + background-color: #fff !important; + } +}*/ + +.vmstab-content { + margin-top: 5px; +} + +.hidden-st-control{ + display: none; +} + +.st-table-filters { + margin-bottom: 5px; + padding-right: 35px; + p.datepicker { + width: 100%; + } + .info-qtip { + right: 15px; + } +} + +.filter-form { + margin-left: -15px; +} + +.twin-controls { + input { + border-color: @primaryColor; + } +} + +.coord-label { + padding: 0; + color: #999999; + line-height: 30px; +} + +input[name="lon|dd"], +input[name="lat|dd"] { + &.coordError{ + border: 1px solid red; + } +} +.coord-deg { + padding: 0; + > input, >input:focus { + border-right: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + &.coordError{ + border: 1px solid red; + } + } + &:after { + content: '\00b0'; + position: absolute; + top: 0; + right: 0; + color: #999999; + font-size: 18px; + } +} + +.coord-min{ + padding: 0; + > input, >input:focus { + border-left: 0; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + &.coordError{ + border: 1px solid red; + } + } + + &:after { + content: '\2019'; + position: absolute; + top: 0; + right: 4px; + color: #999999; + font-size: 18px; + } +} + +.table-tools { + cursor: auto !important; + i { + color: @primaryColor; + cursor: pointer; + font-style: normal; + } + .btnTools { + float: right; + line-height: 1em; + } +} + +.table-tools i:first-child { + padding-right: 8px; +} + +div.table-tools i { + margin-left: 2px; +} + +.lr-drop-target-before{ + border-left: 5px solid @primaryColor; +} + +th:first-child .lr-drop-target-before { + display: none; +} + +.lr-drop-target-after{ + border-right: 5px solid @primaryColor; +} + +.vmspanel-modal { + overflow: auto; + z-index: 1072 !important; + &.collapsed { + bottom: auto; + .modal-dialog { + margin: 30px auto 5px auto; + } + } +} + +.fullscreen, +.is-loading-new-tab + { + .vmspanel-modal { + pointer-events: none; + .modal-dialog { + pointer-events: auto; + } + } +} diff --git a/unionvms-web/app/partial/spatial/reportsPanel/reportForm/reportForm.js b/unionvms-web/app/partial/spatial/reportsPanel/reportForm/reportForm.js index d27dfe7b4..1e1745bac 100644 --- a/unionvms-web/app/partial/spatial/reportsPanel/reportForm/reportForm.js +++ b/unionvms-web/app/partial/spatial/reportsPanel/reportForm/reportForm.js @@ -1,636 +1,648 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').controller('ReportformCtrl',function($scope, $modal, $anchorScroll, reportMsgService, locale, Report, reportRestService, spatialRestService, configurationService, movementRestService, reportService, SpatialConfig, spatialConfigRestService, userService, loadingStatus, reportFormService){ - //Report form mode - $scope.showVesselFilter = false; - - //set visibility types in dropdown option - $scope.visibilities = []; - - //Set the available report types to create - $scope.reportTypes = [ - {"text": locale.getString('spatial.reports_form_type_standard'), "code": "standard"}, - {"text": locale.getString('spatial.reports_form_type_summary'), "code": "summary"} - ]; - - //Set positions selector dropdown options - $scope.positionItems = [ - {"text": locale.getString('spatial.reports_form_positions_selector_option_all'), "code": "all"}, - {"text": locale.getString('spatial.reports_form_positions_selector_option_last'), "code": "last"} - ]; - - //Set positions selector dropdown options - $scope.positionTypeItems = [ - {"text": locale.getString('spatial.reports_form_positions_selector_type_option_positions'), "code": "positions"}, - {"text": locale.getString('spatial.reports_form_positions_selector_type_option_hours'), "code": "hours"} - ]; - - //Set vessel search type dropdown options - $scope.vesselSearchItems = [ - {"text": locale.getString('spatial.reports_form_vessels_search_by_vessel'), "code": "asset"}, - {"text": locale.getString('spatial.reports_form_vessels_search_by_group'), "code": "vgroup"} - ]; - - //Set movement type dropdown options - $scope.movementTypes = configurationService.setTextAndCodeForDropDown(configurationService.getValue('MOVEMENT', 'MESSAGE_TYPE'),'MESSAGE_TYPE','MOVEMENT'); - - //Set movemment activity type dropdown options - $scope.activityTypes = configurationService.setTextAndCodeForDropDown(configurationService.getValue('MOVEMENT', 'ACTIVITY_TYPE'), 'ACTIVITY_TYPE', 'MOVEMENT'); - - //Set category types dropdown options - $scope.categoryTypes = configurationService.setTextAndCodeForDropDown(configurationService.getValue('MOVEMENT', 'CATEGORY_TYPE'), 'CATEGORY_TYPE', 'MOVEMENT'); - - //Set movement source types dropdown options - $scope.movementSourceTypes = configurationService.setTextAndCodeForDropDown(configurationService.getConfig('MOVEMENT_SOURCE_TYPES'),'MOVEMENT_SOURCE_TYPES','MOVEMENT'); - - $scope.submitingReport = false; - - $scope.repFormServ = reportFormService; - - - $scope.aggregationTypes = [ - { - code: "FLAG_STATE", - text: locale.getString('spatial.criteria_flag_state') - }, - { - code: "VESSEL", - text: locale.getString('spatial.criteria_vessel') - }, - { - code: "DATE", - text: locale.getString('spatial.criteria_date'), - items: [ - { - code: "DATE_DAY", - text: locale.getString('spatial.criteria_date_day') - }, - { - code: "DATE_MONTH", - text: locale.getString('spatial.criteria_date_month') - }, - { - code: "DATE_YEAR", - text: locale.getString('spatial.criteria_date_year') - } - ], - selection: "single" - }, - { - code: "AREA", - text: locale.getString('spatial.criteria_area'), - items: [ - { - code: "TERRITORY", - text: locale.getString('spatial.criteria_territory') - }, - { - code: "FAO_AREA", - text: locale.getString('spatial.criteria_fao_area') - }, - { - code: "ICES_STAT_RECTANGLE", - text: locale.getString('spatial.criteria_ices_stat_rectangle') - }, - { - code: "EFFORT_ZONE", - text: locale.getString('spatial.criteria_effort_zone') - }, - { - code: "RFMO", - text: locale.getString('spatial.criteria_rfmo') - }, - { - code: "GFCM_GSA", - text: locale.getString('spatial.criteria_gfcm_gsa') - }, - { - code: "GFCM_STAT_RECTANGLE", - text: locale.getString('spatial.criteria_gfcm_stat_rectangle') - } - ], - selection: "multiple" - }, - { - code: "GEAR_TYPE", - text: locale.getString('spatial.criteria_gear_type') - }, - { - code: "SPECIES", - text: locale.getString('spatial.criteria_species') - }, - { - code: "PRESENTATION", - text: locale.getString('spatial.criteria_presentation') - } - ]; - - $scope.showSaveBtn = function(){ - var result = false; - if ($scope.formMode === 'CREATE'){ - result = true; - } else { - if ((angular.isDefined($scope.report) && $scope.report.createdBy === userService.getUserName()) || $scope.isAllowed('Reporting', 'MANAGE_ALL_REPORTS')){ - result = true; - } - } - return result; - }; - - $scope.init = function(){ - $scope.formAlert = { - visible: false, - msg: '' - }; - $scope.submitingReport = false; - - if ($scope.formMode === 'CREATE'){ - $scope.report.vesselsSelection = []; - } - $scope.showVesselFilter = false; - $scope.selectedAreas = []; - - $scope.shared = { - vesselSearchBy: 'asset', - searchVesselString: '', - selectAll: false, - selectedVessels: 0, - vessels: [], - areas: [] - }; - - if ($scope.report.movSources.length === 0){ - $scope.report.movSources = []; - angular.forEach($scope.movementSourceTypes, function(item){ - $scope.report.movSources.push(item.code); - }); - } - - $scope.checkVisibilities(); - }; - - $scope.checkVisibilities = function(){ - $scope.visibilities = [{"text": locale.getString('spatial.reports_table_share_label_private'), "code": "private"}]; - var availableVisibilities = ['SCOPE', 'PUBLIC']; - angular.forEach(availableVisibilities, function(visibility) { - if (userService.isAllowed('SHARE_REPORT_' + visibility, 'Reporting', true) || userService.isAllowed('MANAGE_ALL_REPORTS', 'Reporting', true)){ - var name = visibility.toLowerCase(); - $scope.visibilities.push({"text": locale.getString('spatial.reports_table_share_label_' + name), "code": name}); - } - }); - }; - - $scope.resetForm = function(){ - reportFormService.report = new Report(); - $scope.report = reportFormService.report; - $scope.init(); - $scope.reportForm.$setPristine(); - $scope.clearVmsErrors(); - }; - - $scope.clearVmsErrors = function(){ - for (var attr in $scope.reportForm.$error){ - $scope.reportForm.$setValidity(attr, true); - } - }; - - $scope.validateRanges = function(){ - var min, max, minD, maxD; - var status = true; - - //Validate positions speed range - if (angular.isDefined($scope.report.vmsFilters.positions) && !_.isEmpty($scope.report.vmsFilters.positions)){ - min = $scope.report.vmsFilters.positions.movMinSpeed; - max = $scope.report.vmsFilters.positions.movMaxSpeed; - - validateRangeFieldGroup(min,max,'movMinSpeed','movMaxSpeed','positionSecForm'); - } - - //Validate segments speed and duration ranges - if (angular.isDefined($scope.report.vmsFilters.segments) && !_.isEmpty($scope.report.vmsFilters.segments)){ - min = $scope.report.vmsFilters.segments.segMinSpeed; - max = $scope.report.vmsFilters.segments.segMaxSpeed; - - validateRangeFieldGroup(min,max,'segMinSpeed','segMaxSpeed','segmentSecForm'); - - minD = $scope.report.vmsFilters.segments.segMinDuration; - maxD = $scope.report.vmsFilters.segments.segMaxDuration; - - validateRangeFieldGroup(minD,maxD,'segMinDuration','segMaxDuration','segmentSecForm'); - } - - //Validate tracks time at sea and duration ranges - if (angular.isDefined($scope.report.vmsFilters.tracks) && !_.isEmpty($scope.report.vmsFilters.tracks)){ - min = $scope.report.vmsFilters.tracks.trkMinTime; - max = $scope.report.vmsFilters.tracks.trkMaxTime; - - validateRangeFieldGroup(min,max,'trkMinTime','trkMaxTime','trackSecForm'); - - minD = $scope.report.vmsFilters.tracks.trkMinDuration; - maxD = $scope.report.vmsFilters.tracks.trkMaxDuration; - - validateRangeFieldGroup(minD,maxD,'trkMinDuration','trkMaxDuration','trackSecForm'); - } - }; - - var validateRangeFieldGroup = function(min,max,fieldMin,fieldMax,subForm){ - if(angular.isDefined(min) && min<0){ - $scope.reportForm.reportBodyForm[subForm][fieldMin].$setValidity('minError', false); - }else{ - $scope.reportForm.reportBodyForm[subForm][fieldMin].$setValidity('minError', true); - } - if(angular.isDefined(max) && max<0){ - $scope.reportForm.reportBodyForm[subForm][fieldMax].$setValidity('minError', false); - }else{ - $scope.reportForm.reportBodyForm[subForm][fieldMax].$setValidity('minError', true); - } - if(angular.isDefined(min) && angular.isDefined(max) && min !== null && max !== null && min > max){ - $scope.reportForm.reportBodyForm[subForm][fieldMax].$setValidity('maxError', false); - }else{ - $scope.reportForm.reportBodyForm[subForm][fieldMax].$setValidity('maxError', true); - } - }; - - $scope.saveReport = function(){ - loadingStatus.isLoading('SaveReport',true); - $scope.submitingReport = true; - $scope.validateRanges(); - if ($scope.reportForm.$valid){ - $scope.report.areas = $scope.exportSelectedAreas(); - $scope.currentRepCopy = angular.copy($scope.report); - $scope.report.currentMapConfig.mapConfiguration.layerSettings = reportFormService.checkLayerSettings($scope.report.currentMapConfig.mapConfiguration.layerSettings); - $scope.report = reportFormService.checkMapConfigDifferences($scope.report); - switch ($scope.formMode) { - case 'CREATE': - reportRestService.createReport($scope.report).then(createReportSuccess, createReportError); - break; - case 'EDIT': - reportRestService.updateReport($scope.report).then(updateReportSuccess, updateReportError); - break; - case 'EDIT-FROM-LIVEVIEW': - if (!angular.equals($scope.currentRepCopy, reportFormService.liveView.originalReport)){ - reportRestService.updateReport($scope.report).then(updateReportSuccess, updateReportError); - } else { - loadingStatus.isLoading('SaveReport',false); - $scope.repNav.goToView('liveViewPanel','mapPanel'); - } - - break; - } - } else { - loadingStatus.isLoading('SaveReport',false); - var invalidElm = angular.element('#reportForm')[0].querySelector('.ng-invalid'); - var errorElm = angular.element('#reportForm')[0].querySelector('.has-error'); - if (invalidElm){ - invalidElm.scrollIntoView(); - } else if (invalidElm === null && errorElm){ - errorElm.scrollIntoView(); - } - } - }; - - $scope.validateDates = function(sDate, eDate){ - var sMomDate = moment(sDate, 'YYYY-MM-DD'); - var eMomDate = moment(eDate, 'YYYY-MM-DD'); - - if (sMomDate.isAfter(eMomDate)){ - return false; - } else { - return true; - } - }; - - $scope.openMapConfigurationModal = function(){ - var modalInstance = $modal.open({ - templateUrl: 'partial/spatial/reportsPanel/reportForm/mapConfigurationModal/mapConfigurationModal.html', - controller: 'MapconfigurationmodalCtrl', - size: 'lg', - resolve: { - reportConfigs: function(){ - return angular.copy($scope.report.currentMapConfig); - }, - displayComponents: function(){ - var components = { - visibility: { - position: true, - segment: true - } - }; - - if ($scope.report.withMap){ - components.map = true; - components.layers = true; - components.referenceData = true; - components.styles = { - position: true, - segment: true, - alarm: true - }; - } - - return components; - } - } - }); - - modalInstance.result.then(function(data){ - if(!angular.equals($scope.report.currentMapConfig.mapConfiguration,data.mapSettings)){ - $scope.reportForm.$setDirty(); - $scope.report.currentMapConfig.mapConfiguration = data.mapSettings; - } - }); - }; - - $scope.runReport = function() { - $scope.submitingReport = true; - $scope.validateRanges(); - if($scope.reportForm.reportBodyForm.$valid){ - $scope.report.areas = $scope.exportSelectedAreas(); - reportService.runReportWithoutSaving($scope.report); - - if (!angular.equals($scope.report, reportFormService.liveView.originalReport)){ - reportFormService.liveView.outOfDate = true; - } else { - reportFormService.liveView.outOfDate = false; - } - reportFormService.liveView.currentTempReport = undefined; - }else{ - var invalidElm = angular.element('#reportForm')[0].querySelector('.ng-invalid'); - var errorElm = angular.element('#reportForm')[0].querySelector('.has-error'); - if (invalidElm){ - invalidElm.scrollIntoView(); - } else if (invalidElm === null && errorElm){ - errorElm.scrollIntoView(); - } - } - }; - - $scope.saveAsReport = function() { - $scope.submitingReport = true; - $scope.validateRanges(); - if ($scope.reportForm.reportBodyForm.$valid){ - var modalInstance = $modal.open({ - templateUrl: 'partial/spatial/reportsPanel/reportForm/saveAsModal/saveAsModal.html', - controller: 'SaveasmodalCtrl', - size: 'md', - resolve: { - reportData: function(){ - return $scope.report; - } - } - }); - - modalInstance.result.then(function(data){ - data.areas = $scope.exportSelectedAreas(); - data.currentMapConfig.mapConfiguration.layerSettings = reportFormService.checkLayerSettings(data.currentMapConfig.mapConfiguration.layerSettings); - data = reportFormService.checkMapConfigDifferences(data); - reportRestService.createReport(data).then(createReportSuccess, createReportError); - }); - } else { - var invalidElm = angular.element('#reportForm')[0].querySelector('.ng-invalid'); - var errorElm = angular.element('#reportForm')[0].querySelector('.has-error'); - if (invalidElm){ - invalidElm.scrollIntoView(); - } else if (invalidElm === null && errorElm){ - errorElm.scrollIntoView(); - } - } - - }; - - $scope.$watch('report.positionSelector', function(newVal, oldVal){ - if ($scope.report && newVal === 'all'){ - //Reset X Value field - $scope.report.xValue = undefined; - } - }); - - $scope.$watch('report.positionTypeSelector', function(newVal, oldVal){ - if ($scope.report && newVal === 'hours'){ - $scope.report.startDateTime = undefined; - $scope.report.endDateTime = undefined; - } - }); - - var createReportSuccess = function(response){ - reportService.loadReportHistory(); - if($scope.repNav.hasPreviousState()){ - $scope.repNav.goToPreviousView(); - }else{ - $scope.repNav.goToView('liveViewPanel','mapPanel',$scope.openReportList); - } - reportFormService.report = undefined; - reportMsgService.show('spatial.success_create_report', 'success', true, 8000); - loadingStatus.isLoading('SaveReport',false); - }; - - var createReportError = function(error){ - reportError(error,'spatial.error_create_report'); - loadingStatus.isLoading('SaveReport',false); - }; - - var updateReportSuccess = function(response){ - reportService.loadReportHistory(); - - reportMsgService.show('spatial.success_update_report', 'success', true, 8000); - if ($scope.formMode === 'EDIT'){ - if($scope.repNav.hasPreviousState()){ - $scope.repNav.goToPreviousView(); - }else{ - $scope.repNav.goToView('liveViewPanel','mapPanel',$scope.openReportList); - } - reportFormService.report = undefined; - } else if ($scope.formMode === 'EDIT-FROM-LIVEVIEW'){ - angular.copy($scope.currentRepCopy,reportFormService.liveView.currentReport); - delete $scope.currentRepCopy; - angular.copy(reportFormService.liveView.currentReport, reportFormService.liveView.originalReport); - reportFormService.liveView.outOfDate = false; - //reportService.runReport($scope.report); - - if (reportFormService.liveView.currentReport.reportType === 'summary'){ - $scope.repNav.goToView('liveViewPanel','catchDetails'); - } else { - $scope.repNav.goToView('liveViewPanel','mapPanel'); - } - - } - loadingStatus.isLoading('SaveReport',false); - }; - - var updateReportError = function(error){ - angular.copy($scope.currentRepCopy,reportFormService.liveView.currentReport); - delete $scope.currentRepCopy; - reportError(error,'spatial.error_update_report'); - loadingStatus.isLoading('SaveReport',false); - }; - - var reportError = function(error, defaultMsg) { - $scope.formAlert.visible = true; - var errorMsg; - - if (angular.isDefined(error.data.msg)) { - var msg = error.data.msg; - if (msg.indexOf('spatial') === -1){ - msg = 'spatial.' + msg; - } - errorMsg = locale.getString(msg); - } - - if (!angular.isDefined(errorMsg) || errorMsg.indexOf('KEY_NOT_FOUND') !== -1 || errorMsg === ''){ - errorMsg = locale.getString(defaultMsg); - } - - $scope.formAlert.msg = errorMsg; - }; - - $scope.resetReport = function(){ - loadingStatus.isLoading('ResetReport',true); - $scope.reportForm.$setPristine(); - reportRestService.getReport($scope.report.id).then(function(response){ - $scope.init(); - angular.copy($scope.report.fromJson(response), $scope.report); - $scope.report.currentMapConfig = {mapConfiguration: {}}; - if (angular.isDefined($scope.report.areas) && $scope.report.areas.length > 0){ - getAreaProperties(buildAreaPropArray()); - } - angular.copy($scope.report.mapConfiguration,$scope.report.currentMapConfig.mapConfiguration); - loadingStatus.isLoading('ResetReport',false); - }, function(error){ - $anchorScroll(); - $scope.formAlert.msg = locale.getString('spatial.error_entry_not_found'); - $scope.formAlert.visible = true; - loadingStatus.isLoading('ResetReport',false); - }); - }; - - $scope.cancel = function(){ - if ($scope.formMode === 'EDIT-FROM-LIVEVIEW'){ - angular.copy(reportFormService.liveView.currentTempReport, reportFormService.liveView.currentReport); - if (!angular.equals(reportFormService.liveView.currentReport, reportFormService.liveView.originalReport)){ - reportFormService.liveView.outOfDate = true; - } - reportFormService.liveView.currentTempReport = undefined; - } else { - reportFormService.report = undefined; - } - $scope.repNav.goToPreviousView(); - }; - - var loadReportForm = function(){ - switch($scope.formMode){ - case 'CREATE': - reportFormService.report = new Report(); - $scope.report = reportFormService.report; - break; - case 'EDIT': - $scope.report = reportFormService.report; - break; - case 'EDIT-FROM-LIVEVIEW': - $scope.report = reportFormService.liveView.currentReport; - reportFormService.liveView.currentTempReport = angular.copy($scope.report); - break; - } - - $scope.init(); - - if (angular.isDefined($scope.report.areas) && $scope.report.areas.length > 0){ - getAreaProperties(buildAreaPropArray()); - } - setTimeout(function() { - $scope.reportForm.$setPristine(); - }, 100); - }; - - /** - * Export all selected areas when modal is closed while saving - * - * @memberof ReportformCtrl - * @public - * @alias exportSelectedAreas - * @returns {Array} An array containing all selected areas properly formatted to submit to server side - */ - $scope.exportSelectedAreas = function(){ - var exported = []; - for (var i = 0; i < $scope.selectedAreas.length; i++){ - var area = { - gid: parseInt($scope.selectedAreas[i].gid), - areaType: $scope.selectedAreas[i].areaType - }; - exported.push(area); - } - - return exported; - }; - - /** - * Build proper array from the modal resolved selected areas. This is to be used to request area properties to server - * - * @memberof AreasselectionfieldsetCtrl - * @private - */ - var buildAreaPropArray = function(){ - var areas = []; - for (var i = 0; i < $scope.report.areas.length; i++){ - areas.push({ - gid : $scope.report.areas[i].gid, - areaType: $scope.report.areas[i].areaType - }); - } - return areas; - }; - - /** - * Get area properties from the Spatial REST API - * - * @memberof AreasselectionfieldsetCtrl - * @private - */ - var getAreaProperties = function(data){ - spatialRestService.getAreaProperties(data).then(function(response){ - $scope.selectedAreas = buildSelectedAreasArray(response.data); - }, function(error){ - $anchorScroll(); - $scope.formAlert.msg = locale.getString('spatial.area_selection_modal_get_selected_sys_area_details_error'); - $scope.formAlert.visible = true; - }); - }; - - /** - * Build properly formated array out of the area properties server response data and merge it with the existent modal resolved selected areas. - * - * @memberof AreasselectionfieldsetCtrl - * @private - */ - var buildSelectedAreasArray = function(data){ - var finalAreas = []; - for (var i = 0; i < data.length; i++){ - var area = data[i]; - area.gid = parseInt(area.gid); - for (var j = 0; j < $scope.report.areas.length; j++){ - if (parseInt($scope.report.areas[j].gid) === parseInt(data[i].gid) && $scope.report.areas[j].areaType === data[i].areaType){ - area.id = parseInt($scope.report.areas[j].id); - } - } - finalAreas.push(area); - } - - return finalAreas; - }; - - $scope.$watch(function(){return $scope.repNav.isViewVisible('reportForm');}, function(newVal,oldVal){ - if(newVal===true){ - loadReportForm(); - } - }); - -}); - +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').controller('ReportformCtrl',function($scope, $modal, $anchorScroll, reportMsgService, locale, Report, reportRestService, spatialRestService, configurationService, movementRestService, reportService, SpatialConfig, spatialConfigRestService, userService, loadingStatus, reportFormService, mapService){ + //Report form mode + $scope.showVesselFilter = false; + + //set visibility types in dropdown option + $scope.visibilities = []; + + //Set the available report types to create + $scope.reportTypes = [ + {"text": locale.getString('spatial.reports_form_type_standard'), "code": "standard"}, + {"text": locale.getString('spatial.reports_form_type_summary'), "code": "summary"} + ]; + + //Set positions selector dropdown options + $scope.positionItems = [ + {"text": locale.getString('spatial.reports_form_positions_selector_option_all'), "code": "all"}, + {"text": locale.getString('spatial.reports_form_positions_selector_option_last'), "code": "last"} + ]; + + //Set positions selector dropdown options + $scope.positionTypeItems = [ + {"text": locale.getString('spatial.reports_form_positions_selector_type_option_positions'), "code": "positions"}, + {"text": locale.getString('spatial.reports_form_positions_selector_type_option_hours'), "code": "hours"} + ]; + + //Set vessel search type dropdown options + $scope.vesselSearchItems = [ + {"text": locale.getString('spatial.reports_form_vessels_search_by_vessel'), "code": "asset"}, + {"text": locale.getString('spatial.reports_form_vessels_search_by_group'), "code": "vgroup"} + ]; + + //Set movement type dropdown options + $scope.movementTypes = configurationService.setTextAndCodeForDropDown(configurationService.getValue('MOVEMENT', 'MESSAGE_TYPE'),'MESSAGE_TYPE','MOVEMENT'); + + //Set movemment activity type dropdown options + $scope.activityTypes = configurationService.setTextAndCodeForDropDown(configurationService.getValue('MOVEMENT', 'ACTIVITY_TYPE'), 'ACTIVITY_TYPE', 'MOVEMENT'); + + //Set category types dropdown options + $scope.categoryTypes = configurationService.setTextAndCodeForDropDown(configurationService.getValue('MOVEMENT', 'CATEGORY_TYPE'), 'CATEGORY_TYPE', 'MOVEMENT'); + + //Set movement source types dropdown options + $scope.movementSourceTypes = configurationService.setTextAndCodeForDropDown(configurationService.getConfig('MOVEMENT_SOURCE_TYPES'),'MOVEMENT_SOURCE_TYPES','MOVEMENT'); + + $scope.submitingReport = false; + + $scope.repFormServ = reportFormService; + + + $scope.aggregationTypes = [ + { + code: "FLAG_STATE", + text: locale.getString('spatial.criteria_flag_state') + }, + { + code: "VESSEL", + text: locale.getString('spatial.criteria_vessel') + }, + { + code: "DATE", + text: locale.getString('spatial.criteria_date'), + items: [ + { + code: "DATE_DAY", + text: locale.getString('spatial.criteria_date_day') + }, + { + code: "DATE_MONTH", + text: locale.getString('spatial.criteria_date_month') + }, + { + code: "DATE_YEAR", + text: locale.getString('spatial.criteria_date_year') + } + ], + selection: "single" + }, + { + code: "AREA", + text: locale.getString('spatial.criteria_area'), + items: [ + { + code: "TERRITORY", + text: locale.getString('spatial.criteria_territory') + }, + { + code: "FAO_AREA", + text: locale.getString('spatial.criteria_fao_area') + }, + { + code: "ICES_STAT_RECTANGLE", + text: locale.getString('spatial.criteria_ices_stat_rectangle') + }, + { + code: "EFFORT_ZONE", + text: locale.getString('spatial.criteria_effort_zone') + }, + { + code: "RFMO", + text: locale.getString('spatial.criteria_rfmo') + }, + { + code: "GFCM_GSA", + text: locale.getString('spatial.criteria_gfcm_gsa') + }, + { + code: "GFCM_STAT_RECTANGLE", + text: locale.getString('spatial.criteria_gfcm_stat_rectangle') + } + ], + selection: "multiple" + }, + { + code: "GEAR_TYPE", + text: locale.getString('spatial.criteria_gear_type') + }, + { + code: "SPECIES", + text: locale.getString('spatial.criteria_species') + }, + { + code: "PRESENTATION", + text: locale.getString('spatial.criteria_presentation') + } + ]; + + $scope.showSaveBtn = function(){ + var result = false; + if ($scope.formMode === 'CREATE'){ + result = true; + } else { + if ((angular.isDefined($scope.report) && $scope.report.createdBy === userService.getUserName()) || $scope.isAllowed('Reporting', 'MANAGE_ALL_REPORTS')){ + result = true; + } + } + return result; + }; + + $scope.init = function(){ + $scope.formAlert = { + visible: false, + msg: '' + }; + $scope.submitingReport = false; + + if ($scope.formMode === 'CREATE'){ + $scope.report.vesselsSelection = []; + } + $scope.showVesselFilter = false; + $scope.selectedAreas = []; + + $scope.shared = { + vesselSearchBy: 'asset', + searchVesselString: '', + selectAll: false, + selectedVessels: 0, + vessels: [], + areas: [] + }; + + if ($scope.report.movSources.length === 0){ + $scope.report.movSources = []; + angular.forEach($scope.movementSourceTypes, function(item){ + $scope.report.movSources.push(item.code); + }); + } + + $scope.checkVisibilities(); + }; + + $scope.checkVisibilities = function(){ + $scope.visibilities = [{"text": locale.getString('spatial.reports_table_share_label_private'), "code": "private"}]; + var availableVisibilities = ['SCOPE', 'PUBLIC']; + angular.forEach(availableVisibilities, function(visibility) { + if (userService.isAllowed('SHARE_REPORT_' + visibility, 'Reporting', true) || userService.isAllowed('MANAGE_ALL_REPORTS', 'Reporting', true)){ + var name = visibility.toLowerCase(); + $scope.visibilities.push({"text": locale.getString('spatial.reports_table_share_label_' + name), "code": name}); + } + }); + }; + + $scope.resetForm = function(){ + reportFormService.report = new Report(); + $scope.report = reportFormService.report; + $scope.init(); + $scope.reportForm.$setPristine(); + $scope.clearVmsErrors(); + }; + + $scope.clearVmsErrors = function(){ + for (var attr in $scope.reportForm.$error){ + $scope.reportForm.$setValidity(attr, true); + } + }; + + $scope.validateRanges = function(){ + var min, max, minD, maxD; + var status = true; + + //Validate positions speed range + if (angular.isDefined($scope.report.vmsFilters.positions) && !_.isEmpty($scope.report.vmsFilters.positions)){ + min = $scope.report.vmsFilters.positions.movMinSpeed; + max = $scope.report.vmsFilters.positions.movMaxSpeed; + + validateRangeFieldGroup(min,max,'movMinSpeed','movMaxSpeed','positionSecForm'); + } + + //Validate segments speed and duration ranges + if (angular.isDefined($scope.report.vmsFilters.segments) && !_.isEmpty($scope.report.vmsFilters.segments)){ + min = $scope.report.vmsFilters.segments.segMinSpeed; + max = $scope.report.vmsFilters.segments.segMaxSpeed; + + validateRangeFieldGroup(min,max,'segMinSpeed','segMaxSpeed','segmentSecForm'); + + minD = $scope.report.vmsFilters.segments.segMinDuration; + maxD = $scope.report.vmsFilters.segments.segMaxDuration; + + validateRangeFieldGroup(minD,maxD,'segMinDuration','segMaxDuration','segmentSecForm'); + } + + //Validate tracks time at sea and duration ranges + if (angular.isDefined($scope.report.vmsFilters.tracks) && !_.isEmpty($scope.report.vmsFilters.tracks)){ + min = $scope.report.vmsFilters.tracks.trkMinTime; + max = $scope.report.vmsFilters.tracks.trkMaxTime; + + validateRangeFieldGroup(min,max,'trkMinTime','trkMaxTime','trackSecForm'); + + minD = $scope.report.vmsFilters.tracks.trkMinDuration; + maxD = $scope.report.vmsFilters.tracks.trkMaxDuration; + + validateRangeFieldGroup(minD,maxD,'trkMinDuration','trkMaxDuration','trackSecForm'); + } + }; + + var validateRangeFieldGroup = function(min,max,fieldMin,fieldMax,subForm){ + if(angular.isDefined(min) && min<0){ + $scope.reportForm.reportBodyForm[subForm][fieldMin].$setValidity('minError', false); + }else{ + $scope.reportForm.reportBodyForm[subForm][fieldMin].$setValidity('minError', true); + } + if(angular.isDefined(max) && max<0){ + $scope.reportForm.reportBodyForm[subForm][fieldMax].$setValidity('minError', false); + }else{ + $scope.reportForm.reportBodyForm[subForm][fieldMax].$setValidity('minError', true); + } + if(angular.isDefined(min) && angular.isDefined(max) && min !== null && max !== null && min > max){ + $scope.reportForm.reportBodyForm[subForm][fieldMax].$setValidity('maxError', false); + }else{ + $scope.reportForm.reportBodyForm[subForm][fieldMax].$setValidity('maxError', true); + } + }; + + $scope.saveReport = function(){ + loadingStatus.isLoading('SaveReport',true); + $scope.submitingReport = true; + $scope.validateRanges(); + if ($scope.reportForm.$valid){ + $scope.report.areas = $scope.exportSelectedAreas(); + if (angular.isDefined(mapService.map) && $scope.formMode !== 'CREATE') { + $scope.report.mapZoom = mapService.map.getView().getZoom(); + $scope.report.mapCenter = JSON.stringify(mapService.map.getView().getCenter()); + } + if ($scope.formMode !== 'CREATE') { + $scope.report.mapLayerConfig = JSON.stringify(reportService.getLayerConfig()); + } + $scope.currentRepCopy = angular.copy($scope.report); + $scope.report.currentMapConfig.mapConfiguration.layerSettings = reportFormService.checkLayerSettings($scope.report.currentMapConfig.mapConfiguration.layerSettings); + $scope.report = reportFormService.checkMapConfigDifferences($scope.report); + switch ($scope.formMode) { + case 'CREATE': + reportRestService.createReport($scope.report).then(createReportSuccess, createReportError); + break; + case 'EDIT': + reportRestService.updateReport($scope.report).then(updateReportSuccess, updateReportError); + break; + case 'EDIT-FROM-LIVEVIEW': + if (!angular.equals($scope.currentRepCopy, reportFormService.liveView.originalReport)){ + reportRestService.updateReport($scope.report).then(updateReportSuccess, updateReportError); + } else { + loadingStatus.isLoading('SaveReport',false); + $scope.repNav.goToView('liveViewPanel','mapPanel'); + } + + break; + } + } else { + loadingStatus.isLoading('SaveReport',false); + var invalidElm = angular.element('#reportForm')[0].querySelector('.ng-invalid'); + var errorElm = angular.element('#reportForm')[0].querySelector('.has-error'); + if (invalidElm){ + invalidElm.scrollIntoView(); + } else if (invalidElm === null && errorElm){ + errorElm.scrollIntoView(); + } + } + }; + + $scope.validateDates = function(sDate, eDate){ + var sMomDate = moment(sDate, 'YYYY-MM-DD'); + var eMomDate = moment(eDate, 'YYYY-MM-DD'); + + if (sMomDate.isAfter(eMomDate)){ + return false; + } else { + return true; + } + }; + + $scope.openMapConfigurationModal = function(){ + var modalInstance = $modal.open({ + templateUrl: 'partial/spatial/reportsPanel/reportForm/mapConfigurationModal/mapConfigurationModal.html', + controller: 'MapconfigurationmodalCtrl', + size: 'lg', + resolve: { + reportConfigs: function(){ + return angular.copy($scope.report.currentMapConfig); + }, + displayComponents: function(){ + var components = { + visibility: { + position: true, + segment: true + } + }; + + if ($scope.report.withMap){ + components.map = true; + components.layers = true; + components.referenceData = true; + components.styles = { + position: true, + segment: true, + alarm: true + }; + } + + return components; + } + } + }); + + modalInstance.result.then(function(data){ + if(!angular.equals($scope.report.currentMapConfig.mapConfiguration,data.mapSettings)){ + $scope.reportForm.$setDirty(); + $scope.report.currentMapConfig.mapConfiguration = data.mapSettings; + } + }); + }; + + $scope.runReport = function() { + $scope.submitingReport = true; + $scope.validateRanges(); + if($scope.reportForm.reportBodyForm.$valid){ + $scope.report.areas = $scope.exportSelectedAreas(); + reportService.runReportWithoutSaving($scope.report); + + if (!angular.equals($scope.report, reportFormService.liveView.originalReport)){ + reportFormService.liveView.outOfDate = true; + } else { + reportFormService.liveView.outOfDate = false; + } + reportFormService.liveView.currentTempReport = undefined; + }else{ + var invalidElm = angular.element('#reportForm')[0].querySelector('.ng-invalid'); + var errorElm = angular.element('#reportForm')[0].querySelector('.has-error'); + if (invalidElm){ + invalidElm.scrollIntoView(); + } else if (invalidElm === null && errorElm){ + errorElm.scrollIntoView(); + } + } + }; + + $scope.saveAsReport = function() { + $scope.submitingReport = true; + $scope.validateRanges(); + if ($scope.reportForm.reportBodyForm.$valid){ + var modalInstance = $modal.open({ + templateUrl: 'partial/spatial/reportsPanel/reportForm/saveAsModal/saveAsModal.html', + controller: 'SaveasmodalCtrl', + size: 'md', + resolve: { + reportData: function(){ + return $scope.report; + } + } + }); + + modalInstance.result.then(function(data){ + if (angular.isDefined(mapService.map)) { + data.mapZoom = mapService.map.getView().getZoom(); + data.mapCenter = JSON.stringify(mapService.map.getView().getCenter()); + } + data.mapLayerConfig = JSON.stringify(reportService.getLayerConfig()); + data.areas = $scope.exportSelectedAreas(); + data.currentMapConfig.mapConfiguration.layerSettings = reportFormService.checkLayerSettings(data.currentMapConfig.mapConfiguration.layerSettings); + data = reportFormService.checkMapConfigDifferences(data); + reportRestService.createReport(data).then(createReportSuccess, createReportError); + }); + } else { + var invalidElm = angular.element('#reportForm')[0].querySelector('.ng-invalid'); + var errorElm = angular.element('#reportForm')[0].querySelector('.has-error'); + if (invalidElm){ + invalidElm.scrollIntoView(); + } else if (invalidElm === null && errorElm){ + errorElm.scrollIntoView(); + } + } + + }; + + $scope.$watch('report.positionSelector', function(newVal, oldVal){ + if ($scope.report && newVal === 'all'){ + //Reset X Value field + $scope.report.xValue = undefined; + } + }); + + $scope.$watch('report.positionTypeSelector', function(newVal, oldVal){ + if ($scope.report && newVal === 'hours'){ + $scope.report.startDateTime = undefined; + $scope.report.endDateTime = undefined; + } + }); + + var createReportSuccess = function(response){ + reportService.loadReportHistory(); + if($scope.repNav.hasPreviousState()){ + $scope.repNav.goToPreviousView(); + }else{ + $scope.repNav.goToView('liveViewPanel','mapPanel',$scope.openReportList); + } + reportFormService.report = undefined; + reportMsgService.show('spatial.success_create_report', 'success', true, 8000); + loadingStatus.isLoading('SaveReport',false); + }; + + var createReportError = function(error){ + reportError(error,'spatial.error_create_report'); + loadingStatus.isLoading('SaveReport',false); + }; + + var updateReportSuccess = function(response){ + reportService.loadReportHistory(); + + reportMsgService.show('spatial.success_update_report', 'success', true, 8000); + if ($scope.formMode === 'EDIT'){ + if($scope.repNav.hasPreviousState()){ + $scope.repNav.goToPreviousView(); + }else{ + $scope.repNav.goToView('liveViewPanel','mapPanel',$scope.openReportList); + } + reportFormService.report = undefined; + } else if ($scope.formMode === 'EDIT-FROM-LIVEVIEW'){ + angular.copy($scope.currentRepCopy,reportFormService.liveView.currentReport); + delete $scope.currentRepCopy; + angular.copy(reportFormService.liveView.currentReport, reportFormService.liveView.originalReport); + reportFormService.liveView.outOfDate = false; + //reportService.runReport($scope.report); + + if (reportFormService.liveView.currentReport.reportType === 'summary'){ + $scope.repNav.goToView('liveViewPanel','catchDetails'); + } else { + $scope.repNav.goToView('liveViewPanel','mapPanel'); + } + + } + loadingStatus.isLoading('SaveReport',false); + }; + + var updateReportError = function(error){ + angular.copy($scope.currentRepCopy,reportFormService.liveView.currentReport); + delete $scope.currentRepCopy; + reportError(error,'spatial.error_update_report'); + loadingStatus.isLoading('SaveReport',false); + }; + + var reportError = function(error, defaultMsg) { + $scope.formAlert.visible = true; + var errorMsg; + + if (angular.isDefined(error.data.msg)) { + var msg = error.data.msg; + if (msg.indexOf('spatial') === -1){ + msg = 'spatial.' + msg; + } + errorMsg = locale.getString(msg); + } + + if (!angular.isDefined(errorMsg) || errorMsg.indexOf('KEY_NOT_FOUND') !== -1 || errorMsg === ''){ + errorMsg = locale.getString(defaultMsg); + } + + $scope.formAlert.msg = errorMsg; + }; + + $scope.resetReport = function(){ + loadingStatus.isLoading('ResetReport',true); + $scope.reportForm.$setPristine(); + reportRestService.getReport($scope.report.id).then(function(response){ + $scope.init(); + angular.copy($scope.report.fromJson(response), $scope.report); + $scope.report.currentMapConfig = {mapConfiguration: {}}; + if (angular.isDefined($scope.report.areas) && $scope.report.areas.length > 0){ + getAreaProperties(buildAreaPropArray()); + } + angular.copy($scope.report.mapConfiguration,$scope.report.currentMapConfig.mapConfiguration); + loadingStatus.isLoading('ResetReport',false); + }, function(error){ + $anchorScroll(); + $scope.formAlert.msg = locale.getString('spatial.error_entry_not_found'); + $scope.formAlert.visible = true; + loadingStatus.isLoading('ResetReport',false); + }); + }; + + $scope.cancel = function(){ + if ($scope.formMode === 'EDIT-FROM-LIVEVIEW'){ + angular.copy(reportFormService.liveView.currentTempReport, reportFormService.liveView.currentReport); + if (!angular.equals(reportFormService.liveView.currentReport, reportFormService.liveView.originalReport)){ + reportFormService.liveView.outOfDate = true; + } + reportFormService.liveView.currentTempReport = undefined; + } else { + reportFormService.report = undefined; + } + $scope.repNav.goToPreviousView(); + }; + + var loadReportForm = function(){ + switch($scope.formMode){ + case 'CREATE': + reportFormService.report = new Report(); + $scope.report = reportFormService.report; + break; + case 'EDIT': + $scope.report = reportFormService.report; + break; + case 'EDIT-FROM-LIVEVIEW': + $scope.report = reportFormService.liveView.currentReport; + reportFormService.liveView.currentTempReport = angular.copy($scope.report); + break; + } + + $scope.init(); + + if (angular.isDefined($scope.report.areas) && $scope.report.areas.length > 0){ + getAreaProperties(buildAreaPropArray()); + } + setTimeout(function() { + $scope.reportForm.$setPristine(); + }, 100); + }; + + /** + * Export all selected areas when modal is closed while saving + * + * @memberof ReportformCtrl + * @public + * @alias exportSelectedAreas + * @returns {Array} An array containing all selected areas properly formatted to submit to server side + */ + $scope.exportSelectedAreas = function(){ + var exported = []; + for (var i = 0; i < $scope.selectedAreas.length; i++){ + var area = { + gid: parseInt($scope.selectedAreas[i].gid), + areaType: $scope.selectedAreas[i].areaType + }; + exported.push(area); + } + + return exported; + }; + + /** + * Build proper array from the modal resolved selected areas. This is to be used to request area properties to server + * + * @memberof AreasselectionfieldsetCtrl + * @private + */ + var buildAreaPropArray = function(){ + var areas = []; + for (var i = 0; i < $scope.report.areas.length; i++){ + areas.push({ + gid : $scope.report.areas[i].gid, + areaType: $scope.report.areas[i].areaType + }); + } + return areas; + }; + + /** + * Get area properties from the Spatial REST API + * + * @memberof AreasselectionfieldsetCtrl + * @private + */ + var getAreaProperties = function(data){ + spatialRestService.getAreaProperties(data).then(function(response){ + $scope.selectedAreas = buildSelectedAreasArray(response.data); + }, function(error){ + $anchorScroll(); + $scope.formAlert.msg = locale.getString('spatial.area_selection_modal_get_selected_sys_area_details_error'); + $scope.formAlert.visible = true; + }); + }; + + /** + * Build properly formated array out of the area properties server response data and merge it with the existent modal resolved selected areas. + * + * @memberof AreasselectionfieldsetCtrl + * @private + */ + var buildSelectedAreasArray = function(data){ + var finalAreas = []; + for (var i = 0; i < data.length; i++){ + var area = data[i]; + area.gid = parseInt(area.gid); + for (var j = 0; j < $scope.report.areas.length; j++){ + if (parseInt($scope.report.areas[j].gid) === parseInt(data[i].gid) && $scope.report.areas[j].areaType === data[i].areaType){ + area.id = parseInt($scope.report.areas[j].id); + } + } + finalAreas.push(area); + } + + return finalAreas; + }; + + $scope.$watch(function(){return $scope.repNav.isViewVisible('reportForm');}, function(newVal,oldVal){ + if(newVal===true){ + loadReportForm(); + } + }); + +}); + diff --git a/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.html b/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.html new file mode 100644 index 000000000..a56d435bc --- /dev/null +++ b/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.html @@ -0,0 +1,56 @@ + +
+
+ {{display}} + Go to vessel + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
NameCFRIRCSExt. markingICCAT
{{item.name | dataNotAvailable}}{{item.cfr | dataNotAvailable}}{{item.ircs | dataNotAvailable}}{{item.externalMarking | dataNotAvailable}}{{item.iccat | dataNotAvailable}}
+
+
+
+{{place}} diff --git a/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.js b/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.js new file mode 100644 index 000000000..974bd5ba0 --- /dev/null +++ b/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.js @@ -0,0 +1,92 @@ +angular.module('unionvmsWeb').directive("vesselDropdown", function(mapService, reportService) { + return { + restrict: "E", + templateUrl: "partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.html", + scope: {}, + link: function(scope) { + scope.listVisible = false; + scope.selected = undefined; + + scope.select = function(item) { + scope.selected = item; + scope.listVisible = false; + scope.panTo(item.coordinates); + }; + + scope.panTo = function(coordinates) { + var coords = ol.proj.transform(coordinates, 'EPSG:4326', mapService.getMapProjectionCode()); + mapService.panTo(coords); + var geom = new ol.geom.Point(coords); + geom.set('GeometryType', 'Point'); + mapService.highlightFeature(geom); + }; + + scope.isSelected = function(item) { + if(scope.selected) { + return item === scope.selected; + } + }; + + scope.show = function() { + scope.listVisible = !scope.listVisible; + }; + + scope.$watch("selected", function(value) { + if(scope.selected){ + scope.display = scope.selected.name; + } + }); + + scope.clearSelection = function(event) { + event.stopPropagation(); + scope.selected = undefined; + scope.listVisible = false; + }; + + scope.vesselsFromMovements = []; + + scope.$watch(function() { return reportService.getPositions(); }, function(positions) { + if(!angular.equals([], positions)) { + positions.sort(function(a,b) { + return (a.properties.positionTime < b.properties.positionTime) ? 1 : ((b.properties.positionTime < a.properties.positionTime) ? -1 : 0) + }); + angular.forEach(positions, function (position) { + var existingVessel = includesVessel(position.properties); + if(existingVessel){ + if(existingVessel.positionTime < position.properties.positionTime) { + existingVessel.coordinates = position.geometry.coordinates; + existingVessel.positionTime = position.properties.positionTime; + } + } else { + scope.vesselsFromMovements.push({"coordinates" : position.geometry.coordinates, + "positionTime" : position.properties.positionTime, + "name" : position.properties.name, + "cfr" : position.properties.cfr, + "ircs" : position.properties.ircs, + "externalMarking" : position.properties.externalMarking, + "iccat" : position.properties.iccat}); + } + }); + if(scope.selected) { + scope.panTo(scope.selected.coordinates); + } + } + }, true); + + var includesVessel = function(vesselProperties) { + var vessel = undefined; + angular.forEach(scope.vesselsFromMovements, function (entry) { + if( entry.name === vesselProperties.name && + entry.cfr === vesselProperties.cfr && + entry.ircs === vesselProperties.ircs && + entry.externalMarking === vesselProperties.externalMarking && + entry.iccat === vesselProperties.iccat) { + + vessel = entry; + } + }); + return vessel; + }; + } + } +}); diff --git a/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.less b/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.less new file mode 100644 index 000000000..46c77f544 --- /dev/null +++ b/unionvms-web/app/partial/spatial/reportsPanel/reportForm/vesselDropdown/vesselDropdown.less @@ -0,0 +1,131 @@ +@height: 25px; +@spacing: 10px; +@placeholder-colour: #AAA; +@select-colour: #089fd7; +@font-size: 14px; +@border-colour: #DDD; +.vertical-centre (@height) { + height: @height; + line-height: @height !important; + display: inline-block; + vertical-align: middle; +} +.vesselDropdown { + float: left; + display: block; + width: 750px; + fill: #FFFFFF; + background-color: #FFFFFF; + >div { + float: left; + width: 100%; + position: relative; + >div.vesselDropdown-display { + float: left; + width: 100%; + background: white; + height: @height; + cursor: pointer; + border: solid 1px @border-colour; + box-sizing: border-box; + @icon-width: 14px; + position: relative; + display: block; + >* { + float: left; + height: 100%; + .vertical-centre(@height); + } + >span.text { + font-size: @font-size; + width: 100%; + position: relative; + box-sizing: border-box; + padding-right: @icon-width+@spacing*2; + padding-left: @spacing; + &.placeholder { + color: @placeholder-colour; + } + } + >i.clear-selection { + position: absolute; + width: @icon-width; + margin-left: (@spacing+2*@icon-width)*-1; + font-size: 1.125em; + font-weight: bold; + padding-right: @spacing + @icon-width; + text-align: right; + margin-top: -2px; + } + >i.show-list { + position: relative; + width: @icon-width; + margin-left: (@spacing+@icon-width)*-1; + font-size: 1.125em; + font-weight: bold; + padding-right: @spacing; + text-align: right; + } + .caret { + color: @primaryColor; + position: absolute; + right: 10px; + top: 50%; + margin-top: -2px; + } + } + >div.vesselDropdown-display:hover { + border-color: #089fd7; + } + >div.vesselDropdown-list { + margin-top: @height; + float: left; + width: 100%; + border-color: #089fd7; + position: absolute; + >div { + position: absolute; + width: 100%; + z-index: 2; + cursor: pointer; + background: white; + >table { + margin-bottom: 0; + } + >table>tbody>tr.selected>td { + background: @select-colour; + } + >div { + float: left; + width: 100%; + padding: 0 @spacing; + font-size: @font-size; + box-sizing: border-box; + border: solid 1px @border-colour; + border-top: none; + @icon-width: 20px; + &:hover { + background: #F0F0F0; + } + >* { + .vertical-centre(@height); + } + >span { + float: left; + width: 100%; + position: relative; + padding-right: @icon-width+@spacing; + box-sizing: border-box; + color: inherit; + } + >i { + float: left; + width: @icon-width; + margin-left: @icon-width*-1; + display: none; + } + } + } + } + } +} diff --git a/unionvms-web/app/partial/spatial/reportsPanel/reportModel.js b/unionvms-web/app/partial/spatial/reportsPanel/reportModel.js index 244ad5881..83c048495 100644 --- a/unionvms-web/app/partial/spatial/reportsPanel/reportModel.js +++ b/unionvms-web/app/partial/spatial/reportsPanel/reportModel.js @@ -1,532 +1,544 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').factory('Report',function(unitConversionService, userService, locale) { //globalSettingsService, - function Report(){ - this.id = undefined; - this.name = undefined; - this.desc = undefined; - this.createdBy = undefined; - this.visibility = 'private'; - this.startDateTime = undefined; - this.endDateTime = undefined; - this.reportType = 'standard'; - this.positionSelector = 'all'; - this.positionTypeSelector = 'positions'; - this.xValue = undefined; - - //Components - this.withMap = true; - - //Vessel filter - this.vesselsSelection = []; - - //VNS filter - this.hasVmsFilter = false; - this.movSources = []; - this.vmsFilters = { - positions: {}, - segments: {}, - tracks: {} - }; - - this.hasFaFilter = false; - this.faFilters = {}; - - this.areas = []; - - //Spatial configs - this.mapConfiguration = { - stylesSettings: undefined, - layerSettings: undefined, - visibilitySettings: undefined - }; - this.currentMapConfig = { - mapConfiguration: {} - }; - } - -// var getDateFormat = function(){ -// return globalSettingsService.getDateFormat(); -// }; -// -// var getTimeZone = function(){ -// return parseInt(globalSettingsService.getTimezone()); -// }; -// -// var convertDate = function(date, direction){ -// var displayFormat = getDateFormat(); -// var src_format = 'YYYY-MM-DD HH:mm:ss Z'; -// var server_format = 'YYYY-MM-DDTHH:mm:ss'; -// -// if (direction === 'to_server'){ -// if (moment.utc(date, src_format).isValid()){ -// return moment.utc(date, src_format).format(server_format); -// } -// } else if(direction === 'from_server') { -// if (moment.utc(date, server_format).isValid()){ -// return moment.utc(date, server_format).format(displayFormat); -// } -// } -// }; - - var validateFilterObject = function(filter,isRunningReport){ - var valid = true; - var existingFilter = false; - var isDefined = false; - for (var i in filter){ - if (i === 'id'){ - existingFilter = true; - } else if (i !== 'id' && i !== 'type'){ - if (angular.isDefined(filter[i])){ - isDefined = true; - } - } - } - - if ((existingFilter || isRunningReport) && isDefined === false){ - valid = false; - } - - return valid; - }; - - Report.prototype.fromJson = function(data){ - var report = new Report(); - - if(data){ - var filter = data.filterExpression; - - report.id = data.id; - report.name = data.name; - report.desc = data.desc; - report.createdBy = data.createdBy; - report.withMap = data.withMap; - report.visibility = data.visibility; - - if (report.visibility !== 'private' && !userService.isAllowed('SHARE_REPORT_' + report.visibility.toUpperCase(), 'Reporting', true) && !userService.isAllowed('MANAGE_ALL_REPORTS', 'Reporting', true)){ - report.visibility = 'private'; - } - - //Common filters - report.commonFilterId = filter.common.id; - report.startDateTime = angular.isDefined(filter.common.startDate) ? unitConversionService.date.convertDate(filter.common.startDate, 'from_server') : undefined; - report.endDateTime = angular.isDefined(filter.common.endDate) ? unitConversionService.date.convertDate(filter.common.endDate, 'from_server') : undefined; - report.positionSelector = angular.isDefined(filter.common.positionSelector) ? filter.common.positionSelector : 'all'; - report.positionTypeSelector = angular.isDefined(filter.common.positionTypeSelector) ? filter.common.positionTypeSelector : 'positions'; - report.xValue = angular.isDefined(filter.common.xValue) ? filter.common.xValue : undefined; - - //Vessel filters - report.vesselsSelection = filter.assets; - - if(angular.isDefined(data.reportType)){ - report.reportType = data.reportType; - } - - //VMS positions filters - if (angular.isDefined(filter.vms) && angular.isDefined(filter.vms.vmsposition)){ - if (_.has(filter.vms.vmsposition, 'movsources')){ - report.movSources = filter.vms.vmsposition.movsources; - } - delete filter.vms.vmsposition.movsources; - report.vmsFilters.positions = filter.vms.vmsposition; - } - - - if (angular.isDefined(filter.vms) && angular.isDefined(filter.vms.vmssegment)){ - report.vmsFilters.segments = filter.vms.vmssegment; - } - - if (angular.isDefined(filter.vms) && angular.isDefined(filter.vms.tracks)){ - report.vmsFilters.tracks = filter.vms.tracks; - } - - if (!angular.equals({}, filter.vms)){ - report.hasVmsFilter = true; - for (var i in filter.vms){ - var filterName = 'has' + i.substring(0,1).toUpperCase()+i.substring(1) + 'Filter'; - report[filterName] = true; - } - } - - //Fishing activity filters - if(!angular.isDefined(filter.fa)){ - filter.fa = {}; - } - - report.faFilters = {}; - angular.forEach(filter.fa, function(value,key){ - if(key === 'weight'){ - report.faFilters[key] = value; - }else{ - report.faFilters[key] = value[0]; - } - }); - - if (!angular.equals({}, filter.fa)){ - report.hasFaFilter = true; - } - - if(!angular.isDefined(report.faFilters.weight)){ - report.faFilters.weight = {unit: 'kg'}; - }else if(!angular.isDefined(report.faFilters.weight.unit)){ - report.faFilters.weight.unit = 'kg'; - } - - if(!angular.isDefined(filter.sort)){ - filter.sort = {}; - } - - report.sortFilters = filter.sort; - - report.areas = filter.areas; - - if(angular.isDefined(filter.criteria) && filter.criteria.length){ - angular.forEach(filter.criteria, function(item){ - item.text = locale.getString('spatial.criteria_' + item.code.toLowerCase()); - }); - } - report.sortFilters = filter.criteria; - - if (angular.isDefined(data.mapConfiguration)){ - if(angular.isDefined(data.mapConfiguration.layerSettings) && angular.isDefined(data.mapConfiguration.layerSettings.areaLayers) && !_.isEmpty(data.mapConfiguration.layerSettings.areaLayers)){ - angular.forEach(data.mapConfiguration.layerSettings.areaLayers, function(item) { - if(item.areaType === 'areagroup'){ - item.name = item.areaGroupName; - } - }); - } - report.mapConfiguration = data.mapConfiguration; - report.currentMapConfig.mapConfiguration = angular.copy(data.mapConfiguration); - } - - } - - return report; - }; - - Report.prototype.toJson = function(){ - return angular.toJson(this.DTO()); - }; - - Report.prototype.DTO = function(){ - var vmsFilters = {}; - var hasData = false; - - if(this.hasVmsFilter){ - if ((angular.isDefined(this.vmsFilters.positions) && !_.isEmpty(this.vmsFilters.positions)) || (angular.isDefined(this.movSources) && !_.isEmpty(this.movSources))){ - vmsFilters.vmsposition = this.vmsFilters.positions; - if (this.movSources.length > 0){ - vmsFilters.vmsposition.movsources = this.movSources; - } - - if(angular.isDefined(this.vmsFilters.positions) && !_.isEmpty(this.vmsFilters.positions)){ - vmsFilters.vmsposition.movMinSpeed = vmsFilters.vmsposition.movMinSpeed === null ? undefined : vmsFilters.vmsposition.movMinSpeed; - vmsFilters.vmsposition.movMaxSpeed = vmsFilters.vmsposition.movMaxSpeed === null ? undefined : vmsFilters.vmsposition.movMaxSpeed; - vmsFilters.vmsposition.type = 'vmspos'; - } - - if (validateFilterObject(vmsFilters.vmsposition) === false){ - vmsFilters.vmsposition = undefined; - } - } - - if (angular.isDefined(this.vmsFilters.segments) && !_.isEmpty(this.vmsFilters.segments)){ - vmsFilters.vmssegment = this.vmsFilters.segments; - vmsFilters.vmssegment.segMinSpeed = vmsFilters.vmssegment.segMinSpeed === null ? undefined : vmsFilters.vmssegment.segMinSpeed; - vmsFilters.vmssegment.segMaxSpeed = vmsFilters.vmssegment.segMaxSpeed === null ? undefined : vmsFilters.vmssegment.segMaxSpeed; - vmsFilters.vmssegment.segMinDuration = vmsFilters.vmssegment.segMinDuration === null ? undefined : vmsFilters.vmssegment.segMinDuration; - vmsFilters.vmssegment.segMaxDuration = vmsFilters.vmssegment.segMaxDuration === null ? undefined : vmsFilters.vmssegment.segMaxDuration; - vmsFilters.vmssegment.type = 'vmsseg'; - - if (validateFilterObject(vmsFilters.vmssegment) === false){ - vmsFilters.vmssegment = undefined; - } - } - - if (angular.isDefined(this.vmsFilters.tracks) && !_.isEmpty(this.vmsFilters.tracks)){ - vmsFilters.vmstrack = this.vmsFilters.tracks; - vmsFilters.vmstrack.trkMinTime = vmsFilters.vmstrack.trkMinTime === null ? undefined : vmsFilters.vmstrack.trkMinTime; - vmsFilters.vmstrack.trkMaxTime = vmsFilters.vmstrack.trkMaxTime === null ? undefined : vmsFilters.vmstrack.trkMaxTime; - vmsFilters.vmstrack.trkMinDuration = vmsFilters.vmstrack.trkMinDuration === null ? undefined : vmsFilters.vmstrack.trkMinDuration; - vmsFilters.vmstrack.trkMaxDuration = vmsFilters.vmstrack.trkMaxDuration === null ? undefined : vmsFilters.vmstrack.trkMaxDuration; - vmsFilters.vmstrack.type = 'vmstrack'; - - if (validateFilterObject(vmsFilters.vmstrack) === false){ - vmsFilters.vmstrack = undefined; - } - } - } - - //Fishing activity filter - var faFilters; - if(this.hasFaFilter){ - if(_.keys(this.faFilters).length){ - faFilters = {}; - angular.forEach(this.faFilters, function(value,key){ - if(key === 'weight' || key === 'id'){ - faFilters[key] = value; - }else{ - faFilters[key] = [value]; - } - }); - - if(angular.isDefined(faFilters.weight) && (!angular.isDefined(faFilters.weight.min) || _.isNull(faFilters.weight.min)) && - (!angular.isDefined(faFilters.weight.max) || _.isNull(faFilters.weight.max))){ - delete faFilters.weight; - } - }else{ - faFilters = undefined; - } - } - - var criteria; - if(angular.isDefined(this.sortFilters) && this.sortFilters.length){ - criteria = []; - angular.forEach(this.sortFilters, function(item){ - var values; - - if(!angular.isDefined(item.values)){ - values = [item.code]; - }else if(!_.isArray(item.values)){ - values = [item.values]; - }else{ - values = item.values; - } - - criteria.push({'code': item.code, 'values': values}); - }); - } - - var filter = { - common: { - id: this.commonFilterId, - startDate: this.startDateTime === undefined ? undefined : unitConversionService.date.convertDate(this.startDateTime, 'to_server'), - endDate: this.endDateTime === undefined ? undefined : unitConversionService.date.convertDate(this.endDateTime, 'to_server'), - positionSelector: this.positionSelector, - positionTypeSelector: this.positionSelector !== 'all' ? this.positionTypeSelector: undefined, - xValue: this.xValue - }, - assets: [], - vms: vmsFilters, - fa: faFilters, - areas: this.areas, - criteria: criteria - }; - - if (angular.isDefined(this.vesselsSelection) && this.vesselsSelection.length){ - filter.assets = this.vesselsSelection; - } - - var dto = { - id: this.id, - name: this.name, - desc: this.desc !== '' ? this.desc : undefined, - reportType: this.reportType, - visibility: angular.isDefined(this.visibility) ? this.visibility : 'private', - withMap: this.reportType === 'standard' ? this.withMap : false, - filterExpression: filter - }; - - if(this.reportType === 'standard'){ - if(this.withMap === true){ - dto.mapConfiguration = this.mapConfiguration; - }else{ - if(angular.isDefined(this.mapConfiguration.spatialConnectId)){ - dto.mapConfiguration = {'spatialConnectId': this.mapConfiguration.spatialConnectId}; - } - if(angular.isDefined(this.mapConfiguration.visibilitySettings)){ - if(angular.isDefined(dto.mapConfiguration)){ - dto.mapConfiguration.visibilitySettings = this.mapConfiguration.visibilitySettings; - }else{ - dto.mapConfiguration = {'visibilitySettings': this.mapConfiguration.visibilitySettings}; - } - } - } - } - - if(angular.isDefined(this.additionalProperties)){ - dto.additionalProperties = this.additionalProperties; - } - - return dto; - }; - - Report.prototype.toJsonCopy = function(){ - return angular.toJson(this.DTOCopy()); - }; - - Report.prototype.DTOCopy = function(){ - var report = {}; - - report.name = this.name; - report.desc = this.desc !== '' ? this.desc : undefined; - report.reportType = this.reportType; - report.withMap = this.withMap; - report.visibility = angular.isDefined(this.visibility) ? this.visibility : 'private'; - - report.filterExpression = {}; - report.filterExpression.common = {}; - report.filterExpression.common.startDate = this.startDateTime === undefined ? undefined : unitConversionService.date.convertDate(this.startDateTime, 'to_server'); - report.filterExpression.common.endDate = this.endDateTime === undefined ? undefined : unitConversionService.date.convertDate(this.endDateTime, 'to_server'); - report.filterExpression.common.positionTypeSelector = this.positionTypeSelector; - report.filterExpression.common.positionSelector = this.positionSelector; - report.filterExpression.common.xValue = this.xValue; - - report.filterExpression.areas = []; - if(angular.isDefined(this.areas) && this.areas.length > 0){ - angular.forEach(this.areas, function(item) { - report.filterExpression.areas.push({ - 'gid': item.gid, - 'areaType': item.areaType - }); - }); - } - - if (angular.isDefined(this.vesselsSelection) && this.vesselsSelection.length){ - report.filterExpression.assets = []; - angular.forEach(this.vesselsSelection, function(item) { - report.filterExpression.assets.push({ - 'guid': item.guid, - 'name': item.name, - 'type': item.type - }); - }); - } - - if(this.hasVmsFilter){ - report.filterExpression.vms = {}; - if ((angular.isDefined(this.vmsFilters.positions) && !_.isEmpty(this.vmsFilters.positions)) || (angular.isDefined(this.movSources) && !_.isEmpty(this.movSources))){ - if(angular.isDefined(this.vmsFilters.positions) && !_.isEmpty(this.vmsFilters.positions)){ - report.filterExpression.vms.vmsposition = { - movActivity: this.vmsFilters.positions.movActivity === null ? undefined : this.vmsFilters.positions.movActivity, - movMaxSpeed: this.vmsFilters.positions.movMaxSpeed === null ? undefined : this.vmsFilters.positions.movMaxSpeed, - movMinSpeed: this.vmsFilters.positions.movMinSpeed === null ? undefined : this.vmsFilters.positions.movMinSpeed, - movsources: this.vmsFilters.positions.movsources === null ? undefined : this.vmsFilters.positions.movsources, - movType: this.vmsFilters.positions.movType === null ? undefined : this.vmsFilters.positions.movType, - type: "vmspos" - }; - } - - if (this.movSources.length > 0){ - if(!angular.isDefined(report.filterExpression.vms.vmsposition)){ - report.filterExpression.vms.vmsposition = {}; - } - report.filterExpression.vms.vmsposition.movsources = this.movSources; - } - if (validateFilterObject(report.filterExpression.vms.vmsposition,true) === false){ - report.filterExpression.vms.vmsposition = undefined; - } - } - - if(this.hasSegmentsFilter === true && angular.isDefined(this.vmsFilters.segments)){ - report.filterExpression.vms.vmssegment = { - segCategory: this.vmsFilters.segments.segCategory === null ? undefined : this.vmsFilters.segments.segCategory, - segMaxDuration: this.vmsFilters.segments.segMaxDuration === null ? undefined : this.vmsFilters.segments.segMaxDuration, - segMaxSpeed: this.vmsFilters.segments.segMaxSpeed === null ? undefined : this.vmsFilters.segments.segMaxSpeed, - segMinDuration: this.vmsFilters.segments.segMinDuration === null ? undefined : this.vmsFilters.segments.segMinDuration, - segMinSpeed: this.vmsFilters.segments.segMinSpeed === null ? undefined : this.vmsFilters.segments.segMinSpeed, - type: "vmsseg" - }; - if (validateFilterObject(report.filterExpression.vms.vmssegment,true) === false){ - report.filterExpression.vms.vmssegment = undefined; - } - } - - if (angular.isDefined(this.vmsFilters.tracks) && !_.isEmpty(this.vmsFilters.tracks)){ - report.filterExpression.vms.vmstrack = { - trkMaxDuration: this.vmsFilters.tracks.trkMaxDuration === null ? undefined : this.vmsFilters.tracks.trkMaxDuration, - trkMaxTime: this.vmsFilters.tracks.trkMaxTime === null ? undefined : this.vmsFilters.tracks.trkMaxTime, - trkMinDuration: this.vmsFilters.tracks.trkMinDuration === null ? undefined : this.vmsFilters.tracks.trkMinDuration, - trkMinTime: this.vmsFilters.tracks.trkMinTime === null ? undefined : this.vmsFilters.tracks.trkMinTime, - type: "vmstrack" - }; - } - if (validateFilterObject(report.filterExpression.vms.vmstrack,true) === false){ - report.filterExpression.vms.vmstrack = undefined; - } - } - - //Fishing activity filter - if(this.hasFaFilter){ - if(_.keys(this.faFilters).length){ - report.filterExpression.fa = {}; - angular.forEach(this.faFilters, function(value,key){ - if(key === 'weight' || key === 'id'){ - report.filterExpression.fa[key] = value; - }else{ - report.filterExpression.fa[key] = [value]; - } - }); - - if(angular.isDefined(report.filterExpression.fa.weight) && (!angular.isDefined(report.filterExpression.fa.weight.min) || _.isNull(report.filterExpression.fa.weight.min)) && - (!angular.isDefined(report.filterExpression.fa.weight.max) || _.isNull(report.filterExpression.fa.weight.max))){ - delete report.filterExpression.fa.weight; - } - }else{ - report.filterExpression.fa = undefined; - } - } - - var criteria; - if(angular.isDefined(this.sortFilters) && this.sortFilters.length){ - criteria = []; - angular.forEach(this.sortFilters, function(item){ - var values; - - if(!angular.isDefined(item.values)){ - values = [item.code]; - }else if(!_.isArray(item.values)){ - values = [item.values]; - }else{ - values = item.values; - } - - criteria.push({'code': item.code, 'values': values}); - }); - } - report.filterExpression.criteria = criteria; - - if(this.reportType === 'standard'){ - if(this.withMap === true){ - report.mapConfiguration = { - coordinatesFormat: this.mapConfiguration.coordinatesFormat, - displayProjectionId: this.mapConfiguration.displayProjectionId, - mapProjectionId: this.mapConfiguration.mapProjectionId, - scaleBarUnits: this.mapConfiguration.scaleBarUnits, - stylesSettings: this.mapConfiguration.stylesSettings, - visibilitySettings: this.mapConfiguration.visibilitySettings, - layerSettings: this.mapConfiguration.layerSettings - }; - }else{ - if(angular.isDefined(this.mapConfiguration.spatialConnectId)){ - report.mapConfiguration = {'spatialConnectId': this.mapConfiguration.spatialConnectId}; - } - if(angular.isDefined(this.mapConfiguration.visibilitySettings)){ - if(angular.isDefined(report.mapConfiguration)){ - report.mapConfiguration.visibilitySettings = this.mapConfiguration.visibilitySettings; - }else{ - report.mapConfiguration = {'visibilitySettings': this.mapConfiguration.visibilitySettings}; - } - } - } - } - - if(angular.isDefined(this.additionalProperties)){ - report.additionalProperties = this.additionalProperties; - } - - return report; - }; - - return Report; -}); - +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').factory('Report',function(unitConversionService, userService, locale) { //globalSettingsService, + function Report(){ + this.id = undefined; + this.name = undefined; + this.desc = undefined; + this.createdBy = undefined; + this.visibility = 'private'; + this.startDateTime = undefined; + this.endDateTime = undefined; + this.reportType = 'standard'; + this.positionSelector = 'all'; + this.positionTypeSelector = 'positions'; + this.xValue = undefined; + this.mapLayerConfig = undefined; + this.mapZoom = undefined; + this.mapCenter = undefined; + + //Components + this.withMap = true; + + //Vessel filter + this.vesselsSelection = []; + + //VNS filter + this.hasVmsFilter = false; + this.movSources = []; + this.vmsFilters = { + positions: {}, + segments: {}, + tracks: {} + }; + + this.hasFaFilter = false; + this.faFilters = {}; + + this.areas = []; + + //Spatial configs + this.mapConfiguration = { + stylesSettings: undefined, + layerSettings: undefined, + visibilitySettings: undefined + }; + this.currentMapConfig = { + mapConfiguration: {} + }; + } + +// var getDateFormat = function(){ +// return globalSettingsService.getDateFormat(); +// }; +// +// var getTimeZone = function(){ +// return parseInt(globalSettingsService.getTimezone()); +// }; +// +// var convertDate = function(date, direction){ +// var displayFormat = getDateFormat(); +// var src_format = 'YYYY-MM-DD HH:mm:ss Z'; +// var server_format = 'YYYY-MM-DDTHH:mm:ss'; +// +// if (direction === 'to_server'){ +// if (moment.utc(date, src_format).isValid()){ +// return moment.utc(date, src_format).format(server_format); +// } +// } else if(direction === 'from_server') { +// if (moment.utc(date, server_format).isValid()){ +// return moment.utc(date, server_format).format(displayFormat); +// } +// } +// }; + + var validateFilterObject = function(filter,isRunningReport){ + var valid = true; + var existingFilter = false; + var isDefined = false; + for (var i in filter){ + if (i === 'id'){ + existingFilter = true; + } else if (i !== 'id' && i !== 'type'){ + if (angular.isDefined(filter[i])){ + isDefined = true; + } + } + } + + if ((existingFilter || isRunningReport) && isDefined === false){ + valid = false; + } + + return valid; + }; + + Report.prototype.fromJson = function(data){ + var report = new Report(); + + if(data){ + var filter = data.filterExpression; + + report.id = data.id; + report.name = data.name; + report.desc = data.desc; + report.createdBy = data.createdBy; + report.withMap = data.withMap; + report.visibility = data.visibility; + report.mapLayerConfig = data.mapLayerConfig; + report.mapCenter = data.mapCenter; + report.mapZoom = data.mapZoom; + + if (report.visibility !== 'private' && !userService.isAllowed('SHARE_REPORT_' + report.visibility.toUpperCase(), 'Reporting', true) && !userService.isAllowed('MANAGE_ALL_REPORTS', 'Reporting', true)){ + report.visibility = 'private'; + } + + //Common filters + report.commonFilterId = filter.common.id; + report.startDateTime = angular.isDefined(filter.common.startDate) ? unitConversionService.date.convertDate(filter.common.startDate, 'from_server') : undefined; + report.endDateTime = angular.isDefined(filter.common.endDate) ? unitConversionService.date.convertDate(filter.common.endDate, 'from_server') : undefined; + report.positionSelector = angular.isDefined(filter.common.positionSelector) ? filter.common.positionSelector : 'all'; + report.positionTypeSelector = angular.isDefined(filter.common.positionTypeSelector) ? filter.common.positionTypeSelector : 'positions'; + report.xValue = angular.isDefined(filter.common.xValue) ? filter.common.xValue : undefined; + + //Vessel filters + report.vesselsSelection = filter.assets; + + if(angular.isDefined(data.reportType)){ + report.reportType = data.reportType; + } + + //VMS positions filters + if (angular.isDefined(filter.vms) && angular.isDefined(filter.vms.vmsposition)){ + if (_.has(filter.vms.vmsposition, 'movsources')){ + report.movSources = filter.vms.vmsposition.movsources; + } + delete filter.vms.vmsposition.movsources; + report.vmsFilters.positions = filter.vms.vmsposition; + } + + + if (angular.isDefined(filter.vms) && angular.isDefined(filter.vms.vmssegment)){ + report.vmsFilters.segments = filter.vms.vmssegment; + } + + if (angular.isDefined(filter.vms) && angular.isDefined(filter.vms.tracks)){ + report.vmsFilters.tracks = filter.vms.tracks; + } + + if (!angular.equals({}, filter.vms)){ + report.hasVmsFilter = true; + for (var i in filter.vms){ + var filterName = 'has' + i.substring(0,1).toUpperCase()+i.substring(1) + 'Filter'; + report[filterName] = true; + } + } + + //Fishing activity filters + if(!angular.isDefined(filter.fa)){ + filter.fa = {}; + } + + report.faFilters = {}; + angular.forEach(filter.fa, function(value,key){ + if(key === 'weight'){ + report.faFilters[key] = value; + }else{ + report.faFilters[key] = value[0]; + } + }); + + if (!angular.equals({}, filter.fa)){ + report.hasFaFilter = true; + } + + if(!angular.isDefined(report.faFilters.weight)){ + report.faFilters.weight = {unit: 'kg'}; + }else if(!angular.isDefined(report.faFilters.weight.unit)){ + report.faFilters.weight.unit = 'kg'; + } + + if(!angular.isDefined(filter.sort)){ + filter.sort = {}; + } + + report.sortFilters = filter.sort; + + report.areas = filter.areas; + + if(angular.isDefined(filter.criteria) && filter.criteria.length){ + angular.forEach(filter.criteria, function(item){ + item.text = locale.getString('spatial.criteria_' + item.code.toLowerCase()); + }); + } + report.sortFilters = filter.criteria; + + if (angular.isDefined(data.mapConfiguration)){ + if(angular.isDefined(data.mapConfiguration.layerSettings) && angular.isDefined(data.mapConfiguration.layerSettings.areaLayers) && !_.isEmpty(data.mapConfiguration.layerSettings.areaLayers)){ + angular.forEach(data.mapConfiguration.layerSettings.areaLayers, function(item) { + if(item.areaType === 'areagroup'){ + item.name = item.areaGroupName; + } + }); + } + report.mapConfiguration = data.mapConfiguration; + report.currentMapConfig.mapConfiguration = angular.copy(data.mapConfiguration); + } + + } + + return report; + }; + + Report.prototype.toJson = function(){ + return angular.toJson(this.DTO()); + }; + + Report.prototype.DTO = function(){ + var vmsFilters = {}; + var hasData = false; + + if(this.hasVmsFilter){ + if ((angular.isDefined(this.vmsFilters.positions) && !_.isEmpty(this.vmsFilters.positions)) || (angular.isDefined(this.movSources) && !_.isEmpty(this.movSources))){ + vmsFilters.vmsposition = this.vmsFilters.positions; + if (this.movSources.length > 0){ + vmsFilters.vmsposition.movsources = this.movSources; + } + + if(angular.isDefined(this.vmsFilters.positions) && !_.isEmpty(this.vmsFilters.positions)){ + vmsFilters.vmsposition.movMinSpeed = vmsFilters.vmsposition.movMinSpeed === null ? undefined : vmsFilters.vmsposition.movMinSpeed; + vmsFilters.vmsposition.movMaxSpeed = vmsFilters.vmsposition.movMaxSpeed === null ? undefined : vmsFilters.vmsposition.movMaxSpeed; + vmsFilters.vmsposition.type = 'vmspos'; + } + + if (validateFilterObject(vmsFilters.vmsposition) === false){ + vmsFilters.vmsposition = undefined; + } + } + + if (angular.isDefined(this.vmsFilters.segments) && !_.isEmpty(this.vmsFilters.segments)){ + vmsFilters.vmssegment = this.vmsFilters.segments; + vmsFilters.vmssegment.segMinSpeed = vmsFilters.vmssegment.segMinSpeed === null ? undefined : vmsFilters.vmssegment.segMinSpeed; + vmsFilters.vmssegment.segMaxSpeed = vmsFilters.vmssegment.segMaxSpeed === null ? undefined : vmsFilters.vmssegment.segMaxSpeed; + vmsFilters.vmssegment.segMinDuration = vmsFilters.vmssegment.segMinDuration === null ? undefined : vmsFilters.vmssegment.segMinDuration; + vmsFilters.vmssegment.segMaxDuration = vmsFilters.vmssegment.segMaxDuration === null ? undefined : vmsFilters.vmssegment.segMaxDuration; + vmsFilters.vmssegment.type = 'vmsseg'; + + if (validateFilterObject(vmsFilters.vmssegment) === false){ + vmsFilters.vmssegment = undefined; + } + } + + if (angular.isDefined(this.vmsFilters.tracks) && !_.isEmpty(this.vmsFilters.tracks)){ + vmsFilters.vmstrack = this.vmsFilters.tracks; + vmsFilters.vmstrack.trkMinTime = vmsFilters.vmstrack.trkMinTime === null ? undefined : vmsFilters.vmstrack.trkMinTime; + vmsFilters.vmstrack.trkMaxTime = vmsFilters.vmstrack.trkMaxTime === null ? undefined : vmsFilters.vmstrack.trkMaxTime; + vmsFilters.vmstrack.trkMinDuration = vmsFilters.vmstrack.trkMinDuration === null ? undefined : vmsFilters.vmstrack.trkMinDuration; + vmsFilters.vmstrack.trkMaxDuration = vmsFilters.vmstrack.trkMaxDuration === null ? undefined : vmsFilters.vmstrack.trkMaxDuration; + vmsFilters.vmstrack.type = 'vmstrack'; + + if (validateFilterObject(vmsFilters.vmstrack) === false){ + vmsFilters.vmstrack = undefined; + } + } + } + + //Fishing activity filter + var faFilters; + if(this.hasFaFilter){ + if(_.keys(this.faFilters).length){ + faFilters = {}; + angular.forEach(this.faFilters, function(value,key){ + if(key === 'weight' || key === 'id'){ + faFilters[key] = value; + }else{ + faFilters[key] = [value]; + } + }); + + if(angular.isDefined(faFilters.weight) && (!angular.isDefined(faFilters.weight.min) || _.isNull(faFilters.weight.min)) && + (!angular.isDefined(faFilters.weight.max) || _.isNull(faFilters.weight.max))){ + delete faFilters.weight; + } + }else{ + faFilters = undefined; + } + } + + var criteria; + if(angular.isDefined(this.sortFilters) && this.sortFilters.length){ + criteria = []; + angular.forEach(this.sortFilters, function(item){ + var values; + + if(!angular.isDefined(item.values)){ + values = [item.code]; + }else if(!_.isArray(item.values)){ + values = [item.values]; + }else{ + values = item.values; + } + + criteria.push({'code': item.code, 'values': values}); + }); + } + + var filter = { + common: { + id: this.commonFilterId, + startDate: this.startDateTime === undefined ? undefined : unitConversionService.date.convertDate(this.startDateTime, 'to_server'), + endDate: this.endDateTime === undefined ? undefined : unitConversionService.date.convertDate(this.endDateTime, 'to_server'), + positionSelector: this.positionSelector, + positionTypeSelector: this.positionSelector !== 'all' ? this.positionTypeSelector: undefined, + xValue: this.xValue + }, + assets: [], + vms: vmsFilters, + fa: faFilters, + areas: this.areas, + criteria: criteria + }; + + if (angular.isDefined(this.vesselsSelection) && this.vesselsSelection.length){ + filter.assets = this.vesselsSelection; + } + + var dto = { + id: this.id, + name: this.name, + desc: this.desc !== '' ? this.desc : undefined, + reportType: this.reportType, + visibility: angular.isDefined(this.visibility) ? this.visibility : 'private', + withMap: this.reportType === 'standard' ? this.withMap : false, + filterExpression: filter, + mapZoom: this.mapZoom, + mapCenter: this.mapCenter, + mapLayerConfig: this.mapLayerConfig + }; + + if(this.reportType === 'standard'){ + if(this.withMap === true){ + dto.mapConfiguration = this.mapConfiguration; + }else{ + if(angular.isDefined(this.mapConfiguration.spatialConnectId)){ + dto.mapConfiguration = {'spatialConnectId': this.mapConfiguration.spatialConnectId}; + } + if(angular.isDefined(this.mapConfiguration.visibilitySettings)){ + if(angular.isDefined(dto.mapConfiguration)){ + dto.mapConfiguration.visibilitySettings = this.mapConfiguration.visibilitySettings; + }else{ + dto.mapConfiguration = {'visibilitySettings': this.mapConfiguration.visibilitySettings}; + } + } + } + } + + if(angular.isDefined(this.additionalProperties)){ + dto.additionalProperties = this.additionalProperties; + } + + return dto; + }; + + Report.prototype.toJsonCopy = function(){ + return angular.toJson(this.DTOCopy()); + }; + + Report.prototype.DTOCopy = function(){ + var report = {}; + + report.name = this.name; + report.desc = this.desc !== '' ? this.desc : undefined; + report.reportType = this.reportType; + report.withMap = this.withMap; + report.visibility = angular.isDefined(this.visibility) ? this.visibility : 'private'; + report.mapLayerConfig = this.mapLayerConfig; + report.mapCenter = this.mapCenter; + report.mapZoom = this.mapZoom; + + report.filterExpression = {}; + report.filterExpression.common = {}; + report.filterExpression.common.startDate = this.startDateTime === undefined ? undefined : unitConversionService.date.convertDate(this.startDateTime, 'to_server'); + report.filterExpression.common.endDate = this.endDateTime === undefined ? undefined : unitConversionService.date.convertDate(this.endDateTime, 'to_server'); + report.filterExpression.common.positionTypeSelector = this.positionTypeSelector; + report.filterExpression.common.positionSelector = this.positionSelector; + report.filterExpression.common.xValue = this.xValue; + + report.filterExpression.areas = []; + if(angular.isDefined(this.areas) && this.areas.length > 0){ + angular.forEach(this.areas, function(item) { + report.filterExpression.areas.push({ + 'gid': item.gid, + 'areaType': item.areaType + }); + }); + } + + if (angular.isDefined(this.vesselsSelection) && this.vesselsSelection.length){ + report.filterExpression.assets = []; + angular.forEach(this.vesselsSelection, function(item) { + report.filterExpression.assets.push({ + 'guid': item.guid, + 'name': item.name, + 'type': item.type + }); + }); + } + + if(this.hasVmsFilter){ + report.filterExpression.vms = {}; + if ((angular.isDefined(this.vmsFilters.positions) && !_.isEmpty(this.vmsFilters.positions)) || (angular.isDefined(this.movSources) && !_.isEmpty(this.movSources))){ + if(angular.isDefined(this.vmsFilters.positions) && !_.isEmpty(this.vmsFilters.positions)){ + report.filterExpression.vms.vmsposition = { + movActivity: this.vmsFilters.positions.movActivity === null ? undefined : this.vmsFilters.positions.movActivity, + movMaxSpeed: this.vmsFilters.positions.movMaxSpeed === null ? undefined : this.vmsFilters.positions.movMaxSpeed, + movMinSpeed: this.vmsFilters.positions.movMinSpeed === null ? undefined : this.vmsFilters.positions.movMinSpeed, + movsources: this.vmsFilters.positions.movsources === null ? undefined : this.vmsFilters.positions.movsources, + movType: this.vmsFilters.positions.movType === null ? undefined : this.vmsFilters.positions.movType, + type: "vmspos" + }; + } + + if (this.movSources.length > 0){ + if(!angular.isDefined(report.filterExpression.vms.vmsposition)){ + report.filterExpression.vms.vmsposition = {}; + } + report.filterExpression.vms.vmsposition.movsources = this.movSources; + } + if (validateFilterObject(report.filterExpression.vms.vmsposition,true) === false){ + report.filterExpression.vms.vmsposition = undefined; + } + } + + if(this.hasSegmentsFilter === true && angular.isDefined(this.vmsFilters.segments)){ + report.filterExpression.vms.vmssegment = { + segCategory: this.vmsFilters.segments.segCategory === null ? undefined : this.vmsFilters.segments.segCategory, + segMaxDuration: this.vmsFilters.segments.segMaxDuration === null ? undefined : this.vmsFilters.segments.segMaxDuration, + segMaxSpeed: this.vmsFilters.segments.segMaxSpeed === null ? undefined : this.vmsFilters.segments.segMaxSpeed, + segMinDuration: this.vmsFilters.segments.segMinDuration === null ? undefined : this.vmsFilters.segments.segMinDuration, + segMinSpeed: this.vmsFilters.segments.segMinSpeed === null ? undefined : this.vmsFilters.segments.segMinSpeed, + type: "vmsseg" + }; + if (validateFilterObject(report.filterExpression.vms.vmssegment,true) === false){ + report.filterExpression.vms.vmssegment = undefined; + } + } + + if (angular.isDefined(this.vmsFilters.tracks) && !_.isEmpty(this.vmsFilters.tracks)){ + report.filterExpression.vms.vmstrack = { + trkMaxDuration: this.vmsFilters.tracks.trkMaxDuration === null ? undefined : this.vmsFilters.tracks.trkMaxDuration, + trkMaxTime: this.vmsFilters.tracks.trkMaxTime === null ? undefined : this.vmsFilters.tracks.trkMaxTime, + trkMinDuration: this.vmsFilters.tracks.trkMinDuration === null ? undefined : this.vmsFilters.tracks.trkMinDuration, + trkMinTime: this.vmsFilters.tracks.trkMinTime === null ? undefined : this.vmsFilters.tracks.trkMinTime, + type: "vmstrack" + }; + } + if (validateFilterObject(report.filterExpression.vms.vmstrack,true) === false){ + report.filterExpression.vms.vmstrack = undefined; + } + } + + //Fishing activity filter + if(this.hasFaFilter){ + if(_.keys(this.faFilters).length){ + report.filterExpression.fa = {}; + angular.forEach(this.faFilters, function(value,key){ + if(key === 'weight' || key === 'id'){ + report.filterExpression.fa[key] = value; + }else{ + report.filterExpression.fa[key] = [value]; + } + }); + + if(angular.isDefined(report.filterExpression.fa.weight) && (!angular.isDefined(report.filterExpression.fa.weight.min) || _.isNull(report.filterExpression.fa.weight.min)) && + (!angular.isDefined(report.filterExpression.fa.weight.max) || _.isNull(report.filterExpression.fa.weight.max))){ + delete report.filterExpression.fa.weight; + } + }else{ + report.filterExpression.fa = undefined; + } + } + + var criteria; + if(angular.isDefined(this.sortFilters) && this.sortFilters.length){ + criteria = []; + angular.forEach(this.sortFilters, function(item){ + var values; + + if(!angular.isDefined(item.values)){ + values = [item.code]; + }else if(!_.isArray(item.values)){ + values = [item.values]; + }else{ + values = item.values; + } + + criteria.push({'code': item.code, 'values': values}); + }); + } + report.filterExpression.criteria = criteria; + + if(this.reportType === 'standard'){ + if(this.withMap === true){ + report.mapConfiguration = { + coordinatesFormat: this.mapConfiguration.coordinatesFormat, + displayProjectionId: this.mapConfiguration.displayProjectionId, + mapProjectionId: this.mapConfiguration.mapProjectionId, + scaleBarUnits: this.mapConfiguration.scaleBarUnits, + stylesSettings: this.mapConfiguration.stylesSettings, + visibilitySettings: this.mapConfiguration.visibilitySettings, + layerSettings: this.mapConfiguration.layerSettings + }; + }else{ + if(angular.isDefined(this.mapConfiguration.spatialConnectId)){ + report.mapConfiguration = {'spatialConnectId': this.mapConfiguration.spatialConnectId}; + } + if(angular.isDefined(this.mapConfiguration.visibilitySettings)){ + if(angular.isDefined(report.mapConfiguration)){ + report.mapConfiguration.visibilitySettings = this.mapConfiguration.visibilitySettings; + }else{ + report.mapConfiguration = {'visibilitySettings': this.mapConfiguration.visibilitySettings}; + } + } + } + } + + if(angular.isDefined(this.additionalProperties)){ + report.additionalProperties = this.additionalProperties; + } + + return report; + }; + + return Report; +}); + diff --git a/unionvms-web/app/partial/spatial/templates/label.html b/unionvms-web/app/partial/spatial/templates/label.html index 5dc4f8fb7..83ef00635 100644 --- a/unionvms-web/app/partial/spatial/templates/label.html +++ b/unionvms-web/app/partial/spatial/templates/label.html @@ -1,25 +1,29 @@ - -
- - {{#data}} - - {{#includeTitles}} - - {{/includeTitles}} - - - {{/data}} -
{{getTitle}}: -
{{getValue}}
-
-
+ +
+ + {{#data}} + + {{#includeTitles}} + + {{/includeTitles}} + + + {{/data}} +
+ {{#includeTitle}} + {{getTitle}}: + {{/includeTitle}} + +
{{getValue}}
+
+
diff --git a/unionvms-web/app/partial/spatial/templates/vmspos.html b/unionvms-web/app/partial/spatial/templates/vmspos.html index 71a197165..68b4f61dc 100644 --- a/unionvms-web/app/partial/spatial/templates/vmspos.html +++ b/unionvms-web/app/partial/spatial/templates/vmspos.html @@ -1,28 +1,27 @@ - -
- - {{#position}} - - {{#showTitles}} - - - {{/showTitles}} - {{^showTitles}} - {{#doDisplay}} - - {{/doDisplay}} - {{/showTitles}} - - {{/position}} -
{{getTitle}}{{getValue}}{{getValue}}
-
+ +
+ + {{#position}} + + {{#showTitles}} + + {{/showTitles}} + + + {{/position}} +
+ {{#showTitle}} + {{getTitle}} + {{/showTitle}} + {{getValue}}
+
diff --git a/unionvms-web/app/partial/spatial/templates/vmsseg.html b/unionvms-web/app/partial/spatial/templates/vmsseg.html index d1ca1c716..9ef1dc873 100644 --- a/unionvms-web/app/partial/spatial/templates/vmsseg.html +++ b/unionvms-web/app/partial/spatial/templates/vmsseg.html @@ -1,28 +1,27 @@ - -
- - {{#segment}} - - {{#showTitles}} - - - {{/showTitles}} - {{^showTitles}} - {{#doDisplay}} - - {{/doDisplay}} - {{/showTitles}} - - {{/segment}} -
{{getTitle}}{{getValue}}{{getValue}}
-
+ +
+ + {{#segment}} + + {{#showTitles}} + + {{/showTitles}} + + + {{/segment}} +
+ {{#showTitle}} + {{getTitle}} + {{/showTitle}} + {{getValue}}
+
diff --git a/unionvms-web/app/partial/vessel/vessel.js b/unionvms-web/app/partial/vessel/vessel.js index 1d084a5d4..4a788f5bd 100644 --- a/unionvms-web/app/partial/vessel/vessel.js +++ b/unionvms-web/app/partial/vessel/vessel.js @@ -1,407 +1,407 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . - */ -angular.module('unionvmsWeb').controller('VesselCtrl', function($scope, $log, $state, $filter, $timeout, locale, savedSearchService, Vessel, VesselContact, searchService, vesselRestService, alertService, csvService, SearchResults, userService, PositionReportModal) { - - var checkAccessToFeature = function(feature) { - return userService.isAllowed(feature, 'Union-VMS', true); - }; - - //Keep track of visibility statuses - $scope.isVisible = { - search : true, - vesselForm : false, - notificationCancelSearch : false - }; - - $scope.currentSearchResults = new SearchResults('', false, locale.getString('vessel.search_zero_results_error')); - $scope.waitingForVesselDataResponse = false; - - //Selected by checkboxes - $scope.selectedVessels = []; - - $scope.editSelectionDropdownItems = [ - {text:locale.getString('common.save_as_group'), code : 'SAVE'}, - {text:locale.getString('common.append_group'), code : 'ADD_TO_GROUP'}, - {text:locale.getString('common.remove_from_group'), code : 'REMOVE_FROM_GROUP'}, - //{text:locale.getString('common.view_on_map'), code : 'MAP'}, - {text:locale.getString('common.export_selection'), code : 'EXPORT'} - ]; - - $scope.stTable = { - tableState: undefined, - itemsByPage: 20, - page: undefined - }; - - //Init function when entering page - var init = function(){ - //Load list with vessels based on latest movements - $scope.searchLatestMovements(); - - //Load vessel details - var vesselGUID = $state.params.id; - if(angular.isDefined(vesselGUID)){ - vesselRestService.getVessel(vesselGUID).then( - function(vessel) { - $scope.vesselObj = vessel.copy(); - $scope.waitingForVesselDataResponse = false; - }, - function(error){ - $log.error("Error loading state params: /" +vesselGUID); - //Show alert and vessel list - $scope.waitingForVesselDataResponse = false; - toggleFormDetails(); - alertService.showErrorMessage(locale.getString('vessel.vessel_stateparams_failed_to_load_error')); - - //Hide alert and change state after 5 sec - $timeout(function() { - $state.go('app.assets', {}, {notify: false}); - alertService.hideMessage(); - }, 5000); - } - ); - - //Show vessel form with loading indicator - $scope.waitingForVesselDataResponse = true; - toggleFormDetails(); - } - }; - - //Goto page in the search results - $scope.gotoPage = function(page){ - if(angular.isDefined(page)){ - searchService.setPage(page); - $scope.searchVessels(); - } - }; - - // Search for vessels - $scope.searchVessels = function(options, page) { - if (angular.isUndefined(page)){ - page = 1; - } - $scope.selectedGroupGuid = angular.isDefined(options) && angular.isDefined(options.savedSearchGroup) ? options.savedSearchGroup.id : undefined; - - $scope.clearSelection(); - $scope.currentSearchResults.clearErrorMessage(); - $scope.currentSearchResults.filter = ''; - $scope.currentSearchResults.setLoading(true); - searchService.searchVessels(page) - .then(updateSearchResults, onGetSearchResultsError); - - var timeoutDisplayNotificationCancelSearch = 3000; - $timeout(function(){ - if ($scope.currentSearchResults.loading) { - $scope.isVisible.notificationCancelSearch = true; - } - }, timeoutDisplayNotificationCancelSearch); - }; - - // Cancel search for vessels - $scope.cancelSearch = function() { - vesselRestService.cancelPendingRequests(); - $scope.currentSearchResults.setLoading(false); - $scope.isVisible.notificationCancelSearch = false; - }; - - // Search for vessels based on latest movements - $scope.searchLatestMovements = function(options) { - $scope.selectedGroupGuid = angular.isDefined(options) && angular.isDefined(options.savedSearchGroup) ? options.savedSearchGroup.id : undefined; - - $scope.clearSelection(); - $scope.currentSearchResults.clearErrorMessage(); - $scope.currentSearchResults.filter = ''; - $scope.currentSearchResults.setLoading(true); - searchService.searchLatestMovements() - .then(updateSearchResults, onGetSearchResultsError); - }; - - //Update the search results - var updateSearchResults = function(vesselListPage){ - $scope.isVisible.notificationCancelSearch = false; - $scope.currentSearchResults.updateWithNewResults(vesselListPage); - - $scope.allCurrentSearchResults = vesselListPage.items; - $scope.currentSearchResultsByPage = vesselListPage.items; - - $scope.stTable.page = vesselListPage.currentPage; - if ($scope.stTable.page !== ($scope.stTable.tableState.pagination.start / $scope.stTable.itemsByPage) + 1){ - $scope.stTable.tableState.pagination.start = $scope.stTable.page; - } - - $scope.stTable.tableState.pagination.numberOfPages = vesselListPage.totalNumberOfPages; - if (angular.isDefined($scope.stTable.tableState.sort.predicate)){ - $scope.sortTableData($scope.stTable.tableState.sort.predicate, $scope.stTable.tableState.sort.reverse); - } - }; - - $scope.sortTableData = function(predicate, reverse){ - $scope.currentSearchResultsByPage = $filter('orderBy')($scope.currentSearchResultsByPage, predicate, reverse); - }; - - // Handle error from search results (listing vessel) - var onGetSearchResultsError = function(response){ - $scope.isVisible.notificationCancelSearch = false; - - // Error functions not to be runned if search has been cancelled - if (angular.isUndefined(response) || response.status !== -1) { - $scope.currentSearchResults.removeAllItems(); - $scope.currentSearchResults.setLoading(false); - $scope.currentSearchResults.setErrorMessage(locale.getString('common.search_failed_error')); - $scope.allCurrentSearchResults = $scope.currentSearchResults.items; - } - }; - - //Is user allowed to edit vessels? - $scope.allowedToEditVessel = function(vessel){ - // Check permission, and vessel cannot be from source NATIONAL. - return checkAccessToFeature('manageVessels') && (!vessel || vessel.source !== 'NATIONAL'); - }; - - //Get original vessel - $scope.getOriginalVessel = function() { - if (!$scope.vesselObj) { - return; - } - - for (var i = 0; i < $scope.currentSearchResults.items.length; i++) { - if ($scope.currentSearchResults.items[i].equals($scope.vesselObj)) { - return $scope.currentSearchResults.items[i]; - } - } - }; - - $scope.mergeCurrentVesselIntoSearchResults = function() { - $scope.mergeCurrentVesselIntoSearchResults($scope.vesselObj); - }; - - $scope.mergeCurrentVesselIntoSearchResults = function(vesselObj) { - var vesselsInList = $scope.currentSearchResults.items; - for (var i = 0; i < vesselsInList.length; i++) { - if (vesselsInList[i].equals(vesselObj)) { - vesselsInList[i] = vesselObj; - vesselObj = vesselsInList[i].copy(); - } - } - }; - - $scope.removeCurrentVesselFromSearchResults = function() { - var vesselsInList = $scope.currentSearchResults.items; - var index; - for (var i = 0; i < vesselsInList.length; i++) { - if (vesselsInList[i].equals($scope.vesselObj)) { - index = i; - } - } - //Remove vessel from list - if(angular.isDefined(index)){ - $scope.currentSearchResults.items.splice(index, 1); - $scope.vesselObj = undefined; - } - - //Removed last vessel from list? - if($scope.currentSearchResults.items.length === 0){ - $scope.searchVessels(); - } - }; - - //Clear the selection - $scope.clearSelection = function(){ - $scope.selectedVessels = []; - }; - - //Add a vessel to the selection - $scope.addToSelection = function(item){ - $scope.selectedVessels.push(item); - }; - - //Remove a vessel from the selection - $scope.removeFromSelection = function(item){ - $.each($scope.selectedVessels, function(index, vessel){ - if(vessel.equals(item)){ - $scope.selectedVessels.splice(index, 1); - return false; - } - }); - }; - - //Are we in create mode? - $scope.isCreateNewMode = function(){ - return $scope.createNewMode; - }; - - $scope.setCreateMode = function(bool){ - $scope.createNewMode = bool; - }; - - $scope.setVesselObj = function(vessel){ - $scope.vesselObj = vessel; - }; - - $scope.getVesselObj = function(){ - return $scope.vesselObj; - }; - - //Toggle create new vessel - $scope.toggleCreateNewVessel = function(){ - $scope.createNewMode = true; - var newVessel = new Vessel(); - newVessel.contact.push(new VesselContact()); - toggleVesselForm(newVessel); - }; - - //Toggle viewing of a vessel - $scope.toggleViewVessel = function(item, noHideMessage){ - $scope.createNewMode = false; - toggleVesselForm(item, noHideMessage); - }; - - var toggleVesselForm = function(vessel, noHideMessage){ - //Create copy of the vessel object so we don't edit the object in the vessel list - if(vessel){ - $scope.vesselObj = vessel.copy(); - }else{ - $scope.vesselObj = undefined; - } - if (!noHideMessage) { - alertService.hideMessage(); - } - toggleFormDetails(); - }; - - //Toggle between vessel details and vessel list - var toggleFormDetails = function(){ - $scope.isVisible.vesselForm = !$scope.isVisible.vesselForm; - $scope.isVisible.search = !$scope.isVisible.search; - }; - - function getVesselGuids(vessels) { - return vessels.map(function(vessel) { - return vessel.vesselId.guid; - }); - } - - //When click cancel redirect to correct state and toggle list view - $scope.cancelFormView = function(){ - if(angular.isDefined($state.params.id)){ - $state.go('app.assets', {}, {notify: false}); - } - - $scope.toggleViewVessel(); - }; - - //Callback function for the "edit selection" dropdown - $scope.editSelectionCallback = function(selectedItem){ - var selectedItems = $scope.getSelectedItemsInFilter(); - if(selectedItems.length > 0){ - if (selectedItem.code === 'SAVE' || selectedItem.code === 'ADD_TO_GROUP') { - var options = { - dynamicSearch : false, - selectedItems : selectedItems, - append: selectedItem.code === 'ADD_TO_GROUP' - }; - savedSearchService.openSaveSearchModal("VESSEL", options); - } - else if (selectedItem.code === 'REMOVE_FROM_GROUP') { - removeFromGroup($scope.selectedGroupGuid, getVesselGuids(selectedItems)); - } - else if (selectedItem.code === 'EXPORT') { - $scope.exportVesselsAsCSVFile(true); - } - }else{ - alertService.showInfoMessageWithTimeout(locale.getString('common.no_items_selected')); - } - }; - - /* Removed the selected items from the current group, updates the group list and refreshed search if successful. */ - function removeFromGroup(groupId, selectedItems) { - if (groupId === undefined) { - alertService.showInfoMessageWithTimeout(locale.getString('common.no_group_selected')); - return; - } - - savedSearchService.removeVesselsFromGroup(groupId, selectedItems).then(function(group) { - $scope.$broadcast('refreshSavedSearch', group); - }, function(error) { - alertService.showErrorMessageWithTimeout(error); - }); - } - - //Get the selected items that are shown by the filter - $scope.getSelectedItemsInFilter = function(){ - return $filter('filter')($scope.selectedVessels, $scope.currentSearchResults.filter); - }; - - //Export data as CSV file - $scope.exportVesselsAsCSVFile = function(onlySelectedItems){ - var filename = 'assets.csv'; - - //Set the header columns - var header = [ - locale.getString('vessel.table_header_flag_state'), - locale.getString('vessel.table_header_external_marking'), - locale.getString('vessel.table_header_name'), - locale.getString('vessel.table_header_signal'), - locale.getString('vessel.table_header_cfr'), - locale.getString('vessel.table_header_gear_type'), - locale.getString('vessel.table_header_license_type'), - locale.getString('vessel.table_header_last_report'), - - ]; - - //Set the data columns - var getData = function() { - var exportItems; - //Export only selected items - if(onlySelectedItems){ - exportItems = $scope.getSelectedItemsInFilter(); - } - //Export items in the table - else{ - exportItems = $scope.currentSearchResults.items; - } - //Only select those shown by filter - return exportItems.reduce( - function(csvObject, item){ - var csvRow = [ - item.countryCode, - item.externalMarking, - item.name, - item.ircs, - item.cfr, - $filter('vesselGearTypeTranslation')(item.gearType), - $filter('vesselLicenseTypeTranslation')(item.licenseType), - angular.isDefined(item.lastMovement) ? $filter('timeAgo')(item.lastMovement.time) : '', - ]; - csvObject.push(csvRow); - return csvObject; - },[] - ); - }; - - //Create and download the file - csvService.downloadCSVFile(getData(), header, filename); - }; - - //Show a position report - $scope.showReport = function(reportGuid){ - if (angular.isDefined(reportGuid)){ - PositionReportModal.showReportWithGuid(reportGuid); - } - }; - - $scope.$on("$destroy", function() { - alertService.hideMessage(); - }); - - init(); -}); +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . + */ +angular.module('unionvmsWeb').controller('VesselCtrl', function($scope, $log, $state, $filter, $timeout, locale, savedSearchService, Vessel, VesselContact, searchService, vesselRestService, alertService, csvService, SearchResults, userService, PositionReportModal) { + + var checkAccessToFeature = function(feature) { + return userService.isAllowed(feature, 'Union-VMS', true); + }; + + //Keep track of visibility statuses + $scope.isVisible = { + search : true, + vesselForm : false, + notificationCancelSearch : false + }; + + $scope.currentSearchResults = new SearchResults('', false, locale.getString('vessel.search_zero_results_error')); + $scope.waitingForVesselDataResponse = false; + + //Selected by checkboxes + $scope.selectedVessels = []; + + $scope.editSelectionDropdownItems = [ + {text:locale.getString('common.save_as_group'), code : 'SAVE'}, + {text:locale.getString('common.append_group'), code : 'ADD_TO_GROUP'}, + {text:locale.getString('common.remove_from_group'), code : 'REMOVE_FROM_GROUP'}, + //{text:locale.getString('common.view_on_map'), code : 'MAP'}, + {text:locale.getString('common.export_selection'), code : 'EXPORT'} + ]; + + $scope.stTable = { + tableState: undefined, + itemsByPage: 20, + page: undefined + }; + + //Init function when entering page + var init = function(){ + //Load list with vessels based on latest movements + $scope.searchLatestMovements(); + + //Load vessel details + var vesselGUID = $state.params.id; + if(angular.isDefined(vesselGUID)){ + vesselRestService.getVessel(vesselGUID).then( + function(vessel) { + $scope.vesselObj = vessel.copy(); + $scope.waitingForVesselDataResponse = false; + }, + function(error){ + $log.error("Error loading state params: /" +vesselGUID); + //Show alert and vessel list + $scope.waitingForVesselDataResponse = false; + toggleFormDetails(); + alertService.showErrorMessage(locale.getString('vessel.vessel_stateparams_failed_to_load_error')); + + //Hide alert and change state after 5 sec + $timeout(function() { + $state.go('app.assets', {}, {notify: false}); + alertService.hideMessage(); + }, 5000); + } + ); + + //Show vessel form with loading indicator + $scope.waitingForVesselDataResponse = true; + toggleFormDetails(); + } + }; + + //Goto page in the search results + $scope.gotoPage = function(page){ + if(angular.isDefined(page)){ + searchService.setPage(page); + $scope.searchVessels(); + } + }; + + // Search for vessels + $scope.searchVessels = function(options, page) { + if (angular.isUndefined(page)){ + page = 1; + } + $scope.selectedGroupGuid = angular.isDefined(options) && angular.isDefined(options.savedSearchGroup) ? options.savedSearchGroup.id : undefined; + + $scope.clearSelection(); + $scope.currentSearchResults.clearErrorMessage(); + $scope.currentSearchResults.filter = ''; + $scope.currentSearchResults.setLoading(true); + searchService.searchVessels(page) + .then(updateSearchResults, onGetSearchResultsError); + + var timeoutDisplayNotificationCancelSearch = 3000; + $timeout(function(){ + if ($scope.currentSearchResults.loading) { + $scope.isVisible.notificationCancelSearch = true; + } + }, timeoutDisplayNotificationCancelSearch); + }; + + // Cancel search for vessels + $scope.cancelSearch = function() { + vesselRestService.cancelPendingRequests(); + $scope.currentSearchResults.setLoading(false); + $scope.isVisible.notificationCancelSearch = false; + }; + + // Search for vessels based on latest movements + $scope.searchLatestMovements = function(options) { + $scope.selectedGroupGuid = angular.isDefined(options) && angular.isDefined(options.savedSearchGroup) ? options.savedSearchGroup.id : undefined; + + $scope.clearSelection(); + $scope.currentSearchResults.clearErrorMessage(); + $scope.currentSearchResults.filter = ''; + $scope.currentSearchResults.setLoading(true); + searchService.searchLatestMovements() + .then(updateSearchResults, onGetSearchResultsError); + }; + + //Update the search results + var updateSearchResults = function(vesselListPage){ + $scope.isVisible.notificationCancelSearch = false; + $scope.currentSearchResults.updateWithNewResults(vesselListPage); + + $scope.allCurrentSearchResults = vesselListPage.items; + $scope.currentSearchResultsByPage = vesselListPage.items; + + $scope.stTable.page = vesselListPage.currentPage; + if ($scope.stTable.page !== ($scope.stTable.tableState.pagination.start / $scope.stTable.itemsByPage) + 1){ + $scope.stTable.tableState.pagination.start = $scope.stTable.page; + } + + $scope.stTable.tableState.pagination.numberOfPages = vesselListPage.totalNumberOfPages; + }; + + $scope.sortTableData = function(predicate, reverse, options, page){ + if(angular.isDefined(predicate) && angular.isDefined(reverse)) { + searchService.addOrderByCriteria(predicate, reverse); + } + $scope.searchVessels(options, page); + }; + + // Handle error from search results (listing vessel) + var onGetSearchResultsError = function(response){ + $scope.isVisible.notificationCancelSearch = false; + + // Error functions not to be runned if search has been cancelled + if (angular.isUndefined(response) || response.status !== -1) { + $scope.currentSearchResults.removeAllItems(); + $scope.currentSearchResults.setLoading(false); + $scope.currentSearchResults.setErrorMessage(locale.getString('common.search_failed_error')); + $scope.allCurrentSearchResults = $scope.currentSearchResults.items; + } + }; + + //Is user allowed to edit vessels? + $scope.allowedToEditVessel = function(vessel){ + // Check permission, and vessel cannot be from source NATIONAL. + return checkAccessToFeature('manageVessels') && (!vessel || vessel.source !== 'NATIONAL'); + }; + + //Get original vessel + $scope.getOriginalVessel = function() { + if (!$scope.vesselObj) { + return; + } + + for (var i = 0; i < $scope.currentSearchResults.items.length; i++) { + if ($scope.currentSearchResults.items[i].equals($scope.vesselObj)) { + return $scope.currentSearchResults.items[i]; + } + } + }; + + $scope.mergeCurrentVesselIntoSearchResults = function() { + $scope.mergeCurrentVesselIntoSearchResults($scope.vesselObj); + }; + + $scope.mergeCurrentVesselIntoSearchResults = function(vesselObj) { + var vesselsInList = $scope.currentSearchResults.items; + for (var i = 0; i < vesselsInList.length; i++) { + if (vesselsInList[i].equals(vesselObj)) { + vesselsInList[i] = vesselObj; + vesselObj = vesselsInList[i].copy(); + } + } + }; + + $scope.removeCurrentVesselFromSearchResults = function() { + var vesselsInList = $scope.currentSearchResults.items; + var index; + for (var i = 0; i < vesselsInList.length; i++) { + if (vesselsInList[i].equals($scope.vesselObj)) { + index = i; + } + } + //Remove vessel from list + if(angular.isDefined(index)){ + $scope.currentSearchResults.items.splice(index, 1); + $scope.vesselObj = undefined; + } + + //Removed last vessel from list? + if($scope.currentSearchResults.items.length === 0){ + $scope.searchVessels(); + } + }; + + //Clear the selection + $scope.clearSelection = function(){ + $scope.selectedVessels = []; + }; + + //Add a vessel to the selection + $scope.addToSelection = function(item){ + $scope.selectedVessels.push(item); + }; + + //Remove a vessel from the selection + $scope.removeFromSelection = function(item){ + $.each($scope.selectedVessels, function(index, vessel){ + if(vessel.equals(item)){ + $scope.selectedVessels.splice(index, 1); + return false; + } + }); + }; + + //Are we in create mode? + $scope.isCreateNewMode = function(){ + return $scope.createNewMode; + }; + + $scope.setCreateMode = function(bool){ + $scope.createNewMode = bool; + }; + + $scope.setVesselObj = function(vessel){ + $scope.vesselObj = vessel; + }; + + $scope.getVesselObj = function(){ + return $scope.vesselObj; + }; + + //Toggle create new vessel + $scope.toggleCreateNewVessel = function(){ + $scope.createNewMode = true; + var newVessel = new Vessel(); + newVessel.contact.push(new VesselContact()); + toggleVesselForm(newVessel); + }; + + //Toggle viewing of a vessel + $scope.toggleViewVessel = function(item, noHideMessage){ + $scope.createNewMode = false; + toggleVesselForm(item, noHideMessage); + }; + + var toggleVesselForm = function(vessel, noHideMessage){ + //Create copy of the vessel object so we don't edit the object in the vessel list + if(vessel){ + $scope.vesselObj = vessel.copy(); + }else{ + $scope.vesselObj = undefined; + } + if (!noHideMessage) { + alertService.hideMessage(); + } + toggleFormDetails(); + }; + + //Toggle between vessel details and vessel list + var toggleFormDetails = function(){ + $scope.isVisible.vesselForm = !$scope.isVisible.vesselForm; + $scope.isVisible.search = !$scope.isVisible.search; + }; + + function getVesselGuids(vessels) { + return vessels.map(function(vessel) { + return vessel.vesselId.guid; + }); + } + + //When click cancel redirect to correct state and toggle list view + $scope.cancelFormView = function(){ + if(angular.isDefined($state.params.id)){ + $state.go('app.assets', {}, {notify: false}); + } + + $scope.toggleViewVessel(); + }; + + //Callback function for the "edit selection" dropdown + $scope.editSelectionCallback = function(selectedItem){ + var selectedItems = $scope.getSelectedItemsInFilter(); + if(selectedItems.length > 0){ + if (selectedItem.code === 'SAVE' || selectedItem.code === 'ADD_TO_GROUP') { + var options = { + dynamicSearch : false, + selectedItems : selectedItems, + append: selectedItem.code === 'ADD_TO_GROUP' + }; + savedSearchService.openSaveSearchModal("VESSEL", options); + } + else if (selectedItem.code === 'REMOVE_FROM_GROUP') { + removeFromGroup($scope.selectedGroupGuid, getVesselGuids(selectedItems)); + } + else if (selectedItem.code === 'EXPORT') { + $scope.exportVesselsAsCSVFile(true); + } + }else{ + alertService.showInfoMessageWithTimeout(locale.getString('common.no_items_selected')); + } + }; + + /* Removed the selected items from the current group, updates the group list and refreshed search if successful. */ + function removeFromGroup(groupId, selectedItems) { + if (groupId === undefined) { + alertService.showInfoMessageWithTimeout(locale.getString('common.no_group_selected')); + return; + } + + savedSearchService.removeVesselsFromGroup(groupId, selectedItems).then(function(group) { + $scope.$broadcast('refreshSavedSearch', group); + }, function(error) { + alertService.showErrorMessageWithTimeout(error); + }); + } + + //Get the selected items that are shown by the filter + $scope.getSelectedItemsInFilter = function(){ + return $filter('filter')($scope.selectedVessels, $scope.currentSearchResults.filter); + }; + + //Export data as CSV file + $scope.exportVesselsAsCSVFile = function(onlySelectedItems){ + var filename = 'assets.csv'; + + //Set the header columns + var header = [ + locale.getString('vessel.table_header_flag_state'), + locale.getString('vessel.table_header_external_marking'), + locale.getString('vessel.table_header_name'), + locale.getString('vessel.table_header_signal'), + locale.getString('vessel.table_header_cfr'), + locale.getString('vessel.table_header_gear_type'), + locale.getString('vessel.table_header_license_type'), + locale.getString('vessel.table_header_last_report'), + + ]; + + //Set the data columns + var getData = function() { + var exportItems; + //Export only selected items + if(onlySelectedItems){ + exportItems = $scope.getSelectedItemsInFilter(); + } + //Export items in the table + else{ + exportItems = $scope.currentSearchResults.items; + } + //Only select those shown by filter + return exportItems.reduce( + function(csvObject, item){ + var csvRow = [ + item.countryCode, + item.externalMarking, + item.name, + item.ircs, + item.cfr, + $filter('vesselGearTypeTranslation')(item.gearType), + $filter('vesselLicenseTypeTranslation')(item.licenseType), + angular.isDefined(item.lastMovement) ? $filter('timeAgo')(item.lastMovement.time) : '', + ]; + csvObject.push(csvRow); + return csvObject; + },[] + ); + }; + + //Create and download the file + csvService.downloadCSVFile(getData(), header, filename); + }; + + //Show a position report + $scope.showReport = function(reportGuid){ + if (angular.isDefined(reportGuid)){ + PositionReportModal.showReportWithGuid(reportGuid); + } + }; + + $scope.$on("$destroy", function() { + alertService.hideMessage(); + }); + + init(); +}); diff --git a/unionvms-web/app/partial/vessel/vesselList/vesselList.html b/unionvms-web/app/partial/vessel/vesselList/vesselList.html index 374a3f2f3..1e6840df5 100644 --- a/unionvms-web/app/partial/vessel/vesselList/vesselList.html +++ b/unionvms-web/app/partial/vessel/vesselList/vesselList.html @@ -1,74 +1,74 @@ - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - {{'vessel.table_header_flag_state' | i18n}} - - {{'vessel.table_header_external_marking' | i18n}} - - {{'vessel.table_header_name' | i18n}} - - {{'vessel.table_header_signal' | i18n}} - - {{'vessel.table_header_cfr' | i18n}} - - {{'vessel.table_header_gear_type' | i18n}} - - {{'vessel.table_header_license_type' | i18n}} - - {{'vessel.table_header_last_report' | i18n}} - {{'vessel.table_header_details' | i18n}}
{{item.countryCode}}{{item.externalMarking}}{{item.name}}{{item.ircs}}{{item.cfr}}{{item.gearType | vesselGearTypeTranslation}}{{item.licenseType | vesselLicenseTypeTranslation}} - -
-
-
-
-
\ No newline at end of file + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + {{'vessel.table_header_flag_state' | i18n}} + + {{'vessel.table_header_external_marking' | i18n}} + + {{'vessel.table_header_name' | i18n}} + + {{'vessel.table_header_signal' | i18n}} + + {{'vessel.table_header_cfr' | i18n}} + + {{'vessel.table_header_gear_type' | i18n}} + + {{'vessel.table_header_license_type' | i18n}} + + {{'vessel.table_header_last_report' | i18n}} + {{'vessel.table_header_details' | i18n}}
{{item.countryCode}}{{item.externalMarking}}{{item.name}}{{item.ircs}}{{item.cfr}}{{item.gearType | vesselGearTypeTranslation}}{{item.licenseType | vesselLicenseTypeTranslation}} + +
+
+
+
+
diff --git a/unionvms-web/app/partial/vessel/vesselList/vesselList.js b/unionvms-web/app/partial/vessel/vesselList/vesselList.js index 6fc7b6a11..f8743b10d 100644 --- a/unionvms-web/app/partial/vessel/vesselList/vesselList.js +++ b/unionvms-web/app/partial/vessel/vesselList/vesselList.js @@ -1,77 +1,81 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . - */ -angular.module('unionvmsWeb').controller('VesselListCtrl',function($scope){ - - //Handle click on the top "check all" checkbox - $scope.checkAll = function(){ - if($scope.isAllChecked()){ - //Remove all - $scope.clearSelection(); - }else{ - //Add all - $scope.clearSelection(); - $.each($scope.currentSearchResults.items, function(index, item) { - $scope.addToSelection(item); - }); - } - }; - - $scope.checkItem = function(item){ - item.Selected = !item.Selected; - if($scope.isChecked(item)){ - //Remove - $scope.removeFromSelection(item); - }else{ - $scope.addToSelection(item); - } - }; - - $scope.isAllChecked = function(){ - if(angular.isUndefined($scope.currentSearchResults.items) || $scope.selectedVessels.length === 0){ - return false; - } - - var allChecked = true; - $.each($scope.currentSearchResults.items, function(index, item) { - if(!$scope.isChecked(item)){ - allChecked = false; - return false; - } - }); - return allChecked; - }; - - $scope.isChecked = function(item){ - var checked = false; - $.each($scope.selectedVessels, function(index, vessel){ - if(vessel.equals(item)){ - checked = true; - return false; - } - }); - return checked; - }; - - $scope.tableCallback = function(tableState){ - $scope.stTable.tableState = tableState; - var pageNumber = $scope.stTable.tableState.pagination.start / $scope.stTable.itemsByPage; - - if (angular.isDefined($scope.stTable.page) && pageNumber + 1 !== $scope.stTable.page){ - $scope.stTable.page = pageNumber + 1; - $scope.searchVessels(undefined, $scope.stTable.page); - } else { - if (angular.isDefined(tableState.sort.predicate) && angular.isDefined($scope.currentSearchResultsByPage) && $scope.currentSearchResultsByPage.length > 0){ - $scope.sortTableData(tableState.sort.predicate, tableState.sort.reverse); - } - } - }; +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . + */ +angular.module('unionvmsWeb').controller('VesselListCtrl',function($scope){ + + //Handle click on the top "check all" checkbox + $scope.checkAll = function(){ + if($scope.isAllChecked()){ + //Remove all + $scope.clearSelection(); + }else{ + //Add all + $scope.clearSelection(); + $.each($scope.currentSearchResults.items, function(index, item) { + $scope.addToSelection(item); + }); + } + }; + + $scope.checkItem = function(item){ + item.Selected = !item.Selected; + if($scope.isChecked(item)){ + //Remove + $scope.removeFromSelection(item); + }else{ + $scope.addToSelection(item); + } + }; + + $scope.isAllChecked = function(){ + if(angular.isUndefined($scope.currentSearchResults.items) || $scope.selectedVessels.length === 0){ + return false; + } + + var allChecked = true; + $.each($scope.currentSearchResults.items, function(index, item) { + if(!$scope.isChecked(item)){ + allChecked = false; + return false; + } + }); + return allChecked; + }; + + $scope.isChecked = function(item){ + var checked = false; + $.each($scope.selectedVessels, function(index, vessel){ + if(vessel.equals(item)){ + checked = true; + return false; + } + }); + return checked; + }; + + $scope.tableCallback = function(tableState){ + $scope.stTable.tableState = tableState; + var pageNumber = $scope.stTable.tableState.pagination.start / $scope.stTable.itemsByPage; + var predicate = undefined; + var reverse = undefined; + var options = undefined; + var page = undefined; + if (angular.isDefined($scope.stTable.page) && pageNumber + 1 !== $scope.stTable.page){ + $scope.stTable.page = pageNumber + 1; + page = $scope.stTable.page; + } + if (angular.isDefined(tableState.sort.predicate) && angular.isDefined($scope.currentSearchResultsByPage) && $scope.currentSearchResultsByPage.length > 0){ + predicate = tableState.sort.predicate; + reverse = tableState.sort.reverse; + } + $scope.sortTableData(predicate, reverse, options, page); + }; }); \ No newline at end of file diff --git a/unionvms-web/app/service/activity/activityRestService.js b/unionvms-web/app/service/activity/activityRestService.js index e95b4d817..64877eeaa 100644 --- a/unionvms-web/app/service/activity/activityRestService.js +++ b/unionvms-web/app/service/activity/activityRestService.js @@ -14,7 +14,7 @@ copy of the GNU General Public License along with the IFDM Suite. If not, see {@link unionvmsWeb.activityRestFactory}

+ * @param activityRestFactory {service} The REST factory for the activity module

{@link unionvmsWeb.activityRestFactory}

* @description * REST services for the activity module */ @@ -170,7 +176,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource var activityService = { /** * Get the user preferences for the activty module - * + * * @memberof activityRestService * @public * @returns {Promise} A promise with either the user preferences of the activity module or reject error @@ -187,7 +193,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource }, /** * Get a list of fishing activity reports according to search criteria - * + * * @memberof activityRestService * @public * @param {Object} data - The search criteria and table pagination data object @@ -225,7 +231,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource }, /** * Get the history for a FA report - * + * * @memberof activityRestService * @public * @param {Number} refId - The reference ID @@ -261,7 +267,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource }, /** * Get the vessel and roles details of a specific trip - * + * * @memberof activityRestService * @public * @param {String} id - The trip id of the selected trip @@ -278,7 +284,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource }, /** * Get the message type count of a specific trip - * + * * @memberof activityRestService * @public * @param {String} id - The trip id of the selected trip @@ -295,7 +301,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource }, /** * Get the trip reports of a specific trip - * + * * @memberof activityRestService * @public * @param {String} id - The trip id of the selected trip @@ -312,7 +318,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource }, /** * Get the trip map data - * + * * @memberof activityRestService * @public * @param {String} id - The trip id of the selected trip @@ -345,8 +351,8 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource return deferred.promise; }, /** - * Get the Catches Evolution Details. - * + * Get the Catches Evolution Details. + * * @memberof activityRestService * @public * @param {String} id - The trip id of the selected trip @@ -364,11 +370,11 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource }, /** * Get Fishing Activity details by type - * + * * @memberof activityRestService * @public * @param {String} type - The fisihing activity type (e.g. departure, landing, arrival) - * @param {Object} payload - The post payload containing the activity id (mandatory) and the trip id (not mandatory and to be used only in the report tab) + * @param {Object} payload - The post payload containing the activity id (mandatory) and the trip id (not mandatory and to be used only in the report tab) * @returns {Promise} A promise with either the fishing activity details or reject error */ getFishingActivityDetails: function(type, payload){ @@ -384,7 +390,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource }, /** * Get commchannels data - * + * * @memberof activityRestService * @public * @returns {Promise} A promise with either the fishing activity details or reject error @@ -397,6 +403,24 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource deferred.reject(error); }); return deferred.promise; + }, + exportActivityListToCsv: function (query) { + return activityRestFactory.exportActivityListToCsv(query).then( + function (response) { + return response.data; + }, function () { + console.error('Failed to export activities to CSV'); + return {}; + }); + }, + exportTripListToCsv: function (query) { + return activityRestFactory.exportTripListToCsv(query).then( + function (response) { + return response.data; + }, function () { + console.error('Failed to export trips to CSV'); + return {}; + }); } }; diff --git a/unionvms-web/app/service/activity/activityService.js b/unionvms-web/app/service/activity/activityService.js index 6f90c0b06..85fd3c27d 100644 --- a/unionvms-web/app/service/activity/activityService.js +++ b/unionvms-web/app/service/activity/activityService.js @@ -32,7 +32,7 @@ copy of the GNU General Public License along with the IFDM Suite. If not, see . - */ -angular.module('unionvmsWeb') -.factory('GetListRequest', function(SearchField) { - - function GetListRequest(page, listSize, isDynamic, criterias, sorting){ - this.page = angular.isDefined(page) ? page : 1; - this.listSize = angular.isDefined(listSize) ? listSize : 10; - this.isDynamic = angular.isDefined(isDynamic) ? isDynamic : true; - this.criterias = angular.isDefined(criterias) ? criterias : []; - this.sorting = angular.isDefined(sorting) ? sorting : {}; - } - - GetListRequest.prototype.toJson = function(){ - return JSON.stringify({ - pagination : {page: this.page, listSize: this.listSize}, - searchCriteria : {isDynamic: this.isDynamic, criterias: this.criterias}, - sorting : {sortBy: this.sorting.sortBy, reversed: this.sorting.reverse} - }); - }; - - GetListRequest.prototype.DTOForVessel = function(){ - //Add * to all text searches for vessel - var wildcardSearchKeys = ['NAME', 'IRCS', 'CFR', 'EXTERNAL_MARKING', 'HOMEPORT', 'IMO', 'PRODUCER_NAME', 'PRODUCER_CODE', 'CONTACT_NAME', 'CONTACT_NUMBER', 'CONTACT_EMAIL', 'MMSI']; - var updatedCriterias = [], - searchFieldKey, searchFieldValue; - - $.each(this.criterias, function(index, searchField){ - searchFieldKey = searchField.key; - searchFieldValue = searchField.value; - //Add * to the end of the search value? - if(wildcardSearchKeys.indexOf(searchFieldKey) >= 0){ - if(typeof searchFieldValue === 'string' && searchFieldValue.charAt(searchFieldValue.length -1)){ - searchFieldValue = searchFieldValue +'*'; - } - - } - updatedCriterias.push(new SearchField(searchFieldKey, searchFieldValue)); - }); - - return { - pagination : {page: this.page, listSize: this.listSize}, - assetSearchCriteria : { isDynamic : this.isDynamic, criterias : updatedCriterias } - }; - }; - - GetListRequest.prototype.DTOForMobileTerminal = function(){ - var wildcardKeys = ['NAME', 'IRCS', 'EXTERNAL_MARKING', 'CFR', 'HOMEPORT', 'MMSI', 'SERIAL_NUMBER', 'DNID', 'SATELLITE_NUMBER', 'MEMBER_NUMBER']; - var criteria = this.criterias.map(function(criteria) { - if (wildcardKeys.indexOf(criteria.key) >= 0) { - return new SearchField(criteria.key, criteria.value + '*'); - } - else { - return criteria; - } - }); - - return { - pagination : {page: this.page, listSize: this.listSize}, - mobileTerminalSearchCriteria : {isDynamic: this.isDynamic, criterias: criteria} - }; - }; - - GetListRequest.prototype.DTOForPoll = function(){ - return { - pagination : {page: this.page, listSize: this.listSize}, - pollSearchCriteria : {isDynamic: this.isDynamic, criterias: this.criterias} - }; - }; - - GetListRequest.prototype.DTOForMovement = function(){ - - //List of search fields that should be in the movementRangeSearchCriteria object - //Ranges must include both from and to, so that's what the defaultValues are for - var ranges = [ - { - key : 'DATE', - from : {searchKey: 'FROM_DATE', defaultValue: '1970-01-01 00:00:00 +00:00'}, - to : {searchKey: 'TO_DATE', defaultValue: '2070-01-01 00:00:00 +00:00'} - }, - { - key: 'MOVEMENT_SPEED', - from : {searchKey: 'SPEED_MIN', defaultValue: 0}, - to : {searchKey: 'SPEED_MAX', defaultValue: 99999999} - } - ]; - - //Get a range by the search key - function getRangeBySearchKey(key){ - var range; - $.each(ranges, function(i, aRange){ - if(key === aRange.from.searchKey || key === aRange.to.searchKey){ - range = aRange; - return false; - } - }); - return range; - } - - var rangeCriterias = {}; - var criterias = []; - - //Build dict with rangeCriterias - var searchFieldKey, searchFieldValue, range; - $.each(this.criterias, function(index, searchField){ - searchFieldKey = searchField.key; - searchFieldValue = searchField.value; - - //Range search? - range = getRangeBySearchKey(searchFieldKey); - if(range){ - if(angular.isUndefined(rangeCriterias[range.key])){ - rangeCriterias[range.key] = { - from : range.from.defaultValue, - to : range.to.defaultValue, - }; - } - if(searchFieldKey === range.from.searchKey){ - rangeCriterias[range.key]['from'] = searchFieldValue; - } - else{ - rangeCriterias[range.key]['to'] = searchFieldValue; - } - }else{ - criterias.push(searchField); - } - }); - - //Make rangeCriterias a list - var rangeCriteriasList = []; - $.each(rangeCriterias, function(key, value){ - value['key'] = key; - rangeCriteriasList.push(value); - }); - - return { - movementRangeSearchCriteria : rangeCriteriasList, - movementSearchCriteria : criterias, - pagination : {page: this.page, listSize: this.listSize} - }; - }; - - GetListRequest.prototype.DTOForManualPosition = function(){ - return { - movementSearchCriteria : this.criterias, - pagination : {page: this.page, listSize: this.listSize} - }; - }; - - GetListRequest.prototype.DTOForAuditLogList = function() { - return { - auditSearchCriteria: this.criterias, - pagination: {page: this.page, listSize: this.listSize} - }; - }; - - GetListRequest.prototype.DTOForExchangeMessageList = function(){ - return{ - exchangeSearchCriteria : {criterias: this.criterias, isDynamic: false}, - pagination: {page: this.page, listSize: this.listSize}, - sorting: this.sorting - }; - }; - - GetListRequest.prototype.DTOForExchangePollList = function(){ - var fromDateSearchField = this.getCriteria('FROM_DATE'); - var toDateSearchField = this.getCriteria('TO_DATE'); - var statusSearchField = this.getCriteria('STATUS'); - - var searchObj = {}; - if(fromDateSearchField){ - searchObj.statusFromDate = fromDateSearchField.value; - } - if(toDateSearchField){ - searchObj.statusToDate = toDateSearchField.value; - } - if(statusSearchField){ - searchObj.status = statusSearchField.value; - } - return searchObj; - }; - - - GetListRequest.prototype.DTOForAlarms = function(){ - return{ - alarmSearchCriteria : this.criterias, - pagination: {page: this.page, listSize: this.listSize}, - dynamic: this.isDynamic - }; - }; - - GetListRequest.prototype.DTOForTickets = function(){ - return{ - ticketSearchCriteria : this.criterias, - pagination: {page: this.page, listSize: this.listSize} - }; - }; - - GetListRequest.prototype.DTOForRules = function(){ - return{ - customRuleSearchCriteria : this.criterias, - pagination: {page: this.page, listSize: this.listSize} - }; - }; - - GetListRequest.prototype.setPage = function(newPage){ - this.page = newPage; - return this.page; - }; - - GetListRequest.prototype.addSearchCriteria = function(key, value){ - var alreadyExists = false; - - //Only add if it doesnt already exists - $.each(this.criterias, function(index, crit){ - if(key === crit.key && value === crit.value){ - alreadyExists = true; - return false; - } - }); - if(!alreadyExists){ - this.criterias.push(new SearchField(key, value)); - } - }; - - //Removes criterias with the specified key - GetListRequest.prototype.removeSearchCriteria = function(key){ - var idxToRemove = []; - $.each(this.criterias, function(index, crit){ - if(key === crit.key){ - idxToRemove.push(index); - } - }); - - //Remove criterias - for (var i = idxToRemove.length - 1; i >= 0; i--) { - this.criterias.splice(idxToRemove[i],1); - } - }; - - GetListRequest.prototype.getCriteria = function(criteria){ - var found; - $.each(this.criterias, function(i, searchField){ - if(searchField.key === criteria){ - found = searchField; - return false; - } - }); - return found; - }; - - GetListRequest.prototype.setSearchCriterias = function(criterias){ - this.criterias = criterias; - }; - - GetListRequest.prototype.resetCriterias = function(){ - this.criterias = []; - }; - - GetListRequest.prototype.setDynamic = function(dynamic){ - this.isDynamic = dynamic; - }; - - GetListRequest.prototype.setDynamicToFalse = function(){ - this.isDynamic = false; - }; - - GetListRequest.prototype.setDynamicToTrue = function(){ - this.isDynamic = true; - }; - - GetListRequest.prototype.getNumberOfSearchCriterias = function(){ - return this.criterias.length; - }; - - GetListRequest.prototype.copy = function(){ - var copy = new GetListRequest(); - copy.page = this.page; - copy.listSize = this.listSize; - copy.isDynamic = this.isDynamic; - copy.criterias = []; - copy.sorting = this.sorting; - - $.each(this.criterias, function(index, searchField){ - copy.criterias.push(searchField.copy()); - }); - return copy; - }; - - return GetListRequest; -}); +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . + */ +angular.module('unionvmsWeb') +.factory('GetListRequest', function(SearchField) { + + function GetListRequest(page, listSize, isDynamic, criterias, sorting, orderByCriteria){ + this.page = angular.isDefined(page) ? page : 1; + this.listSize = angular.isDefined(listSize) ? listSize : 10; + this.isDynamic = angular.isDefined(isDynamic) ? isDynamic : true; + this.criterias = angular.isDefined(criterias) ? criterias : []; + this.sorting = angular.isDefined(sorting) ? sorting : {}; + this.orderByCriteria = angular.isDefined(orderByCriteria) ? orderByCriteria : {}; + } + + GetListRequest.prototype.toJson = function(){ + return JSON.stringify({ + pagination : {page: this.page, listSize: this.listSize}, + searchCriteria : {isDynamic: this.isDynamic, criterias: this.criterias}, + sorting : {sortBy: this.sorting.sortBy, reversed: this.sorting.reverse}, + orderByCriteria : this.orderByCriteria + }); + }; + + GetListRequest.prototype.DTOForVessel = function(){ + //Add * to all text searches for vessel + var wildcardSearchKeys = ['NAME', 'IRCS', 'CFR', 'EXTERNAL_MARKING', 'HOMEPORT', 'IMO', 'PRODUCER_NAME', 'PRODUCER_CODE', 'CONTACT_NAME', 'CONTACT_NUMBER', 'CONTACT_EMAIL', 'MMSI']; + var updatedCriterias = [], + searchFieldKey, searchFieldValue; + + $.each(this.criterias, function(index, searchField){ + searchFieldKey = searchField.key; + searchFieldValue = searchField.value; + //Add * to the end of the search value? + if(wildcardSearchKeys.indexOf(searchFieldKey) >= 0){ + if(typeof searchFieldValue === 'string' && searchFieldValue.charAt(searchFieldValue.length -1)){ + searchFieldValue = searchFieldValue +'*'; + } + + } + updatedCriterias.push(new SearchField(searchFieldKey, searchFieldValue)); + }); + + var DTOForVessel = { + pagination : {page: this.page, listSize: this.listSize}, + assetSearchCriteria : { isDynamic : this.isDynamic, criterias : updatedCriterias }, + }; + + if(this.orderByCriteria && this.orderByCriteria.orderByParam){ + DTOForVessel.orderByCriteria = this.orderByCriteria; + } + + return DTOForVessel; + }; + + GetListRequest.prototype.DTOForMobileTerminal = function(){ + var wildcardKeys = ['NAME', 'IRCS', 'EXTERNAL_MARKING', 'CFR', 'HOMEPORT', 'MMSI', 'SERIAL_NUMBER', 'DNID', 'SATELLITE_NUMBER', 'MEMBER_NUMBER']; + var criteria = this.criterias.map(function(criteria) { + if (wildcardKeys.indexOf(criteria.key) >= 0) { + return new SearchField(criteria.key, criteria.value + '*'); + } + else { + return criteria; + } + }); + + return { + pagination : {page: this.page, listSize: this.listSize}, + mobileTerminalSearchCriteria : {isDynamic: this.isDynamic, criterias: criteria} + }; + }; + + GetListRequest.prototype.DTOForPoll = function(){ + return { + pagination : {page: this.page, listSize: this.listSize}, + pollSearchCriteria : {isDynamic: this.isDynamic, criterias: this.criterias} + }; + }; + + GetListRequest.prototype.DTOForMovement = function(){ + + //List of search fields that should be in the movementRangeSearchCriteria object + //Ranges must include both from and to, so that's what the defaultValues are for + var ranges = [ + { + key : 'DATE', + from : {searchKey: 'FROM_DATE', defaultValue: '1970-01-01 00:00:00 +00:00'}, + to : {searchKey: 'TO_DATE', defaultValue: '2070-01-01 00:00:00 +00:00'} + }, + { + key: 'MOVEMENT_SPEED', + from : {searchKey: 'SPEED_MIN', defaultValue: 0}, + to : {searchKey: 'SPEED_MAX', defaultValue: 99999999} + } + ]; + + //Get a range by the search key + function getRangeBySearchKey(key){ + var range; + $.each(ranges, function(i, aRange){ + if(key === aRange.from.searchKey || key === aRange.to.searchKey){ + range = aRange; + return false; + } + }); + return range; + } + + var rangeCriterias = {}; + var criterias = []; + + //Build dict with rangeCriterias + var searchFieldKey, searchFieldValue, range; + $.each(this.criterias, function(index, searchField){ + searchFieldKey = searchField.key; + searchFieldValue = searchField.value; + + //Range search? + range = getRangeBySearchKey(searchFieldKey); + if(range){ + if(angular.isUndefined(rangeCriterias[range.key])){ + rangeCriterias[range.key] = { + from : range.from.defaultValue, + to : range.to.defaultValue, + }; + } + if(searchFieldKey === range.from.searchKey){ + rangeCriterias[range.key]['from'] = searchFieldValue; + } + else{ + rangeCriterias[range.key]['to'] = searchFieldValue; + } + }else{ + criterias.push(searchField); + } + }); + + //Make rangeCriterias a list + var rangeCriteriasList = []; + $.each(rangeCriterias, function(key, value){ + value['key'] = key; + rangeCriteriasList.push(value); + }); + + return { + movementRangeSearchCriteria : rangeCriteriasList, + movementSearchCriteria : criterias, + pagination : {page: this.page, listSize: this.listSize} + }; + }; + + GetListRequest.prototype.mapOrderByParam = function (orderByParam){ + var orderByParamMap = { + name: "NAME", + externalMarking: "EXTERNAL_MARKING", + countryCode: "FLAG_STATE", + ircs: "IRCS", + cfr: "CFR", + gearType: "GEAR_TYPE", + licenseType: "LICENSE_TYPE" + }; + return orderByParamMap[orderByParam]; + }; + + GetListRequest.prototype.DTOForManualPosition = function(){ + return { + movementSearchCriteria : this.criterias, + pagination : {page: this.page, listSize: this.listSize} + }; + }; + + GetListRequest.prototype.DTOForAuditLogList = function() { + return { + auditSearchCriteria: this.criterias, + pagination: {page: this.page, listSize: this.listSize} + }; + }; + + GetListRequest.prototype.DTOForExchangeMessageList = function(){ + return{ + exchangeSearchCriteria : {criterias: this.criterias, isDynamic: false}, + pagination: {page: this.page, listSize: this.listSize}, + sorting: this.sorting + }; + }; + + GetListRequest.prototype.DTOForExchangePollList = function(){ + var fromDateSearchField = this.getCriteria('FROM_DATE'); + var toDateSearchField = this.getCriteria('TO_DATE'); + var statusSearchField = this.getCriteria('STATUS'); + + var searchObj = {}; + if(fromDateSearchField){ + searchObj.statusFromDate = fromDateSearchField.value; + } + if(toDateSearchField){ + searchObj.statusToDate = toDateSearchField.value; + } + if(statusSearchField){ + searchObj.status = statusSearchField.value; + } + return searchObj; + }; + + + GetListRequest.prototype.DTOForAlarms = function(){ + return{ + alarmSearchCriteria : this.criterias, + pagination: {page: this.page, listSize: this.listSize}, + dynamic: this.isDynamic + }; + }; + + GetListRequest.prototype.DTOForTickets = function(){ + return{ + ticketSearchCriteria : this.criterias, + pagination: {page: this.page, listSize: this.listSize} + }; + }; + + GetListRequest.prototype.DTOForRules = function(){ + return{ + customRuleSearchCriteria : this.criterias, + pagination: {page: this.page, listSize: this.listSize} + }; + }; + + GetListRequest.prototype.setPage = function(newPage){ + this.page = newPage; + return this.page; + }; + + GetListRequest.prototype.addSearchCriteria = function(key, value){ + var alreadyExists = false; + + //Only add if it doesnt already exists + $.each(this.criterias, function(index, crit){ + if(key === crit.key && value === crit.value){ + alreadyExists = true; + return false; + } + }); + if(!alreadyExists){ + this.criterias.push(new SearchField(key, value)); + } + }; + + GetListRequest.prototype.addOrderByCriteria = function(orderByParam, isOrderByDescOrder){ + this.removeOrderByCriteria(); + this.orderByCriteria = {orderByParam: this.mapOrderByParam(orderByParam), isOrderByDescOrder: isOrderByDescOrder}; + }; + + GetListRequest.prototype.removeOrderByCriteria = function() { + delete this.orderByCriteria; + }; + + //Removes criterias with the specified key + GetListRequest.prototype.removeSearchCriteria = function(key){ + var idxToRemove = []; + $.each(this.criterias, function(index, crit){ + if(key === crit.key){ + idxToRemove.push(index); + } + }); + + //Remove criterias + for (var i = idxToRemove.length - 1; i >= 0; i--) { + this.criterias.splice(idxToRemove[i],1); + } + }; + + GetListRequest.prototype.getCriteria = function(criteria){ + var found; + $.each(this.criterias, function(i, searchField){ + if(searchField.key === criteria){ + found = searchField; + return false; + } + }); + return found; + }; + + GetListRequest.prototype.setSearchCriterias = function(criterias){ + this.criterias = criterias; + }; + + GetListRequest.prototype.resetCriterias = function(){ + this.criterias = []; + }; + + GetListRequest.prototype.setDynamic = function(dynamic){ + this.isDynamic = dynamic; + }; + + GetListRequest.prototype.setDynamicToFalse = function(){ + this.isDynamic = false; + }; + + GetListRequest.prototype.setDynamicToTrue = function(){ + this.isDynamic = true; + }; + + GetListRequest.prototype.getNumberOfSearchCriterias = function(){ + return this.criterias.length; + }; + + GetListRequest.prototype.copy = function(){ + var copy = new GetListRequest(); + copy.page = this.page; + copy.listSize = this.listSize; + copy.isDynamic = this.isDynamic; + copy.criterias = []; + copy.sorting = this.sorting; + + $.each(this.criterias, function(index, searchField){ + copy.criterias.push(searchField.copy()); + }); + return copy; + }; + + return GetListRequest; +}); diff --git a/unionvms-web/app/service/common/searchService.js b/unionvms-web/app/service/common/searchService.js index 48dd1b43b..be744a729 100644 --- a/unionvms-web/app/service/common/searchService.js +++ b/unionvms-web/app/service/common/searchService.js @@ -307,7 +307,7 @@ angular.module('unionvmsWeb').factory('searchService',function($q, $log, searchU } var deferred = $q.defer(), - getListRequestAllItems = new GetListRequest(pageNum, DEFAULT_ITEMS_PER_PAGE, getListRequest.isDynamic, getListRequest.criterias); + getListRequestAllItems = new GetListRequest(pageNum, DEFAULT_ITEMS_PER_PAGE, getListRequest.isDynamic, getListRequest.criterias, undefined, getListRequest.orderByCriteria); searchUtilsService.modifySpanAndTimeZones(getListRequest.criterias); searchUtilsService.replaceCommasWithPoint(getListRequest.criterias); @@ -750,9 +750,16 @@ angular.module('unionvmsWeb').factory('searchService',function($q, $log, searchU addSearchCriteria : function(key, value){ getListRequest.addSearchCriteria(key, value); }, + addOrderByCriteria : function(orderByParam, isOrderByDescOrder){ + getListRequest.addOrderByCriteria(orderByParam, isOrderByDescOrder); + }, removeSearchCriteria : function(key){ getListRequest.removeSearchCriteria(key); }, + removeOrderByCriteria : function(){ + getListRequest.removeOrderByCriteria(); + }, + hasSearchCriteria: function(key) { for (var i = 0; i < getListRequest.criterias.length; i++) { var searchField = getListRequest.criterias[i]; diff --git a/unionvms-web/app/service/reporting/reportService.js b/unionvms-web/app/service/reporting/reportService.js index ac9c7aad7..ed98443df 100644 --- a/unionvms-web/app/service/reporting/reportService.js +++ b/unionvms-web/app/service/reporting/reportService.js @@ -16,7 +16,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp name: undefined, isReportExecuting: false, isReportRefreshing: false, - hasAlert: false, + hasAlert: false, hideCatchDetails : false, message: undefined, alertType: undefined, @@ -33,9 +33,13 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp errorLoadingDefault: false, lastMapConfigs: undefined, getConfigsTime: undefined, - getReportTime: undefined + getReportTime: undefined, + mapZoom: undefined, + mapCenter: undefined, + layerConfiguration: {}, + layersConfig: {} }; - + rep.clearVmsData = function(){ rep.id = undefined; rep.positions = []; @@ -45,23 +49,23 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp rep.trips = []; rep.activities = []; }; - + rep.resetReport = function(){ rep.name = locale.getString('spatial.header_live_view'); rep.refresh.status = false; rep.refresh.rate = undefined; rep.getConfigsTime = undefined; rep.getReportTime = undefined; - + //Clear data used in tables rep.clearVmsData(); - + //Reset labels mapService.resetLabelContainers(); - + //Clear report form service reportFormService.resetLiveView(); - + //Reset map projection if (angular.isDefined(mapService.map)){ mapService.updateMapView({ @@ -71,58 +75,70 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp axis: 'enu', extent: '-20026376.39;-20048966.10;20026376.39;20048966.10' }); - + //Reset layer tree layerPanelService.updateLayerTreeSource([]); } }; - + rep.stopRunInterval = function(){ $interval.cancel(rep.runInterval); rep.runInterval = undefined; }; - + var runSummaryReport = function(){ $modalStack.dismissAll(); }; + rep.pushLayerConfig = function(node, value) { + rep.layersConfig[node] = value; + }; + + + rep.getLayerConfig = function() { + return rep.layersConfig; + }; + rep.runReport = function(report){ rep.clearMapOverlays(); loadingStatus.isLoading('LiveviewMap',true, 0); spatialHelperService.fromFAView = false; tripReportsTimeline.reset(); - + if(angular.isDefined(report)){ rep.reportType = report.reportType; + rep.layerConfiguration = JSON.parse(report.mapLayerConfig ? report.mapLayerConfig : '{}'); + rep.mapZoom = report.mapZoom; + rep.mapCenter = report.mapCenter; } rep.hasAlert = false; $modalStack.dismissAll(); if (angular.isDefined(rep.autoRefreshInterval)){ rep.stopAutoRefreshInterval(); } - + rep.isReportExecuting = true; var prevRepId, prevRepEditable; if (angular.isDefined(reportFormService.liveView.currentReport)){ prevRepId = reportFormService.liveView.currentReport.id; prevRepEditable = reportFormService.liveView.editable; } - + if (!angular.isDefined(report) && !angular.isDefined(reportFormService.liveView.currentReport)){ prevRepId = rep.id; prevRepEditable = reportFormService.liveView.editable; } - + reportFormService.resetLiveView(); - + var editable = false; if (angular.isDefined(report)){ if (angular.isDefined(report.editable)){ editable = report.editable; - } - + } + if (angular.isDefined(prevRepId) && prevRepId === report.id && !angular.isDefined(report.editable)){ editable = prevRepEditable; } @@ -130,15 +146,15 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp //here we are always refreshing a report editable = prevRepEditable; } - + reportFormService.liveView.editable = editable; - + rep.runInterval = $interval(function(){ var mapContainer = angular.element('#map'); if (mapContainer.length > 0){ prepareReportToRun(report); rep.getConfigsTime = moment.utc().format('YYYY-MM-DDTHH:mm:ss'); - + if ((report && report.withMap) || rep.isReportRefreshing){ tripSummaryService.withMap = true; spatialRestService.getConfigsForReport(rep.id, rep.getConfigsTime).then(getConfigSuccess, getConfigError); @@ -156,12 +172,12 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp } loadingStatus.isLoading('InitialReporting', false); } - + rep.stopRunInterval(); } }, 10); }; - + rep.runReportWithoutSaving = function(report, preserveMapState){ if (angular.isDefined(preserveMapState) && preserveMapState === true){ setStateProperties(); @@ -176,7 +192,12 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp rep.stopAutoRefreshInterval(); } rep.isReportExecuting = true; - rep.mergedReport = angular.copy(report); + if (angular.isDefined(report)) { + rep.layerConfiguration = JSON.parse(report.mapLayerConfig ? report.mapLayerConfig : '{}'); + rep.mapZoom = report.mapZoom; + rep.mapCenter = report.mapCenter; + } + rep.mergedReport = angular.copy(report); if(rep.mergedReport.withMap && rep.mergedReport.reportType === 'standard'){ spatialConfigRestService.getUserConfigs().then(getUserConfigsSuccess, getUserConfigsFailure); reportingNavigatorService.goToView('liveViewPanel','mapPanel'); @@ -184,10 +205,10 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp }else{ if(rep.reportType === 'summary'){ prepareReportToRun(rep.mergedReport); - + rep.getReportTime = moment.utc().format('YYYY-MM-DDTHH:mm:ss'); rep.mergedReport.additionalProperties = getUnitSettings(); - + reportRestService.executeWithoutSaving(rep.mergedReport).then(getVmsDataSuccess, getVmsDataError); tripSummaryService.trip = undefined; rep.hideCatchDetails = true; @@ -199,11 +220,11 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp loadingStatus.isLoading('InitialReporting', false); } }; - + rep.clearMapOverlays = function(){ //Check for measuring overlays rep.untoggleToolbarBtns(); - + //Deactivate labels if (mapService .vmsposLabels.active === true){ mapService.deactivateVectorLabels('vmspos'); @@ -211,8 +232,9 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp if (mapService.vmssegLabels.active === true){ mapService.deactivateVectorLabels('vmsseg'); } + mapService.resetLabelContainers(); - + //Deactivate popups if (mapService.popupRecContainer.records.length > 0){ mapService.closePopup(); @@ -230,8 +252,13 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp }; mapStateService.toStorage(state); }; - + rep.refreshReport = function(){ + if (angular.isDefined(reportFormService.liveView.currentReport) && reportFormService.liveView.currentReport !== null) { + rep.layerConfiguration = JSON.parse(reportFormService.liveView.currentReport.mapLayerConfig ? reportFormService.liveView.currentReport.mapLayerConfig : '{}'); + rep.mapZoom = reportFormService.liveView.currentReport.mapZoom; + rep.mapCenter = reportFormService.liveView.currentReport.mapCenter; + } if (angular.isDefined(rep.id)){ setStateProperties(); rep.clearMapOverlays(); @@ -248,19 +275,19 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp $interval.cancel(rep.autoRefreshInterval); rep.autoRefreshInterval = undefined; }; - + rep.setAutoRefresh = function() { if (angular.isDefined(rep.autoRefreshInterval)){ rep.stopAutoRefreshInterval(); } - + rep.autoRefreshInterval = $interval(function() { if (rep.isReportExecuting === false && rep.refresh.status === true && reportingNavigatorService.isViewVisible('mapPanel')) { rep.refreshReport(); } }, rep.refresh.rate*60*1000); //timeout in minutes }; - + rep.getAlarms = function(){ loadingStatus.isLoading('LiveviewMap',true,1); var payload = mapAlarmsService.prepareDataForRequest(); @@ -273,7 +300,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp loadingStatus.isLoading('LiveviewMap', false); } }; - + var getUnitSettings = function(){ return { speedUnit: unitConversionService.speed.getUnit(), @@ -281,7 +308,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp timestamp: rep.getReportTime }; }; - + //Get Spatial config Success callback var getConfigSuccess = function(data){ if(!angular.equals(rep.lastMapConfigs, data)){ @@ -289,10 +316,10 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp configureMap(data); } var repConfig = getRepConfig(); - + reportRestService.executeReport(rep.id,repConfig).then(getVmsDataSuccess, getVmsDataError); }; - + //Get Spatial config Error callback var getConfigError = function(error){ rep.loadReportHistory(); @@ -305,7 +332,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp loadingStatus.isLoading('LiveviewMap', false); mapStateService.clearState(); }; - + var getRepConfig = function(){ var unitSettings = getUnitSettings(); return { @@ -316,12 +343,12 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp } }; }; - + //Get config without map Success callback var getConfigWithoutMapSuccess = function(data){ //Set vms table attribute visibility visibilityService.setVisibility(data.visibilitySettings); - + rep.getReportTime = moment.utc().format('YYYY-MM-DDTHH:mm:ss'); var repConfig = getRepConfig(); reportRestService.executeReport(rep.id,repConfig).then(getVmsDataSuccess, getVmsDataError); @@ -329,7 +356,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp if(rep.reportType === 'summary'){ var elems = angular.element('[ng-controller="VmspanelCtrl"] .modal-body input'); angular.forEach(elems,function(el){ - var elem = $(el); + var elem = $(el); elem.val(''); if(elem.hasClass('hidden-st-control')){ elem.trigger('input'); @@ -337,7 +364,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp }); } }; - + //Get config without map Success callback var getConfigWithoutMapError = function(error){ rep.isReportExecuting = false; @@ -345,7 +372,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp rep.alertType = 'danger'; rep.message = locale.getString('spatial.map_error_loading_report'); }; - + //Get Alarms data Success callback var getAlarmsSuccess = function(response){ if (angular.isDefined(response.data)){ @@ -372,7 +399,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp } loadingStatus.isLoading('LiveviewMap', false); }; - + var getAlarmsError = function(error){ rep.hasAlert = true; rep.alertType = 'danger'; @@ -399,6 +426,22 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp return nodes; }; + rep.getPositions = function () { + return rep.positions; + }; + + function coordsEqual(c1, c2) { + return c1[0] === c2[0] && c1[1] === c2[1]; + } + + function mergeTrips(t1, t2) { + t2.forEach(function(tripId) { + if (t1.indexOf(tripId) < 0) { + t1.push(tripId); + } + }); + } + //Get VMS data Success callback var getVmsDataSuccess = function(data){ rep.positions = data.movements.features; @@ -408,6 +451,39 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp rep.activities = data.activities.features; rep.criteria = data.criteria; + //add tripIds to positions + var tripsMap = data.trips.reduce(function(acc, trip) { + var key = trip.CFR + '|' + trip.EXT_MARK + '|' + trip.IRCS + '|' + trip.flagState; + acc[key] = (acc[key] || []); + acc[key].push(trip); + return acc; + }, {}); + var emptyArray = []; + rep.positions.forEach(function(pos) { + var p = pos.properties; + var key = p.cfr + '|' + p.externalMarking + '|' + p.ircs + '|' + p.countryCode; + var pTime = moment(pos.properties.positionTime); + pos.tripIds = (tripsMap[key] || emptyArray).reduce(function(acc, trip) { + if (pTime.isBetween(trip.firstFishingActivityDateTime, trip.lastFishingActivityDateTime)) { + acc.push(trip.tripId); + } + return acc; + }, []); + }); + + //add tripIds to segments + rep.segments.forEach(function(seg) { + seg.tripIds = []; + rep.positions.forEach(function(pos) { + seg.geometry.coordinates.forEach(function(c, index) { + if (coordsEqual(c, pos.geometry.coordinates)) { + mergeTrips(seg.tripIds, pos.tripIds); + if(index === 1) { + seg.properties.positionTime = pos.properties.positionTime; + seg.properties.connectionId = pos.properties.connectionId; + } + }})})}); + if(rep.reportType === 'standard'){ rep.loadReportHistory(); @@ -416,15 +492,37 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp if (mapService.styles.positions.attribute === 'countryCode'){ mapService.setDisplayedFlagStateCodes('positions', rep.positions); } - + if (mapService.styles.segments.attribute === 'countryCode'){ mapService.setDisplayedFlagStateCodes('segments', rep.segments); } - + //Add nodes to the tree and layers to the map if (rep.positions.length > 0 || rep.segments.length > 0 || rep.activities.length > 0){ var vectorNodeSource = new TreeModel(); - vectorNodeSource = vectorNodeSource.nodeFromData(data); + + vectorNodeSource = vectorNodeSource.nodeFromData(data, rep.layerConfiguration); + + angular.forEach(vectorNodeSource, function(VNSChild) { + var selected = false; + + angular.forEach(VNSChild.children, function(child){ + if (child.selected === true) { + selected = true; + } + if (!child.data && child.type === 'ers-type') { + rep.pushLayerConfig(child.filterType, child.selected); + } else { + rep.pushLayerConfig(child.data.type, child.selected); + if (child.children) { + angular.forEach(child.children, function(child2){ + rep.pushLayerConfig(child2.type, child.selected); + }); + } + } + }); + rep.pushLayerConfig(VNSChild.data ? VNSChild.data.type : VNSChild.type, selected); + }); var previousLayerState = mapStateService.fromStorage(); if (angular.isDefined(previousLayerState) && previousLayerState.repId === rep.id){ @@ -442,11 +540,14 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp } }); } - + layerPanelService.addLayerTreeNode(vectorNodeSource); - + if (reportingNavigatorService.isViewVisible('mapPanel') && angular.isUndefined(previousLayerState)){ - mapService.zoomToPositionsLayer(); + if (angular.isDefined(rep.mapZoom) && rep.mapZoom === null) { + mapService.zoomToPositionsLayer(); + } + } } else if (rep.positions.length === 0 && rep.segments.length === 0){ rep.hasAlert = true; @@ -461,27 +562,28 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp mapStateService.clearState(); }else{ - if(!angular.isDefined(rep.criteria.recordDTOs) || rep.criteria.recordDTOs.length === 0){ + if(!angular.isDefined(rep.criteria.recordDTOs) || rep.criteria.recordDTOs.length === 0){ rep.hasAlert = true; rep.alertType = 'warning'; rep.hideCatchDetails = false; rep.message = locale.getString('spatial.report_no_ers_data'); - }else{ + }else{ tripSummaryService.trip = undefined; rep.hideCatchDetails = true; - reportingNavigatorService.goToView('liveViewPanel','catchDetails'); + reportingNavigatorService.goToView('liveViewPanel','catchDetails'); } } - + loadingStatus.isLoading('LiveviewMap', false); rep.isReportExecuting = false; rep.isReportRefreshing = false; }; - + //Get VMS data Failure callback var getVmsDataError = function(error){ rep.loadReportHistory(); rep.positions = []; + rep.activities = []; rep.segments = []; rep.tracks = []; rep.isReportExecuting = false; @@ -493,18 +595,19 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp loadingStatus.isLoading('LiveviewMap', false); mapStateService.clearState(); }; - + //Refresh report success callback var updateVmsDataSuccess = function(data){ layerPanelService.removeVmsNodes(); rep.positions = data.movements.features; rep.segments = data.segments.features; rep.tracks = data.tracks; + rep.activities = data.activities.features; //TODO activities - + //Remove existing vms vector layers from the map mapService.clearVectorLayers(); - + //Add nodes to the tree and layers to the map if (rep.positions.length > 0 || rep.segments.length > 0){ var vectorNodeSource = new TreeModel(); @@ -517,7 +620,7 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp } rep.isReportExecuting = false; }; - + //Refresh report failure callback var updateVmsDataError = function(error){ rep.isReportExecuting = false; @@ -525,40 +628,41 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp rep.alertType = 'danger'; rep.message = locale.getString('spatial.map_error_loading_report'); }; - + var prepareReportToRun = function(report){ rep.id = rep.isReportRefreshing ? rep.id : report.id; rep.name = rep.isReportRefreshing ? rep.name : report.name; rep.positions = []; rep.segments = []; rep.tracks = []; + rep.activities = []; //TODO activities - + mapService.resetLabelContainers(); - + //This gets executed on initial loading when we have a default report if (!angular.isDefined(mapService.map) && report.withMap && report.reportType === 'standard'){ mapService.setMap(defaultMapConfigs); } else if (angular.isDefined(mapService.map)) { mapService.clearVectorLayers(); - + //Reset history control var history = mapService.getControlsByType('HistoryControl')[0]; if (angular.isDefined(history)){ history.resetHistory(); } - + //Close overlays if (angular.isDefined(mapService.overlay)){ mapService.closePopup(); } - + if (mapService.vmsposLabels.active === true){ mapService.deactivateVectorLabels('vmspos'); } - + if (mapService.vmssegLabels.active === true){ - mapService.deactivateVectorLabels('vmsseg'); + mapService.deactivateVectorLabels('vmsseg'); } } }; @@ -602,43 +706,81 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp this.push(nodeCfgFromServer); }, newTreeSource); + if (angular.isDefined(oldTreeSource) && oldTreeSource.length === 0) { + newTreeSource = treeSourceFromCfg; + } + return newTreeSource; }; - + var configureMap = function(data){ //Change map ol.View configuration if (mapService.getMapProjectionCode() !== 'EPSG:' + data.map.projection.epsgCode){ mapService.updateMapView(data.map.projection); } - + + if (angular.isDefined(rep.mapCenter) && rep.mapCenter !== null) { + rep.mapCenter = rep.mapCenter.replace('[',''); + rep.mapCenter = rep.mapCenter.replace(']',''); + + var centerArray = []; + if (angular.isDefined(centerArray)) { + centerArray.push(parseFloat(rep.mapCenter.split(',')[0])); + centerArray.push(parseFloat(rep.mapCenter.split(',')[1])); + mapService.map.getView().setCenter(centerArray); + } + } + + if (angular.isDefined(rep.mapZoom) && rep.mapZoom !== null) { + mapService.map.getView().setZoom(rep.mapZoom); + } + //Set map controls mapService.updateMapControls(data.map.control); - + //Set toolbar controls spatialHelperService.setToolbarControls(data); - + //Set the styles for vector layers and legend - mapService.setPositionStylesObj(data.vectorStyles.positions); + mapService.setPositionStylesObj(data.vectorStyles.positions); mapService.setSegmentStylesObj(data.vectorStyles.segments); mapService.setAlarmsStylesObj(data.vectorStyles.alarms); - + // mapService.setActivityStylesObj(data.vectorStyles.activities); Uncomment when activity settings are added in spatial + //Set vms table attribute visibility visibilityService.setVisibility(data.visibilitySettings); - + //Set popup visibility settings mapService.setPopupVisibility('positions', data.visibilitySettings.positions.popup); mapService.setPopupVisibility('segments', data.visibilitySettings.segments.popup); //mapService.setPopupVisibility('activities', data.visibilitySettings.activities.popup); FIXME - + //Set label visibility mapService.setLabelVisibility('positions', data.visibilitySettings.positions.labels); mapService.setLabelVisibility('segments', data.visibilitySettings.segments.labels); //mapService.setLabelVisibility('activities', data.visibilitySettings.activities.labels); FIXME - + //Build tree object and update layer panel var treeSource = new TreeModel(); - treeSource = treeSource.fromConfig(data.map.layers); + treeSource = treeSource.fromConfig(data.map.layers, rep.layerConfiguration); + + angular.forEach(treeSource, function(ts) { + var selected = false; + angular.forEach(ts.children, function(ch) { + var type = ch.data.type === 'WMS' ? ch.data.typeName : ch.data.type; + if (ch.children) { + angular.forEach(ch.children, function(dc) { + rep.pushLayerConfig(type, dc.selected ? dc.selected : false); + }); + } + if (ch.selected) { + selected = true; + } + rep.pushLayerConfig(type, ch.selected ? ch.selected : false); + }); + rep.pushLayerConfig(ts.data.type, selected); + }); //Maintain the map state if map is being refreshed var previousLayerState = mapStateService.fromStorage(); @@ -649,31 +791,31 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp $timeout(function() { layerPanelService.updateLayerTreeSource(treeSource); }); - + //map refresh configs if (reportingNavigatorService.isViewVisible('mapPanel') && angular.isDefined(data.map.refresh)){ if(rep.isReportRefreshing === false){ rep.refresh.status = data.map.refresh.status; } - rep.refresh.rate = data.map.refresh.rate; + rep.refresh.rate = data.map.refresh.rate; } - + mapService.updateMapSize(); - + rep.getReportTime = moment.utc().format('YYYY-MM-DDTHH:mm:ss'); }; - + var getUserConfigsSuccess = function(response){ rep.lastMapConfigs = response; - + var model = new SpatialConfig(); var userConfig = model.forUserPrefFromJson(response); - + mergeSettings(userConfig); spatialConfigRestService.getMapConfigsFromReport(getMapConfigs(userConfig)).then(getMapConfigsFromReportSuccess, getMapConfigsFromReportFailure); }; - + var getUserConfigsFailure = function(error){ $anchorScroll(); rep.hasAlert = true; @@ -683,28 +825,28 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp rep.isReportExecuting = false; loadingStatus.isLoading('LiveviewMap', false); }; - + var mergeSettings = function(userConfig){ - if(!angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.mapProjectionId) && - !angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.displayProjectionId) && !angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.coordinatesFormat) && + if(!angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.mapProjectionId) && + !angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.displayProjectionId) && !angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.coordinatesFormat) && !angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.scaleBarUnits)){ - + rep.mergedReport.currentMapConfig.mapConfiguration.spatialConnectId = userConfig.mapSettings.spatialConnectId; rep.mergedReport.currentMapConfig.mapConfiguration.mapProjectionId = userConfig.mapSettings.mapProjectionId; rep.mergedReport.currentMapConfig.mapConfiguration.displayProjectionId = userConfig.mapSettings.displayProjectionId; rep.mergedReport.currentMapConfig.mapConfiguration.coordinatesFormat = userConfig.mapSettings.coordinatesFormat; rep.mergedReport.currentMapConfig.mapConfiguration.scaleBarUnits = userConfig.mapSettings.scaleBarUnits; } - + if(!angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.stylesSettings)){ rep.mergedReport.currentMapConfig.mapConfiguration.stylesSettings = userConfig.stylesSettings; } - + if(!angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.layerSettings)){ rep.mergedReport.currentMapConfig.mapConfiguration.layerSettings = userConfig.layerSettings; } rep.mergedReport.currentMapConfig.mapConfiguration.layerSettings = reportFormService.checkLayerSettings(rep.mergedReport.currentMapConfig.mapConfiguration.layerSettings); - + if(!angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.visibilitySettings)){ rep.mergedReport.currentMapConfig.mapConfiguration.visibilitySettings = userConfig.visibilitySettings; } @@ -712,9 +854,9 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp if(!angular.isDefined(rep.mergedReport.currentMapConfig.mapConfiguration.referenceDataSettings)){ rep.mergedReport.currentMapConfig.mapConfiguration.referenceDataSettings = userConfig.referenceDataSettings; } - + }; - + var getMapConfigs = function(userConfig){ return { toolSettings: { @@ -762,17 +904,20 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp } }; }; - + var getMapConfigsFromReportSuccess = function(data){ + rep.mergedReport.layerConfiguration = rep.layerConfiguration; + rep.mergedReport.mapZoom = rep.mapZoom; + rep.mergedReport.mapCenter = rep.mapCenter; prepareReportToRun(rep.mergedReport); configureMap(data[0]); - + rep.getReportTime = moment.utc().format('YYYY-MM-DDTHH:mm:ss'); rep.mergedReport.additionalProperties = getUnitSettings(); - + reportRestService.executeWithoutSaving(rep.mergedReport).then(getVmsDataSuccess, getVmsDataError); }; - + var getMapConfigsFromReportFailure = function(error){ rep.loadReportHistory(); $anchorScroll(); @@ -826,10 +971,10 @@ angular.module('unionvmsWeb').factory('reportService',function($rootScope, $comp rep.reportsHistory.push(sectionShared); } }; - + $rootScope.$on('$stateChangeStart', function() { rep.hasAlert = false; }); return rep; -}); \ No newline at end of file +}); diff --git a/unionvms-web/app/service/spatial/mapFishModel.js b/unionvms-web/app/service/spatial/mapFishModel.js index 1d80a4118..7ca8f3989 100644 --- a/unionvms-web/app/service/spatial/mapFishModel.js +++ b/unionvms-web/app/service/spatial/mapFishModel.js @@ -1,1081 +1,1262 @@ -/* -Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries -© European Union, 2015-2016. - -This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can -redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in -the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a -copy of the GNU General Public License along with the IFDM Suite. If not, see . -*/ -angular.module('unionvmsWeb').factory('MapFish',function() { - - var model = { - - isDeployed : false, - - jobStatusData : { - done : true, - status : undefined, - elapsedTime: undefined, - waitingTime: undefined, - downloadURL: undefined - }, - - templateData : undefined, - capabilitiesData : undefined, - - templates: [], - selected_template : undefined, - - formats : [], - selected_format : undefined, - - layouts : [], - selected_layout : undefined, - - suggestedDpi : [], - selected_dpi : undefined, - - layoutAttributes : [], - - printJobData : { - ref: undefined, - statusURL: undefined, - downloadURL: undefined - }, - - includeCoordGrid: true, - projectionId: undefined, - includeLongCopyright: false, - - printMapSize: [], - - reset: function(){ - model.templates = []; - model.layouts = []; - model.formats = []; - model.layoutAttributes = []; - model.suggestedDpi = []; - model.selected_format = undefined; - model.selected_layout = undefined; - model.selected_dpi = undefined; - model.printMapSize = []; - }, - - resetOnLayoutChange: function(){ - model.layoutAttributes = []; - model.suggestedDpi = []; - model.selected_dpi = undefined; - model.printMapSize = []; - }, - - initTemplateCmbx : function(templates){ - model.templateData = templates; - for (var i = 0; i < templates.length; i++) { - model.templates.push({"text": model.templateData[i], "code": model.templateData[i]}); - } - model.selected_template = model.templates[0].code; - }, - - initLayoutCmbx : function(capabilities){ - model.capabilitiesData = capabilities; - for (var l = 0; l < model.capabilitiesData.layouts.length; l++) { - var layout = model.capabilitiesData.layouts[l]; - model.layouts.push({"text": layout.name, "code": layout.name }); - } - model.selected_layout = model.layouts[0].code; - }, - - initFormatsCmbx : function(capabilities){ - model.capabilitiesData = capabilities; - for (var f = 0; f < model.capabilitiesData.formats.length; f++) { - if (model.capabilitiesData.formats[f] !== 'bmp'){ - model.formats.push({"text": model.capabilitiesData.formats[f], "code": model.capabilitiesData.formats[f]}); - } - } - model.selected_format = model.formats[0].code; - }, - - initLayoutAttributes : function(capabilities, _layout){ - model.layoutAttributes = []; - capabilities.layouts.filter( - function(layout){ - if (layout.name === _layout){ - layout.attributes.filter(function(attribute){ - if (attribute.type === 'String' && ((attribute.default !== undefined && attribute.default.length < 1) || attribute.default === undefined)){ - model.layoutAttributes.push(attribute); - } - else if (attribute.type === 'MapAttributeValues'){ - model.suggestedDpi = []; - for (var d = 0; d < attribute.clientInfo.dpiSuggestions.length; d++){ - var dpiValue = attribute.clientInfo.dpiSuggestions[d]; - model.suggestedDpi.push({"text": dpiValue, "code": dpiValue}); - model.selected_dpi = model.suggestedDpi[0].code; - } - model.printMapSize = [attribute.clientInfo.width, attribute.clientInfo.height]; - } - }); - } - } - ); - } - }; - - return model; - -}) -.factory('MapFishPayload',function(locale, $location, Color, MapFish, mapService, mapFishPrintRestService, unitConversionService, projectionService, coordinateFormatService){ - function mapFishPayload(){ - this.layout = undefined; - this.attributes = {}; - } - - mapFishPayload.prototype.createPayloadObj = function(data, iconLeg){ - this.layout = MapFish.selected_layout; - this.attributes = buildAttributes(data, iconLeg); - }; - - - mapFishPayload.prototype.getIconPayload = function(type){ - var forbidenKeys = ['lineStyle', 'default', 'lineWidth']; - var styles = mapService.styles[type]; - - if (angular.isDefined(styles)){ - var obj, i, keys; - var classes = []; - if (type === 'alarms'){ - obj = { - title: locale.getString('spatial.styles_attr_status') - }; - - keys = _.keys(styles); - for (i = 0; i < keys.length; i++){ - if (keys[i] !== 'size'){ - classes.push({ - text: locale.getString('spatial.legend_panel_alarms_' + keys[i]), - color: styles[keys[i]] - }); - } - } - } else { - obj = { - title: getSubtitle(styles) - }; - - if (type === 'segments'){ - switch (styles.style.lineStyle) { - case 'dotted': - obj.lineStyle = '1,1'; - break; - case 'dashed': - obj.lineStyle = '5,5'; - break; - case 'dotdashed': - obj.lineStyle = '5,2,1,2'; - break; - default: - obj.lineStyle = '0,0'; - break; - } - } else { - obj.cluster = { - text: locale.getString('spatial.print_cluster_legend_title'), - bgcolor: '#FFFFFF', - bordercolor: '#F7580D' - }; - } - - switch (styles.attribute) { - case 'countryCode': - for (i = 0; i < styles.displayedCodes.length; i++){ - classes.push({ - text: styles.displayedCodes[i], - color: styles.style[styles.displayedCodes[i]] - }); - } - break; - case 'activity': //Positions - case 'type': - case 'segmentCategory': //Segments - keys = _.keys(styles.style); - for (i = 0; i < keys.length; i++){ - if (_.indexOf(forbidenKeys, keys[i]) === -1){ - classes.push({ - text: keys[i], - color: styles.style[keys[i]] - }); - } - } - - //Finally add the default rule - classes.push({ - text: locale.getString('spatial.legend_panel_all_other_values'), - color: styles.style.default - }); - - break; - case 'reportedCourse': //Positions - case 'calculatedSpeed': - case 'reportedSpeed': - case 'speedOverGround': //Segments - case 'distance': - case 'courseOverGround': - for (i = 0; i < styles.breaks.intervals.length; i++){ - classes.push({ - text: styles.breaks.intervals[i][0] + ' - ' + styles.breaks.intervals[i][1], - color: styles.style[styles.breaks.intervals[i][0] + '-' + styles.breaks.intervals[i][1]] - }); - } - - //Finally add the default rule - classes.push({ - text: locale.getString('spatial.legend_panel_all_other_values'), - color: styles.style.default - }); - - break; - } - } - - obj.classes = classes; - return obj; - } - }; - - var getSubtitle = function(srcDef){ - var withSpeed = ['reportedSpeed', 'calculatedSpeed', 'speedOverGround']; - var withCourse = ['reportedCourse', 'courseOverGround']; - - var subTitle = locale.getString('spatial.styles_attr_' + srcDef.attribute); - if (_.indexOf(withSpeed, srcDef.attribute) !== -1){ - var srcUnit = unitConversionService.speed.getUnit(); - subTitle += ' (' + locale.getString('common.speed_unit_' + srcUnit) + ')'; - } - - if (_.indexOf(withCourse, srcDef.attribute) !== -1){ - subTitle += ' (' + String.fromCharCode(parseInt('00B0', 16)) + ')'; - } - - if (srcDef.attribute === 'distance'){ - subTitle += ' (' + unitConversionService.distance.getUnit() + ')'; - } - - return subTitle; - }; - - var buildAttributes = function(data, iconLeg){ - var attr = {}; - - //Setting attributes defined through the printing widget like title, description, etc - angular.forEach(data, function(value, key) { - attr[key] = value; - }, attr); - - var spatialAttr = buildMapAndLegendAttributes(iconLeg); - attr.map = spatialAttr.map; - attr.legend = spatialAttr.legend; - attr.datasource = []; - - attr.copyrightTitle = locale.getString('spatial.print_copyright_title').toUpperCase(); - attr.legendTitle = locale.getString('spatial.print_legend_title').toUpperCase(); - - if (spatialAttr.copyright.length > 0){ - attr.datasource.push({ - displayName: '', - table: { - columns: ['layer', 'copyright'], - data: spatialAttr.copyright - } - }); - } - - return attr; - }; - - var buildMapAndLegendAttributes = function(iconLeg){ - var map = {}; - var legend = { - name: '', - classes: [] - }; - - var layerSrc = mapService.getLayerByType('print').getSource(); - - map.projection = mapService.getMapProjectionCode(); - map.bbox = layerSrc.getExtent(); - map.dpi = MapFish.selected_dpi; - map.rotation = 0; - - var configs = getLayersAndLegendConfigsArray(iconLeg); - map.layers = configs.layers; - legend.classes = configs.legend; - - var finalObj = { - map: map, - legend: legend, - copyright: configs.copyright - }; - - return finalObj; - }; - - var getUrl = function(){ - var url = $location.protocol() + '://' + $location.host(); - if ($location.port() !== 80){ - url += ':' + $location.port(); - } - - return url; - }; - - var legendFuncs = { - buildWMS: function(layer){ - var src = layer.getSource(); - var params = src.getParams(); - var url = src.getUrls()[0] + '?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=25&HEIGHT=25&LAYER='; - url += params.LAYERS; - - if (angular.isDefined(params.STYLES) && params.STYLES !== ''){ - url += '&STYLE='; - url += params.STYLES; - } - - var name = layer.get('title'); - - return { - name: name.charAt(0).toUpperCase() + name.slice(1), - icons: [url] - }; - }, - buildVMSPOS: function(layer, iconLeg){ - return this.buildVectorLegend(layer, iconLeg, 'vmspos'); - }, - buildVMSSEG: function(layer, iconLeg){ - return this.buildVectorLegend(layer, iconLeg, 'vmsseg'); - }, - buildALARMS: function(layer, iconLeg){ - return this.buildVectorLegend(layer, iconLeg, 'alarms'); - }, - buildVectorLegend: function(layer, iconLeg, type){ - var url = getUrl(); - url += iconLeg.legend.base; - - switch (type) { - case 'vmspos': - url += iconLeg.legend.positions; - break; - case 'vmsseg': - url += iconLeg.legend.segments; - break; - case 'alarms': - url += iconLeg.legend.alarms; - break; - default: - break; - } - - var name = layer.get('title'); - - return { - name: name.charAt(0).toUpperCase() + name.slice(1), - icons: [url] - }; - } - }; - - var styleFuncs = { - buildVMSPOSCluster: function(features){ - var style = { - version: 2, - strokeColor: '#F7580D', - strokeWidth: 2, - fillColor: '#ffffff', - fillOpacity: 0.3, - fontWeight: 'BOLD', - fontColor: '#000000', - fontSize: 8, - fontFamily: 'Arial', - labelAlign: 'cm', - labelXOffset: -1, - labelYOffset: -1 - }; - - var name; - angular.forEach(features, function(feature) { - var radius = feature.get('radius'); - - name = "["; - name +="radius = " + feature.get('radius'); - name += "]"; - - style[name] = { - symbolizers: [{ - type: 'point', - pointRadius: radius - },{ - type: 'text', - label: '[printLabel]' - }] - }; - }); - - return style; - }, - buildVMSPOS: function(features, iconLeg){ - var styleDef = mapService.styles.positions; - - var style = { - version: 2, - graphicWidth: 18, - graphicOpacity : 1.0, - graphicFormat : 'image/png', - type: 'point' - }; - - this.buildVectorStyle(style, styleDef, 'vmspos', iconLeg); - - return style; - }, - buildALARMS: function(layer){ - var styleDef = mapService.styles.alarms; - - var style = { - version: 2, - strokeColor: '#FFFFFF', - strokeWidth: 2, - pointRadius: styleDef.size * 2, - type: 'point', - }; - - this.buildAlarmsStyle(style, styleDef, 'alarms'); - - return style; - }, - buildVMSSEG: function(layer){ - var styleDef = mapService.styles.segments; - - var style = { - version: 2, - strokeWidth: angular.isDefined(styleDef.style.lineWidth) ? parseInt(styleDef.style.lineWidth) : 2, - strokeDashstyle: 'solid', - strokeLinecap: 'round', - type: 'line' - }; - - var interval, dot; - if (angular.isDefined(styleDef.style.lineStyle)){ - switch (styleDef.style.lineStyle) { - case 'dotted': - dot = (style.strokeWidth + 1).toString(); - interval = style.strokeWidth.toString(); - style.strokeDashstyle = dot + ' ' + interval; - break; - case 'dashed': - style.strokeDashstyle = 'longdash'; - break; - case 'dotdashed': - var dash = (4 * style.strokeWidth).toString(); - dot = (style.strokeWidth + 1).toString(); - interval = (2 * style.strokeWidth).toString(); - style.strokeDashstyle = dash + ' ' + interval + ' ' + dot + ' ' + interval; - break; - default: - style.strokeDashstyle = 'solid'; - break; - } - } - - this.buildVectorStyle(style, styleDef, 'vmsseg'); - - - return style; - }, - buildAlarmsStyle: function(style, styleDef){ - var keys = _.keys(styleDef); - - for (var i = 0; i < keys.length; i++){ - if (keys[i] !== 'size'){ - var name = "[ticketStatus = '" + keys[i].toUpperCase() + "']"; - style[name] = { - symbolizers: [{ - fillColor: styleDef[keys[i]], - fillOpacity: 1.0, - }] - }; - } - } - - }, - buildVectorStyle: function(style, styleDef, type, iconLeg){ - var keys = _.keys(styleDef.style); - - var url; - if (type === 'vmspos'){ - url = getUrl(); - url += iconLeg.map.vmspos.base; - } - - var i, name, defaultName, color, tempName; - switch (styleDef.attribute) { - case 'activity': //Positions - case 'type': - case 'segmentCategory': //Segments - var forbidenKeys = ['lineStyle', 'default', 'lineWidth']; - for (i = 0; i < keys.length; i++){ - tempName = styleDef.attribute; - if (styleDef.attribute === 'activity'){ - tempName = 'activityType'; - } else if (styleDef.attribute === 'type'){ - tempName = 'movementType'; - } - - if (_.indexOf(forbidenKeys, keys[i]) === -1){ - name = "["; - name += tempName + " = '" + keys[i]; - name += "']"; - - if (type === 'vmsseg'){ - style[name] = { - symbolizers: [{ - strokeWidth: style.strokeWidth + 3, - strokeColor: '#ffffff' - },{ - strokeColor: styleDef.style[keys[i]] - }] - }; - } else { - color = styleDef.style[keys[i]].slice(1); - if (_.indexOf(iconLeg.map.vmspos.colors, color) !== -1){ - style[name] = { - symbolizers: [{ - rotation: '[reportedCourse]', - externalGraphic: url + color - }] - }; - } - } - - } - } - //Finally we build the defaults rule - defaultName = "["; - defaultName += tempName + " not in ('"; - defaultName += keys.join("','"); - defaultName += "')]"; - - if (type === 'vmsseg'){ - style[defaultName] = { - symbolizers: [{ - strokeWidth: style.strokeWidth + 3, - strokeColor: '#ffffff' - },{ - strokeColor: styleDef.style.default - }] - }; - } else { - color = styleDef.style.default.slice(1); - style[defaultName] = { - symbolizers: [{ - rotation: '[reportedCourse]', - externalGraphic: url + color - }] - }; - } - - break; - case 'countryCode': - for (i = 0; i < keys.length; i++){ - if (styleDef.displayedCodes.indexOf(keys[i]) !== -1){ - name = "["; - name += styleDef.attribute + " = '" + keys[i]; - name += "']"; - if (type === 'vmsseg'){ - style[name] = { - symbolizers: [{ - strokeWidth: style.strokeWidth + 3, - strokeColor: '#ffffff' - },{ - strokeColor: styleDef.style[keys[i]] - }] - }; - } else { - color = styleDef.style[keys[i]].slice(1); - if (_.indexOf(iconLeg.map.vmspos.colors, color) !== -1){ - style[name] = { - symbolizers: [{ - rotation: '[reportedCourse]', - externalGraphic: url + color - }] - }; - } - } - } - } - break; - case 'reportedCourse': //Positions - case 'calculatedSpeed': - case 'reportedSpeed': - case 'speedOverGround': //Segments - case 'distance': - case 'courseOverGround': - var min, max; - for (i = 0; i < styleDef.breaks.intervals.length; i++){ - name = "["; - name += styleDef.attribute + " >= " + styleDef.breaks.intervals[i][0]; - name += " and "; - name += styleDef.attribute + " < " + styleDef.breaks.intervals[i][1]; - name += "]"; - - if (type === 'vmsseg'){ - style[name] = { - symbolizers: [{ - strokeWidth: style.strokeWidth + 3, - strokeColor: '#ffffff' - },{ - strokeColor: styleDef.style[styleDef.breaks.intervals[i][0] + '-' + styleDef.breaks.intervals[i][1]] - }] - }; - } else { - color = styleDef.style[styleDef.breaks.intervals[i][0] + '-' + styleDef.breaks.intervals[i][1]].slice(1); - if (_.indexOf(iconLeg.map.vmspos.colors, color) !== -1){ - style[name] = { - symbolizers: [{ - rotation: '[reportedCourse]', - externalGraphic: url + color - }] - }; - } - } - - - if (i === 0){ - min = styleDef.breaks.intervals[i][0]; - max = styleDef.breaks.intervals[i][1]; - } else { - min = Math.min(min, styleDef.breaks.intervals[i][0]); - max = Math.max(max, styleDef.breaks.intervals[i][1]); - } - } - //Finally we build the defaults rule - defaultName = "["; - defaultName += styleDef.attribute + " < " + min; - defaultName += " or "; - defaultName += styleDef.attribute + " >= " + max; - defaultName += "]"; - - if (type === 'vmsseg'){ - style[defaultName] = { - symbolizers: [{ - strokeWidth: style.strokeWidth + 3, - strokeColor: '#ffffff' - },{ - strokeColor: styleDef.breaks.defaultColor - }] - }; - } else { - color = styleDef.style.default.slice(1); - style[defaultName] = { - symbolizers: [{ - rotation: '[reportedCourse]', - externalGraphic: url + color - }] - }; - } - break; - } - } - }; - - var rgbToHex = function(colorStr){ - var pattern = /\d+/g; - var rgb = colorStr.match(pattern); - - return '#' + ((1 << 24) | (parseInt(rgb[0], 10) << 16) | (parseInt(rgb[1], 10) << 8) | parseInt(rgb[2], 10)).toString(16).substr(1); - }; - - var layerFuncs = { - buildOSEA: function(layer){ - return this.buildOSM(layer); - }, - buildOSM: function(layer){ - var prop = layer.getProperties(); - - var url; - if (prop.type === 'OSM'){ - url = 'http://tile.openstreetmap.org'; - } else { - url = 'http://tiles.openseamap.org/seamark'; - } - - var obj = { - baseURL: url, - type: 'OSM', - resolutions: [156543.03390625, 78271.516953125, 39135.7584765625, 19567.87923828125, 9783.939619140625, 4891.9698095703125, 2445.9849047851562, 1222.9924523925781, 611.4962261962891, 305.74811309814453, 152.87405654907226, 76.43702827453613, 38.218514137268066, 19.109257068634033, 9.554628534317017, 4.777314267158508, 2.388657133579254, 1.194328566789627, 0.5971642833948135], - opacity: prop.opacity, - maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34], - tileSize: [256, 256], - imageExtension: 'png' - }; - - return obj; - }, - buildWMS: function(layer){ - var prop = layer.getProperties(); - var src = layer.getSource(); - var params = src.getParams(); - - var obj = { - baseURL: src.getUrls()[0], - customParams: { - EXCEPTIONS: 'INIMAGE', - TRANSPARENT: true, - CQL_FILTER: angular.isDefined(params.cql_filter) && params.cql_filter !== null ? params.cql_filter : undefined - }, - layers: [params.LAYERS], - opacity: prop.opacity, - type: 'WMS' - }; - - var server = layer.get('serverType'); - if (angular.isDefined(server)){ - obj.serverType = server; - } - - if (angular.isDefined(params.STYLES) && params.STYLES !== ''){ - obj.styles = [params.STYLES]; - } - - if (angular.isDefined(params.FORMAT) && params.FORMAT !== ''){ - obj.imageFormat = params.FORMAT; - } else { - obj.imageFormat = 'image/png'; - } - - return obj; - }, - buildALARMS: function(layer){ - var obj = { - type: 'geojson', - style: styleFuncs.buildALARMS(layer), - geojson: getGeoJSON(layer) - }; - - return obj; - }, - buildVMSSEG: function(layer){ - var obj = { - type: 'geojson', - style: styleFuncs.buildVMSSEG(layer), - geojson: getGeoJSON(layer) - }; - - if (mapService.vmssegLabels.active){ - var dataFields = []; - var fields = mapService.labelVisibility.segments; - var mappings = mapService.getMappingTitlesProperties('vmsseg'); - var titles = mapService.getSegmentTitles(); - - if (fields.length > 0){ - angular.forEach(fields, function(item) { - var def = { - displayName: titles[item], - propName: mappings[item] - }; - - if (!_.isEqual(def, {})){ - dataFields.push(def); - } - }); - - var labelEl = $('.vector-label-vmsseg').first(); - obj.popupProperties = { - showAttrNames: mapService.labelVisibility.segmentsTitles, - dataFields: dataFields, - popupStyle: { - width: parseInt(labelEl.css('width')), - radius: parseInt(labelEl.css('border-radius')), - border: { - color: rgbToHex(labelEl.css('border-left-color')), - width: parseInt(labelEl.css('border-left-width')) - } - } - }; - } - } - - return obj; - }, - buildVMSPOS: function(layer, iconLeg){ - var format = new ol.format.GeoJSON(); - var printLayerSrc = mapService.getLayerByType('print').getSource(); - var src = layer.getSource(); - var srcStyle = layer.getStyle(); - - var features = src.getFeaturesInExtent(printLayerSrc.getExtent()); - var clusters = []; - var singleFeatures = []; - var tempSizes = {}; - angular.forEach(features, function(clusterFeat) { - var featuresInCluster = clusterFeat.get('features'); - - if (featuresInCluster.length > 1 && clusterFeat.get('featNumber') > 1){ - var clusterToPrint = new ol.Feature({ - geometry: clusterFeat.getGeometry() - }); - - var number = clusterFeat.get('featNumber'); - var radius = clusterFeat.get('radius'); - - if (!angular.isDefined(radius)){ - var featStyle = srcStyle(clusterFeat)[0]; - radius = featStyle.getImage().getRadius(); - } - - clusterToPrint.set('printLabel', clusterFeat.get('featNumber')); - clusterToPrint.set('radius', radius); - - clusters.push(clusterToPrint); - } else { - var feature; - if (featuresInCluster.length === 1){ - feature = featuresInCluster[0].clone(); - } else { - feature = clusterFeat.get('featureToDisplay').clone(); - } - - if (angular.isUndefined(feature.get('reportedCourse'))){ - feature.set('reportedCourse', 0); - } - - if (mapService.vmsposLabels.active){ - if (feature.get('overlayHidden') === false){ - var overCoords = mapService.vmsposLabels[feature.get('overlayId')].overlay.getPosition(); - feature.set('popupX', overCoords[0]); - feature.set('popupY', overCoords[1]); - - var srcCoords = feature.getGeometry().getCoordinates(); - var proj = mapService.getMapProjectionCode(); - if (proj !== 'EPSG:4326'){ - srcCoords = ol.proj.toLonLat(srcCoords, proj); - } - - feature.set('disp_lon', coordinateFormatService.formatAccordingToUserSettings(srcCoords[0])); - feature.set('disp_lat', coordinateFormatService.formatAccordingToUserSettings(srcCoords[1])); - feature.set('positionTime', unitConversionService.date.convertToUserFormat(feature.get('positionTime'))); - feature.set('reportedSpeed', unitConversionService.speed.formatSpeed(feature.get('reportedSpeed'), 5)); - feature.set('calculatedSpeed', unitConversionService.speed.formatSpeed(feature.get('calculatedSpeed'), 5)); - } - } - singleFeatures.push(feature); - } - }); - - var output = {}; - if (singleFeatures.length > 0){ - output.singleFeatures = { - type: 'geojson', - style: styleFuncs.buildVMSPOS(singleFeatures, iconLeg), - geojson: format.writeFeaturesObject(singleFeatures) - }; - - if (mapService.vmsposLabels.active){ - var dataFields = []; - var fields = mapService.labelVisibility.positions; - var mappings = mapService.getMappingTitlesProperties('vmspos'); - var titles = mapService.getPositionTitles(); - - if (fields.length > 0){ - angular.forEach(fields, function(item) { - var def = { - displayName: titles[item] - }; - - if (item === 'lon'){ - def.propName = 'disp_lon'; - } else if (item === 'lat'){ - def.propName = 'disp_lat'; - } else { - def.propName = mappings[item]; - } - - if (!_.isEqual(def, {})){ - dataFields.push(def); - } - }); - - var labelEl = $('.vector-label-vmspos').first(); - output.singleFeatures.popupProperties = { - showAttrNames: mapService.labelVisibility.positionsTitles, - dataFields: dataFields, - popupStyle: { - width: parseInt(labelEl.css('width')), - radius: parseInt(labelEl.css('border-radius')), - border: { - color: rgbToHex(labelEl.css('border-left-color')), - width: parseInt(labelEl.css('border-left-width')) - } - } - }; - } - } - } - - if (clusters.length > 0){ - output.clusters = { - type: 'geojson', - style: styleFuncs.buildVMSPOSCluster(clusters), - geojson: format.writeFeaturesObject(clusters) - }; - } - - return output; - }, - buildGrid: function(){ - var proj = projectionService.getProjectionEpsgById(MapFish.projectionId); - var obj = { - type: 'grid', - gridType: 'points', - numberOfLines: [5,5], - opacity: 1, - renderAsSvg: true, - labelProjection: angular.isDefined(proj) ? 'EPSG:' + proj : 'EPSG:4326', - labelFomat: '%1.2f%s', - font: { - name: ['Arial'], - size: 8, - style: 'BOLD' - }, - labelColor: "#000000", - gridColor: "#000000", - haloRadius: 3 - }; - - return obj; - } - }; - - var getGeoJSON = function(layer){ - var format = new ol.format.GeoJSON(); - var printLayerSrc = mapService.getLayerByType('print').getSource(); - var src = layer.getSource(); - - var features = angular.copy(src.getFeaturesInExtent(printLayerSrc.getExtent())); - if (layer.get('type') === 'vmsseg' && mapService.vmssegLabels.active){ - angular.forEach(features, function(feature) { - if (feature.get('overlayHidden') === false){ - feature.set('distance', unitConversionService.distance.formatDistance(feature.get('distance'), 5)); - feature.set('duration', unitConversionService.duration.timeToHuman(feature.get('duration'))); - feature.set('speedOverGround', unitConversionService.speed.formatSpeed(feature.get('speedOverGround'), 5)); - - var overCoords = mapService.vmssegLabels[feature.get('overlayId')].overlay.getPosition(); - feature.set('popupX', overCoords[0]); - feature.set('popupY', overCoords[1]); - } - }); - } - var geojson = format.writeFeaturesObject(features); - - return geojson; - }; - - var getAttribution = function(layer){ - var attribution = layer.getSource().getAttributions(); - - var attrArray = []; - if (attribution !== null && attribution.length > 0){ - var title = layer.get('title'); - attrArray.push(title.charAt(0).toUpperCase() + title.slice(1)); - - var text = ''; - for (var i = 0; i < attribution.length; i++){ - text += $('

').html(attribution[i].getHTML()).text(); - if (i < attribution.length - 1){ - text += ' | '; - } - } - if (MapFish.includeLongCopyright === true){ - if (text.length > 0){ - text += ' | '; - } - text += layer.get('longAttribution'); - } - attrArray.push(text); - } - - return attrArray; - }; - - var getLayersAndLegendConfigsArray = function(iconLeg){ - var layers = []; - var legClasses = []; - var copyright = []; - var mapLayers = mapService.map.getLayers(); - - mapLayers.forEach(function(lyr, idx, lyrs){ - var type = lyr.get('type'); - var supportedTypes = ['OSM', 'vmspos', 'vmsseg', 'alarms', 'WMS', 'OSEA']; - var supportedLegTypes = ['WMS', 'vmspos', 'vmsseg', 'alarms']; - if (angular.isDefined(type) && _.indexOf(supportedTypes, type) !== -1 && lyr.get('visible') === true){ - var fn = 'build' + type.toUpperCase(); - var layerObj; - if (type === 'vmspos'){ - layerObj = layerFuncs[fn](lyr, iconLeg); - } else { - layerObj = layerFuncs[fn](lyr); - } - - var legObj; - if (_.indexOf(supportedLegTypes, type) !== -1 && (type === 'vmspos' || type === 'vmsseg' || type === 'alarms')){ - legObj = legendFuncs[fn](lyr, iconLeg); - } else if (_.indexOf(supportedLegTypes, type) !== -1){ - legObj = legendFuncs[fn](lyr); - } - - if (angular.isDefined(layerObj)){ - if (type === 'vmspos'){ - if (angular.isDefined(layerObj.clusters) && layerObj.clusters.geojson.features.length > 0){ - layers.push(layerObj.clusters); - } - if (angular.isDefined(layerObj.singleFeatures) && layerObj.singleFeatures.geojson.features.length > 0){ - layers.push(layerObj.singleFeatures); - } - } else if(type === 'vmsseg'){ - if (layerObj.geojson.features.length > 0){ - layers.push(layerObj); - } - } else { - layers.push(layerObj); - } - } - - if (angular.isDefined(legObj)){ - legClasses.push(legObj); - } - - //copyright stuff - var copyArray = getAttribution(lyr); - if (angular.isDefined(copyArray) && copyArray.length > 0){ - copyright.push(copyArray); - } - } - }); - - if (MapFish.includeCoordGrid === true){ - layers.push(layerFuncs.buildGrid()); - } - layers.reverse(); - legClasses.reverse(); - copyright.reverse(); - - return { - layers: layers, - legend: legClasses, - copyright: copyright - }; - }; - - return mapFishPayload; -}); - +/* +Developed with the contribution of the European Commission - Directorate General for Maritime Affairs and Fisheries +© European Union, 2015-2016. + +This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The IFDM Suite is free software: you can +redistribute it and/or modify it under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or any later version. The IFDM Suite is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a +copy of the GNU General Public License along with the IFDM Suite. If not, see . +*/ +angular.module('unionvmsWeb').factory('MapFish',function() { + + var model = { + + spatialServerUrl: undefined, + + isDeployed : false, + + jobStatusData : { + done : true, + status : undefined, + elapsedTime: undefined, + waitingTime: undefined, + downloadURL: undefined + }, + + templateData : undefined, + capabilitiesData : undefined, + + templates: [], + selected_template : undefined, + + formats : [], + selected_format : undefined, + + layouts : [], + selected_layout : undefined, + + suggestedDpi : [], + selected_dpi : undefined, + + layoutAttributes : [], + + printJobData : { + ref: undefined, + statusURL: undefined, + downloadURL: undefined + }, + + includeCoordGrid: true, + projectionId: undefined, + includeLongCopyright: false, + + printMapSize: [], + + initSpatialServerUrl: function(spatialServerUrl) { + model.spatialServerUrl = spatialServerUrl; + }, + + reset: function(){ + model.templates = []; + model.layouts = []; + model.formats = []; + model.layoutAttributes = []; + model.suggestedDpi = []; + model.selected_format = undefined; + model.selected_layout = undefined; + model.selected_dpi = undefined; + model.printMapSize = []; + }, + + resetOnLayoutChange: function(){ + model.layoutAttributes = []; + model.suggestedDpi = []; + model.selected_dpi = undefined; + model.printMapSize = []; + }, + + initTemplateCmbx : function(templates){ + model.templateData = templates; + for (var i = 0; i < templates.length; i++) { + model.templates.push({"text": model.templateData[i], "code": model.templateData[i]}); + } + model.selected_template = model.templates[0].code; + }, + + initLayoutCmbx : function(capabilities){ + model.capabilitiesData = capabilities; + for (var l = 0; l < model.capabilitiesData.layouts.length; l++) { + var layout = model.capabilitiesData.layouts[l]; + model.layouts.push({"text": layout.name, "code": layout.name }); + } + model.selected_layout = model.layouts[0].code; + }, + + initFormatsCmbx : function(capabilities){ + model.capabilitiesData = capabilities; + for (var f = 0; f < model.capabilitiesData.formats.length; f++) { + if (model.capabilitiesData.formats[f] !== 'bmp'){ + model.formats.push({"text": model.capabilitiesData.formats[f], "code": model.capabilitiesData.formats[f]}); + } + } + model.selected_format = model.formats[0].code; + }, + + initLayoutAttributes : function(capabilities, _layout){ + model.layoutAttributes = []; + capabilities.layouts.filter( + function(layout){ + if (layout.name === _layout){ + layout.attributes.filter(function(attribute){ + if (attribute.type === 'String' && ((attribute.default !== undefined && attribute.default.length < 1) || attribute.default === undefined)){ + model.layoutAttributes.push(attribute); + } + else if (attribute.type === 'MapAttributeValues'){ + model.suggestedDpi = []; + for (var d = 0; d < attribute.clientInfo.dpiSuggestions.length; d++){ + var dpiValue = attribute.clientInfo.dpiSuggestions[d]; + model.suggestedDpi.push({"text": dpiValue, "code": dpiValue}); + model.selected_dpi = model.suggestedDpi[0].code; + } + model.printMapSize = [attribute.clientInfo.width, attribute.clientInfo.height]; + } + }); + } + } + ); + } + }; + + return model; + +}) +.factory('MapFishPayload',function(locale, $location, Color, MapFish, mapService, mapFishPrintRestService, unitConversionService, projectionService, coordinateFormatService, spatialConfigRestService){ + + spatialConfigRestService.getAdminConfigs().then(function(configs) { + this.spatialServerUrl = configs.systemSettings.spatialServerUrl; + }); + + function mapFishPayload(){ + this.layout = undefined; + this.attributes = {}; + } + + mapFishPayload.prototype.createPayloadObj = function(data, iconLeg){ + this.layout = MapFish.selected_layout; + this.attributes = buildAttributes(data, iconLeg); + }; + + + mapFishPayload.prototype.getIconPayload = function(type){ + var forbidenKeys = ['lineStyle', 'default', 'lineWidth']; + var styles = mapService.styles[type]; + + if (angular.isDefined(styles)){ + var obj, i, keys; + var classes = []; + if (type === 'alarms'){ + obj = { + title: locale.getString('spatial.styles_attr_status') + }; + + keys = _.keys(styles); + for (i = 0; i < keys.length; i++){ + if (keys[i] !== 'size'){ + classes.push({ + text: locale.getString('spatial.legend_panel_alarms_' + keys[i]), + color: styles[keys[i]] + }); + } + } + } else { + if(type === 'activity'){ + obj = { + title: '' + }; + } else { + obj = { + title: getSubtitle(styles) + }; + } + + if (type === 'segments'){ + switch (styles.style.lineStyle) { + case 'dotted': + obj.lineStyle = '1,1'; + break; + case 'dashed': + obj.lineStyle = '5,5'; + break; + case 'dotdashed': + obj.lineStyle = '5,2,1,2'; + break; + default: + obj.lineStyle = '0,0'; + break; + } + } else if(type === 'activity'){ + obj.cluster = { + text: 'Fishing Activity', + bgcolor: '#FFFFFF', + bordercolor: '#078dbe' + }; + } else { + obj.cluster = { + text: locale.getString('spatial.print_cluster_legend_title'), + bgcolor: '#FFFFFF', + bordercolor: '#F7580D' + }; + } + + switch (styles.attribute) { + case 'countryCode': + for (i = 0; i < styles.displayedCodes.length; i++){ + classes.push({ + text: styles.displayedCodes[i], + color: styles.style[styles.displayedCodes[i]] + }); + } + break; + case 'activity': //Positions + case 'type': + case 'segmentCategory': //Segments + keys = _.keys(styles.style); + for (i = 0; i < keys.length; i++){ + if (_.indexOf(forbidenKeys, keys[i]) === -1){ + classes.push({ + text: keys[i], + color: styles.style[keys[i]] + }); + } + } + + //Finally add the default rule + classes.push({ + text: locale.getString('spatial.legend_panel_all_other_values'), + color: styles.style.default + }); + + break; + case 'reportedCourse': //Positions + case 'calculatedSpeed': + case 'reportedSpeed': + case 'speedOverGround': //Segments + case 'distance': + case 'courseOverGround': + for (i = 0; i < styles.breaks.intervals.length; i++){ + classes.push({ + text: styles.breaks.intervals[i][0] + ' - ' + styles.breaks.intervals[i][1], + color: styles.style[styles.breaks.intervals[i][0] + '-' + styles.breaks.intervals[i][1]] + }); + } + + //Finally add the default rule + classes.push({ + text: locale.getString('spatial.legend_panel_all_other_values'), + color: styles.style.default + }); + + break; + } + } + + obj.classes = classes; + return obj; + } + }; + + var getSubtitle = function(srcDef){ + var withSpeed = ['reportedSpeed', 'calculatedSpeed', 'speedOverGround']; + var withCourse = ['reportedCourse', 'courseOverGround']; + + var subTitle = locale.getString('spatial.styles_attr_' + srcDef.attribute); + if (_.indexOf(withSpeed, srcDef.attribute) !== -1){ + var srcUnit = unitConversionService.speed.getUnit(); + subTitle += ' (' + locale.getString('common.speed_unit_' + srcUnit) + ')'; + } + + if (_.indexOf(withCourse, srcDef.attribute) !== -1){ + subTitle += ' (' + String.fromCharCode(parseInt('00B0', 16)) + ')'; + } + + if (srcDef.attribute === 'distance'){ + subTitle += ' (' + unitConversionService.distance.getUnit() + ')'; + } + + return subTitle; + }; + + var buildAttributes = function(data, iconLeg){ + var attr = {}; + + //Setting attributes defined through the printing widget like title, description, etc + angular.forEach(data, function(value, key) { + attr[key] = value; + }, attr); + + var spatialAttr = buildMapAndLegendAttributes(iconLeg); + attr.map = spatialAttr.map; + attr.legend = spatialAttr.legend; + attr.datasource = []; + + attr.copyrightTitle = locale.getString('spatial.print_copyright_title').toUpperCase(); + attr.legendTitle = locale.getString('spatial.print_legend_title').toUpperCase(); + + if (spatialAttr.copyright.length > 0){ + attr.datasource.push({ + displayName: '', + table: { + columns: ['layer', 'copyright'], + data: spatialAttr.copyright + } + }); + } + + return attr; + }; + + var buildMapAndLegendAttributes = function(iconLeg){ + var map = {}; + var legend = { + name: '', + classes: [] + }; + + var layerSrc = mapService.getLayerByType('print').getSource(); + + map.projection = mapService.getMapProjectionCode(); + map.bbox = layerSrc.getExtent(); + map.dpi = MapFish.selected_dpi; + map.rotation = 0; + + var configs = getLayersAndLegendConfigsArray(iconLeg); + map.layers = configs.layers; + legend.classes = configs.legend; + + var finalObj = { + map: map, + legend: legend, + copyright: configs.copyright + }; + + return finalObj; + }; + + var getUrl = function(){ + var url = null; + if (this.spatialServerUrl) { + url = this.spatialServerUrl; + } else { + var url = $location.protocol() + '://' + $location.host(); + if ($location.port() !== 80){ + url += ':' + $location.port(); + } + } + + return url; + }; + + var legendFuncs = { + buildWMS: function(layer){ + var src = layer.getSource(); + var params = src.getParams(); + var url = src.getUrls()[0] + '?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=25&HEIGHT=25&LAYER='; + url += params.LAYERS; + + if (angular.isDefined(params.STYLES) && params.STYLES !== ''){ + url += '&STYLE='; + url += params.STYLES; + } + + var name = layer.get('title'); + + return { + name: name.charAt(0).toUpperCase() + name.slice(1), + icons: [url] + }; + }, + buildVMSPOS: function(layer, iconLeg){ + return this.buildVectorLegend(layer, iconLeg, 'vmspos'); + }, + buildVMSSEG: function(layer, iconLeg){ + return this.buildVectorLegend(layer, iconLeg, 'vmsseg'); + }, + buildALARMS: function(layer, iconLeg){ + return this.buildVectorLegend(layer, iconLeg, 'alarms'); + }, + buildERS: function(layer, iconLeg){ + return this.buildVectorLegend(layer, iconLeg, 'ers'); + }, + buildVectorLegend: function(layer, iconLeg, type){ + var url = getUrl(); + url += iconLeg.legend.base; + + switch (type) { + case 'ers': + url += iconLeg.legend.activity; + break; + case 'vmspos': + url += iconLeg.legend.positions; + break; + case 'vmsseg': + url += iconLeg.legend.segments; + break; + case 'alarms': + url += iconLeg.legend.alarms; + break; + default: + break; + } + + var name = layer.get('title'); + + return { + name: name.charAt(0).toUpperCase() + name.slice(1), + icons: [url] + }; + } + }; + + var styleFuncs = { + buildVMSPOSCluster: function(features){ + var style = { + version: 2, + strokeColor: '#F7580D', + strokeWidth: 2, + fillColor: '#ffffff', + fillOpacity: 0.3, + fontWeight: 'BOLD', + fontColor: '#000000', + fontSize: 8, + fontFamily: 'Arial', + labelAlign: 'cm', + labelXOffset: -1, + labelYOffset: -1 + }; + + var name; + angular.forEach(features, function(feature) { + var radius = feature.get('radius'); + + name = "["; + name +="radius = " + feature.get('radius'); + name += "]"; + + style[name] = { + symbolizers: [{ + type: 'point', + pointRadius: radius + },{ + type: 'text', + label: '[printLabel]' + }] + }; + }); + + return style; + }, + buildVMSPOS: function(features, iconLeg){ + var styleDef = mapService.styles.positions; + + var style = { + version: 2, + graphicWidth: 18, + graphicOpacity : 1.0, + graphicFormat : 'image/png', + type: 'point' + }; + + this.buildVectorStyle(style, styleDef, 'vmspos', iconLeg); + + return style; + }, + buildERS: function(features, iconLeg){ + + var style = { + version: 2, + strokeColor: '#ffffff', + strokeWidth: 2, + fillColor: '#078dbe', + fillOpacity: 0.3, + fontWeight: 'BOLD', + labelAlign: 'cm', + labelXOffset: -1, + labelYOffset: -1 + }; + + var name; + angular.forEach(features, function(feature) { + var radius = 7; + + name = "["; + name +="radius = " + radius; + name += "]"; + + style[name] = { + symbolizers: [{ + type: 'point', + pointRadius: radius + },{ + type: 'text', + label: '[printLabel]' + }] + }; + }); + + return style; + }, + buildERSPOS: function(features, iconLeg){ + + var style = { + + }; + + return style; + }, + buildALARMS: function(layer){ + var styleDef = mapService.styles.alarms; + + var style = { + version: 2, + strokeColor: '#FFFFFF', + strokeWidth: 2, + pointRadius: styleDef.size * 2, + type: 'point', + }; + + this.buildAlarmsStyle(style, styleDef, 'alarms'); + + return style; + }, + buildVMSSEG: function(layer){ + var styleDef = mapService.styles.segments; + + var style = { + version: 2, + strokeWidth: angular.isDefined(styleDef.style.lineWidth) ? parseInt(styleDef.style.lineWidth) : 2, + strokeDashstyle: 'solid', + strokeLinecap: 'round', + type: 'line' + }; + + var interval, dot; + if (angular.isDefined(styleDef.style.lineStyle)){ + switch (styleDef.style.lineStyle) { + case 'dotted': + dot = (style.strokeWidth + 1).toString(); + interval = style.strokeWidth.toString(); + style.strokeDashstyle = dot + ' ' + interval; + break; + case 'dashed': + style.strokeDashstyle = 'longdash'; + break; + case 'dotdashed': + var dash = (4 * style.strokeWidth).toString(); + dot = (style.strokeWidth + 1).toString(); + interval = (2 * style.strokeWidth).toString(); + style.strokeDashstyle = dash + ' ' + interval + ' ' + dot + ' ' + interval; + break; + default: + style.strokeDashstyle = 'solid'; + break; + } + } + + this.buildVectorStyle(style, styleDef, 'vmsseg'); + + + return style; + }, + buildAlarmsStyle: function(style, styleDef){ + var keys = _.keys(styleDef); + + for (var i = 0; i < keys.length; i++){ + if (keys[i] !== 'size'){ + var name = "[ticketStatus = '" + keys[i].toUpperCase() + "']"; + style[name] = { + symbolizers: [{ + fillColor: styleDef[keys[i]], + fillOpacity: 1.0, + }] + }; + } + } + + }, + buildVectorStyle: function(style, styleDef, type, iconLeg){ + var keys = _.keys(styleDef.style); + + var url; + if (type === 'vmspos'){ + url = getUrl(); + url += iconLeg.map.vmspos.base; + } + + var i, name, defaultName, color, tempName; + switch (styleDef.attribute) { + case 'activity': //Positions + case 'type': + case 'segmentCategory': //Segments + var forbidenKeys = ['lineStyle', 'default', 'lineWidth']; + for (i = 0; i < keys.length; i++){ + tempName = styleDef.attribute; + if (styleDef.attribute === 'activity'){ + tempName = 'activityType'; + } else if (styleDef.attribute === 'type'){ + tempName = 'movementType'; + } + + if (_.indexOf(forbidenKeys, keys[i]) === -1){ + name = "["; + name += tempName + " = '" + keys[i]; + name += "']"; + + if (type === 'vmsseg'){ + style[name] = { + symbolizers: [{ + strokeWidth: style.strokeWidth + 3, + strokeColor: '#ffffff' + },{ + strokeColor: styleDef.style[keys[i]] + }] + }; + } else { + color = styleDef.style[keys[i]].slice(1); + if (_.indexOf(iconLeg.map.vmspos.colors, color) !== -1){ + style[name] = { + symbolizers: [{ + rotation: '[reportedCourse]', + externalGraphic: url + color + }] + }; + } + } + + } + } + //Finally we build the defaults rule + defaultName = "["; + defaultName += tempName + " not in ('"; + defaultName += keys.join("','"); + defaultName += "')]"; + + if (type === 'vmsseg'){ + style[defaultName] = { + symbolizers: [{ + strokeWidth: style.strokeWidth + 3, + strokeColor: '#ffffff' + },{ + strokeColor: styleDef.style.default + }] + }; + } else { + color = styleDef.style.default.slice(1); + style[defaultName] = { + symbolizers: [{ + rotation: '[reportedCourse]', + externalGraphic: url + color + }] + }; + } + + break; + case 'countryCode': + for (i = 0; i < keys.length; i++){ + if (styleDef.displayedCodes.indexOf(keys[i]) !== -1){ + name = "["; + name += styleDef.attribute + " = '" + keys[i]; + name += "']"; + if (type === 'vmsseg'){ + style[name] = { + symbolizers: [{ + strokeWidth: style.strokeWidth + 3, + strokeColor: '#ffffff' + },{ + strokeColor: styleDef.style[keys[i]] + }] + }; + } else { + color = styleDef.style[keys[i]].slice(1); + if (_.indexOf(iconLeg.map.vmspos.colors, color) !== -1){ + style[name] = { + symbolizers: [{ + rotation: '[reportedCourse]', + externalGraphic: url + color + }] + }; + } + } + } + } + break; + case 'reportedCourse': //Positions + case 'calculatedSpeed': + case 'reportedSpeed': + case 'speedOverGround': //Segments + case 'distance': + case 'courseOverGround': + var min, max; + for (i = 0; i < styleDef.breaks.intervals.length; i++){ + name = "["; + name += styleDef.attribute + " >= " + styleDef.breaks.intervals[i][0]; + name += " and "; + name += styleDef.attribute + " < " + styleDef.breaks.intervals[i][1]; + name += "]"; + + if (type === 'vmsseg'){ + style[name] = { + symbolizers: [{ + strokeWidth: style.strokeWidth + 3, + strokeColor: '#ffffff' + },{ + strokeColor: styleDef.style[styleDef.breaks.intervals[i][0] + '-' + styleDef.breaks.intervals[i][1]] + }] + }; + } else { + color = styleDef.style[styleDef.breaks.intervals[i][0] + '-' + styleDef.breaks.intervals[i][1]].slice(1); + if (_.indexOf(iconLeg.map.vmspos.colors, color) !== -1){ + style[name] = { + symbolizers: [{ + rotation: '[reportedCourse]', + externalGraphic: url + color + }] + }; + } + } + + + if (i === 0){ + min = styleDef.breaks.intervals[i][0]; + max = styleDef.breaks.intervals[i][1]; + } else { + min = Math.min(min, styleDef.breaks.intervals[i][0]); + max = Math.max(max, styleDef.breaks.intervals[i][1]); + } + } + //Finally we build the defaults rule + defaultName = "["; + defaultName += styleDef.attribute + " < " + min; + defaultName += " or "; + defaultName += styleDef.attribute + " >= " + max; + defaultName += "]"; + + if (type === 'vmsseg'){ + style[defaultName] = { + symbolizers: [{ + strokeWidth: style.strokeWidth + 3, + strokeColor: '#ffffff' + },{ + strokeColor: styleDef.breaks.defaultColor + }] + }; + } else { + color = styleDef.style.default.slice(1); + style[defaultName] = { + symbolizers: [{ + rotation: '[reportedCourse]', + externalGraphic: url + color + }] + }; + } + break; + } + } + }; + + var rgbToHex = function(colorStr){ + var pattern = /\d+/g; + var rgb = colorStr.match(pattern); + + return '#' + ((1 << 24) | (parseInt(rgb[0], 10) << 16) | (parseInt(rgb[1], 10) << 8) | parseInt(rgb[2], 10)).toString(16).substr(1); + }; + + var layerFuncs = { + buildOSEA: function(layer){ + return this.buildOSM(layer); + }, + buildOSM: function(layer){ + var prop = layer.getProperties(); + + var url; + if (prop.type === 'OSM'){ + url = 'http://tile.openstreetmap.org'; + } else { + url = 'http://tiles.openseamap.org/seamark'; + } + + var obj = { + baseURL: url, + type: 'OSM', + resolutions: [156543.03390625, 78271.516953125, 39135.7584765625, 19567.87923828125, 9783.939619140625, 4891.9698095703125, 2445.9849047851562, 1222.9924523925781, 611.4962261962891, 305.74811309814453, 152.87405654907226, 76.43702827453613, 38.218514137268066, 19.109257068634033, 9.554628534317017, 4.777314267158508, 2.388657133579254, 1.194328566789627, 0.5971642833948135], + opacity: prop.opacity, + maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34], + tileSize: [256, 256], + imageExtension: 'png' + }; + + return obj; + }, + buildWMS: function(layer){ + var prop = layer.getProperties(); + var src = layer.getSource(); + var params = src.getParams(); + + var obj = { + baseURL: src.getUrls()[0], + customParams: { + EXCEPTIONS: 'INIMAGE', + TRANSPARENT: true, + CQL_FILTER: angular.isDefined(params.cql_filter) && params.cql_filter !== null ? params.cql_filter : undefined + }, + layers: [params.LAYERS], + opacity: prop.opacity, + type: 'WMS' + }; + + var server = layer.get('serverType'); + if (angular.isDefined(server)){ + obj.serverType = server; + } + + if (angular.isDefined(params.STYLES) && params.STYLES !== ''){ + obj.styles = [params.STYLES]; + } + + if (angular.isDefined(params.FORMAT) && params.FORMAT !== ''){ + obj.imageFormat = params.FORMAT; + } else { + obj.imageFormat = 'image/png'; + } + + return obj; + }, + buildALARMS: function(layer){ + var obj = { + type: 'geojson', + style: styleFuncs.buildALARMS(layer), + geojson: getGeoJSON(layer) + }; + + return obj; + }, + buildVMSSEG: function(layer){ + var obj = { + type: 'geojson', + style: styleFuncs.buildVMSSEG(layer), + geojson: getGeoJSON(mapService.getLayerByType('vmsseg')) + }; + + if (mapService.vmssegLabels.active){ + var dataFields = []; + var fields = mapService.labelVisibility.segments; + var mappings = mapService.getMappingTitlesProperties('vmsseg'); + var titles = mapService.getSegmentTitles(); + + if (fields.length > 0){ + angular.forEach(fields, function(item) { + var def = { + displayName: titles[item], + propName: mappings[item] + }; + + if (!_.isEqual(def, {})){ + dataFields.push(def); + } + }); + + var labelEl = $('.vector-label-vmsseg').first(); + obj.popupProperties = { + showAttrNames: mapService.labelVisibility.segmentsTitles, + dataFields: dataFields, + popupStyle: { + width: parseInt(labelEl.css('width')), + radius: parseInt(labelEl.css('border-radius')), + border: { + color: rgbToHex(labelEl.css('border-left-color')), + width: parseInt(labelEl.css('border-left-width')) + } + } + }; + } + } + + return obj; + }, + buildVMSPOS: function(layer, iconLeg){ + var format = new ol.format.GeoJSON(); + var printLayerSrc = mapService.getLayerByType('print').getSource(); + var src = layer.getSource(); + var srcStyle = layer.getStyle(); + + var features = src.getFeaturesInExtent(printLayerSrc.getExtent()); + var clusters = []; + var singleFeatures = []; + var tempSizes = {}; + angular.forEach(features, function(clusterFeat) { + var featuresInCluster = clusterFeat.get('features'); + + if (featuresInCluster.length > 1 && clusterFeat.get('featNumber') > 1){ + var clusterToPrint = new ol.Feature({ + geometry: clusterFeat.getGeometry() + }); + + var number = clusterFeat.get('featNumber'); + var radius = clusterFeat.get('radius'); + + if (!angular.isDefined(radius)){ + var featStyle = srcStyle(clusterFeat)[0]; + radius = featStyle.getImage().getRadius(); + } + + clusterToPrint.set('printLabel', clusterFeat.get('featNumber')); + clusterToPrint.set('radius', radius); + + clusters.push(clusterToPrint); + } else { + var feature; + if (featuresInCluster.length === 1){ + feature = featuresInCluster[0].clone(); + } else { + feature = clusterFeat.get('featureToDisplay').clone(); + } + + if (angular.isUndefined(feature.get('reportedCourse'))){ + feature.set('reportedCourse', 0); + } + + if (mapService.vmsposLabels.active){ + if (feature.get('overlayHidden') === false){ + var overCoords = mapService.vmsposLabels[feature.get('overlayId')].overlay.getPosition(); + feature.set('popupX', overCoords[0]); + feature.set('popupY', overCoords[1]); + + var srcCoords = feature.getGeometry().getCoordinates(); + var proj = mapService.getMapProjectionCode(); + if (proj !== 'EPSG:4326'){ + srcCoords = ol.proj.toLonLat(srcCoords, proj); + } + + feature.set('disp_lon', coordinateFormatService.formatAccordingToUserSettings(srcCoords[0])); + feature.set('disp_lat', coordinateFormatService.formatAccordingToUserSettings(srcCoords[1])); + feature.set('positionTime', unitConversionService.date.convertToUserFormat(feature.get('positionTime'))); + feature.set('reportedSpeed', unitConversionService.speed.formatSpeed(feature.get('reportedSpeed'), 5)); + feature.set('calculatedSpeed', unitConversionService.speed.formatSpeed(feature.get('calculatedSpeed'), 5)); + } + } + singleFeatures.push(feature); + } + }); + + var output = {}; + if (singleFeatures.length > 0){ + output.singleFeatures = { + type: 'geojson', + style: styleFuncs.buildVMSPOS(singleFeatures, iconLeg), + geojson: format.writeFeaturesObject(singleFeatures) + }; + + if (mapService.vmsposLabels.active){ + var dataFields = []; + var fields = mapService.labelVisibility.positions; + var mappings = mapService.getMappingTitlesProperties('vmspos'); + var titles = mapService.getPositionTitles(); + + if (fields.length > 0){ + angular.forEach(fields, function(item) { + var def = { + displayName: titles[item] + }; + + if (item === 'lon'){ + def.propName = 'disp_lon'; + } else if (item === 'lat'){ + def.propName = 'disp_lat'; + } else { + def.propName = mappings[item]; + } + + if (!_.isEqual(def, {})){ + dataFields.push(def); + } + }); + + var labelEl = $('.vector-label-vmspos').first(); + output.singleFeatures.popupProperties = { + showAttrNames: mapService.labelVisibility.positionsTitles, + dataFields: dataFields, + popupStyle: { + width: parseInt(labelEl.css('width')), + radius: parseInt(labelEl.css('border-radius')), + border: { + color: rgbToHex(labelEl.css('border-left-color')), + width: parseInt(labelEl.css('border-left-width')) + } + } + }; + } + } + } + + if (clusters.length > 0){ + output.clusters = { + type: 'geojson', + style: styleFuncs.buildVMSPOSCluster(clusters), + geojson: format.writeFeaturesObject(clusters) + }; + } + + return output; + }, + buildERS: function(layer, iconLeg){ + + var printLayerSrc = mapService.getLayerByType('print').getSource(); + var src = layer.getSource(); + var singleFeatures = []; + var features = src.getFeaturesInExtent(printLayerSrc.getExtent()); + var clusters = []; + + var format = new ol.format.GeoJSON(); + + angular.forEach(features, function(entry) { + + if (mapService.ersLabels.active) { + var feature = entry.clone(); + if (feature.get('overlayHidden') === false) { + var overCoords = mapService.ersLabels[feature.get('overlayId')].overlay.getPosition(); + feature.set('popupX', overCoords[0]); + feature.set('popupY', overCoords[1]); + + var srcCoords = feature.getGeometry().getCoordinates(); + var proj = mapService.getMapProjectionCode(); + if (proj !== 'EPSG:4326'){ + srcCoords = ol.proj.toLonLat(srcCoords, proj); + } + + feature.set('disp_lon', coordinateFormatService.formatAccordingToUserSettings(srcCoords[0])); + feature.set('disp_lat', coordinateFormatService.formatAccordingToUserSettings(srcCoords[1])); + feature.set('positionTime', unitConversionService.date.convertToUserFormat(feature.get('positionTime'))); + feature.set('reportedSpeed', unitConversionService.speed.formatSpeed(feature.get('reportedSpeed'), 5)); + feature.set('calculatedSpeed', unitConversionService.speed.formatSpeed(feature.get('calculatedSpeed'), 5)); + + } + singleFeatures.push(feature); + } else { + entry.getGeometry().set('type','Point'); + var clusterToPrint = new ol.Feature({ + geometry: entry.getGeometry() + }); + clusterToPrint.set('radius', 7); + clusterToPrint.set('printLabel', ''); + clusters.push(clusterToPrint); + } + }); + + var output = {}; + if (singleFeatures.length > 0) { + output.singleFeatures = { + type: 'geojson', + style: styleFuncs.buildERSPOS(singleFeatures, iconLeg), + geojson: format.writeFeaturesObject(singleFeatures) + }; + + var dataFields = []; + var fields = mapService.labelVisibility.activities; + var mappings = mapService.getMappingTitlesProperties('ers'); + var titles = mapService.getActivityTitles(); + + if (fields.length > 0) { + angular.forEach(fields, function (item) { + var def = { + displayName: titles[item] + }; + + if (item === 'lon') { + def.propName = 'disp_lon'; + } else if (item === 'lat') { + def.propName = 'disp_lat'; + } else { + def.propName = mappings[item]; + } + + if (!_.isEqual(def, {})) { + dataFields.push(def); + } + }); + + var labelEl = $('.vector-label-ers').first(); + output.singleFeatures.popupProperties = { + showAttrNames: mapService.labelVisibility.activitiesTitles, + dataFields: dataFields, + popupStyle: { + width: parseInt(labelEl.css('width')), + radius: parseInt(labelEl.css('border-radius')), + border: { + color: rgbToHex(labelEl.css('border-left-color')), + width: parseInt(labelEl.css('border-left-width')) + } + } + }; + return output.singleFeatures; + } + } + + if (clusters.length > 0){ + output = { + type: 'geojson', + style: styleFuncs.buildERS(clusters, iconLeg), + geojson: format.writeFeaturesObject(clusters) + }; + return output; + } + + + }, + buildGrid: function(){ + var proj = projectionService.getProjectionEpsgById(MapFish.projectionId); + var obj = { + type: 'grid', + gridType: 'points', + numberOfLines: [5,5], + opacity: 1, + renderAsSvg: true, + labelProjection: angular.isDefined(proj) ? 'EPSG:' + proj : 'EPSG:4326', + labelFomat: '%1.2f%s', + font: { + name: ['Arial'], + size: 8, + style: 'BOLD' + }, + labelColor: "#000000", + gridColor: "#000000", + haloRadius: 3 + }; + + return obj; + } + }; + + var getGeoJSON = function(layer){ + var format = new ol.format.GeoJSON(); + var printLayerSrc = mapService.getLayerByType('print').getSource(); + var src = layer.getSource(); + + var features = angular.copy(src.getSource().getFeaturesInExtent(printLayerSrc.getExtent())); + if (layer.get('type') === 'vmsseg' && mapService.vmssegLabels.active){ + angular.forEach(features, function(feature) { + if (feature.get('overlayHidden') === false){ + feature.set('distance', unitConversionService.distance.formatDistance(feature.get('distance'), 5)); + feature.set('duration', unitConversionService.duration.timeToHuman(feature.get('duration'))); + feature.set('speedOverGround', unitConversionService.speed.formatSpeed(feature.get('speedOverGround'), 5)); + + var overCoords = mapService.vmssegLabels[feature.get('overlayId')].overlay.getPosition(); + feature.set('popupX', overCoords[0]); + feature.set('popupY', overCoords[1]); + } + }); + } + var geojson = format.writeFeaturesObject(features); + + return geojson; + }; + + var getAttribution = function(layer){ + var attribution = layer.getSource().getAttributions(); + + var attrArray = []; + if (attribution !== null && attribution.length > 0){ + var title = layer.get('title'); + attrArray.push(title.charAt(0).toUpperCase() + title.slice(1)); + + var text = ''; + for (var i = 0; i < attribution.length; i++){ + text += $('

').html(attribution[i].getHTML()).text(); + if (i < attribution.length - 1){ + text += ' | '; + } + } + if (MapFish.includeLongCopyright === true){ + if (text.length > 0){ + text += ' | '; + } + text += layer.get('longAttribution'); + } + attrArray.push(text); + } + + return attrArray; + }; + + var getLayersAndLegendConfigsArray = function(iconLeg){ + var layers = []; + var legClasses = []; + var copyright = []; + var mapLayers = mapService.map.getLayers(); + + mapLayers.forEach(function(lyr, idx, lyrs){ + var type = lyr.get('type'); + var supportedTypes = ['OSM', 'vmspos', 'vmsseg', 'alarms', 'WMS', 'OSEA','ers']; + var supportedLegTypes = ['WMS', 'vmspos', 'vmsseg', 'alarms','ers']; + if (angular.isDefined(type) && _.indexOf(supportedTypes, type) !== -1 && lyr.get('visible') === true){ + var fn = 'build' + type.toUpperCase(); + var layerObj; + if (type === 'vmspos'){ + layerObj = layerFuncs[fn](lyr, iconLeg); + } else { + layerObj = layerFuncs[fn](lyr); + } + + var legObj; + if (_.indexOf(supportedLegTypes, type) !== -1 && (type === 'vmspos' || type === 'vmsseg' || type === 'alarms' || type === 'ers')){ + legObj = legendFuncs[fn](lyr, iconLeg); + } else if (_.indexOf(supportedLegTypes, type) !== -1){ + legObj = legendFuncs[fn](lyr); + } + + if (angular.isDefined(layerObj)){ + if (type === 'vmspos'){ + if (angular.isDefined(layerObj.clusters) && layerObj.clusters.geojson.features.length > 0){ + layers.push(layerObj.clusters); + } + if (angular.isDefined(layerObj.singleFeatures) && layerObj.singleFeatures.geojson.features.length > 0){ + layers.push(layerObj.singleFeatures); + } + } else if(type === 'vmsseg'){ + if (layerObj.geojson.features.length > 0){ + layers.push(layerObj); + } + } else { + layers.push(layerObj); + } + } + + if (angular.isDefined(legObj)){ + legClasses.push(legObj); + } + + //copyright stuff + var copyArray = getAttribution(lyr); + if (angular.isDefined(copyArray) && copyArray.length > 0){ + copyright.push(copyArray); + } + } + }); + + if (MapFish.includeCoordGrid === true){ + layers.push(layerFuncs.buildGrid()); + } + layers.reverse(); + legClasses.reverse(); + copyright.reverse(); + + return { + layers: layers, + legend: legClasses, + copyright: copyright + }; + }; + + return mapFishPayload; +}); + diff --git a/unionvms-web/app/service/spatial/mapService.js b/unionvms-web/app/service/spatial/mapService.js index 7d898277c..bd300d6b3 100644 --- a/unionvms-web/app/service/spatial/mapService.js +++ b/unionvms-web/app/service/spatial/mapService.js @@ -55,7 +55,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.sp = spatialHelperService; /** * Set liveview map according to report/preferences configurations - * + * * @memberof mapService * @public * @alias setMap @@ -65,7 +65,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.controls = []; ms.interactions = []; ms.overlay = ms.addPopupOverlay(); - + //Get all controls and interactions that will be added to the map var controlsToMap = ms.setControls(config.map.control); @@ -85,16 +85,16 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, control.updateHistory(); } }, controls); - + //Adjust print extent to the new map scale var printLayer = ms.getLayerByType('print'); if (angular.isDefined(printLayer) && ms.map.getView().getResolution() !== ms.mapPrintResolution){ ms.addPrintExtent(); } - + ms.checkLabelStatus(); }); - + map.on('change:size', function(e){ //Adjust print extent to the new map scale var printLayer = ms.getLayerByType('print'); @@ -108,7 +108,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var coordinate = evt.coordinate; var selInteraction = ms.getInteractionsByType('Select')[0]; var dragInteraction = ms.getCustomInteraction('Pointer', 'dragExtent')[0]; - + //get feature info if (angular.equals({}, ms.measureInteraction) && !angular.isDefined(dragInteraction)){ var records = []; @@ -120,12 +120,12 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var selFeat; if (positions.length === 1){ selFeat = positions[0]; - } - + } + if (feature.get('featNumber') === 1 && !angular.isDefined(selFeat)) { selFeat = feature.get('featureToDisplay'); } - + if (angular.isDefined(selFeat)){ records.push({ type: type, @@ -146,7 +146,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } } }); - + //Check features in exploded cluster if (angular.isDefined(selInteraction) && selInteraction.getFeatures().getLength() > 0){ var positions = selInteraction.getFeatures().getArray()[0].get('features'); @@ -166,12 +166,12 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } } }); - + if (angular.isDefined(record)){ records.push(record); } } - + if (records.length > 0){ ms.popupRecContainer.reset(); var data = ms.setObjPopup(records[0]); @@ -181,15 +181,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } } }); - + var view = ms.createView(config.map.projection); map.setView(view); ms.map = map; ms.addBlankLayer(); - + //Remove display none of the popup on initial loading angular.element('#popup').css('display', 'block'); - + ms.map.getViewport().addEventListener('contextmenu', function(e){ e.preventDefault(); var select = ms.getInteractionsByType('Select')[0]; @@ -207,14 +207,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, if (selFeatures.getLength() > 0){ selFeatures.clear(); } - + if (feature.get('featNumber') > 1){ selFeatures.push(feature); foundedFeatures = true; } } }); - + if (foundedFeatures === false){ selFeatures.clear(); } else if (foundedFeatures === true && angular.isDefined(ms.overlay) && ms.overlay.get('fromCluster') === true){ @@ -223,22 +223,22 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } } }); - + ms.setDragBoxEvent(ms.map); }; - + /** * Create a OL map view from config object - * + * * @memberof mapService * @public * @alias createView * @param {Object} config - The map configuration object - * @returns {ol.View} The OL map view + * @returns {ol.View} The OL map view */ ms.createView = function(config){ var view = genericMapService.createView(config); - + view.on('change:resolution', function(evt){ //Clear features on expanded clusters when zooming var select = ms.getInteractionsByType('Select')[0]; @@ -248,17 +248,17 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.closePopup(); } } - + layerPanelService.reloadPanels(); //$rootScope.$broadcast('reloadLegend'); }); - + return view; }; - + /** * Update map view with new configuration object - * + * * @memberof mapService * @public * @alias updateMapView @@ -268,31 +268,31 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var view = ms.createView(config); ms.map.setView(view); }; - + /** * Remove all layers from the map - * + * * @memberof mapService * @public * @alias removeAllLayers */ ms.removeAllLayers = function(){ genericMapService.removeAllLayers(ms.map); - + //Always add blank layer ms.addBlankLayer(); }; - + //Add layers /** * Create and add a blank base layer to the map - * + * * @memberof mapService * @public * @alias addBlankLayers */ ms.addBlankLayer = function(){ - var proj = ms.map.getView().getProjection(); + var proj = ms.map.getView().getProjection(); var layer = new ol.layer.Image({ type: 'mapbackground', opacity: 1, @@ -303,14 +303,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, imageSize: [256,256] }) }); - + ms.map.addLayer(layer); }; - + //create layer, returns ol.layer.* or undefined /** * Generic function to create all types of layers - * + * * @memberof mapService * @public * @alias createLayer @@ -349,14 +349,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return ( layer ); }; - + /** * Create OpenStreeMap layer - * + * * @memberof mapService * @public * @alias createOsm - * @param {Object} config - The layer configuration object + * @param {Object} config - The layer configuration object * @returns {ol.layer.Tile} The OSM layer */ ms.createOsm = function( config ){ @@ -366,7 +366,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Create OpenSeaMap layer - * + * * @memberof mapService * @public * @alias createOseam @@ -377,10 +377,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var layer = genericMapService.defineOseam(config); return (layer); }; - + /** * Create BING layers - * + * * @memberof mapService * @public * @alias createBing @@ -395,20 +395,20 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, //create WMS tile layer /** * Create WMS layers - * + * * @memberof mapService * @public * @alias createWms * @param {Object} config - The layer configuration object - * @returns {ol.layer.Tile} - The WMS layer + * @returns {ol.layer.Tile} - The WMS layer */ ms.createWms = function( config ){ var layer = genericMapService.defineWms(config); - layer.set('serverType', config.serverType); - + layer.set('serverType', config.serverType); + return ( layer ); }; - + //Map graticule ms.graticuleFormat = 'dms'; ms.mapGraticule = new ol.Graticule({ @@ -422,7 +422,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }); /** * Set mapGraticule in the current map according to a specified visibility status - * + * * @memberof mapService * @public * @alias setGraticule @@ -435,11 +435,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.mapGraticule.setMap(ms.map); } }; - + //Add alarms layer /** * Create alarms layer - * + * * @memberof mapService * @public * @alias createAlarmsLayer @@ -450,27 +450,27 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var attribution = new ol.Attribution({ html: locale.getString('spatial.alarms_copyright') }); - + var source = new ol.source.Vector({ attributions: [attribution], features: (new ol.format.GeoJSON()).readFeatures(config.geoJson) }); - + var layer = new ol.layer.Vector({ title: config.title, type: config.type, longAttribution: config.longAttribution, isBaseLayer: false, source: source, - style: ms.setAlarmsStyle + style: ms.setAlarmsStyle }); - + return( layer ); }; - + /** * Create fishing activities layer - * + * * @memberof mapService * @public * @alias createActivityLayer @@ -481,17 +481,17 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var attribution = new ol.Attribution({ html: locale.getString('spatial.activities_copyright') }); - + var features = (new ol.format.GeoJSON()).readFeatures(config.geoJson, { dataProjection: 'EPSG:4326', featureProjection: ms.getMapProjectionCode() }); - + var source = new ol.source.Vector({ attributions: [attribution], features: features }); - + var layer = new ol.layer.Vector({ title: config.title, type: config.type, @@ -500,13 +500,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, source: source, style: ms.setActivitiesStyle }); - + return( layer ); }; /** * Create VMS positions layer - * + * * @memberof mapService * @public * @alias createPositionsLayer @@ -518,28 +518,28 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, dataProjection: 'EPSG:4326', featureProjection: ms.getMapProjectionCode() }); - + var count = 0; angular.forEach(features, function(feature) { count += 1; feature.setId(count); feature.set('isVisible', true); }); - + var source = new ol.source.Vector({ - features: features + features: features }); - + var attribution = new ol.Attribution({ html: locale.getString('spatial.vms_positions_copyright') }); - + var cluster = new ol.source.Cluster({ attributions: [attribution], distance: 20, source: source }); - + cluster.on('change', function(e){ //hide popup if position is clustered if (angular.isDefined(ms.overlay)){ @@ -554,14 +554,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, visible = true; } }); - + if (!visible){ ms.closePopup(); } } } }); - + var layer = new ol.layer.Vector({ title: config.title, type: config.type, @@ -570,15 +570,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, source: cluster, style: ms.setClusterStyle }); - + ms.addClusterExploder(layer); - + return( layer ); }; - + /** * Zoom to the extent containing all VMS positions - * + * * @memberof mapService * @public * @alias zoomToPositionsLayer @@ -599,10 +599,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }); } }; - + /** * Create and add map interaction to explode the clusters (VMS positions) - * + * * @memberof mapService * @public * @alias addClusterExploder @@ -619,10 +619,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.map.addInteraction(exploder); }; - + /** * Collapse expanded clusters - * + * * @memberof mapService * @public */ @@ -632,10 +632,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, select.getFeatures().clear(); } }; - + /** * Create VMS segements layer - * + * * @memberof mapService * @public * @alias createSegmentsLayer @@ -646,7 +646,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var attribution = new ol.Attribution({ html: locale.getString('spatial.vms_segments_copyright') }); - + var layer = new ol.layer.Image({ title: config.title, type: config.type, @@ -663,14 +663,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, style: ms.setSegStyle }) }); - + return( layer ); }; - + //Clear vms data from layers /** * Clear vms data from vector layers (VMS positions and segments) - * + * * @memberof mapService * @public * @alias clearVmsLayers @@ -683,12 +683,12 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } } }; - + //MAPFISH PRINT //Add printing extent layer /** * Create and add map layer to show the printing extent supported by the mapfish print server - * + * * @memberof mapService * @public * @alias addPrintLayer @@ -705,24 +705,24 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.map.addLayer(layer); }; - + ms.mapPrintResolution = undefined; - + /** * Add print extent vector feature to the printing layer - * + * * @memberof mapService * @public * @alias addPrintExtent */ ms.addPrintExtent = function(){ ms.mapPrintResolution = ms.map.getView().getResolution(); - + var mapSize = ms.map.getSize(); var currentMapRatio = mapSize[0] / mapSize[1]; var scaleFactor = 0.9; var desiredPrintRatio = MapFish.printMapSize[0] / MapFish.printMapSize[1]; - + var targetWidth, targetHeight; if (desiredPrintRatio >= currentMapRatio){ targetWidth = mapSize[0] * scaleFactor; @@ -731,18 +731,18 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, targetHeight = mapSize[1] * scaleFactor; targetWidth = targetHeight * desiredPrintRatio; } - + var geomExtent = ms.map.getView().calculateExtent([targetWidth, targetHeight]); var printFeature = new ol.Feature(ol.geom.Polygon.fromExtent(geomExtent)); - + var layer = ms.getLayerByType('print').getSource(); layer.clear(true); layer.addFeature(printFeature); }; - + /** * Create and add a vector layer to display OSM Nominatim search results - * + * * @memberof mapService * @public * @alias addNominatimLayer @@ -757,15 +757,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }), style: ms.setNominatimStyle }); - + ms.map.addLayer(layer); - + return layer; }; - + /** * Create and add vector layer used to highlight vector features in the map - * + * * @memberof mapService * @public * @alias addFeatureOverlay @@ -785,7 +785,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Highlight feature in the map - * + * * @memberof mapService * @public * @alias highlightFeature @@ -800,10 +800,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, layer.clear(true); layer.addFeature(feature); }; - + /** * Create and add a vector layer for measurement controls - * + * * @memberof mapService * @public * @alias addMeasureLayer @@ -816,14 +816,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, style: ms.setMeasureStyle }); ms.map.addLayer(layer); - + return layer; }; - + //STYLES /** * Set print style - * + * * @memberof mapService * @public * @alias setPrintStyle @@ -840,14 +840,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, color: 'rgba(255, 255, 255, 0.3)' }) }); - + return [style]; }; - + //Highlight styles /** * Set the highlight style - * + * * @memberof mapService * @public * @alias setHighlightStyle @@ -874,7 +874,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, if (angular.isDefined(ms.styles.segments.style.lineWidth)){ width = parseInt(ms.styles.segments.style.lineWidth) + 6; } - + style = new ol.style.Style({ stroke: new ol.style.Stroke({ color: color, @@ -885,11 +885,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return [style]; }; - + //Measure styles /** * Set the measurement styles - * + * * @memberof mapService * @public * @alias setMeasureStyle @@ -901,7 +901,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var styles = []; var coords = feature.getGeometry().getCoordinates(); coords.shift(); - + var bufferLineStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(255, 255, 255, 0.8)', @@ -909,15 +909,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }) }); styles.push(bufferLineStyle); - + var lineStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(120, 120, 120, 1)', width: 2 - }) + }) }); styles.push(lineStyle); - + var pointStyle = new ol.style.Style({ image: new ol.style.Circle({ radius: 5, @@ -934,13 +934,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } }); styles.push(pointStyle); - + return styles; }; - + /** * Set the Nominatim styles - * + * * @memberof mapService * @public * @alias setNominatimStyle @@ -973,13 +973,18 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.styles = { positions: undefined, segments: undefined, - alarms: undefined + alarms: undefined, + activity: { strokeColor: '#ffffff', + strokeWidth: 2, + fillColor: '#078dbe', + fillOpacity: 0.3, + } }; - - + + /** * Calculate breaks for range classification on VMS data. Stores the breaks under each type style object - * + * * @memberof mapService * @public * @alias calculateBreaks @@ -991,7 +996,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, defaultColor: undefined, intervals: [] }; - + angular.forEach(style, function(value, key){ var gapNum = key.split('-'); var tempBreak = []; @@ -1008,39 +1013,39 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, breaks.intervals.push(tempBreak); } }); - + //Sort intervals if (breaks.intervals.length > 0){ breaks.intervals.sort(function(a,b){ return (a[0] < b[0]) ? -1 : 1; }); } - + if (type === 'positions'){ ms.styles.positions.breaks = breaks; } else { ms.styles.segments.breaks = breaks; } }; - + //COLORING BY ATTRIBUTES /** * Get color definition by Flag State - * + * * @memberof mapService * @public * @alias getColorByFlagState - * @param {Object} src - The source styles object containing all style definitions - * @param {String} fs - The countryCode of the desired Flag State - * @returns {String} The hexadecimal color code + * @param {Object} src - The source styles object containing all style definitions + * @param {String} fs - The countryCode of the desired Flag State + * @returns {String} The hexadecimal color code */ ms.getColorByFlagState = function(src, fs){ return src.style[fs.toUpperCase()]; }; - + /** * Set the displayed flag state codes in the styles object - * + * * @memberof mapService * @public * @alias setDisplayedFlagStateCodes @@ -1052,21 +1057,21 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, if (!angular.isDefined(src.displayedCodes)){ src.displayedCodes = []; } - + angular.forEach(data, function(item){ if (src.displayedCodes.indexOf(item.properties.countryCode) === -1){ src.displayedCodes.push(item.properties.countryCode); } }, src); }; - + /** - * Get color code for a specific value of a field that is classified by range - * + * Get color code for a specific value of a field that is classified by range + * * @memberof mapService * @public * @alias getColorByRange - * @param {Object} src - The source styles object containing all style definitions + * @param {Object} src - The source styles object containing all style definitions * @param {Number} value - The property value to match within an interval * @returns {String} The hexadecimal color code */ @@ -1079,17 +1084,17 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, break; } } - + if (angular.isDefined(color)){ return color; } else { return src.breaks.defaultColor; } }; - + /** * Get color code to style fields with discrete classification (such as MovementType, ActivityType, SegmentCategory) - * + * * @memberof mapService * @public * @alias getColorByStaticFields @@ -1104,10 +1109,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return src.style[type]; } }; - + /** * Set the styles object for VMS positions - * + * * @memberof mapService * @public * @alias setPositionStylesObj @@ -1115,16 +1120,16 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, */ ms.setPositionStylesObj = function(styles){ ms.styles.positions = styles; - + var rangeFields = ['reportedSpeed', 'reportedCourse', 'calculatedSpeed']; if (_.indexOf(rangeFields, ms.styles.positions.attribute) !== -1){ ms.calculateBreaks('positions', ms.styles.positions.style); } }; - + /** * Get color code for each VMS position according to the styles definitions of report/user preferences - * + * * @memberof mapService * @public * @alias getColorForPosition @@ -1153,10 +1158,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return 'rgba(0,0,0,0)'; } }; - + /** * Get color code for each VMS position according to the styles definitions of report/user preferences without depending on isVisible value. - * + * * @memberof mapService * @public * @alias getColorForPositionWithoutIsVisible @@ -1181,18 +1186,18 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return '#0066FF'; //default color } }; - + //OL VMS positions cluster style ms.clusterStyles = {}; ms.currentResolution = undefined; ms.clusterMaxFeatureCount = 1; ms.clusterMinFeatureCount = 100000; ms.vmsSources = {}; - + //Calculate necessary max and min amount of features of the available map clusters at each resolution /** * Calculate the maximum and minimum cluster sizes (number of features inside clusters) at the current map resolution - * + * * @memberof mapService * @public * @alias calculateClusterInfo @@ -1200,13 +1205,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.calculateClusterInfo = function(){ var layer = ms.getLayerByType('vmspos'); var features = layer.getSource().getFeatures(); - + angular.forEach(features, function(clusterFeat) { var includedPositions = clusterFeat.get('features'); clusterFeat.set('featNumber', includedPositions.length); ms.clusterMaxFeatureCount = Math.max(ms.clusterMaxFeatureCount, includedPositions.length); ms.clusterMinFeatureCount = Math.min(ms.clusterMinFeatureCount, includedPositions.length); - + var counter = 0; var displayedFeature; if (includedPositions.length > 1){ @@ -1217,22 +1222,22 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } }); } - + if (counter === 1){ clusterFeat.set('featureToDisplay', displayedFeature); } else { clusterFeat.set('featureToDisplay', undefined); } - + if (clusterFeat.get('featNumber') !== counter && clusterFeat.get('featNumber') > 1){ clusterFeat.set('featNumber', counter); } }); }; - + /** * Builds the name of the cluster style - * + * * @memberof mapService * @private * @returns {String} The style name to be cached @@ -1244,14 +1249,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, name += key; } }); - + name.replace(/\s/g, ''); return name; }; - + /** * Set the cluster styles - * + * * @memberof mapService * @public * @alias setClusterStyle @@ -1266,7 +1271,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } var size = feature.get('featNumber'); var inFeatures = feature.get('features'); - + var style; if (inFeatures.length === 1){ //caso de um cluster so com uma feature style = ms.setPosStyle(inFeatures[0]); @@ -1288,7 +1293,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } else if (ms.clusterMaxFeatureCount > 50 && ms.clusterMaxFeatureCount <= 100){ maxRadius = 20; } - + //Normalize radius to scale between maxRadius and minRadius var radius = Math.round((maxRadius - minRadius) * (Math.abs(feature.get('featNumber') - ms.clusterMinFeatureCount)) / (ms.clusterMaxFeatureCount - ms.clusterMinFeatureCount)); if (isNaN(radius) || !isFinite(radius) || radius < 0){ @@ -1296,18 +1301,18 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } radius += minRadius; feature.set('radius', radius); - + if (!angular.isDefined(size)){ var a = 'test'; } - + //Apply cluster style style = new ol.style.Style({ image: new ol.style.Circle({ radius: radius, stroke: new ol.style.Stroke({ color: '#F7580D', - width: 2 + width: 2 }), fill: new ol.style.Fill({ color: 'rgba(255, 255, 255, 0.7)', @@ -1323,19 +1328,19 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }) }) }); - + ms.clusterStyles[styleName] = style; } } } - + return [style]; }; - + //Set style for positons when cluster is expanded /** * Set the style for unclustered style - * + * * @memberof mapService * @public * @alias setUnclusteredStyle @@ -1346,16 +1351,16 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var positions = feature.get('features'); if (positions.length > 1){ var centerCoords = feature.getGeometry().getCoordinates(); - + var mapExtent = ms.map.getView().calculateExtent(ms.map.getSize()); var mapSize = Math.min(ol.extent.getWidth(mapExtent), ol.extent.getHeight(mapExtent)); - - + + var items = positions.length; if (positions.length !== feature.get('featNumber')){ items = feature.get('featNumber'); } - + var radius = mapSize / 10; if (items > 20){ radius = items * radius / 20; @@ -1363,15 +1368,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, radius = mapSize / 2.5; } } - + var circle = new ol.geom.Circle(centerCoords, radius); var circlePoly = ol.geom.Polygon.fromCircle(circle); circlePoly.transform(ms.getMapProjectionCode(), 'EPSG:4326'); - + var line = turf.linestring(circlePoly.getCoordinates()[0]); - + var length = turf.lineDistance(line, 'radians') / items; - + var styles = []; var j = 0; for (var i = 0; i < positions.length; i++){ @@ -1383,17 +1388,17 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, j += 1; } } - + return _.flatten(styles); } else { return [ms.setPosStyle(positions[0])]; } - + }; - + /** * Set the spider style for unclustered data - * + * * @memberof mapService * @public * @alias setSpiderStyle @@ -1417,7 +1422,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return new ol.geom.Point(pointCoords); } }); - + var lineStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(120, 120, 120, 0.7)', @@ -1427,13 +1432,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return new ol.geom.LineString([pointCoords, feature.getGeometry().getCoordinates()]); } }); - + var centerStyle = new ol.style.Style({ image: new ol.style.Circle({ radius: 5, fill: new ol.style.Fill({ color: 'rgba(255, 255, 255, 0.7)', - + }), stroke: new ol.style.Stroke({ color: '#F7580D', @@ -1444,13 +1449,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } }) }); - + return [pointStyle, lineStyle, centerStyle]; }; - + /** * Set the style for VMS positions - * + * * @memberof mapService * @public * @alias setPosStyle @@ -1477,13 +1482,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } } }); - + return style; }; - + /** * Set the styles object for VMS segments - * + * * @memberof mapService * @public * @alias setSegmentStylesObj @@ -1491,16 +1496,16 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, */ ms.setSegmentStylesObj = function(styles){ ms.styles.segments = styles; - + var rangeFields = ['speedOverGround', 'distance', 'courseOverGround']; if (_.indexOf(rangeFields, ms.styles.segments.attribute) !== -1){ ms.calculateBreaks('segments', ms.styles.segments.style); } }; - + /** * Get color code for each VMS segment according to the styles definitions of report/user preferences - * + * * @memberof mapService * @public * @alias getColorForSegment @@ -1523,7 +1528,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return '#0066FF'; //default color } }; - + // ms.calculateJenkinsIntervals = function(geoJson){ // var breaks = turf.jenks(geoJson, 'speedOverGround', 4); // if (breaks !== null){ @@ -1531,7 +1536,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, // ms.styles.speedBreaks[4] = ms.styles.speedBreaks[4] + 1; // } // }; -// +// // ms.getColorBySpeed = function(speed){ // for (var i = 1; i < ms.styles.speedBreaks.length; i++){ // if (speed >= ms.styles.speedBreaks[i-1] && speed < ms.styles.speedBreaks[i]){ @@ -1540,10 +1545,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, // } // } // }; - + /** * Set the style of VMS segments - * + * * @memberof mapService * @public * @alias setSegStyle @@ -1554,12 +1559,12 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.setSegStyle = function(feature, resolution){ var geometry = feature.getGeometry(); var color = ms.getColorForSegment(feature); - + var width = 2; if (angular.isDefined(ms.styles.segments.style.lineWidth)){ width = parseInt(ms.styles.segments.style.lineWidth); } - + var lineDash = null; if (angular.isDefined(ms.styles.segments.style.lineStyle)){ switch (ms.styles.segments.style.lineStyle) { @@ -1577,12 +1582,12 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, break; } } - + var fontSize = 10; if (width > 2){ fontSize = Math.round((width - 2) * 2.5 + 10); } - + var style; if (feature.getGeometry().getLength() > 0){ style = [ @@ -1620,10 +1625,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return style; }; - + /** * Set the styles object for VMS alarms - * + * * @memberof mapService * @public * @alias setAlarmsStylesObj @@ -1632,10 +1637,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.setAlarmsStylesObj = function(styles){ ms.styles.alarms = styles; }; - + /** * Get color code by alarm status - * + * * @memberof mapService * @public * @alias getColorByStatus @@ -1646,10 +1651,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.getColorByStatus = function(src, status){ return src[status.toLowerCase()]; }; - + /** * Set the style for the alarms layer - * + * * @memberof mapService * @public * @alias setAlarmsStyle @@ -1670,13 +1675,22 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }) }) }); - + return [style]; }; - + + ms.setActivityStylesObj = function(styles){ + ms.styles.activities = { + strokeColor: '#ffffff', + strokeWidth: 2, + fillColor: '#078dbe', + fillOpacity: 0.3, + }; + }; + /** * Set the style for the fishing activities layer - * + * * @memberof mapService * @public * @alias setActivitiesStyle @@ -1697,10 +1711,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }) }) }); - + return [style]; }; - + //Buffering vector data /*ms.addVmsSelectCtrl = function(type){ //TODO Check if interaction is there @@ -1710,7 +1724,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, layers: [layer], condition: ol.events.condition.click }); - + ms.map.addInteraction(sel); } };*/ @@ -1719,19 +1733,19 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Clear and remove all vector layers from the map as well as reseting the cluster styles. * This function is used before running a new report. - * + * * @memberof mapService * @public * @alias clearVectorLayers */ ms.clearVectorLayers = function(){ - var layers = [ms.getLayerByType('highlight'), ms.getLayerByType('vmspos'), ms.getLayerByType('vmsseg'), ms.getLayerByType('alarms')]; + var layers = [ms.getLayerByType('highlight'), ms.getLayerByType('vmspos'), ms.getLayerByType('vmsseg'), ms.getLayerByType('alarms'),ms.getLayerByType('ers')]; for (var i = 0; i < layers.length; i++){ if (angular.isDefined(layers[i])){ ms.map.removeLayer(layers[i]); } } - + //Clear the cluster styles applied to vms positions ms.clusterStyles = {}; ms.currentResolution = undefined; @@ -1745,7 +1759,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Get the first layer with the specified title - * + * * @memberof mapService * @public * @alias getLayerByTitle @@ -1758,20 +1772,20 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Get the first layer with the specified type - * + * * @memberof mapService * @public - * @alias getLayerByType + * @alias getLayerByType * @param {String} type - The type of the layer to find * @returns {ol.layer} The OL layer */ ms.getLayerByType = function(type){ return genericMapService.getLayerByType(type, ms.map); }; - + /** * Calculates the numeric scale of the current view of the map - * + * * @memberof mapService * @public * @alias getCurrentScale @@ -1783,7 +1797,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Gets the base projection of the map - * + * * @memberof mapService * @public * @alias getMapProjectionCode @@ -1795,7 +1809,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Force a recalculation of the map viewport size - * + * * @memberof mapService * @public * @alias updateMapSize @@ -1804,40 +1818,40 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.updateMapSize = function(){ genericMapService.updateMapSize(ms.map); }; - + /** * Update map div container size - * + * * @memberof mapService * @public * @alias updateMapContainerSize * @param {Event} evt */ ms.updateMapContainerSize = function(evt) { - + setTimeout(function() { var w = angular.element(window); if(evt && (angular.element('.mapPanelContainer.fullscreen').length > 0 || (angular.element('.mapPanelContainer.fullscreen').length === 0 && evt.type.toUpperCase().indexOf("FULLSCREENCHANGE") !== -1))){ - - + + $('.map-container').css('height', w.height() + 'px'); $('#map').css('height', w.height() + 'px'); ms.updateMapSize(); return; } - + var minHeight = 400; var headerHeight = angular.element('header')[0].offsetHeight; var newHeight = w.height() - headerHeight; - + if (newHeight < minHeight) { newHeight = minHeight; } - + $('.map-container').css('height', newHeight); $('#map').css('height', newHeight + 'px'); - + ms.updateMapSize(); }, 100); }; @@ -1845,7 +1859,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, //GENERIC FUNCTIONS FOR CONTROLS AND STYLES /** * Convert degrees to radians - * + * * @memberof mapService * @public * @alias degToRad @@ -1863,31 +1877,31 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Calculates the middle point between the first and last coordinate of a geometry. * To be used with linestring geometries representing segments. - * + * * @memberof mapService * @public * @alias getMiddlePoint - * @param {ol.geom.Geometry} geometry - The OL geometry + * @param {ol.geom.Geometry} geometry - The OL geometry * @returns {ol.Coordinate} The coordinates of the middle point */ ms.getMiddlePoint = function(geometry){ var sourceProj = ms.getMapProjectionCode(); var p1 = ms.pointCoordsToTurf(ol.proj.transform(geometry.getFirstCoordinate(), sourceProj, 'EPSG:4326')); var p2 = ms.pointCoordsToTurf(ol.proj.transform(geometry.getLastCoordinate(), sourceProj, 'EPSG:4326')); - + var middlePoint = ms.turfToOlGeom(turf.midpoint(p1, p2)); - + return geometry.getClosestPoint(middlePoint.getCoordinates()); }; /** * Calculate the rotation of the arrows added in the segments symbology. Rotation is calculated taking into consideration * the linestring geometry direction - * + * * @memberof mapService * @public * @alias getRotationForArrow - * @param {ol.geom.Geometry} geometry - The OL geometry + * @param {ol.geom.Geometry} geometry - The OL geometry * @returns {Number} The rotation */ ms.getRotationForArrow = function(geometry){ @@ -1903,7 +1917,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, //SETTERS /** * Set map projection - * + * * @memberof mapService * @public * @alias setProjection @@ -1918,7 +1932,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.addedControls = []; //quick reference to added controls /** * Set the controls in the map - * + * * @memberof mapService * @public * @alias setControls @@ -1942,11 +1956,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return [new ol.Collection(ms.controls), new ol.Collection(ms.interactions)]; }; - + //Update map controls according to configuration from server /** * Update all map controls using configurations from report/user preferences. - * + * * @memberof mapService * @public * @alias setControls @@ -1955,7 +1969,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.updateMapControls = function(controls){ var tempControls = []; var mousecoordsCtrl, scaleCtrl; - + angular.forEach(controls, function(ctrl){ tempControls.push(ctrl.type); if (ctrl.type === 'mousecoords'){ @@ -1965,11 +1979,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, scaleCtrl = ctrl; } }); - + var ctrlsToRemove = _.difference(ms.addedControls, tempControls); var ctrlsToAdd = _.difference(tempControls, ms.addedControls); var ctrlsToUpdate = _.intersection(ms.addedControls, tempControls); - + //Remove controls and interactions if (ctrlsToRemove.length > 0){ angular.forEach(ctrlsToRemove, function(ctrl){ @@ -1977,7 +1991,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms[fnName](); }, ms); } - + //Update controls if (ctrlsToUpdate.length > 0){ angular.forEach(ctrlsToUpdate, function(ctrl){ @@ -1988,14 +2002,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } else if (ctrl === 'scale'){ config = scaleCtrl; } - + if (angular.isDefined(config)){ var fnName = 'update' + ctrl.charAt(0).toUpperCase() + ctrl.slice(1); ms[fnName](config); } }, ms); } - + //Add controls if (ctrlsToAdd.length > 0){ angular.forEach(ctrlsToAdd, function(ctrl){ @@ -2006,15 +2020,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } else if (ctrl === 'scale'){ config = scaleCtrl; } - + var fnName = 'add' + ctrl.charAt(0).toUpperCase() + ctrl.slice(1); ms[fnName](config, false); }, ms); } - + ms.addedControls = _.union(ctrlsToAdd, ctrlsToUpdate); }; - + /** * Get list of controls by type * @@ -2027,7 +2041,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.getControlsByType = function(type){ return genericMapService.getControlsByType(type, ms.map); }; - + /** * Get list of interactions by type * @@ -2040,7 +2054,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.getInteractionsByType = function(type){ return genericMapService.getInteractionsByType(type, ms.map); }; - + //Get custom interactions by type /** * @memberof mapService @@ -2055,13 +2069,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var ints = interactions.filter(function(int){ return int instanceof ol.interaction[olType] === true && int instanceof ms[type]; }); - + return ints; }; /** * Add zoom controls and interactions to the map - * + * * @memberof mapService * @public * @alias addZoom @@ -2070,16 +2084,16 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, */ ms.addZoom = function(ctrl, initial){ var olCtrl = genericMapService.createZoomCtrl('ol-zoom-liveview'); - + var iconSpan = document.createElement('span'); iconSpan.className = 'fa fa-globe'; var fullExtent = new ol.control.ZoomToExtent({ label: iconSpan, tipLabel: locale.getString('spatial.map_tip_full_extent') }); - + var interactions = genericMapService.createZoomInteractions(); - + if (initial){ ms.controls.push(olCtrl); ms.controls.push(fullExtent); @@ -2089,13 +2103,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.map.addControl(fullExtent); for (var i = 0; i < interactions.length; i++){ ms.map.addInteraction(interactions[i]); - } + } } }; - + /** * Remove all zoom controls and interactions from map - * + * * @memberof mapService * @public * @alias removeZoom @@ -2112,10 +2126,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } ms.map.removeInteraction(ms.getInteractionsByType('PinchZoom')[0]); }; - + /** * Creates and adds the navigation history control to the map - * + * * @memberof mapService * @public * @alias addHistory @@ -2127,17 +2141,17 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, backLabel: locale.getString('spatial.map_tip_go_back'), forwardLabel: locale.getString('spatial.map_tip_go_forward') }); - + if (initial){ ms.controls.push(olCtrl); } else { ms.map.addControl(olCtrl); } }; - + /** * Removes the navigation history control from the map - * + * * @memberof mapService * @public * @alias removeHistory @@ -2145,10 +2159,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.removeHistory = function(){ ms.map.removeControl(ms.getControlsByType('HistoryControl')[0]); }; - + /** * Creates and adds the scale control to the map - * + * * @memberof mapService * @public * @alias addHistory @@ -2157,18 +2171,18 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, */ ms.addScale = function(ctrl, initial){ var olCtrl = genericMapService.addScale(ctrl); - + if (initial){ ms.controls.push(olCtrl); } else { ms.map.addControl(olCtrl); } }; - - + + /** * Updates the scale control of the map - * + * * @memberof mapService * @public * @alias updateScale @@ -2178,10 +2192,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.map.removeControl(ms.getControlsByType('ScaleLine')[0]); ms.addScale(config, false); }; - + /** * Removes the scale control from the map - * + * * @memberof mapService * @public * @alias removeScale @@ -2189,10 +2203,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.removeScale = function(){ ms.map.removeControl(ms.getControlsByType('ScaleLine')[0]); }; - + /** * Creates and adds all drag related interactions to the map - * + * * @memberof mapService * @public * @alias addDrag @@ -2208,12 +2222,12 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.map.addInteraction(interactions[i]); } } - + }; - + /** * Removes all drag related interactions from the map - * + * * @memberof mapService * @public * @alias removeDrag @@ -2222,10 +2236,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.map.removeInteraction(ms.getInteractionsByType('DragPan')[0]); ms.map.removeInteraction(ms.getInteractionsByType('KeyboardPan')[0]); }; - + /** * Create and add Mouse Coordinates control to the map - * + * * @memberof mapService * @public * @alias addMousecoords @@ -2234,17 +2248,17 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, */ ms.addMousecoords = function(ctrl, initial){ var olCtrl = genericMapService.addMousecoords(ctrl, 'map-coordinates'); - + if (initial){ ms.controls.push(olCtrl); } else { ms.map.addControl(olCtrl); } }; - + /** * Updates the mouse coordinates control of the map - * + * * @memberof mapService * @public * @alias updateMousecoords @@ -2254,10 +2268,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.map.removeControl(ms.getControlsByType('MousePosition')[0]); ms.addMousecoords(config, false); }; - + /** * Removes the mouse coordinates control from the map - * + * * @memberof mapService * @public * @alias removeMousecoords @@ -2268,12 +2282,12 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Zoom to a specified geometry - * + * * @memberof mapService * @public * @alias zoomTo * @param {ol.geom.Geometry} geom - The OL geometry to zoom to - * @param {Boolean} nearest - Zoom to nearest zoom level possible. Default is false + * @param {Boolean} nearest - Zoom to nearest zoom level possible. Default is false */ ms.zoomTo = function(geom, nearest){ var opt = { @@ -2288,7 +2302,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Pan map to specified coordinates - * + * * @memberof mapService * @public * @alias panTo @@ -2297,10 +2311,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.panTo = function(coords){ ms.map.getView().setCenter(coords); }; - + /** * Add drag interaction for the print extent feature - * + * * @memberof mapService * @public * @alias addDragPrintExtent @@ -2309,11 +2323,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var ctrl = new ms.dragExtent(); ms.map.addInteraction(ctrl); }; - + //Custum drag interaction for print extent /** * Creates the custom drag print extent interaction - * + * * @memberof mapService * @public * @alias dragExtent @@ -2325,14 +2339,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, handleMoveEvent: ms.dragExtent.prototype.handleMoveEvent, handleUpEvent: ms.dragExtent.prototype.handleUpEvent }); - + this._coordinate = null; this._feature = null; this._cursor = 'pointer'; this._previousCursor = 'default'; }; ol.inherits(ms.dragExtent, ol.interaction.Pointer); - + ms.dragExtent.prototype.handleDownEvent = function(evt){ var map = evt.map; var feature = map.forEachFeatureAtPixel(evt.pixel, function(feature, layer){ @@ -2343,15 +2357,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }, this, function(layer){ return layer.get('type') === 'print'; }); - + if (feature){ this._coordinate = evt.coordinate; this._feature = feature; } - + return !!feature; }; - + ms.dragExtent.prototype.handleDragEvent = function(evt){ var deltaX = evt.coordinate[0] - this._coordinate[0]; var deltaY = evt.coordinate[1] - this._coordinate[1]; @@ -2362,7 +2376,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, this._coordinate[0] = evt.coordinate[0]; this._coordinate[1] = evt.coordinate[1]; }; - + ms.dragExtent.prototype.handleMoveEvent = function(evt){ if (this._cursor) { var map = evt.map; @@ -2384,18 +2398,18 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } } }; - + ms.dragExtent.prototype.handleUpEvent = function(evt){ this._coordinate = null; this._feature = null; return false; }; - + //Measuring interaction ms.measureInteraction = {}; /** * Add measure control and start it automatically - * + * * @memberof mapService * @public * @alias startMeasureControl @@ -2433,18 +2447,18 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }) }) }); - + ms.map.addInteraction(draw); ms.registerDrawEvents(draw, layer); ms.measureInteraction = draw; }; - + ms.measurePointsLength = 0; ms.measureOverlays = []; ms.measureETA = undefined; /** * Register all draw events for the measure control - * + * * @memberof mapService * @public * @alias registerDrawEvents @@ -2455,13 +2469,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, //Clear any vector features previous drawn layer.getSource().clear(); ms.clearMeasureOverlays(); - + //Disable user input on config window ms.sp.measure.disabled = true; - + var feature = evt.feature; - ms.measurePointsLength = feature.getGeometry().getCoordinates().length - 1; - + ms.measurePointsLength = feature.getGeometry().getCoordinates().length - 1; + listener = feature.getGeometry().on('change', function(evt){ var coords = evt.target.getCoordinates(); if (coords.length !== ms.measurePointsLength + 1){ @@ -2473,7 +2487,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } }); }); - + draw.on('drawend', function(evt){ ms.measurePointsLength = 0; ms.sp.measure.disabled = false; @@ -2485,10 +2499,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.measureETA = undefined; }); }; - + /** * Calculate length over the sphere, bearing and ETA of the measures drawn - * + * * @memberof mapService * @public * @alias calculateLengthAndBearingAndETA @@ -2498,7 +2512,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.calculateLengthAndBearingAndETA = function(line){ var coords = line.getCoordinates(); var sourceProj = ms.getMapProjectionCode(); - + //Calculate distance if (coords.length > 2){ var c1 = ms.pointCoordsToTurf(ol.proj.transform(coords[coords.length - 3], sourceProj, 'EPSG:4326')); @@ -2509,15 +2523,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, units = 'miles'; displayUnits = 'mi'; } - + var distance = turf.distance(c1, c2, units); var bearing = turf.bearing(c1, c2); - + //Calculate ETA if(angular.isDefined(ms.sp.measure.speed) && angular.isDefined(ms.sp.measure.startDate) && ms.sp.measure.speed !== null && ms.sp.measure.speed > 0){ //Convert knots to kmh var avgSpeed = ms.sp.measure.speed * 1.852; - + //Make sure we use distance in km var distanceForETA; if (displayUnits === 'mi'){ @@ -2525,54 +2539,54 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } else { distanceForETA = distance; } - + //Calculate necessary time for the specified distance var timeSpent = distanceForETA / avgSpeed; //in hours - + if (!angular.isDefined(ms.measureETA)){ ms.measureETA = moment.utc(ms.sp.measure.startDate, 'YYYY-MM-DD HH:mm:ss Z'); } ms.measureETA.add(timeSpent, 'hours'); } - - + + if (ms.sp.measure.units === 'nm'){ displayUnits = 'nm'; distance = distance * 1000 / 1852; } - + if (distance < 1 && displayUnits === 'km'){ distance = distance * 1000; displayUnits = 'm'; } - + if (bearing < 0){ bearing = bearing + 360; } - + distance = Math.round(distance * 100) / 100; //2 decimals bearing = Math.round(bearing * 100) / 100; //2 decimals - - + + var response = { distance: distance, - dist_units: displayUnits, + dist_units: displayUnits, bearing: bearing, bearing_units: '\u00b0', anchorPosition: coords[coords.length - 2] }; - + if (angular.isDefined(ms.measureETA)){ response.eta = ms.measureETA.format(globalSettingsService.getDateFormat()); } - + return response; } }; - + /** * Create the measure tooltips - * + * * @memberof mapService * @public * @alias createMeasureTooltip @@ -2581,14 +2595,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.createMeasureTooltip = function(data){ var el = document.createElement('div'); el.className = 'map-tooltip map-tooltip-small'; - + data.dist_title = locale.getString('spatial.map_measure_distance_title'); data.bearing_title = locale.getString('spatial.map_measure_bearing_title'); if (angular.isDefined(data.eta)){ data.eta_title = locale.getString('spatial.map_measure_eta_title'); el.className = 'map-tooltip map-tooltip-large'; } - + var templateURL = 'partial/spatial/templates/measure_tooltip.html'; $templateRequest(templateURL).then(function(template){ var rendered = Mustache.render(template, data); @@ -2596,7 +2610,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }, function(){ console.log('error fetching template'); }); - + var offset = []; if (data.bearing >= 0 && data.bearing <= 90){ offset = [-135, -45]; @@ -2616,21 +2630,21 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, offset = [-163, 6]; } } - + var tooltip = new ol.Overlay({ element: el, offset: offset, insertFirst: false }); - + ms.map.addOverlay(tooltip); tooltip.setPosition(data.anchorPosition); ms.measureOverlays.push(tooltip); }; - + /** * Remove all measure tooltip overlays - * + * * @memberof mapService * @public * @alias clearMeasureOverlays @@ -2641,10 +2655,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } ms.measureOverlays = []; }; - + /** * Clear the measure control by removing it from the map and destroying all tooltip overlyas - * + * * @memberof mapService * @public * @alias clearMeasureControl @@ -2655,10 +2669,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.map.removeLayer(ms.getLayerByType('measure-vector')); ms.measureInteraction = {}; }; - + /** * Convert point coordinates to GeoJSON so that they can be used in Turf - * + * * @memberof mapService * @public * @alias pointCoordsToTurf @@ -2669,10 +2683,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var geom = new ol.geom.Point(coords); return genericMapService.geomToGeoJson(geom); }; - + /** * Convert GeoJSON to OL feature - * + * * @memberof mapService * @public * @alias turfToOlGeom @@ -2683,54 +2697,70 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var geom = genericMapService.geoJsonToOlGeom(feature); return geom.transform('EPSG:4326', ms.getMapProjectionCode()); }; - + //VECTOR LABELS //label visibility settings object ms.labelVisibility = { positions: ['fs', 'extMark', 'ircs', 'cfr', 'name', 'posTime', 'lat', 'lon', 'stat', 'm_spd', 'c_spd', 'crs', 'msg_tp', 'act_tp', 'source'], + positionsNames: ['fs', 'extMark', 'ircs', 'cfr', 'name', 'posTime', 'lat', 'lon', 'stat', 'm_spd', 'c_spd', 'crs', 'msg_tp', 'act_tp', 'source'], positionsTitles: true, segments: ['fs', 'extMark', 'ircs', 'cfr', 'name', 'dist', 'dur', 'spd', 'crs', 'cat'], + segmentsNames: ['fs', 'extMark', 'ircs', 'cfr', 'name', 'dist', 'dur', 'spd', 'crs', 'cat'], segmentsTitles: true, activities: ['fs', 'ext_mark', 'ircs', 'cfr', 'gfcm', 'iccat', 'uvi', 'name', 'source', 'activityType', 'reportType', 'purposeCode', 'occurrence', 'areas', 'gears', 'species'], activitiesTitles: true }; - + /** * Set labels visibility according to the user configurations - * + * * @memberof mapService * @public * @alias setLabelVisibility * @param {String} type - The label type (either positions or segments) - * @param {Object} config - The label configuration object + * @param {Object} config - The label configuration object */ ms.setLabelVisibility = function(type, config){ ms.labelVisibility[type] = config.values; ms.labelVisibility[type + 'Titles'] = angular.isDefined(config.isAttributeVisible) ? config.isAttributeVisible : false; + ms.labelVisibility[type + 'ReplacementTitles'] = undefined; + + if(angular.isDefined(config.titles) && config.titles.length > 0){ + var replacements = {}; + angular.forEach(config.titles,function(item){ + var key = item.code; + replacements[key] = item.title; + }); + ms.labelVisibility[type + 'ReplacementTitles'] = replacements; + } + + if(type !== 'activities'){ + ms.labelVisibility[type + 'Names'] = angular.isDefined(config.names) ? config.names : []; + } if (!angular.isDefined(ms.labelVisibility[type])){ ms.labelVisibility[type] = []; } }; - + //Container for displayed label overlays ms.vmsposLabels = { active: false, displayedIds: [] }; - + ms.vmssegLabels = { active: false, displayedIds: [] }; - + ms.ersLabels = { active: false, displayedIds: [] }; - + /** * Reset all label container objects - * + * * @memberof mapService * @public * @alias resetLabelContainers @@ -2740,22 +2770,22 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, active: false, displayedIds: [] }; - + ms.vmssegLabels = { active: false, displayedIds: [] }; - + ms.ersLabels = { active: false, displayedIds: [] }; }; - - + + /** * Check label status and activate them if necessary - * + * * @memberof mapService * @public * @alias checkLabelStatus @@ -2765,39 +2795,39 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, if (ms.vmsposLabels.active === true){ ms.activateVectorLabels('vmspos'); } - + if (ms.vmssegLabels.active === true){ ms.activateVectorLabels('vmsseg'); } - + if (ms.ersLabels.active === true){ ms.activateVectorLabels('ers'); } }; - + //Activate Vector Label Overlays /** * Activate vector labels - * + * * @memberof mapService * @public * @alias activateVectorLabels * @param {String} type - The type of labels to be activated (either positions or segments) */ ms.activateVectorLabels = function(type){ - if ((type === 'vmspos' && ms.labelVisibility.positions.length > 0) || + if ((type === 'vmspos' && ms.labelVisibility.positions.length > 0) || (type === 'vmsseg' && ms.labelVisibility.segments.length > 0) || (type === 'ers' && ms.labelVisibility.activities.length > 0)){ - var containerName = type + 'Labels'; + var containerName = type + 'Labels'; ms[containerName].active = true; ms[containerName].displayedIds = []; - + var layer = ms.getLayerByType(type); - + var extent = ms.map.getView().calculateExtent(ms.map.getSize()); var size = Math.min.apply(Math, ol.extent.getSize(extent)); //var resolution = ms.map.getView().getResolution(); - + var src = layer.getSource(); if (type === 'vmsseg'){ src = src.getSource(); @@ -2811,11 +2841,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, if (containedFeatures.length === 1){ feat = containedFeatures[0]; } - + if (feature.get('featNumber') === 1 && containedFeatures.length > 1){ feat = feature.get('featureToDisplay'); } - + if (angular.isDefined(feat) && feat.get('isVisible')){ overlayId = feat.get('overlayId'); if (!angular.isDefined(overlayId)){ @@ -2858,15 +2888,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } } }); - + //Finally we remove overlays that are no longer visible ms.removeLabelsByMapChange(type); } }; - + /** * Remove labels when map changes (by zooming or panning) - * + * * @memberof mapService * @public * @alias removeLabelsByMapChange @@ -2877,7 +2907,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var containerName = type + 'Labels'; var existingKeys = _.keys(ms[containerName]); existingKeys = _.without(existingKeys, 'active', 'displayedIds'); - + var diff = _.difference(existingKeys, ms[containerName].displayedIds); angular.forEach(diff, function(key){ var hidden = this[key].feature.get('overlayHidden'); @@ -2889,10 +2919,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } }, ms[containerName]); }; - + /** * Remove labels when map changes (by zooming or panning) - * + * * @memberof mapService * @public * @alias deactivateVectorLabels @@ -2902,7 +2932,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.deactivateVectorLabels = function(type){ var containerName = type + 'Labels'; var keys = _.keys(ms[containerName]); - keys = _.without(keys, 'active', 'displayedIds'); + keys = _.without(keys, 'active', 'displayedIds'); if (angular.isDefined(keys) && angular.isDefined(ms.map)){ angular.forEach(keys, function(key) { @@ -2915,15 +2945,15 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms[containerName].active = false; } }; - + /** * Add label overlay - * + * * @memberof mapService * @public * @alias addLabelsOverlay * @param {ol.Feature} feature - The OL feature object that will be labeled - * @param {String} type - The type of label (either vmspos or vmsseg) + * @param {String} type - The type of label (either vmspos or vmsseg) * @param {String} overlayId - The GUID of the overlay */ ms.addLabelsOverlay = function(feature, type, overlayId){ @@ -2935,37 +2965,37 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } else { coords = ms.getMiddlePoint(feature.getGeometry()); } - + var containerName = type + 'Labels'; - + //HTML DOM var labelEl = document.createElement('div'); labelEl.className = 'col-md-12 vector-label vector-label-' + type; - + var toolsEl = document.createElement('div'); - + var closeBtn = document.createElement('span'); closeBtn.className = 'fa fa-times close-icon pull-right'; closeBtn.addEventListener('click', closeLabelOverlay(containerName, overlayId), false); - + toolsEl.appendChild(closeBtn); labelEl.appendChild(toolsEl); - + var contentEl = document.createElement('div'); contentEl.className = 'col-md-12 label-content'; labelEl.appendChild(contentEl); - + //Mustache var data = ms.setLabelObj(feature, type); ms.requestLabelTemplate(type, data, contentEl); - + var overlay = new ol.Overlay({ element: labelEl, autoPan: false, position: coords, positioning: 'top-left' }); - + ms.map.addOverlay(overlay); ms[containerName][overlayId] = { feature: feature, @@ -2974,10 +3004,31 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, feature.set('overlayId', overlayId); feature.set('overlayHidden', false); }; - + + ms.getLabelAttrName = function(titles,replacementTitles,type,index){ + var name = ms.labelVisibility[type][index]; + var found = false; + for(var i =0; i < ms.labelVisibility[type+'Names'].length; i++){ + if(name === ms.labelVisibility[type+'Names'][i]){ + found = true; + break; + } + } + if(found) { + var title ; + if(angular.isDefined(replacementTitles)){ + title = replacementTitles[name]; + } + if(!angular.isDefined(title)){ + title = titles[name]; + } + return title; + } + return ''; + }; /** * Build the label object that will be used with Mustache - * + * * @memberof mapService * @public * @alias setLabelObj @@ -2987,16 +3038,17 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, * @returns {Object} The object containing all the necessary data for the label */ ms.setLabelObj = function(feature, type, id){ - var titles, srcData, showTitles, i; + var titles, replacementTitles, srcData, showTitles, i; var data = []; if (type === 'vmspos'){ - showTitles = ms.labelVisibility.positionsTitles; + showTitles = ms.labelVisibility.positionsNames.length > 0; titles = ms.getPositionTitles(); + replacementTitles = ms.labelVisibility.positionsReplacementTitles; srcData = ms.formatPositionDataForPopup(feature.getProperties()); - + for (i = 0; i < ms.labelVisibility.positions.length; i++){ data.push({ - title: titles[ms.labelVisibility.positions[i]], + title: ms.getLabelAttrName(titles,replacementTitles,'positions',i), value: srcData[ms.labelVisibility.positions[i]] }); } @@ -3004,7 +3056,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, showTitles = ms.labelVisibility.activitiesTitles; titles = ms.getActivityTitles(); srcData = ms.formatActivityDataForPopup(feature.getProperties()); - + for (i = 0; i < ms.labelVisibility.activities.length; i++){ data.push({ title: titles[ms.labelVisibility.activities[i]], @@ -3012,23 +3064,27 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }); } } else { - showTitles = ms.labelVisibility.segmentsTitles; + showTitles = ms.labelVisibility.segmentsNames.length > 0; + replacementTitles = ms.labelVisibility.segmentsReplacementTitles; titles = ms.getSegmentTitles(); srcData = ms.formatSegmentDataForPopup(feature.getProperties()); - + for (i = 0; i < ms.labelVisibility.segments.length; i++){ data.push({ - title: titles[ms.labelVisibility.segments[i]], + title: ms.getLabelAttrName(titles,replacementTitles,'segments',i), value: srcData[ms.labelVisibility.segments[i]] }); } } - + if (data.length > 0){ return { id: id, data: data, includeTitles: showTitles, + includeTitle: function(){ + return this.title !== ''; + }, getTitle: function(){ return this.title; }, @@ -3038,10 +3094,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, }; } }; - + /** * Request label template and render it using Mustache - * + * * @memberof mapService * @public * @alias requestLabelTemplate @@ -3058,10 +3114,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, console.log('error getting template'); }); }; - + /** * Close a single label overlay by id - * + * * @memberof mapService * @private * @param {String} container - The label container name @@ -3078,10 +3134,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } }; }; - + /** * Generate an overlay id (GUID) - * + * * @memberof mapService * @public * @alias generateOverlayId @@ -3090,20 +3146,20 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, */ ms.generateOverlayId = function(container){ var id = generateGUID(); - + if (_.has(container, id) === true){ ms.generateOverlayId(container); } else { return id; } }; - + /** * Generate random GUID - * + * * @memberof mapService * @public - * @returns {String} The generated GUID + * @returns {String} The generated GUID */ var generateGUID = function(){ function s4() { @@ -3113,12 +3169,12 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); }; - + //POPUPS //Render popup info using mustache /** * Request popup template and render it using Mustache - * + * * @memberof mapService * @public * @alias requestPopupTemplate @@ -3129,11 +3185,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, */ ms.requestPopupTemplate = function(data, type, coords, fromCluster){ ms.popupRecContainer.currentType = type; - + if (type === 'ers'){ ms.popupRecContainer.activityType = data.activityType; } - + var templateURL = 'partial/spatial/templates/' + type + '.html'; $templateRequest(templateURL).then(function(template){ var rendered = Mustache.render(template, data); @@ -3160,10 +3216,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, console.log('error getting template'); }); }; - + /** * Add OL popup overlay - * + * * @memberof mapService * @public * @alias addPopupOverlay @@ -3179,10 +3235,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return overlay; }; - + /** * Close OL popup overlay - * + * * @memberof mapService * @public * @alias closePopup @@ -3193,33 +3249,47 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.popupRecContainer.reset(); return false; }; - + //Popup visibility settings object ms.popupVisibility = { positions: ['fs', 'extMark', 'ircs', 'cfr', 'name', 'posTime', 'lat', 'lon', 'stat', 'm_spd', 'c_spd', 'crs', 'msg_tp', 'act_tp', 'source'], + positionsNames: ['fs', 'extMark', 'ircs', 'cfr', 'name', 'posTime', 'lat', 'lon', 'stat', 'm_spd', 'c_spd', 'crs', 'msg_tp', 'act_tp', 'source'], positionsTitles: true, segments: ['fs', 'extMark', 'ircs', 'cfr', 'name', 'dist', 'dur', 'spd', 'crs', 'cat'], + segmentsNames: ['fs', 'extMark', 'ircs', 'cfr', 'name', 'dist', 'dur', 'spd', 'crs', 'cat'], segmentsTitles: true, ers: ['fs', 'ext_mark', 'ircs', 'cfr', 'gfcm', 'iccat', 'uvi', 'name', 'source', 'activityType', 'reportType', 'purposeCode', 'occurrence', 'areas', 'gears', 'species'], ersTitles: true }; - + ms.setPopupVisibility = function(type, config){ ms.popupVisibility[type] = config.values; ms.popupVisibility[type + 'Titles'] = angular.isDefined(config.isAttributeVisible) ? config.isAttributeVisible: false; + ms.popupVisibility[type + 'ReplacementTitles'] = undefined; + if(angular.isDefined(config.titles) && config.titles.length > 0){ + var replacements = {}; + angular.forEach(config.titles,function(item){ + var key = item.code; + replacements[key] = item.title; + }); + ms.popupVisibility[type + 'ReplacementTitles'] = replacements; + } + if(type !== 'ers'){ + ms.popupVisibility[type + 'Names'] = angular.isDefined(config.names) ? config.names : []; + } if (!angular.isDefined(ms.popupVisibility[type])){ ms.popupVisibility[type] = []; } }; - - //POPUP - decide which function to call so that data is properly formated + + //POPUP - decide which function to call so that data is properly formated /** * Create object containing all the necessary information to be displayed in the popup - * + * * @memberof mapService * @public * @alias setObjPopup - * @param {Object} record - The source record for which a popup will be displayed + * @param {Object} record - The source record for which a popup will be displayed * @returns {Object} An object containing the necessary information to be displayed in the popup */ ms.setObjPopup = function(record){ @@ -3241,10 +3311,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, default: break; } - + return data; }; - + ms.popupRecContainer = { records: [], currentType: undefined, @@ -3256,55 +3326,72 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } }; + ms.getPopupAttrName = function(titles,replacementTitles,type,index){ + var name = ms.popupVisibility[type][index]; + var found = false; + for(var i =0; i < ms.popupVisibility[type+'Names'].length; i++){ + if(name === ms.popupVisibility[type+'Names'][i]){ + found = true; + break; + } + } + var title = ''; + if(found) { + if(angular.isDefined(replacementTitles)){ + title = replacementTitles[name]; + } + if(!angular.isDefined(title)){ + title = titles[name]; + } + } + return title; + }; //POPUP - Define the object that will be used in the popup for vms positions /** * Create object containing all the necessary position information to be displayed in the popup - * + * * @memberof mapService * @public * @alias setPositionsObjPopup - * @param {ol.Feature} feature - The OL feature used to display the popup + * @param {ol.Feature} feature - The OL feature used to display the popup * @param {String} [id] - The id of the feature * @returns {Object} An object containing the necessary position information to be displayed in the popup */ ms.setPositionsObjPopup = function(feature, id){ var titles = ms.getPositionTitles(); var srcData = ms.formatPositionDataForPopup(feature); - + var showAttrNames = ms.popupVisibility.positionsNames.length > 0; + var replacementTitles = ms.popupVisibility.positionsReplacementTitles; var data = []; for (var i = 0; i < ms.popupVisibility.positions.length; i++){ data.push({ - title: titles[ms.popupVisibility.positions[i]], + title: ms.getPopupAttrName(titles,replacementTitles,'positions',i), value: srcData[ms.popupVisibility.positions[i]] }); } - + return { - showTitles: ms.popupVisibility.positionsTitles, + showTitles: showAttrNames, position: data, id: id, vesselName: feature.name, vesselId: feature.connectionId, + showTitle: function(){ + return this.title !== ''; + }, getTitle: function(){ return this.title; }, getValue: function(){ return this.value; - }, - doDisplay: function(){ - if (!angular.isDefined(this.value) || this.value === ''){ - return false; - } else { - return true; - } } }; }; - + //Popup attribute names for positions /** * Get attributes names for positional data - * + * * @memberof mapService * @public * @alias getPositionTitles @@ -3329,11 +3416,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, source: locale.getString('spatial.tab_vms_pos_table_header_source') }; }; - + //Popup data values for positions /** * Format positional data to be displayed in the popup taking into consideration user preferences - * + * * @memberof mapService * @public * @alias formatPositionDataForPopup @@ -3343,7 +3430,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.formatPositionDataForPopup = function(data){ var coords = data.geometry.getCoordinates(); var repCoords = ol.proj.transform(coords, ms.getMapProjectionCode(), 'EPSG:4326'); - + return { name: data.name, fs: data.countryCode, @@ -3362,10 +3449,10 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, source: data.source }; }; - + /** * Do the mapping between application object properties and the source data properties - * + * * @memberof mapService * @public * @alias getMappingTitlesProperties @@ -3390,7 +3477,29 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, source: 'source' }; } - + if (type === 'ers'){ + return { + name: 'name', + fs: 'flagState', + ext_mark: 'EXT_MARK', + ircs: 'IRCS', + cfr: 'CFR', + gfcm: 'GFCM', + date: 'acceptedDateTime', + iccat: 'ICCAT', + uvi: 'UVI', + source: 'dataSource', + activityType: 'activityType', + reportType: 'reportType', + purposeCode: 'purposeCode', + occurrence: 'acceptedDateTime', + areas: 'areas', + gears: 'gears', + species: 'species', + asset:'name' + }; + } + if (type === 'vmsseg'){ return { name: 'name', @@ -3409,48 +3518,45 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, /** * Create object containing all the necessary segment information to be displayed in the popup - * + * * @memberof mapService * @public * @alias setSegmentsObjPopup - * @param {ol.Feature} feature - The OL feature used to display the popup + * @param {ol.Feature} feature - The OL feature used to display the popup * @returns {Object} An object containing the necessary position information to be displayed in the popup */ ms.setSegmentsObjPopup = function(feature){ var titles = ms.getSegmentTitles(); var srcData = ms.formatSegmentDataForPopup(feature); - + var showAttrNames = ms.popupVisibility.segmentsNames.length > 0; + var replacementTitles = ms.popupVisibility.segmentsReplacementTitles; var data = []; for (var i = 0; i < ms.popupVisibility.segments.length; i++){ data.push({ - title: titles[ms.popupVisibility.segments[i]], + title: ms.getPopupAttrName(titles,replacementTitles,'segments',i), value: srcData[ms.popupVisibility.segments[i]] }); } - + return { - showTitles: ms.popupVisibility.segmentsTitles, + showTitles: showAttrNames, segment: data, + showTitle: function(){ + return this.title !== ''; + }, getTitle: function(){ return this.title; }, getValue: function(){ return this.value; - }, - doDisplay: function(){ - if (!angular.isDefined(this.value) || this.value === ''){ - return false; - } else { - return true; - } } }; }; - + //Popup attribute names for segments /** * Get attributes names for segment data - * + * * @memberof mapService * @public * @alias getSegmentTitles @@ -3470,11 +3576,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, cat: locale.getString('spatial.tab_vms_seg_table_header_category') }; }; - + //Popup data values for segments /** * Format segment data to be displayed in the popup taking into consideration user preferences - * + * * @memberof mapService * @public * @alias formatPositionDataForPopup @@ -3495,18 +3601,18 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, cat: data.segmentCategory }; }; - + //POPUP - alarms //Define the object that will be used in the popup for alarms /** * Create the alarms object that will be used in the popup - * + * * @memberof mapService * @public * @alias setAlarmsObjPopup - * @param {ol.Feature} feature - The OL feature representing the alarm + * @param {ol.Feature} feature - The OL feature representing the alarm * @param {Boolean} includeAsset - Whether the details button should be displayed in the popup or not - * @returns {Object} + * @returns {Object} */ ms.setAlarmsObjPopup = function(feature, includeAsset){ if (!angular.isDefined(includeAsset)){ @@ -3514,7 +3620,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } var titles = ms.getAlarmTitles(); var srcData = ms.formatAlarmDataForPopup(feature); - + return { alarmTitle: locale.getString('spatial.popup_alarms_title'), titles: titles, @@ -3522,11 +3628,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, includeAssetDetails: includeAsset }; }; - + //Popup attribute names for alarms /** * Get attributes names for alarms data - * + * * @memberof mapService * @public * @alias getAlarmTitles @@ -3547,17 +3653,17 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, updatedBy: locale.getString('spatial.rule_updated_by') }; }; - + /** * Format alarm data to be displayed in the popup taking into consideration user preferences - * + * * @memberof mapService * @public * @alias formatAlarmDataForPopup * @param {Object} data - The object containing initial data * @returns {Object} An object containing properly formated alarm data */ - ms.formatAlarmDataForPopup = function(data){ + ms.formatAlarmDataForPopup = function(data){ return { name: data.name, fs: data.fs, @@ -3574,20 +3680,20 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, color: ms.getColorByStatus(ms.styles.alarms, data.ticketStatus) }; }; - + /** * Create object containing all the necessary fishing activity information to be displayed in the popup - * + * * @memberof mapService * @public * @alias setActivitiesObjPopup - * @param {ol.Feature} feature - The OL feature used to display the popup + * @param {ol.Feature} feature - The OL feature used to display the popup * @returns {Object} An object containing the necessary position information to be displayed in the popup */ ms.setActivitiesObjPopup = function(feature){ var titles = ms.getActivityTitles(); var srcData = ms.formatActivityDataForPopup(feature); - + var data = []; for (var i = 0; i < ms.popupVisibility.ers.length; i++){ data.push({ @@ -3595,7 +3701,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, value: srcData[ms.popupVisibility.ers[i]] }); } - + return { showTitles: ms.popupVisibility.ersTitles, activity: data, @@ -3622,11 +3728,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } }; }; - + //Popup attribute names for fishing activities /** * Get attributes names for activity data - * + * * @memberof mapService * @public * @alias getActivityTitles @@ -3653,11 +3759,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, species: locale.getString('spatial.criteria_species') }; }; - + //Popup data values for activities /** * Format segment data to be displayed in the popup taking into consideration user preferences - * + * * @memberof mapService * @public * @alias formatActivityDataForPopup @@ -3667,7 +3773,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.formatActivityDataForPopup = function(data){ var filter = $filter('stArrayToString'); var pCodeDesc = mdrCacheService.getDescriptionByCode('FLUX_GP_PURPOSE', data.purposeCode); - + return { fs: data.flagState, name: data.vesselName, @@ -3684,8 +3790,8 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, occurrence: unitConversionService.date.convertToUserFormat(data.acceptedDateTime), areas: filter(data.areas, ' - '), //ports: data.ports, - gears: filter(data.gears, ' - '), - species: filter(data.species, ', ') + gears: filter(data.gears, ' - '), + species: filter(data.species, ', ') }; }; @@ -3695,11 +3801,11 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, //array holding features selected by DragBox ms.selectedFeatures = []; - + ms.getSelectedFeatures = function() { return ms.selectedFeatures; }; - + ms.setDragBoxEvent = function(map){ var dragBox = new ol.interaction.DragBox({ condition: ol.events.condition.shiftKeyOnly @@ -3711,7 +3817,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, dragBox.on('boxstart', function () { ms.selectedFeatures = []; }); - + ms.wktFormatter = new ol.format.WKT(); dragBox.on('boxend', function () { @@ -3727,13 +3833,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, ms.resetHighlightedFeatures(); }); }; - + ms.resetHighlightedFeatures = function() { var layer = ms.getLayerByType('highlight').getSource(); layer.clear(true); layer.addFeatures(ms.selectedFeatures); }; - + ms.getFeaturesIntersectingExtent = function(source, extend, geomType, layer) { source.forEachFeatureIntersectingExtent(extend, function (feature) { ms.selectedFeatures.push(feature); @@ -3741,14 +3847,14 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, feature.getGeometry().set("GeometryType", geomType); }); } ; - + ms.clearFeaturesOfUnselectedLayer = function(layer) { ms.selectedFeatures = ms.selectedFeatures.filter(function(feature) { return feature.get('layerType') !== layer; }); ms.resetHighlightedFeatures(); }; - + ms.getSelectedFeaturesForExport = function(identifier) { var features = {}; angular.forEach(ms.selectedFeatures, function (feature) { @@ -3773,7 +3879,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, } return parent[name]; }; - + ms.getFlagState = function(feature) { if(feature.get('layerType') === 'ers') { return feature.get('flagState') !== "" ? feature.get('flagState') : "UNKNOWN"; @@ -3783,7 +3889,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return feature.get('countryCode') !== "" ? feature.get('countryCode') : "UNKNOWN"; } }; - + ms.getIdentifier = function(feature, identifier) { if(feature.get('layerType') === 'ers') { return identifier.toUpperCase() + ": " + feature.get(identifier.toUpperCase()); @@ -3793,7 +3899,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, return identifier.toUpperCase() + ": " + feature.get(identifier.toLowerCase()); } }; - + ms.pushFeatureInRelevantLayerFolder = function(parent, feature) { var layerFolder; if(feature.get('layerType') === 'ers') { @@ -3807,7 +3913,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, layerFolder.push(ms.segmentFeatureToDto(feature)); } }; - + ms.getTransformedCoordinates = function(feature) { var src = 'EPSG:3857'; var dest = 'EPSG:4326'; @@ -3815,13 +3921,13 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, clonedFeature.getGeometry().transform(src, dest); return clonedFeature.getGeometry().getCoordinates(); }; - + ms.positionFeatureToDto = function(feature) { var dto = {}; dto['geometry'] = ms.getTransformedCoordinates(feature).join(); dto['color'] = ms.getColorForPositionWithoutIsVisible(feature); - + var properties = feature.get('features')[0].getProperties(); dto['positionTime'] = properties['positionTime']; dto['connectionId'] = properties['connectionId']; @@ -3848,7 +3954,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, dto['geometry'].push(coordinates.join()); }); dto['color'] = ms.getColorForSegment(feature); - + var properties = feature.getProperties(); dto['cfr'] = properties['cfr']; dto['countryCode'] = properties['countryCode']; @@ -3868,7 +3974,7 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, var dto = {}; dto['geometry'] = ms.getTransformedCoordinates(feature).join(); - + var properties = feature.getProperties(); dto['activityId'] = parseInt(properties['activityId']); dto['faReportID'] = parseInt(properties['faReportID']); @@ -3896,7 +4002,6 @@ angular.module('unionvmsWeb').factory('mapService', function(locale, $rootScope, dto['vesselIdentifiers'] = vesselIds; return dto; }; - + return ms; }); -