diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/services/as-eln-lims-api/script.py b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/services/as-eln-lims-api/script.py index a094b91a0eb645b7e62f089f3a2eecc8117caf67..a89914d942eb9afb016920030dd348a96fd145d5 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/services/as-eln-lims-api/script.py +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/services/as-eln-lims-api/script.py @@ -70,6 +70,7 @@ def getSamplesImportTemplate(context, parameters): from ch.ethz.sis.openbis.generic.asapi.v3.dto.plugin import PluginType allowedSampleTypes = [EntityTypePermId(code) for code in parameters.get("allowedSampleTypes")] + templateType = parameters.get("templateType") importMode = parameters.get("importMode") sessionToken = context.getSessionToken() api = context.getApplicationService() @@ -97,9 +98,10 @@ def getSamplesImportTemplate(context, parameters): cell_index = _create_cell(row, cell_index, header_style, "Code") if importMode == "UPDATE": cell_index = _create_cell(row, cell_index, header_style, "Identifier") - cell_index = _create_cell(row, cell_index, header_style, "Experiment") - cell_index = _create_cell(row, cell_index, header_style, "Project") - cell_index = _create_cell(row, cell_index, header_style, "Space") + if templateType == "GENERAL": + cell_index = _create_cell(row, cell_index, header_style, "Experiment") + cell_index = _create_cell(row, cell_index, header_style, "Project") + cell_index = _create_cell(row, cell_index, header_style, "Space") cell_index = _create_cell(row, cell_index, header_style, "Parents") for propertyAssignment in sampleTypes.get(sampleTypeId).getPropertyAssignments(): plugin = propertyAssignment.getPlugin() diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js index b38bbe19bca8ff7da8f362c0634c51566f4ddf42..d4c8b759cf052558ee8a3e73470b9bdda70b72a2 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js @@ -133,10 +133,11 @@ function ServerFacade(openbisServer) { }); } - this.getSamplesImportTemplate = function(allowedSampleTypes, importMode, callback) { + this.getSamplesImportTemplate = function(allowedSampleTypes, templateType, importMode, callback) { this.customELNASAPI({ "method" : "getSamplesImportTemplate", "allowedSampleTypes" : allowedSampleTypes, + "templateType" : templateType, "importMode" : importMode }, function(result) { callback(result) diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/widgets/BatchView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/widgets/BatchView.js index aed8ccd491b6b599d04d9b78da42fa8361d02da4..abab7830f644cb4d0519e472e45279d625d046b5 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/widgets/BatchView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/widgets/BatchView.js @@ -59,11 +59,12 @@ function BatchView(controller, model) { $templateLink.on("click", function() { var allowedSampleTypes = getAllowedSampleTypes(); var importMode = _this._model.linkType; - mainController.serverFacade.getSamplesImportTemplate(allowedSampleTypes, importMode, function(result) { + var templateType = _this._model.allowSampleTypeSelection ? "GENERAL" : "COLLECTION"; + mainController.serverFacade.getSamplesImportTemplate(allowedSampleTypes, templateType, importMode, function(result) { var link = document.createElement('a'); var mimeType = "application/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; link.href = "data:" + mimeType + ";base64," + result; - link.download = "SAMPLE-" + importMode + "-" + allowedSampleTypes.join("-") + "-template.xlsx"; + link.download = "SAMPLE-" + templateType + "-" + importMode + "-" + allowedSampleTypes.join("-") + "-template.xlsx"; document.body.appendChild(link); link.click(); document.body.removeChild(link);