|
30 | 30 | from bika.lims.browser.worksheet.tools import getWorksheetLayouts
|
31 | 31 | from bika.lims.config import CURRENCIES
|
32 | 32 | from bika.lims.config import DECIMAL_MARKS
|
| 33 | +from bika.lims.config import DEFAULT_WORKSHEET_LAYOUT |
33 | 34 | from bika.lims.config import MULTI_VERIFICATION_TYPE
|
34 | 35 | from bika.lims.config import PROJECTNAME
|
35 | 36 | from bika.lims.config import SCINOTATION_OPTIONS
|
36 | 37 | from bika.lims.config import WEEKDAYS
|
37 |
| -from bika.lims.config import DEFAULT_WORKSHEET_LAYOUT |
38 | 38 | from bika.lims.content.bikaschema import BikaFolderSchema
|
39 | 39 | from bika.lims.interfaces import IBikaSetup
|
40 | 40 | from bika.lims.numbergenerator import INumberGenerator
|
|
53 | 53 | from Products.Archetypes.atapi import StringField
|
54 | 54 | from Products.Archetypes.atapi import TextAreaWidget
|
55 | 55 | from Products.Archetypes.atapi import registerType
|
56 |
| -from Products.Archetypes.Field import BooleanField |
57 | 56 | from Products.Archetypes.Field import TextField
|
58 | 57 | from Products.Archetypes.utils import DisplayList
|
59 | 58 | from Products.Archetypes.utils import IntDisplayList
|
60 | 59 | from Products.Archetypes.Widget import RichWidget
|
61 | 60 | from Products.CMFCore.utils import getToolByName
|
| 61 | +from senaite.core import registry as senaite_registry |
62 | 62 | from senaite.core.api import geo
|
63 | 63 | from senaite.core.browser.fields.records import RecordsField
|
64 | 64 | from senaite.core.interfaces import IHideActionsMenu
|
@@ -575,6 +575,25 @@ def getCounterTypes(self, instance=None):
|
575 | 575 | "in the sample types setup"),
|
576 | 576 | )
|
577 | 577 | ),
|
| 578 | + # NOTE: This is a Proxy Field which delegates to the SENAITE Registry! |
| 579 | + TextField( |
| 580 | + "EmailBodySamplePublication", |
| 581 | + default_content_type="text/html", |
| 582 | + default_output_type="text/x-html-safe", |
| 583 | + schemata="Notifications", |
| 584 | + # Needed to fetch the default value from the registry |
| 585 | + edit_accessor="getEmailBodySamplePublication", |
| 586 | + widget=RichWidget( |
| 587 | + label=_("Email body for Sample publication notifications"), |
| 588 | + description=_( |
| 589 | + "The default text that is used for the publication email. " |
| 590 | + " sending publication reports."), |
| 591 | + default_mime_type="text/x-html", |
| 592 | + output_mime_type="text/x-html", |
| 593 | + allow_file_upload=False, |
| 594 | + rows=15, |
| 595 | + ), |
| 596 | + ), |
578 | 597 | BooleanField(
|
579 | 598 | 'NotifyOnSampleRejection',
|
580 | 599 | schemata="Notifications",
|
@@ -966,5 +985,17 @@ def getIDServerValuesHTML(self):
|
966 | 985 | results.append('%s: %s' % (keys[i], values[i]))
|
967 | 986 | return "\n".join(results)
|
968 | 987 |
|
| 988 | + def getEmailBodySamplePublication(self): |
| 989 | + """Get the value from the senaite setup |
| 990 | + """ |
| 991 | + setup = api.get_senaite_setup() |
| 992 | + return setup.getEmailBodySamplePublication() |
| 993 | + |
| 994 | + def setEmailBodySamplePublication(self, value): |
| 995 | + """Set the value in the senaite setup |
| 996 | + """ |
| 997 | + setup = api.get_senaite_setup() |
| 998 | + setup.setEmailBodySamplePublication(value) |
| 999 | + |
969 | 1000 |
|
970 | 1001 | registerType(BikaSetup, PROJECTNAME)
|
0 commit comments