예제 #1
0
    'urban_location':
    ('liege.urban: External Reader', 'liege.urban: Internal Editor'),
    'urban_environment':
    ('liege.urban: Internal Reader', 'liege.urban: Environment Editor'),
    'urban_road': ('liege.urban: Road Reader', 'liege.urban: Road Editor'),
}

exceptions = [
    'portal_type', 'id', 'claimsSynthesis',
    'environmentTechnicalAdviceAfterInquiry', 'commentsOnSPWOpinion',
    'conclusions'
]

for licence_class in env_licence_classes:
    licence_class.schema = update_licences_schema(licence_class.schema)
    licence_class.schema = set_field_permissions(
        licence_class.schema,
        licences_permissions_mapping,
        exceptions,
    )
# env class bordering has no specific worfklow, apply same permissions than class 3
EnvClassBordering.schema = set_environment_field_permissions(
    EnvClassBordering.schema)


def getAllValidationEvents(self):
    return self.getAllEvents(interfaces.IUrbanEventWithEnvironmentValidation)


EnvironmentBase.getAllValidationEvents = getAllValidationEvents
예제 #2
0
licence_classes = [
    Article127, BuildLicence, Declaration, Division, EnvClassOne,
    EnvClassThree, EnvClassTwo, MiscDemand, ParcelOutLicence,
    PatrimonyCertificate, UrbanCertificateBase, UrbanCertificateTwo,
    IntegratedLicence, UniqueLicence, CODT_Article127, CODT_BuildLicence,
    CODT_UrbanCertificateTwo, CODT_IntegratedLicence, CODT_UniqueLicence,
    CODT_UrbanCertificateBase, Inspection, Ticket, RoadDecree
]

for licence_class in licence_classes:
    licence_class.schema = update_item_schema(licence_class.schema)
    permissions_mapping = {
        'urban_analysis':
        ('liege.urban: Internal Reader', 'liege.urban: Internal Editor'),
    }
    licence_class.schema = set_field_permissions(licence_class.schema,
                                                 permissions_mapping)


def updateTitle(self):
    """
        Update the title to clearly identify the licence
    """
    if self.getApplicants():
        applicantTitle = self.getApplicants()[0].Title()
    else:
        applicantTitle = translate('no_applicant_defined',
                                   'urban',
                                   context=self.REQUEST).encode('utf8')
    to_shore = queryAdapter(self, IShore)
    title = "%s %s - %s - %s" % (self.getReference(), to_shore.display(),
                                 self.getLicenceSubject(), applicantTitle)
예제 #3
0
# -*- coding: utf-8 -*-

from Products.urban.content.licence.UrbanCertificateTwo import UrbanCertificateTwo

# buildlicence and article127 schema should have the same changes
from liege.urban.content.buildlicence import update_item_schema
from liege.urban.licence_fields_permissions import set_field_permissions

permissions_mapping = {
    'urban_description':
    ('liege.urban: External Reader', 'liege.urban: Description Editor'),
    'urban_description':
    ('liege.urban: External Reader', 'liege.urban: Description Editor'),
    'urban_location':
    ('liege.urban: External Reader', 'liege.urban: Road Editor'),
    'urban_road': ('liege.urban: Road Reader', 'liege.urban: Road Editor'),
}

UrbanCertificateTwo.schema = update_item_schema(UrbanCertificateTwo.schema)
UrbanCertificateTwo.schema = set_field_permissions(
    UrbanCertificateTwo.schema,
    permissions_mapping,
)
예제 #4
0
    LicenceSchema['pebType'].schemata = 'urban_analysis'
    LicenceSchema.moveField('pebType', after='usage')
    LicenceSchema['pebDetails'].schemata = 'urban_analysis'
    LicenceSchema.moveField('pebDetails', after='pebType')
    LicenceSchema['pebStudy'].schemata = 'urban_analysis'
    LicenceSchema.moveField('pebStudy', after='pebDetails')
    LicenceSchema['pebTechnicalAdvice'].schemata = 'urban_analysis'
    LicenceSchema.moveField('pebTechnicalAdvice', after='pebStudy')

    # move some road fields to location schemata
    LicenceSchema['roadDgrneUnderground'].schemata = 'urban_location'
    LicenceSchema.moveField('roadDgrneUnderground', after='natura_2000')
    LicenceSchema.moveField('roadType', after='roadDgrneUnderground')
    LicenceSchema['roadAdaptation'].schemata = 'urban_analysis'
    LicenceSchema.moveField('roadAdaptation', before='annoncedDelay')

    # stats INS no longer mandatory
    LicenceSchema['usage'].required = False
    LicenceSchema['roadTechnicalAdvice'].widget.label = _(
        'urban_label_roadDescription')
    LicenceSchema['missingParts'].widget.size = 15

    return LicenceSchema


BuildLicence.schema = update_item_schema(BuildLicence.schema)
BuildLicence.schema = set_field_permissions(
    BuildLicence.schema,
    permissions_mapping,
)
예제 #5
0
# -*- coding: utf-8 -*-

from Products.urban.content.licence.IntegratedLicence import IntegratedLicence

# buildlicence and article127 schema should have the same changes
from liege.urban.content.buildlicence import update_item_schema
from liege.urban.licence_fields_permissions import set_field_permissions

permissions_mapping = {
    'urban_description': ('liege.urban: External Reader', 'liege.urban: Description Editor'),
    'urban_habitation': ('liege.urban: External Reader', 'liege.urban: Habitation Editor'),
}


IntegratedLicence.schema = update_item_schema(IntegratedLicence.schema)
IntegratedLicence.schema = set_field_permissions(
    IntegratedLicence.schema,
    permissions_mapping,
)
예제 #6
0
# -*- coding: utf-8 -*-

from Products.urban.content.licence.PreliminaryNotice import PreliminaryNotice

from liege.urban.licence_fields_permissions import set_field_permissions

permissions_mapping = {
    'urban_description':
    ('liege.urban: External Reader', 'liege.urban: Description Editor'),
    'urban_analysis':
    ('liege.urban: Internal Reader', 'liege.urban: Internal Editor'),
}

PreliminaryNotice.schema = set_field_permissions(
    PreliminaryNotice.schema,
    permissions_mapping,
)
예제 #7
0
# -*- coding: utf-8 -*-

from Products.urban.content.licence.UniqueLicence import UniqueLicence

# buildlicence and uniquelicence schema should have the same changes
from liege.urban.content.buildlicence import update_item_schema
from liege.urban.content.codt_uniquelicence import updateTitle
from liege.urban.licence_fields_permissions import set_field_permissions

permissions_mapping = {
    'urban_description':
    ('liege.urban: External Reader', 'liege.urban: Description Editor'),
    'urban_analysis':
    ('liege.urban: Internal Reader', 'liege.urban: Internal Editor'),
    'urban_habitation':
    ('liege.urban: External Reader', 'liege.urban: Habitation Editor'),
}

UniqueLicence.schema = update_item_schema(UniqueLicence.schema)
UniqueLicence.schema = set_field_permissions(
    UniqueLicence.schema,
    permissions_mapping,
)

UniqueLicence.updateTitle = updateTitle
예제 #8
0
# -*- coding: utf-8 -*-

from Products.urban.content.licence.RoadDecree import RoadDecree

from liege.urban import UrbanMessage as _
from liege.urban.licence_fields_permissions import set_field_permissions

permissions_mapping = {
    'urban_description': ('liege.urban: External Reader', 'liege.urban: Description Editor'),
    'urban_analysis': ('liege.urban: Internal Reader', 'liege.urban: Internal Editor'),
    'urban_road': ('liege.urban: Road Reader', 'liege.urban: Road Editor'),
    'urban_habitation': ('liege.urban: External Reader', 'liege.urban: Habitation Editor'),
}


def update_item_schema(base_schema):
    licence_schema = base_schema.copy()
    licence_schema['roadTechnicalAdvice'].widget.label = _(
        'urban_label_roadDescription'
    )
    licence_schema['requirementFromFDModifiedBp'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}
    licence_schema['exemptFDArticleModifiedBp'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}

    return licence_schema


RoadDecree.schema = update_item_schema(RoadDecree.schema)
RoadDecree.schema = set_field_permissions(RoadDecree.schema, permissions_mapping)
예제 #9
0
    'urban_road': ('liege.urban: Road Reader', 'liege.urban: Road Editor'),
    'urban_habitation':
    ('liege.urban: External Reader', 'liege.urban: Habitation Editor'),
}

# claimsSynthesis and environmentTechnicalAdviceAfterInquiry must have reviewer
# write permission to be able to freeze them in the workflow
exceptions = [
    'portal_type', 'id', 'claimsSynthesis',
    'environmentTechnicalAdviceAfterInquiry', 'commentsOnSPWOpinion',
    'conclusions'
]

CODT_UniqueLicence.schema = set_field_permissions(
    CODT_UniqueLicence.schema,
    permissions_mapping,
    exceptions,
)


def updateTitle(self):
    """
        Update the title to clearly identify the licence
    """
    if self.getApplicants():
        applicantTitle = self.getApplicants()[0].Title()
    else:
        applicantTitle = translate('no_applicant_defined',
                                   'urban',
                                   context=self.REQUEST).encode('utf8')
    to_shore = queryAdapter(self, IShore)
예제 #10
0
# -*- coding: utf-8 -*-

from Products.urban.content.licence.Article127 import Article127

# buildlicence and article127 schema should have the same changes
from liege.urban.content.buildlicence import update_item_schema
from liege.urban.licence_fields_permissions import set_field_permissions

permissions_mapping = {
    'urban_description':
    ('liege.urban: External Reader', 'liege.urban: Description Editor'),
    'urban_analysis':
    ('liege.urban: Internal Reader', 'liege.urban: Internal Editor'),
    'urban_location':
    ('liege.urban: External Reader', 'liege.urban: Road Editor'),
    'urban_road': ('liege.urban: Road Reader', 'liege.urban: Road Editor'),
    'urban_habitation':
    ('liege.urban: External Reader', 'liege.urban: Habitation Editor'),
}

Article127.schema = update_item_schema(Article127.schema)
Article127.schema = set_field_permissions(
    Article127.schema,
    permissions_mapping,
)