Пример #1
0
class IHistoryRowSchema(model.Schema):
    modified_field = schema.TextLine(title=_(u"Modified field"),
                                     required=False)

    date = schema.Date(title=_(u"Date"), required=False)

    user = schema.TextLine(title=_(u"User"), required=False)
Пример #2
0
class IMultidiciplinaryRowSchema(model.Schema):

    cce_event_coordination_cell = ObjectField(
        title=_(u"CCE Event Coordination Cell"),
        required=False,
        schema=ICCEEventCoordinationCellRowSchema,
    )

    centre_100 = RichText(title=_(u"Centre 100"), required=False)
Пример #3
0
class IDiscipline2RowSchema(model.Schema):

    Location_ps_pma = RichText(title=_(u"Location P.S.,P.M.A."), required=False)

    organizing_means_on_site = RichText(
        title=_(u"Organizing means on site (for info)"), required=False
    )

    zhc_extra_means_at_the_first_aid_post = RichText(
        title=_(u"Z.H.C. extra means at the first aid post"), required=False
    )
Пример #4
0
class AnomaliesReportingSettingsEditForm(controlpanel.RegistryEditForm):

    schema = IAnomaliesReportingSettingsSchema
    label = _(u"Anomalies reporting settings")
    description = _(u"")

    def updateFields(self):
        super(AnomaliesReportingSettingsEditForm, self).updateFields()

    def updateWidgets(self):
        super(AnomaliesReportingSettingsEditForm, self).updateWidgets()
Пример #5
0
 def __call__(self, context):
     values = [
         {
             "LOW": _("LOW", u"Low risk")
         },
         {
             "MED": _("MED", u"Medium Risk")
         },
         {
             "HIG": _("HIG", u"High risk")
         },
     ]
     return dict_list_2_vocabulary(values)
Пример #6
0
 def __call__(self, context):
     values = [
         {
             "UNC": _("UNC", u"Unclassified")
         },
         {
             "SMA": _("SMA", u"classified small SEVESO")
         },
         {
             "BIG": _("BIG", u"classified big SEVESO")
         },
     ]
     return dict_list_2_vocabulary(values)
Пример #7
0
class IKeysCodeAccessBadgeFieldsRowSchema(model.Schema):

    existence_keys_code_access_badge = schema.Bool(
        title=_(u"Existence of keys, code, access badge?"), required=False)

    information = RichText(
        required=False,
        default_mime_type="text/html",
        defaultFactory=default_translator(
            _(u"<p>Description and usefulness of the keys :</p>"
              u"<p>Where the key is stored :</p>"
              u"<p>Number of copies :</p>")),
    )

    last_key_check_date = schema.Date(title=_(u"Last Key Check Date"),
                                      required=False)
Пример #8
0
 def validate(self, value):
     super(ImplementationPlanValidator, self).validate(value)
     dependency_key = "form.widgets.data_limited_to_description"
     if not self.request.form.get(dependency_key) and not value:
         raise Invalid(
             _(u"The implementation plan is mandatory if the ppi data is "
               u"not limited to the description"))
Пример #9
0
    def exist_popup(self):
        list_popup = api.content.find(context=self.context,
                                      portal_type="pop_up")

        if not list_popup:
            return False

        for popup in list_popup:
            if popup.EffectiveDate != "None":
                today = datetime.date.today()
                start = popup.effective.date()
                end = popup.expires.date()
                if start <= today <= end:
                    popup_obj = popup.getObject()
                    text = _(
                        u"popup_message",
                        default=
                        u"<h4>${titre}</h4> <p>From ${start} to ${end}</p> <p>${message}</p>",
                        mapping={
                            u"titre": popup_obj.titre,
                            u"start": start.strftime("%d-%m-%Y"),
                            u"end": end.strftime("%d-%m-%Y"),
                            u"message": popup_obj.richtext_desc.output,
                        },
                    )
                    return text

        return False
Пример #10
0
class IDiscipline1RowSchema(model.Schema):

    zhc_means_on_site = ObjectField(
        title=_(u"Z.H.C. means on site"),
        schema=IZHCMeansOnSiteRowSchema,
        required=False,
    )

    organizing_means_on_site = RichText(
        title=_(u"Organizing means on site (for info)"), required=False
    )

    zhc_extra_means_at_the_first_aid_post = ObjectField(
        title=_(u"Z.H.C. extra means at the first aid post"),
        schema=IZHCExtraMeansAtTheFirstAidPostRowSchema,
        required=False,
    )
Пример #11
0
class IZHCMeansOnSiteRowSchema(model.Schema):

    start = schema.Datetime(title=_(u"Schedule start"), required=False)

    end = schema.Datetime(title=_(u"Schedule end"), required=False)

    at_the_events_coordination_centre = RichText(
        title=_(u"At the events coordination centre (representative D1)"),
        required=False,
    )

    in_the_field = RichText(title=_(u"In the field (field PC)"), required=False)

    @invariant
    def validate_start_end(data):
        if data.start is not None and data.end is not None:
            if data.start > data.end:
                raise Invalid(_(u"The start date must be before the end date."))
Пример #12
0
class IPopUp(model.Schema):

    titre = schema.TextLine(title=_(u"Titre"), required=True)

    richtext_desc = RichText(title=_(u"Description"),
                             default_mime_type="text/html",
                             required=True)

    effective = schema.Date(title=_(u"Date start"), required=True)

    expires = schema.Date(title=_(u"Date end"), required=True)

    @invariant
    def validate_start_end(data):
        if data.effective is not None and data.expires is not None:
            if data.effective > data.expires:
                raise Invalid(
                    _(u"The start date must be before the end date."))
Пример #13
0
class IZHCExtraMeansAtTheFirstAidPostRowSchema(model.Schema):

    richtext_fields = RichText(
        required=False,
        defaultFactory=default_translator(
            _(u"<p><span>Human</span> :</p><p></p>" u"<p><span>Equipment</span> :</p>")
        ),
        default_mime_type="text/html",
    )

    start = schema.Datetime(title=_(u"Schedule start"), required=False)

    end = schema.Datetime(title=_(u"Schedule end"), required=False)

    @invariant
    def validate_start_end(data):
        if data.start is not None and data.end is not None:
            if data.start > data.end:
                raise Invalid(_(u"The start date must be before the end date."))
Пример #14
0
class AddForm(add.DefaultAddForm, BrowserView):
    portal_type = "ppi"
    template = ViewPageTemplateFile("templates/ppi_form_add.pt")

    def updateFields(self):
        super(add.DefaultAddForm, self).updateFields()
        self.group_errors = []
        self.update_fieldset_classes()

    @button.buttonAndHandler(_("Save"), name="save")
    def handleAdd(self, action):
        data, errors = self.extractData()
        if errors:
            self.status = self.formErrorsMessage
            self.handle_errors(errors)
            return
        # self.update_fieldset_classes()
        obj = self.createAndAdd(data)
        if obj is not None:
            # mark only as finished if we get the new object
            self._finishedAdd = True
            IStatusMessage(self.request).addStatusMessage(
                self.success_message, "info")

    def handle_errors(self, errors):

        group_ids = []
        self.group_labels = {}
        for error in errors:
            name = error.form.__name__
            if name not in group_ids:
                group_ids.append(name)
                self.group_labels[name] = error.form.label

        self.group_errors = group_ids

        self.update_fieldset_classes()

    def get_fieldset_legend_class(self, group):
        if group.__name__ in self.group_errors:
            return "error"
        return ""

    def update_fieldset_classes(self):
        self.fieldset_class = {}
        for group in self.groups:
            self.fieldset_class[
                group.__name__] = self.get_fieldset_legend_class(group)

    def get_group_label(self, group):
        return self.group_labels[group]
Пример #15
0
class ICCEEventCoordinationCellRowSchema(model.Schema):

    present_location = RichText(
        title=_(u"Present and location"),
        required=False,
        defaultFactory=default_translator(
            _(
                u"<p><span>Presence</span> :</p><p></p>"
                u"<p><span>Location</span> :</p>"
            )
        ),
        default_mime_type="text/html",
    )

    start = schema.Datetime(title=_(u"Schedule start"), required=False)

    end = schema.Datetime(title=_(u"Schedule end"), required=False)

    @invariant
    def validate_start_end(data):
        if data.start is not None and data.end is not None:
            if data.start > data.end:
                raise Invalid(_(u"The start date must be before the end date."))
Пример #16
0
class IAddressRowSchema(model.Schema):
    number = schema.TextLine(title=_(u"N°"), required=False)

    street = schema.TextLine(title=_(u"Street"), required=True)

    zip_code = schema.Int(title=_(u"Zip code"), required=True)

    commune = schema.TextLine(title=_(u"Commune"), required=True)

    longitude = schema.Float(title=_(u"Longitude"), required=False)

    latitude = schema.Float(title=_(u"Latitude"), required=False)
Пример #17
0
 def validate_start_end(data):
     if data.start is not None and data.end is not None:
         if data.start > data.end:
             raise Invalid(_(u"The start date must be before the end date."))
Пример #18
0
class IPpi(model.Schema):
    """IPpi"""

    fieldset(
        "description sheet",
        label=_(u"Description sheet"),
        fields=[
            "title",
            "other_names",
            "address",
            "occupancy_schedule",
            "type_of_activity",
            "concierge_service",
            "contacts",
            "premises",
            "existence_of_a_ppui",
            "data_limited_to_description",
            "site_classified_seveso",
            "keys_code_access_badge",
            "date_of_update_of_the_description_sheet",
        ],
    )

    title = schema.TextLine(title=_(u"Site name"), required=True)

    other_names = schema.TextLine(title=_(u"Other names"), required=False)

    address = ObjectField(title=_(u"Address"),
                          schema=IAddressRowSchema,
                          required=True)

    occupancy_schedule = RichText(
        title=_(u"Occupancy schedule"),
        description=_(
            u"<p>Specify night occupancy or not. Specify public occupation</p>"
        ),
        default_mime_type="text/html",
        defaultFactory=default_translator(
            _(u'{table}<div><div class="column">'
              u"<p><span>0 No activity</span></p>"
              u"<p><span>1 Workers present</span></p>"
              u"<p><span>2 Open to public</span></p>"
              u"</div></div>"),
            table=occupation_table_value,
        ),
        required=False,
    )

    type_of_activity = schema.TextLine(
        title=_(u"Type of activity"),
        description=
        _(u"<p>Factory, warehouse, store, MRPA... Public access, number of people, valid? autonomous? sleeping? Describe in a few lines what it is about.</p>"
          ),
        required=False,
    )

    concierge_service = schema.Bool(title=_(u"Concierge Service?"),
                                    required=False)

    contacts = RichText(
        title=_(u"Contacts"),
        required=False,
        defaultFactory=default_translator(
            _(u'<table border="1">'
              u"<tbody>"
              u"<tr>"
              u"<td><strong>Priority</strong></td>"
              u"<td><strong>Function</strong></td>"
              u"<td><strong>Phone</strong></td>"
              u"<td><strong>Remark</strong></td>"
              u"</tr>"
              u"<tr>"
              u"<td>&nbsp;</td>"
              u"<td>&nbsp;</td>"
              u"<td>&nbsp;</td>"
              u"<td>&nbsp;</td>"
              u"</tr>"
              u"</tbody>"
              u"</table>")),
        default_mime_type="text/html",
    )

    premises = RichText(title=_(u"Premises"), required=False)

    existence_of_a_ppui = schema.Text(
        title=_(u"Existence of a PPUI?"),
        description=
        _(u"<p>If yes, briefly describe the multidisciplinary principles...</p>"
          ),
        required=False,
    )

    data_limited_to_description = schema.Bool(
        title=_(u"Data limited to description?"), required=False)

    site_classified_seveso = schema.Choice(
        title=_(u"Site classified SEVESO?"),
        vocabulary=u"rescuearea.core.vocabularies.seveso",
        required=False,
    )

    keys_code_access_badge = ObjectField(
        title=_(u"Keys, code, access badge?"),
        description=_(u"If yes, describe utility"),
        schema=IKeysCodeAccessBadgeFieldsRowSchema,
        required=False,
    )

    date_of_update_of_the_description_sheet = schema.Date(
        title=_(u"Date of update of the description sheet"), required=False)

    fieldset(
        "before departure",
        label=_(u"Before departure"),
        fields=[
            "adaptation_of_the_emergency_services_in_relation_to_the_response_plan",
            "specific_equipment_to_take_with_you",
            "route_to_follow",
            "site_particularities",
            "instructions_for_the_operator",
        ],
    )

    adaptation_of_the_emergency_services_in_relation_to_the_response_plan = RichText(
        title=
        _(u"Adaptation of the emergency services in relation to the response plan"
          ),
        description=
        _(u"<p>How should the dispatch of help be adapted for this site in relation to the usual procedures?</p>"
          ),
        required=False,
    )

    specific_equipment_to_take_with_you = RichText(
        title=_(u"Specific equipment to take with you"),
        description=
        _(u"<p>For example UHF relay for buildings with insufficient UHF range</p>"
          ),
        required=False,
    )

    route_to_follow = RichText(
        title=_(u"Route to follow"),
        description=
        _(u"<p>Is it always the same, or according to the intervention, you must take into account the direction of the wind, or arrive by a particular access to the site according to the place where the event occurred</p>"
          ),
        required=False,
    )

    site_particularities = RichText(
        title=_(u"Site Particularities"),
        description=
        _(u"<p>Describe in a few words why this site is special and has been the subject of a PPI.</p><p>Example: Access not very obvious, complex architecture, exceptional risk(s) present, means of control available on site for firefighters, place for which an intervention will be arduous because of the absence of compartmentalization...</p>"
          ),
        required=False,
    )

    instructions_for_the_operator = RichText(
        title=_(u"Instructions for the operator"),
        description=
        _(u"<p>Specify here if specific actions are to be taken by the operator.</p><p>For example, if the call comes from a private individual, it is imperative to contact the lodge on duty to inform those in charge of the site of our arrival, and thus be welcomed.</p>"
          ),
        required=False,
    )

    fieldset(
        "during the ride",
        label=_(u"During the ride"),
        fields=[
            "vehicle_stop_emergency_reception_point",
            "point_of_first_destination"
        ],
    )

    vehicle_stop_emergency_reception_point = RichText(
        title=_(u"Vehicle stop/emergency reception point"),
        description=
        _(u"<p>Specify here if a meeting point is planned with site managers for reasons of access complexity, or if depending on a chemical scenario you should not get too close...</p>"
          ),
        required=False,
    )

    point_of_first_destination = RichText(
        title=_(u"Point of First Destination (PFD)"),
        description=
        _(u"<p>Specify if a particular place has been designed to gather emergency services in the event of an increase in power. Important mainly if reflex reinforcements are sent, or in case of chemical intervention, for example.</p>"
          ),
        required=False,
    )

    fieldset(
        "on_site",
        label=_(u"On site"),
        fields=[
            "reflex_measurements_on_arrival_on_site",
            "special_means_of_protection_to_wear",
            "risks_present",
            "materials_equipment_available",
        ],
    )

    reflex_measurements_on_arrival_on_site = RichText(
        title=_(u"Reflex measurements on arrival on site"), required=False)

    special_means_of_protection_to_wear = RichText(
        title=_(u"Special means of protection to wear"),
        description=
        _(u"<p>Specify here the means that must be taken in addition to firefighting, or the personal protective equipment imposed on an industrial site for example</p>"
          ),
        required=False,
    )

    materials_equipment_available = RichText(
        title=_(u"Materials/Equipment available"),
        description=
        _(u"<p>Identify the main risks of the site. limit yourself to about 5 maximum.</p><p>Completeness = drown the fish!</p>"
          ),
        required=False,
    )

    risks_present = RichText(
        title=_(u"Risks Present"),
        description=
        _(u"<p>we need to know what's available to assist us in intervention. It is not necessary to mention the presence of fire extinguishers or even reels intended for the PPE of the site. On the other hand, hydrants, dry or wet columns... must be mentioned.</p>"
          ),
        required=False,
    )

    fieldset(
        "Return to normal",
        label=_(u"Return to normal"),
        fields=["attention_points_for_the_return_to_normal"],
    )

    attention_points_for_the_return_to_normal = RichText(
        title=_(u"Attention points for the return to normal"), required=False)

    fieldset(
        "additional_information",
        label=_(u"Additional information"),
        fields=[
            "appendix_itinerary",
            "appendix_map_of_the_location",
            "appendix_implementation_plan",
            "appendix_water_resources",
            "appendix_axonometric_view",
            "appendix_carroyer_plan",
            "appendix_description",
        ],
    )

    appendix_itinerary = NamedBlobFile(
        title=_(u"Appendix : Itinerary"),
        description=_(
            u"<p>mandatory if wind has an influence (toxic risk)</p>"),
        required=False,
    )

    appendix_map_of_the_location = ObjectField(
        title=_(u"Appendix : Map of the location"),
        description=
        _(u"<p>To do via the PPI carto app to put on line on the map.</p><ul><li>Locate accesses</li><li>Red/black area if known</li><li>Type google map with black box on the object </li></ul>"
          ),
        schema=ILinkFileRowSchema,
        required=True,
    )

    appendix_implementation_plan = NamedBlobFile(
        title=_(u"Appendix : Implementation Plan"),
        description=
        _(u"<p>mandatory : do in A3 on the basis of the zonal canvas</p><ul><li>Wind dose</li><li>Access</li><li>(Sub-funds)</li><li>Scale</li><li>Legend of layout </li><li>Pictogram<ul><li>Keybox</li><li>Concierge</li><li>Exhaust installation</li><li>Fire detection station (or firefighter control station)</li><li>Sprinkler installation</li></ul></li><li>Localization of the crisis room of the ets</li></ul>"
          ),
        required=False,
    )

    appendix_water_resources = ObjectField(
        title=_(u"Appendix : Water resources"),
        description=_(
            u"<p>mandatory to be printed from the PPI carto application</p>"),
        schema=ILinkFileRowSchema,
        required=False,
    )

    appendix_axonometric_view = NamedBlobFile(
        title=_(u"Appendix : Axonometric view"), required=False)

    appendix_carroyer_plan = NamedBlobFile(
        title=_(u"Appendix : Carroyer plan"),
        description=
        _(u"<p>Mandatory if the size of the site does not fit within a 250m x 250m square. To do by the Carto team to put online on the PPI carto app.</p><p>If there is no 'not shown', indicate 'not shown'.</p>"
          ),
        required=False,
    )

    appendix_description = NamedBlobFile(
        title=_(u"Appendix : Description"),
        description=
        _(u"<p>Free annex examples</p><ul><li>Facade photos</li><li>Level plan<ul><li>Scale</li><li>Wind dose</li><li>Compartments</li><li>Access</li><li>Pictogra<ul><li>Keybox</li><li>Concierge</li><li>Exhaust installation</li><li>Fire detection center</li><li>Sprinkler installation</li><li>Localization of the crisis room of the ets</li></ul></li><li>Construction<ul><li>Wall structure</li><li>Roof structure</li></ul></li></ul></li><li>Fire panel operation mode</li></ul>"
          ),
        required=False,
    )

    fieldset(
        "Administration of PPI",
        label=_(u"Administration of PPI"),
        fields=[
            "description",
            "date_of_last_modification",
            "deadline_for_searching_for_additional_information",
            "modification_history",
            "case_officer",
            "preventionist",
            "availability_of_paper_copies",
            "classification_for_risk_analysis",
        ],
    )

    description = schema.TextLine(title=_(u"PPI reference"), required=True)

    date_of_last_modification = schema.Date(
        title=_(u"Date of last modification"), required=False)

    deadline_for_searching_for_additional_information = schema.Date(
        title=_(u"Deadline for searching for additional information"),
        required=False)

    modification_history = schema.List(
        title=_(u"Modification history"),
        required=False,
        value_type=ObjectField(title=_(u"History"), schema=IHistoryRowSchema),
    )

    case_officer = schema.TextLine(title=_(u"case_officer"), required=False)

    preventionist = schema.TextLine(title=_(u"Preventionist"), required=False)

    availability_of_paper_copies = schema.Text(
        title=_(u"Availability of Paper Copies"),
        description=
        _(u"<p>Specify the places where it is necessary to have paper copies available </p><ul><li>DZHC</li><li>Fastest first aid station (several if the means must come from several stations)</li></ul>"
          ),
        required=False,
    )

    classification_for_risk_analysis = schema.Choice(
        title=_(u"Classification for risk analysis"),
        vocabulary=u"rescuearea.core.vocabularies.classification",
        required=False,
    )
Пример #19
0
class AddForm(add.DefaultAddForm, BrowserView):
    portal_type = "ppi_e"
    template = ViewPageTemplateFile("templates/ppie_form_add.pt")

    def update(self):
        super(add.DefaultAddForm, self).update()
        for group in [g for g in self.groups if g.__name__ == "dates"]:
            group.widgets["IPublication.effective"].required = True
            group.widgets["IPublication.expires"].required = True

    def required_default(self, group, field_name, data):
        field_object = group.fields[field_name].field
        if field_object.required:
            default_value = group.fields[field_name].field.defaultFactory
            value = getattr(data, field_name, None)

            if default_value == value:
                return True
        return False

    def updateFields(self):
        super(add.DefaultAddForm, self).updateFields()
        self.group_errors = []
        self.update_fieldset_classes()

    @button.buttonAndHandler(_("Save"), name="save")
    def handleAdd(self, action):
        data, errors = self.extractData()
        if errors:
            self.status = self.formErrorsMessage
            self.handle_errors(errors)
            return
        # self.update_fieldset_classes()
        obj = self.createAndAdd(data)
        if obj is not None:
            # mark only as finished if we get the new object
            self._finishedAdd = True
            IStatusMessage(self.request).addStatusMessage(self.success_message, "info")

    def handle_errors(self, errors):

        group_ids = []
        self.group_labels = {}
        for error in errors:
            name = error.form.__name__
            if name not in group_ids:
                group_ids.append(name)
                self.group_labels[name] = error.form.label

        self.group_errors = group_ids

        self.update_fieldset_classes()

    def get_fieldset_legend_class(self, group):
        if group.__name__ in self.group_errors:
            return "error"
        return ""

    def update_fieldset_classes(self):
        self.fieldset_class = {}
        for group in self.groups:
            self.fieldset_class[group.__name__] = self.get_fieldset_legend_class(group)

    def get_group_label(self, group):
        return self.group_labels[group]
Пример #20
0
 def validate(self, value):
     super(DefaultValueValidator2, self).validate(value)
     if self.field.defaultFactory(self) == value.output.replace(
         u"\r\n<p>\xa0</p>\r\n", u"<p>&nbsp;</p>"
     ):
         raise Invalid(_(u"It is necessary to change the default value"))
Пример #21
0
 def validate(self, value):
     super(DefaultValueValidator, self).validate(value)
     if self.field.defaultFactory(self) == value.output.replace("\r\n", ""):
         raise Invalid(_(u"It is necessary to change the default value"))
Пример #22
0
class IPpie(model.Schema):
    """IPpie"""

    fieldset(
        "Description of the event",
        label=_(u"Description of the event"),
        fields=["date_time", "location", "nature_and_risk_involved", "impacted_items"],
    )

    date_time = schema.TextLine(title=_(u"Dates and times"), required=True)

    location = RichText(title=_(u"Location"), required=True)

    nature_and_risk_involved = RichText(
        title=_(u"Nature and risk involved"),
        required=True,
        defaultFactory=default_translator(
            _(u"<p>Nature :</p><p>&nbsp;</p>" u"<p>Risks :</p>")
        ),
        default_mime_type="text/html",
    )

    form.widget(impacted_items=MultiSelect2FieldWidget)
    impacted_items = schema.List(
        title=_(u"Impacted items"),
        value_type=schema.Choice(
            title=_(u"Impacted items"),
            source="rescuearea.core.vocabularies.impacted_items",
        ),
        required=True,
    )

    fieldset(
        "Impact on emergency stations",
        label=_(u"Impact on emergency stations"),
        fields=[
            "modified_itinerary",
            "access_to_the_site_for_firefighters",
            "access_for_ambulances",
        ],
    )

    modified_itinerary = RichText(title=_(u"Modified itinerary"), required=False)

    access_to_the_site_for_firefighters = RichText(
        title=_(u"Access to the site for firefighters"), required=False
    )

    access_for_ambulances = RichText(
        title=_(u"Access for ambulances"),
        defaultFactory=default_translator(_(u"<p>PMA IN, PMA out</p>")),
        default_mime_type="text/html",
        required=False,
    )

    fieldset(
        "Preventive devices",
        label=_(u"Preventive devices"),
        fields=["multidiciplinary", "discipline1", "discipline2"],
    )

    multidiciplinary = RichText(
        title=_(u"Multidiciplinary"),
        defaultFactory=default_translator(
            _(
                u'<table border="1">'
                u"<tbody>"
                u"<tr>"
                u"<td>CCE</td>"
                u"<td>Préciser les personnes (disciplines) présentes, le lieu, la plage horaire, et le rôle. Si pas, indiquer « néant ».</td>"
                u"</tr>"
                u"<tr>"
                u"<td>C100</td>"
                u"<td>&nbsp;</td>"
                u"</tr>"
                u"<tr>"
                u"<td>&nbsp;</td>"
                u"<td>&nbsp;</td>"
                u"</tr>"
                u"</tbody>"
                u"</table>"
            )
        ),
        default_mime_type="text/html",
        required=False,
    )

    discipline1 = RichText(
        title=_(u"Discipline 1"),
        defaultFactory=default_translator(
            _(
                u'<table border="1">'
                u"<tbody>"
                u"<tr>"
                u'<td width="30%">Moyens ZHC sur place</td>'
                u"<td>- Moyens Humains :<br />- Matériel :<br />- Horaire :<br />- Localisation :<br />- Mission des intervenants :</td>"
                u"</tr>"
                u"<tr>"
                u"<td>Moyens organisateur sur place (pour info)</td>"
                u"<td>&nbsp;</td>"
                u"</tr>"
                u"<tr>"
                u"<td>Moyens ZHC extra au poste de secours</td>"
                u"<td>préciser l'horaire s'il y en a!</td>"
                u"</tr>"
                u"</tbody>"
                u"</table>"
            )
        ),
        default_mime_type="text/html",
        required=False,
    )

    discipline2 = RichText(
        title=_(u"Discipline 2"),
        defaultFactory=default_translator(
            _(
                u'<table border="1">'
                u"<tbody>"
                u"<tr>"
                u'<td width="30%">Localisation PS, PMA ...</td>'
                u"<td>&nbsp;</td>"
                u"</tr>"
                u"<tr>"
                u"<td>Moyens organisateur sur place (pour info)</td>"
                u"<td>&nbsp;</td>"
                u"</tr>"
                u"<tr>"
                u"<td>Moyens ZHC extra au poste de secours</td>"
                u"<td>&nbsp;</td>"
                u"</tr>"
                u"</tbody>"
                u"</table>"
            )
        ),
        default_mime_type="text/html",
        required=False,
    )

    fieldset(
        "Alert chain and communications",
        label=_(u"Alert chain and communications"),
        fields=[
            "on_site_intervention_request_management",
            "communication_radio",
            "directory_and_telephone_directory",
        ],
    )

    on_site_intervention_request_management = RichText(
        title=_(u"On-site intervention request management"), required=False
    )

    communication_radio = RichText(
        title=_(u"Communication radio"),
        defaultFactory=default_translator(
            _(
                u"<p>Communication multidisciplinaire M HAI P0?</p>"
                u"<ul>"
                u"<li>groupe écouté par</li>"
                u"<li>préciser l'horaire</li>"
                u"</ul>"
            )
        ),
        default_mime_type="text/html",
        required=True,
    )

    directory_and_telephone_directory = RichText(
        title=_(u"Directory and telephone directory"), required=False
    )

    fieldset(
        "Rising power",
        label=_(u"Rising power"),
        fields=[
            "access_to_the_site",
            "means",
            "location_ppd",
            "location_pc_ops",
            "location_municipal_crisis_centre",
        ],
    )

    access_to_the_site = RichText(title=_(u"Access to the site"), required=False)

    means = RichText(title=_(u"Means"), required=False)

    location_ppd = RichText(title=_(u"Location P.P.D."), required=False)

    location_pc_ops = RichText(title=_(u"Location P.C. OPS"), required=False)

    location_municipal_crisis_centre = RichText(
        title=_(u"Location municipal crisis centre"), required=True
    )

    fieldset(
        "Miscellaneous remarks",
        label=_(u"Miscellaneous remarks"),
        fields=[
            "preliminary_actions_to_be_undertaken",
            "contact_person_for_information_on_this_document",
        ],
    )

    preliminary_actions_to_be_undertaken = RichText(
        title=_(u"Preliminary actions to be undertaken"), required=False
    )

    contact_person_for_information_on_this_document = RichText(
        title=_(u"Contact person for information on this document"), required=False
    )

    fieldset("Appendices", label=_(u"Appendices"), fields=["appendices"])

    appendices = schema.List(
        title=_(u"Appendices"),
        required=False,
        value_type=RichText(title=_(u"Appendix")),
    )
Пример #23
0
class IAnomaliesReportingSettingsSchema(Interface):

    form.widget("anomalies_reporting", klass="pat-tinymce")
    anomalies_reporting = schema.Text(title=_(u"Anomalies reporting settings"))
Пример #24
0
 def validate_start_end(data):
     if data.effective is not None and data.expires is not None:
         if data.effective > data.expires:
             raise Invalid(
                 _(u"The start date must be before the end date."))
Пример #25
0
class ILinkFileRowSchema(model.Schema):

    # form.widget(file=FileObjectFieldWidget)
    file = FileObject(title=_(u"File"), required=False)

    link = schema.URI(title=_(u"Link"), required=False)