Skip to content

Commit

Permalink
Format + Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Oct 11, 2023
1 parent 51c1939 commit 7baa5c0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 61 deletions.
13 changes: 8 additions & 5 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@ Changelog
2.0.1 (unreleased)
------------------

- Add booking details to the export file
- Add hidden booking types for the operator use.
[folix-01]

- Change PrenotazioniFolder.cosa_serve field type to RichText
- Add booking details to the export file.
[folix-01]

- Change PrenotazioniFolder.cosa_serve field type to RichText.
[folix-01]

- Utilizzare defaultFactory se il default è una funzione, altrimenti non viene
eseguita nel momento corretto.
[mamico]

- Rimosso searchabletext di prenotazioni doppio
- Rimosso searchabletext di prenotazioni doppio.
[mamico]

- Aggiunto indexer per fiscalcode uppercase per
fare ricerche case insensitive
fare ricerche case insensitive.
[mamico]

- Remove Contributor from the package permissions map
- Remove Contributor from the package permissions map.
[folix-01]

- Add configurable simultaneous bookings limit for the same user.
Expand Down
33 changes: 8 additions & 25 deletions src/redturtle/prenotazioni/content/prenotazioni_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
from redturtle.prenotazioni import _
from redturtle.prenotazioni.browser.widget import WeekTableOverridesFieldWidget
from redturtle.prenotazioni.config import DEFAULT_VISIBLE_BOOKING_FIELDS
from redturtle.prenotazioni.content.validators import (
PauseValidator,
checkOverrides,
)
from redturtle.prenotazioni.content.validators import PauseValidator, checkOverrides

try:
from plone.app.dexterity import textindexer
Expand All @@ -45,9 +42,7 @@ def get_from_form(form, fieldname):
return value
return None

number_of_entry = request.form.get(
"form.widgets.{}.count".format(fieldname)
)
number_of_entry = request.form.get("form.widgets.{}.count".format(fieldname))
data = []
prefix = "form.widgets.{}".format(fieldname)
for counter in range(int(number_of_entry)):
Expand Down Expand Up @@ -87,9 +82,7 @@ class IWeekTableRow(model.Schema):
)

afternoon_start = schema.Choice(
title=_(
"afternoon_start_label", default="Start time in the afternoon"
),
title=_("afternoon_start_label", default="Start time in the afternoon"),
vocabulary="redturtle.prenotazioni.VocOreInizio",
required=False,
)
Expand Down Expand Up @@ -229,9 +222,7 @@ class IPrenotazioniFolder(model.Schema):
descriptionAgenda = RichText(
required=False,
title=_("Descrizione Agenda", default="Descrizione Agenda"),
description=_(
"Inserire il testo di presentazione dell'agenda corrente"
),
description=_("Inserire il testo di presentazione dell'agenda corrente"),
)

form.mode(descriptionAgenda="display")
Expand All @@ -246,9 +237,7 @@ class IPrenotazioniFolder(model.Schema):

directives.widget(visible_booking_fields=CheckBoxFieldWidget)
visible_booking_fields = schema.List(
title=_(
"label_visible_booking_fields", default="Visible booking fields"
),
title=_("label_visible_booking_fields", default="Visible booking fields"),
description=_(
"help_visible_booking_fields",
"User will not be able to add a booking unless those "
Expand All @@ -266,9 +255,7 @@ class IPrenotazioniFolder(model.Schema):

directives.widget(required_booking_fields=CheckBoxFieldWidget)
required_booking_fields = schema.List(
title=_(
"label_required_booking_fields", default="Required booking fields"
),
title=_("label_required_booking_fields", default="Required booking fields"),
description=_(
"help_required_booking_fields",
"User will not be able to add a booking unless those "
Expand Down Expand Up @@ -518,14 +505,10 @@ def data_validation(data):
raise Invalid(_("You should set a start time for afternoon."))
if interval["morning_start"] and interval["morning_end"]:
if interval["morning_start"] > interval["morning_end"]:
raise Invalid(
_("Morning start should not be greater than end.")
)
raise Invalid(_("Morning start should not be greater than end."))
if interval["afternoon_start"] and interval["afternoon_end"]:
if interval["afternoon_start"] > interval["afternoon_end"]:
raise Invalid(
_("Afternoon start should not be greater than end.")
)
raise Invalid(_("Afternoon start should not be greater than end."))

# TODO: definire o descrivere quando avviee la notifica
# TODO: inserire qui la chiave IO ? o su un config in zope.conf/environment ?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
# -*- coding: utf-8 -*-
from plone import api
from plone.restapi.interfaces import IFieldSerializer, ISerializeToJson
from plone.restapi.serializer.converters import json_compatible
from zope.component import adapter, getMultiAdapter
from zope.i18n import translate
from zope.interface import implementer
from zope.publisher.interfaces import IRequest
from zope.schema import getFields
from copy import deepcopy

from plone.restapi.interfaces import ISerializeToJson
from plone.restapi.serializer.dxcontent import SerializeFolderToJson
from zope.component import adapter
from zope.interface import implementer

from redturtle.prenotazioni import logger
from redturtle.prenotazioni.content.prenotazioni_folder import (
IPrenotazioniFolder,
)
from redturtle.prenotazioni.interfaces import (
ISerializeToPrenotazioneSearchableItem,
)
from redturtle.prenotazioni.content.prenotazioni_folder import IPrenotazioniFolder
from redturtle.prenotazioni.interfaces import IRedturtlePrenotazioniLayer

from copy import deepcopy


@implementer(ISerializeToJson)
@adapter(IPrenotazioniFolder, IRedturtlePrenotazioniLayer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import unittest
from datetime import date, datetime

from Acquisition import aq_parent
from plone import api
from plone.app.testing import (
Expand All @@ -10,6 +11,7 @@
setRoles,
)
from plone.restapi.testing import RelativeSession

from redturtle.prenotazioni.adapters.booker import IBooker
from redturtle.prenotazioni.testing import REDTURTLE_PRENOTAZIONI_INTEGRATION_TESTING
from redturtle.prenotazioni.tests.helpers import WEEK_TABLE_SCHEMA
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
# -*- coding: UTF-8 -*-
import email
import unittest
from datetime import date, datetime, timedelta
from datetime import date

import pytz
from collective.contentrules.mailfromfield.actions.mail import (
MailFromFieldAction,
)
from plone import api
from plone.app.testing import TEST_USER_ID, setRoles
from plone.contentrules.rule.interfaces import IExecutable
from Products.CMFCore.WorkflowCore import ActionSucceededEvent
from plone.restapi.interfaces import ISerializeToJson
from zope.component import getMultiAdapter
from zope.globalrequest import getRequest
from zope.interface import implementer
from zope.interface.interfaces import IObjectEvent
from zope.globalrequest import getRequest
from plone.restapi.interfaces import ISerializeToJson

from redturtle.prenotazioni.adapters.booker import IBooker
from redturtle.prenotazioni.testing import (
REDTURTLE_PRENOTAZIONI_FUNCTIONAL_TESTING,
)
from redturtle.prenotazioni.testing import REDTURTLE_PRENOTAZIONI_FUNCTIONAL_TESTING


@implementer(IObjectEvent)
Expand Down

0 comments on commit 7baa5c0

Please sign in to comment.