From a172bb2cee25c50384832bb6a6773bcd76675752 Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Thu, 13 Jul 2017 08:00:39 +0000
Subject: [PATCH] SSDM-5375 : get all samples allow to not show hidden +
 intended bugfix

SVN: 38524
---
 .../webapps/eln-lims/html/js/config/Profile.js  | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js
index e67d0d83fc2..5afd1eee526 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js
@@ -200,7 +200,7 @@ $.extend(DefaultProfile.prototype, {
 			if(sampleType && sampleType.listable) {
 				return ($.inArray(sampleTypeCode, this.hideTypes["sampleTypeCodes"]) !== -1);
 			} else {
-				return true;
+				return false;
 			}
 		}
 		
@@ -595,8 +595,19 @@ $.extend(DefaultProfile.prototype, {
 			return null;
 		}
 		
-		this.getAllSampleTypes = function() {
-			return this.allSampleTypes;
+		this.getAllSampleTypes = function(skipHidden) {
+			if(skipHidden) {
+				var allNonHiddenSampleTypes = [];
+				for(var sIdx = 0; sIdx < this.allSampleTypes.length; sIdx++) {
+					var sampleType = this.allSampleTypes[sIdx];
+					if(!this.isSampleTypeHidden(sampleType.sampleTypeCode)) {
+						allNonHiddenSampleTypes.push(sampleType);
+					}
+				}
+				return allNonHiddenSampleTypes;
+			} else {
+				return this.allSampleTypes;
+			}
 		}
 		
 		this.initPropertyTypes = function(callback) {
-- 
GitLab