From 753e31d7a6ca75ec47ef5388918d892e3b5c5e2e Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Thu, 13 Feb 2020 08:07:36 +0100 Subject: [PATCH 1/7] Moved and cleaned up action profile --- bika/lims/profiles/default/actions.xml | 251 ++++++++++--------------- 1 file changed, 96 insertions(+), 155 deletions(-) diff --git a/bika/lims/profiles/default/actions.xml b/bika/lims/profiles/default/actions.xml index d97df2ef56..53a5aba0d3 100644 --- a/bika/lims/profiles/default/actions.xml +++ b/bika/lims/profiles/default/actions.xml @@ -1,26 +1,23 @@ + name="portal_actions" + meta_type="Plone Actions Tool" + purge="True"> - - - - - - - - Sharing - - string:${object_url}/@@sharing - - - python:here.portal_type not in ['Client', 'ClientFolder'] - - False - + + + + + Sharing + + string:${object_url}/@@sharing + + + python:here.portal_type not in ['Client', 'ClientFolder'] + + False + Audit Log @@ -34,131 +31,75 @@ True - + - - - - Home - - string:${globals_view/navigationRootUrl} - - - - - - - False - - - Home - - string:${globals_view/navigationRootUrl} - - - - - - - False - - - Samples - - string:$portal_url/analysisrequests - - - - - - - False - - - Worksheets - - string:$portal_url/worksheets - - - - - - - False - - - Suppliers - - string:$portal_url/suppliers - - - - - - - False - - - Reference Samples - - string:$portal_url/referencesamples - - - - - - - False - - - Extracts - - string:$portal_url/extracts - - - - - - - False - - - Prices - - string:$portal_url/setanalyses - - - - - - - False - - - Report - - string:$portal_url/reports - - - - - - - True - - - Import - - string:$portal_url/import - - - - - - - True - - + + + + False + + + False + + + False + + + False + + + False + + + + + + + False + + + False + + + False + + + False + + + False + + + + + + + + Report + + string:$portal_url/reports + + + + + + + True + + + + Import + + string:$portal_url/import + + + + + + + True + + Search @@ -172,17 +113,17 @@ True - - Audit Log - - string:$portal_url/bika_setup/auditlog - - - - - - - True + + Audit Log + + string:$portal_url/bika_setup/auditlog + + + + + + + True From 59437a6b4b59f28f9c907391484c14f088b77944 Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Thu, 13 Feb 2020 08:10:56 +0100 Subject: [PATCH 2/7] Moved portal languages into core Also added chinese, thai and polish to the list --- .../profiles/default/portal_languages.xml | 55 +++++++------------ 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/bika/lims/profiles/default/portal_languages.xml b/bika/lims/profiles/default/portal_languages.xml index 807c4c011c..22f8da9b40 100644 --- a/bika/lims/profiles/default/portal_languages.xml +++ b/bika/lims/profiles/default/portal_languages.xml @@ -1,38 +1,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + From 2d5c10a95c3a7d12502e774787a1ecd18ed1cb1b Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Thu, 13 Feb 2020 08:13:13 +0100 Subject: [PATCH 3/7] Moved navigation portlet --- bika/lims/profiles/default/portlets.xml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/bika/lims/profiles/default/portlets.xml b/bika/lims/profiles/default/portlets.xml index bd30a63d34..9841c6cbe4 100644 --- a/bika/lims/profiles/default/portlets.xml +++ b/bika/lims/profiles/default/portlets.xml @@ -1,19 +1,15 @@ + xmlns:i18n="http://xml.zope.org/namespaces/i18n" + i18n:domain="plone"> - + + 0 False Navigation - True + False 0 From b01a807667e04ea5b38708341792fde62aeb08e6 Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Thu, 13 Feb 2020 08:21:37 +0100 Subject: [PATCH 4/7] Moved html filter setup to core --- bika/lims/setuphandlers.py | 22 ++++++++++++++++++++++ bika/lims/upgrade/v01_03_003.py | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/bika/lims/setuphandlers.py b/bika/lims/setuphandlers.py index c84f37c0ed..93b58bb692 100644 --- a/bika/lims/setuphandlers.py +++ b/bika/lims/setuphandlers.py @@ -28,6 +28,8 @@ from bika.lims.catalog import setup_catalogs from bika.lims.catalog.catalog_utilities import addZCTextIndex from plone import api as ploneapi +from plone.app.controlpanel.filter import IFilterSchema + PROFILE_ID = "profile-bika.lims:default" @@ -233,6 +235,11 @@ ("portal_catalog", "Analyst"), ) +ALLOWED_STYLES = [ + "color", + "background-color" +] + def pre_install(portal_setup): """Runs before the first import step of the *default* profile @@ -289,6 +296,7 @@ def setup_handler(context): setup_catalog_mappings(portal) setup_core_catalogs(portal) add_dexterity_setup_items(portal) + setup_html_filter(portal) # Setting up all LIMS catalogs defined in catalog folder setup_catalogs(portal, getCatalogDefinitions()) @@ -527,3 +535,17 @@ def add_dexterity_setup_items(portal): # Enable content type filtering ti.filter_content_types = True + + +def setup_html_filter(portal): + """Setup HTML filtering for resultsinterpretations + """ + logger.info("*** Setup HTML Filter ***") + # bypass the broken API from portal_transforms + adapter = IFilterSchema(portal) + style_whitelist = adapter.style_whitelist + for style in ALLOWED_STYLES: + logger.info("Allow style '{}'".format(style)) + if style not in style_whitelist: + style_whitelist.append(style) + adapter.style_whitelist = style_whitelist diff --git a/bika/lims/upgrade/v01_03_003.py b/bika/lims/upgrade/v01_03_003.py index a04069f3d3..b447febd01 100644 --- a/bika/lims/upgrade/v01_03_003.py +++ b/bika/lims/upgrade/v01_03_003.py @@ -33,6 +33,7 @@ from bika.lims.interfaces import IVerified from bika.lims.setuphandlers import add_dexterity_setup_items from bika.lims.setuphandlers import setup_form_controller_actions +from bika.lims.setuphandlers import setup_html_filter from bika.lims.upgrade import upgradestep from bika.lims.upgrade.utils import UpgradeUtils from Products.Archetypes.config import UID_CATALOG @@ -353,6 +354,9 @@ def upgrade(tool): remove_stale_css(portal) remove_stale_javascripts(portal) + # setup html filtering + setup_html_filter(portal) + logger.info("{0} upgraded to version {1}".format(product, version)) return True From 3ebad52ac1197c8489d40bf19057a17774cb0293 Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Thu, 13 Feb 2020 08:44:15 +0100 Subject: [PATCH 5/7] Changelog updated --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 403e2a9d23..c1b153be71 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,7 @@ Changelog **Added** +- #1536 Integrated Setup and Profiles from senaite.lims - #1534 Integrate browser resources from senaite.lims - #1529 Moved contentmenu provider into core - #1523 Moved Installation Screens into core From b9cd2516deb545c0750b9d617c8b559b58da68d7 Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Thu, 13 Feb 2020 08:54:47 +0100 Subject: [PATCH 6/7] Fixed chinese language code --- bika/lims/profiles/default/portal_languages.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bika/lims/profiles/default/portal_languages.xml b/bika/lims/profiles/default/portal_languages.xml index 22f8da9b40..b037de301e 100644 --- a/bika/lims/profiles/default/portal_languages.xml +++ b/bika/lims/profiles/default/portal_languages.xml @@ -13,11 +13,11 @@ + - - - + + From 1af8d3abd0e0b28ddfaaaa9831fbd6bbe1edd87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Thu, 13 Feb 2020 22:23:38 +0100 Subject: [PATCH 7/7] Import from profile: languagetool --- bika/lims/upgrade/v01_03_003.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bika/lims/upgrade/v01_03_003.py b/bika/lims/upgrade/v01_03_003.py index b447febd01..7d1b3465b5 100644 --- a/bika/lims/upgrade/v01_03_003.py +++ b/bika/lims/upgrade/v01_03_003.py @@ -354,6 +354,9 @@ def upgrade(tool): remove_stale_css(portal) remove_stale_javascripts(portal) + # setup portal languages + setup.runImportStepFromProfile(profile, "languagetool") + # setup html filtering setup_html_filter(portal)