diff --git a/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.html b/unionvms-web/app/partial/activity/activityReportsList/activityReportsList.html index dc0ff7be3..664d9e10b 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 @@
@@ -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/tripReportsList/tripReportsList.html b/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.html index 90a169007..41ba4488b 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 @@
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 {@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