diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/elnTypes.py b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/elnTypes.py index c410effaa511e27997f38e08ef71b22c885d9701..99db494e5c4cd40837981198610d87825ac38f3c 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/elnTypes.py +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/elnTypes.py @@ -857,6 +857,11 @@ DRAWING_BOARD_SAMPLE = ["DRAWING_BOARD", "", [ ## Types - Orders ## + +PURCHASES = ["PURCHASES", "Folder used to organize purchases related items", [ + ["NAME", "General", "Name", DataType.VARCHAR, None, "Name", None, None] + ]]; + LANGUAGE = [ "LANGUAGE", "Language", [ ["ENGLISH", "English (Default)", None], @@ -926,17 +931,4 @@ ORDER = ["ORDER", "", [ ["TOTAL_PRICE", "General", "Total Price", DataType.VARCHAR, None, "Total Price", None, None], ["ADDITIONAL_INFORMATION", "General", "Additional Information", DataType.MULTILINE_VARCHAR, None, "Additional Information", None, None], ["REQUESTS", "General", "Requests", DataType.XML, None, "Requests", None, None] - ]]; - -ORDER_LANGUAGE = ["ORDER_LANGUAGE", "", [ - ["ORDER_LANGUAGE", "General", "Order language", DataType.CONTROLLEDVOCABULARY, "LANGUAGE", "Order language", None, None], - ["DATE_LABEL", "General", "Date label", DataType.VARCHAR, None, "Date label", None, None], - ["ORDER_MANAGER_LABEL", "General", "Order manager label", DataType.VARCHAR, None, "Order manager label", None, None], - ["ORDER_MANAGER_CONTACT_DETAILS_LABEL", "General", "Order manager contact details label", DataType.VARCHAR, None, "Order manager contact details label", None, None], - ["COMPANY_EMAIL_LABEL", "General", "Company email label", DataType.VARCHAR, None, "Company email label", None, None], - ["COMPANY_FAX_LABEL", "General", "Company fax label", DataType.VARCHAR, None, "Company fax label", None, None], - ["QUANTITY_LABEL", "General", "Quantity label", DataType.VARCHAR, None, "Quantity label", None, None], - ["PRODUCT_LABEL", "General", "Product label", DataType.VARCHAR, None, "Product label", None, None], - ["TOTAL_PRICE_LABEL", "General", "Total price label", DataType.VARCHAR, None, "Total price label", None, None], - ["ADDITIONAL_INFORMATION_LABEL", "General", "Additional information Label", DataType.VARCHAR, None, "Additional information label", None, None] ]]; \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/initialize-master-data-minimum.py b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/initialize-master-data-minimum.py index bb3c085a226f038dc52d9ddeda3c6a0f2f6d9fd1..5ab6319ca4f8345d27fc1c132a301ed253a70fc3 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/initialize-master-data-minimum.py +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/initialize-master-data-minimum.py @@ -70,8 +70,9 @@ elnTypes.createVocabularyWithTerms(tr, elnTypes.CURRENCY); elnTypes.createVocabularyWithTerms(tr, elnTypes.PREFERRED_ORDER_METHOD); elnTypes.createVocabularyWithTerms(tr, elnTypes.ORDER_STATUS); +elnTypes.createExperimentTypeWithProperties(tr, elnTypes.PURCHASES); + elnTypes.createSampleTypeWithProperties(tr, elnTypes.SUPPLIER); elnTypes.createSampleTypeWithProperties(tr, elnTypes.PRODUCT); elnTypes.createSampleTypeWithProperties(tr, elnTypes.REQUEST); -elnTypes.createSampleTypeWithProperties(tr, elnTypes.ORDER); -elnTypes.createSampleTypeWithProperties(tr, elnTypes.ORDER_LANGUAGE); \ No newline at end of file +elnTypes.createSampleTypeWithProperties(tr, elnTypes.ORDER); \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/initialize-master-data.py b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/initialize-master-data.py index fdfa3c7a33999abf4d79b0260cb579b79593dd4a..733a11cef83dfdbcb2acc8cc7bbcab1653943f8f 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/initialize-master-data.py +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/initialize-master-data.py @@ -178,8 +178,9 @@ elnTypes.createVocabularyWithTerms(tr, elnTypes.CURRENCY); elnTypes.createVocabularyWithTerms(tr, elnTypes.PREFERRED_ORDER_METHOD); elnTypes.createVocabularyWithTerms(tr, elnTypes.ORDER_STATUS); +elnTypes.createExperimentTypeWithProperties(tr, elnTypes.PURCHASES); + elnTypes.createSampleTypeWithProperties(tr, elnTypes.SUPPLIER); elnTypes.createSampleTypeWithProperties(tr, elnTypes.PRODUCT); elnTypes.createSampleTypeWithProperties(tr, elnTypes.REQUEST); -elnTypes.createSampleTypeWithProperties(tr, elnTypes.ORDER); -elnTypes.createSampleTypeWithProperties(tr, elnTypes.ORDER_LANGUAGE); \ No newline at end of file +elnTypes.createSampleTypeWithProperties(tr, elnTypes.ORDER); \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/index.html b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/index.html index e27d01603187d9a5ac6f9676774b57920c12f1c9..f77b5f760d94995d4007087fa55f52573794488c 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/index.html +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/index.html @@ -208,10 +208,6 @@ <script type="text/javascript" src="./js/views/Export/ExportTreeModel.js"></script> <script type="text/javascript" src="./js/views/Export/ExportTreeView.js"></script> - <script type="text/javascript" src="./js/views/Orders/OrdersController.js"></script> - <script type="text/javascript" src="./js/views/Orders/OrdersModel.js"></script> - <script type="text/javascript" src="./js/views/Orders/OrdersView.js"></script> - <script type="text/javascript" src="./js/views/DrawingBoards/DrawingBoardsController.js"></script> <script type="text/javascript" src="./js/views/DrawingBoards/DrawingBoardsModel.js"></script> <script type="text/javascript" src="./js/views/DrawingBoards/DrawingBoardsView.js"></script> 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 754ed26aa5a285698cb74f9ff2248f3484cdc46c..508619e9a1359572c69ac5f95ef56c4c051d761c 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 @@ -50,8 +50,22 @@ $.extend(DefaultProfile.prototype, { showUserManager : true } + this.orderLanguage = { + "EN" : { + "DATE_LABEL" : "Date", + "ORDER_MANAGER_LABEL" : "Order Manager", + "ORDER_MANAGER_CONTACT_DETAILS_LABEL" : "Order Manager Contact Details", + "COMPANY_EMAIL_LABEL" : "Company Email", + "COMPANY_FAX_LABEL" : "Company Fax", + "QUANTITY_LABEL" : "Quantity", + "PRODUCT_LABEL" : "Product", + "TOTAL_PRICE_LABEL" : "Total Price", + "ADDITIONAL_INFORMATION_LABEL" : "Additional Information" + } + } + this.searchDomains = [ { "@id" : -1, "@type" : "GobalSearch", label : "Global", name : "global"}]; - this.inventorySpaces = ["MATERIALS", "METHODS", "ORDERS"]; + this.inventorySpaces = ["MATERIALS", "METHODS", "PURCHASES"]; this.sampleTypeProtocols = ["GENERAL_PROTOCOL", "PCR_PROTOCOL", "WESTERN_BLOTTING_PROTOCOL"]; this.searchSamplesUsingV3OnDropbox = false; this.searchSamplesUsingV3OnDropboxRunCustom = false; @@ -63,9 +77,8 @@ $.extend(DefaultProfile.prototype, { this.directFileServer = null; //To be set during initialization using info retrieved from the DSS configuration by the reporting plugin this.copyPastePlainText = false; this.hideCodes = true; - this.hideSpaces = ["ORDERS"]; this.hideTypes = { - "sampleTypeCodes" : ["SUPPLIER", "PRODUCT", "REQUEST", "ORDER", "ORDER_LANGUAGE"], + "sampleTypeCodes" : ["SUPPLIER", "PRODUCT", "REQUEST", "ORDER"], "experimentTypeCodes" : [] } this.propertyReplacingCode = "NAME"; @@ -106,10 +119,6 @@ $.extend(DefaultProfile.prototype, { } } - this.isSpaceHidden = function(spaceCode) { - return ($.inArray(spaceCode, this.hideSpaces) !== -1); - } - this.isExperimentTypeHidden = function(experimentTypeCode) { return ($.inArray(experimentTypeCode, this.hideTypes["experimentTypeCodes"]) !== -1); } diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index 42a1f2d3aaab92fc1e7c5443b0c3ce2aee41735c..ba91e96351422c9c4889565e753cd70b79afbc94 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -212,13 +212,6 @@ function MainController(profile) { try { switch (newViewChange) { - case "showOrdersPage": - document.title = "Orders"; - var newView = new OrdersController(this); - newView.init($("#mainContainer")); - this.currentView = newView; - window.scrollTo(0,0); - break; case "showExportTreePage": document.title = "Export"; var newView = new ExportTreeController(this); diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersController.js deleted file mode 100644 index 2a6f9796b2d1ffc574ee3dc1aa97da92d37b4385..0000000000000000000000000000000000000000 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersController.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2016 ETH Zuerich, Scientific IT Services - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function OrdersController(parentController) { - var parentController = parentController; - var ordersModel = new OrdersModel(); - var ordersView = new OrdersView(this, ordersModel); - - this.init = function($container) { - ordersView.repaint($container); - } -} \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersModel.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersModel.js deleted file mode 100644 index 536e683f8728b56a349584de61525523bc49e914..0000000000000000000000000000000000000000 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersModel.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2016 ETH Zuerich, Scientific IT Services - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function OrdersModel() { -} \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersView.js deleted file mode 100644 index 1ce2120f0cb28fe106dc476ba97368d85e41d999..0000000000000000000000000000000000000000 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/Orders/OrdersView.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2016 ETH Zuerich, Scientific IT Services - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function OrdersView(ordersController, ordersModel) { - var ordersController = ordersController; - var ordersModel = ordersModel; - - this.repaint = function($container) { - $container.empty(); - - var $form = $("<div>", { "class" : "form-horizontal row"}); - var $formColumn = $("<div>", { "class" : FormUtil.formColumClass }); - - $form.append($formColumn); - - var $formTitle = $("<h2>").append("Orders"); - - // - // Toolbar - // - var toolbarModel = []; - - var $request = FormUtil.getButtonWithIcon("glyphicon-plus", function() {}, "Request"); - toolbarModel.push({ component : $request, tooltip: "Create Request" }); - var $order = FormUtil.getButtonWithIcon("glyphicon-plus", function() {}, "Order"); - toolbarModel.push({ component : $order, tooltip: "Create Order" }); - - - $formColumn.append($formTitle); - $formColumn.append(FormUtil.getToolbar(toolbarModel)); - $formColumn.append("<br>"); - - $container.append($form); - } -} \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableView.js index 2988d8c0a5aab36b9f8a46f9d6b86653d2dcaaae..39206983e033168bae9d37cf02c093a3d6484190 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableView.js @@ -58,7 +58,7 @@ function SampleTableView(sampleTableController, sampleTableModel) { } //Add Sample Type - if(sampleTypeCode !== null && !profile.isSampleTypeHidden(sampleTypeCode)) { + if(sampleTypeCode !== null) { var $createButton = FormUtil.getButtonWithIcon("glyphicon-plus", function() { var argsMap = { "sampleTypeCode" : sampleTypeCode, diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SideMenu/SideMenuWidgetView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SideMenu/SideMenuWidgetView.js index e35624b88922699ef8a123c5b396b692405c096f..7e6f6e623c2d429efa02d06ebdb85ca9606176e5 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SideMenu/SideMenuWidgetView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SideMenu/SideMenuWidgetView.js @@ -220,10 +220,6 @@ function SideMenuWidgetView(sideMenuWidgetController, sideMenuWidgetModel) { treeModel.push({ title : "Inventory", entityType: "INVENTORY", key : "INVENTORY", folder : true, lazy : true, view : "showInventoryPage" }); } - if(profile.mainMenu.showOrders) { - treeModel.push({ title : "Orders", entityType: "ORDERS", key : "ORDERS", folder : true, lazy : false, view : "showOrdersPage", icon : "fa fa-shopping-cart" }); - } - var treeModelUtils = []; if(profile.mainMenu.showDrawingBoard) { @@ -295,13 +291,16 @@ function SideMenuWidgetView(sideMenuWidgetController, sideMenuWidgetModel) { var spaces = searchResult.objects; for (var i = 0; i < spaces.length; i++) { var space = spaces[i]; - if(!profile.isSpaceHidden(space.code)) { - var isInventorySpace = profile.isInventorySpace(space.code); - if((type === "LAB_NOTEBOOK" && !isInventorySpace) || (type === "INVENTORY" && isInventorySpace)) { - var normalizedSpaceTitle = Util.getDisplayNameFromCode(space.code); - results.push({ title : normalizedSpaceTitle, entityType: "SPACE", key : space.getCode(), folder : true, lazy : true, view : "showSpacePage", viewData: space.getCode() }); + var isInventorySpace = profile.isInventorySpace(space.code); + if((type === "LAB_NOTEBOOK" && !isInventorySpace) || (type === "INVENTORY" && isInventorySpace)) { + var normalizedSpaceTitle = Util.getDisplayNameFromCode(space.code); + + var spaceNode = { title : normalizedSpaceTitle, entityType: "SPACE", key : space.getCode(), folder : true, lazy : true, view : "showSpacePage", viewData: space.getCode() }; + if(space.getCode() === "PURCHASES") { + spaceNode.icon = "fa fa-shopping-cart"; } - } + results.push(spaceNode); + } } dfd.resolve(results); }); @@ -315,6 +314,7 @@ function SideMenuWidgetView(sideMenuWidgetController, sideMenuWidgetModel) { var project = projects[i]; var normalizedProjectTitle = Util.getDisplayNameFromCode(project.code); results.push({ title : normalizedProjectTitle, entityType: "PROJECT", key : project.getPermId().getPermId(), folder : true, lazy : true, view : "showProjectPageFromPermId", viewData: project.getPermId().getPermId() }); + } dfd.resolve(results); }); diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py index 451d90cad62f04e83279a73f1ea75d876542bff7..9782359ed4bede50eca1bcfe638b157f7af13bf7 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py @@ -324,7 +324,23 @@ def init(tr, parameters, tableBuilder): elnTypesMetadataMini = tr.getVocabularyForUpdate("ELN_TYPES_METADATA_MINI"); addData = elnTypesMetadata != None or elnTypesMetadataMini != None; if addData: # We can only create the data if the ELN metadata is present, this is not true on highly customized systems. - tr.createNewSpace("ORDERS", None); + tr.createNewSpace("PURCHASES", None); + + tr.createNewProject("/PURCHASES/PRODUCTS"); + purchasesCollection = tr.createNewExperiment("/PURCHASES/PRODUCTS/PRODUCT_COLLECTION_1", "PURCHASES"); + purchasesCollection.setPropertyValue("NAME", "Product Collection 1"); + + tr.createNewProject("/PURCHASES/SUPPLIERS"); + purchasesCollection = tr.createNewExperiment("/PURCHASES/SUPPLIERS/SUPPLIER_COLLECTION_1", "PURCHASES"); + purchasesCollection.setPropertyValue("NAME", "Supplier Collection 1"); + + tr.createNewProject("/PURCHASES/REQUESTS"); + purchasesCollection = tr.createNewExperiment("/PURCHASES/REQUESTS/REQUEST_COLLECTION_1", "PURCHASES"); + purchasesCollection.setPropertyValue("NAME", "Request Collection 1"); + + tr.createNewProject("/PURCHASES/ORDERS"); + purchasesCollection = tr.createNewExperiment("/PURCHASES/ORDERS/ORDER_COLLECTION_1", "PURCHASES"); + purchasesCollection.setPropertyValue("NAME", "Order Collection 1"); tr.createNewSpace("MATERIALS", None);