From 7e3556bb505e9431a72bcb5df644debf6e88646c Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Mon, 16 Jun 2025 11:49:58 +0200 Subject: [PATCH 01/25] add municipal directive vocabulary --- .../urban/locales/fr/LC_MESSAGES/urban.po | 24 +++++++++ src/Products/urban/migration/update_270.py | 53 ++++++++++++++++++- src/Products/urban/migration/upgrades.zcml | 8 +++ .../urban/profiles/default/metadata.xml | 4 +- 4 files changed, 86 insertions(+), 3 deletions(-) diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po index fc91e9de0..d46a36f93 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po @@ -5430,3 +5430,27 @@ msgstr "ans" msgid "zip_folder_title" msgstr "Zone d'initiative privilégiée" + +msgid "chapter_1_guiding_principles" +msgstr "Chapitre 1 : principes directeurs" + +msgid "chapter_2_density" +msgstr "Chapitre 2 : densité" + +msgid "chapter_3_surface_area" +msgstr "Chapitre 3 : superficie" + +msgid "chapter_4_parking" +msgstr "Chapitre 4 : Stationnement" + +msgid "chapter_5_stormwater_management" +msgstr "Chapitre 5 : gestion des eaux pluviales" + +msgid "chapter_6_service_premises" +msgstr "Chapitre 6 : Locaux de service" + +msgid "chapter_7_collective_housing" +msgstr "Chapitre 7 : logement collectif" + +msgid "municipal_directive_folder_title" +msgstr "Directive communale" \ No newline at end of file diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index 3f157340b..ba451ad56 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -7,6 +7,7 @@ from Products.urban.interfaces import IGenericLicence from Products.urban.migration.utils import refresh_workflow_permissions from Products.urban.setuphandlers import createFolderDefaultValues +from Products.urban.setuphandlers import createVocabularyFolder from imio.schedule.content.object_factories import MacroCreationConditionObject from imio.schedule.content.object_factories import MacroEndConditionObject from imio.schedule.content.object_factories import MacroFreezeConditionObject @@ -38,6 +39,7 @@ from zope.component import getUtility import logging +from zope.i18n import translate def rename_patrimony_certificate(context): @@ -481,4 +483,53 @@ def add_new_registry_for_missing_capakey(context): registry.records[key] = registry_record logger.info("migration done!") - \ No newline at end of file + +def add_municipal_directive_vocabulary(context): + logger = logging.getLogger("urban: Add municipal directive vocabulary") + logger.info("starting migration steps") + + container = api.portal.get_tool("portal_urban") + vocabulary_name = "municipal_directive" + + municipal_directive_vocabulary_config = [ + + { + "id": "guiding-principles", + "title": translate(_("chapter_1_guiding_principles"), context=context.REQUEST) + }, + { + "id": "density", + "title": translate(_("chapter_2_density"), context=context.REQUEST) + }, + { + "id": "surface-area", + "title": translate(_("chapter_3_surface_area"), context=context.REQUEST) + }, + { + "id": "parking", + "title": translate(_("chapter_4_parking"), context=context.REQUEST) + }, + { + "id": "stormwater-management", + "title": translate(_("chapter_5_stormwater_management"), context=context.REQUEST) + }, + { + "id": "service-premises", + "title": translate(_("chapter_6_service_premises"), context=context.REQUEST) + }, + { + "id": "collective-housing", + "title": translate(_("chapter_7_collective_housing"), context=context.REQUEST) + } + ] + municipal_directive_config = createVocabularyFolder( + container, vocabulary_name, context, "UrbanVocabularyTerm" + ) + + createFolderDefaultValues( + municipal_directive_config, + municipal_directive_vocabulary_config, + "UrbanVocabularyTerm" + ) + + logger.info("upgrade done!") \ No newline at end of file diff --git a/src/Products/urban/migration/upgrades.zcml b/src/Products/urban/migration/upgrades.zcml index 59e1f7fe8..16971dc24 100644 --- a/src/Products/urban/migration/upgrades.zcml +++ b/src/Products/urban/migration/upgrades.zcml @@ -782,5 +782,13 @@ handler=".update_270.add_new_registry_for_missing_capakey" profile="Products.urban:default" /> + diff --git a/src/Products/urban/profiles/default/metadata.xml b/src/Products/urban/profiles/default/metadata.xml index 83073fe15..86b1cbeb3 100644 --- a/src/Products/urban/profiles/default/metadata.xml +++ b/src/Products/urban/profiles/default/metadata.xml @@ -1,7 +1,7 @@ - 1165 + 1166 profile-Products.urban:preinstall - + \ No newline at end of file From ee4a287c9a99f2d06115f315ec6ff198fa465d52 Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Tue, 17 Jun 2025 09:47:20 +0200 Subject: [PATCH 02/25] add municipalDirective field for location shemata --- src/Products/urban/content/licence/GenericLicence.py | 11 +++++++++++ src/Products/urban/locales/fr/LC_MESSAGES/urban.po | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/Products/urban/content/licence/GenericLicence.py b/src/Products/urban/content/licence/GenericLicence.py index d69d79534..7875dc39f 100755 --- a/src/Products/urban/content/licence/GenericLicence.py +++ b/src/Products/urban/content/licence/GenericLicence.py @@ -1464,6 +1464,17 @@ schemata="urban_environment", default_output_type="text/x-html-safe", ), + LinesField( + name="municipalDirective", + widget=MultiSelect2Widget( + size=10, + label=_("urban_label_municipalDirective", default="municipalDirective"), + ), + schemata="urban_location", + multiValued=True, + vocabulary=UrbanVocabulary("municipal_directive",vocType='UrbanVocabularyTerm', inUrbanConfig=False), + default_method="getDefaultValue", + ), ), ) diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po index d46a36f93..5d4958822 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po @@ -5453,4 +5453,7 @@ msgid "chapter_7_collective_housing" msgstr "Chapitre 7 : logement collectif" msgid "municipal_directive_folder_title" +msgstr "Directive communale" + +msgid "urban_label_municipalDirective" msgstr "Directive communale" \ No newline at end of file From d9aee8c261636783ad16b74a2206d0f33abeef22 Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Tue, 17 Jun 2025 09:52:04 +0200 Subject: [PATCH 03/25] add changelog --- news/URB-3342.feature | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 news/URB-3342.feature diff --git a/news/URB-3342.feature b/news/URB-3342.feature new file mode 100644 index 000000000..5e5e93d65 --- /dev/null +++ b/news/URB-3342.feature @@ -0,0 +1,2 @@ +Add vocabulary for municipal directives and include a field for location in the schema. +[WBoudabous] \ No newline at end of file From 9be8031ef4d75599bb3363c4d99f4733c582be9f Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Tue, 17 Jun 2025 10:43:43 +0200 Subject: [PATCH 04/25] rename vocanulary --- .../urban/content/licence/GenericLicence.py | 23 +++++++-------- .../urban/locales/fr/LC_MESSAGES/urban.po | 28 +++++++++---------- src/Products/urban/migration/update_270.py | 28 +++++++++---------- src/Products/urban/migration/upgrades.zcml | 2 +- 4 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/Products/urban/content/licence/GenericLicence.py b/src/Products/urban/content/licence/GenericLicence.py index 7875dc39f..50f4e20d4 100755 --- a/src/Products/urban/content/licence/GenericLicence.py +++ b/src/Products/urban/content/licence/GenericLicence.py @@ -1022,6 +1022,17 @@ schemata="urban_location", default_output_type="text/x-html-safe", ), + LinesField( + name="municipalDirective", + widget=MultiSelect2Widget( + size=10, + label=_("urban_label_municipalDirective", default="municipalDirective"), + ), + schemata="urban_location", + multiValued=True, + vocabulary=UrbanVocabulary("municipal_directive",vocType='UrbanVocabularyTerm', inUrbanConfig=False), + default_method="getDefaultValue", + ), LinesField( name="PRenU", widget=MultiSelect2Widget( @@ -1464,17 +1475,7 @@ schemata="urban_environment", default_output_type="text/x-html-safe", ), - LinesField( - name="municipalDirective", - widget=MultiSelect2Widget( - size=10, - label=_("urban_label_municipalDirective", default="municipalDirective"), - ), - schemata="urban_location", - multiValued=True, - vocabulary=UrbanVocabulary("municipal_directive",vocType='UrbanVocabularyTerm', inUrbanConfig=False), - default_method="getDefaultValue", - ), + ), ) diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po index 5d4958822..7571e5a25 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po @@ -5431,26 +5431,26 @@ msgstr "ans" msgid "zip_folder_title" msgstr "Zone d'initiative privilégiée" -msgid "chapter_1_guiding_principles" -msgstr "Chapitre 1 : principes directeurs" +msgid "chapter_1" +msgstr "Chapitre 1" -msgid "chapter_2_density" -msgstr "Chapitre 2 : densité" +msgid "chapter_2" +msgstr "Chapitre 2" -msgid "chapter_3_surface_area" -msgstr "Chapitre 3 : superficie" +msgid "chapter_3" +msgstr "Chapitre 3" -msgid "chapter_4_parking" -msgstr "Chapitre 4 : Stationnement" +msgid "chapter_4" +msgstr "Chapitre 4" -msgid "chapter_5_stormwater_management" -msgstr "Chapitre 5 : gestion des eaux pluviales" +msgid "chapter_5" +msgstr "Chapitre 5" -msgid "chapter_6_service_premises" -msgstr "Chapitre 6 : Locaux de service" +msgid "chapter_6" +msgstr "Chapitre 6" -msgid "chapter_7_collective_housing" -msgstr "Chapitre 7 : logement collectif" +msgid "chapter_7" +msgstr "Chapitre 7" msgid "municipal_directive_folder_title" msgstr "Directive communale" diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index ba451ad56..3ca8f858f 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -494,32 +494,32 @@ def add_municipal_directive_vocabulary(context): municipal_directive_vocabulary_config = [ { - "id": "guiding-principles", - "title": translate(_("chapter_1_guiding_principles"), context=context.REQUEST) + "id": "chapter_1", + "title": translate(_("chapter_1"), context=context.REQUEST) }, { - "id": "density", - "title": translate(_("chapter_2_density"), context=context.REQUEST) + "id": "chapter_2", + "title": translate(_("chapter_2"), context=context.REQUEST) }, { - "id": "surface-area", - "title": translate(_("chapter_3_surface_area"), context=context.REQUEST) + "id": "chapter_3", + "title": translate(_("chapter_3"), context=context.REQUEST) }, { - "id": "parking", - "title": translate(_("chapter_4_parking"), context=context.REQUEST) + "id": "chapter_4", + "title": translate(_("chapter_4"), context=context.REQUEST) }, { - "id": "stormwater-management", - "title": translate(_("chapter_5_stormwater_management"), context=context.REQUEST) + "id": "chapter_5", + "title": translate(_("chapter_5"), context=context.REQUEST) }, { - "id": "service-premises", - "title": translate(_("chapter_6_service_premises"), context=context.REQUEST) + "id": "chapter_6", + "title": translate(_("chapter_6"), context=context.REQUEST) }, { - "id": "collective-housing", - "title": translate(_("chapter_7_collective_housing"), context=context.REQUEST) + "id": "chapter_7", + "title": translate(_("chapter_7"), context=context.REQUEST) } ] municipal_directive_config = createVocabularyFolder( diff --git a/src/Products/urban/migration/upgrades.zcml b/src/Products/urban/migration/upgrades.zcml index 16971dc24..ecac76cf7 100644 --- a/src/Products/urban/migration/upgrades.zcml +++ b/src/Products/urban/migration/upgrades.zcml @@ -783,7 +783,7 @@ profile="Products.urban:default" /> Date: Wed, 18 Jun 2025 16:23:33 +0200 Subject: [PATCH 05/25] URBBDC-3142: Fix changelog --- news/URB-3293.bugfix | 2 -- news/URBBDC-3142.feature | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 news/URB-3293.bugfix create mode 100644 news/URBBDC-3142.feature diff --git a/news/URB-3293.bugfix b/news/URB-3293.bugfix deleted file mode 100644 index 0ae106a9a..000000000 --- a/news/URB-3293.bugfix +++ /dev/null @@ -1,2 +0,0 @@ -Add RoadDecree to URBAN_TYPES to be able to use it in the tests. -[aduchene] \ No newline at end of file diff --git a/news/URBBDC-3142.feature b/news/URBBDC-3142.feature new file mode 100644 index 000000000..55cdcd5dd --- /dev/null +++ b/news/URBBDC-3142.feature @@ -0,0 +1,2 @@ +Add building procedure's +[WBoudabous, aduchene] From 369692cca483e95f42ecf438aea3cce0d67cc187 Mon Sep 17 00:00:00 2001 From: Martin Peeters Date: Wed, 18 Jun 2025 16:25:54 +0200 Subject: [PATCH 06/25] Preparing release 2.7.41 --- docs/CHANGES.rst | 12 ++++++++++++ news/SUP-39760.feature | 2 -- news/URBBDC-3142.feature | 2 -- setup.py | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) delete mode 100644 news/SUP-39760.feature delete mode 100644 news/URBBDC-3142.feature diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index 8468032e0..927e23b58 100644 --- a/docs/CHANGES.rst +++ b/docs/CHANGES.rst @@ -8,6 +8,18 @@ Changelog .. towncrier release notes start +2.7.41 (2025-06-18) +------------------- + +New features: + + +- Add translation for nonapplicable state in Division + [jchandelle] (SUP-39760) +- Add building procedure's + [WBoudabous, aduchene] (URBBDC-3142) + + 2.7.40 (2025-06-10) ------------------- diff --git a/news/SUP-39760.feature b/news/SUP-39760.feature deleted file mode 100644 index 64930223f..000000000 --- a/news/SUP-39760.feature +++ /dev/null @@ -1,2 +0,0 @@ -Add translation for nonapplicable state in Division -[jchandelle] \ No newline at end of file diff --git a/news/URBBDC-3142.feature b/news/URBBDC-3142.feature deleted file mode 100644 index 55cdcd5dd..000000000 --- a/news/URBBDC-3142.feature +++ /dev/null @@ -1,2 +0,0 @@ -Add building procedure's -[WBoudabous, aduchene] diff --git a/setup.py b/setup.py index d3d350f47..6c1fa1b28 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "2.7.41.dev0" +version = "2.7.41" setup( name="Products.urban", From 17860f4150695da93ef05f5343844aadb8fe03ef Mon Sep 17 00:00:00 2001 From: Martin Peeters Date: Wed, 18 Jun 2025 19:40:16 +0200 Subject: [PATCH 07/25] Back to development: 2.7.42 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6c1fa1b28..6b9bd8260 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "2.7.41" +version = "2.7.42.dev0" setup( name="Products.urban", From ce9806e9f8324b7d728eabcf2688ceb09d50afcf Mon Sep 17 00:00:00 2001 From: jimbiscuit Date: Fri, 20 Jun 2025 09:38:56 +0200 Subject: [PATCH 08/25] SUP-36370 Fix registry encoding --- src/Products/urban/migration/update_270.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index d895eb181..a65302994 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -485,8 +485,8 @@ def add_new_registry_for_missing_capakey(context): registry = getUtility(IRegistry) key = "Products.urban.interfaces.IMissingCapakey" registry_field = List( - title="Missing capakey", - description="List of missing capakey", + title=u"Missing capakey", + description=u"List of missing capakey", value_type=TextLine(), ) registry_record = Record(registry_field) From f89f2f7f3960b5cbc17b0070a73af24eceeea0a1 Mon Sep 17 00:00:00 2001 From: Martin Peeters Date: Thu, 26 Jun 2025 14:11:49 +0200 Subject: [PATCH 09/25] Revert "URBBDC-3142 (#379)" This change is still in progress This reverts commit 49a305ed6a60647dcc12db381597954dccfbfdf0. --- src/Products/urban/LicenceConfig.py | 8 - src/Products/urban/__init__.py | 2 - .../urban/browser/licence/configure.zcml | 15 - .../urban/browser/licence/housingview.py | 50 -- .../licence/templates/housingmacros.pt | 52 -- .../browser/licence/templates/housingview.pt | 13 - src/Products/urban/config.py | 5 +- src/Products/urban/configure.zcml | 4 - .../content/licence/CODT_BaseBuildLicence.py | 49 +- src/Products/urban/content/licence/Housing.py | 37 -- .../urban/content/licence/Inspection.py | 14 - .../urban/dashboard/config/housings.xml | 160 ------ src/Products/urban/interfaces.py | 8 - .../urban/locales/fr/LC_MESSAGES/plone.po | 3 - .../urban/locales/fr/LC_MESSAGES/urban.po | 40 -- src/Products/urban/locales/urban-manual.pot | 3 - src/Products/urban/locales/urban.pot | 17 - src/Products/urban/migration/update_270.py | 139 ++--- src/Products/urban/migration/upgrades.zcml | 8 - .../urban/profiles/default/metadata.xml | 4 +- .../profiles/extra/config_default_values.py | 42 -- .../urban/profiles/preinstall/workflows.xml | 523 +++++++++--------- .../urban/profiles/urban_types/types.xml | 376 +++++++------ .../profiles/urban_types/types/Housing.xml | 66 --- .../urban/schedule/config/housing.xml | 120 ---- src/Products/urban/schedule/vocabulary.py | 1 - .../skins/urban_templates/housing_edit.pt | 27 - 27 files changed, 494 insertions(+), 1292 deletions(-) delete mode 100644 src/Products/urban/browser/licence/housingview.py delete mode 100644 src/Products/urban/browser/licence/templates/housingmacros.pt delete mode 100644 src/Products/urban/browser/licence/templates/housingview.pt delete mode 100644 src/Products/urban/content/licence/Housing.py delete mode 100644 src/Products/urban/dashboard/config/housings.xml delete mode 100644 src/Products/urban/profiles/urban_types/types/Housing.xml delete mode 100644 src/Products/urban/schedule/config/housing.xml delete mode 100644 src/Products/urban/skins/urban_templates/housing_edit.pt diff --git a/src/Products/urban/LicenceConfig.py b/src/Products/urban/LicenceConfig.py index 8a715b552..145d8f953 100644 --- a/src/Products/urban/LicenceConfig.py +++ b/src/Products/urban/LicenceConfig.py @@ -513,13 +513,6 @@ def getTabsConfigRows(self): "patrimony", "environment", ] - housing_tabs_config = [ - "description", - "advices", - "inspection", - "habitation", - "location", - ] patrimonycertificate_tabs_config = [ "description", "analysis", @@ -560,7 +553,6 @@ def getTabsConfigRows(self): "explosivespossession": explosivespossession_tabs_config, "envclassbordering": env_inquiry_tabs_config, "inspection": inspection_tabs_config, - "housing": housing_tabs_config, "patrimonycertificate": patrimonycertificate_tabs_config, "ticket": ticket_tabs_config, "roaddecree": buildlicence_tabs_config, diff --git a/src/Products/urban/__init__.py b/src/Products/urban/__init__.py index adb6775b5..3bff045a1 100644 --- a/src/Products/urban/__init__.py +++ b/src/Products/urban/__init__.py @@ -134,7 +134,6 @@ from Products.urban.content.licence import UniqueLicence # noqa from Products.urban.content.licence import ExplosivesPossession # noqa from Products.urban.content.licence import RoadDecree # noqa -from Products.urban.content.licence import Housing # noqa from Products.urban.content import CODT_Inquiry # noqa from Products.urban.content import CODT_UniqueLicenceInquiry # noqa from Products.urban.content import FollowUpEventType # noqa @@ -203,7 +202,6 @@ def initialize(context): import content.licence.CODT_UrbanCertificateTwo import content.licence.Declaration import content.licence.Division - import content.licence.Housing import content.licence.EnvClassThree import content.licence.EnvClassTwo import content.licence.EnvClassOne diff --git a/src/Products/urban/browser/licence/configure.zcml b/src/Products/urban/browser/licence/configure.zcml index 888fce9ef..07f0a02e8 100644 --- a/src/Products/urban/browser/licence/configure.zcml +++ b/src/Products/urban/browser/licence/configure.zcml @@ -472,21 +472,6 @@ permission="zope2.View" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Products/urban/browser/licence/templates/housingview.pt b/src/Products/urban/browser/licence/templates/housingview.pt deleted file mode 100644 index 1a3e774e2..000000000 --- a/src/Products/urban/browser/licence/templates/housingview.pt +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/Products/urban/config.py b/src/Products/urban/config.py index 5fa83abdc..5a104b77e 100755 --- a/src/Products/urban/config.py +++ b/src/Products/urban/config.py @@ -223,10 +223,9 @@ def section(self, section_name): "CODT_NotaryLetter", "ProjectMeeting", "ExplosivesPossession", - 'RoadDecree', + # 'RoadDecree', "Inspection", "Ticket", - "Housing", ] URBAN_TYPES_ACRONYM = { @@ -261,7 +260,6 @@ def section(self, section_name): "RoadDecree": "DV", "Inspection": "INSP", "Ticket": "PV", - "Housing": "LOG", } URBAN_CWATUPE_TYPES = [ @@ -301,7 +299,6 @@ def section(self, section_name): "RoadDecree", "Inspection", "Ticket", - "Housing", ] URBAN_ENVIRONMENT_TYPES = [ diff --git a/src/Products/urban/configure.zcml b/src/Products/urban/configure.zcml index 512da0a3f..166599d02 100644 --- a/src/Products/urban/configure.zcml +++ b/src/Products/urban/configure.zcml @@ -309,10 +309,6 @@ interface=".interfaces.IIntentionToSubmitAmendedPlans" type=".interfaces.IEventTypeType"/> - - - - - - sorting - Tri - top - default - True - eea.faceted.vocabularies.SortingCatalogIndexes - created(reverse) - - - collection-link - Procédures - top - default - True - - - - collective.eeafaceted.collectionwidget.cachedcollectionvocabulary - True - True - - e0a93b95e3974e5ca02ba8f6e859cef6 - - - daterange - Date de la décision - top - advanced - False - getDecisionDate - - c-10:c+10 - - - daterange - Date de validité - top - advanced - False - getValidityDate - - c-10:c+10 - - - text - Demandeur - top - advanced - False - applicantInfosIndex - - True - True - - - autocomplete - Rue - top - advanced - False - StreetsUID - - sreets-autocomplete-suggest - True - - - text - N° de police - top - advanced - False - StreetNumber - - True - - - - autocomplete - Référence cadastrale - top - advanced - False - parcelInfosIndex - - cadastral-autocomplete-suggest - True - - - text - Référence supplémentaire - top - advanced - False - getAdditionalReference - - True - True - - - text - Titre, référence - center - default - False - Title - - True - True - - - select - Agent traitant - center - default - False - - - - folder_manager - urban.folder_managers - - - - - - checkbox - État - center - default - False - 0 - 0 - 0 - review_state - or - 0 - urban.rootfolder_licence_state - - 0 - - - resultsperpage - Results per page - center - default - False - 0 - 50 - 10 - 20 - - - \ No newline at end of file diff --git a/src/Products/urban/interfaces.py b/src/Products/urban/interfaces.py index 795b52ba6..73523a9e5 100644 --- a/src/Products/urban/interfaces.py +++ b/src/Products/urban/interfaces.py @@ -328,10 +328,6 @@ class IInspection(IGenericLicence): Marker interface for inspection """ -class IHousing(IGenericLicence): - """ - Marker interface for inspection - """ class ITicket(IGenericLicence): """ @@ -577,10 +573,6 @@ class ITransferOfLicenceEvent(Interface): __doc__ = _("""ITransferOfLicence type marker interface""") -class IObservationEvent(Interface): - __doc__ = _("""IObservationEvent type marker interface""") - - class IUrbanBase(Interface): """Marker interface for .Base.UrbanBase""" diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/plone.po b/src/Products/urban/locales/fr/LC_MESSAGES/plone.po index 6b8b19f04..dc2cb523d 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/plone.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/plone.po @@ -57,9 +57,6 @@ msgstr "Certificat d'urbanisme 1 (CODT)" msgid "CODT_UrbanCertificateTwo" msgstr "Certificats d'urbanisme 2 (CODT)" -msgid "Housing" -msgstr "Logement" - msgid "City" msgstr "Localité" diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po index a164f0ce0..fc91e9de0 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po @@ -674,11 +674,6 @@ msgstr "Fin des travaux" msgid "ImpactStudy event type marker interface" msgstr "Étude d'incidence" -#: ../interfaces.py:581 -msgid "IObservationEvent type marker interface" -msgstr "Constat" - -#: ../browser/urbaneventviews.py:294 #: ../browser/urbaneventviews.py:330 msgid "Import" msgstr "Import" @@ -1613,9 +1608,6 @@ msgstr "Paramètres des détentions d'explosifs" msgid "explosivespossessions" msgstr "Détention d'explosifs" -msgid "Housing" -msgstr "Logement" - msgid "externaldecisions_folder_title" msgstr "Décision des avis externes" @@ -1864,9 +1856,6 @@ msgstr "Périodes de suspension d'enquête" msgid "inquiry_title_and_number" msgstr "Enquête n°${number}" -msgid "housing_urbanconfig_title" -msgstr "Paramètres logements" - msgid "inspection_urbanconfig_title" msgstr "Paramètres de l'inspection" @@ -5441,32 +5430,3 @@ msgstr "ans" msgid "zip_folder_title" msgstr "Zone d'initiative privilégiée" - -msgid "dimensiontypes_folder_title" -msgstr "Types de dimension" - -msgid "units_folder_title" -msgstr "Unités" - -msgid "observationitems_folder_title" -msgstr "Eléments de constatation" -msgid "urban_label_dimensions" -msgstr "Dimensions" - -msgid "dimensions" -msgstr "Dimensions" - -msgid "urban_label_observationItems" -msgstr "Eléments de constatation" - -msgid "Unit" -msgstr "Unité" - -msgid "Details" -msgstr "Détails" - -msgid "Value" -msgstr "Valeur" - -msgid "urban_label_dimensions" -msgstr "Dimensions" \ No newline at end of file diff --git a/src/Products/urban/locales/urban-manual.pot b/src/Products/urban/locales/urban-manual.pot index 3cc804442..16f81f584 100644 --- a/src/Products/urban/locales/urban-manual.pot +++ b/src/Products/urban/locales/urban-manual.pot @@ -415,9 +415,6 @@ msgstr "" msgid "inspection_urbanconfig_title" msgstr "" -msgid "housing_urbanconfig_title" -msgstr "" - msgid "inspectioncontexts_folder_title" msgstr "" diff --git a/src/Products/urban/locales/urban.pot b/src/Products/urban/locales/urban.pot index d14d99663..03d7d5263 100644 --- a/src/Products/urban/locales/urban.pot +++ b/src/Products/urban/locales/urban.pot @@ -663,11 +663,6 @@ msgstr "" msgid "ImpactStudy event type marker interface" msgstr "" -#: ../interfaces.py:581 -msgid "IObservationEvent type marker interface" -msgstr "" - -#: ../browser/urbaneventviews.py:294 #: ../browser/urbaneventviews.py:330 msgid "Import" msgstr "" @@ -1597,9 +1592,6 @@ msgstr "" msgid "explosivespossessions" msgstr "" -msgid "Housing" -msgstr "" - msgid "externaldecisions_folder_title" msgstr "" @@ -5398,12 +5390,3 @@ msgstr "" msgid "zip_folder_title" msgstr "" - -msgid "dimensiontypes_folder_title" -msgstr "" - -msgid "units_folder_title" -msgstr "" - -msgid "urban_label_dimensions" -msgstr "" \ No newline at end of file diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index a65302994..3f157340b 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -7,8 +7,6 @@ from Products.urban.interfaces import IGenericLicence from Products.urban.migration.utils import refresh_workflow_permissions from Products.urban.setuphandlers import createFolderDefaultValues -from Products.urban.profiles.extra.config_default_values import default_values -from Products.urban.setuphandlers import createVocabularyFolder from imio.schedule.content.object_factories import MacroCreationConditionObject from imio.schedule.content.object_factories import MacroEndConditionObject from imio.schedule.content.object_factories import MacroFreezeConditionObject @@ -52,9 +50,7 @@ def rename_patrimony_certificate(context): patrimony_folder.setTitle(u"Patrimoines") patrimony_folder.reindexObject(["Title"]) - patrimony_collection = ( - portal.urban.patrimonycertificates.collection_patrimonycertificate - ) + patrimony_collection = portal.urban.patrimonycertificates.collection_patrimonycertificate patrimony_collection.setTitle(u"Patrimoines") patrimony_collection.reindexObject(["Title"]) @@ -71,9 +67,7 @@ def rename_content_rule(context): logger.info("starting upgrade steps") setup_tool = api.portal.get_tool("portal_setup") - setup_tool.runImportStepFromProfile( - "profile-Products.urban:default", "contentrules" - ) + setup_tool.runImportStepFromProfile("profile-Products.urban:default", "contentrules") logger.info("upgrade step done!") @@ -86,7 +80,7 @@ def fix_supended_state_licence(context): refresh_workflow_permissions( "codt_buildlicence_workflow", folder_path=urban_path, - for_states=["suspension", "frozen_suspension"], + for_states=["suspension", "frozen_suspension"] ) logger.info("upgrade done!") @@ -124,20 +118,21 @@ def _replace_object(obj, new_type, condition=None, logger=None): if isinstance(round_to_day, dict): round_to_day = round_to_day.get("token", None) + new_obj = api.content.create( container=container, type=new_type, id=old_obj_data["id"], title=old_obj_data["title"], start_date=start_date, - enabled=old_obj_data.get("enabled", None), + enabled=old_obj_data.get("enabled",None), default_assigned_group=default_assigned_group, default_assigned_user=default_assigned_user, - warning_delay=old_obj_data.get("warning_delay", None), - additional_delay=old_obj_data.get("additional_delay", None), - additional_delay_type=old_obj_data.get("additional_delay_type", None), + warning_delay=old_obj_data.get("warning_delay",None), + additional_delay=old_obj_data.get("additional_delay",None), + additional_delay_type=old_obj_data.get("additional_delay_type",None), round_to_day=round_to_day, - activate_recurrency=old_obj_data.get("activate_recurrency", None), + activate_recurrency=old_obj_data.get("activate_recurrency",None), ) log_info(logger, "{} created".format("/".join(obj.getPhysicalPath()))) @@ -176,12 +171,12 @@ def _replace_object(obj, new_type, condition=None, logger=None): key, set( [ - value( - condition=item.get("condition", None), - operator=item.get("operator", None), - display_status=item.get("display_status", None), - ) - for item in old_obj_data[key] + value( + condition=item.get("condition", None), + operator=item.get("operator", None), + display_status=item.get("display_status", None), + ) + for item in old_obj_data[key] ] ), ) @@ -207,11 +202,9 @@ def _replace_object(obj, new_type, condition=None, logger=None): dashboard_collection.showNumberOfItems = True query = [ - ( - {"i": filter["i"], "o": filter["o"], "v": old_obj_data["UID"]} - if filter["i"] == "CompoundCriterion" - else filter - ) + {"i": filter["i"], "o": filter["o"], "v": old_obj_data["UID"]} + if filter["i"] == "CompoundCriterion" + else filter for filter in dashboard_collection.query ] @@ -247,9 +240,7 @@ def fix_config_wrong_class(context): def add_new_voc_terms_for_form_composition(context): - logger = logging.getLogger( - "urban: Add new vocabularies to portal_urban/form_composition" - ) + logger = logging.getLogger("urban: Add new vocabularies to portal_urban/form_composition") logger.info("starting upgrade steps") portal_urban = api.portal.get()["portal_urban"] @@ -260,25 +251,35 @@ def add_new_voc_terms_for_form_composition(context): # for the existing vocabulary terms # that will be initiated in each new instance form_composition_new_vocabulary_terms_to_add = [ - {"id": "10", "title": "1/1 Formulaire général permis environnement et unique"}, - {"id": "11", "title": "1/2 Élevage et détention d'animaux"}, + { + "id": "10", + "title": u"1/1 Formulaire général permis environnement et unique" + }, + { + "id": "11", + "title": u"1/2 Élevage et détention d'animaux" + }, { "id": "12", - "title": "Annexe V/1 - Implantation d'un commerce", + "title": u"Annexe V/1 - Implantation d'un commerce", }, { "id": "13", - "title": "Annexe IX - Permis d'urbanisme dispensé d'un architecte ou autre que les demandes visées aux annexes 5 à 8", + "title": u"Annexe IX - Permis d'urbanisme dispensé d'un architecte ou autre que les demandes visées aux annexes 5 à 8", }, { "id": "14", - "title": "Annexe X - Demande de permis d'urbanisation ou de modification de permis d'urbanisation", + "title": u"Annexe X - Demande de permis d'urbanisation ou de modification de permis d'urbanisation" }, { "id": "15", - "title": "Annexe XI - Demande de permis d'urbanisation ou de modification de permis d'urbanisation avec contenu simplifié", + "title": u"Annexe XI - Demande de permis d'urbanisation ou de modification de permis d'urbanisation avec contenu simplifié" + }, + { + "id": "16", + "title": u"Annexe XV - Demande de certificat d'urbanisme n°2" }, - {"id": "16", "title": "Annexe XV - Demande de certificat d'urbanisme n°2"}, + ] createFolderDefaultValues( @@ -305,9 +306,7 @@ def remove_permission_to_create_integrated_licences(context): remaining_roles = tuple(set(roles).difference(["Contributor"])) codt_integratedlicences_folder.manage_delLocalRoles([principal_id]) if remaining_roles: - codt_integratedlicences_folder.manage_addLocalRoles( - principal_id, remaining_roles - ) + codt_integratedlicences_folder.manage_addLocalRoles(principal_id, remaining_roles) codt_integratedlicences_folder.reindexObjectSecurity() logger.info("upgrade step done!") @@ -377,7 +376,7 @@ def add_new_registry_profil(context): logger.info("starting migration steps") registry = getUtility(IRegistry) - attributes = {"title": _("Planned address"), "description": _("address planned")} + attributes = {"title": _(u"Planned address"), "description": _(u"address planned")} key = "Products.urban.interfaces.IAsyncInquiryRadius.inquiries_address_to_do" registry_field = Dict(**attributes) registry_record = Record(registry_field) @@ -407,9 +406,7 @@ def hide_patrimony_tab_in_licence_config(context): for licence_config in portal_urban.objectValues("LicenceConfig"): if licence_config.id in included: # add hidden tab config (unless there is one already) - if not [ - tab for tab in licence_config.tabsConfig if tab["value"] == "patrimony" - ]: + if not [tab for tab in licence_config.tabsConfig if tab["value"] == "patrimony"]: updated_config = licence_config.tabsConfig + ( {"display": "", "display_name": "Patrimoine", "value": "patrimony"}, ) @@ -437,17 +434,9 @@ def hide_tab_in_licence_config(context): for licence_config in portal_urban.objectValues("LicenceConfig"): if licence_config.id not in excluded: # add hidden tab config (unless there is one already) - if not [ - tab - for tab in licence_config.tabsConfig - if tab["value"] == "environment" - ]: + if not [tab for tab in licence_config.tabsConfig if tab["value"] == "environment"]: updated_config = licence_config.tabsConfig + ( - { - "display": "", - "display_name": "Analyse Environnement", - "value": "environment", - }, + {"display": "", "display_name": "Analyse Environnement", "value": "environment"}, ) licence_config.setTabsConfig(updated_config) @@ -467,9 +456,7 @@ def hide_habitation_tab_in_licence_config(context): for licence_config in portal_urban.objectValues("LicenceConfig"): if licence_config.id in included: # add hidden tab config (unless there is one already) - if not [ - tab for tab in licence_config.tabsConfig if tab["value"] == "habitation" - ]: + if not [tab for tab in licence_config.tabsConfig if tab["value"] == "habitation"]: updated_config = licence_config.tabsConfig + ( {"display": "", "display_name": "Logement", "value": "habitation"}, ) @@ -494,44 +481,4 @@ def add_new_registry_for_missing_capakey(context): registry.records[key] = registry_record logger.info("migration done!") - - -def add_building_procedure(context): - logger = logging.getLogger("urban: Add housing procedure") - logger.info("starting upgrade steps") - setup_tool = api.portal.get_tool("portal_setup") - setup_tool.runAllImportStepsFromProfile("profile-Products.urban:preinstall") - portal_urban = api.portal.get_tool("portal_urban") - dimension_type_vocabularies_config = default_values["global"]["dimensiontypes"] - allowedtypes = dimension_type_vocabularies_config[0] - dimension_type_vocabularies_config = createVocabularyFolder( - portal_urban, "dimensiontypes", context, allowedtypes - ) - createFolderDefaultValues( - dimension_type_vocabularies_config, - default_values["global"]["dimensiontypes"][1:], - default_values["global"]["dimensiontypes"][0], - ) - units_vocabularies_config = default_values["global"]["units"] - allowedtypes = units_vocabularies_config[0] - units_vocabularies_config = createVocabularyFolder( - portal_urban, "units", context, allowedtypes - ) - createFolderDefaultValues( - units_vocabularies_config, - default_values["global"]["units"][1:], - default_values["global"]["units"][0], - ) - observation_items_vocabularies_config = default_values["Housing"][ - "observationitems" - ] - observation_items_vocabularies_config = createVocabularyFolder( - portal_urban.housing, "observationitems", context, allowedtypes - ) - createFolderDefaultValues( - observation_items_vocabularies_config, - default_values["Housing"]["observationitems"][1:], - default_values["Housing"]["observationitems"][0], - ) - - logger.info("migration step done!") \ No newline at end of file + \ No newline at end of file diff --git a/src/Products/urban/migration/upgrades.zcml b/src/Products/urban/migration/upgrades.zcml index d55ea5cef..59e1f7fe8 100644 --- a/src/Products/urban/migration/upgrades.zcml +++ b/src/Products/urban/migration/upgrades.zcml @@ -782,13 +782,5 @@ handler=".update_270.add_new_registry_for_missing_capakey" profile="Products.urban:default" /> - diff --git a/src/Products/urban/profiles/default/metadata.xml b/src/Products/urban/profiles/default/metadata.xml index 86b1cbeb3..83073fe15 100644 --- a/src/Products/urban/profiles/default/metadata.xml +++ b/src/Products/urban/profiles/default/metadata.xml @@ -1,7 +1,7 @@ - 1166 + 1165 profile-Products.urban:preinstall - \ No newline at end of file + diff --git a/src/Products/urban/profiles/extra/config_default_values.py b/src/Products/urban/profiles/extra/config_default_values.py index a17f5f150..c2205e7c6 100644 --- a/src/Products/urban/profiles/extra/config_default_values.py +++ b/src/Products/urban/profiles/extra/config_default_values.py @@ -3057,36 +3057,6 @@ ], }, "global": { - "dimensiontypes": [ - "UrbanVocabularyTerm", - {"id": "width", "title": u"Largeur"}, - {"id": "height", "title": u"Hauteur"}, - {"id": "depth", "title": u"Profondeur"}, - {"id": "area", "title": u"Surface de plancher"}, - {"id": "living_area", "title": u"Surface habitable"}, - {"id": "built_area", "title": u"Surface bâtie"}, - {"id": "unbuilt_area", "title": u"Surface non bâtie"}, - {"id": "green_space_area", "title": u"Surface d'espaces verts"}, - {"id": "roof_area", "title": u"Surface de toiture"}, - {"id": "volume", "title": u"Volume"}, - {"id": "building_footprint", "title": u"Emprise au sol"}, - {"id": "number_of_floors", "title": u"Nombre d'étages"}, - {"id": "distance_to_property_line", "title": u"Distance à la limite de propriété"}, - {"id": "front_length", "title": u"Longueur de façade"}, - {"id": "front_height", "title": u"Hauteur de façade"}, - ], - "units": [ - "UrbanVocabularyTerm", - {"id": "m", "title": u"m"}, - {"id": "m2", "title": u"m²"}, - {"id": "m3", "title": u"m³"}, - {"id": "km", "title": u"km"}, - {"id": "ha", "title": u"ha"}, - {"id": "floor", "title": u"étage(s)"}, - {"id": "unit", "title": u"unité(s)"}, - {"id": "percent", "title": u"%"}, - {"id": "degree", "title": u"°"}, - ], "deposittype": [ "UrbanVocabularyTerm", {"id": "recommande", "title": u"Par recommandé postal"}, @@ -3851,16 +3821,4 @@ {"id": "externe", "title": u"Demande externe"}, ], }, - "Housing": { - "observationitems": [ - "UrbanVocabularyTerm", - {"id": "no_population_registration", "title": u"L’immeuble (ou partie d’immeuble) ne fait pas l’objet d’une inscription dans les registres de la population"}, - {"id": "no_waiting_registration", "title": u"L’immeuble (ou partie d’immeuble) ne fait pas l’objet d’une inscription dans les registres d’attente"}, - {"id": "no_bce_registration", "title": u"L’immeuble (ou partie d’immeuble) ne fait pas l’objet d’une inscription à la Banque-Carrefour des Entreprises"}, - {"id": "subject_to_environmental_decree", "title": u"L’exploitation de l’immeuble (ou partie d’immeuble) relève du décret du 11 mars 1999 relatif au permis d’environnement"}, - {"id": "expired_environmental_permit", "title": u"Le permis d’exploiter, d’environnement, unique ou la déclaration requise n’a pas été mis en œuvre et est périmé"}, - {"id": "environmental_order_or_suspension", "title": u"L’établissement fait l’objet d’un ordre d’arrêter l’exploitation, d’un retrait ou d’une suspension d’autorisation prononcés en vertu du décret susmentionné"}, - {"id": "commercial_closure_order", "title": u"L’occupation de l’immeuble (ou partie d’immeuble) relève d’une activité soumise à autorisation d’implantation en vertu de la loi du 29 juin 1975 ou du décret du 5 février 2015, or ladite implantation est frappée d’un ordre de fermeture, d’un retrait ou d’une suspension d’autorisation prononcés en vertu des dispositions de la loi du 13 août 2004 ou d’une mesure de sanction prévue par l’article 68 du décret précité"} ] - - }, } diff --git a/src/Products/urban/profiles/preinstall/workflows.xml b/src/Products/urban/profiles/preinstall/workflows.xml index c4cdaa11c..4169ac77d 100644 --- a/src/Products/urban/profiles/preinstall/workflows.xml +++ b/src/Products/urban/profiles/preinstall/workflows.xml @@ -1,266 +1,263 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - \ No newline at end of file + + + diff --git a/src/Products/urban/profiles/urban_types/types.xml b/src/Products/urban/profiles/urban_types/types.xml index b7ea2e639..26b51fd78 100644 --- a/src/Products/urban/profiles/urban_types/types.xml +++ b/src/Products/urban/profiles/urban_types/types.xml @@ -1,192 +1,190 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Products/urban/profiles/urban_types/types/Housing.xml b/src/Products/urban/profiles/urban_types/types/Housing.xml deleted file mode 100644 index 82c4b4178..000000000 --- a/src/Products/urban/profiles/urban_types/types/Housing.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - Housing - - string:${portal_url}/BuildLicence.png - Housing - urban - addHousing - housingview - True - True - - - - - - - - - - - - - - - - - - - False - housingview - - - - - - - - False - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Products/urban/schedule/config/housing.xml b/src/Products/urban/schedule/config/housing.xml deleted file mode 100644 index 0bc88d734..000000000 --- a/src/Products/urban/schedule/config/housing.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - collection-link - Échéancier - top - default - True - - - - imio.schedule.collections - True - True - 0 - - a587404d02664bf9aa4973b32a53591e - - - sorting - Tri - top - default - True - eea.faceted.vocabularies.SortingCatalogIndexes - - - - text - Référence - center - default - False - getReference - - True - True - - - select - Assigné à - center - default - False - - - - assigned_user - urban.schedule_users - - - admin - - - resultsperpage - Résultats par page - center - default - False - 20 - 1000 - 20 - 20 - - - select - Agent traitant - center - default - False - - - - assigned_user - urban.schedule_users - - - - - - checkbox - Prop - center - default - False - 0 - 0 - 0 - Subject - or - 0 - urban.inspection_followups - - 0 - 0 - - - checkbox - Review state - center - advanced - False - - - - review_state - or - - schedule.TaskWorkflowStates - - 0 - - - - - - - \ No newline at end of file diff --git a/src/Products/urban/schedule/vocabulary.py b/src/Products/urban/schedule/vocabulary.py index 3b51a4ad7..8c67f6ecc 100644 --- a/src/Products/urban/schedule/vocabulary.py +++ b/src/Products/urban/schedule/vocabulary.py @@ -52,7 +52,6 @@ "UrbanEventOpinionRequest": interfaces.IUrbanEventOpinionRequest, "ExplosivesPossession": interfaces.IExplosivesPossession, "RoadDecree": interfaces.IRoadDecree, - "Housing": interfaces.IHousing, } diff --git a/src/Products/urban/skins/urban_templates/housing_edit.pt b/src/Products/urban/skins/urban_templates/housing_edit.pt deleted file mode 100644 index 198e7aea4..000000000 --- a/src/Products/urban/skins/urban_templates/housing_edit.pt +++ /dev/null @@ -1,27 +0,0 @@ - - - - -
- -
- -
- - - - - - - - -
- - - From 52a017bd1eae4c9291282d2a2d24c0c51c3b89d3 Mon Sep 17 00:00:00 2001 From: Julien Chandelle Date: Mon, 7 Jul 2025 22:12:33 +0200 Subject: [PATCH 10/25] URB-3337 Add option to add complementary delay to task and add value for SPW cyberattack --- news/URB-3337.feature | 3 + src/Products/urban/ComplementaryDelayTerm.py | 69 ++++++++++++++ src/Products/urban/__init__.py | 1 + .../content/licence/CODT_BaseBuildLicence.py | 1 + .../licence/CODT_UrbanCertificateBase.py | 1 + .../content/licence/ExplosivesPossession.py | 3 + .../urban/content/licence/GenericLicence.py | 35 +++++++ .../urban/content/licence/Inspection.py | 1 + src/Products/urban/content/licence/Ticket.py | 1 + src/Products/urban/dashboard/config/all.xml | 16 ++++ .../urban/dashboard/config/article127s.xml | 16 ++++ .../urban/dashboard/config/buildlicences.xml | 16 ++++ .../dashboard/config/codt_article127s.xml | 16 ++++ .../dashboard/config/codt_buildlicences.xml | 16 ++++ .../config/codt_commerciallicences.xml | 16 ++++ .../config/codt_integratedlicences.xml | 16 ++++ .../dashboard/config/codt_notaryletters.xml | 16 ++++ .../config/codt_parceloutlicences.xml | 16 ++++ .../dashboard/config/codt_uniquelicences.xml | 16 ++++ .../config/codt_urbancertificateones.xml | 16 ++++ .../config/codt_urbancertificatetwos.xml | 16 ++++ .../urban/dashboard/config/declarations.xml | 16 ++++ .../urban/dashboard/config/divisions.xml | 16 ++++ .../dashboard/config/envclassborderings.xml | 16 ++++ .../urban/dashboard/config/envclassones.xml | 16 ++++ .../urban/dashboard/config/envclassthrees.xml | 16 ++++ .../urban/dashboard/config/envclasstwos.xml | 16 ++++ .../config/explosivespossessions.xml | 16 ++++ .../urban/dashboard/config/inspections.xml | 16 ++++ .../dashboard/config/integratedlicences.xml | 16 ++++ .../urban/dashboard/config/miscdemands.xml | 16 ++++ .../urban/dashboard/config/notaryletters.xml | 16 ++++ .../dashboard/config/parceloutlicences.xml | 16 ++++ .../config/patrimonycertificates.xml | 16 ++++ .../dashboard/config/preliminarynotices.xml | 16 ++++ .../dashboard/config/projectmeetings.xml | 16 ++++ .../urban/dashboard/config/roaddecrees.xml | 16 ++++ .../urban/dashboard/config/tickets.xml | 16 ++++ .../urban/dashboard/config/uniquelicences.xml | 16 ++++ .../dashboard/config/urbancertificateones.xml | 16 ++++ .../dashboard/config/urbancertificatetwos.xml | 16 ++++ src/Products/urban/interfaces.py | 4 + .../urban/locales/fr/LC_MESSAGES/plone.po | 3 + .../urban/locales/fr/LC_MESSAGES/urban.po | 5 + src/Products/urban/locales/plone.pot | 3 + src/Products/urban/locales/urban.pot | 5 + src/Products/urban/migration/update_270.py | 92 ++++++++++++++++++- src/Products/urban/migration/upgrades.zcml | 11 ++- .../urban/profiles/default/metadata.xml | 2 +- .../urban/profiles/preinstall/workflows.xml | 3 + .../urban/profiles/urban_types/catalog.xml | 5 + .../profiles/urban_types/factorytool.xml | 1 + .../urban/profiles/urban_types/types.xml | 2 + .../types/ComplementaryDelayTerm.xml | 46 ++++++++++ src/Products/urban/schedule/delay.py | 12 ++- src/Products/urban/vocabularies.py | 16 ++++ src/Products/urban/vocabulary.zcml | 6 ++ 57 files changed, 839 insertions(+), 4 deletions(-) create mode 100644 news/URB-3337.feature create mode 100644 src/Products/urban/ComplementaryDelayTerm.py create mode 100644 src/Products/urban/profiles/urban_types/types/ComplementaryDelayTerm.xml diff --git a/news/URB-3337.feature b/news/URB-3337.feature new file mode 100644 index 000000000..84dfc9e33 --- /dev/null +++ b/news/URB-3337.feature @@ -0,0 +1,3 @@ +Add option to add complementary delay to task +Add value for SPW cyberattack +[jchandelle] \ No newline at end of file diff --git a/src/Products/urban/ComplementaryDelayTerm.py b/src/Products/urban/ComplementaryDelayTerm.py new file mode 100644 index 000000000..6d87b6982 --- /dev/null +++ b/src/Products/urban/ComplementaryDelayTerm.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +# +# File: complementary_delay_term.py +# +# Copyright (c) 2025 by CommunesPlone +# Generator: ArchGenXML Version 2.7 +# http://plone.org/products/archgenxml +# +# GNU General Public License (GPL) +# + +__author__ = """Gauthier BASTIEN , Stephan GEULETTE +, Jean-Michel Abe """ +__docformat__ = "plaintext" + +from AccessControl import ClassSecurityInfo +from Products.Archetypes.atapi import * +from zope.interface import implements +import interfaces +from Products.urban.UrbanVocabularyTerm import UrbanVocabularyTerm +from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin + +from Products.urban.config import * + +from Products.urban import UrbanMessage as _ + +##/code-section module-header + +schema = Schema( + ( + IntegerField( + name="delay", + widget=IntegerField._properties["widget"]( + label=_("urban_label_delay", "Delay"), + ), + ), + ), +) + +##code-section after-local-schema #fill in your manual code here +##/code-section after-local-schema + +ComplementaryDelayTerm_schema = ( + BaseSchema.copy() + + getattr(UrbanVocabularyTerm, "schema", Schema(())).copy() + + schema.copy() +) + +##code-section after-schema #fill in your manual code here +##/code-section after-schema + + +class ComplementaryDelayTerm(BaseContent, UrbanVocabularyTerm, BrowserDefaultMixin): + """ """ + + security = ClassSecurityInfo() + implements(interfaces.IComplementaryDelayTerm) + + meta_type = "ComplementaryDelayTerm" + _at_rename_after_creation = True + + schema = ComplementaryDelayTerm_schema + + +registerType(ComplementaryDelayTerm, PROJECTNAME) +# end of class ComplementaryDelayTerm + +##code-section module-footer #fill in your manual code here +##/code-section module-footer diff --git a/src/Products/urban/__init__.py b/src/Products/urban/__init__.py index 3bff045a1..82cc2994b 100644 --- a/src/Products/urban/__init__.py +++ b/src/Products/urban/__init__.py @@ -191,6 +191,7 @@ def initialize(context): import UrbanEventType import UrbanTool import UrbanVocabularyTerm + import ComplementaryDelayTerm import content.licence.Article127 import content.licence.BuildLicence import content.licence.CODT_Article127 diff --git a/src/Products/urban/content/licence/CODT_BaseBuildLicence.py b/src/Products/urban/content/licence/CODT_BaseBuildLicence.py index 1f16564c3..c6bf9fca9 100644 --- a/src/Products/urban/content/licence/CODT_BaseBuildLicence.py +++ b/src/Products/urban/content/licence/CODT_BaseBuildLicence.py @@ -826,6 +826,7 @@ def finalizeSchema(schema): schema.moveField("patrimony_observation", after="patrimony_analysis") schema.moveField("watercourse", after="locationFloodingLevel") schema.moveField("watercourseCategories", after="watercourse") + schema.moveField("complementary_delay", after="prorogation") schema.moveField("trail", after="roadEquipments") schema.moveField("trailDetails", after="trail") schema["missingParts"].widget.format = None diff --git a/src/Products/urban/content/licence/CODT_UrbanCertificateBase.py b/src/Products/urban/content/licence/CODT_UrbanCertificateBase.py index d8ded1f26..5d5f66130 100644 --- a/src/Products/urban/content/licence/CODT_UrbanCertificateBase.py +++ b/src/Products/urban/content/licence/CODT_UrbanCertificateBase.py @@ -89,6 +89,7 @@ def finalizeSchema(schema, folderish=False, moveDiscussion=True): schema["pcaZone"].widget.label = _("urban_label_solZone") schema["isInPCA"].widget.label = _("urban_label_is_in_sol") schema["pcaDetails"].widget.label = _("urban_label_sol_details") + schema["complementary_delay"].schemata = "urban_description" return schema diff --git a/src/Products/urban/content/licence/ExplosivesPossession.py b/src/Products/urban/content/licence/ExplosivesPossession.py index b64e67bc9..081d3d1fe 100644 --- a/src/Products/urban/content/licence/ExplosivesPossession.py +++ b/src/Products/urban/content/licence/ExplosivesPossession.py @@ -187,6 +187,9 @@ def finalizeSchema(schema, folderish=False, moveDiscussion=True): ) for field in hidden_fields: schema[field].widget.visible = {"edit": "invisible"} + + schema["complementary_delay"].schemata = "urban_description" + schema.moveField("complementary_delay", after="prorogation") return schema diff --git a/src/Products/urban/content/licence/GenericLicence.py b/src/Products/urban/content/licence/GenericLicence.py index d69d79534..21742ff3b 100755 --- a/src/Products/urban/content/licence/GenericLicence.py +++ b/src/Products/urban/content/licence/GenericLicence.py @@ -192,6 +192,7 @@ "groundStateStatus", "groundstatestatusDetails", "covid", + "complementary_delay", "watercourse", "watercourseCategories", "trail", @@ -323,6 +324,18 @@ label=_("urban_label_taxDetails", default="Taxdetails"), ), ), + StringField( + name="complementary_delay", + widget=MultiSelect2Widget( + format="select", + label=_("urban_label_complementary_delay", default="Complementary Delay"), + ), + enforceVocabulary=True, + multiValued=True, + schemata="urban_analysis", + vocabulary=UrbanVocabulary("complementary_delay", vocType="ComplementaryDelayTerm", inUrbanConfig=False), + default_method="getDefaultValue", + ), LinesField( name="missingParts", widget=MultiSelect2Widget( @@ -1779,6 +1792,28 @@ def getOpinionRequests(self, organisation=""): res.append(opinionRequest) return res + security.declarePublic("get_complementary_delay") + + def get_complementary_delay(self): + complementary_delay = self.getComplementary_delay() + if not complementary_delay: + return [] + + portal_urban = api.portal.get_tool("portal_urban") + complementary_delay_vocabulary = portal_urban.listVocabularyObjects( + vocToReturn="complementary_delay", + context=self, + vocType="ComplementaryDelayTerm", + inUrbanConfig=False, + allowedStates=["disabled", "enabled"] + ) + + return [ + complementary_delay_vocabulary.get(delay) + for delay in complementary_delay + if complementary_delay_vocabulary.get(delay, None) + ] + security.declarePublic("createAllAdvices") def createAllAdvices(self): diff --git a/src/Products/urban/content/licence/Inspection.py b/src/Products/urban/content/licence/Inspection.py index e97ce95ce..24b4bfc94 100644 --- a/src/Products/urban/content/licence/Inspection.py +++ b/src/Products/urban/content/licence/Inspection.py @@ -729,6 +729,7 @@ def finalize_schema(schema, folderish=False, moveDiscussion=True): schema["pcaZone"].widget.label = _("urban_label_solZone") schema["isInPCA"].widget.label = _("urban_label_is_in_sol") schema["pcaDetails"].widget.label = _("urban_label_sol_details") + schema["complementary_delay"].schemata = "urban_description" return schema diff --git a/src/Products/urban/content/licence/Ticket.py b/src/Products/urban/content/licence/Ticket.py index 0e2fd1453..9fe1acf34 100644 --- a/src/Products/urban/content/licence/Ticket.py +++ b/src/Products/urban/content/licence/Ticket.py @@ -670,6 +670,7 @@ def finalize_schema(schema, folderish=False, moveDiscussion=True): schema["pcaZone"].widget.label = _("urban_label_solZone") schema["isInPCA"].widget.label = _("urban_label_is_in_sol") schema["pcaDetails"].widget.label = _("urban_label_sol_details") + schema["complementary_delay"].schemata = "urban_description" return schema diff --git a/src/Products/urban/dashboard/config/all.xml b/src/Products/urban/dashboard/config/all.xml index aa8012a83..a0c2a7120 100644 --- a/src/Products/urban/dashboard/config/all.xml +++ b/src/Products/urban/dashboard/config/all.xml @@ -145,5 +145,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/article127s.xml b/src/Products/urban/dashboard/config/article127s.xml index 71499bb70..6f4ca48ca 100644 --- a/src/Products/urban/dashboard/config/article127s.xml +++ b/src/Products/urban/dashboard/config/article127s.xml @@ -157,5 +157,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/buildlicences.xml b/src/Products/urban/dashboard/config/buildlicences.xml index ac5fcb256..fdfc51900 100644 --- a/src/Products/urban/dashboard/config/buildlicences.xml +++ b/src/Products/urban/dashboard/config/buildlicences.xml @@ -169,5 +169,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_article127s.xml b/src/Products/urban/dashboard/config/codt_article127s.xml index 29b08d307..20a46630b 100644 --- a/src/Products/urban/dashboard/config/codt_article127s.xml +++ b/src/Products/urban/dashboard/config/codt_article127s.xml @@ -169,5 +169,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_buildlicences.xml b/src/Products/urban/dashboard/config/codt_buildlicences.xml index 7eecf0360..d54c95eaa 100644 --- a/src/Products/urban/dashboard/config/codt_buildlicences.xml +++ b/src/Products/urban/dashboard/config/codt_buildlicences.xml @@ -179,5 +179,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_commerciallicences.xml b/src/Products/urban/dashboard/config/codt_commerciallicences.xml index 812380747..efdb996a3 100644 --- a/src/Products/urban/dashboard/config/codt_commerciallicences.xml +++ b/src/Products/urban/dashboard/config/codt_commerciallicences.xml @@ -168,5 +168,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_integratedlicences.xml b/src/Products/urban/dashboard/config/codt_integratedlicences.xml index 812380747..efdb996a3 100644 --- a/src/Products/urban/dashboard/config/codt_integratedlicences.xml +++ b/src/Products/urban/dashboard/config/codt_integratedlicences.xml @@ -168,5 +168,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_notaryletters.xml b/src/Products/urban/dashboard/config/codt_notaryletters.xml index cd9007ba7..7891fc934 100644 --- a/src/Products/urban/dashboard/config/codt_notaryletters.xml +++ b/src/Products/urban/dashboard/config/codt_notaryletters.xml @@ -157,5 +157,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_parceloutlicences.xml b/src/Products/urban/dashboard/config/codt_parceloutlicences.xml index 126b86b6e..f6e7b4982 100644 --- a/src/Products/urban/dashboard/config/codt_parceloutlicences.xml +++ b/src/Products/urban/dashboard/config/codt_parceloutlicences.xml @@ -168,5 +168,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_uniquelicences.xml b/src/Products/urban/dashboard/config/codt_uniquelicences.xml index 812380747..efdb996a3 100644 --- a/src/Products/urban/dashboard/config/codt_uniquelicences.xml +++ b/src/Products/urban/dashboard/config/codt_uniquelicences.xml @@ -168,5 +168,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_urbancertificateones.xml b/src/Products/urban/dashboard/config/codt_urbancertificateones.xml index e57ab51bb..305525859 100644 --- a/src/Products/urban/dashboard/config/codt_urbancertificateones.xml +++ b/src/Products/urban/dashboard/config/codt_urbancertificateones.xml @@ -157,5 +157,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/codt_urbancertificatetwos.xml b/src/Products/urban/dashboard/config/codt_urbancertificatetwos.xml index 812380747..efdb996a3 100644 --- a/src/Products/urban/dashboard/config/codt_urbancertificatetwos.xml +++ b/src/Products/urban/dashboard/config/codt_urbancertificatetwos.xml @@ -168,5 +168,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/declarations.xml b/src/Products/urban/dashboard/config/declarations.xml index 2cbe7f728..d48f65690 100644 --- a/src/Products/urban/dashboard/config/declarations.xml +++ b/src/Products/urban/dashboard/config/declarations.xml @@ -75,5 +75,21 @@ 20 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/divisions.xml b/src/Products/urban/dashboard/config/divisions.xml index b3a5c4958..765aba4a1 100644 --- a/src/Products/urban/dashboard/config/divisions.xml +++ b/src/Products/urban/dashboard/config/divisions.xml @@ -157,5 +157,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/envclassborderings.xml b/src/Products/urban/dashboard/config/envclassborderings.xml index 812380747..efdb996a3 100644 --- a/src/Products/urban/dashboard/config/envclassborderings.xml +++ b/src/Products/urban/dashboard/config/envclassborderings.xml @@ -168,5 +168,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/envclassones.xml b/src/Products/urban/dashboard/config/envclassones.xml index 812380747..efdb996a3 100644 --- a/src/Products/urban/dashboard/config/envclassones.xml +++ b/src/Products/urban/dashboard/config/envclassones.xml @@ -168,5 +168,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/envclassthrees.xml b/src/Products/urban/dashboard/config/envclassthrees.xml index 0bdcfb2cd..430100116 100644 --- a/src/Products/urban/dashboard/config/envclassthrees.xml +++ b/src/Products/urban/dashboard/config/envclassthrees.xml @@ -146,5 +146,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/envclasstwos.xml b/src/Products/urban/dashboard/config/envclasstwos.xml index 812380747..efdb996a3 100644 --- a/src/Products/urban/dashboard/config/envclasstwos.xml +++ b/src/Products/urban/dashboard/config/envclasstwos.xml @@ -168,5 +168,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/explosivespossessions.xml b/src/Products/urban/dashboard/config/explosivespossessions.xml index 64b9421ee..1edb177f8 100644 --- a/src/Products/urban/dashboard/config/explosivespossessions.xml +++ b/src/Products/urban/dashboard/config/explosivespossessions.xml @@ -156,5 +156,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/inspections.xml b/src/Products/urban/dashboard/config/inspections.xml index 64b9421ee..1edb177f8 100644 --- a/src/Products/urban/dashboard/config/inspections.xml +++ b/src/Products/urban/dashboard/config/inspections.xml @@ -156,5 +156,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/integratedlicences.xml b/src/Products/urban/dashboard/config/integratedlicences.xml index f06c8f2d4..c49fbe939 100644 --- a/src/Products/urban/dashboard/config/integratedlicences.xml +++ b/src/Products/urban/dashboard/config/integratedlicences.xml @@ -157,5 +157,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/miscdemands.xml b/src/Products/urban/dashboard/config/miscdemands.xml index 14179af52..a59326092 100644 --- a/src/Products/urban/dashboard/config/miscdemands.xml +++ b/src/Products/urban/dashboard/config/miscdemands.xml @@ -158,5 +158,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/notaryletters.xml b/src/Products/urban/dashboard/config/notaryletters.xml index 091c34f07..258d9af36 100644 --- a/src/Products/urban/dashboard/config/notaryletters.xml +++ b/src/Products/urban/dashboard/config/notaryletters.xml @@ -146,5 +146,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/parceloutlicences.xml b/src/Products/urban/dashboard/config/parceloutlicences.xml index cf23e28fc..20420fd86 100644 --- a/src/Products/urban/dashboard/config/parceloutlicences.xml +++ b/src/Products/urban/dashboard/config/parceloutlicences.xml @@ -76,5 +76,21 @@ 20 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/patrimonycertificates.xml b/src/Products/urban/dashboard/config/patrimonycertificates.xml index 14179af52..a59326092 100644 --- a/src/Products/urban/dashboard/config/patrimonycertificates.xml +++ b/src/Products/urban/dashboard/config/patrimonycertificates.xml @@ -158,5 +158,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/preliminarynotices.xml b/src/Products/urban/dashboard/config/preliminarynotices.xml index 14179af52..a59326092 100644 --- a/src/Products/urban/dashboard/config/preliminarynotices.xml +++ b/src/Products/urban/dashboard/config/preliminarynotices.xml @@ -158,5 +158,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/projectmeetings.xml b/src/Products/urban/dashboard/config/projectmeetings.xml index 14179af52..a59326092 100644 --- a/src/Products/urban/dashboard/config/projectmeetings.xml +++ b/src/Products/urban/dashboard/config/projectmeetings.xml @@ -158,5 +158,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/roaddecrees.xml b/src/Products/urban/dashboard/config/roaddecrees.xml index 270a3be7a..4a660bded 100644 --- a/src/Products/urban/dashboard/config/roaddecrees.xml +++ b/src/Products/urban/dashboard/config/roaddecrees.xml @@ -145,5 +145,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/tickets.xml b/src/Products/urban/dashboard/config/tickets.xml index 64b9421ee..1edb177f8 100644 --- a/src/Products/urban/dashboard/config/tickets.xml +++ b/src/Products/urban/dashboard/config/tickets.xml @@ -156,5 +156,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/uniquelicences.xml b/src/Products/urban/dashboard/config/uniquelicences.xml index f06c8f2d4..c49fbe939 100644 --- a/src/Products/urban/dashboard/config/uniquelicences.xml +++ b/src/Products/urban/dashboard/config/uniquelicences.xml @@ -157,5 +157,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/urbancertificateones.xml b/src/Products/urban/dashboard/config/urbancertificateones.xml index 091c34f07..258d9af36 100644 --- a/src/Products/urban/dashboard/config/urbancertificateones.xml +++ b/src/Products/urban/dashboard/config/urbancertificateones.xml @@ -146,5 +146,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/dashboard/config/urbancertificatetwos.xml b/src/Products/urban/dashboard/config/urbancertificatetwos.xml index f06c8f2d4..c49fbe939 100644 --- a/src/Products/urban/dashboard/config/urbancertificatetwos.xml +++ b/src/Products/urban/dashboard/config/urbancertificatetwos.xml @@ -157,5 +157,21 @@ 10 20 + + select2 + Prorogation complémentaire + getComplementary_delay + urban.vocabularies.complementary_delay + + False + center + default + False + False + False + False + False +
diff --git a/src/Products/urban/interfaces.py b/src/Products/urban/interfaces.py index 73523a9e5..96bda8c19 100644 --- a/src/Products/urban/interfaces.py +++ b/src/Products/urban/interfaces.py @@ -233,6 +233,10 @@ class IEnvironmentRubricTerm(Interface): """Marker interface for .EnvironmentRubricTerm.EnvironmentRubricTerm""" +class IComplementaryDelayTerm(Interface): + """Marker interface for .ComplementaryDelayTerm.ComplementaryDelayTerm""" + + class ISpecificFeatureTerm(Interface): """Marker interface for .SpecificFeatureTerm.SpecificFeatureTerm""" diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/plone.po b/src/Products/urban/locales/fr/LC_MESSAGES/plone.po index dc2cb523d..e0f8622a7 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/plone.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/plone.po @@ -529,3 +529,6 @@ msgstr "Rue" msgid "nonapplicable" msgstr "Refuser" + +msgid "ComplementaryDelayTerm" +msgstr "Prorogation complémentaire" diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po index fc91e9de0..5967f50c0 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po @@ -3171,6 +3171,11 @@ msgstr "Inventaire communal" msgid "urban_label_complement" msgstr "Compléments" +#. Default: "Complementary Delay" +#: ../content/licence/GenericLicence.py:331 +msgid "urban_label_complementary_delay" +msgstr "Prorogation complémentaire" + #. Default: "Composition" #: ../content/licence/BaseBuildLicence.py:607 msgid "urban_label_composition" diff --git a/src/Products/urban/locales/plone.pot b/src/Products/urban/locales/plone.pot index 1a30afcd7..14fe0c7f7 100644 --- a/src/Products/urban/locales/plone.pot +++ b/src/Products/urban/locales/plone.pot @@ -532,3 +532,6 @@ msgstr "" msgid "nonapplicable" msgstr "" + +msgid "ComplementaryDelayTerm" +msgstr "" diff --git a/src/Products/urban/locales/urban.pot b/src/Products/urban/locales/urban.pot index 03d7d5263..745a79d41 100644 --- a/src/Products/urban/locales/urban.pot +++ b/src/Products/urban/locales/urban.pot @@ -3140,6 +3140,11 @@ msgstr "" msgid "urban_label_complement" msgstr "" +#. Default: "Complementary Delay" +#: ../content/licence/GenericLicence.py:331 +msgid "urban_label_complementary_delay" +msgstr "" + #. Default: "Composition" #: ../content/licence/BaseBuildLicence.py:607 msgid "urban_label_composition" diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index 3f157340b..3e5634430 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -1,12 +1,15 @@ # encoding: utf-8 from Acquisition import aq_parent +from eea.facetednavigation.interfaces import ICriteria from OFS.interfaces import IOrderedContainer from Products.urban import UrbanMessage as _ +from Products.urban.config import URBAN_TYPES from Products.CMFCore.utils import getToolByName from Products.urban.interfaces import IGenericLicence from Products.urban.migration.utils import refresh_workflow_permissions from Products.urban.setuphandlers import createFolderDefaultValues +from Products.urban.setuphandlers import createVocabularyFolder from imio.schedule.content.object_factories import MacroCreationConditionObject from imio.schedule.content.object_factories import MacroEndConditionObject from imio.schedule.content.object_factories import MacroFreezeConditionObject @@ -481,4 +484,91 @@ def add_new_registry_for_missing_capakey(context): registry.records[key] = registry_record logger.info("migration done!") - \ No newline at end of file + + +def add_additional_delay_option(context): + logger = logging.getLogger("urban: Add complementary delay option") + logger.info("starting upgrade steps") + + # Add new term type, workflow and index + logger.info("Add new term type, workflow and index") + setup_tool = api.portal.get_tool("portal_setup") + setup_tool.runImportStepFromProfile("profile-Products.urban:urbantypes", "typeinfo") + setup_tool.runImportStepFromProfile("profile-Products.urban:preinstall", "workflow") + setup_tool.runImportStepFromProfile("profile-Products.urban:urbantypes", "catalog") + + # Add vocabulary + logger.info("Add vocabulary") + portal_urban = api.portal.get_tool("portal_urban") + complementary_delay_folder = createVocabularyFolder( + container=portal_urban, + folder_id="complementary_delay", + site=None, + allowedtypes="ComplementaryDelayTerm" + ) + complementary_delay_term = [ + { + "id": "cyberattaque_spw", + "title": u"Cyberattaque SPW - avril 2025", + "delay": 60 + } + ] + createFolderDefaultValues( + complementary_delay_folder, + complementary_delay_term, + portal_type="ComplementaryDelayTerm" + ) + + # Add qery widget to 'all' folder + urban_folder = api.portal.get().urban + data = { + "_cid_": u"c97", + "title": u"Prorogation complémentaire", + "hidden": False, + "index": u"getComplementary_delay", + "vocabulary": u"urban.vocabularies.complementary_delay" + } + urban_folder_criterion = ICriteria(urban_folder) + if urban_folder_criterion is not None: + urban_folder_criterion.add( + wid="select2", + position="top", + section="advanced", + **data + ) + + # Add complementary_delay field to all default + logger.info("Add complementary_delay field to all default") + field = "complementary_delay" + + for urban_type in URBAN_TYPES: + # Add complementary_delay field + licence_config = portal_urban.get(urban_type.lower(), None) + if licence_config is None: + continue + if not hasattr(licence_config, "getUsedAttributes"): + continue + used_attributes = licence_config.getUsedAttributes() + if field in used_attributes: + continue + licence_config.setUsedAttributes(used_attributes + (field, )) + logger.info("Type {}, attribute add".format(urban_type)) + + #Add query widget + licence_folder = getattr(urban_folder, "{}s".format(urban_type.lower()), None) + if licence_folder is None: + continue + criterion = ICriteria(licence_folder) + if criterion is None: + continue + + criterion.add( + wid="select2", + position="top", + section="advanced", + **data + ) + logger.info("Type {}, query widget add".format(urban_type)) + + + logger.info("upgrade step done!") diff --git a/src/Products/urban/migration/upgrades.zcml b/src/Products/urban/migration/upgrades.zcml index 59e1f7fe8..697aa5f26 100644 --- a/src/Products/urban/migration/upgrades.zcml +++ b/src/Products/urban/migration/upgrades.zcml @@ -782,5 +782,14 @@ handler=".update_270.add_new_registry_for_missing_capakey" profile="Products.urban:default" /> - + + + diff --git a/src/Products/urban/profiles/default/metadata.xml b/src/Products/urban/profiles/default/metadata.xml index 83073fe15..d23aa42b6 100644 --- a/src/Products/urban/profiles/default/metadata.xml +++ b/src/Products/urban/profiles/default/metadata.xml @@ -1,6 +1,6 @@ - 1165 + 1166 profile-Products.urban:preinstall diff --git a/src/Products/urban/profiles/preinstall/workflows.xml b/src/Products/urban/profiles/preinstall/workflows.xml index 4169ac77d..86fc403a1 100644 --- a/src/Products/urban/profiles/preinstall/workflows.xml +++ b/src/Products/urban/profiles/preinstall/workflows.xml @@ -163,6 +163,9 @@ + + + diff --git a/src/Products/urban/profiles/urban_types/catalog.xml b/src/Products/urban/profiles/urban_types/catalog.xml index 9198409a3..b10ff7dd8 100644 --- a/src/Products/urban/profiles/urban_types/catalog.xml +++ b/src/Products/urban/profiles/urban_types/catalog.xml @@ -122,5 +122,10 @@ + + + + +
diff --git a/src/Products/urban/profiles/urban_types/factorytool.xml b/src/Products/urban/profiles/urban_types/factorytool.xml index abbe7d4be..a9ada1bba 100644 --- a/src/Products/urban/profiles/urban_types/factorytool.xml +++ b/src/Products/urban/profiles/urban_types/factorytool.xml @@ -19,6 +19,7 @@ + diff --git a/src/Products/urban/profiles/urban_types/types.xml b/src/Products/urban/profiles/urban_types/types.xml index 26b51fd78..499d52570 100644 --- a/src/Products/urban/profiles/urban_types/types.xml +++ b/src/Products/urban/profiles/urban_types/types.xml @@ -186,5 +186,7 @@ meta_type="Factory-based Type Information with dynamic views"/> + diff --git a/src/Products/urban/profiles/urban_types/types/ComplementaryDelayTerm.xml b/src/Products/urban/profiles/urban_types/types/ComplementaryDelayTerm.xml new file mode 100644 index 000000000..511714db9 --- /dev/null +++ b/src/Products/urban/profiles/urban_types/types/ComplementaryDelayTerm.xml @@ -0,0 +1,46 @@ + + + + ComplementaryDelayTerm + + string:${portal_url}/UrbanVocabularyTerm.png + ComplementaryDelayTerm + urban + addComplementaryDelayTerm + base_view + True + False + + + False + base_view + + + + False + + + + + + + + + + + + + diff --git a/src/Products/urban/schedule/delay.py b/src/Products/urban/schedule/delay.py index 82eea0ffa..934d037ca 100644 --- a/src/Products/urban/schedule/delay.py +++ b/src/Products/urban/schedule/delay.py @@ -22,6 +22,7 @@ def calculate_delay(self): return 0 licence = self.task_container + marked_suspension_1 = ITaskWithSuspensionDelay.providedBy(task) marked_suspension_2 = ITaskWithWholeSuspensionDelay.providedBy(task) if not licence.getCovid() or ( @@ -59,6 +60,7 @@ def calculate_delay(self, with_modified_blueprints=True): base_delay = super(AnnoncedDelay, self).calculate_delay() licence = self.task_container delay = licence.getAnnoncedDelay() or 0 + get_complementary_delay = self.get_complementary_delay() if hasattr(licence, "decisional_delay"): delay = licence.getDecisional_delay() if with_modified_blueprints and licence.getHasModifiedBlueprints(): @@ -66,7 +68,15 @@ def calculate_delay(self, with_modified_blueprints=True): if delay and delay.endswith("j"): delay = int(delay[:-1]) delay += self.inquiry_suspension_delay() - return delay + base_delay + return delay + base_delay + get_complementary_delay + + def get_complementary_delay(self): + if not hasattr(self, "task_container"): + return 0 + licence = self.task_container + if not hasattr(licence, "get_complementary_delay"): + return 0 + return sum([delay.getDelay() for delay in licence.get_complementary_delay()]) def inquiry_suspension_delay(self): licence = self.task_container diff --git a/src/Products/urban/vocabularies.py b/src/Products/urban/vocabularies.py index d4d71807e..42c03a6a2 100644 --- a/src/Products/urban/vocabularies.py +++ b/src/Products/urban/vocabularies.py @@ -454,3 +454,19 @@ def __call__(self, context): LicenceDocumentsVocabularyFactory = LicenceDocumentsVocabulary() + + +class ComplementaryDelayVocabulary(object): + implements(IVocabularyFactory) + + def __call__(self, context): + vocabulary = UrbanVocabulary("complementary_delay", vocType="ComplementaryDelayTerm", inUrbanConfig=False) + terms = vocabulary.get_raw_voc(context) + voc_terms = [ + SimpleTerm(t["id"], t["id"], t["title"]) for t in terms if t["enabled"] + ] + # sort elements by title + return SimpleVocabulary(voc_terms) + + +ComplementaryDelayFactory = ComplementaryDelayVocabulary() \ No newline at end of file diff --git a/src/Products/urban/vocabulary.zcml b/src/Products/urban/vocabulary.zcml index 6d44eded3..f1abc9f97 100644 --- a/src/Products/urban/vocabulary.zcml +++ b/src/Products/urban/vocabulary.zcml @@ -105,4 +105,10 @@ provides="zope.schema.interfaces.IVocabularyFactory" /> + + From ba5586f0b4b39f3726c48436b86aea1572393eb5 Mon Sep 17 00:00:00 2001 From: jimbiscuit Date: Tue, 8 Jul 2025 10:10:49 +0200 Subject: [PATCH 11/25] Preparing release 2.7.42 --- docs/CHANGES.rst | 11 +++++++++++ news/URB-3337.feature | 3 --- setup.py | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) delete mode 100644 news/URB-3337.feature diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index 927e23b58..d31d5fe77 100644 --- a/docs/CHANGES.rst +++ b/docs/CHANGES.rst @@ -8,6 +8,17 @@ Changelog .. towncrier release notes start +2.7.42 (2025-07-08) +------------------- + +New features: + + +- Add option to add complementary delay to task + Add value for SPW cyberattack + [jchandelle] (URB-3337) + + 2.7.41 (2025-06-18) ------------------- diff --git a/news/URB-3337.feature b/news/URB-3337.feature deleted file mode 100644 index 84dfc9e33..000000000 --- a/news/URB-3337.feature +++ /dev/null @@ -1,3 +0,0 @@ -Add option to add complementary delay to task -Add value for SPW cyberattack -[jchandelle] \ No newline at end of file diff --git a/setup.py b/setup.py index 6b9bd8260..6a69749b4 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "2.7.42.dev0" +version = "2.7.42" setup( name="Products.urban", From eaf7af585508cfc9d8be6aecb6fca86c792d8974 Mon Sep 17 00:00:00 2001 From: jimbiscuit Date: Tue, 8 Jul 2025 10:11:40 +0200 Subject: [PATCH 12/25] Back to development: 2.7.43 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6a69749b4..cde65393e 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "2.7.42" +version = "2.7.43.dev0" setup( name="Products.urban", From 03c0ae9f2b4bed067a464021095158bb068ef9ce Mon Sep 17 00:00:00 2001 From: Martin Peeters Date: Tue, 8 Jul 2025 15:42:19 +0200 Subject: [PATCH 13/25] URBBDC-3142: Fix changelog to reflect revert --- docs/CHANGES.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index d31d5fe77..a257fefe2 100644 --- a/docs/CHANGES.rst +++ b/docs/CHANGES.rst @@ -19,6 +19,13 @@ New features: [jchandelle] (URB-3337) +Bug fixes: + + +- Revert: Add building procedure's + [WBoudabous, aduchene] (URBBDC-3142) + + 2.7.41 (2025-06-18) ------------------- From 4dcd5182d886e69c74577a814f889097fce9a510 Mon Sep 17 00:00:00 2001 From: Martin Peeters Date: Wed, 23 Jul 2025 11:29:03 +0200 Subject: [PATCH 14/25] Fix changelog --- docs/CHANGES.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index a257fefe2..86954aa41 100644 --- a/docs/CHANGES.rst +++ b/docs/CHANGES.rst @@ -230,10 +230,9 @@ Bug fixes: - Fix external decision values [daggelpop] - Handle default vocabulary values for a non-array field [daggelpop] (SUP-40288) -- Fix urban vocabularies following configuration order +- Fix urban vocabularies following configuration order [WBoudabous] (SUP-41929) - Add missing translation in schedule config [WBoudabous] (URB-3142) @@ -580,7 +579,7 @@ New features: Bug fixes: -- Fix unicode error on street name merge field +- Fix unicode error on street name merge field [fngaha] (SUP-34184) - Avoid to display disabled vocabulary entries with no start or end validity date [mpeeters] (SUP-36742) From c56d2723d2821d40117b5cfb786a393fc6dbe5dd Mon Sep 17 00:00:00 2001 From: Julien Chandelle Date: Tue, 12 Aug 2025 15:13:34 +0200 Subject: [PATCH 15/25] SUP-46330: Fix patrimony certificates interface (#411) --- news/SUP-46330.bugfix | 2 ++ src/Products/urban/migration/update_270.py | 1 + src/Products/urban/migration/upgrades.zcml | 9 +++++++++ src/Products/urban/profiles/default/metadata.xml | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 news/SUP-46330.bugfix diff --git a/news/SUP-46330.bugfix b/news/SUP-46330.bugfix new file mode 100644 index 000000000..616b0df49 --- /dev/null +++ b/news/SUP-46330.bugfix @@ -0,0 +1,2 @@ +Fix patrimony certificates interface +[jchandelle] \ No newline at end of file diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index 3e5634430..9e3d051a6 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -352,6 +352,7 @@ def fix_patrimony_certificate_class(context): licence.__class__ = PatrimonyCertificate licence.meta_type = "PatrimonyCertificate" licence.schema = PatrimonyCertificate.schema + licence._p_changed = 1 licence.reindexObject() logger.info("upgrade step done!") diff --git a/src/Products/urban/migration/upgrades.zcml b/src/Products/urban/migration/upgrades.zcml index 697aa5f26..2447af730 100644 --- a/src/Products/urban/migration/upgrades.zcml +++ b/src/Products/urban/migration/upgrades.zcml @@ -792,4 +792,13 @@ profile="Products.urban:default" /> + + diff --git a/src/Products/urban/profiles/default/metadata.xml b/src/Products/urban/profiles/default/metadata.xml index d23aa42b6..7308389d8 100644 --- a/src/Products/urban/profiles/default/metadata.xml +++ b/src/Products/urban/profiles/default/metadata.xml @@ -1,6 +1,6 @@ - 1166 + 1167 profile-Products.urban:preinstall From 0b95d02dcd537cea5b75e5943666f309dbd5174f Mon Sep 17 00:00:00 2001 From: jimbiscuit Date: Tue, 12 Aug 2025 15:17:43 +0200 Subject: [PATCH 16/25] Preparing release 2.7.43 --- docs/CHANGES.rst | 10 ++++++++++ news/SUP-46330.bugfix | 2 -- setup.py | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) delete mode 100644 news/SUP-46330.bugfix diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index 86954aa41..601be1f15 100644 --- a/docs/CHANGES.rst +++ b/docs/CHANGES.rst @@ -8,6 +8,16 @@ Changelog .. towncrier release notes start +2.7.43 (2025-08-12) +------------------- + +Bug fixes: + + +- Fix patrimony certificates interface + [jchandelle] (SUP-46330) + + 2.7.42 (2025-07-08) ------------------- diff --git a/news/SUP-46330.bugfix b/news/SUP-46330.bugfix deleted file mode 100644 index 616b0df49..000000000 --- a/news/SUP-46330.bugfix +++ /dev/null @@ -1,2 +0,0 @@ -Fix patrimony certificates interface -[jchandelle] \ No newline at end of file diff --git a/setup.py b/setup.py index cde65393e..db314745f 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "2.7.43.dev0" +version = "2.7.43" setup( name="Products.urban", From 523ee97f47ef7cc893db632b13d21535d4e417af Mon Sep 17 00:00:00 2001 From: jimbiscuit Date: Tue, 12 Aug 2025 15:20:37 +0200 Subject: [PATCH 17/25] Back to development: 2.7.44 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index db314745f..545a3399a 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "2.7.43" +version = "2.7.44.dev0" setup( name="Products.urban", From 351f304ccda65ae51bfe05ab31d8225cb256a289 Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Fri, 22 Aug 2025 12:06:44 +0200 Subject: [PATCH 18/25] fix conflit --- src/Products/urban/migration/update_270.py | 51 +++++++++++++++++++ src/Products/urban/migration/upgrades.zcml | 8 +++ .../urban/profiles/default/metadata.xml | 4 +- 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index 9e3d051a6..75665bdda 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -41,6 +41,7 @@ from zope.component import getUtility import logging +from zope.i18n import translate def rename_patrimony_certificate(context): @@ -573,3 +574,53 @@ def add_additional_delay_option(context): logger.info("upgrade step done!") + +def add_municipal_directive_vocabulary(context): + logger = logging.getLogger("urban: Add municipal directive vocabulary") + logger.info("starting migration steps") + + container = api.portal.get_tool("portal_urban") + vocabulary_name = "municipal_directive" + + municipal_directive_vocabulary_config = [ + + { + "id": "guiding-principles", + "title": translate(_("chapter_1_guiding_principles"), context=context.REQUEST) + }, + { + "id": "density", + "title": translate(_("chapter_2_density"), context=context.REQUEST) + }, + { + "id": "surface-area", + "title": translate(_("chapter_3_surface_area"), context=context.REQUEST) + }, + { + "id": "parking", + "title": translate(_("chapter_4_parking"), context=context.REQUEST) + }, + { + "id": "stormwater-management", + "title": translate(_("chapter_5_stormwater_management"), context=context.REQUEST) + }, + { + "id": "service-premises", + "title": translate(_("chapter_6_service_premises"), context=context.REQUEST) + }, + { + "id": "collective-housing", + "title": translate(_("chapter_7_collective_housing"), context=context.REQUEST) + } + ] + municipal_directive_config = createVocabularyFolder( + container, vocabulary_name, context, "UrbanVocabularyTerm" + ) + + createFolderDefaultValues( + municipal_directive_config, + municipal_directive_vocabulary_config, + "UrbanVocabularyTerm" + ) + + logger.info("upgrade done!") diff --git a/src/Products/urban/migration/upgrades.zcml b/src/Products/urban/migration/upgrades.zcml index 2447af730..23cfa8f16 100644 --- a/src/Products/urban/migration/upgrades.zcml +++ b/src/Products/urban/migration/upgrades.zcml @@ -801,4 +801,12 @@ profile="Products.urban:default" /> + diff --git a/src/Products/urban/profiles/default/metadata.xml b/src/Products/urban/profiles/default/metadata.xml index 7308389d8..88c91f448 100644 --- a/src/Products/urban/profiles/default/metadata.xml +++ b/src/Products/urban/profiles/default/metadata.xml @@ -1,7 +1,7 @@ - 1167 + 1168 profile-Products.urban:preinstall - + \ No newline at end of file From 8f8596768d2abf3e130f27001395de7c7db86fde Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Fri, 22 Aug 2025 12:13:35 +0200 Subject: [PATCH 19/25] update translation --- .../urban/locales/fr/LC_MESSAGES/urban.po | 24 +++++++++++++++++++ src/Products/urban/migration/update_270.py | 14 +++++------ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po index 5967f50c0..699d690be 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po @@ -5435,3 +5435,27 @@ msgstr "ans" msgid "zip_folder_title" msgstr "Zone d'initiative privilégiée" + +msgid "chapter_1" +msgstr "Chapitre 1" + +msgid "chapter_2" +msgstr "Chapitre 2" + +msgid "chapter_3" +msgstr "Chapitre 3" + +msgid "chapter_4" +msgstr "Chapitre 4" + +msgid "chapter_5" +msgstr "Chapitre 5" + +msgid "chapter_6" +msgstr "Chapitre 6" + +msgid "chapter_7" +msgstr "Chapitre 7" + +msgid "municipal_directive_folder_title" +msgstr "Directive communale" \ No newline at end of file diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index 75665bdda..7f79b25f1 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -586,31 +586,31 @@ def add_municipal_directive_vocabulary(context): { "id": "guiding-principles", - "title": translate(_("chapter_1_guiding_principles"), context=context.REQUEST) + "title": translate(_("chapter_1"), context=context.REQUEST) }, { "id": "density", - "title": translate(_("chapter_2_density"), context=context.REQUEST) + "title": translate(_("chapter_2"), context=context.REQUEST) }, { "id": "surface-area", - "title": translate(_("chapter_3_surface_area"), context=context.REQUEST) + "title": translate(_("chapter_3"), context=context.REQUEST) }, { "id": "parking", - "title": translate(_("chapter_4_parking"), context=context.REQUEST) + "title": translate(_("chapter_4"), context=context.REQUEST) }, { "id": "stormwater-management", - "title": translate(_("chapter_5_stormwater_management"), context=context.REQUEST) + "title": translate(_("chapter_5"), context=context.REQUEST) }, { "id": "service-premises", - "title": translate(_("chapter_6_service_premises"), context=context.REQUEST) + "title": translate(_("chapter_6"), context=context.REQUEST) }, { "id": "collective-housing", - "title": translate(_("chapter_7_collective_housing"), context=context.REQUEST) + "title": translate(_("chapter_7"), context=context.REQUEST) } ] municipal_directive_config = createVocabularyFolder( From ce909cdb69070a6bd033fb87d3ea7e5bfb04bb59 Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Tue, 17 Jun 2025 09:47:20 +0200 Subject: [PATCH 20/25] add municipalDirective field for location shemata --- src/Products/urban/content/licence/GenericLicence.py | 11 +++++++++++ src/Products/urban/locales/fr/LC_MESSAGES/urban.po | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/Products/urban/content/licence/GenericLicence.py b/src/Products/urban/content/licence/GenericLicence.py index 21742ff3b..be7445ef5 100755 --- a/src/Products/urban/content/licence/GenericLicence.py +++ b/src/Products/urban/content/licence/GenericLicence.py @@ -1477,6 +1477,17 @@ schemata="urban_environment", default_output_type="text/x-html-safe", ), + LinesField( + name="municipalDirective", + widget=MultiSelect2Widget( + size=10, + label=_("urban_label_municipalDirective", default="municipalDirective"), + ), + schemata="urban_location", + multiValued=True, + vocabulary=UrbanVocabulary("municipal_directive",vocType='UrbanVocabularyTerm', inUrbanConfig=False), + default_method="getDefaultValue", + ), ), ) diff --git a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po index 699d690be..04954d4d4 100644 --- a/src/Products/urban/locales/fr/LC_MESSAGES/urban.po +++ b/src/Products/urban/locales/fr/LC_MESSAGES/urban.po @@ -5458,4 +5458,7 @@ msgid "chapter_7" msgstr "Chapitre 7" msgid "municipal_directive_folder_title" +msgstr "Directive communale" + +msgid "urban_label_municipalDirective" msgstr "Directive communale" \ No newline at end of file From 2f4d85fea4af7d43ecf07dbb9cb01dd560bfbbf5 Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Tue, 17 Jun 2025 09:52:04 +0200 Subject: [PATCH 21/25] add changelog --- news/URB-3342.feature | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 news/URB-3342.feature diff --git a/news/URB-3342.feature b/news/URB-3342.feature new file mode 100644 index 000000000..5e5e93d65 --- /dev/null +++ b/news/URB-3342.feature @@ -0,0 +1,2 @@ +Add vocabulary for municipal directives and include a field for location in the schema. +[WBoudabous] \ No newline at end of file From 1af1d99ba8517f0f2d376c9fbabc2cefcd4d7d29 Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Tue, 17 Jun 2025 10:43:43 +0200 Subject: [PATCH 22/25] rename vocanulary --- .../urban/content/licence/GenericLicence.py | 23 ++++++++++--------- src/Products/urban/migration/update_270.py | 20 ++++++++-------- src/Products/urban/migration/upgrades.zcml | 5 ++-- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/Products/urban/content/licence/GenericLicence.py b/src/Products/urban/content/licence/GenericLicence.py index be7445ef5..b8fb19b53 100755 --- a/src/Products/urban/content/licence/GenericLicence.py +++ b/src/Products/urban/content/licence/GenericLicence.py @@ -1035,6 +1035,17 @@ schemata="urban_location", default_output_type="text/x-html-safe", ), + LinesField( + name="municipalDirective", + widget=MultiSelect2Widget( + size=10, + label=_("urban_label_municipalDirective", default="municipalDirective"), + ), + schemata="urban_location", + multiValued=True, + vocabulary=UrbanVocabulary("municipal_directive",vocType='UrbanVocabularyTerm', inUrbanConfig=False), + default_method="getDefaultValue", + ), LinesField( name="PRenU", widget=MultiSelect2Widget( @@ -1477,17 +1488,7 @@ schemata="urban_environment", default_output_type="text/x-html-safe", ), - LinesField( - name="municipalDirective", - widget=MultiSelect2Widget( - size=10, - label=_("urban_label_municipalDirective", default="municipalDirective"), - ), - schemata="urban_location", - multiValued=True, - vocabulary=UrbanVocabulary("municipal_directive",vocType='UrbanVocabularyTerm', inUrbanConfig=False), - default_method="getDefaultValue", - ), + ), ) diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index 7f79b25f1..dcf872db1 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -582,34 +582,34 @@ def add_municipal_directive_vocabulary(context): container = api.portal.get_tool("portal_urban") vocabulary_name = "municipal_directive" - municipal_directive_vocabulary_config = [ - - { - "id": "guiding-principles", + municipal_directive_vocabulary_config = [ + { + + "id": "chapter_1", "title": translate(_("chapter_1"), context=context.REQUEST) }, { - "id": "density", + "id": "chapter_2", "title": translate(_("chapter_2"), context=context.REQUEST) }, { - "id": "surface-area", + "id": "chapter_3", "title": translate(_("chapter_3"), context=context.REQUEST) }, { - "id": "parking", + "id": "chapter_4", "title": translate(_("chapter_4"), context=context.REQUEST) }, { - "id": "stormwater-management", + "id": "chapter_5", "title": translate(_("chapter_5"), context=context.REQUEST) }, { - "id": "service-premises", + "id": "chapter_6", "title": translate(_("chapter_6"), context=context.REQUEST) }, { - "id": "collective-housing", + "id": "chapter_7", "title": translate(_("chapter_7"), context=context.REQUEST) } ] diff --git a/src/Products/urban/migration/upgrades.zcml b/src/Products/urban/migration/upgrades.zcml index 23cfa8f16..659a2a38e 100644 --- a/src/Products/urban/migration/upgrades.zcml +++ b/src/Products/urban/migration/upgrades.zcml @@ -804,9 +804,10 @@ + From 0b9726f2741471bb67ea6ce15b10fff2160bd212 Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Fri, 22 Aug 2025 12:28:36 +0200 Subject: [PATCH 23/25] run black --- src/Products/urban/migration/update_270.py | 42 ++++++---------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index dcf872db1..409fbfc3c 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -582,37 +582,15 @@ def add_municipal_directive_vocabulary(context): container = api.portal.get_tool("portal_urban") vocabulary_name = "municipal_directive" - municipal_directive_vocabulary_config = [ - { - - "id": "chapter_1", - "title": translate(_("chapter_1"), context=context.REQUEST) - }, - { - "id": "chapter_2", - "title": translate(_("chapter_2"), context=context.REQUEST) - }, - { - "id": "chapter_3", - "title": translate(_("chapter_3"), context=context.REQUEST) - }, - { - "id": "chapter_4", - "title": translate(_("chapter_4"), context=context.REQUEST) - }, - { - "id": "chapter_5", - "title": translate(_("chapter_5"), context=context.REQUEST) - }, - { - "id": "chapter_6", - "title": translate(_("chapter_6"), context=context.REQUEST) - }, - { - "id": "chapter_7", - "title": translate(_("chapter_7"), context=context.REQUEST) - } - ] + municipal_directive_vocabulary_config = [ + {"id": "chapter_1", "title": translate(_("chapter_1"), context=context.REQUEST)}, + {"id": "chapter_2", "title": translate(_("chapter_2"), context=context.REQUEST)}, + {"id": "chapter_3", "title": translate(_("chapter_3"), context=context.REQUEST)}, + {"id": "chapter_4", "title": translate(_("chapter_4"), context=context.REQUEST)}, + {"id": "chapter_5", "title": translate(_("chapter_5"), context=context.REQUEST)}, + {"id": "chapter_6", "title": translate(_("chapter_6"), context=context.REQUEST)}, + {"id": "chapter_7", "title": translate(_("chapter_7"), context=context.REQUEST)}, + ] municipal_directive_config = createVocabularyFolder( container, vocabulary_name, context, "UrbanVocabularyTerm" ) @@ -620,7 +598,7 @@ def add_municipal_directive_vocabulary(context): createFolderDefaultValues( municipal_directive_config, municipal_directive_vocabulary_config, - "UrbanVocabularyTerm" + "UrbanVocabularyTerm", ) logger.info("upgrade done!") From 5f6a94ab964da40ff07126a4fae3f5f9eb861162 Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Fri, 22 Aug 2025 13:42:24 +0200 Subject: [PATCH 24/25] run isort --- src/Products/urban/migration/update_270.py | 46 +++++++++------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/src/Products/urban/migration/update_270.py b/src/Products/urban/migration/update_270.py index b81259a2e..390a3c21d 100644 --- a/src/Products/urban/migration/update_270.py +++ b/src/Products/urban/migration/update_270.py @@ -1,46 +1,38 @@ # encoding: utf-8 +import logging + from Acquisition import aq_parent from eea.facetednavigation.interfaces import ICriteria -from OFS.interfaces import IOrderedContainer -from Products.urban import UrbanMessage as _ -from Products.urban.config import URBAN_TYPES -from Products.CMFCore.utils import getToolByName -from Products.urban.interfaces import IGenericLicence -from Products.urban.migration.utils import refresh_workflow_permissions -from Products.urban.setuphandlers import createFolderDefaultValues -from Products.urban.setuphandlers import createVocabularyFolder from imio.schedule.content.object_factories import MacroCreationConditionObject from imio.schedule.content.object_factories import MacroEndConditionObject from imio.schedule.content.object_factories import MacroFreezeConditionObject from imio.schedule.content.object_factories import MacroRecurrenceConditionObject from imio.schedule.content.object_factories import MacroStartConditionObject from imio.schedule.content.object_factories import MacroThawConditionObject -from imio.schedule.events.zope_registration import ( - register_schedule_collection_criterion, -) +from imio.schedule.events.zope_registration import register_schedule_collection_criterion from imio.schedule.events.zope_registration import register_task_collection_criterion -from imio.schedule.events.zope_registration import ( - subscribe_task_configs_for_content_type, -) -from imio.schedule.events.zope_registration import ( - unregister_schedule_collection_criterion, -) +from imio.schedule.events.zope_registration import subscribe_task_configs_for_content_type +from imio.schedule.events.zope_registration import unregister_schedule_collection_criterion from imio.schedule.events.zope_registration import unregister_task_collection_criterion -from imio.schedule.events.zope_registration import ( - unsubscribe_task_configs_for_content_type, -) +from imio.schedule.events.zope_registration import unsubscribe_task_configs_for_content_type + +from OFS.interfaces import IOrderedContainer from plone import api from plone.registry import Record -from plone.registry.field import Dict -from plone.registry.field import TextLine -from plone.registry.field import List +from plone.registry.field import Dict, List, TextLine from plone.registry.interfaces import IRegistry from plone.restapi.interfaces import ISerializeToJson -from zope.component import getMultiAdapter -from zope.component import getUtility +from Products.CMFCore.utils import getToolByName -import logging +from Products.urban import UrbanMessage as _ +from Products.urban.config import URBAN_TYPES +from Products.urban.interfaces import IGenericLicence +from Products.urban.migration.utils import refresh_workflow_permissions +from Products.urban.setuphandlers import createFolderDefaultValues +from Products.urban.setuphandlers import createVocabularyFolder + +from zope.component import getMultiAdapter, getUtility from zope.i18n import translate @@ -601,4 +593,4 @@ def add_municipal_directive_vocabulary(context): municipal_directive_vocabulary_config, "UrbanVocabularyTerm", ) - logger.info("upgrade done!") \ No newline at end of file + logger.info("upgrade done!") From 7ed753cf4379381bd0c46a2c07cd6e0b781ae0bd Mon Sep 17 00:00:00 2001 From: Wiemboudabous Date: Fri, 22 Aug 2025 14:18:04 +0200 Subject: [PATCH 25/25] run flake8 --- .../urban/content/licence/GenericLicence.py | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/src/Products/urban/content/licence/GenericLicence.py b/src/Products/urban/content/licence/GenericLicence.py index b8fb19b53..ca8a6c64b 100755 --- a/src/Products/urban/content/licence/GenericLicence.py +++ b/src/Products/urban/content/licence/GenericLicence.py @@ -50,10 +50,8 @@ from Products.MasterSelectWidget.MasterBooleanWidget import MasterBooleanWidget from Products.MasterSelectWidget.MasterSelectWidget import MasterSelectWidget 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.widget.historizereferencewidget import ( HistorizeReferenceBrowserWidget, ) @@ -1035,17 +1033,6 @@ schemata="urban_location", default_output_type="text/x-html-safe", ), - LinesField( - name="municipalDirective", - widget=MultiSelect2Widget( - size=10, - label=_("urban_label_municipalDirective", default="municipalDirective"), - ), - schemata="urban_location", - multiValued=True, - vocabulary=UrbanVocabulary("municipal_directive",vocType='UrbanVocabularyTerm', inUrbanConfig=False), - default_method="getDefaultValue", - ), LinesField( name="PRenU", widget=MultiSelect2Widget( @@ -1488,7 +1475,6 @@ schemata="urban_environment", default_output_type="text/x-html-safe", ), - ), ) @@ -1599,9 +1585,9 @@ def divideList(self, divider, list): part = len(list) / divider remain = len(list) % divider for i in range(part): - res.append(list[i * divider : (i + 1) * divider]) + res.append(list[i * divider: (i + 1) * divider]) if remain > 0: - res.append(list[divider * part : divider * part + remain]) + res.append(list[divider * part: divider * part + remain]) return tuple(res) def templateRoadEquipments(self, tup): @@ -1691,7 +1677,6 @@ def listCentralities(self): ) return DisplayList(vocab) - security.declarePublic("foldermanagersBaseQuery") def foldermanagersBaseQuery(self): @@ -1805,7 +1790,7 @@ def getOpinionRequests(self, organisation=""): return res security.declarePublic("get_complementary_delay") - + def get_complementary_delay(self): complementary_delay = self.getComplementary_delay() if not complementary_delay: @@ -1914,7 +1899,7 @@ def showWatercourseCategories(self, *values): def getFirstDeposit(self): return self.getFirstEvent(interfaces.IDepositEvent) - + def getSecondDeposit(self): return self.getSecondEvent(interfaces.IDepositEvent) @@ -1988,7 +1973,7 @@ def getFirstEvent(self, eventInterface=None): events = self.getAllEvents(eventInterface) if events: return events[0] - + def getSecondEvent(self, eventInterface=None): events = self.getAllEvents(eventInterface) if len(events) > 1: @@ -2123,9 +2108,7 @@ def legalconditions_base_query(self): return {"review_state": ["enabled", "private"]} - registerType(GenericLicence, PROJECTNAME) # end of class GenericLicence - # code-section module-footer #fill in your manual code here # /code-section module-footer