Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URB-3017 centrality & URB-3117 surface fields - LIEGE #299

Open
wants to merge 3 commits into
base: liege-urban2.5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions news/URB-3017.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Add centrality to every licence & make it a multiselect
[daggelpop]
Move centrality in first position in the fieldset
[daggelpop]
2 changes: 2 additions & 0 deletions news/URB-3017.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add centrality to commercial licence
[daggelpop]
2 changes: 2 additions & 0 deletions news/URB-3117.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add 3 surface fields to commercial licence
[daggelpop]
37 changes: 36 additions & 1 deletion src/Products/urban/content/licence/CODT_CommercialLicence.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,42 @@
##/code-section module-header

schema = Schema(
(),
(
IntegerField(
name="surfaceFoodBusiness",
default=0,
widget=IntegerField._properties["widget"](
label=_(
"urban_label_surfaceFoodBusiness",
default="surfaceFoodBusiness",
),
),
schemata="urban_location",
),
IntegerField(
name="surfaceLightBusiness",
default=0,
widget=IntegerField._properties["widget"](
label=_(
"urban_label_surfaceLightBusiness",
default="surfaceLightBusiness",
),
),
schemata="urban_location",
),
IntegerField(
name="surfaceHeavyBusiness",
default=0,
widget=IntegerField._properties["widget"](
label=_(
"urban_label_surfaceHeavyBusiness",
default="surfaceHeavyBusiness",
),
),
schemata="urban_location",
),
),

)

##code-section after-local-schema #fill in your manual code here
Expand Down
26 changes: 25 additions & 1 deletion src/Products/urban/content/licence/GenericLicence.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@
from zope.i18n import translate
from collective.datagridcolumns.ReferenceColumn import ReferenceColumn
from Products.MasterSelectWidget.MasterBooleanWidget import MasterBooleanWidget
from Products.MasterSelectWidget.MasterMultiSelectWidget import MasterMultiSelectWidget
from Products.urban.content.licence.base import UrbanBase
from Products.urban.interfaces import IOpinionRequestEvent
from Products.urban.interfaces import IUrbanEvent
from Products.urban.utils import setOptionalAttributes
from Products.urban.utils import get_interface_by_path

from Products.urban.UrbanVocabularyTerm import UrbanVocabulary
from zope.globalrequest import getRequest

Expand Down Expand Up @@ -643,6 +645,16 @@
default_content_type="text/plain",
default_output_type="text/html",
),
LinesField(
name="centrality",
widget=MasterMultiSelectWidget(
format="checkbox",
label=_("urban_label_centrality", default="Centrality"),
),
schemata="urban_location",
multiValued=1,
vocabulary="listCentralities",
),
LinesField(
name="folderZone",
widget=MultiSelectionWidget(
Expand Down Expand Up @@ -1203,7 +1215,7 @@ def getDefaultValue(self, context=None, field=None):

empty_value = getattr(field, "multivalued", "") and [] or ""
if hasattr(field, "vocabulary") and isinstance(
field.vocabulary, UrbanVocabulary
field.vocabulary, UrbanVocabulary
):
return field.vocabulary.get_default_values(context)
return empty_value
Expand Down Expand Up @@ -1330,6 +1342,18 @@ def listFloodingLevels(self):

return DisplayList(vocab)

security.declarePublic("listCentralities")

def listCentralities(self):
vocab = (
("villageoise", "villageoise"),
("urbaine", "urbaine"),
("urbaine_de_pole", "urbaine de pôle"),
("bordure_de_centralite", "bordure de centralité"),
)
return DisplayList(vocab)


security.declarePublic("foldermanagersBaseQuery")

def foldermanagersBaseQuery(self):
Expand Down
20 changes: 20 additions & 0 deletions src/Products/urban/locales/fr/LC_MESSAGES/urban.po
Original file line number Diff line number Diff line change
Expand Up @@ -3161,6 +3161,11 @@ msgstr "Détails concernant la zone de captage"
msgid "urban_label_category"
msgstr "Catégorie"

#. Default: "Centrality"
#: ../content/licence/CODT_CommercialLicence.py:39
msgid "urban_label_centrality"
msgstr "Centralité"

#. Default: "Changes"
#: PcaTerm.py
msgid "urban_label_changes"
Expand Down Expand Up @@ -5245,6 +5250,21 @@ msgstr "Rubriques"
msgid "urban_label_submissionNumber"
msgstr "N° de soumission"

#. Default: "surfaceFoodBusiness"
#: ../content/licence/CODT_CommercialLicence.py:49
msgid "urban_label_surfaceFoodBusiness"
msgstr "m² de commerce alimentaire"

#. Default: "surfaceHeavyBusiness"
#: ../content/licence/CODT_CommercialLicence.py:71
msgid "urban_label_surfaceHeavyBusiness"
msgstr "m² de commerce lourd"

#. Default: "surfaceLightBusiness"
#: ../content/licence/CODT_CommercialLicence.py:60
msgid "urban_label_surfaceLightBusiness"
msgstr "m² de commerce léger"

#. Default: "Suspension"
#: ../content/UrbanEventInquiry.py:127
msgid "urban_label_suspension"
Expand Down
20 changes: 20 additions & 0 deletions src/Products/urban/locales/urban.pot
Original file line number Diff line number Diff line change
Expand Up @@ -3129,6 +3129,11 @@ msgstr ""
msgid "urban_label_category"
msgstr ""

#. Default: "Centrality"
#: ../content/licence/CODT_CommercialLicence.py:39
msgid "urban_label_centrality"
msgstr ""

#. Default: "Changes"
#: PcaTerm.py
msgid "urban_label_changes"
Expand Down Expand Up @@ -5211,6 +5216,21 @@ msgstr ""
msgid "urban_label_submissionNumber"
msgstr ""

#. Default: "surfaceFoodBusiness"
#: ../content/licence/CODT_CommercialLicence.py:49
msgid "urban_label_surfaceFoodBusiness"
msgstr ""

#. Default: "surfaceHeavyBusiness"
#: ../content/licence/CODT_CommercialLicence.py:71
msgid "urban_label_surfaceHeavyBusiness"
msgstr ""

#. Default: "surfaceLightBusiness"
#: ../content/licence/CODT_CommercialLicence.py:60
msgid "urban_label_surfaceLightBusiness"
msgstr ""

#. Default: "Suspension"
#: ../content/UrbanEventInquiry.py:127
msgid "urban_label_suspension"
Expand Down