示例#1
0
class IOGMail(model.Schema):
    """Opengever specific behavior,
    which add a title Field to the form.
    """

    model.fieldset(u'common',
                   label=base_mf(u'fieldset_common', u'Common'),
                   fields=[u'title', 'original_message', 'message_source'])

    form.order_before(title='message')
    dexteritytextindexer.searchable('title')
    title = schema.TextLine(
        title=dossier_mf(u'label_title', default=u'Title'),
        required=False,
    )

    form.mode(original_message=DISPLAY_MODE)
    form.read_permission(original_message='cmf.ManagePortal')
    form.write_permission(original_message='cmf.ManagePortal')
    original_message = field.NamedBlobFile(
        title=_(u'label_original_message',
                default=u'Raw *.msg message before conversion'),
        required=False,
    )

    form.mode(message_source=DISPLAY_MODE)
    form.read_permission(message_source='cmf.ManagePortal')
    form.write_permission(message_source='cmf.ManagePortal')
    message_source = schema.Choice(
        title=_('label_message_source', default='Message source'),
        vocabulary=get_message_source_vocabulary(),
        required=False,
    )
示例#2
0
class IDCAT(model.Schema):
    """Marker interface for all DCAT-AP.de Content Types"""

    read_permission(dct_identifier='pkan.dcatapde.ProviderDataEditor')
    write_permission(dct_identifier='pkan.dcatapde.ProviderDataEditor')
    dct_identifier = schema.URI(
        required=False,
        title=i18n.LABEL_DCT_IDENTIFIER,
        description=i18n.IDENTIFIER_DESCRIPTION,
    )

    read_permission(adms_identifier='pkan.dcatapde.ProviderDataEditor')
    write_permission(adms_identifier='pkan.dcatapde.ProviderDataEditor')
    adms_identifier = schema.URI(
        required=False,
        title=i18n.LABEL_ADMS_IDENTIFIER,
        description=i18n.IDENTIFIER_DESCRIPTION,
    )

    #    read_permission(uri_in_triplestore='pkan.dcatapde.Admin')
    #    write_permission(uri_in_triplestore='pkan.dcatapde.Admin')
    #    uri_in_triplestore = schema.URI(
    #        required=False,
    #        title=_(u'Uri in Triplestore'),
    #    )

    model.fieldset(
        'object_identifier',
        label=i18n.FIELDSET_INTERNAL_INFO,
        fields=[
            'dct_identifier',
            'adms_identifier',
        ],
    )
示例#3
0
class IRICPerson(model.Schema):

    functions = schema.List(
        title=_(u"Fonctions"),
        description=_(u"Vous pouvez sélectionner plusieurs fonctions en appuyant sur la touche CTRL"),
        required=True,
        value_type=schema.Choice(source=FunctionsList),
    )
    form.widget('functions', SelectFieldWidget, multiple='multiple', size=3)

    invalidmail = schema.Bool(title=_(u"E-mail invalide"),
                              required=True)

    form.read_permission(invalidmail='RIC.ActualPersonOwner')
    form.write_permission(invalidmail='RIC.Administrator')
    form.widget('invalidmail', RadioFieldWidget)

    multimail = schema.List(title=_(u"Envoi mail"),
                            required=False,
                            value_type=schema.Choice(source=MultimailTypes()),
                            )
    form.widget('multimail', SelectFieldWidget, multiple='multiple', size=2)

    userid = schema.TextLine(title=_(u"Identifiant de l'utilisateur"),
                             required=False)

    form.read_permission(userid='RIC.Administrator')
    form.write_permission(userid='RIC.Administrator')
示例#4
0
class ITransportationexpenses(model.Schema):
    """
    """

    amount_transportation = schema.Float(
        title=_(u'label_applications_amount_transportation', u'Amount for Transportation Expenses'),
        required=True,
        min=0.0,
    )

    directives.widget(transportation_type=CheckBoxFieldWidget)
    transportation_type = schema.Set(
        title=_(u'label_applications_transportation_type', default=u'Type Transportation'),
        value_type=schema.Choice(
            vocabulary='im.applications.TransportationType',
        ),
        required=False,
    )

    directives.read_permission(amount_transportation_recommended='im.applications.ViewComision')
    directives.write_permission(amount_transportation_recommended='im.applications.EditComision')
    amount_transportation_recommended = schema.Float(
        title=_(u'label_applications_amount_transportation_recommended', u'Approved Amount by Special Comision for Transportation Expenses'),
        required=True,
        min=0.0,
    )

    directives.read_permission(amount_transportation_authorized='im.applications.ViewCantidadAutorizada')
    directives.write_permission(amount_transportation_authorized='im.applications.EditConsejo')
    amount_transportation_authorized = schema.Float(
        title=_(u'label_applications_amount_transportation_authorized', u'Approved Amount by Consejo Interno for Transportation Expenses'),
        required=True,
        min=0.0,
    )

    directives.read_permission(amount_transportation_used='im.applications.ViewCantidadUtilizada')
    directives.write_permission(amount_transportation_used='im.applications.EditCantidadUtilizada')
    amount_transportation_used = schema.Float(
        title=_(u'label_applications_amount_transportation_used', u'Used Amount for Transportation Expenses'),
        required=True,
        min=0.0,
    )

    @invariant
    def validateFields(data):
        if data.amount_transportation > 0 and data.transportation_type == set([]):
            message = 'Invalid Transportation Type: You must select at least one transportation, please correct it.'
            raise Invalid(_('label_im_applications_error_transportation', default=message))
        elif data.amount_transportation == 0:
            if data.transportation_type.__contains__('groudtransportation') or data.transportation_type.__contains__('airtransport'):
                message = 'Invalid Transportation Type: You amount transportation is zero the transportation type must be empty, please correct it.'
                raise Invalid(_('label_im_applications_error_transportation2', default=message))
示例#5
0
class IDocument(form.Schema, IImageScaleTraversable):
    """
    Document
    """

    dexteritytextindexer.searchable('title')
    title = schema.TextLine(
        title=_(u"Title"),
        required=False,
    )

    dexteritytextindexer.searchable('multifile')
    write_permission(multifile='cmf.ReviewPortalContent')
    read_permission(multifile='cmf.ReviewPortalContent')
    # multifile = NamedBlobFile(
    #     title=_(u"Document"),
    #     description=_(u"Please attach a file"),
    #     required=False,
    #     )

    form.widget(multifile=MultiFileFieldWidget)
    multifile = schema.List(
        title=_(u"Document"),
        required=False,
        value_type=NamedFile(),
    )
    pass
示例#6
0
class ISponsor(model.Schema):
    """Dexterity-Schema for Sponsors
    """

    directives.widget(level=RadioFieldWidget)
    level = schema.Choice(title=_(u"Sponsoring Level"),
                          vocabulary=LevelVocabulary,
                          required=True)

    text = RichText(title=_(u"Text"), required=False)

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

    fieldset('Images', fields=['logo', 'advertisment'])
    logo = namedfile.NamedBlobImage(
        title=_(u"Logo"),
        required=False,
    )

    advertisment = namedfile.NamedBlobImage(
        title=_(u"Advertisment (Gold-sponsors and above)"),
        required=False,
    )

    directives.read_permission(notes="cmf.ManagePortal")
    directives.write_permission(notes="cmf.ManagePortal")
    notes = RichText(title=_(u"Secret Notes (only for site-admins)"),
                     required=False)
示例#7
0
class IRICOrganization(model.Schema):

    citizen = schema.Int(
        title=_(u"Nombre d'habitants"),
        required=True,
        min=1
    )

    #servers = schema.TextLine(
    #    title=_(u"Serveurs"),
    #    required=True
    #)

    #softwares = schema.TextLine(
    #    title=_(u"Logiciels"),
    #    required=True
    #)

    subscriptions = schema.List(
        title=_(u"Cotisations"),
        value_type=DictRow(title=_(u"Cotisation"),
                           schema=ICotisationRow),
        required=False,
    )
    form.read_permission(subscriptions='RIC.ActualOrganizationMember')
    form.write_permission(subscriptions='RIC.Administrator')
    form.widget('subscriptions', DataGridField)
示例#8
0
class IRichPreviewSettings(Interface):
    """Schema for the control panel form."""

    enable = schema.Bool(
        title=_(u'Enable Rich Link Previews?'),
        description=
        _(u'Rich Link Previews are only available for Dexterity-based content types.'
          ),
        default=True,
    )

    form.widget('public_key', rows=5)
    public_key = schema.Text(
        title=_(u'Public Key'),
        description=_(u'Used to encrypt the URL.'),
        constraint=validate_public_key,
    )

    form.widget('private_key', rows=15)
    private_key = schema.Text(
        title=_(u'Private Key'),
        description=_(
            u'Used to decrypt the URL. Never share this key with anyone.'),
        constraint=validate_private_key,
    )

    # keys are available to Administrators only
    form.read_permission(public_key='cmf.ManagePortal',
                         private_key='cmf.ManagePortal')
    form.write_permission(public_key='cmf.ManagePortal',
                          private_key='cmf.ManagePortal')

    @invariant
    def _validate_key_pair(data):
        validate_key_pair(data)
示例#9
0
class IElasticSearchBlocks(model.Schema):
    """
    """

    directives.read_permission(blocks_plaintext='cmf.ManagePortal')
    directives.write_permission(blocks_plaintext='cmf.ManagePortal')
    blocks_plaintext = schema.TextLine(
        title=_(u'Blocks content in plain text'), required=False, default="")
示例#10
0
class IRegistrationfees(model.Schema):
    """
    """

    amount_registration = schema.Float(
        title=_(u'label_applications_amount_registration',
                u'Amount for Registration Fees'),
        required=True,
        min=0.0,
    )

    directives.read_permission(
        amount_registration_recommended='im.applications.ViewComision')
    directives.write_permission(
        amount_registration_recommended='im.applications.EditComision')
    amount_registration_recommended = schema.Float(
        title=_(u'label_applications_amount_registration_recommended',
                u'Approved Amount by Special Comision for Registration Fees'),
        required=True,
        min=0.0,
    )

    directives.read_permission(
        amount_registration_authorized='im.applications.ViewCantidadAutorizada'
    )
    directives.write_permission(
        amount_registration_authorized='im.applications.EditConsejo')
    amount_registration_authorized = schema.Float(
        title=_(u'label_applications_amount_registration_authorized',
                u'Approved Amount by Consejo Interno for Registration Fees'),
        required=True,
        min=0.0,
    )

    directives.read_permission(
        amount_registration_used='im.applications.ViewCantidadUtilizada')
    directives.write_permission(
        amount_registration_used='im.applications.EditCantidadUtilizada')
    amount_registration_used = schema.Float(
        title=_(u'label_applications_amount_registration_used',
                u'Used Amount for Registration Fees'),
        required=True,
        min=0.0,
    )
示例#11
0
class IHotfix(model.Schema):
    """ Marker interface for Hotfixes """

    description = schema.Text(
        title=_(u"Summary"),
        description=
        _(u"A summary of the hotfix contents, used in item listings and search results."
          ),
        default=u"")

    release_date = schema.Date(
        title=_(u"Release date"),
        description=_(u"Date the hotfix will be released"))

    read_permission(hotfix='plone.app.vulnerabilities.hotfix.view_release')
    hotfix = ChecksummedFile(
        title=_(u"Hotfix"),
        description=_(u"Old-style product tarball for this hotfix"),
        required=False)

    read_permission(text='plone.app.vulnerabilities.hotfix.view_release')
    text = RichText(
        title=_(u"Release body"),
        description=_(u"This will be shown after the hotfix is released"),
        default=u"",
        allowed_mime_types=("text/html", ),
        required=False)

    form.fieldset('preannounce',
                  label=_(u"Preannounce"),
                  fields=['preannounce_text'])

    read_permission(
        preannounce_text='plone.app.vulnerabilities.hotfix.view_preannounce')
    preannounce_text = RichText(
        title=_(u"Preannounce body"),
        description=_(
            u"This will be shown while the hotfix is in the preannounce state"
        ),
        default=u"",
        allowed_mime_types=("text/html", ),
        required=False)
示例#12
0
class IMappaSimulazione(model.Schema):
    """ Marker interface and Dexterity Python Schema for MappaSimulazione
    """
    # If you want, you can load a xml model created TTW here
    # and customize it in Python:

    # model.load('mappa_simulazione.xml')

    # directives.widget(level=RadioFieldWidget)
    # level = schema.Choice(
    #     title=_(u'Sponsoring Level'),
    #     vocabulary=LevelVocabulary,
    #     required=True
    # )

    # text = RichText(
    #     title=_(u'Text'),
    #     required=False
    # )

    # url = schema.URI(
    #     title=_(u'Link'),
    #     required=False
    # )

    # fieldset('Images', fields=['logo', 'advertisement'])
    # logo = namedfile.NamedBlobImage(
    #     title=_(u'Logo'),
    #     required=False,
    # )

    start = schema.Date(
        title=u'First day of the conference',
        required=False,
        default=date(2019, 10, 21),
    )

    end = schema.Date(
        title=u'First day of the conference',
        required=False,
        default=date(2019, 10, 21),
    )

    file_simulazione = namedfile.NamedBlobFile(
        title=_(u'File di simulazione (file SWMM5)'),
        required=True,
    )

    directives.read_permission(notes='cmf.ManagePortal')
    directives.write_permission(notes='cmf.ManagePortal')
    notes = RichText(
        title=_(u'Secret Notes (only for site-admins)'),
        required=False
    )
示例#13
0
class IDmsPerson(IPerson):

    userid = schema.Choice(
        title=_(u'Plone user'),
        required=False,
        vocabulary=u'plone.app.vocabularies.Users',
    )

    #directives.widget('userid', AjaxChosenFieldWidget, populate_select=True)
    directives.read_permission(userid='imio.dms.mail.write_userid_field')
    directives.write_permission(userid='imio.dms.mail.write_userid_field')
示例#14
0
class IPrivateContactInformations(model.Schema):

    model.fieldset(
        "private_contact_informations",
        label=_("Private contact informations"),
        fields=[
            "private_phones", "private_mails", "private_urls", "private_note"
        ],
    )
    private_phones = schema.List(
        title=_("Phones"),
        value_type=DictRow(
            title="Value",
            schema=IPhoneRowSchema,
        ),
        required=False,
    )
    widget("private_phones", DataGridFieldFactory, allow_reorder=True)

    private_mails = schema.List(
        title=_("E-mails"),
        value_type=DictRow(
            title="Value",
            schema=IMailRowSchema,
        ),
        required=False,
    )
    widget("private_mails", DataGridFieldFactory, allow_reorder=True)

    private_urls = schema.List(
        title=_("URLs"),
        value_type=DictRow(
            title="Value",
            schema=IUrlRowSchema,
        ),
        required=False,
    )
    widget("private_urls", DataGridFieldFactory, allow_reorder=True)

    private_note = schema.Text(title=_("Internal note"), required=False)

    read_permission(
        private_phones="imio.directory.core.ViewContactPrivateInformations",
        private_mails="imio.directory.core.ViewContactPrivateInformations",
        private_urls="imio.directory.core.ViewContactPrivateInformations",
        private_note="imio.directory.core.ViewContactPrivateInformations",
    )
    write_permission(
        private_phones="imio.directory.core.ModifyContactPrivateInformations",
        private_mails="imio.directory.core.ModifyContactPrivateInformations",
        private_urls="imio.directory.core.ModifyContactPrivateInformations",
        private_note="imio.directory.core.ModifyContactPrivateInformations",
    )
示例#15
0
        class IDummy(model.Schema):

            form.omitted('foo')
            form.omitted('bar')
            form.widget(foo='some.dummy.Widget')
            form.widget(baz='other.Widget')
            form.mode(bar='hidden')
            form.mode(foo='display')
            form.order_before(baz='title')
            form.order_after(baz='qux')
            form.order_after(qux='bar')
            form.order_before(foo='body')
            form.read_permission(foo='zope2.View', bar='zope2.View')
            form.read_permission(baz='random.Permission')
            form.write_permission(foo='cmf.ModifyPortalContent')
            form.write_permission(baz='another.Permission')

            foo = zope.schema.TextLine(title=u'Foo')
            bar = zope.schema.TextLine(title=u'Bar')
            baz = zope.schema.TextLine(title=u'Baz')
            qux = zope.schema.TextLine(title=u'Qux')
class ICustomScript(IAction):
    """Executes a Python script for form data"""
    directives.read_permission(ProxyRole=MODIFY_PORTAL_CONTENT)
    directives.write_permission(ProxyRole=config.EDIT_PYTHON_PERMISSION)
    ProxyRole = zope.schema.Choice(
        title=_(u'label_script_proxy', default=u'Proxy role'),
        description=_(u'help_script_proxy',
                      default=u'Role under which to run the script.'),
        default=u'none',
        required=True,
        vocabulary='easyform.ProxyRoleChoices',
    )
    directives.read_permission(ScriptBody=MODIFY_PORTAL_CONTENT)
    directives.write_permission(ScriptBody=config.EDIT_PYTHON_PERMISSION)
    ScriptBody = zope.schema.Text(
        title=_(u'label_script_body', default=u'Script body'),
        description=_(u'help_script_body', default=u'Write your script here.'),
        default=config.DEFAULT_SCRIPT,
        required=False,
        missing_value=u'',
    )
示例#17
0
class ITestType1(Schema):
    test_text = schema.TextLine(title=u"Test text field", )

    test_int = schema.Int(title=u"Integer test field", )

    test_bool = schema.Bool(title=u"Boolean test field", )

    directives.widget(funky=FunkyFieldWidget, )
    funky = schema.TextLine(title=u"Test funky field", )

    directives.read_permission(topsecret='cmf.ModifyPortalContent')
    directives.write_permission(topsecret='cmf.ManagePortal')
    topsecret = schema.TextLine(title=u"Top secret field", )
示例#18
0
class IMusicPlayer(ISubscriber):
    phone = schema.TextLine(
        title=_(u'plone number'),
        description=_(u'phone_description'),
        required=False,
    )
    mobile = schema.TextLine(
        title=_(u'mobile number'),
        description=_(u'mobile_description'),
        required=False,
    )
    directives.read_permission(instrument='cmf.ModifyPortalContent')
    directives.write_permission(instrument='cmf.ModifyPortalContent')
    instrument = schema.Choice(
        title=_(u'instrument played'),
        description=_(u'you can choose "Other"'),
        source='player.instruments',
        default=u'',
        required=False,
    )
    directives.read_permission(music='cmf.ModifyPortalContent')
    directives.write_permission(music='cmf.ModifyPortalContent')
    music = schema.Choice(
        title=_(u'music played'),
        description=_(u'you can choose "Other"'),
        source='player.musics',
        default=u'',
        required=False,
    )
    """
    a ajouter:
    adresse
    site web perso
    Choix d'afficher les info perso aux autres musiciens ?
    liens social : facebook, twiter, google+, etc...
    """
    """
示例#19
0
class ICOPItem(form.Schema, IImageScaleTraversable):
    """
    COP Item
    """
    form.widget(blog_body=WysiwygFieldWidget)
    blog_body = schema.Text(title=u"Body")

    write_permission(multifile='cmf.ReviewPortalContent')
    read_permission(multifile='cmf.ReviewPortalContent')
    form.widget(multifile=MultiFileFieldWidget)
    multifile = schema.List(
        title=_(u"File Attachment"),
        required=False,
        value_type=NamedFile(),
    )

    pass
示例#20
0
        class IDummy(model.Schema):

            form.omitted('foo', 'bar')
            form.omitted(model.Schema, 'qux')
            form.no_omit(model.Schema, 'bar')
            form.widget(foo='some.dummy.Widget', baz='other.Widget')
            form.mode(bar='hidden')
            form.mode(model.Schema, bar='input')
            form.order_before(baz='title')
            form.order_after(qux='title')
            form.read_permission(foo='zope2.View')
            form.write_permission(foo='cmf.ModifyPortalContent')

            foo = zope.schema.TextLine(title=u'Foo')
            bar = zope.schema.TextLine(title=u'Bar')
            baz = zope.schema.TextLine(title=u'Baz')
            qux = zope.schema.TextLine(title=u'Qux')
class IActionExtender(Schema):
    fieldset(u'overrides', label=_('Overrides'), fields=['execCondition'])
    read_permission(execCondition=MODIFY_PORTAL_CONTENT)
    write_permission(execCondition=EDIT_TALES_PERMISSION)
    execCondition = TextLine(
        title=_(u'label_execcondition_text', default=u'Execution Condition'),
        description=(_(u'help_execcondition_text', default=u''
                       u'A TALES expression that will be evaluated to determine whether '
                       u'or not to execute this action. Leave empty if unneeded, and '
                       u'the action will be executed. Your expression should evaluate '
                       u'as a boolean; return True if you wish the action to execute. '
                       u'PLEASE NOTE: errors in the evaluation of this expression will '
                       u'cause an error on form display.')
                     ),
        default=u'',
        constraint=isTALES,
        required=False,
    )
示例#22
0
class IActionExtender(Schema):
    fieldset(u'overrides', label=_('Overrides'), fields=['execCondition'])
    directives.read_permission(execCondition=MODIFY_PORTAL_CONTENT)
    directives.write_permission(execCondition=config.EDIT_TALES_PERMISSION)
    execCondition = zope.schema.TextLine(
        title=_(u'label_execcondition_text', default=u'Execution Condition'),
        description=_(
            u'help_execcondition_text',
            default=u'A TALES expression that will be evaluated to determine '
            u'whether or not to execute this action. Leave empty if '
            u'unneeded, and the action will be executed. Your '
            u'expression should evaluate as a boolean; return True '
            u'if you wish the action to execute. PLEASE NOTE: errors '
            u'in the evaluation of this expression will  cause an '
            u'error on form display.'),
        default=u'',
        constraint=isTALES,
        required=False,
    )
示例#23
0
class IContact(IPrivateContactInformations, IContactInformations, IAddress):
    """ """

    directives.order_before(type="IBasic.title")
    directives.widget(type=RadioFieldWidget)
    type = schema.Choice(
        title=_("Type"),
        source="imio.directory.vocabulary.ContactTypes",
        required=True,
    )

    directives.order_after(subtitle="IBasic.title")
    subtitle = schema.TextLine(title=_("Subtitle"), required=False)

    logo = NamedBlobImage(title=_("Logo"), description=_(""), required=False)

    model.fieldset("categorization",
                   fields=["selected_entities", "facilities"])
    directives.widget(selected_entities=SelectFieldWidget)
    selected_entities = schema.List(
        title=_("Selected entities"),
        description=
        _("Select entities where this contact will be displayed. Current entity will always be selected."
          ),
        value_type=schema.Choice(
            vocabulary="imio.directory.vocabulary.EntitiesUIDs"),
        default=[],
        required=False,
    )

    facilities = schema.List(
        title=_("Facilities"),
        description=
        _("Important! These categories make it possible to highlight and geolocate certain basic services"
          ),
        value_type=schema.Choice(
            vocabulary="imio.directory.vocabulary.Facilities"),
        required=False,
    )
    directives.widget(facilities=SelectFieldWidget)

    read_permission(selected_entities="imio.directory.core.AddEntity")
    write_permission(selected_entities="imio.directory.core.AddEntity")
示例#24
0
class IActionExtender(Schema):
    fieldset(u"overrides", label=_("Overrides"), fields=["execCondition"])
    directives.read_permission(execCondition=MODIFY_PORTAL_CONTENT)
    directives.write_permission(execCondition=config.EDIT_TALES_PERMISSION)
    execCondition = zope.schema.TextLine(
        title=_(u"label_execcondition_text", default=u"Execution Condition"),
        description=_(
            u"help_execcondition_text",
            default=u"A TALES expression that will be evaluated to determine "
            u"whether or not to execute this action. Leave empty if "
            u"unneeded, and the action will be executed. Your "
            u"expression should evaluate as a boolean; return True "
            u"if you wish the action to execute. PLEASE NOTE: errors "
            u"in the evaluation of this expression will  cause an "
            u"error on form display.",
        ),
        default=u"",
        constraint=isTALES,
        required=False,
    )
示例#25
0
class IPMPerson(IPerson):
    """ """

    form.order_before(firstname_abbreviated='gender')
    firstname_abbreviated = schema.TextLine(
        title=_("Firstname abbreviated"),
        required=False,
    )

    form.read_permission(userid='PloneMeeting.write_userid_field')
    form.write_permission(userid='PloneMeeting.write_userid_field')
    userid = schema.Choice(
        title=_(u'Plone user'),
        description=_(u'If you need to use this person data in the '
                      u'application like for example scanned signature or '
                      u'telephone number, select it here.'),
        required=False,
        vocabulary=u'Products.PloneMeeting.Users',
    )

    model.fieldset('app_parameters',
                   label=_(u"Application parameters"),
                   fields=['userid'])
示例#26
0
class IIssue(model.Schema):
    """Marker interface for Poi issue"""

    dexteritytextindexer.searchable('title')
    title = schema.TextLine(
        title=_(u'Poi_label_issue_title', default=u"Title"),
        description=_(u'Poi_help_issue_title',
                      default=u"Enter a short, descriptive title for "
                      u"the issue. A good title will make it easier "
                      u"for project managers to identify and respond "
                      u"to the issue."))

    release = schema.Choice(
        title=_(u'Poi_label_issue_release', default=u'Release'),
        description=_(u'Poi_help_issue_release',
                      default=u"Select the version the issue was found in."),
        required=False,
        source=possibleTargetReleases)

    dexteritytextindexer.searchable('details')
    details = RichText(title=_(u'Poi_label_issue_details', default=u'Details'),
                       description=_(
                           u'Poi_help_issue_details',
                           default=u"Please provide further details."))

    dexteritytextindexer.searchable('steps')
    steps = RichText(
        title=_(u'Poi_label_issue_steps', default=u'Steps To Reproduce'),
        description=_(u'Poi_help_issue_steps',
                      default=u"If applicable, please provide the steps to "
                      u"reproduce the error or identify the issue, one per "
                      u"line."),
        required=False,
    )

    area = schema.Choice(
        title=_(u'Poi_label_issue_area', default=u'Area'),
        description=_(u'Poi_help_issue_area',
                      default=u"Select the area this issue is relevant to."),
        source=possibleAreas)

    issue_type = schema.Choice(title=_(u'Poi_label_issue_type',
                                       default=u'Issue Type'),
                               description=_(
                                   u'Poi_help_issue_type',
                                   default=u"Select the type of issue."),
                               source=possibleIssueTypes)

    read_permission(severity='Poi.ModifyIssueSeverity')
    write_permission(severity='Poi.ModifyIssueSeverity')
    severity = schema.Choice(
        title=_(u'Poi_label_issue_severity', default=u'Severity'),
        description=_(u'Poi_help_issue_severity',
                      default=u"Select the severity of this issue."),
        defaultFactory=default_severity,
        source=possibleSeverities)

    read_permission(target_release='Poi.ModifyIssueTargetRelease')
    write_permission(target_release='Poi.ModifyIssueTargetRelease')
    target_release = schema.Choice(
        title=_(u'Poi_label_issue_target_release', default=u'Target Release'),
        description=_(u'Poi_help_issue_target_release',
                      default=u"Release this issue is targetted to be fixed "
                      u"in."),
        source=possibleTargetReleases,
        required=False,
    )

    read_permission(assignee='Poi.ModifyIssueAssignment')
    write_permission(assignee='Poi.ModifyIssueAssignment')
    assignee = schema.Choice(
        title=_(u'Poi_label_issue_assignee', default=u'Assignee'),
        description=_(u'Poi_help_issue_assignee',
                      default=u"Select which person, if any, is assigned to "
                      u"this issue."),
        source=possibleAssignees,
        required=False,
    )

    contact_email = email.Email(
        title=_(u'Poi_label_issue_contact_email', default=u'Contact Email'),
        description=_(u'Poi_help_issue_contact_email',
                      default=u"Please provide an email address where you can "
                      u"be contacted for further information or when a "
                      u"resolution is available. Note that your email "
                      u"address will not be displayed to others."),
        required=False,
    )

    read_permission(watchers='Poi.ModifyIssueWatchers')
    write_permission(watchers='Poi.ModifyIssueWatchers')
    widget('watchers',
           AjaxSelectFieldWidget,
           vocabulary='plone.app.vocabularies.Users')
    watchers = schema.List(
        title=_(u'Poi_label_issue_watchers', default=u'Watchers'),
        description=_(u'Poi_help_issue_watchers',
                      default=u"Enter the user ids of members who are watching"
                      u" this issue, one per line. E-mail addresses are "
                      u"allowed too. These persons will "
                      u"receive an email when a response is added to the "
                      u"issue. Members can also add themselves as "
                      u"watchers."),
        value_type=schema.TextLine(),
        required=False,
        defaultFactory=default_watchers,
    )

    write_permission(subject='Poi.ModifyIssueTags')
    read_permission(subject='Poi.ModifyIssueTags')
    widget('subject',
           AjaxSelectFieldWidget,
           vocabulary='plone.app.vocabularies.Keywords',
           pattern_options={'allowNewItems': 'true'})
    subject = schema.Tuple(
        title=_(u'Poi_label_issue_subject', default=u'Subject'),
        description=_(u'Poi_help_issue_subject',
                      default=u"Tags can be used to add arbitrary "
                      u"categorisation to issues. The list below shows "
                      u"existing tags which you can select, or you can add "
                      u"new ones."),
        value_type=schema.TextLine(),
        required=False,
        missing_value=[],
    )

    read_permission(related_issue='Poi.ModifyRelatedIssues')
    write_permission(related_issue='Poi.ModifyRelatedIssues')
    widget(
        'related_issue',
        RelatedItemsFieldWidget,
        pattern_options={
            'resultTemplate':
            '' +
            '<div class="pattern-relateditems-result<% if (oneLevelUp) { %> one-level-up<% } %>">'
            +
            '  <a class="pattern-relateditems-result-select<% if (selectable) { %> selectable<% } else if (browsing && is_folderish) { %> pattern-relateditems-result-browse<% } %><% if (oneLevelUp) { %> one-level-up<% } %>" data-path="<%- path %>">'
            +
            '    <% if (getURL && (getIcon || portal_type === "Image")) { %><img src="<%- getURL %>/@@images/image/icon "><br><% } %>'
            +
            '    <span class="pattern-relateditems-result-title" title="<%- portal_type %>"><%- Title %></span>'
            +
            '    <span class="pattern-relateditems-result-path"><%- path %></span>'
            + '  </a>' + '</div>'
        })
    related_issue = RelationList(title=_(u'Poi_label_issue_related',
                                         default=u'Related Issue(s)'),
                                 description=_(
                                     u'Poi_help_issue_related',
                                     default=u'Link related issues.'),
                                 value_type=RelationChoice(
                                     title=u"Related",
                                     source=tracker_issues,
                                 ),
                                 required=False)

    empty = schema.Bool(title=_(u'Poi_label_issue_empty',
                                default=u'Leave this field empty'),
                        required=False,
                        constraint=checkEmpty)
示例#27
0
class IMailer(IAction):
    """A form action adapter that will e-mail form input."""

    directives.write_permission(
        recipient_name=config.EDIT_ADDRESSING_PERMISSION)
    directives.read_permission(recipient_name=MODIFY_PORTAL_CONTENT)
    recipient_name = zope.schema.TextLine(
        title=_(u'label_formmailer_recipient_fullname',
                default=u"Recipient's full name"),
        description=_(
            u'help_formmailer_recipient_fullname',
            default=u'The full name of the recipient of the mailed form.'),
        default=u'',
        missing_value=u'',
        required=False,
    )

    directives.write_permission(
        recipient_email=config.EDIT_ADDRESSING_PERMISSION)
    directives.read_permission(recipient_email=MODIFY_PORTAL_CONTENT)
    recipient_email = Email(
        title=_(u'label_formmailer_recipient_email',
                default=u"Recipient's e-mail address"),
        description=_(u'help_formmailer_recipient_email',
                      default=u'The recipients e-mail address.'),
        required=False,
    )
    fieldset(u'addressing',
             label=_('Addressing'),
             fields=[
                 'to_field', 'cc_recipients', 'bcc_recipients', 'replyto_field'
             ])
    directives.write_permission(to_field=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(to_field=MODIFY_PORTAL_CONTENT)
    to_field = zope.schema.Choice(
        title=_(u'label_formmailer_to_extract',
                default=u'Extract Recipient From'),
        description=_(
            u'help_formmailer_to_extract',
            default=u'Choose a form field from which you wish to extract '
            u'input for the To header. If you choose anything other '
            u'than "None", this will override the "Recipient\'s " '
            u'e-mail address setting above. Be very cautious about '
            u'allowing unguarded user input for this purpose.'),
        required=False,
        vocabulary='easyform.Fields',
    )

    directives.write_permission(
        cc_recipients=config.EDIT_ADDRESSING_PERMISSION)
    directives.read_permission(cc_recipients=MODIFY_PORTAL_CONTENT)
    cc_recipients = zope.schema.Text(
        title=_(u'label_formmailer_cc_recipients', default=u'CC Recipients'),
        description=_(
            u'help_formmailer_cc_recipients',
            default=u'E-mail addresses which receive a carbon copy.'),
        default=u'',
        missing_value=u'',
        required=False,
    )

    directives.write_permission(
        bcc_recipients=config.EDIT_ADDRESSING_PERMISSION)
    directives.read_permission(bcc_recipients=MODIFY_PORTAL_CONTENT)
    bcc_recipients = zope.schema.Text(
        title=_(u'label_formmailer_bcc_recipients', default=u'BCC Recipients'),
        description=_(
            u'help_formmailer_bcc_recipients',
            default=u'E-mail addresses which receive a blind carbon copy.'),
        default=u'',
        missing_value=u'',
        required=False,
    )

    directives.write_permission(replyto_field=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(replyto_field=MODIFY_PORTAL_CONTENT)
    replyto_field = zope.schema.Choice(
        title=_(u'label_formmailer_replyto_extract',
                default=u'Extract Reply-To From'),
        description=_(
            u'help_formmailer_replyto_extract',
            default=u'Choose a form field from which you wish to extract '
            u'input for the Reply-To header. NOTE: You should '
            u'activate e-mail address verification for the '
            u'designated field.'),
        required=False,
        vocabulary='easyform.Fields',
    )
    fieldset(u'message',
             label=PMF('Message'),
             fields=[
                 'msg_subject',
                 'subject_field',
                 'body_pre',
                 'body_post',
                 'body_footer',
                 'showAll',
                 'showFields',
                 'includeEmpties',
                 'sendCSV',
             ])
    directives.read_permission(msg_subject=MODIFY_PORTAL_CONTENT)
    msg_subject = zope.schema.TextLine(
        title=_(u'label_formmailer_subject', default=u'Subject'),
        description=_(u'help_formmailer_subject',
                      default=u''
                      u'Subject line of message. This is used if you '
                      u'do not specify a subject field or if the field '
                      u'is empty.'),
        default=u'Form Submission',
        missing_value=u'',
        required=False,
    )

    directives.write_permission(subject_field=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(subject_field=MODIFY_PORTAL_CONTENT)
    subject_field = zope.schema.Choice(
        title=_(u'label_formmailer_subject_extract',
                default=u'Extract Subject From'),
        description=_(u'help_formmailer_subject_extract',
                      default=u''
                      u'Choose a form field from which you wish to extract '
                      u'input for the mail subject line.'),
        required=False,
        vocabulary='easyform.Fields',
    )
    directives.read_permission(body_pre=MODIFY_PORTAL_CONTENT)
    directives.widget('body_pre', TextAreaWidget)

    body_pre = RichText(
        title=_(u'label_formmailer_body_pre', default=u'Body (prepended)'),
        description=_(u'help_formmailer_body_pre',
                      default=u'Text prepended to fields listed in mail-body'),
        default=u'',
        missing_value=u'',
        default_mime_type='text/x-web-intelligent',
        allowed_mime_types=('text/x-web-intelligent', ),
        output_mime_type='text/x-html-safe',
        required=False,
    )
    directives.read_permission(body_post=MODIFY_PORTAL_CONTENT)
    directives.widget('body_post', TextAreaWidget)
    body_post = RichText(
        title=_(u'label_formmailer_body_post', default=u'Body (appended)'),
        description=_(u'help_formmailer_body_post',
                      default=u'Text appended to fields listed in mail-body'),
        default=u'',
        missing_value=u'',
        default_mime_type='text/x-web-intelligent',
        allowed_mime_types=('text/x-web-intelligent', ),
        output_mime_type='text/x-html-safe',
        required=False,
    )
    directives.read_permission(body_footer=MODIFY_PORTAL_CONTENT)
    directives.widget('body_footer', TextAreaWidget)
    body_footer = RichText(
        title=_(u'label_formmailer_body_footer', default=u'Body (signature)'),
        description=_(u'help_formmailer_body_footer',
                      default=u'Text used as the footer at '
                      u'bottom, delimited from the body by a dashed line.'),
        default=u'',
        missing_value=u'',
        default_mime_type='text/x-web-intelligent',
        allowed_mime_types=('text/x-web-intelligent', ),
        output_mime_type='text/x-html-safe',
        required=False,
    )

    directives.read_permission(showAll=MODIFY_PORTAL_CONTENT)
    showAll = zope.schema.Bool(
        title=_(u'label_mailallfields_text', default=u'Include All Fields'),
        description=_(u'help_mailallfields_text',
                      default=u''
                      u'Check this to include input for all fields '
                      u'(except label and file fields). If you check '
                      u'this, the choices in the pick box below '
                      u'will be ignored.'),
        default=True,
        required=False,
    )

    directives.read_permission(showFields=MODIFY_PORTAL_CONTENT)
    showFields = zope.schema.List(
        title=_(u'label_mailfields_text', default=u'Show Responses'),
        description=_(
            u'help_mailfields_text',
            default=u'Pick the fields whose inputs you\'d like to include in '
            u'the e-mail.'),
        unique=True,
        required=False,
        value_type=zope.schema.Choice(vocabulary='easyform.Fields'),
    )

    directives.read_permission(includeEmpties=MODIFY_PORTAL_CONTENT)
    includeEmpties = zope.schema.Bool(
        title=_(u'label_mailEmpties_text', default=u'Include Empties'),
        description=_(u'help_mailEmpties_text',
                      default=u''
                      u'Check this to include titles '
                      u'for fields that received no input. Uncheck '
                      u'to leave fields with no input out of the e-mail.'),
        default=True,
        required=False,
    )

    directives.read_permission(sendCSV=MODIFY_PORTAL_CONTENT)
    sendCSV = zope.schema.Bool(
        title=_(u'label_sendCSV_text', default=u'Send CSV data attachment'),
        description=_(u'help_sendCSV_text',
                      default=u''
                      u'Check this to send a CSV file '
                      u'attachment containing the values '
                      u'filled out in the form.'),
        default=False,
        required=False,
    )

    fieldset(u'template',
             label=PMF('Template'),
             fields=['body_pt', 'body_type'])
    directives.write_permission(body_pt=config.EDIT_TALES_PERMISSION)
    directives.read_permission(body_pt=MODIFY_PORTAL_CONTENT)
    body_pt = zope.schema.Text(
        title=_(u'label_formmailer_body_pt', default=u'Mail-Body Template'),
        description=_(
            u'help_formmailer_body_pt',
            default=u'This is a Zope Page Template used for rendering of '
            u'the mail-body. You don\'t need to modify it, but if you '
            u'know TAL (Zope\'s Template Attribute Language) have '
            u'the full power to customize your outgoing mails.'),
        defaultFactory=default_mail_body,
        missing_value=u'',
    )

    directives.write_permission(body_type=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(body_type=MODIFY_PORTAL_CONTENT)
    body_type = zope.schema.Choice(
        title=_(u'label_formmailer_body_type', default=u'Mail Format'),
        description=_(
            u'help_formmailer_body_type',
            default=u'Set the mime-type of the mail-body. Change this '
            u'setting only if you know exactly what you are doing. '
            u'Leave it blank for default behaviour.'),
        default=u'html',
        vocabulary='easyform.MimeList',
    )
    fieldset(u'headers',
             label=_('Headers'),
             fields=['xinfo_headers', 'additional_headers'])
    directives.widget(xinfo_headers=CheckBoxFieldWidget)
    directives.write_permission(xinfo_headers=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(xinfo_headers=MODIFY_PORTAL_CONTENT)
    xinfo_headers = zope.schema.List(
        title=_(u'label_xinfo_headers_text', default=u'HTTP Headers'),
        description=_(u'help_xinfo_headers_text',
                      default=u''
                      u'Pick any items from the HTTP headers that '
                      u'you\'d like to insert as X- headers in the message.'),
        unique=True,
        required=False,
        default=[u'HTTP_X_FORWARDED_FOR', u'REMOTE_ADDR', u'PATH_INFO'],
        missing_value=[u'HTTP_X_FORWARDED_FOR', u'REMOTE_ADDR', u'PATH_INFO'],
        value_type=zope.schema.Choice(vocabulary='easyform.XinfoHeaders'),
    )
    directives.write_permission(
        additional_headers=config.EDIT_ADVANCED_PERMISSION)
    directives.read_permission(additional_headers=MODIFY_PORTAL_CONTENT)
    additional_headers = zope.schema.List(
        title=_(u'label_formmailer_additional_headers',
                default=u'Additional Headers'),
        description=_(u'help_formmailer_additional_headers',
                      default=u'Additional e-mail-header lines. Only use '
                      u'RFC822-compliant headers.'),
        unique=True,
        required=False,
        value_type=zope.schema.TextLine(title=_(u'extra_header',
                                                default=u'${name} Header',
                                                mapping={u'name': u'HTTP'}), ),
    )

    fieldset(u'overrides',
             label=_('Overrides'),
             fields=[
                 'subjectOverride', 'senderOverride', 'recipientOverride',
                 'ccOverride', 'bccOverride'
             ])

    directives.write_permission(subjectOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(subjectOverride=MODIFY_PORTAL_CONTENT)
    subjectOverride = zope.schema.TextLine(
        title=_(u'label_subject_override_text', default=u'Subject Expression'),
        description=_(
            u'help_subject_override_text',
            default=u'A TALES expression that will be evaluated to override '
            u'any value otherwise entered for the e-mail subject '
            u'header. Leave empty if unneeded. Your expression '
            u'should evaluate as a string. PLEASE NOTE: errors in '
            u'the evaluation of this expression will cause an error '
            u'on form display.'),
        required=False,
        default=u'',
        missing_value=u'',
        constraint=isTALES,
    )

    directives.write_permission(senderOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(senderOverride=MODIFY_PORTAL_CONTENT)
    senderOverride = zope.schema.TextLine(
        title=_(u'label_sender_override_text', default=u'Sender Expression'),
        description=_(
            u'help_sender_override_text',
            default=u'A TALES expression that will be evaluated to override '
            u'the "From" header. Leave empty if unneeded. '
            u'Your expression should evaluate as a string. '
            u'PLEASE NOTE: errors in the evaluation of this '
            u'expression will cause an error on form display.'),
        required=False,
        default=u'',
        missing_value=u'',
        constraint=isTALES,
    )

    directives.write_permission(recipientOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(recipientOverride=MODIFY_PORTAL_CONTENT)
    recipientOverride = zope.schema.TextLine(
        title=_(u'label_recipient_override_text',
                default=u'Recipient Expression'),
        description=_(
            u'help_recipient_override_text',
            default=u'A TALES expression that will be evaluated to override '
            u'any value otherwise entered for the recipient '
            u'e-mail address. You are strongly cautioned against using'
            u'unvalidated data from the request for this purpose. '
            u'Leave empty if unneeded. Your expression should '
            u'evaluate as a string. PLEASE NOTE: errors in the '
            u'evaluation of this expression will cause '
            u'an error on form display.'),
        required=False,
        default=u'',
        missing_value=u'',
        constraint=isTALES,
    )

    directives.write_permission(ccOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(ccOverride=MODIFY_PORTAL_CONTENT)
    ccOverride = zope.schema.TextLine(
        title=_(u'label_cc_override_text', default=u'CC Expression'),
        description=_(
            u'help_cc_override_text',
            default=u'A TALES expression that will be evaluated to override '
            u'any value otherwise entered for the CC list. You are '
            u'strongly cautioned against using unvalidated data from '
            u'the request for this purpose. Leave empty if unneeded. '
            u'Your expression should evaluate as a sequence of '
            u'strings. PLEASE NOTE: errors in the evaluation of this '
            u'expression will cause an error on form display.'),
        required=False,
        default=u'',
        missing_value=u'',
        constraint=isTALES,
    )

    directives.write_permission(bccOverride=config.EDIT_TALES_PERMISSION)
    directives.read_permission(bccOverride=MODIFY_PORTAL_CONTENT)
    bccOverride = zope.schema.TextLine(
        title=_(u'label_bcc_override_text', default=u'BCC Expression'),
        description=_(
            u'help_bcc_override_text',
            default=u'A TALES expression that will be evaluated to override '
            u'any value otherwise entered for the BCC list. '
            u'You are strongly cautioned against using '
            u'unvalidated data from the request for this purpose. '
            u'Leave empty if unneeded. Your expression should '
            u'evaluate as a sequence of strings. PLEASE NOTE: errors '
            u'in the evaluation of this expression will cause '
            u'an error on form display.'),
        required=False,
        default=u'',
        missing_value=u'',
        constraint=isTALES,
    )
示例#28
0
class IOrgangovern(form.Schema):
    """ Organ de Govern
    """

    fieldset('organ',
             label=_(u'Tab organ'),
             fields=[
                 'title', 'acronim', 'descripcioOrgan', 'fromMail',
                 'organType', 'logoOrgan', 'visiblefields', 'eventsColor',
                 'estatsLlista', 'FAQmembres'
             ])

    fieldset(
        'assistents',
        label=_(u'Assistents'),
        fields=['membresOrgan', 'convidatsPermanentsOrgan', 'adrecaLlista'])

    fieldset(
        'afectats',
        label=_(u'Afectats'),
        fields=['adrecaAfectatsLlista'],
    )

    fieldset(
        'plantilles',
        label=_(u'Plantilles'),
        fields=['bodyMailconvoquing', 'bodyMailSend', 'footerMail', 'footer'],
    )

    dexterity.write_permission(title='genweb.webmaster')
    dexteritytextindexer.searchable('title')
    title = schema.TextLine(title=_(u'Organ Title'), required=True)

    dexterity.write_permission(acronim='genweb.webmaster')
    dexteritytextindexer.searchable('acronim')
    acronim = schema.TextLine(title=_(u'Acronym'),
                              description=_(u"Acronym Description"),
                              required=True)

    dexteritytextindexer.searchable('descripcioOrgan')
    directives.widget(descripcioOrgan=WysiwygFieldWidget)
    descripcioOrgan = schema.Text(
        title=_(u"Organ Govern description"),
        description=_(u"Organ Govern description help"),
        required=False,
    )

    dexterity.write_permission(organType='genweb.webmaster')
    organType = schema.Choice(
        title=_(u"Organ Govern type"),
        vocabulary=types,
        default=_(u'open_organ'),
        required=True,
    )

    directives.widget(membresOrgan=WysiwygFieldWidget)
    membresOrgan = schema.Text(
        title=_(u"Organ Govern members"),
        description=_(u"Organ Govern members Description"),
        required=False,
    )

    directives.widget(convidatsPermanentsOrgan=WysiwygFieldWidget)
    convidatsPermanentsOrgan = schema.Text(
        title=_(u"Invited members"),
        description=_(u"Organ permanently invited people description."),
        required=False,
    )

    fromMail = schema.TextLine(
        title=_(u'From mail'),
        description=_(u'Enter the from used in the mail form'),
        required=True,
        constraint=checkEmailAddress)

    adrecaLlista = schema.Text(
        title=_(u"mail address"),
        description=_(u"Mail address help"),
        required=True,
    )

    adrecaAfectatsLlista = schema.Text(
        title=_(u"Stakeholders mail address"),
        description=_(u"Stakeholders mail address help."),
        required=False,
    )

    logoOrgan = NamedBlobImage(
        title=_(u"Organ logo"),
        description=_(u'Logo description'),
        required=False,
    )

    eventsColor = schema.TextLine(
        title=_(u"Color del esdeveniments"),
        description=_(u"Events color help"),
        required=False,
    )

    dexterity.write_permission(estatsLlista='genweb.webmaster')
    directives.widget(estatsLlista=WysiwygFieldWidget)
    estatsLlista = schema.Text(
        title=_(u"Agreement and document labels"),
        description=_(u"Enter labels, separated by commas."),
        default=defaultEstats,
        required=False,
    )

    directives.widget(bodyMailconvoquing=WysiwygFieldWidget)
    bodyMailconvoquing = schema.Text(
        title=_(u"Body Mail"),
        description=_(u"Body Mail convoquing description"),
        required=False,
    )

    directives.widget(bodyMailSend=WysiwygFieldWidget)
    bodyMailSend = schema.Text(
        title=_(u"Body Mail send"),
        description=_(u"Body Mail send description"),
        required=False,
    )

    directives.widget(footerMail=WysiwygFieldWidget)
    footerMail = schema.Text(
        title=_(u"footerMail"),
        description=_(u"footerMail description"),
        required=False,
    )

    directives.widget(footer=WysiwygFieldWidget)
    dexteritytextindexer.searchable('footer')
    footer = schema.Text(
        title=_(u"Footer"),
        description=_(u"Footer help"),
        required=False,
    )

    directives.read_permission(visiblefields='genweb.organs.add.organs')
    directives.write_permission(visiblefields='genweb.organs.add.organs')
    visiblefields = schema.Bool(
        title=_(u"Visible fields"),
        description=
        _(u"Make the sessions and composition members fields visibles to everyone, omitting the security systems."
          ),
        required=False,
    )

    FAQmembres = RichTextField(
        title=_(u"FAQ membres"),
        description=_(u'Preguntes freqüents de membres'),
        required=False,
    )
示例#29
0
class IDocumentMetadata(model.Schema):
    """Schema behavior for common GEVER document metadata
    """

    model.fieldset(
        u'common',
        label=_(u'fieldset_common', u'Common'),
        fields=[
            u'description',
            u'keywords',
            u'foreign_reference',
            u'document_date',
            u'receipt_date',
            u'delivery_date',
            u'document_type',
            u'document_author',
            u'digitally_available',
            u'preserved_as_paper',
            u'thumbnail',
            u'preview',
        ],
    )

    model.fieldset(u'archive_file',
                   label=_(u'fieldset_archive_file', u'Archive file'),
                   fields=[u'archival_file'])

    dexteritytextindexer.searchable('description')
    description = schema.Text(
        title=_(u'label_description', default=u'Description'),
        required=False,
        missing_value=u'',
    )

    form.widget('keywords', KeywordFieldWidget, new_terms_as_unicode=True)
    keywords = schema.Tuple(
        title=_(u'label_keywords', default=u'Keywords'),
        description=_(u'help_keywords', default=u''),
        value_type=ChoicePlus(vocabulary='plone.app.vocabularies.Keywords'),
        required=False,
        missing_value=(),
        default=(),
    )

    foreign_reference = schema.TextLine(
        title=_(u'label_foreign_reference', default='Foreign Reference'),
        description=_('help_foreign_reference', default=''),
        required=False,
    )

    # workaround because ftw.datepicker wasn't working
    form.widget(document_date=DatePickerFieldWidget)
    document_date = schema.Date(
        title=_(u'label_document_date', default='Document Date'),
        description=_(u'help_document_date', default=''),
        required=False,
        defaultFactory=document_date_default,
    )

    # workaround because ftw.datepicker wasn't working
    form.widget(receipt_date=DatePickerFieldWidget)
    receipt_date = schema.Date(
        title=_(u'label_receipt_date', default='Date of receipt'),
        description=_(u'help_receipt_date', default=''),
        required=False,
    )

    # workaround because ftw.datepicker wasn't working
    form.widget(delivery_date=DatePickerFieldWidget)
    delivery_date = schema.Date(
        title=_(u'label_delivery_date', default='Date of delivery'),
        description=_(u'help_delivery_date', default=''),
        required=False,
    )

    document_type = schema.Choice(
        title=_(u'label_document_type', default='Document Type'),
        source=wrap_vocabulary(
            'opengever.document.document_types',
            visible_terms_from_registry='opengever.document' +
            '.interfaces.IDocumentType.document_types'),
        required=False,
    )

    dexteritytextindexer.searchable('document_author')
    document_author = schema.TextLine(
        title=_(u'label_author', default='Author'),
        description=_(u'help_author',
                      default="Surname firstname or a userid"
                      "(would be automatically resolved to fullname)"),
        required=False,
    )

    form.mode(digitally_available='hidden')
    digitally_available = schema.Bool(
        title=_(u'label_digitally_available', default='Digital Available'),
        required=False,
    )

    form.widget(preserved_as_paper=checkbox.SingleCheckBoxFieldWidget)
    preserved_as_paper = schema.Bool(
        title=_(u'label_preserved_as_paper', default='Preserved as paper'),
        description=_(u'help_preserved_as_paper', default=''),
        required=False,
        defaultFactory=preserved_as_paper_default,
    )

    form.read_permission(archival_file='opengever.document.ModifyArchivalFile')
    form.write_permission(
        archival_file='opengever.document.ModifyArchivalFile')
    archival_file = NamedBlobFile(
        title=_(u'label_archival_file', default='Archival File'),
        description=_(u'help_archival_file', default=''),
        required=False,
    )

    form.omitted('archival_file_state')
    archival_file_state = schema.Int(
        title=_(u'label_archival_file_state', default='Archival file state'),
        required=False,
    )

    form.omitted('thumbnail')
    thumbnail = NamedBlobFile(
        title=_(u'label_thumbnail', default='Thumbnail'),
        required=False,
    )

    form.omitted('preview')
    preview = NamedBlobFile(
        title=_(u'label_preview', default='Preview'),
        description=_(u'help_preview', default=''),
        required=False,
    )
示例#30
0
class IFoundationMember(Schema):
    """A foundation member"""

    fieldset('Contact',
             label=u'Contact',
             fields=[
                 'fname',
                 'lname',
                 'email',
                 'address',
                 'city',
                 'state',
                 'postalCode',
                 'country',
                 'organization',
             ])

    fieldset('Merit', label=u'Merit', fields=[
        'merit',
    ])

    fieldset('Survey', label=u'Survey', fields=[
        'orgsize',
        'ploneuse',
    ])

    fname = schema.TextLine(title=_PMF(u'First name', default=u'First name'),
                            required=True)

    lname = schema.TextLine(title=_PMF(u'Last name', default=u'Last name'),
                            required=True)

    read_permission(email='ploneorg.core.foundationmember.view')
    email = schema.TextLine(title=_PMF(u'Email', default=u'Email'),
                            required=True)

    read_permission(address='ploneorg.core.foundationmember.view')
    address = schema.TextLine(title=_PMF(u'Address', default=u'Address'),
                              required=True)

    city = schema.TextLine(title=_PMF(u'City', default=u'City'), required=True)

    read_permission(state='ploneorg.core.foundationmember.view')
    state = schema.TextLine(title=_PMF(u'State', default=u'State'),
                            required=True)

    read_permission(postalCode='ploneorg.core.foundationmember.view')
    postalCode = schema.TextLine(title=_PMF(u'Postal code',
                                            default=u'Postal code'),
                                 required=True)

    country = schema.Choice(title=_PMF(u'Country', default=u'Country'),
                            vocabulary=country_vocabulary,
                            required=True)

    organization = schema.TextLine(title=_PMF(u'Organization',
                                              default=u'Organization'),
                                   required=True)

    read_permission(merit='ploneorg.core.foundationmember.view')
    merit = RichText(
        title=_(u'Contributions'),
        description=_(u'Describe your contributions to the project.'),
        required=True)

    read_permission(orgsize='ploneorg.core.foundationmember.view')
    orgsize = schema.Int(
        title=_(u'Organization size'),
        description=_(
            u'Number of people in your organization. It\'s fine to estimate.'),
        required=False)

    read_permission(ploneuse='ploneorg.core.foundationmember.view')
    ploneuse = RichText(
        title=_(u'Plone use'),
        description=_(u'How is Plone used by your organization?'),
        required=False)