diff --git a/CHANGES.rst b/CHANGES.rst index 35c223f..d5c058d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,11 @@ Changelog - Compatibilize with the 2.0.1 redturtle.prenotazioni version. - Add the UO.contact_info field to @bookable-uo-list response. [folix-01] + [folix-01] +- Add the UO.contact_info field to @bookable-uo-list response. + [folix-01] +- Extend prenotazioni email vars list. + [folix-01] 1.1.10 (2023-10-16) diff --git a/src/design/plone/ioprenoto/adapters/configure.zcml b/src/design/plone/ioprenoto/adapters/configure.zcml index 859b395..5343e88 100644 --- a/src/design/plone/ioprenoto/adapters/configure.zcml +++ b/src/design/plone/ioprenoto/adapters/configure.zcml @@ -22,4 +22,11 @@ name="booking_operator_url" /> + + diff --git a/src/design/plone/ioprenoto/adapters/stringinterp.py b/src/design/plone/ioprenoto/adapters/stringinterp.py index e0f46ee..79b2c44 100644 --- a/src/design/plone/ioprenoto/adapters/stringinterp.py +++ b/src/design/plone/ioprenoto/adapters/stringinterp.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from plone import api from plone.registry.interfaces import IRegistry +from plone.stringinterp.adapters import BaseSubstitution from plone.volto.interfaces import IVoltoSettings from redturtle.prenotazioni.adapters import stringinterp as base from zope.component import adapter, getUtility @@ -62,3 +63,24 @@ def safe_call(self): booking_folder.getPhysicalPath()[len(portal.getPhysicalPath()) :] # noqa ) return f"{portal_url}/{booking_folder_path}?tab=search&SearchableText={self.context.getBookingCode()}&login=1" + + +@adapter(Interface) +class BookingUnitaOrganizzativaTitle(BaseSubstitution): + def safe_call(self): + return getattr( + getattr( + next( + iter( + getattr( + self.context.getPrenotazioniFolder(), "uffici_correlati", [] + ) + ), + None, + ), + "to_object", + None, + ), + "title", + "", + )