From b58213451361d78116c7c358b2f26be0c76018cc Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Fri, 21 Jul 2017 08:44:09 +0000
Subject: [PATCH] SSDM-5266 : Registrator and Modifier in Search, Samples and
 Experiments tables

SVN: 38560
---
 .../AdvancedSearchController.js               |  2 ++
 .../AdvancedSearch/AdvancedSearchView.js      | 14 ++++++++++
 .../views/DataGrid/ExperimentDataGridUtil.js  | 16 ++++++++++++
 .../js/views/DataGrid/SampleDataGridUtil.js   | 26 +++++++++++++++++++
 4 files changed, 58 insertions(+)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchController.js
index 73c7f6720f1..7f3fa70ada4 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchController.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchController.js
@@ -72,7 +72,9 @@ function AdvancedSearchController(mainController, forceSearch) {
 					rowData.entityType = (entity.type)?entity.type.code:"";
 					rowData.code =  entity.code;
 					rowData.permId = (entity.permId)?entity.permId.permId:"";
+					rowData.registrator = (entity.registrator)?entity.registrator.userId:null;
 					rowData.registrationDate = (entity.registrationDate)?Util.getFormatedDate(new Date(entity.registrationDate)):null;
+					rowData.modifier = (entity.modifier)?entity.modifier.userId:null;
 					rowData.modificationDate = (entity.modificationDate)?Util.getFormatedDate(new Date(entity.modificationDate)):null;
 					rowData.entityObject = entity;
 					
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js
index a266f1027c0..79fc3070ba1 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js
@@ -694,6 +694,13 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) {
 				sortable : false
 			});
 			
+			columnsLast.push({
+				label : 'Registrator',
+				property : 'registrator',
+				isExportable: true,
+				sortable : !isGlobalSearch
+			});
+			
 			columnsLast.push({
 				label : 'Registration Date',
 				property : 'registrationDate',
@@ -701,6 +708,13 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) {
 				sortable : !isGlobalSearch
 			});
 			
+			columnsLast.push({
+				label : 'Modifier',
+				property : 'modifier',
+				isExportable: true,
+				sortable : !isGlobalSearch
+			});
+			
 			columnsLast.push({
 				label : 'Modification Date',
 				property : 'modificationDate',
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js
index 19280e4066a..e748d547185 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js
@@ -106,6 +106,13 @@ var ExperimentDataGridUtil = new function() {
 			sortable : false
 		});
 		
+		columns.push({
+			label : 'Registrator',
+			property : 'registrator',
+			isExportable: false,
+			sortable : true
+		});
+		
 		columns.push({
 			label : 'Registration Date',
 			property : 'registrationDate',
@@ -113,6 +120,13 @@ var ExperimentDataGridUtil = new function() {
 			sortable : true
 		});
 		
+		columns.push({
+			label : 'Modifier',
+			property : 'modifier',
+			isExportable: false,
+			sortable : true
+		});
+		
 		columns.push({
 			label : 'Modification Date',
 			property : 'modificationDate',
@@ -127,7 +141,9 @@ var ExperimentDataGridUtil = new function() {
 				var entity = entities[sIdx];
 				var model = {		'identifier' : entity.identifier, 
 									'permId' : entity.permId,
+									'registrator' : entity.registrationDetails.userId,
 									'registrationDate' : Util.getFormatedDate(new Date(entity.registrationDetails.registrationDate)),
+									'modifier' : entity.registrationDetails.modifierUserId,
 									'modificationDate' : Util.getFormatedDate(new Date(entity.registrationDetails.modificationDate))
 				};
 				
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
index d3f107099a6..35dccdd44e2 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
@@ -198,6 +198,13 @@ var SampleDataGridUtil = new function() {
 			sortable : false
 		});
 		
+		columnsLast.push({
+			label : 'Registrator',
+			property : 'registrator',
+			isExportable: false,
+			sortable : true
+		});
+		
 		columnsLast.push({
 			label : 'Registration Date',
 			property : 'registrationDate',
@@ -205,6 +212,13 @@ var SampleDataGridUtil = new function() {
 			sortable : true
 		});
 		
+		columnsLast.push({
+			label : 'Modifier',
+			property : 'modifier',
+			isExportable: false,
+			sortable : true
+		});
+		
 		columnsLast.push({
 			label : 'Modification Date',
 			property : 'modificationDate',
@@ -244,11 +258,21 @@ var SampleDataGridUtil = new function() {
 				for(var sIdx = 0; sIdx < result.objects.length; sIdx++) {
 					var sample = mainController.serverFacade.getV3SampleAsV1(result.objects[sIdx]);
 					
+					var registrator = null;
+					if(sample.registrationDetails && sample.registrationDetails.userId) {
+						registrator = sample.registrationDetails.userId;
+					}
+					
 					var registrationDate = null;
 					if(sample.registrationDetails && sample.registrationDetails.registrationDate) {
 						registrationDate = Util.getFormatedDate(new Date(sample.registrationDetails.registrationDate));
 					}
 					
+					var modifier = null;
+					if(sample.registrationDetails && sample.registrationDetails.modifierUserId) {
+						modifier = sample.registrationDetails.modifierUserId;
+					}
+					
 					var modificationDate = null;
 					if(sample.registrationDetails && sample.registrationDetails.modificationDate) {
 						modificationDate = Util.getFormatedDate(new Date(sample.registrationDetails.modificationDate));
@@ -262,7 +286,9 @@ var SampleDataGridUtil = new function() {
 										'default_space' : sample.spaceCode,
 										'permId' : sample.permId,
 //										'experiment' : sample.experimentIdentifierOrNull,
+										'registrator' : registrator,
 										'registrationDate' : registrationDate,
+										'modifier' : modifier,
 										'modificationDate' : modificationDate
 									};
 					
-- 
GitLab