Esempio n. 1
0
class ICreateDocumentFromTemplate(model.Schema):

    template = TableChoice(title=_(u"label_template", default=u"Template"),
                           source=get_templates,
                           required=True,
                           show_filter=True,
                           columns=({
                               'column':
                               'title',
                               'column_title':
                               _(u'label_title', default=u'Title'),
                               'sort_index':
                               'sortable_title',
                               'transform':
                               document_with_icon
                           }, {
                               'column':
                               'Creator',
                               'column_title':
                               _(u'label_creator', default=u'Creator'),
                               'sort_index':
                               'document_author'
                           }, {
                               'column':
                               'modified',
                               'column_title':
                               _(u'label_modified', default=u'Modified'),
                               'transform':
                               helper.readable_date
                           }))

    title = schema.TextLine(title=_(u"label_title", default=u"Title"),
                            required=True)

    form.widget('recipient', KeywordFieldWidget, async=True)
    recipient = schema.Choice(
        title=_(u'label_recipient', default=u'Recipient'),
        source=ContactsSourceBinder(),
        required=False,
    )

    form.widget(edit_after_creation=SingleCheckBoxFieldWidget)
    edit_after_creation = schema.Bool(
        title=_(u'label_edit_after_creation', default='Edit after creation'),
        default=True,
        required=False,
    )
Esempio n. 2
0
class IParticipation(model.Schema):
    """ Participation Form schema
    """

    contact = schema.Choice(
        title=_(u'label_contact', default=u'Contact'),
        source=ContactsSourceBinder(),
        required=True,
    )

    roles = schema.List(
        title=_(u'label_roles', default=u'Roles'),
        value_type=schema.Choice(source=wrap_vocabulary(
            'opengever.dossier.participation_roles',
            visible_terms_from_registry='opengever.dossier'
            '.interfaces.IDossierParticipants.roles'), ),
        required=True,
        missing_value=[],
    )
Esempio n. 3
0
class IManualJournalEntry(model.Schema):
    """Provide a z3c.form.Schema to enter a manual journal entry."""

    category = schema.Choice(
        title=_(u'label_category', default=u'Category'),
        vocabulary='opengever.journal.manual_entry_categories',
        required=True,
    )

    comment = schema.Text(
        title=_(u'label_comment', default=u'Comment'),
        required=False,
    )

    contacts = schema.List(
        title=_(u'label_contacts', default=u'Contacts'),
        value_type=schema.Choice(
            source=ContactsSourceBinder()),
        required=False,
    )

    related_documents = RelationList(
        title=_(u'label_related_documents', default=u'Related Documents'),
        default=[],
        missing_value=[],
        value_type=RelationChoice(
            title=u"Related",
            source=DossierPathSourceBinder(
                portal_type=("opengever.document.document", "ftw.mail.mail"),
                navigation_tree_query={
                    'object_provides':
                    ['opengever.dossier.behaviors.dossier.IDossierMarker',
                     'opengever.document.document.IDocumentSchema',
                     'opengever.task.task.ITask',
                     'ftw.mail.mail.IMail']
                }),
            ),
        required=False,
    )